@syncfusion/ej2-richtexteditor 25.1.38 → 25.1.39
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 +22 -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 +1926 -1773
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +1987 -1835
- 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 +9 -9
- package/src/editor-manager/plugin/indents.js +1 -1
- package/src/editor-manager/plugin/inserthtml.js +8 -2
- package/src/editor-manager/plugin/link.js +4 -2
- package/src/editor-manager/plugin/lists.js +38 -14
- package/src/editor-manager/plugin/nodecutter.js +3 -0
- package/src/editor-manager/plugin/selection-commands.d.ts +1 -0
- package/src/editor-manager/plugin/selection-commands.js +84 -2
- package/src/editor-manager/plugin/table.d.ts +4 -0
- package/src/editor-manager/plugin/table.js +62 -19
- package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +1 -0
- package/src/rich-text-editor/actions/base-quick-toolbar.js +9 -13
- package/src/rich-text-editor/actions/base-toolbar.js +3 -2
- package/src/rich-text-editor/actions/dropdown-buttons.d.ts +1 -0
- package/src/rich-text-editor/actions/dropdown-buttons.js +8 -23
- package/src/rich-text-editor/actions/emoji-picker.js +1 -1
- package/src/rich-text-editor/actions/enter-key.js +4 -1
- package/src/rich-text-editor/actions/format-painter.js +4 -1
- package/src/rich-text-editor/actions/html-editor.js +9 -4
- package/src/rich-text-editor/actions/quick-toolbar.d.ts +2 -0
- package/src/rich-text-editor/actions/quick-toolbar.js +14 -4
- package/src/rich-text-editor/base/rich-text-editor.js +4 -18
- package/src/rich-text-editor/base/util.d.ts +0 -4
- package/src/rich-text-editor/base/util.js +1 -35
- package/src/rich-text-editor/formatter/formatter.js +2 -1
- package/src/rich-text-editor/renderer/audio-module.js +9 -4
- package/src/rich-text-editor/renderer/image-module.js +4 -1
- package/src/rich-text-editor/renderer/table-module.js +15 -5
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +0 -1
- package/src/rich-text-editor/renderer/toolbar-renderer.js +27 -23
- package/src/rich-text-editor/renderer/video-module.js +29 -15
- package/styles/bootstrap-dark.css +11 -0
- package/styles/bootstrap.css +11 -0
- package/styles/bootstrap4.css +11 -0
- package/styles/bootstrap5-dark.css +11 -0
- package/styles/bootstrap5.css +11 -0
- package/styles/fabric-dark.css +11 -0
- package/styles/fabric.css +11 -0
- package/styles/fluent-dark.css +11 -0
- package/styles/fluent.css +11 -0
- package/styles/highcontrast-light.css +11 -0
- package/styles/highcontrast.css +11 -0
- package/styles/material-dark.css +11 -0
- package/styles/material.css +11 -0
- package/styles/material3-dark.css +11 -0
- package/styles/material3.css +11 -0
- package/styles/rich-text-editor/_bds-definition.scss +6 -0
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +6 -0
- package/styles/rich-text-editor/_bootstrap-definition.scss +6 -0
- package/styles/rich-text-editor/_bootstrap4-definition.scss +6 -0
- package/styles/rich-text-editor/_bootstrap5-definition.scss +6 -0
- package/styles/rich-text-editor/_fabric-dark-definition.scss +6 -0
- package/styles/rich-text-editor/_fabric-definition.scss +6 -0
- package/styles/rich-text-editor/_fluent-definition.scss +6 -0
- package/styles/rich-text-editor/_fusionnew-definition.scss +6 -0
- package/styles/rich-text-editor/_highcontrast-definition.scss +6 -0
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +6 -0
- package/styles/rich-text-editor/_layout.scss +10 -0
- package/styles/rich-text-editor/_material-dark-definition.scss +6 -0
- package/styles/rich-text-editor/_material-definition.scss +6 -0
- package/styles/rich-text-editor/_material3-definition.scss +6 -0
- package/styles/rich-text-editor/_tailwind-definition.scss +6 -0
- package/styles/rich-text-editor/bootstrap-dark.css +11 -0
- package/styles/rich-text-editor/bootstrap.css +11 -0
- package/styles/rich-text-editor/bootstrap4.css +11 -0
- package/styles/rich-text-editor/bootstrap5-dark.css +11 -0
- package/styles/rich-text-editor/bootstrap5.css +11 -0
- package/styles/rich-text-editor/fabric-dark.css +11 -0
- package/styles/rich-text-editor/fabric.css +11 -0
- package/styles/rich-text-editor/fluent-dark.css +11 -0
- package/styles/rich-text-editor/fluent.css +11 -0
- package/styles/rich-text-editor/highcontrast-light.css +11 -0
- package/styles/rich-text-editor/highcontrast.css +11 -0
- package/styles/rich-text-editor/material-dark.css +11 -0
- package/styles/rich-text-editor/material.css +11 -0
- package/styles/rich-text-editor/material3-dark.css +11 -0
- package/styles/rich-text-editor/material3.css +11 -0
- package/styles/rich-text-editor/tailwind-dark.css +11 -0
- package/styles/rich-text-editor/tailwind.css +11 -0
- package/styles/tailwind-dark.css +11 -0
- package/styles/tailwind.css +11 -0
|
@@ -3082,40 +3082,6 @@ function getTooltipText(item, serviceLocator) {
|
|
|
3082
3082
|
var tooltipText = i10n.getConstant(itemLocale);
|
|
3083
3083
|
return tooltipText;
|
|
3084
3084
|
}
|
|
3085
|
-
function getTooltipTextDropdownItems(item, serviceLocator, localeItems, rteObj) {
|
|
3086
|
-
if (localeItems) {
|
|
3087
|
-
var i10n = serviceLocator.getService('rteLocale');
|
|
3088
|
-
for (var i = 0; i < localeItems.length; i++) {
|
|
3089
|
-
var itemLocale = localeItems[i].value.toLocaleLowerCase();
|
|
3090
|
-
var numberValue = localeItems[i].locale;
|
|
3091
|
-
var numberLocale = defaultLocale["" + numberValue].toLocaleLowerCase();
|
|
3092
|
-
if (item === itemLocale || item === numberLocale) {
|
|
3093
|
-
var tooltipText = localeItems[i].locale;
|
|
3094
|
-
return i10n.getConstant(tooltipText);
|
|
3095
|
-
}
|
|
3096
|
-
}
|
|
3097
|
-
}
|
|
3098
|
-
else {
|
|
3099
|
-
var fontsize = rteObj.fontSize.items;
|
|
3100
|
-
for (var i = 0; i < fontsize.length; i++) {
|
|
3101
|
-
if (item === rteObj.fontSize.items[i].value) {
|
|
3102
|
-
var fontSize$$1 = rteObj.fontSize.items[i].text;
|
|
3103
|
-
return fontSize$$1;
|
|
3104
|
-
}
|
|
3105
|
-
}
|
|
3106
|
-
}
|
|
3107
|
-
return '';
|
|
3108
|
-
}
|
|
3109
|
-
function getQuickToolbarTooltipText(item) {
|
|
3110
|
-
var keys = Object.keys(defaultLocale);
|
|
3111
|
-
for (var i = 0; i < keys.length; i++) {
|
|
3112
|
-
var tooltipText = defaultLocale["" + keys[i]];
|
|
3113
|
-
if (item === tooltipText) {
|
|
3114
|
-
return tooltipText;
|
|
3115
|
-
}
|
|
3116
|
-
}
|
|
3117
|
-
return '';
|
|
3118
|
-
}
|
|
3119
3085
|
/**
|
|
3120
3086
|
* @param {ISetToolbarStatusArgs} e - specifies the e element
|
|
3121
3087
|
* @param {boolean} isPopToolbar - specifies the boolean value
|
|
@@ -3587,86 +3553,1476 @@ function updateDropDownFontFormatLocale(self) {
|
|
|
3587
3553
|
}
|
|
3588
3554
|
|
|
3589
3555
|
/**
|
|
3590
|
-
*
|
|
3556
|
+
* Is formatted or not.
|
|
3591
3557
|
*
|
|
3592
3558
|
* @hidden
|
|
3593
3559
|
* @deprecated
|
|
3594
3560
|
*/
|
|
3595
|
-
var
|
|
3561
|
+
var IsFormatted = /** @__PURE__ @class */ (function () {
|
|
3562
|
+
function IsFormatted() {
|
|
3563
|
+
}
|
|
3596
3564
|
/**
|
|
3597
|
-
*
|
|
3565
|
+
* getFormattedNode method
|
|
3598
3566
|
*
|
|
3599
|
-
* @param {
|
|
3600
|
-
* @param {
|
|
3567
|
+
* @param {Node} node - specifies the node.
|
|
3568
|
+
* @param {string} format - specifies the string value.
|
|
3569
|
+
* @param {Node} endNode - specifies the end node
|
|
3570
|
+
* @returns {Node} - returns the node
|
|
3571
|
+
* @hidden
|
|
3572
|
+
* @deprecated
|
|
3601
3573
|
*/
|
|
3602
|
-
function
|
|
3603
|
-
this.
|
|
3604
|
-
if (
|
|
3605
|
-
|
|
3574
|
+
IsFormatted.prototype.getFormattedNode = function (node, format, endNode) {
|
|
3575
|
+
var parentNode = this.getFormatParent(node, format, endNode);
|
|
3576
|
+
if (parentNode !== null && parentNode !== endNode) {
|
|
3577
|
+
return parentNode;
|
|
3606
3578
|
}
|
|
3607
|
-
|
|
3608
|
-
}
|
|
3609
|
-
ToolbarRenderer.prototype.wireEvent = function () {
|
|
3610
|
-
this.parent.on(destroy, this.unWireEvent, this);
|
|
3611
|
-
this.parent.on(destroyTooltip, this.destroyTooltip, this);
|
|
3612
|
-
this.parent.on(closeTooltip, this.closeTooltip, this);
|
|
3579
|
+
return null;
|
|
3613
3580
|
};
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3581
|
+
IsFormatted.prototype.getFormatParent = function (node, format, endNode) {
|
|
3582
|
+
do {
|
|
3583
|
+
node = node.parentNode;
|
|
3584
|
+
} while (node && (node !== endNode) && !this.isFormattedNode(node, format));
|
|
3585
|
+
return node;
|
|
3586
|
+
};
|
|
3587
|
+
IsFormatted.prototype.isFormattedNode = function (node, format) {
|
|
3588
|
+
switch (format) {
|
|
3589
|
+
case 'bold':
|
|
3590
|
+
return IsFormatted.isBold(node);
|
|
3591
|
+
case 'italic':
|
|
3592
|
+
return IsFormatted.isItalic(node);
|
|
3593
|
+
case 'underline':
|
|
3594
|
+
return IsFormatted.isUnderline(node);
|
|
3595
|
+
case 'strikethrough':
|
|
3596
|
+
return IsFormatted.isStrikethrough(node);
|
|
3597
|
+
case 'superscript':
|
|
3598
|
+
return IsFormatted.isSuperscript(node);
|
|
3599
|
+
case 'subscript':
|
|
3600
|
+
return IsFormatted.isSubscript(node);
|
|
3601
|
+
case 'fontcolor':
|
|
3602
|
+
return this.isFontColor(node);
|
|
3603
|
+
case 'fontname':
|
|
3604
|
+
return this.isFontName(node);
|
|
3605
|
+
case 'fontsize':
|
|
3606
|
+
return this.isFontSize(node);
|
|
3607
|
+
case 'backgroundcolor':
|
|
3608
|
+
return this.isBackgroundColor(node);
|
|
3609
|
+
default:
|
|
3610
|
+
return false;
|
|
3621
3611
|
}
|
|
3622
3612
|
};
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3613
|
+
/**
|
|
3614
|
+
* isBold method
|
|
3615
|
+
*
|
|
3616
|
+
* @param {Node} node - specifies the node value
|
|
3617
|
+
* @returns {boolean} - returns the boolean value
|
|
3618
|
+
* @hidden
|
|
3619
|
+
* @deprecated
|
|
3620
|
+
*/
|
|
3621
|
+
IsFormatted.isBold = function (node) {
|
|
3622
|
+
var validTags = ['strong', 'b'];
|
|
3623
|
+
if (validTags.indexOf(node.nodeName.toLowerCase()) !== -1) {
|
|
3624
|
+
return true;
|
|
3625
|
+
}
|
|
3626
|
+
else if (this.inlineTags.indexOf(node.nodeName.toLowerCase()) !== -1 &&
|
|
3627
|
+
node.style && node.style.fontWeight === 'bold') {
|
|
3628
|
+
return true;
|
|
3629
|
+
}
|
|
3630
|
+
else {
|
|
3631
|
+
return false;
|
|
3632
|
+
}
|
|
3627
3633
|
};
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3634
|
+
/**
|
|
3635
|
+
* isItalic method
|
|
3636
|
+
*
|
|
3637
|
+
* @param {Node} node - specifies the node value
|
|
3638
|
+
* @returns {boolean} - returns the boolean value
|
|
3639
|
+
* @hidden
|
|
3640
|
+
* @deprecated
|
|
3641
|
+
*/
|
|
3642
|
+
IsFormatted.isItalic = function (node) {
|
|
3643
|
+
var validTags = ['em', 'i'];
|
|
3644
|
+
if (validTags.indexOf(node.nodeName.toLowerCase()) !== -1) {
|
|
3645
|
+
return true;
|
|
3646
|
+
}
|
|
3647
|
+
else if (this.inlineTags.indexOf(node.nodeName.toLowerCase()) !== -1 &&
|
|
3648
|
+
node.style && node.style.fontStyle === 'italic') {
|
|
3649
|
+
return true;
|
|
3650
|
+
}
|
|
3651
|
+
else {
|
|
3652
|
+
return false;
|
|
3631
3653
|
}
|
|
3632
3654
|
};
|
|
3633
|
-
|
|
3634
|
-
|
|
3655
|
+
/**
|
|
3656
|
+
* isUnderline method
|
|
3657
|
+
*
|
|
3658
|
+
* @param {Node} node - specifies the node value
|
|
3659
|
+
* @returns {boolean} - returns the boolean value
|
|
3660
|
+
* @hidden
|
|
3661
|
+
* @deprecated
|
|
3662
|
+
*/
|
|
3663
|
+
IsFormatted.isUnderline = function (node) {
|
|
3664
|
+
var validTags = ['u'];
|
|
3665
|
+
if (validTags.indexOf(node.nodeName.toLowerCase()) !== -1) {
|
|
3666
|
+
return true;
|
|
3667
|
+
/* eslint-disable */
|
|
3668
|
+
}
|
|
3669
|
+
else if (this.inlineTags.indexOf(node.nodeName.toLowerCase()) !== -1 &&
|
|
3670
|
+
node.style && (node.style.textDecoration === 'underline' ||
|
|
3671
|
+
node.style.textDecorationLine === 'underline')) {
|
|
3672
|
+
/* eslint-enable */
|
|
3673
|
+
return true;
|
|
3674
|
+
}
|
|
3675
|
+
else {
|
|
3676
|
+
return false;
|
|
3677
|
+
}
|
|
3635
3678
|
};
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3679
|
+
/**
|
|
3680
|
+
* isStrikethrough method
|
|
3681
|
+
*
|
|
3682
|
+
* @param {Node} node - specifies the node value
|
|
3683
|
+
* @returns {boolean} - returns the boolean value
|
|
3684
|
+
* @hidden
|
|
3685
|
+
* @deprecated
|
|
3686
|
+
*/
|
|
3687
|
+
IsFormatted.isStrikethrough = function (node) {
|
|
3688
|
+
var validTags = ['del', 'strike'];
|
|
3689
|
+
if (validTags.indexOf(node.nodeName.toLowerCase()) !== -1) {
|
|
3690
|
+
return true;
|
|
3691
|
+
/* eslint-disable */
|
|
3639
3692
|
}
|
|
3640
|
-
this.
|
|
3641
|
-
|
|
3642
|
-
|
|
3693
|
+
else if (this.inlineTags.indexOf(node.nodeName.toLowerCase()) !== -1 &&
|
|
3694
|
+
node.style && (node.style.textDecoration === 'line-through' ||
|
|
3695
|
+
node.style.textDecorationLine === 'line-through')) {
|
|
3696
|
+
/* eslint-enable */
|
|
3697
|
+
return true;
|
|
3698
|
+
}
|
|
3699
|
+
else {
|
|
3700
|
+
return false;
|
|
3643
3701
|
}
|
|
3644
3702
|
};
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3703
|
+
/**
|
|
3704
|
+
* isSuperscript method
|
|
3705
|
+
*
|
|
3706
|
+
* @param {Node} node - specifies the node value
|
|
3707
|
+
* @returns {boolean} - returns the boolean value
|
|
3708
|
+
* @hidden
|
|
3709
|
+
* @deprecated
|
|
3710
|
+
*/
|
|
3711
|
+
IsFormatted.isSuperscript = function (node) {
|
|
3712
|
+
var validTags = ['sup'];
|
|
3713
|
+
if (validTags.indexOf(node.nodeName.toLowerCase()) !== -1) {
|
|
3714
|
+
return true;
|
|
3715
|
+
}
|
|
3716
|
+
else {
|
|
3717
|
+
return false;
|
|
3718
|
+
}
|
|
3648
3719
|
};
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3720
|
+
/**
|
|
3721
|
+
* isSubscript method
|
|
3722
|
+
*
|
|
3723
|
+
* @param {Node} node - specifies the node value
|
|
3724
|
+
* @returns {boolean} - returns the boolean value
|
|
3725
|
+
* @hidden
|
|
3726
|
+
* @deprecated
|
|
3727
|
+
*/
|
|
3728
|
+
IsFormatted.isSubscript = function (node) {
|
|
3729
|
+
var validTags = ['sub'];
|
|
3730
|
+
if (validTags.indexOf(node.nodeName.toLowerCase()) !== -1) {
|
|
3731
|
+
return true;
|
|
3732
|
+
}
|
|
3733
|
+
else {
|
|
3734
|
+
return false;
|
|
3652
3735
|
}
|
|
3653
|
-
this.parent.notify(beforeDropDownItemRender, args);
|
|
3654
3736
|
};
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3737
|
+
IsFormatted.prototype.isFontColor = function (node) {
|
|
3738
|
+
var color = node.style && node.style.color;
|
|
3739
|
+
if (IsFormatted.inlineTags.indexOf(node.nodeName.toLowerCase()) !== -1 &&
|
|
3740
|
+
color !== null && color !== '' && color !== undefined) {
|
|
3741
|
+
return true;
|
|
3742
|
+
}
|
|
3743
|
+
else {
|
|
3744
|
+
return false;
|
|
3745
|
+
}
|
|
3746
|
+
};
|
|
3747
|
+
IsFormatted.prototype.isBackgroundColor = function (node) {
|
|
3748
|
+
var backColor = node.style && node.style.backgroundColor;
|
|
3749
|
+
if (IsFormatted.inlineTags.indexOf(node.nodeName.toLowerCase()) !== -1 &&
|
|
3750
|
+
backColor !== null && backColor !== '' && backColor !== undefined) {
|
|
3751
|
+
return true;
|
|
3752
|
+
}
|
|
3753
|
+
else {
|
|
3754
|
+
return false;
|
|
3755
|
+
}
|
|
3756
|
+
};
|
|
3757
|
+
IsFormatted.prototype.isFontSize = function (node) {
|
|
3758
|
+
var size = node.style && node.style.fontSize;
|
|
3759
|
+
if (IsFormatted.inlineTags.indexOf(node.nodeName.toLowerCase()) !== -1 &&
|
|
3760
|
+
size !== null && size !== '' && size !== undefined) {
|
|
3761
|
+
return true;
|
|
3762
|
+
}
|
|
3763
|
+
else {
|
|
3764
|
+
return false;
|
|
3765
|
+
}
|
|
3766
|
+
};
|
|
3767
|
+
IsFormatted.prototype.isFontName = function (node) {
|
|
3768
|
+
var name = node.style && node.style.fontFamily;
|
|
3769
|
+
if (IsFormatted.inlineTags.indexOf(node.nodeName.toLowerCase()) !== -1 &&
|
|
3770
|
+
name !== null && name !== '' && name !== undefined) {
|
|
3771
|
+
return true;
|
|
3772
|
+
}
|
|
3773
|
+
else {
|
|
3774
|
+
return false;
|
|
3775
|
+
}
|
|
3776
|
+
};
|
|
3777
|
+
// Get Formatted Node
|
|
3778
|
+
IsFormatted.inlineTags = [
|
|
3779
|
+
'a',
|
|
3780
|
+
'abbr',
|
|
3781
|
+
'acronym',
|
|
3782
|
+
'b',
|
|
3783
|
+
'bdo',
|
|
3784
|
+
'big',
|
|
3785
|
+
'cite',
|
|
3786
|
+
'code',
|
|
3787
|
+
'dfn',
|
|
3788
|
+
'em',
|
|
3789
|
+
'font',
|
|
3790
|
+
'i',
|
|
3791
|
+
'kbd',
|
|
3792
|
+
'label',
|
|
3793
|
+
'q',
|
|
3794
|
+
'samp',
|
|
3795
|
+
'small',
|
|
3796
|
+
'span',
|
|
3797
|
+
'strong',
|
|
3798
|
+
'sub',
|
|
3799
|
+
'sup',
|
|
3800
|
+
'tt',
|
|
3801
|
+
'u',
|
|
3802
|
+
'var',
|
|
3803
|
+
'del'
|
|
3804
|
+
];
|
|
3805
|
+
return IsFormatted;
|
|
3806
|
+
}());
|
|
3807
|
+
|
|
3808
|
+
/**
|
|
3809
|
+
* Constant values for EditorManager
|
|
3810
|
+
*/
|
|
3811
|
+
/**
|
|
3812
|
+
* Image plugin events
|
|
3813
|
+
*
|
|
3814
|
+
* @hidden
|
|
3815
|
+
*/
|
|
3816
|
+
var IMAGE = 'INSERT-IMAGE';
|
|
3817
|
+
var AUDIO = 'INSERT-AUDIO';
|
|
3818
|
+
var VIDEO = 'INSERT-VIDEO';
|
|
3819
|
+
var TABLE = 'INSERT-TABLE';
|
|
3820
|
+
var LINK = 'INSERT-LINK';
|
|
3821
|
+
var INSERT_ROW = 'INSERT-ROW';
|
|
3822
|
+
var INSERT_COLUMN = 'INSERT-COLUMN';
|
|
3823
|
+
var DELETEROW = 'DELETE-ROW';
|
|
3824
|
+
var DELETECOLUMN = 'DELETE-COLUMN';
|
|
3825
|
+
var REMOVETABLE = 'REMOVE-TABLE';
|
|
3826
|
+
var TABLEHEADER = 'TABLE-HEADER';
|
|
3827
|
+
var TABLE_VERTICAL_ALIGN = 'TABLE_VERTICAL_ALIGN';
|
|
3828
|
+
var TABLE_MERGE = 'TABLE_MERGE';
|
|
3829
|
+
var TABLE_VERTICAL_SPLIT = 'TABLE_VERTICAL_SPLIT';
|
|
3830
|
+
var TABLE_HORIZONTAL_SPLIT = 'TABLE_HORIZONTAL_SPLIT';
|
|
3831
|
+
var TABLE_MOVE = 'TABLE_MOVE';
|
|
3832
|
+
/**
|
|
3833
|
+
* Alignments plugin events
|
|
3834
|
+
*
|
|
3835
|
+
* @hidden
|
|
3836
|
+
*/
|
|
3837
|
+
var ALIGNMENT_TYPE = 'alignment-type';
|
|
3838
|
+
/**
|
|
3839
|
+
* Indents plugin events
|
|
3840
|
+
*
|
|
3841
|
+
* @hidden
|
|
3842
|
+
*/
|
|
3843
|
+
var INDENT_TYPE = 'indent-type';
|
|
3844
|
+
/**
|
|
3845
|
+
* Constant tag names
|
|
3846
|
+
*
|
|
3847
|
+
* @hidden
|
|
3848
|
+
*/
|
|
3849
|
+
var DEFAULT_TAG = 'p';
|
|
3850
|
+
/**
|
|
3851
|
+
* @hidden
|
|
3852
|
+
*/
|
|
3853
|
+
var BLOCK_TAGS = ['address', 'article', 'aside', 'audio', 'blockquote',
|
|
3854
|
+
'canvas', 'details', 'dd', 'div', 'dl', 'dt', 'fieldset', 'figcaption', 'figure', 'footer',
|
|
3855
|
+
'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hgroup', 'hr', 'li', 'main', 'nav',
|
|
3856
|
+
'noscript', 'ol', 'output', 'p', 'pre', 'section', 'table', 'tbody', 'td', 'tfoot', 'th',
|
|
3857
|
+
'thead', 'tr', 'ul', 'video', 'body'];
|
|
3858
|
+
/**
|
|
3859
|
+
* @hidden
|
|
3860
|
+
*/
|
|
3861
|
+
var IGNORE_BLOCK_TAGS = ['td', 'th'];
|
|
3862
|
+
/**
|
|
3863
|
+
* @hidden
|
|
3864
|
+
*/
|
|
3865
|
+
var TABLE_BLOCK_TAGS = ['table', 'tbody', 'td', 'tfoot', 'th',
|
|
3866
|
+
'thead', 'tr'];
|
|
3867
|
+
/**
|
|
3868
|
+
* Selection plugin events
|
|
3869
|
+
*
|
|
3870
|
+
* @hidden
|
|
3871
|
+
*/
|
|
3872
|
+
var SELECTION_TYPE = 'selection-type';
|
|
3873
|
+
/**
|
|
3874
|
+
* Insert HTML plugin events
|
|
3875
|
+
*
|
|
3876
|
+
* @hidden
|
|
3877
|
+
*/
|
|
3878
|
+
var INSERTHTML_TYPE = 'inserthtml-type';
|
|
3879
|
+
/**
|
|
3880
|
+
* Insert Text plugin events
|
|
3881
|
+
*
|
|
3882
|
+
* @hidden
|
|
3883
|
+
*/
|
|
3884
|
+
var INSERT_TEXT_TYPE = 'insert-text-type';
|
|
3885
|
+
/**
|
|
3886
|
+
* Clear Format HTML plugin events
|
|
3887
|
+
*
|
|
3888
|
+
* @hidden
|
|
3889
|
+
*/
|
|
3890
|
+
var CLEAR_TYPE = 'clear-type';
|
|
3891
|
+
/**
|
|
3892
|
+
* Self closing tags
|
|
3893
|
+
*
|
|
3894
|
+
* @hidden
|
|
3895
|
+
*/
|
|
3896
|
+
var SELF_CLOSING_TAGS = ['area', 'base', 'br', 'embed', 'hr', 'img', 'input', 'param', 'source', 'track', 'wbr', 'iframe', 'td', 'table'];
|
|
3897
|
+
/**
|
|
3898
|
+
* Source
|
|
3899
|
+
*
|
|
3900
|
+
* @hidden
|
|
3901
|
+
*/
|
|
3902
|
+
var PASTE_SOURCE = ['word', 'excel', 'onenote'];
|
|
3903
|
+
|
|
3904
|
+
/**
|
|
3905
|
+
* `Selection` module is used to handle RTE Selections.
|
|
3906
|
+
*/
|
|
3907
|
+
var NodeSelection = /** @__PURE__ @class */ (function () {
|
|
3908
|
+
function NodeSelection() {
|
|
3909
|
+
this.startNodeName = [];
|
|
3910
|
+
this.endNodeName = [];
|
|
3911
|
+
}
|
|
3912
|
+
NodeSelection.prototype.saveInstance = function (range, body) {
|
|
3913
|
+
this.range = range.cloneRange();
|
|
3914
|
+
this.rootNode = this.documentFromRange(range);
|
|
3915
|
+
this.body = body;
|
|
3916
|
+
this.startContainer = this.getNodeArray(range.startContainer, true);
|
|
3917
|
+
this.endContainer = this.getNodeArray(range.endContainer, false);
|
|
3918
|
+
this.startOffset = range.startOffset;
|
|
3919
|
+
this.endOffset = range.endOffset;
|
|
3920
|
+
this.html = this.body.innerHTML;
|
|
3921
|
+
return this;
|
|
3922
|
+
};
|
|
3923
|
+
NodeSelection.prototype.documentFromRange = function (range) {
|
|
3924
|
+
return (9 === range.startContainer.nodeType) ? range.startContainer : range.startContainer.ownerDocument;
|
|
3925
|
+
};
|
|
3926
|
+
NodeSelection.prototype.getRange = function (docElement) {
|
|
3927
|
+
var select$$1 = this.get(docElement);
|
|
3928
|
+
var range = select$$1 && select$$1.rangeCount > 0 ? select$$1.getRangeAt(select$$1.rangeCount - 1) : docElement.createRange();
|
|
3929
|
+
return (range.startContainer !== docElement || range.endContainer !== docElement
|
|
3930
|
+
|| range.startOffset || range.endOffset || (range.setStart(docElement.body, 0), range.collapse(!0)), range);
|
|
3931
|
+
};
|
|
3932
|
+
/**
|
|
3933
|
+
* get method
|
|
3934
|
+
*
|
|
3935
|
+
* @param {Document} docElement - specifies the get function
|
|
3936
|
+
* @returns {void}
|
|
3937
|
+
* @hidden
|
|
3938
|
+
* @deprecated
|
|
3939
|
+
*/
|
|
3940
|
+
NodeSelection.prototype.get = function (docElement) {
|
|
3941
|
+
return docElement.defaultView.getSelection();
|
|
3942
|
+
};
|
|
3943
|
+
/**
|
|
3944
|
+
* save method
|
|
3945
|
+
*
|
|
3946
|
+
* @param {Range} range - range value.
|
|
3947
|
+
* @param {Document} docElement - specifies the document.
|
|
3948
|
+
* @returns {void}
|
|
3949
|
+
* @hidden
|
|
3950
|
+
* @deprecated
|
|
3951
|
+
*/
|
|
3952
|
+
NodeSelection.prototype.save = function (range, docElement) {
|
|
3953
|
+
range = (range) ? range.cloneRange() : this.getRange(docElement);
|
|
3954
|
+
return this.saveInstance(range, docElement.body);
|
|
3955
|
+
};
|
|
3956
|
+
/**
|
|
3957
|
+
* getIndex method
|
|
3958
|
+
*
|
|
3959
|
+
* @param {Node} node - specifies the node value.
|
|
3960
|
+
* @returns {void}
|
|
3961
|
+
* @hidden
|
|
3962
|
+
* @deprecated
|
|
3963
|
+
*/
|
|
3964
|
+
NodeSelection.prototype.getIndex = function (node) {
|
|
3965
|
+
var index;
|
|
3966
|
+
var num = 0;
|
|
3967
|
+
node = !node.previousSibling && node.tagName === 'BR' ? node : node.previousSibling;
|
|
3968
|
+
if (node) {
|
|
3969
|
+
for (var type = node.nodeType; node; null) {
|
|
3970
|
+
index = node.nodeType;
|
|
3971
|
+
num++;
|
|
3972
|
+
//eslint-disable-next-line
|
|
3973
|
+
type = index;
|
|
3974
|
+
node = node.previousSibling;
|
|
3975
|
+
}
|
|
3976
|
+
}
|
|
3977
|
+
return num;
|
|
3978
|
+
};
|
|
3979
|
+
NodeSelection.prototype.isChildNode = function (nodeCollection, parentNode) {
|
|
3980
|
+
for (var index = 0; index < parentNode.childNodes.length; index++) {
|
|
3981
|
+
if (nodeCollection.indexOf(parentNode.childNodes[index]) > -1) {
|
|
3982
|
+
return true;
|
|
3668
3983
|
}
|
|
3669
3984
|
}
|
|
3985
|
+
return false;
|
|
3986
|
+
};
|
|
3987
|
+
NodeSelection.prototype.getNode = function (startNode, endNode, nodeCollection) {
|
|
3988
|
+
if (endNode === startNode &&
|
|
3989
|
+
(startNode.nodeType === 3 || !startNode.firstChild || nodeCollection.indexOf(startNode.firstChild) !== -1
|
|
3990
|
+
|| this.isChildNode(nodeCollection, startNode))) {
|
|
3991
|
+
return null;
|
|
3992
|
+
}
|
|
3993
|
+
if (startNode.nodeType === 3 && startNode.previousSibling === endNode && endNode.nodeName === 'IMG') {
|
|
3994
|
+
return null;
|
|
3995
|
+
}
|
|
3996
|
+
if (nodeCollection.indexOf(startNode.firstChild) === -1 && startNode.firstChild && !this.isChildNode(nodeCollection, startNode)) {
|
|
3997
|
+
return startNode.firstChild;
|
|
3998
|
+
}
|
|
3999
|
+
if (startNode.nextSibling) {
|
|
4000
|
+
return startNode.nextSibling;
|
|
4001
|
+
}
|
|
4002
|
+
if (!startNode.parentNode) {
|
|
4003
|
+
return null;
|
|
4004
|
+
}
|
|
4005
|
+
else {
|
|
4006
|
+
return startNode.parentNode;
|
|
4007
|
+
}
|
|
4008
|
+
};
|
|
4009
|
+
/**
|
|
4010
|
+
* getNodeCollection method
|
|
4011
|
+
*
|
|
4012
|
+
* @param {Range} range -specifies the range.
|
|
4013
|
+
* @returns {void}
|
|
4014
|
+
* @hidden
|
|
4015
|
+
* @deprecated
|
|
4016
|
+
*/
|
|
4017
|
+
NodeSelection.prototype.getNodeCollection = function (range) {
|
|
4018
|
+
var startNode = range.startContainer.childNodes[range.startOffset]
|
|
4019
|
+
|| range.startContainer;
|
|
4020
|
+
var endNode = range.endContainer.childNodes[(range.endOffset > 0) ? (range.endOffset - 1) : range.endOffset]
|
|
4021
|
+
|| range.endContainer;
|
|
4022
|
+
if ((startNode === endNode || (startNode.nodeName === 'BR' && startNode === range.endContainer.childNodes[range.endOffset])) &&
|
|
4023
|
+
startNode.childNodes.length === 0) {
|
|
4024
|
+
return [startNode];
|
|
4025
|
+
}
|
|
4026
|
+
if (range.startOffset === range.endOffset && range.startOffset !== 0 && range.startContainer.nodeName === 'PRE') {
|
|
4027
|
+
return [startNode.nodeName === 'BR' || startNode.nodeName === '#text' ? startNode : startNode.childNodes[0]];
|
|
4028
|
+
}
|
|
4029
|
+
var nodeCollection = [];
|
|
4030
|
+
do {
|
|
4031
|
+
if (nodeCollection.indexOf(startNode) === -1) {
|
|
4032
|
+
nodeCollection.push(startNode);
|
|
4033
|
+
}
|
|
4034
|
+
startNode = this.getNode(startNode, endNode, nodeCollection);
|
|
4035
|
+
} while (startNode);
|
|
4036
|
+
return nodeCollection;
|
|
4037
|
+
};
|
|
4038
|
+
/**
|
|
4039
|
+
* getParentNodeCollection method
|
|
4040
|
+
*
|
|
4041
|
+
* @param {Range} range - specifies the range value.
|
|
4042
|
+
* @returns {void}
|
|
4043
|
+
* @hidden
|
|
4044
|
+
* @deprecated
|
|
4045
|
+
*/
|
|
4046
|
+
NodeSelection.prototype.getParentNodeCollection = function (range) {
|
|
4047
|
+
return this.getParentNodes(this.getNodeCollection(range), range);
|
|
4048
|
+
};
|
|
4049
|
+
/**
|
|
4050
|
+
* getParentNodes method
|
|
4051
|
+
*
|
|
4052
|
+
* @param {Node[]} nodeCollection - specifies the collection of nodes.
|
|
4053
|
+
* @param {Range} range - specifies the range values.
|
|
4054
|
+
* @returns {void}
|
|
4055
|
+
* @hidden
|
|
4056
|
+
* @deprecated
|
|
4057
|
+
*/
|
|
4058
|
+
NodeSelection.prototype.getParentNodes = function (nodeCollection, range) {
|
|
4059
|
+
nodeCollection = nodeCollection.reverse();
|
|
4060
|
+
for (var index = 0; index < nodeCollection.length; index++) {
|
|
4061
|
+
if ((nodeCollection.indexOf(nodeCollection[index].parentNode) !== -1)
|
|
4062
|
+
|| (nodeCollection[index].nodeType === 3 &&
|
|
4063
|
+
range.startContainer !== range.endContainer &&
|
|
4064
|
+
range.startContainer.parentNode !== range.endContainer.parentNode)) {
|
|
4065
|
+
nodeCollection.splice(index, 1);
|
|
4066
|
+
index--;
|
|
4067
|
+
}
|
|
4068
|
+
else if (nodeCollection[index].nodeType === 3) {
|
|
4069
|
+
nodeCollection[index] = nodeCollection[index].parentNode;
|
|
4070
|
+
}
|
|
4071
|
+
}
|
|
4072
|
+
return nodeCollection;
|
|
4073
|
+
};
|
|
4074
|
+
/**
|
|
4075
|
+
* getSelectionNodeCollection method
|
|
4076
|
+
*
|
|
4077
|
+
* @param {Range} range - specifies the range value.
|
|
4078
|
+
* @returns {void}
|
|
4079
|
+
* @hidden
|
|
4080
|
+
* @deprecated
|
|
4081
|
+
*/
|
|
4082
|
+
NodeSelection.prototype.getSelectionNodeCollection = function (range) {
|
|
4083
|
+
return this.getSelectionNodes(this.getNodeCollection(range));
|
|
4084
|
+
};
|
|
4085
|
+
/**
|
|
4086
|
+
* getSelectionNodeCollection along with BR node method
|
|
4087
|
+
*
|
|
4088
|
+
* @param {Range} range - specifies the range value.
|
|
4089
|
+
* @returns {void}
|
|
4090
|
+
* @hidden
|
|
4091
|
+
* @deprecated
|
|
4092
|
+
*/
|
|
4093
|
+
NodeSelection.prototype.getSelectionNodeCollectionBr = function (range) {
|
|
4094
|
+
return this.getSelectionNodesBr(this.getNodeCollection(range));
|
|
4095
|
+
};
|
|
4096
|
+
/**
|
|
4097
|
+
* getParentNodes method
|
|
4098
|
+
*
|
|
4099
|
+
* @param {Node[]} nodeCollection - specifies the collection of nodes.
|
|
4100
|
+
* @returns {void}
|
|
4101
|
+
* @hidden
|
|
4102
|
+
* @deprecated
|
|
4103
|
+
*/
|
|
4104
|
+
NodeSelection.prototype.getSelectionNodes = function (nodeCollection) {
|
|
4105
|
+
nodeCollection = nodeCollection.reverse();
|
|
4106
|
+
// eslint-disable-next-line
|
|
4107
|
+
var regEx = new RegExp(String.fromCharCode(8203), 'g');
|
|
4108
|
+
for (var index = 0; index < nodeCollection.length; index++) {
|
|
4109
|
+
if (nodeCollection[index].nodeType !== 3 || (nodeCollection[index].textContent.trim() === '' ||
|
|
4110
|
+
(nodeCollection[index].textContent.length === 1 && nodeCollection[index].textContent.match(regEx)))) {
|
|
4111
|
+
nodeCollection.splice(index, 1);
|
|
4112
|
+
index--;
|
|
4113
|
+
}
|
|
4114
|
+
}
|
|
4115
|
+
return nodeCollection.reverse();
|
|
4116
|
+
};
|
|
4117
|
+
/**
|
|
4118
|
+
* Get selection text nodes with br method.
|
|
4119
|
+
*
|
|
4120
|
+
* @param {Node[]} nodeCollection - specifies the collection of nodes.
|
|
4121
|
+
* @returns {void}
|
|
4122
|
+
* @hidden
|
|
4123
|
+
* @deprecated
|
|
4124
|
+
*/
|
|
4125
|
+
NodeSelection.prototype.getSelectionNodesBr = function (nodeCollection) {
|
|
4126
|
+
nodeCollection = nodeCollection.reverse();
|
|
4127
|
+
// eslint-disable-next-line
|
|
4128
|
+
var regEx = new RegExp(String.fromCharCode(8203), 'g');
|
|
4129
|
+
for (var index = 0; index < nodeCollection.length; index++) {
|
|
4130
|
+
if (nodeCollection[index].nodeName !== 'BR' &&
|
|
4131
|
+
(nodeCollection[index].nodeType !== 3 || (nodeCollection[index].textContent.trim() === '' ||
|
|
4132
|
+
(nodeCollection[index].textContent.length === 1 && nodeCollection[index].textContent.match(regEx))))) {
|
|
4133
|
+
nodeCollection.splice(index, 1);
|
|
4134
|
+
index--;
|
|
4135
|
+
}
|
|
4136
|
+
}
|
|
4137
|
+
return nodeCollection.reverse();
|
|
4138
|
+
};
|
|
4139
|
+
/**
|
|
4140
|
+
* getInsertNodeCollection method
|
|
4141
|
+
*
|
|
4142
|
+
* @param {Range} range - specifies the range value.
|
|
4143
|
+
* @returns {void}
|
|
4144
|
+
* @hidden
|
|
4145
|
+
* @deprecated
|
|
4146
|
+
*/
|
|
4147
|
+
NodeSelection.prototype.getInsertNodeCollection = function (range) {
|
|
4148
|
+
return this.getInsertNodes(this.getNodeCollection(range));
|
|
4149
|
+
};
|
|
4150
|
+
/**
|
|
4151
|
+
* getInsertNodes method
|
|
4152
|
+
*
|
|
4153
|
+
* @param {Node[]} nodeCollection - specifies the collection of nodes.
|
|
4154
|
+
* @returns {void}
|
|
4155
|
+
* @hidden
|
|
4156
|
+
* @deprecated
|
|
4157
|
+
*/
|
|
4158
|
+
NodeSelection.prototype.getInsertNodes = function (nodeCollection) {
|
|
4159
|
+
nodeCollection = nodeCollection.reverse();
|
|
4160
|
+
for (var index = 0; index < nodeCollection.length; index++) {
|
|
4161
|
+
if ((nodeCollection[index].childNodes.length !== 0 &&
|
|
4162
|
+
nodeCollection[index].nodeType !== 3) ||
|
|
4163
|
+
(nodeCollection[index].nodeType === 3 &&
|
|
4164
|
+
nodeCollection[index].textContent === '')) {
|
|
4165
|
+
nodeCollection.splice(index, 1);
|
|
4166
|
+
index--;
|
|
4167
|
+
}
|
|
4168
|
+
}
|
|
4169
|
+
return nodeCollection.reverse();
|
|
4170
|
+
};
|
|
4171
|
+
/**
|
|
4172
|
+
* getNodeArray method
|
|
4173
|
+
*
|
|
4174
|
+
* @param {Node} node - specifies the node content.
|
|
4175
|
+
* @param {boolean} isStart - specifies the boolean value.
|
|
4176
|
+
* @param {Document} root - specifies the root document.
|
|
4177
|
+
* @returns {void}
|
|
4178
|
+
* @hidden
|
|
4179
|
+
* @deprecated
|
|
4180
|
+
*/
|
|
4181
|
+
NodeSelection.prototype.getNodeArray = function (node, isStart, root) {
|
|
4182
|
+
var array = [];
|
|
4183
|
+
// eslint-disable-next-line
|
|
4184
|
+
((isStart) ? (this.startNodeName = []) : (this.endNodeName = []));
|
|
4185
|
+
for (; node !== (root ? root : this.rootNode); null) {
|
|
4186
|
+
if (isNullOrUndefined(node)) {
|
|
4187
|
+
break;
|
|
4188
|
+
}
|
|
4189
|
+
// eslint-disable-next-line
|
|
4190
|
+
(isStart) ? this.startNodeName.push(node.nodeName.toLowerCase()) : this.endNodeName.push(node.nodeName.toLowerCase());
|
|
4191
|
+
array.push(this.getIndex(node));
|
|
4192
|
+
node = node.parentNode;
|
|
4193
|
+
}
|
|
4194
|
+
return array;
|
|
4195
|
+
};
|
|
4196
|
+
NodeSelection.prototype.setRangePoint = function (range, isvalid, num, size) {
|
|
4197
|
+
var node = this.rootNode;
|
|
4198
|
+
var index = num.length;
|
|
4199
|
+
var constant = size;
|
|
4200
|
+
for (; index--; null) {
|
|
4201
|
+
node = node && node.childNodes[num[index]];
|
|
4202
|
+
}
|
|
4203
|
+
if (node && constant >= 0 && node.nodeName !== 'html') {
|
|
4204
|
+
if (node.nodeType === 3 && node.nodeValue.replace(/\u00a0/g, ' ') === ' ') {
|
|
4205
|
+
constant = node.textContent.length;
|
|
4206
|
+
}
|
|
4207
|
+
range[isvalid ? 'setStart' : 'setEnd'](node, constant);
|
|
4208
|
+
}
|
|
4209
|
+
return range;
|
|
4210
|
+
};
|
|
4211
|
+
/**
|
|
4212
|
+
* restore method
|
|
4213
|
+
*
|
|
4214
|
+
* @returns {void}
|
|
4215
|
+
* @hidden
|
|
4216
|
+
* @deprecated
|
|
4217
|
+
*/
|
|
4218
|
+
NodeSelection.prototype.restore = function () {
|
|
4219
|
+
var range = this.range.cloneRange();
|
|
4220
|
+
range = this.setRangePoint(range, true, this.startContainer, this.startOffset);
|
|
4221
|
+
range = this.setRangePoint(range, false, this.endContainer, this.endOffset);
|
|
4222
|
+
this.selectRange(this.rootNode, range);
|
|
4223
|
+
return range;
|
|
4224
|
+
};
|
|
4225
|
+
NodeSelection.prototype.selectRange = function (docElement, range) {
|
|
4226
|
+
this.setRange(docElement, range);
|
|
4227
|
+
this.save(range, docElement);
|
|
4228
|
+
};
|
|
4229
|
+
/**
|
|
4230
|
+
* setRange method
|
|
4231
|
+
*
|
|
4232
|
+
* @param {Document} docElement - specifies the document.
|
|
4233
|
+
* @param {Range} range - specifies the range.
|
|
4234
|
+
* @returns {void}
|
|
4235
|
+
* @hidden
|
|
4236
|
+
* @deprecated
|
|
4237
|
+
*/
|
|
4238
|
+
NodeSelection.prototype.setRange = function (docElement, range) {
|
|
4239
|
+
var selection = this.get(docElement);
|
|
4240
|
+
selection.removeAllRanges();
|
|
4241
|
+
selection.addRange(range);
|
|
4242
|
+
};
|
|
4243
|
+
/**
|
|
4244
|
+
* setSelectionText method
|
|
4245
|
+
*
|
|
4246
|
+
* @param {Document} docElement - specifies the documrent
|
|
4247
|
+
* @param {Node} startNode - specifies the starting node.
|
|
4248
|
+
* @param {Node} endNode - specifies the the end node.
|
|
4249
|
+
* @param {number} startIndex - specifies the starting index.
|
|
4250
|
+
* @param {number} endIndex - specifies the end index.
|
|
4251
|
+
* @returns {void}
|
|
4252
|
+
* @hidden
|
|
4253
|
+
* @deprecated
|
|
4254
|
+
*/
|
|
4255
|
+
NodeSelection.prototype.setSelectionText = function (docElement, startNode, endNode, startIndex, endIndex) {
|
|
4256
|
+
var range = docElement.createRange();
|
|
4257
|
+
range.setStart(startNode, startIndex);
|
|
4258
|
+
range.setEnd(endNode, endIndex);
|
|
4259
|
+
this.setRange(docElement, range);
|
|
4260
|
+
};
|
|
4261
|
+
/**
|
|
4262
|
+
* setSelectionContents method
|
|
4263
|
+
*
|
|
4264
|
+
* @param {Document} docElement - specifies the document.
|
|
4265
|
+
* @param {Node} element - specifies the node.
|
|
4266
|
+
* @returns {void}
|
|
4267
|
+
* @hidden
|
|
4268
|
+
* @deprecated
|
|
4269
|
+
*/
|
|
4270
|
+
NodeSelection.prototype.setSelectionContents = function (docElement, element) {
|
|
4271
|
+
var range = docElement.createRange();
|
|
4272
|
+
range.selectNode(element);
|
|
4273
|
+
this.setRange(docElement, range);
|
|
4274
|
+
};
|
|
4275
|
+
/**
|
|
4276
|
+
* setSelectionNode method
|
|
4277
|
+
*
|
|
4278
|
+
* @param {Document} docElement - specifies the document.
|
|
4279
|
+
* @param {Node} element - specifies the node.
|
|
4280
|
+
* @returns {void}
|
|
4281
|
+
* @hidden
|
|
4282
|
+
* @deprecated
|
|
4283
|
+
*/
|
|
4284
|
+
NodeSelection.prototype.setSelectionNode = function (docElement, element) {
|
|
4285
|
+
var range = docElement.createRange();
|
|
4286
|
+
range.selectNodeContents(element);
|
|
4287
|
+
this.setRange(docElement, range);
|
|
4288
|
+
};
|
|
4289
|
+
/**
|
|
4290
|
+
* getSelectedNodes method
|
|
4291
|
+
*
|
|
4292
|
+
* @param {Document} docElement - specifies the document.
|
|
4293
|
+
* @returns {void}
|
|
4294
|
+
* @hidden
|
|
4295
|
+
* @deprecated
|
|
4296
|
+
*/
|
|
4297
|
+
NodeSelection.prototype.getSelectedNodes = function (docElement) {
|
|
4298
|
+
return this.getNodeCollection(this.getRange(docElement));
|
|
4299
|
+
};
|
|
4300
|
+
/**
|
|
4301
|
+
* Clear method
|
|
4302
|
+
*
|
|
4303
|
+
* @param {Document} docElement - specifies the document.
|
|
4304
|
+
* @returns {void}
|
|
4305
|
+
* @hidden
|
|
4306
|
+
* @deprecated
|
|
4307
|
+
*/
|
|
4308
|
+
NodeSelection.prototype.Clear = function (docElement) {
|
|
4309
|
+
this.get(docElement).removeAllRanges();
|
|
4310
|
+
};
|
|
4311
|
+
/**
|
|
4312
|
+
* insertParentNode method
|
|
4313
|
+
*
|
|
4314
|
+
* @param {Document} docElement - specifies the document.
|
|
4315
|
+
* @param {Node} newNode - specicfies the new node.
|
|
4316
|
+
* @param {Range} range - specifies the range.
|
|
4317
|
+
* @returns {void}
|
|
4318
|
+
* @hidden
|
|
4319
|
+
* @deprecated
|
|
4320
|
+
*/
|
|
4321
|
+
NodeSelection.prototype.insertParentNode = function (docElement, newNode, range) {
|
|
4322
|
+
range.surroundContents(newNode);
|
|
4323
|
+
this.selectRange(docElement, range);
|
|
4324
|
+
};
|
|
4325
|
+
/**
|
|
4326
|
+
* setCursorPoint method
|
|
4327
|
+
*
|
|
4328
|
+
* @param {Document} docElement - specifies the document.
|
|
4329
|
+
* @param {Element} element - specifies the element.
|
|
4330
|
+
* @param {number} point - specifies the point.
|
|
4331
|
+
* @returns {void}
|
|
4332
|
+
* @hidden
|
|
4333
|
+
* @deprecated
|
|
4334
|
+
*/
|
|
4335
|
+
NodeSelection.prototype.setCursorPoint = function (docElement, element, point) {
|
|
4336
|
+
var range = docElement.createRange();
|
|
4337
|
+
var selection = docElement.defaultView.getSelection();
|
|
4338
|
+
range.setStart(element, point);
|
|
4339
|
+
range.collapse(true);
|
|
4340
|
+
selection.removeAllRanges();
|
|
4341
|
+
selection.addRange(range);
|
|
4342
|
+
};
|
|
4343
|
+
return NodeSelection;
|
|
4344
|
+
}());
|
|
4345
|
+
|
|
4346
|
+
/**
|
|
4347
|
+
* `Selection` module is used to handle RTE Selections.
|
|
4348
|
+
*/
|
|
4349
|
+
|
|
4350
|
+
/**
|
|
4351
|
+
* Defines common util methods used by Rich Text Editor.
|
|
4352
|
+
*/
|
|
4353
|
+
var inlineNode$1 = ['a', 'abbr', 'acronym', 'audio', 'b', 'bdi', 'bdo', 'big', 'br', 'button',
|
|
4354
|
+
'canvas', 'cite', 'code', 'data', 'datalist', 'del', 'dfn', 'em', 'embed', 'font', 'i', 'iframe', 'img', 'input',
|
|
4355
|
+
'ins', 'kbd', 'label', 'map', 'mark', 'meter', 'noscript', 'object', 'output', 'picture', 'progress',
|
|
4356
|
+
'q', 'ruby', 's', 'samp', 'script', 'select', 'slot', 'small', 'span', 'strong', 'strike', 'sub', 'sup', 'svg',
|
|
4357
|
+
'template', 'textarea', 'time', 'u', 'tt', 'var', 'video', 'wbr'];
|
|
4358
|
+
/**
|
|
4359
|
+
* @returns {void}
|
|
4360
|
+
* @hidden
|
|
4361
|
+
*/
|
|
4362
|
+
function isIDevice$1() {
|
|
4363
|
+
var result = false;
|
|
4364
|
+
if (Browser.isDevice && Browser.isIos) {
|
|
4365
|
+
result = true;
|
|
4366
|
+
}
|
|
4367
|
+
return result;
|
|
4368
|
+
}
|
|
4369
|
+
/**
|
|
4370
|
+
* @param {Element} editableElement - specifies the editable element.
|
|
4371
|
+
* @param {string} selector - specifies the string values.
|
|
4372
|
+
* @returns {void}
|
|
4373
|
+
* @hidden
|
|
4374
|
+
*/
|
|
4375
|
+
function setEditFrameFocus(editableElement, selector) {
|
|
4376
|
+
if (editableElement.nodeName === 'BODY' && !isNullOrUndefined(selector)) {
|
|
4377
|
+
var iframe = top.window.document.querySelector(selector);
|
|
4378
|
+
if (!isNullOrUndefined(iframe)) {
|
|
4379
|
+
iframe.contentWindow.focus();
|
|
4380
|
+
}
|
|
4381
|
+
}
|
|
4382
|
+
}
|
|
4383
|
+
/**
|
|
4384
|
+
* @param {string} value - specifies the string value
|
|
4385
|
+
* @param {string} enterAction - specifies the enter key action API
|
|
4386
|
+
* @returns {void}
|
|
4387
|
+
* @hidden
|
|
4388
|
+
*/
|
|
4389
|
+
function updateTextNode$1(value, enterAction) {
|
|
4390
|
+
var tempNode = document.createElement('div');
|
|
4391
|
+
tempNode.innerHTML = value;
|
|
4392
|
+
tempNode.setAttribute('class', 'tempDiv');
|
|
4393
|
+
var resultElm = document.createElement('div');
|
|
4394
|
+
var childNodes = tempNode.childNodes;
|
|
4395
|
+
if (childNodes.length > 0) {
|
|
4396
|
+
var isPreviousInlineElem = void 0;
|
|
4397
|
+
var previousParent = void 0;
|
|
4398
|
+
var paraElm = void 0;
|
|
4399
|
+
while (tempNode.firstChild) {
|
|
4400
|
+
if ((tempNode.firstChild.nodeName === '#text' &&
|
|
4401
|
+
(tempNode.firstChild.textContent.indexOf('\n') < 0 || tempNode.firstChild.textContent.trim() !== '')) ||
|
|
4402
|
+
inlineNode$1.indexOf(tempNode.firstChild.nodeName.toLocaleLowerCase()) >= 0) {
|
|
4403
|
+
if (!isPreviousInlineElem) {
|
|
4404
|
+
if (enterAction === 'BR') {
|
|
4405
|
+
resultElm.appendChild(tempNode.firstChild);
|
|
4406
|
+
previousParent = resultElm;
|
|
4407
|
+
}
|
|
4408
|
+
else {
|
|
4409
|
+
paraElm = createElement('p');
|
|
4410
|
+
resultElm.appendChild(paraElm);
|
|
4411
|
+
paraElm.appendChild(tempNode.firstChild);
|
|
4412
|
+
previousParent = paraElm;
|
|
4413
|
+
isPreviousInlineElem = true;
|
|
4414
|
+
}
|
|
4415
|
+
}
|
|
4416
|
+
else {
|
|
4417
|
+
previousParent.appendChild(tempNode.firstChild);
|
|
4418
|
+
previousParent = paraElm;
|
|
4419
|
+
isPreviousInlineElem = true;
|
|
4420
|
+
}
|
|
4421
|
+
}
|
|
4422
|
+
else if (tempNode.firstChild.nodeName === '#text' && (tempNode.firstChild.textContent === '\n' ||
|
|
4423
|
+
(tempNode.firstChild.textContent.indexOf('\n') >= 0 && tempNode.firstChild.textContent.trim() === ''))) {
|
|
4424
|
+
detach(tempNode.firstChild);
|
|
4425
|
+
}
|
|
4426
|
+
else {
|
|
4427
|
+
resultElm.appendChild(tempNode.firstChild);
|
|
4428
|
+
isPreviousInlineElem = false;
|
|
4429
|
+
}
|
|
4430
|
+
}
|
|
4431
|
+
var tableElm = resultElm.querySelectorAll('table');
|
|
4432
|
+
for (var i = 0; i < tableElm.length; i++) {
|
|
4433
|
+
if (tableElm[i].classList.length > 0 && !tableElm[i].classList.contains('e-rte-table')) {
|
|
4434
|
+
tableElm[i].classList.add('e-rte-paste-table');
|
|
4435
|
+
if (tableElm[i].classList.contains('e-rte-paste-word-table')) {
|
|
4436
|
+
tableElm[i].classList.remove('e-rte-paste-word-table');
|
|
4437
|
+
continue; // Skiping the removal of the border if the source is from word.
|
|
4438
|
+
}
|
|
4439
|
+
else if (tableElm[i].classList.contains('e-rte-paste-excel-table')) {
|
|
4440
|
+
tableElm[i].classList.remove('e-rte-paste-excel-table');
|
|
4441
|
+
if (tableElm[i].getAttribute('border') === '0') {
|
|
4442
|
+
tableElm[i].removeAttribute('border');
|
|
4443
|
+
}
|
|
4444
|
+
var tdElm = tableElm[i].querySelectorAll('td');
|
|
4445
|
+
for (var j = 0; j < tdElm.length; j++) {
|
|
4446
|
+
if (tdElm[j].style.borderLeft === 'none') {
|
|
4447
|
+
tdElm[j].style.removeProperty('border-left');
|
|
4448
|
+
}
|
|
4449
|
+
if (tdElm[j].style.borderRight === 'none') {
|
|
4450
|
+
tdElm[j].style.removeProperty('border-right');
|
|
4451
|
+
}
|
|
4452
|
+
if (tdElm[j].style.borderBottom === 'none') {
|
|
4453
|
+
tdElm[j].style.removeProperty('border-bottom');
|
|
4454
|
+
}
|
|
4455
|
+
if (tdElm[j].style.borderTop === 'none') {
|
|
4456
|
+
tdElm[j].style.removeProperty('border-top');
|
|
4457
|
+
}
|
|
4458
|
+
if (tdElm[j].style.border === 'none') {
|
|
4459
|
+
tdElm[j].style.removeProperty('border');
|
|
4460
|
+
}
|
|
4461
|
+
}
|
|
4462
|
+
}
|
|
4463
|
+
else if (tableElm[i].classList.contains('e-rte-paste-onenote-table')) {
|
|
4464
|
+
tableElm[i].classList.remove('e-rte-paste-onenote-table');
|
|
4465
|
+
continue;
|
|
4466
|
+
}
|
|
4467
|
+
}
|
|
4468
|
+
}
|
|
4469
|
+
var imageElm = resultElm.querySelectorAll('img');
|
|
4470
|
+
for (var i = 0; i < imageElm.length; i++) {
|
|
4471
|
+
if (imageElm[i].classList.contains('e-rte-image-unsupported')) {
|
|
4472
|
+
continue; // Should not add the class if the image is Broken.
|
|
4473
|
+
}
|
|
4474
|
+
if (!imageElm[i].classList.contains('e-rte-image')) {
|
|
4475
|
+
imageElm[i].classList.add('e-rte-image');
|
|
4476
|
+
}
|
|
4477
|
+
if (!(imageElm[i].classList.contains('e-imginline') ||
|
|
4478
|
+
imageElm[i].classList.contains('e-imgbreak'))) {
|
|
4479
|
+
imageElm[i].classList.add('e-imginline');
|
|
4480
|
+
}
|
|
4481
|
+
}
|
|
4482
|
+
}
|
|
4483
|
+
return resultElm.innerHTML;
|
|
4484
|
+
}
|
|
4485
|
+
/**
|
|
4486
|
+
* @param {Node} startChildNodes - specifies the node
|
|
4487
|
+
* @returns {void}
|
|
4488
|
+
* @hidden
|
|
4489
|
+
*/
|
|
4490
|
+
function getLastTextNode(startChildNodes) {
|
|
4491
|
+
var finalNode = startChildNodes;
|
|
4492
|
+
do {
|
|
4493
|
+
if (finalNode.childNodes.length > 0) {
|
|
4494
|
+
finalNode = finalNode.childNodes[0];
|
|
4495
|
+
}
|
|
4496
|
+
} while (finalNode.childNodes.length > 0);
|
|
4497
|
+
return finalNode;
|
|
4498
|
+
}
|
|
4499
|
+
/**
|
|
4500
|
+
* @returns {void}
|
|
4501
|
+
* @hidden
|
|
4502
|
+
*/
|
|
4503
|
+
function getDefaultHtmlTbStatus() {
|
|
4504
|
+
return {
|
|
4505
|
+
bold: false,
|
|
4506
|
+
italic: false,
|
|
4507
|
+
subscript: false,
|
|
4508
|
+
superscript: false,
|
|
4509
|
+
strikethrough: false,
|
|
4510
|
+
orderedlist: false,
|
|
4511
|
+
unorderedlist: false,
|
|
4512
|
+
numberFormatList: false,
|
|
4513
|
+
bulletFormatList: false,
|
|
4514
|
+
underline: false,
|
|
4515
|
+
alignments: null,
|
|
4516
|
+
backgroundcolor: null,
|
|
4517
|
+
fontcolor: null,
|
|
4518
|
+
fontname: null,
|
|
4519
|
+
fontsize: null,
|
|
4520
|
+
formats: null,
|
|
4521
|
+
createlink: false,
|
|
4522
|
+
insertcode: false
|
|
4523
|
+
};
|
|
4524
|
+
}
|
|
4525
|
+
/**
|
|
4526
|
+
* @returns {void}
|
|
4527
|
+
* @hidden
|
|
4528
|
+
*/
|
|
4529
|
+
function getDefaultMDTbStatus() {
|
|
4530
|
+
return {
|
|
4531
|
+
bold: false,
|
|
4532
|
+
italic: false,
|
|
4533
|
+
subscript: false,
|
|
4534
|
+
superscript: false,
|
|
4535
|
+
strikethrough: false,
|
|
4536
|
+
orderedlist: false,
|
|
4537
|
+
uppercase: false,
|
|
4538
|
+
lowercase: false,
|
|
4539
|
+
inlinecode: false,
|
|
4540
|
+
unorderedlist: false,
|
|
4541
|
+
formats: null
|
|
4542
|
+
};
|
|
4543
|
+
}
|
|
4544
|
+
/**
|
|
4545
|
+
* @param {Range} range - specifies the range
|
|
4546
|
+
* @returns {void}
|
|
4547
|
+
* @hidden
|
|
4548
|
+
*/
|
|
4549
|
+
function nestedListCleanUp(range) {
|
|
4550
|
+
if (range.startContainer.parentElement.closest('ol,ul') !== null && range.endContainer.parentElement.closest('ol,ul') !== null) {
|
|
4551
|
+
range.extractContents();
|
|
4552
|
+
while ((range.startContainer.nodeName === "#text" ? range.startContainer.parentElement : range.startContainer).querySelectorAll('li :empty').length > 0 ||
|
|
4553
|
+
(range.startContainer.nodeName === "#text" ? range.startContainer.parentElement : range.startContainer).querySelectorAll('ol :empty').length > 0) {
|
|
4554
|
+
var emptyLI = (range.startContainer.nodeName === "#text" ? range.startContainer.parentElement : range.startContainer).querySelectorAll('li :empty');
|
|
4555
|
+
if (emptyLI.length > 0) {
|
|
4556
|
+
emptyLI.forEach(function (item) {
|
|
4557
|
+
item.remove();
|
|
4558
|
+
});
|
|
4559
|
+
}
|
|
4560
|
+
}
|
|
4561
|
+
var liElem = (range.startContainer.nodeName === "#text" ? range.startContainer.parentElement : range.startContainer).querySelectorAll("li");
|
|
4562
|
+
if (liElem.length > 0) {
|
|
4563
|
+
liElem.forEach(function (item) {
|
|
4564
|
+
if (item.firstChild.nodeName === "OL" || item.firstChild.nodeName === "UL") {
|
|
4565
|
+
item.style.listStyleType = "none";
|
|
4566
|
+
}
|
|
4567
|
+
});
|
|
4568
|
+
}
|
|
4569
|
+
}
|
|
4570
|
+
}
|
|
4571
|
+
|
|
4572
|
+
/**
|
|
4573
|
+
* Update Toolbar Status
|
|
4574
|
+
*
|
|
4575
|
+
* @hidden
|
|
4576
|
+
* @deprecated
|
|
4577
|
+
*/
|
|
4578
|
+
var statusCollection = getDefaultHtmlTbStatus();
|
|
4579
|
+
var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
4580
|
+
function ToolbarStatus() {
|
|
4581
|
+
}
|
|
4582
|
+
/**
|
|
4583
|
+
* get method
|
|
4584
|
+
*
|
|
4585
|
+
* @param {Document} docElement - specifies the document element
|
|
4586
|
+
* @param {Node} rootNode - specifies the content editable element
|
|
4587
|
+
* @param {string[]} formatNode - specifies the format node
|
|
4588
|
+
* @param {string[]} fontSize - specifies the font size
|
|
4589
|
+
* @param {string[]} fontName - specifies the font name.
|
|
4590
|
+
* @param {Node} documentNode - specifies the document node.
|
|
4591
|
+
* @returns {IToolbarStatus} - returns the toolbar status
|
|
4592
|
+
* @hidden
|
|
4593
|
+
* @deprecated
|
|
4594
|
+
*/
|
|
4595
|
+
ToolbarStatus.get = function (docElement, rootNode, formatNode, fontSize, fontName, documentNode) {
|
|
4596
|
+
var formatCollection = JSON.parse(JSON.stringify(statusCollection));
|
|
4597
|
+
var nodeCollection = JSON.parse(JSON.stringify(statusCollection));
|
|
4598
|
+
var nodeSelection = new NodeSelection();
|
|
4599
|
+
var range = nodeSelection.getRange(docElement);
|
|
4600
|
+
var nodes = documentNode ? [documentNode] : range.collapsed ? nodeSelection.getNodeCollection(range) :
|
|
4601
|
+
nodeSelection.getSelectionNodeCollectionBr(range);
|
|
4602
|
+
var nodesLength = nodes.length;
|
|
4603
|
+
var isNodeChanged = false;
|
|
4604
|
+
for (var index = 0; index < nodes.length; index++) {
|
|
4605
|
+
while (nodes[index].nodeType === 3 && range.startContainer.nodeType === 3 && nodes[index].parentNode &&
|
|
4606
|
+
nodes[index].parentNode.lastElementChild && nodes[index].parentNode.lastElementChild.nodeName !== 'BR' &&
|
|
4607
|
+
(this.getImmediateBlockNode(nodes[index].parentNode)).textContent.replace(/\u200B/g, '').length === 0 &&
|
|
4608
|
+
range.startContainer.textContent.replace(/\u200B/g, '').length === 0 &&
|
|
4609
|
+
nodeSelection.get(docElement).toString().replace(/\u200B/g, '').length === 0) {
|
|
4610
|
+
nodes[index] = nodes[index].parentNode.lastElementChild.firstChild;
|
|
4611
|
+
isNodeChanged = true;
|
|
4612
|
+
}
|
|
4613
|
+
if (isNodeChanged && nodes[index]) {
|
|
4614
|
+
nodeSelection.setCursorPoint(docElement, nodes[index], nodes[index].textContent.length);
|
|
4615
|
+
isNodeChanged = false;
|
|
4616
|
+
}
|
|
4617
|
+
if ((nodes[index].nodeName !== 'BR' && nodes[index].nodeType !== 3) ||
|
|
4618
|
+
(nodesLength > 1 && nodes[index].nodeType === 3 && nodes[index].textContent.trim() === '')) {
|
|
4619
|
+
nodes.splice(index, 1);
|
|
4620
|
+
index--;
|
|
4621
|
+
}
|
|
4622
|
+
}
|
|
4623
|
+
for (var index = 0; index < nodes.length; index++) {
|
|
4624
|
+
// eslint-disable-next-line max-len
|
|
4625
|
+
formatCollection = this.getFormatParent(docElement, formatCollection, nodes[index], rootNode, formatNode, fontSize, fontName);
|
|
4626
|
+
if ((index === 0 && formatCollection.bold) || !formatCollection.bold) {
|
|
4627
|
+
nodeCollection.bold = formatCollection.bold;
|
|
4628
|
+
}
|
|
4629
|
+
if ((index === 0 && formatCollection.insertcode) || !formatCollection.insertcode) {
|
|
4630
|
+
nodeCollection.insertcode = formatCollection.insertcode;
|
|
4631
|
+
}
|
|
4632
|
+
if ((index === 0 && formatCollection.italic) || !formatCollection.italic) {
|
|
4633
|
+
nodeCollection.italic = formatCollection.italic;
|
|
4634
|
+
}
|
|
4635
|
+
if ((index === 0 && formatCollection.underline) || !formatCollection.underline) {
|
|
4636
|
+
nodeCollection.underline = formatCollection.underline;
|
|
4637
|
+
}
|
|
4638
|
+
if ((index === 0 && formatCollection.strikethrough) || !formatCollection.strikethrough) {
|
|
4639
|
+
nodeCollection.strikethrough = formatCollection.strikethrough;
|
|
4640
|
+
}
|
|
4641
|
+
if ((index === 0 && formatCollection.superscript) || !formatCollection.superscript) {
|
|
4642
|
+
nodeCollection.superscript = formatCollection.superscript;
|
|
4643
|
+
}
|
|
4644
|
+
if ((index === 0 && formatCollection.subscript) || !formatCollection.subscript) {
|
|
4645
|
+
nodeCollection.subscript = formatCollection.subscript;
|
|
4646
|
+
}
|
|
4647
|
+
if ((index === 0 && formatCollection.fontcolor) || !formatCollection.fontcolor) {
|
|
4648
|
+
nodeCollection.fontcolor = formatCollection.fontcolor;
|
|
4649
|
+
}
|
|
4650
|
+
if (index === 0 && formatCollection.fontname) {
|
|
4651
|
+
nodeCollection.fontname = formatCollection.fontname;
|
|
4652
|
+
}
|
|
4653
|
+
else {
|
|
4654
|
+
nodeCollection.fontname = formatCollection.fontname === nodeCollection.fontname ? formatCollection.fontname : 'empty';
|
|
4655
|
+
}
|
|
4656
|
+
if (index === 0 && formatCollection.fontsize) {
|
|
4657
|
+
nodeCollection.fontsize = formatCollection.fontsize;
|
|
4658
|
+
}
|
|
4659
|
+
else {
|
|
4660
|
+
nodeCollection.fontsize = formatCollection.fontsize === nodeCollection.fontsize ? formatCollection.fontsize : 'empty';
|
|
4661
|
+
}
|
|
4662
|
+
if ((index === 0 && formatCollection.backgroundcolor) || !formatCollection.backgroundcolor) {
|
|
4663
|
+
nodeCollection.backgroundcolor = formatCollection.backgroundcolor;
|
|
4664
|
+
}
|
|
4665
|
+
if ((index === 0 && formatCollection.orderedlist) || !formatCollection.orderedlist) {
|
|
4666
|
+
nodeCollection.orderedlist = formatCollection.orderedlist;
|
|
4667
|
+
}
|
|
4668
|
+
if ((index === 0 && formatCollection.unorderedlist) || !formatCollection.unorderedlist) {
|
|
4669
|
+
nodeCollection.unorderedlist = formatCollection.unorderedlist;
|
|
4670
|
+
}
|
|
4671
|
+
if ((index === 0 && formatCollection.alignments) || !formatCollection.alignments) {
|
|
4672
|
+
nodeCollection.alignments = formatCollection.alignments;
|
|
4673
|
+
}
|
|
4674
|
+
if (index === 0 && formatCollection.formats) {
|
|
4675
|
+
nodeCollection.formats = formatCollection.formats;
|
|
4676
|
+
}
|
|
4677
|
+
else {
|
|
4678
|
+
nodeCollection.formats = formatCollection.formats === nodeCollection.formats ? formatCollection.formats : 'empty';
|
|
4679
|
+
}
|
|
4680
|
+
if ((index === 0 && formatCollection.createlink) || !formatCollection.createlink) {
|
|
4681
|
+
nodeCollection.createlink = formatCollection.createlink;
|
|
4682
|
+
}
|
|
4683
|
+
if ((index === 0 && formatCollection.numberFormatList) || !formatCollection.numberFormatList) {
|
|
4684
|
+
nodeCollection.numberFormatList = formatCollection.numberFormatList;
|
|
4685
|
+
}
|
|
4686
|
+
if ((index === 0 && formatCollection.bulletFormatList) || !formatCollection.bulletFormatList) {
|
|
4687
|
+
nodeCollection.bulletFormatList = formatCollection.bulletFormatList;
|
|
4688
|
+
}
|
|
4689
|
+
formatCollection = JSON.parse(JSON.stringify(statusCollection));
|
|
4690
|
+
}
|
|
4691
|
+
return nodeCollection;
|
|
4692
|
+
};
|
|
4693
|
+
ToolbarStatus.getImmediateBlockNode = function (node) {
|
|
4694
|
+
do {
|
|
4695
|
+
node = node.parentNode;
|
|
4696
|
+
} while (node && BLOCK_TAGS.indexOf(node.nodeName.toLocaleLowerCase()) < 0);
|
|
4697
|
+
return node;
|
|
4698
|
+
};
|
|
4699
|
+
ToolbarStatus.getFormatParent = function (docElement, formatCollection, node, targetNode, formatNode, fontSize, fontName) {
|
|
4700
|
+
var isListUpdated = false;
|
|
4701
|
+
var isComplexListUpdated = false;
|
|
4702
|
+
if (targetNode.contains(node) ||
|
|
4703
|
+
(node.nodeType === 3 && targetNode.nodeType !== 3 && targetNode.contains(node.parentNode))) {
|
|
4704
|
+
do {
|
|
4705
|
+
formatCollection = this.isFormattedNode(docElement, formatCollection, node, isListUpdated, isComplexListUpdated, formatNode, fontSize, fontName);
|
|
4706
|
+
if (formatCollection.orderedlist || formatCollection.unorderedlist) {
|
|
4707
|
+
isListUpdated = true;
|
|
4708
|
+
}
|
|
4709
|
+
if (formatCollection.bulletFormatList || formatCollection.numberFormatList) {
|
|
4710
|
+
isComplexListUpdated = true;
|
|
4711
|
+
}
|
|
4712
|
+
node = node.parentNode;
|
|
4713
|
+
} while (node && (node !== targetNode));
|
|
4714
|
+
}
|
|
4715
|
+
return formatCollection;
|
|
4716
|
+
};
|
|
4717
|
+
ToolbarStatus.isFormattedNode = function (docElement, formatCollection, node, isListUpdated, isComplexListUpdated, formatNode, fontSize, fontName) {
|
|
4718
|
+
if (!formatCollection.bold) {
|
|
4719
|
+
formatCollection.bold = IsFormatted.isBold(node);
|
|
4720
|
+
}
|
|
4721
|
+
if (!formatCollection.italic) {
|
|
4722
|
+
formatCollection.italic = IsFormatted.isItalic(node);
|
|
4723
|
+
}
|
|
4724
|
+
if (!formatCollection.underline) {
|
|
4725
|
+
formatCollection.underline = IsFormatted.isUnderline(node);
|
|
4726
|
+
}
|
|
4727
|
+
if (!formatCollection.strikethrough) {
|
|
4728
|
+
formatCollection.strikethrough = IsFormatted.isStrikethrough(node);
|
|
4729
|
+
}
|
|
4730
|
+
if (!formatCollection.superscript) {
|
|
4731
|
+
formatCollection.superscript = IsFormatted.isSuperscript(node);
|
|
4732
|
+
}
|
|
4733
|
+
if (!formatCollection.subscript) {
|
|
4734
|
+
formatCollection.subscript = IsFormatted.isSubscript(node);
|
|
4735
|
+
}
|
|
4736
|
+
if (!formatCollection.fontcolor) {
|
|
4737
|
+
formatCollection.fontcolor = this.isFontColor(docElement, node);
|
|
4738
|
+
}
|
|
4739
|
+
if (!formatCollection.fontname) {
|
|
4740
|
+
formatCollection.fontname = this.isFontName(docElement, node, fontName);
|
|
4741
|
+
}
|
|
4742
|
+
if (!formatCollection.fontsize) {
|
|
4743
|
+
formatCollection.fontsize = this.isFontSize(docElement, node, fontSize);
|
|
4744
|
+
}
|
|
4745
|
+
if (!formatCollection.backgroundcolor) {
|
|
4746
|
+
formatCollection.backgroundcolor = this.isBackgroundColor(node);
|
|
4747
|
+
}
|
|
4748
|
+
if (!formatCollection.orderedlist && !isListUpdated) {
|
|
4749
|
+
formatCollection.orderedlist = this.isOrderedList(node);
|
|
4750
|
+
}
|
|
4751
|
+
if (!formatCollection.unorderedlist && !isListUpdated) {
|
|
4752
|
+
formatCollection.unorderedlist = this.isUnorderedList(node);
|
|
4753
|
+
}
|
|
4754
|
+
if (!formatCollection.alignments) {
|
|
4755
|
+
formatCollection.alignments = this.isAlignment(node);
|
|
4756
|
+
}
|
|
4757
|
+
if (!formatCollection.formats) {
|
|
4758
|
+
formatCollection.formats = this.isFormats(node, formatNode);
|
|
4759
|
+
if (formatCollection.formats === 'pre') {
|
|
4760
|
+
formatCollection.insertcode = true;
|
|
4761
|
+
}
|
|
4762
|
+
}
|
|
4763
|
+
if (!formatCollection.createlink) {
|
|
4764
|
+
formatCollection.createlink = this.isLink(node);
|
|
4765
|
+
}
|
|
4766
|
+
if (!formatCollection.numberFormatList && !isComplexListUpdated) {
|
|
4767
|
+
formatCollection.numberFormatList = this.isNumberFormatList(node);
|
|
4768
|
+
}
|
|
4769
|
+
if (!formatCollection.bulletFormatList && !isComplexListUpdated) {
|
|
4770
|
+
formatCollection.bulletFormatList = this.isBulletFormatList(node);
|
|
4771
|
+
}
|
|
4772
|
+
return formatCollection;
|
|
4773
|
+
};
|
|
4774
|
+
ToolbarStatus.isFontColor = function (docElement, node) {
|
|
4775
|
+
var color = node.style && node.style.color;
|
|
4776
|
+
if ((color === null || color === undefined || color === '') && node.nodeType !== 3) {
|
|
4777
|
+
color = this.getComputedStyle(docElement, node, 'color');
|
|
4778
|
+
}
|
|
4779
|
+
if (color !== null && color !== '' && color !== undefined) {
|
|
4780
|
+
return color;
|
|
4781
|
+
}
|
|
4782
|
+
else {
|
|
4783
|
+
return null;
|
|
4784
|
+
}
|
|
4785
|
+
};
|
|
4786
|
+
ToolbarStatus.isLink = function (node) {
|
|
4787
|
+
if (node.nodeName.toLocaleLowerCase() === 'a') {
|
|
4788
|
+
return true;
|
|
4789
|
+
}
|
|
4790
|
+
else {
|
|
4791
|
+
return false;
|
|
4792
|
+
}
|
|
4793
|
+
};
|
|
4794
|
+
ToolbarStatus.isBackgroundColor = function (node) {
|
|
4795
|
+
var backColor = node.style && node.style.backgroundColor;
|
|
4796
|
+
if (backColor !== null && backColor !== '' && backColor !== undefined) {
|
|
4797
|
+
return backColor;
|
|
4798
|
+
}
|
|
4799
|
+
else {
|
|
4800
|
+
return null;
|
|
4801
|
+
}
|
|
4802
|
+
};
|
|
4803
|
+
ToolbarStatus.isFontSize = function (docElement, node, fontSize) {
|
|
4804
|
+
var size = node.style && node.style.fontSize;
|
|
4805
|
+
if ((size === null || size === undefined || size === '') && node.nodeType !== 3 &&
|
|
4806
|
+
node.parentElement.classList.contains('e-content')) {
|
|
4807
|
+
size = this.getComputedStyle(docElement, node, 'font-size');
|
|
4808
|
+
}
|
|
4809
|
+
if ((size !== null && size !== '' && size !== undefined)
|
|
4810
|
+
&& (fontSize === null || fontSize === undefined || (fontSize.indexOf(size) > -1))) {
|
|
4811
|
+
return size;
|
|
4812
|
+
}
|
|
4813
|
+
else {
|
|
4814
|
+
return null;
|
|
4815
|
+
}
|
|
4816
|
+
};
|
|
4817
|
+
ToolbarStatus.isFontName = function (docElement, node, fontName) {
|
|
4818
|
+
var name = node.style && node.style.fontFamily;
|
|
4819
|
+
if ((name === null || name === undefined || name === '') && node.nodeType !== 3) {
|
|
4820
|
+
name = this.getComputedStyle(docElement, node, 'font-family');
|
|
4821
|
+
}
|
|
4822
|
+
var index = null;
|
|
4823
|
+
if ((name !== null && name !== '' && name !== undefined)
|
|
4824
|
+
&& (fontName === null || fontName === undefined || (fontName.filter(function (value, pos) {
|
|
4825
|
+
// eslint-disable-next-line
|
|
4826
|
+
var pattern = new RegExp(name, 'i');
|
|
4827
|
+
if ((value.replace(/"/g, '').replace(/ /g, '').toLowerCase() === name.replace(/"/g, '').replace(/ /g, '').toLowerCase()) ||
|
|
4828
|
+
(value.split(',')[0] && !isNullOrUndefined(value.split(',')[0].trim().match(pattern)) &&
|
|
4829
|
+
value.split(',')[0].trim() === value.split(',')[0].trim().match(pattern)[0])) {
|
|
4830
|
+
index = pos;
|
|
4831
|
+
}
|
|
4832
|
+
}) && (index !== null)))) {
|
|
4833
|
+
// eslint-disable-next-line
|
|
4834
|
+
return (index !== null) ? fontName[index] : name.replace(/"/g, '');
|
|
4835
|
+
}
|
|
4836
|
+
else {
|
|
4837
|
+
return null;
|
|
4838
|
+
}
|
|
4839
|
+
};
|
|
4840
|
+
ToolbarStatus.isOrderedList = function (node) {
|
|
4841
|
+
if (node.nodeName.toLocaleLowerCase() === 'ol') {
|
|
4842
|
+
return true;
|
|
4843
|
+
}
|
|
4844
|
+
else {
|
|
4845
|
+
return false;
|
|
4846
|
+
}
|
|
4847
|
+
};
|
|
4848
|
+
ToolbarStatus.isUnorderedList = function (node) {
|
|
4849
|
+
if (node.nodeName.toLocaleLowerCase() === 'ul') {
|
|
4850
|
+
return true;
|
|
4851
|
+
}
|
|
4852
|
+
else {
|
|
4853
|
+
return false;
|
|
4854
|
+
}
|
|
4855
|
+
};
|
|
4856
|
+
ToolbarStatus.isAlignment = function (node) {
|
|
4857
|
+
var align = node.style && node.style.textAlign;
|
|
4858
|
+
if (align === 'left') {
|
|
4859
|
+
return 'justifyleft';
|
|
4860
|
+
}
|
|
4861
|
+
else if (align === 'center') {
|
|
4862
|
+
return 'justifycenter';
|
|
4863
|
+
}
|
|
4864
|
+
else if (align === 'right') {
|
|
4865
|
+
return 'justifyright';
|
|
4866
|
+
}
|
|
4867
|
+
else if (align === 'justify') {
|
|
4868
|
+
return 'justifyfull';
|
|
4869
|
+
}
|
|
4870
|
+
else {
|
|
4871
|
+
return null;
|
|
4872
|
+
}
|
|
4873
|
+
};
|
|
4874
|
+
ToolbarStatus.isFormats = function (node, formatNode) {
|
|
4875
|
+
if (((formatNode === undefined || formatNode === null)
|
|
4876
|
+
&& BLOCK_TAGS.indexOf(node.nodeName.toLocaleLowerCase()) > -1)
|
|
4877
|
+
|| (formatNode !== null && formatNode !== undefined
|
|
4878
|
+
&& formatNode.indexOf(node.nodeName.toLocaleLowerCase()) > -1)) {
|
|
4879
|
+
return node.nodeName.toLocaleLowerCase();
|
|
4880
|
+
}
|
|
4881
|
+
else {
|
|
4882
|
+
return null;
|
|
4883
|
+
}
|
|
4884
|
+
};
|
|
4885
|
+
ToolbarStatus.getComputedStyle = function (docElement, node, prop) {
|
|
4886
|
+
return docElement.defaultView.getComputedStyle(node, null).getPropertyValue(prop);
|
|
4887
|
+
};
|
|
4888
|
+
ToolbarStatus.isNumberFormatList = function (node) {
|
|
4889
|
+
var list = node.style && node.style.listStyleType;
|
|
4890
|
+
if (list === 'lower-alpha') {
|
|
4891
|
+
return 'Lower Alpha';
|
|
4892
|
+
}
|
|
4893
|
+
else if (list === 'number') {
|
|
4894
|
+
return 'Number';
|
|
4895
|
+
}
|
|
4896
|
+
else if (list === 'upper-alpha') {
|
|
4897
|
+
return 'Upper Alpha';
|
|
4898
|
+
}
|
|
4899
|
+
else if (list === 'lower-roman') {
|
|
4900
|
+
return 'Lower Roman';
|
|
4901
|
+
}
|
|
4902
|
+
else if (list === 'upper-roman') {
|
|
4903
|
+
return 'Upper Roman';
|
|
4904
|
+
}
|
|
4905
|
+
else if (list === 'lower-greek') {
|
|
4906
|
+
return 'Lower Greek';
|
|
4907
|
+
}
|
|
4908
|
+
else if (list === 'none') {
|
|
4909
|
+
return 'None';
|
|
4910
|
+
}
|
|
4911
|
+
else if (this.isOrderedList(node)) {
|
|
4912
|
+
return true;
|
|
4913
|
+
}
|
|
4914
|
+
else {
|
|
4915
|
+
return null;
|
|
4916
|
+
}
|
|
4917
|
+
};
|
|
4918
|
+
ToolbarStatus.isBulletFormatList = function (node) {
|
|
4919
|
+
var list = node.style && node.style.listStyleType;
|
|
4920
|
+
if (list === 'circle') {
|
|
4921
|
+
return 'Circle';
|
|
4922
|
+
}
|
|
4923
|
+
else if (list === 'square') {
|
|
4924
|
+
return 'Square';
|
|
4925
|
+
}
|
|
4926
|
+
else if (list === 'none') {
|
|
4927
|
+
return 'None';
|
|
4928
|
+
}
|
|
4929
|
+
else if (list === 'disc') {
|
|
4930
|
+
return 'Disc';
|
|
4931
|
+
}
|
|
4932
|
+
else if (this.isUnorderedList(node)) {
|
|
4933
|
+
return true;
|
|
4934
|
+
}
|
|
4935
|
+
else {
|
|
4936
|
+
return null;
|
|
4937
|
+
}
|
|
4938
|
+
};
|
|
4939
|
+
return ToolbarStatus;
|
|
4940
|
+
}());
|
|
4941
|
+
|
|
4942
|
+
/**
|
|
4943
|
+
* `Toolbar renderer` module is used to render toolbar in RichTextEditor.
|
|
4944
|
+
*
|
|
4945
|
+
* @hidden
|
|
4946
|
+
* @deprecated
|
|
4947
|
+
*/
|
|
4948
|
+
var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
4949
|
+
/**
|
|
4950
|
+
* Constructor for toolbar renderer module
|
|
4951
|
+
*
|
|
4952
|
+
* @param {IRichTextEditor} parent - specifies the parent element.
|
|
4953
|
+
* @param {ServiceLocator} serviceLocator - specifies the serviceLocator
|
|
4954
|
+
*/
|
|
4955
|
+
function ToolbarRenderer(parent, serviceLocator) {
|
|
4956
|
+
this.parent = parent;
|
|
4957
|
+
if (serviceLocator) {
|
|
4958
|
+
this.l10n = serviceLocator.getService('rteLocale');
|
|
4959
|
+
}
|
|
4960
|
+
this.wireEvent();
|
|
4961
|
+
}
|
|
4962
|
+
ToolbarRenderer.prototype.wireEvent = function () {
|
|
4963
|
+
this.parent.on(destroy, this.unWireEvent, this);
|
|
4964
|
+
this.parent.on(destroyTooltip, this.destroyTooltip, this);
|
|
4965
|
+
this.parent.on(closeTooltip, this.closeTooltip, this);
|
|
4966
|
+
};
|
|
4967
|
+
ToolbarRenderer.prototype.destroyTooltip = function () {
|
|
4968
|
+
var currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
|
|
4969
|
+
this.parent.contentModule.getDocument();
|
|
4970
|
+
if (!isNullOrUndefined(currentDocument.querySelector('.e-tooltip-wrap')) && !isNullOrUndefined(currentDocument.querySelector('[data-tooltip-id]'))) {
|
|
4971
|
+
var tooltipTargetEle = currentDocument.querySelector('[data-tooltip-id]');
|
|
4972
|
+
var event_1 = new MouseEvent('mouseleave', { bubbles: true, cancelable: true });
|
|
4973
|
+
tooltipTargetEle.dispatchEvent(event_1);
|
|
4974
|
+
}
|
|
4975
|
+
};
|
|
4976
|
+
ToolbarRenderer.prototype.unWireEvent = function () {
|
|
4977
|
+
this.parent.off(destroy, this.unWireEvent);
|
|
4978
|
+
this.parent.off(destroyTooltip, this.destroyTooltip);
|
|
4979
|
+
this.parent.off(closeTooltip, this.closeTooltip);
|
|
4980
|
+
};
|
|
4981
|
+
ToolbarRenderer.prototype.toolbarBeforeCreate = function (e) {
|
|
4982
|
+
if (this.mode === 'Extended') {
|
|
4983
|
+
e.enableCollision = false;
|
|
4984
|
+
}
|
|
4985
|
+
};
|
|
4986
|
+
ToolbarRenderer.prototype.toolbarCreated = function () {
|
|
4987
|
+
this.parent.notify(toolbarCreated, this);
|
|
4988
|
+
};
|
|
4989
|
+
ToolbarRenderer.prototype.toolbarClicked = function (args) {
|
|
4990
|
+
if (!this.parent.enabled) {
|
|
4991
|
+
return;
|
|
4992
|
+
}
|
|
4993
|
+
this.parent.trigger('toolbarClick', args);
|
|
4994
|
+
if (!this.parent.readonly || isNullOrUndefined(args.item)) {
|
|
4995
|
+
this.parent.notify(toolbarClick, args);
|
|
4996
|
+
}
|
|
4997
|
+
};
|
|
4998
|
+
ToolbarRenderer.prototype.dropDownSelected = function (args) {
|
|
4999
|
+
this.parent.notify(dropDownSelect, { element: args.element, item: args.item, originalEvent: args.event });
|
|
5000
|
+
this.destroyTooltip();
|
|
5001
|
+
};
|
|
5002
|
+
ToolbarRenderer.prototype.beforeDropDownItemRender = function (args) {
|
|
5003
|
+
if (this.parent.readonly || !this.parent.enabled) {
|
|
5004
|
+
return;
|
|
5005
|
+
}
|
|
5006
|
+
this.parent.notify(beforeDropDownItemRender, args);
|
|
5007
|
+
};
|
|
5008
|
+
ToolbarRenderer.prototype.tooltipBeforeRender = function (args) {
|
|
5009
|
+
if (!isNullOrUndefined(args.target.getAttribute('title'))) {
|
|
5010
|
+
var tooltipTarget = args.target.getAttribute('title');
|
|
5011
|
+
var tooltipText = void 0;
|
|
5012
|
+
switch (tooltipTarget) {
|
|
5013
|
+
case 'Minimize':
|
|
5014
|
+
tooltipText = this.l10n.getConstant('minimize');
|
|
5015
|
+
args.target.setAttribute('title', tooltipText + ' (Esc)');
|
|
5016
|
+
break;
|
|
5017
|
+
case 'Maximize':
|
|
5018
|
+
tooltipText = this.l10n.getConstant('maximize');
|
|
5019
|
+
args.target.setAttribute('title', tooltipText + ' (Ctrl+Shift+F)');
|
|
5020
|
+
break;
|
|
5021
|
+
}
|
|
5022
|
+
}
|
|
5023
|
+
if (args.target.querySelector('.e-active')) {
|
|
5024
|
+
args.cancel = true;
|
|
5025
|
+
}
|
|
3670
5026
|
};
|
|
3671
5027
|
ToolbarRenderer.prototype.dropDownOpen = function (args) {
|
|
3672
5028
|
if (args.element.parentElement.getAttribute('id').indexOf('TableCell') > -1 && !isNullOrUndefined(args.element.parentElement.querySelector('.e-cell-merge')) &&
|
|
@@ -3689,19 +5045,6 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3689
5045
|
addClass([listEle[1], listEle[2]], 'e-disabled');
|
|
3690
5046
|
}
|
|
3691
5047
|
}
|
|
3692
|
-
if (this.parent.showTooltip) {
|
|
3693
|
-
this.dropdownTooltip = new Tooltip({
|
|
3694
|
-
target: '[aria-owns="' + this.parent.getID() + '"].e-rte-elements [title]',
|
|
3695
|
-
showTipPointer: true,
|
|
3696
|
-
openDelay: 400,
|
|
3697
|
-
opensOn: 'Hover',
|
|
3698
|
-
beforeRender: this.tooltipBeforeRender.bind(this),
|
|
3699
|
-
cssClass: this.parent.getCssClass(),
|
|
3700
|
-
windowCollision: true,
|
|
3701
|
-
position: 'BottomCenter'
|
|
3702
|
-
});
|
|
3703
|
-
this.dropdownTooltip.appendTo(args.element);
|
|
3704
|
-
}
|
|
3705
5048
|
this.parent.notify(selectionSave, args);
|
|
3706
5049
|
};
|
|
3707
5050
|
ToolbarRenderer.prototype.dropDownClose = function (args) {
|
|
@@ -3847,11 +5190,22 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3847
5190
|
}
|
|
3848
5191
|
//Formats preselect
|
|
3849
5192
|
if (args.items[0].command === 'Formats' || args.items[0].command === 'Font') {
|
|
5193
|
+
var fontName_1 = [];
|
|
5194
|
+
var formats_1 = [];
|
|
5195
|
+
_this.parent.format.types.forEach(function (item) {
|
|
5196
|
+
formats_1.push(item.value.toLocaleLowerCase());
|
|
5197
|
+
});
|
|
5198
|
+
_this.parent.fontFamily.items.forEach(function (item) {
|
|
5199
|
+
fontName_1.push(item.value);
|
|
5200
|
+
});
|
|
5201
|
+
var toolbarStatus = ToolbarStatus.get(_this.parent.contentModule.getDocument(), _this.parent.contentModule.getEditPanel(), formats_1, null, fontName_1);
|
|
3850
5202
|
for (var index = 0; index < args.element.childNodes.length; index++) {
|
|
3851
5203
|
var divNode = _this.parent.createElement('div');
|
|
3852
5204
|
divNode.innerHTML = dropDown.content.trim();
|
|
3853
|
-
if (divNode.textContent.trim() !== ''
|
|
3854
|
-
&& args.element.childNodes[index].textContent.trim() === divNode.textContent.trim())
|
|
5205
|
+
if ((divNode.textContent.trim() !== ''
|
|
5206
|
+
&& args.element.childNodes[index].textContent.trim() === divNode.textContent.trim()) ||
|
|
5207
|
+
((args.items[0].command === 'Formats' && !isNullOrUndefined(toolbarStatus.formats) && _this.parent.format.types[index].value.toLowerCase() === toolbarStatus.formats.toLowerCase() && args.element.childNodes[index].classList.contains(_this.parent.format.types[index].cssClass))
|
|
5208
|
+
|| (args.items[0].command === 'Font' && !isNullOrUndefined(toolbarStatus.fontname) && _this.parent.fontFamily.items[index].value.toLowerCase() === toolbarStatus.fontname.toLowerCase() && args.element.childNodes[index].classList.contains(_this.parent.fontFamily.items[index].cssClass)))) {
|
|
3855
5209
|
if (!args.element.childNodes[index].classList.contains('e-active')) {
|
|
3856
5210
|
addClass([args.element.childNodes[index]], 'e-active');
|
|
3857
5211
|
}
|
|
@@ -4037,6 +5391,8 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
4037
5391
|
target: colorPicker.element.parentElement, cssClass: css,
|
|
4038
5392
|
enablePersistence: this.parent.enablePersistence, enableRtl: this.parent.enableRtl,
|
|
4039
5393
|
beforeOpen: function (dropDownArgs) {
|
|
5394
|
+
colorPicker.inline = true;
|
|
5395
|
+
colorPicker.dataBind();
|
|
4040
5396
|
if (proxy.parent.readonly || !proxy.parent.enabled) {
|
|
4041
5397
|
dropDownArgs.cancel = true;
|
|
4042
5398
|
return;
|
|
@@ -4175,18 +5531,14 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
4175
5531
|
var colorPicker = new ColorPicker({
|
|
4176
5532
|
enablePersistence: this.parent.enablePersistence,
|
|
4177
5533
|
enableRtl: this.parent.enableRtl,
|
|
4178
|
-
inline:
|
|
4179
|
-
value:
|
|
4180
|
-
cssClass: ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_PICKER : CLS_FONT_COLOR_PICKER) + ' ' + args.cssClass + ' ' + 'e-rte-picker-init',
|
|
5534
|
+
inline: false,
|
|
5535
|
+
value: '#fff',
|
|
4181
5536
|
created: function () {
|
|
4182
5537
|
var value = (item === 'backgroundcolor') ? proxy.parent.backgroundColor.default : proxy.parent.fontColor.default;
|
|
4183
|
-
colorPicker.
|
|
4184
|
-
colorPicker.value = value;
|
|
5538
|
+
colorPicker.setProperties({ value: value });
|
|
4185
5539
|
},
|
|
4186
5540
|
mode: ((item === 'backgroundcolor') ? proxy.parent.backgroundColor.mode : proxy.parent.fontColor.mode),
|
|
4187
5541
|
modeSwitcher: ((item === 'backgroundcolor') ? proxy.parent.backgroundColor.modeSwitcher : proxy.parent.fontColor.modeSwitcher),
|
|
4188
|
-
presetColors: (item === 'backgroundcolor') ? this.parent.backgroundColor.colorCode : this.parent.fontColor.colorCode,
|
|
4189
|
-
columns: (item === 'backgroundcolor') ? this.parent.backgroundColor.columns : this.parent.fontColor.columns,
|
|
4190
5542
|
beforeTileRender: function (args) {
|
|
4191
5543
|
args.element.classList.add(CLS_COLOR_PALETTE);
|
|
4192
5544
|
args.element.classList.add(CLS_CUSTOM_TILE);
|
|
@@ -4231,6 +5583,10 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
4231
5583
|
}
|
|
4232
5584
|
});
|
|
4233
5585
|
colorPicker.isStringTemplate = true;
|
|
5586
|
+
colorPicker.columns = (item === 'backgroundcolor') ? this.parent.backgroundColor.columns : this.parent.fontColor.columns;
|
|
5587
|
+
colorPicker.presetColors = (item === 'backgroundcolor') ? this.parent.backgroundColor.colorCode :
|
|
5588
|
+
this.parent.fontColor.colorCode;
|
|
5589
|
+
colorPicker.cssClass = ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_PICKER : CLS_FONT_COLOR_PICKER) + ' ' + args.cssClass;
|
|
4234
5590
|
colorPicker.createElement = this.parent.createElement;
|
|
4235
5591
|
colorPicker.appendTo(document.getElementById(args.target));
|
|
4236
5592
|
return colorPicker;
|
|
@@ -4435,15 +5791,16 @@ var BaseToolbar = /** @__PURE__ @class */ (function () {
|
|
|
4435
5791
|
for (var num = 0; num < items.length; num++) {
|
|
4436
5792
|
var tooltipText = items[num].tooltipText;
|
|
4437
5793
|
var shortCutKey = void 0;
|
|
5794
|
+
var isMacDev = window.navigator.platform.toLocaleLowerCase().includes('mac');
|
|
4438
5795
|
if (windowKeys["" + tooltipText]) {
|
|
4439
|
-
shortCutKey =
|
|
5796
|
+
shortCutKey = isMacDev ? windowKeys["" + tooltipText].replace('Ctrl+', '⌘').replace('Shift+', '⇧').replace('Alt+', '⌥') : windowKeys["" + tooltipText];
|
|
4440
5797
|
}
|
|
4441
5798
|
else {
|
|
4442
5799
|
shortCutKey = tooltipText;
|
|
4443
5800
|
}
|
|
4444
5801
|
if (shortCutKey) {
|
|
4445
5802
|
if (!(items[num].command === "Images" && items[num].subCommand === "InsertLink")) {
|
|
4446
|
-
items[num].tooltipText = (tooltipText !== shortCutKey) ? tooltipText + ' (' + shortCutKey + ')' : tooltipText;
|
|
5803
|
+
items[num].tooltipText = (tooltipText !== shortCutKey) ? (isMacDev) ? shortCutKey : tooltipText + ' (' + shortCutKey + ')' : tooltipText;
|
|
4447
5804
|
}
|
|
4448
5805
|
}
|
|
4449
5806
|
}
|
|
@@ -4494,28 +5851,10 @@ var DropDownButtons = /** @__PURE__ @class */ (function () {
|
|
|
4494
5851
|
if (item.cssClass) {
|
|
4495
5852
|
addClass([args.element], item.cssClass);
|
|
4496
5853
|
}
|
|
4497
|
-
if (item.command === 'Images' || item.command === 'Videos' || item.command === 'Audios' || item.command === 'Table') {
|
|
4498
|
-
args.element.setAttribute('title', getQuickToolbarTooltipText(item.text) !== '' ? getQuickToolbarTooltipText(item.text) : item.text);
|
|
4499
|
-
}
|
|
4500
5854
|
if (item.command === 'Alignments' || item.subCommand === 'JustifyLeft'
|
|
4501
5855
|
|| item.subCommand === 'JustifyRight' || item.subCommand === 'JustifyCenter') {
|
|
4502
5856
|
args.element.setAttribute('title', getTooltipText(item.subCommand.toLocaleLowerCase(), this.locator));
|
|
4503
5857
|
}
|
|
4504
|
-
if (item.command === 'Formats') {
|
|
4505
|
-
args.element.setAttribute('title', getTooltipTextDropdownItems(item.subCommand.toLocaleLowerCase(), this.locator, formatsLocale));
|
|
4506
|
-
}
|
|
4507
|
-
if (item.command === 'Font') {
|
|
4508
|
-
args.element.setAttribute('title', getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, fontNameLocale) !== '' ? getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, fontNameLocale) : item.text);
|
|
4509
|
-
}
|
|
4510
|
-
if (item.subCommand === 'BulletFormatList') {
|
|
4511
|
-
args.element.setAttribute('title', getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, bulletFormatListLocale) !== '' ? getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, bulletFormatListLocale) : item.text);
|
|
4512
|
-
}
|
|
4513
|
-
if (item.subCommand === 'NumberFormatList') {
|
|
4514
|
-
args.element.setAttribute('title', (getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, numberFormatListLocale)) !== '' ? getTooltipTextDropdownItems(item.text.toLocaleLowerCase(), this.locator, numberFormatListLocale) : item.text);
|
|
4515
|
-
}
|
|
4516
|
-
if (item.subCommand === 'FontSize') {
|
|
4517
|
-
args.element.setAttribute('title', getTooltipTextDropdownItems(item.value.toLocaleLowerCase(), null, null, this.parent));
|
|
4518
|
-
}
|
|
4519
5858
|
};
|
|
4520
5859
|
DropDownButtons.prototype.dropdownContent = function (width, type, content) {
|
|
4521
5860
|
return ('<span style="display: inline-flex;' + 'width:' + ((type === 'quick') ? 'auto' : width) + '" >' +
|
|
@@ -4821,7 +6160,7 @@ var DropDownButtons = /** @__PURE__ @class */ (function () {
|
|
|
4821
6160
|
if (targetElement.classList.contains(CLS_DROPDOWN_BTN)) {
|
|
4822
6161
|
return;
|
|
4823
6162
|
}
|
|
4824
|
-
this.
|
|
6163
|
+
this.tableCellDropDown = this.toolbarRenderer.renderDropDownButton({
|
|
4825
6164
|
iconCss: 'e-table-cell e-icons',
|
|
4826
6165
|
cssClass: CLS_DROPDOWN_POPUP + ' ' + CLS_DROPDOWN_ITEMS + ' ' + CLS_QUICK_DROPDOWN,
|
|
4827
6166
|
itemName: 'TableCell',
|
|
@@ -4929,6 +6268,10 @@ var DropDownButtons = /** @__PURE__ @class */ (function () {
|
|
|
4929
6268
|
this.removeDropDownClasses(this.tableColumnsDropDown.element);
|
|
4930
6269
|
this.tableColumnsDropDown.destroy();
|
|
4931
6270
|
}
|
|
6271
|
+
if (this.tableCellDropDown) {
|
|
6272
|
+
this.removeDropDownClasses(this.tableCellDropDown.element);
|
|
6273
|
+
this.tableCellDropDown.destroy();
|
|
6274
|
+
}
|
|
4932
6275
|
if (this.tableCellVerticalAlignDropDown) {
|
|
4933
6276
|
this.removeDropDownClasses(this.tableCellVerticalAlignDropDown.element);
|
|
4934
6277
|
this.tableCellVerticalAlignDropDown.destroy();
|
|
@@ -4982,7 +6325,7 @@ var DropDownButtons = /** @__PURE__ @class */ (function () {
|
|
|
4982
6325
|
var dropDownObj = [
|
|
4983
6326
|
this.formatDropDown, this.fontNameDropDown, this.fontSizeDropDown, this.alignDropDown, this.imageAlignDropDown,
|
|
4984
6327
|
this.displayDropDown, this.numberFormatListDropDown, this.bulletFormatListDropDown, this.tableRowsDropDown,
|
|
4985
|
-
this.tableColumnsDropDown, this.tableCellVerticalAlignDropDown
|
|
6328
|
+
this.tableColumnsDropDown, this.tableCellDropDown, this.tableCellVerticalAlignDropDown
|
|
4986
6329
|
];
|
|
4987
6330
|
for (var i = 0; i < dropDownObj.length; i++) {
|
|
4988
6331
|
this.updateCss(dropDownObj[i], e);
|
|
@@ -5000,7 +6343,7 @@ var DropDownButtons = /** @__PURE__ @class */ (function () {
|
|
|
5000
6343
|
this.parent.on(bindCssClass, this.setCssClass, this);
|
|
5001
6344
|
};
|
|
5002
6345
|
DropDownButtons.prototype.onIframeMouseDown = function () {
|
|
5003
|
-
if (this.parent.getToolbarElement().querySelectorAll('.e-rte-dropdown-btn[aria-expanded="true"]').length > 0) {
|
|
6346
|
+
if (!isNullOrUndefined(this.parent.getToolbarElement()) && (this.parent.getToolbarElement().querySelectorAll('.e-rte-dropdown-btn[aria-expanded="true"]').length > 0 || this.parent.getToolbarElement().querySelectorAll('.e-dropdown-btn.e-rte-inline-dropdown[aria-expanded="true"]').length > 0)) {
|
|
5004
6347
|
dispatchEvent(document, 'mousedown');
|
|
5005
6348
|
}
|
|
5006
6349
|
};
|
|
@@ -6400,26 +7743,19 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6400
7743
|
}
|
|
6401
7744
|
target = isAligned ? e.target : target;
|
|
6402
7745
|
var targetOffsetLeft;
|
|
6403
|
-
var currentOffsetWidth;
|
|
6404
7746
|
if (!isNullOrUndefined(closest(target, 'table'))) {
|
|
6405
7747
|
targetOffsetLeft = target.offsetLeft;
|
|
6406
|
-
var parentTable = closest(target, '
|
|
6407
|
-
var checkOffSetParentWidth = false;
|
|
6408
|
-
if (!isNullOrUndefined(closest(parentTable, 'TD'))) {
|
|
6409
|
-
checkOffSetParentWidth = true;
|
|
6410
|
-
}
|
|
7748
|
+
var parentTable = closest(target.parentElement, 'td');
|
|
6411
7749
|
while (!isNullOrUndefined(parentTable)) {
|
|
6412
7750
|
targetOffsetLeft += parentTable.offsetLeft;
|
|
6413
|
-
currentOffsetWidth = checkOffSetParentWidth ? parentTable.offsetWidth : target.offsetWidth;
|
|
6414
7751
|
parentTable = closest(parentTable.parentElement, 'table');
|
|
6415
7752
|
}
|
|
6416
7753
|
}
|
|
6417
7754
|
else {
|
|
6418
|
-
currentOffsetWidth = target.offsetWidth;
|
|
6419
7755
|
targetOffsetLeft = (target.classList.contains("e-rte-audio")) ? target.parentElement.offsetLeft : target.offsetLeft;
|
|
6420
7756
|
}
|
|
6421
|
-
if (
|
|
6422
|
-
x = (
|
|
7757
|
+
if (target.offsetWidth > e.popWidth) {
|
|
7758
|
+
x = (target.offsetWidth / 2) - (e.popWidth / 2) + e.parentData.left + targetOffsetLeft;
|
|
6423
7759
|
}
|
|
6424
7760
|
else {
|
|
6425
7761
|
x = e.parentData.left + targetOffsetLeft;
|
|
@@ -6559,6 +7895,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6559
7895
|
target: '#' + _this.element.id + ' [title]',
|
|
6560
7896
|
openDelay: 400,
|
|
6561
7897
|
showTipPointer: true,
|
|
7898
|
+
beforeRender: _this.tooltipBeforeRender.bind(_this),
|
|
6562
7899
|
windowCollision: true,
|
|
6563
7900
|
position: 'BottomCenter',
|
|
6564
7901
|
cssClass: _this.parent.getCssClass()
|
|
@@ -6619,6 +7956,11 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6619
7956
|
}
|
|
6620
7957
|
});
|
|
6621
7958
|
};
|
|
7959
|
+
BaseQuickToolbar.prototype.tooltipBeforeRender = function (args) {
|
|
7960
|
+
if (args.target.querySelector('.e-active')) {
|
|
7961
|
+
args.cancel = true;
|
|
7962
|
+
}
|
|
7963
|
+
};
|
|
6622
7964
|
/**
|
|
6623
7965
|
* hidePopup method
|
|
6624
7966
|
*
|
|
@@ -6651,9 +7993,6 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6651
7993
|
this.parent.enableToolbarItem(this.parent.toolbarSettings.items);
|
|
6652
7994
|
}
|
|
6653
7995
|
}
|
|
6654
|
-
if (this.parent.showTooltip && !isNullOrUndefined(document.querySelector('.e-tooltip-wrap'))) {
|
|
6655
|
-
this.parent.notify(destroyTooltip, { args: event });
|
|
6656
|
-
}
|
|
6657
7996
|
this.removeEleFromDOM();
|
|
6658
7997
|
this.isRendered = false;
|
|
6659
7998
|
};
|
|
@@ -6865,6 +8204,7 @@ var PopupRenderer = /** @__PURE__ @class */ (function () {
|
|
|
6865
8204
|
*/
|
|
6866
8205
|
var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
6867
8206
|
function QuickToolbar(parent, locator) {
|
|
8207
|
+
this.debounceTimeout = 1000;
|
|
6868
8208
|
this.parent = parent;
|
|
6869
8209
|
this.locator = locator;
|
|
6870
8210
|
this.renderFactory = this.locator.getService('rendererFactory');
|
|
@@ -7056,7 +8396,7 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
7056
8396
|
clearTimeout(this.deBouncer);
|
|
7057
8397
|
this.deBouncer = window.setTimeout(function () {
|
|
7058
8398
|
_this.showInlineQTBar(x, y, target);
|
|
7059
|
-
},
|
|
8399
|
+
}, this.debounceTimeout);
|
|
7060
8400
|
};
|
|
7061
8401
|
QuickToolbar.prototype.mouseUpHandler = function (e) {
|
|
7062
8402
|
if (this.parent.inlineMode.enable && (!Browser.isDevice || isIDevice())) {
|
|
@@ -7106,7 +8446,7 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
7106
8446
|
this.offsetY = pageYOffset(args, this.parent.element, this.parent.iframeSettings.enable);
|
|
7107
8447
|
var range = this.parent.getRange();
|
|
7108
8448
|
if ((range.endContainer.parentElement.tagName === range.startContainer.parentElement.tagName && (range.startContainer.parentElement.tagName === 'A' && range.endContainer.parentElement.tagName === 'A')) ||
|
|
7109
|
-
(target.tagName === 'IMG') || (target.tagName === 'VIDEO') || (target.tagName === 'AUDIO') || (target.childNodes[0] && target.childNodes[0].nodeType === 1 && target.childNodes[0].classList.contains('e-rte-audio')) ||
|
|
8449
|
+
(target.tagName === 'IMG') || (target.tagName === 'VIDEO' || this.isEmbedVidElem(target)) || (target.tagName === 'AUDIO') || (target.childNodes[0] && target.childNodes[0].nodeType === 1 && target.childNodes[0].classList.contains('e-rte-audio')) ||
|
|
7110
8450
|
(this.parent.getRange().startOffset === this.parent.getRange().endOffset)) {
|
|
7111
8451
|
return;
|
|
7112
8452
|
}
|
|
@@ -7114,6 +8454,15 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
7114
8454
|
this.textQTBar.showPopup(this.offsetX, this.offsetY, target, 'text');
|
|
7115
8455
|
}
|
|
7116
8456
|
};
|
|
8457
|
+
QuickToolbar.prototype.isEmbedVidElem = function (target) {
|
|
8458
|
+
if ((target && target.nodeType !== 3 && target.nodeName !== 'BR' && (target.classList && target.classList.contains(CLS_VID_CLICK_ELEM))) ||
|
|
8459
|
+
(target && target.nodeName === 'IFRAME')) {
|
|
8460
|
+
return true;
|
|
8461
|
+
}
|
|
8462
|
+
else {
|
|
8463
|
+
return false;
|
|
8464
|
+
}
|
|
8465
|
+
};
|
|
7117
8466
|
QuickToolbar.prototype.keyDownHandler = function (e) {
|
|
7118
8467
|
var preventHide = e.args.altKey;
|
|
7119
8468
|
if (this.parent.inlineMode.enable && e.args.metaKey && e.args.keyCode === 65) {
|
|
@@ -7169,7 +8518,7 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
7169
8518
|
clearTimeout(this.deBouncer);
|
|
7170
8519
|
this.deBouncer = window.setTimeout(function () {
|
|
7171
8520
|
_this.onSelectionChange(e);
|
|
7172
|
-
},
|
|
8521
|
+
}, this.debounceTimeout);
|
|
7173
8522
|
};
|
|
7174
8523
|
QuickToolbar.prototype.onSelectionChange = function (e) {
|
|
7175
8524
|
if (!isNullOrUndefined(select('.' + CLS_INLINE_POP, document.body))) {
|
|
@@ -7811,228 +9160,6 @@ var MarkdownSelection = /** @__PURE__ @class */ (function () {
|
|
|
7811
9160
|
return MarkdownSelection;
|
|
7812
9161
|
}());
|
|
7813
9162
|
|
|
7814
|
-
/**
|
|
7815
|
-
* Defines common util methods used by Rich Text Editor.
|
|
7816
|
-
*/
|
|
7817
|
-
var inlineNode$1 = ['a', 'abbr', 'acronym', 'audio', 'b', 'bdi', 'bdo', 'big', 'br', 'button',
|
|
7818
|
-
'canvas', 'cite', 'code', 'data', 'datalist', 'del', 'dfn', 'em', 'embed', 'font', 'i', 'iframe', 'img', 'input',
|
|
7819
|
-
'ins', 'kbd', 'label', 'map', 'mark', 'meter', 'noscript', 'object', 'output', 'picture', 'progress',
|
|
7820
|
-
'q', 'ruby', 's', 'samp', 'script', 'select', 'slot', 'small', 'span', 'strong', 'strike', 'sub', 'sup', 'svg',
|
|
7821
|
-
'template', 'textarea', 'time', 'u', 'tt', 'var', 'video', 'wbr'];
|
|
7822
|
-
/**
|
|
7823
|
-
* @returns {void}
|
|
7824
|
-
* @hidden
|
|
7825
|
-
*/
|
|
7826
|
-
function isIDevice$1() {
|
|
7827
|
-
var result = false;
|
|
7828
|
-
if (Browser.isDevice && Browser.isIos) {
|
|
7829
|
-
result = true;
|
|
7830
|
-
}
|
|
7831
|
-
return result;
|
|
7832
|
-
}
|
|
7833
|
-
/**
|
|
7834
|
-
* @param {Element} editableElement - specifies the editable element.
|
|
7835
|
-
* @param {string} selector - specifies the string values.
|
|
7836
|
-
* @returns {void}
|
|
7837
|
-
* @hidden
|
|
7838
|
-
*/
|
|
7839
|
-
function setEditFrameFocus(editableElement, selector) {
|
|
7840
|
-
if (editableElement.nodeName === 'BODY' && !isNullOrUndefined(selector)) {
|
|
7841
|
-
var iframe = top.window.document.querySelector(selector);
|
|
7842
|
-
if (!isNullOrUndefined(iframe)) {
|
|
7843
|
-
iframe.contentWindow.focus();
|
|
7844
|
-
}
|
|
7845
|
-
}
|
|
7846
|
-
}
|
|
7847
|
-
/**
|
|
7848
|
-
* @param {string} value - specifies the string value
|
|
7849
|
-
* @param {string} enterAction - specifies the enter key action API
|
|
7850
|
-
* @returns {void}
|
|
7851
|
-
* @hidden
|
|
7852
|
-
*/
|
|
7853
|
-
function updateTextNode$1(value, enterAction) {
|
|
7854
|
-
var tempNode = document.createElement('div');
|
|
7855
|
-
tempNode.innerHTML = value;
|
|
7856
|
-
tempNode.setAttribute('class', 'tempDiv');
|
|
7857
|
-
var resultElm = document.createElement('div');
|
|
7858
|
-
var childNodes = tempNode.childNodes;
|
|
7859
|
-
if (childNodes.length > 0) {
|
|
7860
|
-
var isPreviousInlineElem = void 0;
|
|
7861
|
-
var previousParent = void 0;
|
|
7862
|
-
var paraElm = void 0;
|
|
7863
|
-
while (tempNode.firstChild) {
|
|
7864
|
-
if ((tempNode.firstChild.nodeName === '#text' &&
|
|
7865
|
-
(tempNode.firstChild.textContent.indexOf('\n') < 0 || tempNode.firstChild.textContent.trim() !== '')) ||
|
|
7866
|
-
inlineNode$1.indexOf(tempNode.firstChild.nodeName.toLocaleLowerCase()) >= 0) {
|
|
7867
|
-
if (!isPreviousInlineElem) {
|
|
7868
|
-
if (enterAction === 'BR') {
|
|
7869
|
-
resultElm.appendChild(tempNode.firstChild);
|
|
7870
|
-
previousParent = resultElm;
|
|
7871
|
-
}
|
|
7872
|
-
else {
|
|
7873
|
-
paraElm = createElement('p');
|
|
7874
|
-
resultElm.appendChild(paraElm);
|
|
7875
|
-
paraElm.appendChild(tempNode.firstChild);
|
|
7876
|
-
previousParent = paraElm;
|
|
7877
|
-
isPreviousInlineElem = true;
|
|
7878
|
-
}
|
|
7879
|
-
}
|
|
7880
|
-
else {
|
|
7881
|
-
previousParent.appendChild(tempNode.firstChild);
|
|
7882
|
-
previousParent = paraElm;
|
|
7883
|
-
isPreviousInlineElem = true;
|
|
7884
|
-
}
|
|
7885
|
-
}
|
|
7886
|
-
else if (tempNode.firstChild.nodeName === '#text' && (tempNode.firstChild.textContent === '\n' ||
|
|
7887
|
-
(tempNode.firstChild.textContent.indexOf('\n') >= 0 && tempNode.firstChild.textContent.trim() === ''))) {
|
|
7888
|
-
detach(tempNode.firstChild);
|
|
7889
|
-
}
|
|
7890
|
-
else {
|
|
7891
|
-
resultElm.appendChild(tempNode.firstChild);
|
|
7892
|
-
isPreviousInlineElem = false;
|
|
7893
|
-
}
|
|
7894
|
-
}
|
|
7895
|
-
var tableElm = resultElm.querySelectorAll('table');
|
|
7896
|
-
for (var i = 0; i < tableElm.length; i++) {
|
|
7897
|
-
if (tableElm[i].classList.length > 0 && !tableElm[i].classList.contains('e-rte-table')) {
|
|
7898
|
-
tableElm[i].classList.add('e-rte-paste-table');
|
|
7899
|
-
if (tableElm[i].classList.contains('e-rte-paste-word-table')) {
|
|
7900
|
-
tableElm[i].classList.remove('e-rte-paste-word-table');
|
|
7901
|
-
continue; // Skiping the removal of the border if the source is from word.
|
|
7902
|
-
}
|
|
7903
|
-
else if (tableElm[i].classList.contains('e-rte-paste-excel-table')) {
|
|
7904
|
-
tableElm[i].classList.remove('e-rte-paste-excel-table');
|
|
7905
|
-
if (tableElm[i].getAttribute('border') === '0') {
|
|
7906
|
-
tableElm[i].removeAttribute('border');
|
|
7907
|
-
}
|
|
7908
|
-
var tdElm = tableElm[i].querySelectorAll('td');
|
|
7909
|
-
for (var j = 0; j < tdElm.length; j++) {
|
|
7910
|
-
if (tdElm[j].style.borderLeft === 'none') {
|
|
7911
|
-
tdElm[j].style.removeProperty('border-left');
|
|
7912
|
-
}
|
|
7913
|
-
if (tdElm[j].style.borderRight === 'none') {
|
|
7914
|
-
tdElm[j].style.removeProperty('border-right');
|
|
7915
|
-
}
|
|
7916
|
-
if (tdElm[j].style.borderBottom === 'none') {
|
|
7917
|
-
tdElm[j].style.removeProperty('border-bottom');
|
|
7918
|
-
}
|
|
7919
|
-
if (tdElm[j].style.borderTop === 'none') {
|
|
7920
|
-
tdElm[j].style.removeProperty('border-top');
|
|
7921
|
-
}
|
|
7922
|
-
if (tdElm[j].style.border === 'none') {
|
|
7923
|
-
tdElm[j].style.removeProperty('border');
|
|
7924
|
-
}
|
|
7925
|
-
}
|
|
7926
|
-
}
|
|
7927
|
-
else if (tableElm[i].classList.contains('e-rte-paste-onenote-table')) {
|
|
7928
|
-
tableElm[i].classList.remove('e-rte-paste-onenote-table');
|
|
7929
|
-
continue;
|
|
7930
|
-
}
|
|
7931
|
-
}
|
|
7932
|
-
}
|
|
7933
|
-
var imageElm = resultElm.querySelectorAll('img');
|
|
7934
|
-
for (var i = 0; i < imageElm.length; i++) {
|
|
7935
|
-
if (imageElm[i].classList.contains('e-rte-image-unsupported')) {
|
|
7936
|
-
continue; // Should not add the class if the image is Broken.
|
|
7937
|
-
}
|
|
7938
|
-
if (!imageElm[i].classList.contains('e-rte-image')) {
|
|
7939
|
-
imageElm[i].classList.add('e-rte-image');
|
|
7940
|
-
}
|
|
7941
|
-
if (!(imageElm[i].classList.contains('e-imginline') ||
|
|
7942
|
-
imageElm[i].classList.contains('e-imgbreak'))) {
|
|
7943
|
-
imageElm[i].classList.add('e-imginline');
|
|
7944
|
-
}
|
|
7945
|
-
}
|
|
7946
|
-
}
|
|
7947
|
-
return resultElm.innerHTML;
|
|
7948
|
-
}
|
|
7949
|
-
/**
|
|
7950
|
-
* @param {Node} startChildNodes - specifies the node
|
|
7951
|
-
* @returns {void}
|
|
7952
|
-
* @hidden
|
|
7953
|
-
*/
|
|
7954
|
-
function getLastTextNode(startChildNodes) {
|
|
7955
|
-
var finalNode = startChildNodes;
|
|
7956
|
-
do {
|
|
7957
|
-
if (finalNode.childNodes.length > 0) {
|
|
7958
|
-
finalNode = finalNode.childNodes[0];
|
|
7959
|
-
}
|
|
7960
|
-
} while (finalNode.childNodes.length > 0);
|
|
7961
|
-
return finalNode;
|
|
7962
|
-
}
|
|
7963
|
-
/**
|
|
7964
|
-
* @returns {void}
|
|
7965
|
-
* @hidden
|
|
7966
|
-
*/
|
|
7967
|
-
function getDefaultHtmlTbStatus() {
|
|
7968
|
-
return {
|
|
7969
|
-
bold: false,
|
|
7970
|
-
italic: false,
|
|
7971
|
-
subscript: false,
|
|
7972
|
-
superscript: false,
|
|
7973
|
-
strikethrough: false,
|
|
7974
|
-
orderedlist: false,
|
|
7975
|
-
unorderedlist: false,
|
|
7976
|
-
numberFormatList: false,
|
|
7977
|
-
bulletFormatList: false,
|
|
7978
|
-
underline: false,
|
|
7979
|
-
alignments: null,
|
|
7980
|
-
backgroundcolor: null,
|
|
7981
|
-
fontcolor: null,
|
|
7982
|
-
fontname: null,
|
|
7983
|
-
fontsize: null,
|
|
7984
|
-
formats: null,
|
|
7985
|
-
createlink: false,
|
|
7986
|
-
insertcode: false
|
|
7987
|
-
};
|
|
7988
|
-
}
|
|
7989
|
-
/**
|
|
7990
|
-
* @returns {void}
|
|
7991
|
-
* @hidden
|
|
7992
|
-
*/
|
|
7993
|
-
function getDefaultMDTbStatus() {
|
|
7994
|
-
return {
|
|
7995
|
-
bold: false,
|
|
7996
|
-
italic: false,
|
|
7997
|
-
subscript: false,
|
|
7998
|
-
superscript: false,
|
|
7999
|
-
strikethrough: false,
|
|
8000
|
-
orderedlist: false,
|
|
8001
|
-
uppercase: false,
|
|
8002
|
-
lowercase: false,
|
|
8003
|
-
inlinecode: false,
|
|
8004
|
-
unorderedlist: false,
|
|
8005
|
-
formats: null
|
|
8006
|
-
};
|
|
8007
|
-
}
|
|
8008
|
-
/**
|
|
8009
|
-
* @param {Range} range - specifies the range
|
|
8010
|
-
* @returns {void}
|
|
8011
|
-
* @hidden
|
|
8012
|
-
*/
|
|
8013
|
-
function nestedListCleanUp(range) {
|
|
8014
|
-
if (range.startContainer.parentElement.closest('ol,ul') !== null && range.endContainer.parentElement.closest('ol,ul') !== null) {
|
|
8015
|
-
range.extractContents();
|
|
8016
|
-
while ((range.startContainer.nodeName === "#text" ? range.startContainer.parentElement : range.startContainer).querySelectorAll('li :empty').length > 0 ||
|
|
8017
|
-
(range.startContainer.nodeName === "#text" ? range.startContainer.parentElement : range.startContainer).querySelectorAll('ol :empty').length > 0) {
|
|
8018
|
-
var emptyLI = (range.startContainer.nodeName === "#text" ? range.startContainer.parentElement : range.startContainer).querySelectorAll('li :empty');
|
|
8019
|
-
if (emptyLI.length > 0) {
|
|
8020
|
-
emptyLI.forEach(function (item) {
|
|
8021
|
-
item.remove();
|
|
8022
|
-
});
|
|
8023
|
-
}
|
|
8024
|
-
}
|
|
8025
|
-
var liElem = (range.startContainer.nodeName === "#text" ? range.startContainer.parentElement : range.startContainer).querySelectorAll("li");
|
|
8026
|
-
if (liElem.length > 0) {
|
|
8027
|
-
liElem.forEach(function (item) {
|
|
8028
|
-
if (item.firstChild.nodeName === "OL" || item.firstChild.nodeName === "UL") {
|
|
8029
|
-
item.style.listStyleType = "none";
|
|
8030
|
-
}
|
|
8031
|
-
});
|
|
8032
|
-
}
|
|
8033
|
-
}
|
|
8034
|
-
}
|
|
8035
|
-
|
|
8036
9163
|
/**
|
|
8037
9164
|
* MarkdownToolbarStatus module for refresh the toolbar status
|
|
8038
9165
|
*/
|
|
@@ -8414,7 +9541,8 @@ var Formatter = /** @__PURE__ @class */ (function () {
|
|
|
8414
9541
|
_this.saveData();
|
|
8415
9542
|
}
|
|
8416
9543
|
self.isBlur = false;
|
|
8417
|
-
|
|
9544
|
+
var quickToolbarAction = !isNullOrUndefined(event) && !isNullOrUndefined(event.target) && (!isNullOrUndefined(closest(event.target, ".e-rte-elements.e-dropdown-popup.e-rte-dropdown-popup.e-quick-dropdown.e-popup-open")) || !isNullOrUndefined(closest(event.target, ".e-rte-elements.e-rte-quick-popup.e-popup-open")));
|
|
9545
|
+
if (isNullOrUndefined(saveSelection) || (!quickToolbarAction && (isNullOrUndefined(closest(saveSelection.range.startContainer.parentElement, ".e-img-caption")) ? true : !(closest(saveSelection.range.startContainer.parentElement, ".e-img-caption").getAttribute("contenteditable") == "false")))) {
|
|
8418
9546
|
self.contentModule.getEditPanel().focus();
|
|
8419
9547
|
}
|
|
8420
9548
|
if (self.editorMode === 'HTML' && !isKeyboardVideoInsert) {
|
|
@@ -10537,845 +11665,303 @@ var MarkdownFormatter = /** @__PURE__ @class */ (function (_super) {
|
|
|
10537
11665
|
MarkdownFormatter.prototype.initialize = function () {
|
|
10538
11666
|
this.keyConfig = markdownKeyConfig;
|
|
10539
11667
|
this.formatTags = markdownFormatTags;
|
|
10540
|
-
this.listTags = markdownListsTags;
|
|
10541
|
-
this.selectionTags = markdownSelectionTags;
|
|
10542
|
-
};
|
|
10543
|
-
/**
|
|
10544
|
-
* Update the formatter of RichTextEditor
|
|
10545
|
-
*
|
|
10546
|
-
* @param {Element} editElement - specifies the edit element.
|
|
10547
|
-
* @param {Document} doc - specifies the document.
|
|
10548
|
-
* @param {number} options - specifies the options
|
|
10549
|
-
* @returns {void}
|
|
10550
|
-
* @hidden
|
|
10551
|
-
* @deprecated
|
|
10552
|
-
*/
|
|
10553
|
-
MarkdownFormatter.prototype.updateFormatter = function (editElement, doc, options) {
|
|
10554
|
-
if (editElement) {
|
|
10555
|
-
this.editorManager = new MarkdownParser({
|
|
10556
|
-
element: editElement,
|
|
10557
|
-
formatTags: this.formatTags,
|
|
10558
|
-
listTags: this.listTags,
|
|
10559
|
-
selectionTags: this.selectionTags,
|
|
10560
|
-
options: options
|
|
10561
|
-
});
|
|
10562
|
-
}
|
|
10563
|
-
};
|
|
10564
|
-
return MarkdownFormatter;
|
|
10565
|
-
}(Formatter));
|
|
10566
|
-
|
|
10567
|
-
/**
|
|
10568
|
-
* Markdown module is used to render Rich Text Editor as Markdown editor content
|
|
10569
|
-
*
|
|
10570
|
-
* @hidden
|
|
10571
|
-
* @deprecated
|
|
10572
|
-
*/
|
|
10573
|
-
var MarkdownRender = /** @__PURE__ @class */ (function () {
|
|
10574
|
-
/**
|
|
10575
|
-
* Constructor for content renderer module
|
|
10576
|
-
*
|
|
10577
|
-
* @param {IRichTextEditor} parent - specifies the parent.
|
|
10578
|
-
*/
|
|
10579
|
-
function MarkdownRender(parent) {
|
|
10580
|
-
this.parent = parent;
|
|
10581
|
-
}
|
|
10582
|
-
/**
|
|
10583
|
-
* The function is used to render Rich Text Editor content div
|
|
10584
|
-
*
|
|
10585
|
-
* @returns {void}
|
|
10586
|
-
* @hidden
|
|
10587
|
-
* @deprecated
|
|
10588
|
-
*/
|
|
10589
|
-
MarkdownRender.prototype.renderPanel = function () {
|
|
10590
|
-
var rteObj = this.parent;
|
|
10591
|
-
var div = this.parent.createElement('div', { id: this.parent.getID() + '_view', className: 'e-rte-content' });
|
|
10592
|
-
this.editableElement = this.parent.createElement('textarea', {
|
|
10593
|
-
className: 'e-content',
|
|
10594
|
-
id: this.parent.getID() + '_editable-content',
|
|
10595
|
-
attrs: { 'aria-labelledby': this.parent.getID() + '_view' }
|
|
10596
|
-
});
|
|
10597
|
-
div.appendChild(this.editableElement);
|
|
10598
|
-
this.setPanel(div);
|
|
10599
|
-
rteObj.element.appendChild(div);
|
|
10600
|
-
};
|
|
10601
|
-
/**
|
|
10602
|
-
* Get the content div element of RichTextEditor
|
|
10603
|
-
*
|
|
10604
|
-
* @returns {Element} - specifies the element
|
|
10605
|
-
* @hidden
|
|
10606
|
-
* @deprecated
|
|
10607
|
-
*/
|
|
10608
|
-
MarkdownRender.prototype.getPanel = function () {
|
|
10609
|
-
return this.contentPanel;
|
|
10610
|
-
};
|
|
10611
|
-
/**
|
|
10612
|
-
* Get the editable element of RichTextEditor
|
|
10613
|
-
*
|
|
10614
|
-
* @returns {Element} - specifies the element
|
|
10615
|
-
* @hidden
|
|
10616
|
-
* @deprecated
|
|
10617
|
-
*/
|
|
10618
|
-
MarkdownRender.prototype.getEditPanel = function () {
|
|
10619
|
-
return this.editableElement;
|
|
10620
|
-
};
|
|
10621
|
-
/**
|
|
10622
|
-
* Returns the text content as string.
|
|
10623
|
-
*
|
|
10624
|
-
* @returns {string} - specifies the string values.
|
|
10625
|
-
*/
|
|
10626
|
-
MarkdownRender.prototype.getText = function () {
|
|
10627
|
-
return this.getEditPanel().value;
|
|
10628
|
-
};
|
|
10629
|
-
/**
|
|
10630
|
-
* Set the content div element of RichTextEditor
|
|
10631
|
-
*
|
|
10632
|
-
* @param {Element} panel - specifies the element.
|
|
10633
|
-
* @returns {void}
|
|
10634
|
-
* @hidden
|
|
10635
|
-
* @deprecated
|
|
10636
|
-
*/
|
|
10637
|
-
MarkdownRender.prototype.setPanel = function (panel) {
|
|
10638
|
-
this.contentPanel = panel;
|
|
10639
|
-
};
|
|
10640
|
-
/**
|
|
10641
|
-
* Get the document of RichTextEditor
|
|
10642
|
-
*
|
|
10643
|
-
* @returns {void}
|
|
10644
|
-
* @hidden
|
|
10645
|
-
* @deprecated
|
|
10646
|
-
*/
|
|
10647
|
-
MarkdownRender.prototype.getDocument = function () {
|
|
10648
|
-
return this.getEditPanel().ownerDocument;
|
|
10649
|
-
};
|
|
10650
|
-
return MarkdownRender;
|
|
10651
|
-
}());
|
|
10652
|
-
|
|
10653
|
-
/**
|
|
10654
|
-
* `MarkdownEditor` module is used to markdown editor
|
|
10655
|
-
*/
|
|
10656
|
-
var MarkdownEditor = /** @__PURE__ @class */ (function () {
|
|
10657
|
-
function MarkdownEditor(parent, serviceLocator) {
|
|
10658
|
-
this.parent = parent;
|
|
10659
|
-
this.locator = serviceLocator;
|
|
10660
|
-
this.renderFactory = this.locator.getService('rendererFactory');
|
|
10661
|
-
this.addEventListener();
|
|
10662
|
-
}
|
|
10663
|
-
/**
|
|
10664
|
-
* Destroys the Markdown.
|
|
10665
|
-
*
|
|
10666
|
-
* @function destroy
|
|
10667
|
-
* @returns {void}
|
|
10668
|
-
* @hidden
|
|
10669
|
-
* @deprecated
|
|
10670
|
-
*/
|
|
10671
|
-
MarkdownEditor.prototype.destroy = function () {
|
|
10672
|
-
if (isNullOrUndefined(this.parent)) {
|
|
10673
|
-
return;
|
|
10674
|
-
}
|
|
10675
|
-
this.removeEventListener();
|
|
10676
|
-
};
|
|
10677
|
-
MarkdownEditor.prototype.moduleDestroy = function () {
|
|
10678
|
-
this.parent = null;
|
|
10679
|
-
this.toolbarUpdate.parent = null;
|
|
10680
|
-
};
|
|
10681
|
-
MarkdownEditor.prototype.addEventListener = function () {
|
|
10682
|
-
if (this.parent.isDestroyed) {
|
|
10683
|
-
return;
|
|
10684
|
-
}
|
|
10685
|
-
this.saveSelection = new MarkdownSelection();
|
|
10686
|
-
this.parent.on(initialLoad, this.instantiateRenderer, this);
|
|
10687
|
-
this.parent.on(initialEnd, this.render, this);
|
|
10688
|
-
this.parent.on(modelChanged, this.onPropertyChanged, this);
|
|
10689
|
-
this.parent.on(markdownToolbarClick, this.onToolbarClick, this);
|
|
10690
|
-
this.parent.on(destroy, this.destroy, this);
|
|
10691
|
-
this.parent.on(selectAll$1, this.selectAll, this);
|
|
10692
|
-
this.parent.on(getSelectedHtml, this.getSelectedHtml, this);
|
|
10693
|
-
this.parent.on(selectionSave, this.onSelectionSave, this);
|
|
10694
|
-
this.parent.on(selectionRestore, this.onSelectionRestore, this);
|
|
10695
|
-
this.parent.on(readOnlyMode, this.updateReadOnly, this);
|
|
10696
|
-
this.parent.on(moduleDestroy, this.moduleDestroy, this);
|
|
10697
|
-
};
|
|
10698
|
-
MarkdownEditor.prototype.updateReadOnly = function () {
|
|
10699
|
-
if (this.parent.readonly) {
|
|
10700
|
-
this.parent.contentModule.getEditPanel().setAttribute('readonly', 'readonly');
|
|
10701
|
-
addClass([this.parent.element], CLS_RTE_READONLY);
|
|
10702
|
-
}
|
|
10703
|
-
else {
|
|
10704
|
-
this.parent.contentModule.getEditPanel().removeAttribute('readonly');
|
|
10705
|
-
removeClass([this.parent.element], CLS_RTE_READONLY);
|
|
10706
|
-
}
|
|
10707
|
-
};
|
|
10708
|
-
MarkdownEditor.prototype.onSelectionSave = function () {
|
|
10709
|
-
var textArea = this.parent.contentModule.getEditPanel();
|
|
10710
|
-
this.saveSelection.save(textArea.selectionStart, textArea.selectionEnd);
|
|
10711
|
-
};
|
|
10712
|
-
// eslint-disable-next-line
|
|
10713
|
-
MarkdownEditor.prototype.onSelectionRestore = function (e) {
|
|
10714
|
-
this.contentRenderer.getEditPanel().focus();
|
|
10715
|
-
var textArea = this.parent.contentModule.getEditPanel();
|
|
10716
|
-
this.saveSelection.restore(textArea);
|
|
10717
|
-
};
|
|
10718
|
-
MarkdownEditor.prototype.onToolbarClick = function (args) {
|
|
10719
|
-
var item = args.item;
|
|
10720
|
-
var textArea = this.parent.contentModule.getEditPanel();
|
|
10721
|
-
if (item.command !== 'Formats') {
|
|
10722
|
-
textArea.focus();
|
|
10723
|
-
}
|
|
10724
|
-
var startOffset = textArea.selectionStart;
|
|
10725
|
-
var endOffset = textArea.selectionEnd;
|
|
10726
|
-
var text = textArea.value.substring(startOffset, endOffset);
|
|
10727
|
-
switch (item.subCommand) {
|
|
10728
|
-
case 'Maximize':
|
|
10729
|
-
this.parent.notify(enableFullScreen, { args: args });
|
|
10730
|
-
break;
|
|
10731
|
-
case 'Minimize':
|
|
10732
|
-
this.parent.notify(disableFullScreen, { args: args });
|
|
10733
|
-
break;
|
|
10734
|
-
case 'CreateLink':
|
|
10735
|
-
this.parent.notify(insertLink, { member: 'link', args: args, text: text, module: 'Markdown' });
|
|
10736
|
-
break;
|
|
10737
|
-
case 'Image':
|
|
10738
|
-
this.parent.notify(insertImage, { member: 'image', args: args, text: text, module: 'Markdown' });
|
|
10739
|
-
break;
|
|
10740
|
-
case 'CreateTable': {
|
|
10741
|
-
var tableConstant = {
|
|
10742
|
-
'headingText': this.parent.localeObj.getConstant('TableHeadingText'),
|
|
10743
|
-
'colText': this.parent.localeObj.getConstant('TableColText')
|
|
10744
|
-
};
|
|
10745
|
-
this.parent.formatter.process(this.parent, args, args.originalEvent, tableConstant);
|
|
10746
|
-
break;
|
|
10747
|
-
}
|
|
10748
|
-
default:
|
|
10749
|
-
this.parent.formatter.process(this.parent, args, args.originalEvent, null);
|
|
10750
|
-
break;
|
|
10751
|
-
}
|
|
10752
|
-
};
|
|
10753
|
-
MarkdownEditor.prototype.instantiateRenderer = function () {
|
|
10754
|
-
this.renderFactory.addRenderer(RenderType.Content, new MarkdownRender(this.parent));
|
|
10755
|
-
};
|
|
10756
|
-
MarkdownEditor.prototype.removeEventListener = function () {
|
|
10757
|
-
if (this.parent.isDestroyed) {
|
|
10758
|
-
return;
|
|
10759
|
-
}
|
|
10760
|
-
this.parent.off(initialEnd, this.render);
|
|
10761
|
-
this.parent.off(modelChanged, this.onPropertyChanged);
|
|
10762
|
-
this.parent.off(destroy, this.destroy);
|
|
10763
|
-
this.parent.off(markdownToolbarClick, this.onToolbarClick);
|
|
10764
|
-
this.parent.off(initialLoad, this.instantiateRenderer);
|
|
10765
|
-
this.parent.off(selectAll$1, this.selectAll);
|
|
10766
|
-
this.parent.off(getSelectedHtml, this.getSelectedHtml);
|
|
10767
|
-
this.parent.off(selectionSave, this.onSelectionSave);
|
|
10768
|
-
this.parent.off(selectionRestore, this.onSelectionRestore);
|
|
10769
|
-
this.parent.off(readOnlyMode, this.updateReadOnly);
|
|
10770
|
-
this.parent.off(moduleDestroy, this.moduleDestroy);
|
|
10771
|
-
};
|
|
10772
|
-
MarkdownEditor.prototype.render = function () {
|
|
10773
|
-
this.contentRenderer = this.renderFactory.getRenderer(RenderType.Content);
|
|
10774
|
-
var editElement = this.contentRenderer.getEditPanel();
|
|
10775
|
-
var option = { undoRedoSteps: this.parent.undoRedoSteps, undoRedoTimer: this.parent.undoRedoTimer };
|
|
10776
|
-
if (isNullOrUndefined(this.parent.formatter)) {
|
|
10777
|
-
this.parent.formatter = new MarkdownFormatter({
|
|
10778
|
-
element: editElement,
|
|
10779
|
-
options: option
|
|
10780
|
-
});
|
|
10781
|
-
}
|
|
10782
|
-
else {
|
|
10783
|
-
this.parent.formatter.updateFormatter(editElement, this.contentRenderer.getDocument(), option);
|
|
10784
|
-
}
|
|
10785
|
-
if (this.parent.toolbarSettings.enable) {
|
|
10786
|
-
this.toolbarUpdate = new MarkdownToolbarStatus(this.parent);
|
|
10787
|
-
}
|
|
10788
|
-
this.parent.notify(bindOnEnd, {});
|
|
10789
|
-
};
|
|
10790
|
-
/**
|
|
10791
|
-
* Called internally if any of the property value changed.
|
|
10792
|
-
*
|
|
10793
|
-
* @param {RichTextEditorModel} e - specifies the editor model
|
|
10794
|
-
* @returns {void}
|
|
10795
|
-
* @hidden
|
|
10796
|
-
* @deprecated
|
|
10797
|
-
*/
|
|
10798
|
-
MarkdownEditor.prototype.onPropertyChanged = function (e) {
|
|
10799
|
-
// On property code change here
|
|
10800
|
-
if (!isNullOrUndefined(e.newProp.formatter)) {
|
|
10801
|
-
var editElement = this.contentRenderer.getEditPanel();
|
|
10802
|
-
var option = { undoRedoSteps: this.parent.undoRedoSteps,
|
|
10803
|
-
undoRedoTimer: this.parent.undoRedoTimer };
|
|
10804
|
-
this.parent.formatter.updateFormatter(editElement, this.contentRenderer.getDocument(), option);
|
|
10805
|
-
}
|
|
10806
|
-
};
|
|
10807
|
-
/**
|
|
10808
|
-
* For internal use only - Get the module name.
|
|
10809
|
-
*
|
|
10810
|
-
* @returns {void}
|
|
10811
|
-
*/
|
|
10812
|
-
MarkdownEditor.prototype.getModuleName = function () {
|
|
10813
|
-
return 'markdownEditor';
|
|
10814
|
-
};
|
|
10815
|
-
/**
|
|
10816
|
-
* For selecting all content in RTE
|
|
10817
|
-
*
|
|
10818
|
-
* @returns {void}
|
|
10819
|
-
* @private
|
|
10820
|
-
*/
|
|
10821
|
-
MarkdownEditor.prototype.selectAll = function () {
|
|
10822
|
-
this.parent.formatter.editorManager.markdownSelection.setSelection(this.parent.contentModule.getEditPanel(), 0, this.parent.contentModule.getEditPanel().value.length);
|
|
10823
|
-
};
|
|
10824
|
-
/**
|
|
10825
|
-
* For get a selected text in RTE
|
|
10826
|
-
*
|
|
10827
|
-
* @param {NotifyArgs} e - specifies the arguments.
|
|
10828
|
-
* @returns {void}
|
|
10829
|
-
* @private
|
|
10830
|
-
*/
|
|
10831
|
-
MarkdownEditor.prototype.getSelectedHtml = function (e) {
|
|
10832
|
-
e.callBack(this.parent.formatter.editorManager.markdownSelection.getSelectedText(this.parent.contentModule.getEditPanel()));
|
|
10833
|
-
};
|
|
10834
|
-
return MarkdownEditor;
|
|
10835
|
-
}());
|
|
10836
|
-
|
|
10837
|
-
/**
|
|
10838
|
-
* Constant values for EditorManager
|
|
10839
|
-
*/
|
|
10840
|
-
/**
|
|
10841
|
-
* Image plugin events
|
|
10842
|
-
*
|
|
10843
|
-
* @hidden
|
|
10844
|
-
*/
|
|
10845
|
-
var IMAGE = 'INSERT-IMAGE';
|
|
10846
|
-
var AUDIO = 'INSERT-AUDIO';
|
|
10847
|
-
var VIDEO = 'INSERT-VIDEO';
|
|
10848
|
-
var TABLE = 'INSERT-TABLE';
|
|
10849
|
-
var LINK = 'INSERT-LINK';
|
|
10850
|
-
var INSERT_ROW = 'INSERT-ROW';
|
|
10851
|
-
var INSERT_COLUMN = 'INSERT-COLUMN';
|
|
10852
|
-
var DELETEROW = 'DELETE-ROW';
|
|
10853
|
-
var DELETECOLUMN = 'DELETE-COLUMN';
|
|
10854
|
-
var REMOVETABLE = 'REMOVE-TABLE';
|
|
10855
|
-
var TABLEHEADER = 'TABLE-HEADER';
|
|
10856
|
-
var TABLE_VERTICAL_ALIGN = 'TABLE_VERTICAL_ALIGN';
|
|
10857
|
-
var TABLE_MERGE = 'TABLE_MERGE';
|
|
10858
|
-
var TABLE_VERTICAL_SPLIT = 'TABLE_VERTICAL_SPLIT';
|
|
10859
|
-
var TABLE_HORIZONTAL_SPLIT = 'TABLE_HORIZONTAL_SPLIT';
|
|
10860
|
-
var TABLE_MOVE = 'TABLE_MOVE';
|
|
10861
|
-
/**
|
|
10862
|
-
* Alignments plugin events
|
|
10863
|
-
*
|
|
10864
|
-
* @hidden
|
|
10865
|
-
*/
|
|
10866
|
-
var ALIGNMENT_TYPE = 'alignment-type';
|
|
10867
|
-
/**
|
|
10868
|
-
* Indents plugin events
|
|
10869
|
-
*
|
|
10870
|
-
* @hidden
|
|
10871
|
-
*/
|
|
10872
|
-
var INDENT_TYPE = 'indent-type';
|
|
10873
|
-
/**
|
|
10874
|
-
* Constant tag names
|
|
10875
|
-
*
|
|
10876
|
-
* @hidden
|
|
10877
|
-
*/
|
|
10878
|
-
var DEFAULT_TAG = 'p';
|
|
10879
|
-
/**
|
|
10880
|
-
* @hidden
|
|
10881
|
-
*/
|
|
10882
|
-
var BLOCK_TAGS = ['address', 'article', 'aside', 'audio', 'blockquote',
|
|
10883
|
-
'canvas', 'details', 'dd', 'div', 'dl', 'dt', 'fieldset', 'figcaption', 'figure', 'footer',
|
|
10884
|
-
'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hgroup', 'hr', 'li', 'main', 'nav',
|
|
10885
|
-
'noscript', 'ol', 'output', 'p', 'pre', 'section', 'table', 'tbody', 'td', 'tfoot', 'th',
|
|
10886
|
-
'thead', 'tr', 'ul', 'video', 'body'];
|
|
10887
|
-
/**
|
|
10888
|
-
* @hidden
|
|
10889
|
-
*/
|
|
10890
|
-
var IGNORE_BLOCK_TAGS = ['td', 'th'];
|
|
10891
|
-
/**
|
|
10892
|
-
* @hidden
|
|
10893
|
-
*/
|
|
10894
|
-
var TABLE_BLOCK_TAGS = ['table', 'tbody', 'td', 'tfoot', 'th',
|
|
10895
|
-
'thead', 'tr'];
|
|
10896
|
-
/**
|
|
10897
|
-
* Selection plugin events
|
|
10898
|
-
*
|
|
10899
|
-
* @hidden
|
|
10900
|
-
*/
|
|
10901
|
-
var SELECTION_TYPE = 'selection-type';
|
|
10902
|
-
/**
|
|
10903
|
-
* Insert HTML plugin events
|
|
10904
|
-
*
|
|
10905
|
-
* @hidden
|
|
10906
|
-
*/
|
|
10907
|
-
var INSERTHTML_TYPE = 'inserthtml-type';
|
|
10908
|
-
/**
|
|
10909
|
-
* Insert Text plugin events
|
|
10910
|
-
*
|
|
10911
|
-
* @hidden
|
|
10912
|
-
*/
|
|
10913
|
-
var INSERT_TEXT_TYPE = 'insert-text-type';
|
|
10914
|
-
/**
|
|
10915
|
-
* Clear Format HTML plugin events
|
|
10916
|
-
*
|
|
10917
|
-
* @hidden
|
|
10918
|
-
*/
|
|
10919
|
-
var CLEAR_TYPE = 'clear-type';
|
|
10920
|
-
/**
|
|
10921
|
-
* Self closing tags
|
|
10922
|
-
*
|
|
10923
|
-
* @hidden
|
|
10924
|
-
*/
|
|
10925
|
-
var SELF_CLOSING_TAGS = ['area', 'base', 'br', 'embed', 'hr', 'img', 'input', 'param', 'source', 'track', 'wbr', 'iframe', 'td', 'table'];
|
|
10926
|
-
/**
|
|
10927
|
-
* Source
|
|
10928
|
-
*
|
|
10929
|
-
* @hidden
|
|
10930
|
-
*/
|
|
10931
|
-
var PASTE_SOURCE = ['word', 'excel', 'onenote'];
|
|
10932
|
-
|
|
10933
|
-
/**
|
|
10934
|
-
* `Selection` module is used to handle RTE Selections.
|
|
10935
|
-
*/
|
|
10936
|
-
var NodeSelection = /** @__PURE__ @class */ (function () {
|
|
10937
|
-
function NodeSelection() {
|
|
10938
|
-
this.startNodeName = [];
|
|
10939
|
-
this.endNodeName = [];
|
|
10940
|
-
}
|
|
10941
|
-
NodeSelection.prototype.saveInstance = function (range, body) {
|
|
10942
|
-
this.range = range.cloneRange();
|
|
10943
|
-
this.rootNode = this.documentFromRange(range);
|
|
10944
|
-
this.body = body;
|
|
10945
|
-
this.startContainer = this.getNodeArray(range.startContainer, true);
|
|
10946
|
-
this.endContainer = this.getNodeArray(range.endContainer, false);
|
|
10947
|
-
this.startOffset = range.startOffset;
|
|
10948
|
-
this.endOffset = range.endOffset;
|
|
10949
|
-
this.html = this.body.innerHTML;
|
|
10950
|
-
return this;
|
|
10951
|
-
};
|
|
10952
|
-
NodeSelection.prototype.documentFromRange = function (range) {
|
|
10953
|
-
return (9 === range.startContainer.nodeType) ? range.startContainer : range.startContainer.ownerDocument;
|
|
10954
|
-
};
|
|
10955
|
-
NodeSelection.prototype.getRange = function (docElement) {
|
|
10956
|
-
var select$$1 = this.get(docElement);
|
|
10957
|
-
var range = select$$1 && select$$1.rangeCount > 0 ? select$$1.getRangeAt(select$$1.rangeCount - 1) : docElement.createRange();
|
|
10958
|
-
return (range.startContainer !== docElement || range.endContainer !== docElement
|
|
10959
|
-
|| range.startOffset || range.endOffset || (range.setStart(docElement.body, 0), range.collapse(!0)), range);
|
|
10960
|
-
};
|
|
10961
|
-
/**
|
|
10962
|
-
* get method
|
|
10963
|
-
*
|
|
10964
|
-
* @param {Document} docElement - specifies the get function
|
|
10965
|
-
* @returns {void}
|
|
10966
|
-
* @hidden
|
|
10967
|
-
* @deprecated
|
|
10968
|
-
*/
|
|
10969
|
-
NodeSelection.prototype.get = function (docElement) {
|
|
10970
|
-
return docElement.defaultView.getSelection();
|
|
10971
|
-
};
|
|
10972
|
-
/**
|
|
10973
|
-
* save method
|
|
10974
|
-
*
|
|
10975
|
-
* @param {Range} range - range value.
|
|
10976
|
-
* @param {Document} docElement - specifies the document.
|
|
10977
|
-
* @returns {void}
|
|
10978
|
-
* @hidden
|
|
10979
|
-
* @deprecated
|
|
10980
|
-
*/
|
|
10981
|
-
NodeSelection.prototype.save = function (range, docElement) {
|
|
10982
|
-
range = (range) ? range.cloneRange() : this.getRange(docElement);
|
|
10983
|
-
return this.saveInstance(range, docElement.body);
|
|
10984
|
-
};
|
|
10985
|
-
/**
|
|
10986
|
-
* getIndex method
|
|
10987
|
-
*
|
|
10988
|
-
* @param {Node} node - specifies the node value.
|
|
10989
|
-
* @returns {void}
|
|
10990
|
-
* @hidden
|
|
10991
|
-
* @deprecated
|
|
10992
|
-
*/
|
|
10993
|
-
NodeSelection.prototype.getIndex = function (node) {
|
|
10994
|
-
var index;
|
|
10995
|
-
var num = 0;
|
|
10996
|
-
node = !node.previousSibling && node.tagName === 'BR' ? node : node.previousSibling;
|
|
10997
|
-
if (node) {
|
|
10998
|
-
for (var type = node.nodeType; node; null) {
|
|
10999
|
-
index = node.nodeType;
|
|
11000
|
-
num++;
|
|
11001
|
-
//eslint-disable-next-line
|
|
11002
|
-
type = index;
|
|
11003
|
-
node = node.previousSibling;
|
|
11004
|
-
}
|
|
11005
|
-
}
|
|
11006
|
-
return num;
|
|
11007
|
-
};
|
|
11008
|
-
NodeSelection.prototype.isChildNode = function (nodeCollection, parentNode) {
|
|
11009
|
-
for (var index = 0; index < parentNode.childNodes.length; index++) {
|
|
11010
|
-
if (nodeCollection.indexOf(parentNode.childNodes[index]) > -1) {
|
|
11011
|
-
return true;
|
|
11012
|
-
}
|
|
11013
|
-
}
|
|
11014
|
-
return false;
|
|
11015
|
-
};
|
|
11016
|
-
NodeSelection.prototype.getNode = function (startNode, endNode, nodeCollection) {
|
|
11017
|
-
if (endNode === startNode &&
|
|
11018
|
-
(startNode.nodeType === 3 || !startNode.firstChild || nodeCollection.indexOf(startNode.firstChild) !== -1
|
|
11019
|
-
|| this.isChildNode(nodeCollection, startNode))) {
|
|
11020
|
-
return null;
|
|
11021
|
-
}
|
|
11022
|
-
if (startNode.nodeType === 3 && startNode.previousSibling === endNode && endNode.nodeName === 'IMG') {
|
|
11023
|
-
return null;
|
|
11024
|
-
}
|
|
11025
|
-
if (nodeCollection.indexOf(startNode.firstChild) === -1 && startNode.firstChild && !this.isChildNode(nodeCollection, startNode)) {
|
|
11026
|
-
return startNode.firstChild;
|
|
11027
|
-
}
|
|
11028
|
-
if (startNode.nextSibling) {
|
|
11029
|
-
return startNode.nextSibling;
|
|
11030
|
-
}
|
|
11031
|
-
if (!startNode.parentNode) {
|
|
11032
|
-
return null;
|
|
11033
|
-
}
|
|
11034
|
-
else {
|
|
11035
|
-
return startNode.parentNode;
|
|
11036
|
-
}
|
|
11668
|
+
this.listTags = markdownListsTags;
|
|
11669
|
+
this.selectionTags = markdownSelectionTags;
|
|
11037
11670
|
};
|
|
11038
11671
|
/**
|
|
11039
|
-
*
|
|
11672
|
+
* Update the formatter of RichTextEditor
|
|
11040
11673
|
*
|
|
11041
|
-
* @param
|
|
11674
|
+
* @param {Element} editElement - specifies the edit element.
|
|
11675
|
+
* @param {Document} doc - specifies the document.
|
|
11676
|
+
* @param {number} options - specifies the options
|
|
11042
11677
|
* @returns {void}
|
|
11043
11678
|
* @hidden
|
|
11044
11679
|
* @deprecated
|
|
11045
11680
|
*/
|
|
11046
|
-
|
|
11047
|
-
|
|
11048
|
-
|
|
11049
|
-
|
|
11050
|
-
|
|
11051
|
-
|
|
11052
|
-
|
|
11053
|
-
|
|
11054
|
-
|
|
11055
|
-
if (range.startOffset === range.endOffset && range.startOffset !== 0 && range.startContainer.nodeName === 'PRE') {
|
|
11056
|
-
return [startNode.nodeName === 'BR' || startNode.nodeName === '#text' ? startNode : startNode.childNodes[0]];
|
|
11681
|
+
MarkdownFormatter.prototype.updateFormatter = function (editElement, doc, options) {
|
|
11682
|
+
if (editElement) {
|
|
11683
|
+
this.editorManager = new MarkdownParser({
|
|
11684
|
+
element: editElement,
|
|
11685
|
+
formatTags: this.formatTags,
|
|
11686
|
+
listTags: this.listTags,
|
|
11687
|
+
selectionTags: this.selectionTags,
|
|
11688
|
+
options: options
|
|
11689
|
+
});
|
|
11057
11690
|
}
|
|
11058
|
-
var nodeCollection = [];
|
|
11059
|
-
do {
|
|
11060
|
-
if (nodeCollection.indexOf(startNode) === -1) {
|
|
11061
|
-
nodeCollection.push(startNode);
|
|
11062
|
-
}
|
|
11063
|
-
startNode = this.getNode(startNode, endNode, nodeCollection);
|
|
11064
|
-
} while (startNode);
|
|
11065
|
-
return nodeCollection;
|
|
11066
11691
|
};
|
|
11692
|
+
return MarkdownFormatter;
|
|
11693
|
+
}(Formatter));
|
|
11694
|
+
|
|
11695
|
+
/**
|
|
11696
|
+
* Markdown module is used to render Rich Text Editor as Markdown editor content
|
|
11697
|
+
*
|
|
11698
|
+
* @hidden
|
|
11699
|
+
* @deprecated
|
|
11700
|
+
*/
|
|
11701
|
+
var MarkdownRender = /** @__PURE__ @class */ (function () {
|
|
11067
11702
|
/**
|
|
11068
|
-
*
|
|
11703
|
+
* Constructor for content renderer module
|
|
11069
11704
|
*
|
|
11070
|
-
* @param {
|
|
11071
|
-
* @returns {void}
|
|
11072
|
-
* @hidden
|
|
11073
|
-
* @deprecated
|
|
11705
|
+
* @param {IRichTextEditor} parent - specifies the parent.
|
|
11074
11706
|
*/
|
|
11075
|
-
|
|
11076
|
-
|
|
11077
|
-
}
|
|
11707
|
+
function MarkdownRender(parent) {
|
|
11708
|
+
this.parent = parent;
|
|
11709
|
+
}
|
|
11078
11710
|
/**
|
|
11079
|
-
*
|
|
11711
|
+
* The function is used to render Rich Text Editor content div
|
|
11080
11712
|
*
|
|
11081
|
-
* @param {Node[]} nodeCollection - specifies the collection of nodes.
|
|
11082
|
-
* @param {Range} range - specifies the range values.
|
|
11083
11713
|
* @returns {void}
|
|
11084
11714
|
* @hidden
|
|
11085
11715
|
* @deprecated
|
|
11086
11716
|
*/
|
|
11087
|
-
|
|
11088
|
-
|
|
11089
|
-
|
|
11090
|
-
|
|
11091
|
-
|
|
11092
|
-
|
|
11093
|
-
|
|
11094
|
-
|
|
11095
|
-
|
|
11096
|
-
|
|
11097
|
-
|
|
11098
|
-
nodeCollection[index] = nodeCollection[index].parentNode;
|
|
11099
|
-
}
|
|
11100
|
-
}
|
|
11101
|
-
return nodeCollection;
|
|
11717
|
+
MarkdownRender.prototype.renderPanel = function () {
|
|
11718
|
+
var rteObj = this.parent;
|
|
11719
|
+
var div = this.parent.createElement('div', { id: this.parent.getID() + '_view', className: 'e-rte-content' });
|
|
11720
|
+
this.editableElement = this.parent.createElement('textarea', {
|
|
11721
|
+
className: 'e-content',
|
|
11722
|
+
id: this.parent.getID() + '_editable-content',
|
|
11723
|
+
attrs: { 'aria-labelledby': this.parent.getID() + '_view' }
|
|
11724
|
+
});
|
|
11725
|
+
div.appendChild(this.editableElement);
|
|
11726
|
+
this.setPanel(div);
|
|
11727
|
+
rteObj.element.appendChild(div);
|
|
11102
11728
|
};
|
|
11103
11729
|
/**
|
|
11104
|
-
*
|
|
11730
|
+
* Get the content div element of RichTextEditor
|
|
11105
11731
|
*
|
|
11106
|
-
* @
|
|
11107
|
-
* @returns {void}
|
|
11732
|
+
* @returns {Element} - specifies the element
|
|
11108
11733
|
* @hidden
|
|
11109
11734
|
* @deprecated
|
|
11110
11735
|
*/
|
|
11111
|
-
|
|
11112
|
-
return this.
|
|
11736
|
+
MarkdownRender.prototype.getPanel = function () {
|
|
11737
|
+
return this.contentPanel;
|
|
11113
11738
|
};
|
|
11114
11739
|
/**
|
|
11115
|
-
*
|
|
11740
|
+
* Get the editable element of RichTextEditor
|
|
11116
11741
|
*
|
|
11117
|
-
* @
|
|
11118
|
-
* @returns {void}
|
|
11742
|
+
* @returns {Element} - specifies the element
|
|
11119
11743
|
* @hidden
|
|
11120
11744
|
* @deprecated
|
|
11121
11745
|
*/
|
|
11122
|
-
|
|
11123
|
-
return this.
|
|
11746
|
+
MarkdownRender.prototype.getEditPanel = function () {
|
|
11747
|
+
return this.editableElement;
|
|
11124
11748
|
};
|
|
11125
11749
|
/**
|
|
11126
|
-
*
|
|
11750
|
+
* Returns the text content as string.
|
|
11127
11751
|
*
|
|
11128
|
-
* @
|
|
11129
|
-
* @returns {void}
|
|
11130
|
-
* @hidden
|
|
11131
|
-
* @deprecated
|
|
11752
|
+
* @returns {string} - specifies the string values.
|
|
11132
11753
|
*/
|
|
11133
|
-
|
|
11134
|
-
|
|
11135
|
-
// eslint-disable-next-line
|
|
11136
|
-
var regEx = new RegExp(String.fromCharCode(8203), 'g');
|
|
11137
|
-
for (var index = 0; index < nodeCollection.length; index++) {
|
|
11138
|
-
if (nodeCollection[index].nodeType !== 3 || (nodeCollection[index].textContent.trim() === '' ||
|
|
11139
|
-
(nodeCollection[index].textContent.length === 1 && nodeCollection[index].textContent.match(regEx)))) {
|
|
11140
|
-
nodeCollection.splice(index, 1);
|
|
11141
|
-
index--;
|
|
11142
|
-
}
|
|
11143
|
-
}
|
|
11144
|
-
return nodeCollection.reverse();
|
|
11754
|
+
MarkdownRender.prototype.getText = function () {
|
|
11755
|
+
return this.getEditPanel().value;
|
|
11145
11756
|
};
|
|
11146
11757
|
/**
|
|
11147
|
-
*
|
|
11758
|
+
* Set the content div element of RichTextEditor
|
|
11148
11759
|
*
|
|
11149
|
-
* @param
|
|
11760
|
+
* @param {Element} panel - specifies the element.
|
|
11150
11761
|
* @returns {void}
|
|
11151
11762
|
* @hidden
|
|
11152
11763
|
* @deprecated
|
|
11153
11764
|
*/
|
|
11154
|
-
|
|
11155
|
-
|
|
11156
|
-
// eslint-disable-next-line
|
|
11157
|
-
var regEx = new RegExp(String.fromCharCode(8203), 'g');
|
|
11158
|
-
for (var index = 0; index < nodeCollection.length; index++) {
|
|
11159
|
-
if (nodeCollection[index].nodeName !== 'BR' &&
|
|
11160
|
-
(nodeCollection[index].nodeType !== 3 || (nodeCollection[index].textContent.trim() === '' ||
|
|
11161
|
-
(nodeCollection[index].textContent.length === 1 && nodeCollection[index].textContent.match(regEx))))) {
|
|
11162
|
-
nodeCollection.splice(index, 1);
|
|
11163
|
-
index--;
|
|
11164
|
-
}
|
|
11165
|
-
}
|
|
11166
|
-
return nodeCollection.reverse();
|
|
11765
|
+
MarkdownRender.prototype.setPanel = function (panel) {
|
|
11766
|
+
this.contentPanel = panel;
|
|
11167
11767
|
};
|
|
11168
11768
|
/**
|
|
11169
|
-
*
|
|
11769
|
+
* Get the document of RichTextEditor
|
|
11170
11770
|
*
|
|
11171
|
-
* @param {Range} range - specifies the range value.
|
|
11172
11771
|
* @returns {void}
|
|
11173
11772
|
* @hidden
|
|
11174
11773
|
* @deprecated
|
|
11175
11774
|
*/
|
|
11176
|
-
|
|
11177
|
-
return this.
|
|
11775
|
+
MarkdownRender.prototype.getDocument = function () {
|
|
11776
|
+
return this.getEditPanel().ownerDocument;
|
|
11178
11777
|
};
|
|
11778
|
+
return MarkdownRender;
|
|
11779
|
+
}());
|
|
11780
|
+
|
|
11781
|
+
/**
|
|
11782
|
+
* `MarkdownEditor` module is used to markdown editor
|
|
11783
|
+
*/
|
|
11784
|
+
var MarkdownEditor = /** @__PURE__ @class */ (function () {
|
|
11785
|
+
function MarkdownEditor(parent, serviceLocator) {
|
|
11786
|
+
this.parent = parent;
|
|
11787
|
+
this.locator = serviceLocator;
|
|
11788
|
+
this.renderFactory = this.locator.getService('rendererFactory');
|
|
11789
|
+
this.addEventListener();
|
|
11790
|
+
}
|
|
11179
11791
|
/**
|
|
11180
|
-
*
|
|
11792
|
+
* Destroys the Markdown.
|
|
11181
11793
|
*
|
|
11182
|
-
* @
|
|
11794
|
+
* @function destroy
|
|
11183
11795
|
* @returns {void}
|
|
11184
11796
|
* @hidden
|
|
11185
11797
|
* @deprecated
|
|
11186
11798
|
*/
|
|
11187
|
-
|
|
11188
|
-
|
|
11189
|
-
|
|
11190
|
-
if ((nodeCollection[index].childNodes.length !== 0 &&
|
|
11191
|
-
nodeCollection[index].nodeType !== 3) ||
|
|
11192
|
-
(nodeCollection[index].nodeType === 3 &&
|
|
11193
|
-
nodeCollection[index].textContent === '')) {
|
|
11194
|
-
nodeCollection.splice(index, 1);
|
|
11195
|
-
index--;
|
|
11196
|
-
}
|
|
11799
|
+
MarkdownEditor.prototype.destroy = function () {
|
|
11800
|
+
if (isNullOrUndefined(this.parent)) {
|
|
11801
|
+
return;
|
|
11197
11802
|
}
|
|
11198
|
-
|
|
11803
|
+
this.removeEventListener();
|
|
11199
11804
|
};
|
|
11200
|
-
|
|
11201
|
-
|
|
11202
|
-
|
|
11203
|
-
|
|
11204
|
-
|
|
11205
|
-
|
|
11206
|
-
|
|
11207
|
-
* @hidden
|
|
11208
|
-
* @deprecated
|
|
11209
|
-
*/
|
|
11210
|
-
NodeSelection.prototype.getNodeArray = function (node, isStart, root) {
|
|
11211
|
-
var array = [];
|
|
11212
|
-
// eslint-disable-next-line
|
|
11213
|
-
((isStart) ? (this.startNodeName = []) : (this.endNodeName = []));
|
|
11214
|
-
for (; node !== (root ? root : this.rootNode); null) {
|
|
11215
|
-
if (isNullOrUndefined(node)) {
|
|
11216
|
-
break;
|
|
11217
|
-
}
|
|
11218
|
-
// eslint-disable-next-line
|
|
11219
|
-
(isStart) ? this.startNodeName.push(node.nodeName.toLowerCase()) : this.endNodeName.push(node.nodeName.toLowerCase());
|
|
11220
|
-
array.push(this.getIndex(node));
|
|
11221
|
-
node = node.parentNode;
|
|
11805
|
+
MarkdownEditor.prototype.moduleDestroy = function () {
|
|
11806
|
+
this.parent = null;
|
|
11807
|
+
this.toolbarUpdate.parent = null;
|
|
11808
|
+
};
|
|
11809
|
+
MarkdownEditor.prototype.addEventListener = function () {
|
|
11810
|
+
if (this.parent.isDestroyed) {
|
|
11811
|
+
return;
|
|
11222
11812
|
}
|
|
11223
|
-
|
|
11813
|
+
this.saveSelection = new MarkdownSelection();
|
|
11814
|
+
this.parent.on(initialLoad, this.instantiateRenderer, this);
|
|
11815
|
+
this.parent.on(initialEnd, this.render, this);
|
|
11816
|
+
this.parent.on(modelChanged, this.onPropertyChanged, this);
|
|
11817
|
+
this.parent.on(markdownToolbarClick, this.onToolbarClick, this);
|
|
11818
|
+
this.parent.on(destroy, this.destroy, this);
|
|
11819
|
+
this.parent.on(selectAll$1, this.selectAll, this);
|
|
11820
|
+
this.parent.on(getSelectedHtml, this.getSelectedHtml, this);
|
|
11821
|
+
this.parent.on(selectionSave, this.onSelectionSave, this);
|
|
11822
|
+
this.parent.on(selectionRestore, this.onSelectionRestore, this);
|
|
11823
|
+
this.parent.on(readOnlyMode, this.updateReadOnly, this);
|
|
11824
|
+
this.parent.on(moduleDestroy, this.moduleDestroy, this);
|
|
11224
11825
|
};
|
|
11225
|
-
|
|
11226
|
-
|
|
11227
|
-
|
|
11228
|
-
|
|
11229
|
-
for (; index--; null) {
|
|
11230
|
-
node = node && node.childNodes[num[index]];
|
|
11826
|
+
MarkdownEditor.prototype.updateReadOnly = function () {
|
|
11827
|
+
if (this.parent.readonly) {
|
|
11828
|
+
this.parent.contentModule.getEditPanel().setAttribute('readonly', 'readonly');
|
|
11829
|
+
addClass([this.parent.element], CLS_RTE_READONLY);
|
|
11231
11830
|
}
|
|
11232
|
-
|
|
11233
|
-
|
|
11234
|
-
|
|
11235
|
-
}
|
|
11236
|
-
range[isvalid ? 'setStart' : 'setEnd'](node, constant);
|
|
11831
|
+
else {
|
|
11832
|
+
this.parent.contentModule.getEditPanel().removeAttribute('readonly');
|
|
11833
|
+
removeClass([this.parent.element], CLS_RTE_READONLY);
|
|
11237
11834
|
}
|
|
11238
|
-
return range;
|
|
11239
11835
|
};
|
|
11240
|
-
|
|
11241
|
-
|
|
11242
|
-
|
|
11243
|
-
* @returns {void}
|
|
11244
|
-
* @hidden
|
|
11245
|
-
* @deprecated
|
|
11246
|
-
*/
|
|
11247
|
-
NodeSelection.prototype.restore = function () {
|
|
11248
|
-
var range = this.range.cloneRange();
|
|
11249
|
-
range = this.setRangePoint(range, true, this.startContainer, this.startOffset);
|
|
11250
|
-
range = this.setRangePoint(range, false, this.endContainer, this.endOffset);
|
|
11251
|
-
this.selectRange(this.rootNode, range);
|
|
11252
|
-
return range;
|
|
11836
|
+
MarkdownEditor.prototype.onSelectionSave = function () {
|
|
11837
|
+
var textArea = this.parent.contentModule.getEditPanel();
|
|
11838
|
+
this.saveSelection.save(textArea.selectionStart, textArea.selectionEnd);
|
|
11253
11839
|
};
|
|
11254
|
-
|
|
11255
|
-
|
|
11256
|
-
this.
|
|
11840
|
+
// eslint-disable-next-line
|
|
11841
|
+
MarkdownEditor.prototype.onSelectionRestore = function (e) {
|
|
11842
|
+
this.contentRenderer.getEditPanel().focus();
|
|
11843
|
+
var textArea = this.parent.contentModule.getEditPanel();
|
|
11844
|
+
this.saveSelection.restore(textArea);
|
|
11257
11845
|
};
|
|
11258
|
-
|
|
11259
|
-
|
|
11260
|
-
|
|
11261
|
-
|
|
11262
|
-
|
|
11263
|
-
|
|
11264
|
-
|
|
11265
|
-
|
|
11266
|
-
|
|
11267
|
-
|
|
11268
|
-
|
|
11269
|
-
|
|
11270
|
-
|
|
11846
|
+
MarkdownEditor.prototype.onToolbarClick = function (args) {
|
|
11847
|
+
var item = args.item;
|
|
11848
|
+
var textArea = this.parent.contentModule.getEditPanel();
|
|
11849
|
+
if (item.command !== 'Formats') {
|
|
11850
|
+
textArea.focus();
|
|
11851
|
+
}
|
|
11852
|
+
var startOffset = textArea.selectionStart;
|
|
11853
|
+
var endOffset = textArea.selectionEnd;
|
|
11854
|
+
var text = textArea.value.substring(startOffset, endOffset);
|
|
11855
|
+
switch (item.subCommand) {
|
|
11856
|
+
case 'Maximize':
|
|
11857
|
+
this.parent.notify(enableFullScreen, { args: args });
|
|
11858
|
+
break;
|
|
11859
|
+
case 'Minimize':
|
|
11860
|
+
this.parent.notify(disableFullScreen, { args: args });
|
|
11861
|
+
break;
|
|
11862
|
+
case 'CreateLink':
|
|
11863
|
+
this.parent.notify(insertLink, { member: 'link', args: args, text: text, module: 'Markdown' });
|
|
11864
|
+
break;
|
|
11865
|
+
case 'Image':
|
|
11866
|
+
this.parent.notify(insertImage, { member: 'image', args: args, text: text, module: 'Markdown' });
|
|
11867
|
+
break;
|
|
11868
|
+
case 'CreateTable': {
|
|
11869
|
+
var tableConstant = {
|
|
11870
|
+
'headingText': this.parent.localeObj.getConstant('TableHeadingText'),
|
|
11871
|
+
'colText': this.parent.localeObj.getConstant('TableColText')
|
|
11872
|
+
};
|
|
11873
|
+
this.parent.formatter.process(this.parent, args, args.originalEvent, tableConstant);
|
|
11874
|
+
break;
|
|
11875
|
+
}
|
|
11876
|
+
default:
|
|
11877
|
+
this.parent.formatter.process(this.parent, args, args.originalEvent, null);
|
|
11878
|
+
break;
|
|
11879
|
+
}
|
|
11271
11880
|
};
|
|
11272
|
-
|
|
11273
|
-
|
|
11274
|
-
*
|
|
11275
|
-
* @param {Document} docElement - specifies the documrent
|
|
11276
|
-
* @param {Node} startNode - specifies the starting node.
|
|
11277
|
-
* @param {Node} endNode - specifies the the end node.
|
|
11278
|
-
* @param {number} startIndex - specifies the starting index.
|
|
11279
|
-
* @param {number} endIndex - specifies the end index.
|
|
11280
|
-
* @returns {void}
|
|
11281
|
-
* @hidden
|
|
11282
|
-
* @deprecated
|
|
11283
|
-
*/
|
|
11284
|
-
NodeSelection.prototype.setSelectionText = function (docElement, startNode, endNode, startIndex, endIndex) {
|
|
11285
|
-
var range = docElement.createRange();
|
|
11286
|
-
range.setStart(startNode, startIndex);
|
|
11287
|
-
range.setEnd(endNode, endIndex);
|
|
11288
|
-
this.setRange(docElement, range);
|
|
11881
|
+
MarkdownEditor.prototype.instantiateRenderer = function () {
|
|
11882
|
+
this.renderFactory.addRenderer(RenderType.Content, new MarkdownRender(this.parent));
|
|
11289
11883
|
};
|
|
11290
|
-
|
|
11291
|
-
|
|
11292
|
-
|
|
11293
|
-
|
|
11294
|
-
|
|
11295
|
-
|
|
11296
|
-
|
|
11297
|
-
|
|
11298
|
-
|
|
11299
|
-
|
|
11300
|
-
|
|
11301
|
-
|
|
11302
|
-
this.
|
|
11884
|
+
MarkdownEditor.prototype.removeEventListener = function () {
|
|
11885
|
+
if (this.parent.isDestroyed) {
|
|
11886
|
+
return;
|
|
11887
|
+
}
|
|
11888
|
+
this.parent.off(initialEnd, this.render);
|
|
11889
|
+
this.parent.off(modelChanged, this.onPropertyChanged);
|
|
11890
|
+
this.parent.off(destroy, this.destroy);
|
|
11891
|
+
this.parent.off(markdownToolbarClick, this.onToolbarClick);
|
|
11892
|
+
this.parent.off(initialLoad, this.instantiateRenderer);
|
|
11893
|
+
this.parent.off(selectAll$1, this.selectAll);
|
|
11894
|
+
this.parent.off(getSelectedHtml, this.getSelectedHtml);
|
|
11895
|
+
this.parent.off(selectionSave, this.onSelectionSave);
|
|
11896
|
+
this.parent.off(selectionRestore, this.onSelectionRestore);
|
|
11897
|
+
this.parent.off(readOnlyMode, this.updateReadOnly);
|
|
11898
|
+
this.parent.off(moduleDestroy, this.moduleDestroy);
|
|
11303
11899
|
};
|
|
11304
|
-
|
|
11305
|
-
|
|
11306
|
-
|
|
11307
|
-
|
|
11308
|
-
|
|
11309
|
-
|
|
11310
|
-
|
|
11311
|
-
|
|
11312
|
-
|
|
11313
|
-
|
|
11314
|
-
|
|
11315
|
-
|
|
11316
|
-
|
|
11900
|
+
MarkdownEditor.prototype.render = function () {
|
|
11901
|
+
this.contentRenderer = this.renderFactory.getRenderer(RenderType.Content);
|
|
11902
|
+
var editElement = this.contentRenderer.getEditPanel();
|
|
11903
|
+
var option = { undoRedoSteps: this.parent.undoRedoSteps, undoRedoTimer: this.parent.undoRedoTimer };
|
|
11904
|
+
if (isNullOrUndefined(this.parent.formatter)) {
|
|
11905
|
+
this.parent.formatter = new MarkdownFormatter({
|
|
11906
|
+
element: editElement,
|
|
11907
|
+
options: option
|
|
11908
|
+
});
|
|
11909
|
+
}
|
|
11910
|
+
else {
|
|
11911
|
+
this.parent.formatter.updateFormatter(editElement, this.contentRenderer.getDocument(), option);
|
|
11912
|
+
}
|
|
11913
|
+
if (this.parent.toolbarSettings.enable) {
|
|
11914
|
+
this.toolbarUpdate = new MarkdownToolbarStatus(this.parent);
|
|
11915
|
+
}
|
|
11916
|
+
this.parent.notify(bindOnEnd, {});
|
|
11317
11917
|
};
|
|
11318
11918
|
/**
|
|
11319
|
-
*
|
|
11919
|
+
* Called internally if any of the property value changed.
|
|
11320
11920
|
*
|
|
11321
|
-
* @param {
|
|
11921
|
+
* @param {RichTextEditorModel} e - specifies the editor model
|
|
11322
11922
|
* @returns {void}
|
|
11323
11923
|
* @hidden
|
|
11324
11924
|
* @deprecated
|
|
11325
11925
|
*/
|
|
11326
|
-
|
|
11327
|
-
|
|
11926
|
+
MarkdownEditor.prototype.onPropertyChanged = function (e) {
|
|
11927
|
+
// On property code change here
|
|
11928
|
+
if (!isNullOrUndefined(e.newProp.formatter)) {
|
|
11929
|
+
var editElement = this.contentRenderer.getEditPanel();
|
|
11930
|
+
var option = { undoRedoSteps: this.parent.undoRedoSteps,
|
|
11931
|
+
undoRedoTimer: this.parent.undoRedoTimer };
|
|
11932
|
+
this.parent.formatter.updateFormatter(editElement, this.contentRenderer.getDocument(), option);
|
|
11933
|
+
}
|
|
11328
11934
|
};
|
|
11329
11935
|
/**
|
|
11330
|
-
*
|
|
11936
|
+
* For internal use only - Get the module name.
|
|
11331
11937
|
*
|
|
11332
|
-
* @param {Document} docElement - specifies the document.
|
|
11333
11938
|
* @returns {void}
|
|
11334
|
-
* @hidden
|
|
11335
|
-
* @deprecated
|
|
11336
11939
|
*/
|
|
11337
|
-
|
|
11338
|
-
|
|
11940
|
+
MarkdownEditor.prototype.getModuleName = function () {
|
|
11941
|
+
return 'markdownEditor';
|
|
11339
11942
|
};
|
|
11340
11943
|
/**
|
|
11341
|
-
*
|
|
11944
|
+
* For selecting all content in RTE
|
|
11342
11945
|
*
|
|
11343
|
-
* @param {Document} docElement - specifies the document.
|
|
11344
|
-
* @param {Node} newNode - specicfies the new node.
|
|
11345
|
-
* @param {Range} range - specifies the range.
|
|
11346
11946
|
* @returns {void}
|
|
11347
|
-
* @
|
|
11348
|
-
* @deprecated
|
|
11947
|
+
* @private
|
|
11349
11948
|
*/
|
|
11350
|
-
|
|
11351
|
-
|
|
11352
|
-
this.selectRange(docElement, range);
|
|
11949
|
+
MarkdownEditor.prototype.selectAll = function () {
|
|
11950
|
+
this.parent.formatter.editorManager.markdownSelection.setSelection(this.parent.contentModule.getEditPanel(), 0, this.parent.contentModule.getEditPanel().value.length);
|
|
11353
11951
|
};
|
|
11354
11952
|
/**
|
|
11355
|
-
*
|
|
11953
|
+
* For get a selected text in RTE
|
|
11356
11954
|
*
|
|
11357
|
-
* @param {
|
|
11358
|
-
* @param {Element} element - specifies the element.
|
|
11359
|
-
* @param {number} point - specifies the point.
|
|
11955
|
+
* @param {NotifyArgs} e - specifies the arguments.
|
|
11360
11956
|
* @returns {void}
|
|
11361
|
-
* @
|
|
11362
|
-
* @deprecated
|
|
11957
|
+
* @private
|
|
11363
11958
|
*/
|
|
11364
|
-
|
|
11365
|
-
|
|
11366
|
-
var selection = docElement.defaultView.getSelection();
|
|
11367
|
-
range.setStart(element, point);
|
|
11368
|
-
range.collapse(true);
|
|
11369
|
-
selection.removeAllRanges();
|
|
11370
|
-
selection.addRange(range);
|
|
11959
|
+
MarkdownEditor.prototype.getSelectedHtml = function (e) {
|
|
11960
|
+
e.callBack(this.parent.formatter.editorManager.markdownSelection.getSelectedText(this.parent.contentModule.getEditPanel()));
|
|
11371
11961
|
};
|
|
11372
|
-
return
|
|
11962
|
+
return MarkdownEditor;
|
|
11373
11963
|
}());
|
|
11374
11964
|
|
|
11375
|
-
/**
|
|
11376
|
-
* `Selection` module is used to handle RTE Selections.
|
|
11377
|
-
*/
|
|
11378
|
-
|
|
11379
11965
|
var markerClassName = {
|
|
11380
11966
|
startSelection: 'e-editor-select-start',
|
|
11381
11967
|
endSelection: 'e-editor-select-end'
|
|
@@ -12502,11 +13088,17 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
12502
13088
|
Lists.prototype.removeList = function (range, e) {
|
|
12503
13089
|
var startNode = this.parent.domNode.getSelectedNode(range.startContainer, range.startOffset);
|
|
12504
13090
|
var endNode = (!isNullOrUndefined(range.endContainer.parentElement.closest('li')) && range.endContainer.parentElement.closest('li').childElementCount > 1 && range.endContainer.nodeName === '#text') ? range.endContainer : this.parent.domNode.getSelectedNode(range.endContainer, range.endOffset);
|
|
13091
|
+
var parentList = (range.startContainer.nodeName === '#text') ? range.startContainer.parentElement.closest('li') : range.startContainer.closest('li');
|
|
13092
|
+
var fullContent = '';
|
|
13093
|
+
if (!isNullOrUndefined(parentList) && !isNullOrUndefined(parentList.childNodes)) {
|
|
13094
|
+
parentList.childNodes.forEach(function (e) {
|
|
13095
|
+
fullContent = fullContent + e.textContent;
|
|
13096
|
+
});
|
|
13097
|
+
}
|
|
12505
13098
|
startNode = startNode.nodeName === 'BR' ? startNode.parentElement : startNode;
|
|
12506
13099
|
endNode = endNode.nodeName === 'BR' ? endNode.parentElement : endNode;
|
|
12507
13100
|
startNode = startNode.nodeName !== 'LI' && !isNullOrUndefined(startNode.closest('LI')) ? startNode.closest('LI') : startNode;
|
|
12508
13101
|
endNode = endNode.nodeName !== 'LI' && endNode.nodeName !== '#text' && !isNullOrUndefined(endNode.closest('LI')) ? endNode.closest('LI') : endNode;
|
|
12509
|
-
var parentList = (range.startContainer.nodeName === '#text') ? range.startContainer.parentElement.closest('li') : range.startContainer.closest('li');
|
|
12510
13102
|
if (((range.commonAncestorContainer.nodeName === 'OL' || range.commonAncestorContainer.nodeName === 'UL' || range.commonAncestorContainer.nodeName === 'LI') &&
|
|
12511
13103
|
isNullOrUndefined(endNode.nextElementSibling) && endNode.textContent.length === range.endOffset &&
|
|
12512
13104
|
isNullOrUndefined(startNode.previousElementSibling) && range.startOffset === 0) ||
|
|
@@ -12523,10 +13115,23 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
12523
13115
|
}
|
|
12524
13116
|
e.event.preventDefault();
|
|
12525
13117
|
}
|
|
12526
|
-
else if (!isNullOrUndefined(parentList) &&
|
|
13118
|
+
else if (!isNullOrUndefined(parentList) && !range.collapsed && parentList.textContent === fullContent) {
|
|
12527
13119
|
range.deleteContents();
|
|
12528
|
-
this.parent.editableElement.querySelectorAll('li
|
|
12529
|
-
|
|
13120
|
+
this.parent.editableElement.querySelectorAll('li').forEach(function (li) {
|
|
13121
|
+
if (!li.firstChild || li.textContent.trim() === '') {
|
|
13122
|
+
li.parentNode.removeChild(li);
|
|
13123
|
+
}
|
|
13124
|
+
});
|
|
13125
|
+
this.parent.editableElement.querySelectorAll('ol').forEach(function (ol) {
|
|
13126
|
+
if (!ol.firstChild || ol.textContent.trim() === '') {
|
|
13127
|
+
ol.parentNode.removeChild(ol);
|
|
13128
|
+
}
|
|
13129
|
+
});
|
|
13130
|
+
this.parent.editableElement.querySelectorAll('ul').forEach(function (ul) {
|
|
13131
|
+
if (!ul.firstChild || ul.textContent.trim() === '') {
|
|
13132
|
+
ul.parentNode.removeChild(ul);
|
|
13133
|
+
}
|
|
13134
|
+
});
|
|
12530
13135
|
e.event.preventDefault();
|
|
12531
13136
|
}
|
|
12532
13137
|
};
|
|
@@ -12923,6 +13528,10 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
12923
13528
|
}
|
|
12924
13529
|
else {
|
|
12925
13530
|
this.checkLists(elements, type, item);
|
|
13531
|
+
var marginLeftAttribute = '';
|
|
13532
|
+
if (elements[0].style.marginLeft !== '') {
|
|
13533
|
+
marginLeftAttribute = ' style = "margin-left: ' + elements[0].style.marginLeft + ';"';
|
|
13534
|
+
}
|
|
12926
13535
|
for (var i = 0; i < elements.length; i++) {
|
|
12927
13536
|
if (!isNullOrUndefined(item) && !isNullOrUndefined(item.listStyle)) {
|
|
12928
13537
|
if (item.listStyle === 'listImage') {
|
|
@@ -12933,6 +13542,9 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
12933
13542
|
setStyleAttribute(elements[i], { 'list-style-type': item.listStyle.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase() });
|
|
12934
13543
|
}
|
|
12935
13544
|
}
|
|
13545
|
+
var elemAtt = void 0;
|
|
13546
|
+
elements[i].style.removeProperty('margin-left');
|
|
13547
|
+
elemAtt = elements[i].tagName === 'IMG' ? '' : this.domNode.attributes(elements[i]);
|
|
12936
13548
|
if (elements[i].getAttribute('contenteditable') === 'true'
|
|
12937
13549
|
&& elements[i].childNodes.length === 1 && elements[i].childNodes[0].nodeName === 'TABLE') {
|
|
12938
13550
|
var listEle = document.createElement(type);
|
|
@@ -12941,8 +13553,7 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
12941
13553
|
}
|
|
12942
13554
|
else if ('LI' !== elements[i].tagName && isNullOrUndefined(item) &&
|
|
12943
13555
|
elements[i].nodeName === 'BLOCKQUOTE') {
|
|
12944
|
-
var
|
|
12945
|
-
var openTag = '<' + type + '>';
|
|
13556
|
+
var openTag = '<' + type + marginLeftAttribute + '>';
|
|
12946
13557
|
var closeTag = '</' + type + '>';
|
|
12947
13558
|
var newTag = 'li' + elemAtt;
|
|
12948
13559
|
var replaceHTML = elements[i].innerHTML;
|
|
@@ -12951,8 +13562,7 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
12951
13562
|
elements[i].innerHTML = collectionString;
|
|
12952
13563
|
}
|
|
12953
13564
|
else if ('LI' !== elements[i].tagName && isNullOrUndefined(item)) {
|
|
12954
|
-
var
|
|
12955
|
-
var openTag = '<' + type + '>';
|
|
13565
|
+
var openTag = '<' + type + marginLeftAttribute + '>';
|
|
12956
13566
|
var closeTag = '</' + type + '>';
|
|
12957
13567
|
var newTag = 'li' + elemAtt;
|
|
12958
13568
|
var replaceHTML = (elements[i].tagName.toLowerCase() === DEFAULT_TAG ?
|
|
@@ -12963,8 +13573,8 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
12963
13573
|
}
|
|
12964
13574
|
else if (!isNullOrUndefined(item) && 'LI' !== elements[i].tagName) {
|
|
12965
13575
|
// eslint-disable-next-line
|
|
12966
|
-
var
|
|
12967
|
-
var openTag = '<' + type +
|
|
13576
|
+
var currentElemAtt = elements[i].tagName === 'IMG' ? '' : this.domNode.attributes(elements[i]);
|
|
13577
|
+
var openTag = '<' + type + currentElemAtt + '>';
|
|
12968
13578
|
var closeTag = '</' + type + '>';
|
|
12969
13579
|
var newTag = 'li';
|
|
12970
13580
|
var replaceHTML = (elements[i].tagName.toLowerCase() === DEFAULT_TAG ?
|
|
@@ -13160,16 +13770,16 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
13160
13770
|
var parentElement = parentNode;
|
|
13161
13771
|
if (elements.length === parentElement.querySelectorAll('li').length) {
|
|
13162
13772
|
if (!isNullOrUndefined(parentElement.style.listStyleType)) {
|
|
13163
|
-
parentNode.style.removeProperty(
|
|
13773
|
+
parentNode.style.removeProperty("list-style-type");
|
|
13164
13774
|
}
|
|
13165
13775
|
if (!isNullOrUndefined(parentElement.style.listStyleImage)) {
|
|
13166
|
-
parentNode.style.removeProperty(
|
|
13776
|
+
parentNode.style.removeProperty("list-style-image");
|
|
13167
13777
|
}
|
|
13168
13778
|
if (parentElement.style.length === 0) {
|
|
13169
|
-
parentNode.removeAttribute(
|
|
13779
|
+
parentNode.removeAttribute("style");
|
|
13170
13780
|
}
|
|
13171
13781
|
}
|
|
13172
|
-
var wrapper = '<' + DEFAULT_TAG + wrapperclass + '></' + DEFAULT_TAG + '>';
|
|
13782
|
+
var wrapper = '<' + DEFAULT_TAG + wrapperclass + this.domNode.attributes(element) + '></' + DEFAULT_TAG + '>';
|
|
13173
13783
|
if (e.enterAction !== 'BR') {
|
|
13174
13784
|
this.domNode.wrapInner(element, this.domNode.parseHTMLFragment(wrapper));
|
|
13175
13785
|
}
|
|
@@ -13483,6 +14093,9 @@ var NodeCutter = /** @__PURE__ @class */ (function () {
|
|
|
13483
14093
|
else {
|
|
13484
14094
|
var startOffset = this.GetCursorStart(indexes, range.startOffset, true);
|
|
13485
14095
|
this.position = range.startOffset - startOffset;
|
|
14096
|
+
if (startOffset !== 0 && str[startOffset] && str[startOffset] === ' ') {
|
|
14097
|
+
startOffset = startOffset + 1;
|
|
14098
|
+
}
|
|
13486
14099
|
cursorRange.setStart(range.startContainer, startOffset);
|
|
13487
14100
|
cursorRange.setEnd(range.startContainer, this.GetCursorStart(indexes, range.startOffset, false));
|
|
13488
14101
|
}
|
|
@@ -14342,7 +14955,7 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
14342
14955
|
if (blockNode.nodeName === 'BODY' && range.startContainer === range.endContainer && range.startContainer.nodeType === 1) {
|
|
14343
14956
|
blockNode = range.startContainer;
|
|
14344
14957
|
}
|
|
14345
|
-
if (blockNode.closest('LI') && node && node.firstElementChild &&
|
|
14958
|
+
if (blockNode.closest('LI') && blockNode.nodeName !== 'TD' && blockNode.nodeName !== 'TH' && blockNode.nodeName !== 'TR' && node && node.firstElementChild &&
|
|
14346
14959
|
((node).firstElementChild.tagName === 'OL' || node.firstElementChild.tagName === 'UL')) {
|
|
14347
14960
|
var liNode = void 0;
|
|
14348
14961
|
while (node.firstElementChild.lastElementChild && node.firstElementChild.lastElementChild.tagName === 'LI') {
|
|
@@ -14372,7 +14985,7 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
14372
14985
|
}
|
|
14373
14986
|
}
|
|
14374
14987
|
else if ((currentNode.nodeName === '#text' || currentNode.nodeName === 'BR') && !isNullOrUndefined(currentNode.parentElement) &&
|
|
14375
|
-
(currentNode.parentElement.nodeName === 'LI' || (blockNode === editNode && currentNode.parentElement === blockNode)) &&
|
|
14988
|
+
(currentNode.parentElement.nodeName === 'LI' || currentNode.parentElement.closest('LI') || (blockNode === editNode && currentNode.parentElement === blockNode)) &&
|
|
14376
14989
|
currentNode.parentElement.textContent.trim().length > 0) {
|
|
14377
14990
|
splitedElm = currentNode;
|
|
14378
14991
|
if (currentNode.parentElement.nodeName === 'LI' && !isNullOrUndefined(currentNode.nextSibling) &&
|
|
@@ -14381,6 +14994,12 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
14381
14994
|
}
|
|
14382
14995
|
if (!range.collapsed) {
|
|
14383
14996
|
range.deleteContents();
|
|
14997
|
+
var value = range.startContainer;
|
|
14998
|
+
if (!isNullOrUndefined(value) && value.nodeName === 'LI' && !isNullOrUndefined(value.parentElement) && (value.parentElement.nodeName === 'OL' || value.parentElement.nodeName === 'UL') && value.textContent.trim() === '') {
|
|
14999
|
+
value.parentElement.querySelectorAll('li').forEach(function (item) {
|
|
15000
|
+
item.remove();
|
|
15001
|
+
});
|
|
15002
|
+
}
|
|
14384
15003
|
}
|
|
14385
15004
|
range.insertNode(node);
|
|
14386
15005
|
this.contentsDeleted = true;
|
|
@@ -14573,7 +15192,8 @@ var LinkCommand = /** @__PURE__ @class */ (function () {
|
|
|
14573
15192
|
}
|
|
14574
15193
|
if (!isNullOrUndefined(e.item.text) && e.item.text !== '') {
|
|
14575
15194
|
linkText = anchorEle.innerText;
|
|
14576
|
-
anchorEle.innerText = e.item.text
|
|
15195
|
+
anchorEle.firstChild.nodeName === '#text' ? anchorEle.innerText = e.item.text :
|
|
15196
|
+
anchorEle.firstChild.innerText = e.item.text;
|
|
14577
15197
|
}
|
|
14578
15198
|
if (!isNullOrUndefined(e.item.target)) {
|
|
14579
15199
|
anchorEle.setAttribute('target', e.item.target);
|
|
@@ -14589,7 +15209,8 @@ var LinkCommand = /** @__PURE__ @class */ (function () {
|
|
|
14589
15209
|
}
|
|
14590
15210
|
else {
|
|
14591
15211
|
var startIndex = e.item.action === 'Paste' ? anchorEle.childNodes[0].textContent.length : 0;
|
|
14592
|
-
|
|
15212
|
+
var endIndex = anchorEle.firstChild.nodeName === '#text' ? anchorEle.childNodes[0].textContent.length : anchorEle.childNodes.length;
|
|
15213
|
+
e.item.selection.setSelectionText(this.parent.currentDocument, anchorEle.childNodes[0], anchorEle.childNodes[0], startIndex, endIndex);
|
|
14593
15214
|
}
|
|
14594
15215
|
}
|
|
14595
15216
|
else {
|
|
@@ -15011,7 +15632,7 @@ var Indents = /** @__PURE__ @class */ (function () {
|
|
|
15011
15632
|
isRtl ? (parentNode.style.marginRight = indentsValue) : (parentNode.style.marginLeft = indentsValue);
|
|
15012
15633
|
}
|
|
15013
15634
|
else {
|
|
15014
|
-
indentsValue = (marginLeftOrRight === '' || marginLeftOrRight === '0px') ? '' : parseInt(marginLeftOrRight, null) - this.indentValue + 'px';
|
|
15635
|
+
indentsValue = (marginLeftOrRight === '' || marginLeftOrRight === '0px' || marginLeftOrRight === '0in') ? '' : parseInt(marginLeftOrRight, null) - this.indentValue + 'px';
|
|
15015
15636
|
isRtl ? (parentNode.style.marginRight = indentsValue) : (parentNode.style.marginLeft = indentsValue);
|
|
15016
15637
|
/* eslint-enable */
|
|
15017
15638
|
}
|
|
@@ -16580,28 +17201,23 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
16580
17201
|
var newCell = this.activeCell.cloneNode(true);
|
|
16581
17202
|
newCell.removeAttribute('class');
|
|
16582
17203
|
newCell.innerHTML = '</br>';
|
|
16583
|
-
var avgWidth = parseFloat(this.activeCell.style.width) / 2;
|
|
16584
|
-
if (this.activeCell.tagName === 'TH' && isNaN(avgWidth)) {
|
|
16585
|
-
var cellCount = this.curTable.querySelector('tr').childElementCount;
|
|
16586
|
-
var colSpanCount = 0;
|
|
16587
|
-
for (var i = 0; i < cellCount; i++) {
|
|
16588
|
-
colSpanCount = colSpanCount + (parseInt(this.curTable.querySelector('tr').children[i].getAttribute('colspan'), 10) || 1);
|
|
16589
|
-
}
|
|
16590
|
-
avgWidth = parseFloat((((this.activeCell.offsetWidth / 2) / this.curTable.offsetWidth) * 100).toFixed(1));
|
|
16591
|
-
}
|
|
16592
17204
|
var activeCellIndex = this.getCorrespondingIndex(this.activeCell, this.getCorrespondingColumns());
|
|
16593
17205
|
var correspondingColumns = this.getCorrespondingColumns();
|
|
16594
|
-
var activeCellcolSpan = parseInt(this.activeCell.getAttribute('colspan'), 10);
|
|
17206
|
+
var activeCellcolSpan = parseInt(this.activeCell.getAttribute('colspan'), 10) || 1;
|
|
16595
17207
|
if (activeCellcolSpan > 1) {
|
|
16596
|
-
|
|
16597
|
-
|
|
16598
|
-
|
|
16599
|
-
|
|
16600
|
-
|
|
16601
|
-
|
|
16602
|
-
|
|
17208
|
+
var colSpan = Math.ceil(activeCellcolSpan / 2);
|
|
17209
|
+
var getColSizes = this.getColSizes(this.curTable);
|
|
17210
|
+
var activeCellUpdatedWidth = this.getSplitColWidth(activeCellIndex[1], activeCellIndex[1] + colSpan - 1, getColSizes);
|
|
17211
|
+
var newCellWidth = this.getSplitColWidth(activeCellIndex[1] + colSpan, activeCellIndex[1] + activeCellcolSpan - 1, getColSizes);
|
|
17212
|
+
var activeCellWidth = this.convertPixelToPercentage(this.activeCell.offsetWidth, this.curTable.offsetWidth);
|
|
17213
|
+
newCellWidth = (activeCellWidth - activeCellUpdatedWidth) < newCellWidth ? (activeCellWidth - activeCellUpdatedWidth) : newCellWidth;
|
|
17214
|
+
1 < colSpan ? this.activeCell.setAttribute('colspan', colSpan.toString()) : this.activeCell.removeAttribute('colspan');
|
|
17215
|
+
1 < activeCellcolSpan - colSpan ? newCell.setAttribute('colspan', (activeCellcolSpan - colSpan).toString()) : newCell.removeAttribute('colspan');
|
|
17216
|
+
this.activeCell.style.width = activeCellUpdatedWidth + '%';
|
|
17217
|
+
newCell.style.width = newCellWidth + '%';
|
|
16603
17218
|
}
|
|
16604
17219
|
else {
|
|
17220
|
+
var avgWidth = parseFloat(this.activeCell.style.width) / 2;
|
|
16605
17221
|
for (var i = 0; i <= allRows.length - 1; i++) {
|
|
16606
17222
|
if (0 === i || correspondingColumns[i][activeCellIndex[1]] !== correspondingColumns[i - 1][activeCellIndex[1]]) {
|
|
16607
17223
|
var currentCell = correspondingColumns[i][activeCellIndex[1]];
|
|
@@ -16611,9 +17227,9 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
16611
17227
|
}
|
|
16612
17228
|
}
|
|
16613
17229
|
}
|
|
17230
|
+
this.activeCell.style.width = avgWidth + '%';
|
|
17231
|
+
newCell.style.width = avgWidth + '%';
|
|
16614
17232
|
}
|
|
16615
|
-
this.activeCell.style.width = avgWidth + '%';
|
|
16616
|
-
newCell.style.width = avgWidth + '%';
|
|
16617
17233
|
this.activeCell.parentNode.insertBefore(newCell, this.activeCell.nextSibling);
|
|
16618
17234
|
if (e.callBack) {
|
|
16619
17235
|
e.callBack({
|
|
@@ -16625,6 +17241,54 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
16625
17241
|
});
|
|
16626
17242
|
}
|
|
16627
17243
|
};
|
|
17244
|
+
TableCommand.prototype.getSplitColWidth = function (startIndex, endInex, sizes) {
|
|
17245
|
+
var width = 0;
|
|
17246
|
+
for (var i = startIndex; i <= endInex; i++) {
|
|
17247
|
+
width += sizes[i];
|
|
17248
|
+
}
|
|
17249
|
+
return this.convertPixelToPercentage(width, this.curTable.offsetWidth);
|
|
17250
|
+
};
|
|
17251
|
+
TableCommand.prototype.getColSizes = function (curTable) {
|
|
17252
|
+
var cellColl = curTable.rows[0].cells;
|
|
17253
|
+
var cellCount = 0;
|
|
17254
|
+
for (var cell = 0; cell < cellColl.length; cell++) {
|
|
17255
|
+
cellCount = cellCount + cellColl[cell].colSpan;
|
|
17256
|
+
}
|
|
17257
|
+
var sizes = new Array(cellCount);
|
|
17258
|
+
var rowSpanCells = new Map();
|
|
17259
|
+
for (var i = 0; i < curTable.rows.length; i++) {
|
|
17260
|
+
var currentColIndex = 0;
|
|
17261
|
+
for (var k = 0; k < curTable.rows[i].cells.length; k++) {
|
|
17262
|
+
for (var l = 1; l < curTable.rows[i].cells[k].rowSpan; l++) {
|
|
17263
|
+
var key = "" + (i + l) + currentColIndex;
|
|
17264
|
+
rowSpanCells.set(key, curTable.rows[i].cells[k]);
|
|
17265
|
+
}
|
|
17266
|
+
var cellIndex = this.getCellIndex(rowSpanCells, i, k);
|
|
17267
|
+
if (cellIndex > currentColIndex) {
|
|
17268
|
+
currentColIndex = cellIndex;
|
|
17269
|
+
}
|
|
17270
|
+
var width = curTable.rows[i].cells[k].offsetWidth;
|
|
17271
|
+
if (!sizes[currentColIndex] || width < sizes[currentColIndex]) {
|
|
17272
|
+
sizes[currentColIndex] = width;
|
|
17273
|
+
}
|
|
17274
|
+
currentColIndex += 1 + curTable.rows[i].cells[k].colSpan - 1;
|
|
17275
|
+
}
|
|
17276
|
+
}
|
|
17277
|
+
return sizes;
|
|
17278
|
+
};
|
|
17279
|
+
TableCommand.prototype.getCellIndex = function (rowSpanCells, rowIndex, colIndex) {
|
|
17280
|
+
var cellKey = "" + rowIndex + colIndex;
|
|
17281
|
+
var spannedCell = rowSpanCells.get(cellKey);
|
|
17282
|
+
if (spannedCell) {
|
|
17283
|
+
return this.getCellIndex(rowSpanCells, rowIndex, colIndex + spannedCell.colSpan);
|
|
17284
|
+
}
|
|
17285
|
+
else {
|
|
17286
|
+
return colIndex;
|
|
17287
|
+
}
|
|
17288
|
+
};
|
|
17289
|
+
TableCommand.prototype.convertPixelToPercentage = function (value, offsetValue) {
|
|
17290
|
+
return (value / offsetValue) * 100;
|
|
17291
|
+
};
|
|
16628
17292
|
TableCommand.prototype.getCorrespondingColumns = function () {
|
|
16629
17293
|
var elementArray = [];
|
|
16630
17294
|
// eslint-disable-next-line
|
|
@@ -16791,259 +17455,6 @@ var MinMax = /** @__PURE__ @class */ (function () {
|
|
|
16791
17455
|
return MinMax;
|
|
16792
17456
|
}());
|
|
16793
17457
|
|
|
16794
|
-
/**
|
|
16795
|
-
* Is formatted or not.
|
|
16796
|
-
*
|
|
16797
|
-
* @hidden
|
|
16798
|
-
* @deprecated
|
|
16799
|
-
*/
|
|
16800
|
-
var IsFormatted = /** @__PURE__ @class */ (function () {
|
|
16801
|
-
function IsFormatted() {
|
|
16802
|
-
}
|
|
16803
|
-
/**
|
|
16804
|
-
* getFormattedNode method
|
|
16805
|
-
*
|
|
16806
|
-
* @param {Node} node - specifies the node.
|
|
16807
|
-
* @param {string} format - specifies the string value.
|
|
16808
|
-
* @param {Node} endNode - specifies the end node
|
|
16809
|
-
* @returns {Node} - returns the node
|
|
16810
|
-
* @hidden
|
|
16811
|
-
* @deprecated
|
|
16812
|
-
*/
|
|
16813
|
-
IsFormatted.prototype.getFormattedNode = function (node, format, endNode) {
|
|
16814
|
-
var parentNode = this.getFormatParent(node, format, endNode);
|
|
16815
|
-
if (parentNode !== null && parentNode !== endNode) {
|
|
16816
|
-
return parentNode;
|
|
16817
|
-
}
|
|
16818
|
-
return null;
|
|
16819
|
-
};
|
|
16820
|
-
IsFormatted.prototype.getFormatParent = function (node, format, endNode) {
|
|
16821
|
-
do {
|
|
16822
|
-
node = node.parentNode;
|
|
16823
|
-
} while (node && (node !== endNode) && !this.isFormattedNode(node, format));
|
|
16824
|
-
return node;
|
|
16825
|
-
};
|
|
16826
|
-
IsFormatted.prototype.isFormattedNode = function (node, format) {
|
|
16827
|
-
switch (format) {
|
|
16828
|
-
case 'bold':
|
|
16829
|
-
return IsFormatted.isBold(node);
|
|
16830
|
-
case 'italic':
|
|
16831
|
-
return IsFormatted.isItalic(node);
|
|
16832
|
-
case 'underline':
|
|
16833
|
-
return IsFormatted.isUnderline(node);
|
|
16834
|
-
case 'strikethrough':
|
|
16835
|
-
return IsFormatted.isStrikethrough(node);
|
|
16836
|
-
case 'superscript':
|
|
16837
|
-
return IsFormatted.isSuperscript(node);
|
|
16838
|
-
case 'subscript':
|
|
16839
|
-
return IsFormatted.isSubscript(node);
|
|
16840
|
-
case 'fontcolor':
|
|
16841
|
-
return this.isFontColor(node);
|
|
16842
|
-
case 'fontname':
|
|
16843
|
-
return this.isFontName(node);
|
|
16844
|
-
case 'fontsize':
|
|
16845
|
-
return this.isFontSize(node);
|
|
16846
|
-
case 'backgroundcolor':
|
|
16847
|
-
return this.isBackgroundColor(node);
|
|
16848
|
-
default:
|
|
16849
|
-
return false;
|
|
16850
|
-
}
|
|
16851
|
-
};
|
|
16852
|
-
/**
|
|
16853
|
-
* isBold method
|
|
16854
|
-
*
|
|
16855
|
-
* @param {Node} node - specifies the node value
|
|
16856
|
-
* @returns {boolean} - returns the boolean value
|
|
16857
|
-
* @hidden
|
|
16858
|
-
* @deprecated
|
|
16859
|
-
*/
|
|
16860
|
-
IsFormatted.isBold = function (node) {
|
|
16861
|
-
var validTags = ['strong', 'b'];
|
|
16862
|
-
if (validTags.indexOf(node.nodeName.toLowerCase()) !== -1) {
|
|
16863
|
-
return true;
|
|
16864
|
-
}
|
|
16865
|
-
else if (this.inlineTags.indexOf(node.nodeName.toLowerCase()) !== -1 &&
|
|
16866
|
-
node.style && node.style.fontWeight === 'bold') {
|
|
16867
|
-
return true;
|
|
16868
|
-
}
|
|
16869
|
-
else {
|
|
16870
|
-
return false;
|
|
16871
|
-
}
|
|
16872
|
-
};
|
|
16873
|
-
/**
|
|
16874
|
-
* isItalic method
|
|
16875
|
-
*
|
|
16876
|
-
* @param {Node} node - specifies the node value
|
|
16877
|
-
* @returns {boolean} - returns the boolean value
|
|
16878
|
-
* @hidden
|
|
16879
|
-
* @deprecated
|
|
16880
|
-
*/
|
|
16881
|
-
IsFormatted.isItalic = function (node) {
|
|
16882
|
-
var validTags = ['em', 'i'];
|
|
16883
|
-
if (validTags.indexOf(node.nodeName.toLowerCase()) !== -1) {
|
|
16884
|
-
return true;
|
|
16885
|
-
}
|
|
16886
|
-
else if (this.inlineTags.indexOf(node.nodeName.toLowerCase()) !== -1 &&
|
|
16887
|
-
node.style && node.style.fontStyle === 'italic') {
|
|
16888
|
-
return true;
|
|
16889
|
-
}
|
|
16890
|
-
else {
|
|
16891
|
-
return false;
|
|
16892
|
-
}
|
|
16893
|
-
};
|
|
16894
|
-
/**
|
|
16895
|
-
* isUnderline method
|
|
16896
|
-
*
|
|
16897
|
-
* @param {Node} node - specifies the node value
|
|
16898
|
-
* @returns {boolean} - returns the boolean value
|
|
16899
|
-
* @hidden
|
|
16900
|
-
* @deprecated
|
|
16901
|
-
*/
|
|
16902
|
-
IsFormatted.isUnderline = function (node) {
|
|
16903
|
-
var validTags = ['u'];
|
|
16904
|
-
if (validTags.indexOf(node.nodeName.toLowerCase()) !== -1) {
|
|
16905
|
-
return true;
|
|
16906
|
-
/* eslint-disable */
|
|
16907
|
-
}
|
|
16908
|
-
else if (this.inlineTags.indexOf(node.nodeName.toLowerCase()) !== -1 &&
|
|
16909
|
-
node.style && (node.style.textDecoration === 'underline' ||
|
|
16910
|
-
node.style.textDecorationLine === 'underline')) {
|
|
16911
|
-
/* eslint-enable */
|
|
16912
|
-
return true;
|
|
16913
|
-
}
|
|
16914
|
-
else {
|
|
16915
|
-
return false;
|
|
16916
|
-
}
|
|
16917
|
-
};
|
|
16918
|
-
/**
|
|
16919
|
-
* isStrikethrough method
|
|
16920
|
-
*
|
|
16921
|
-
* @param {Node} node - specifies the node value
|
|
16922
|
-
* @returns {boolean} - returns the boolean value
|
|
16923
|
-
* @hidden
|
|
16924
|
-
* @deprecated
|
|
16925
|
-
*/
|
|
16926
|
-
IsFormatted.isStrikethrough = function (node) {
|
|
16927
|
-
var validTags = ['del', 'strike'];
|
|
16928
|
-
if (validTags.indexOf(node.nodeName.toLowerCase()) !== -1) {
|
|
16929
|
-
return true;
|
|
16930
|
-
/* eslint-disable */
|
|
16931
|
-
}
|
|
16932
|
-
else if (this.inlineTags.indexOf(node.nodeName.toLowerCase()) !== -1 &&
|
|
16933
|
-
node.style && (node.style.textDecoration === 'line-through' ||
|
|
16934
|
-
node.style.textDecorationLine === 'line-through')) {
|
|
16935
|
-
/* eslint-enable */
|
|
16936
|
-
return true;
|
|
16937
|
-
}
|
|
16938
|
-
else {
|
|
16939
|
-
return false;
|
|
16940
|
-
}
|
|
16941
|
-
};
|
|
16942
|
-
/**
|
|
16943
|
-
* isSuperscript method
|
|
16944
|
-
*
|
|
16945
|
-
* @param {Node} node - specifies the node value
|
|
16946
|
-
* @returns {boolean} - returns the boolean value
|
|
16947
|
-
* @hidden
|
|
16948
|
-
* @deprecated
|
|
16949
|
-
*/
|
|
16950
|
-
IsFormatted.isSuperscript = function (node) {
|
|
16951
|
-
var validTags = ['sup'];
|
|
16952
|
-
if (validTags.indexOf(node.nodeName.toLowerCase()) !== -1) {
|
|
16953
|
-
return true;
|
|
16954
|
-
}
|
|
16955
|
-
else {
|
|
16956
|
-
return false;
|
|
16957
|
-
}
|
|
16958
|
-
};
|
|
16959
|
-
/**
|
|
16960
|
-
* isSubscript method
|
|
16961
|
-
*
|
|
16962
|
-
* @param {Node} node - specifies the node value
|
|
16963
|
-
* @returns {boolean} - returns the boolean value
|
|
16964
|
-
* @hidden
|
|
16965
|
-
* @deprecated
|
|
16966
|
-
*/
|
|
16967
|
-
IsFormatted.isSubscript = function (node) {
|
|
16968
|
-
var validTags = ['sub'];
|
|
16969
|
-
if (validTags.indexOf(node.nodeName.toLowerCase()) !== -1) {
|
|
16970
|
-
return true;
|
|
16971
|
-
}
|
|
16972
|
-
else {
|
|
16973
|
-
return false;
|
|
16974
|
-
}
|
|
16975
|
-
};
|
|
16976
|
-
IsFormatted.prototype.isFontColor = function (node) {
|
|
16977
|
-
var color = node.style && node.style.color;
|
|
16978
|
-
if (IsFormatted.inlineTags.indexOf(node.nodeName.toLowerCase()) !== -1 &&
|
|
16979
|
-
color !== null && color !== '' && color !== undefined) {
|
|
16980
|
-
return true;
|
|
16981
|
-
}
|
|
16982
|
-
else {
|
|
16983
|
-
return false;
|
|
16984
|
-
}
|
|
16985
|
-
};
|
|
16986
|
-
IsFormatted.prototype.isBackgroundColor = function (node) {
|
|
16987
|
-
var backColor = node.style && node.style.backgroundColor;
|
|
16988
|
-
if (IsFormatted.inlineTags.indexOf(node.nodeName.toLowerCase()) !== -1 &&
|
|
16989
|
-
backColor !== null && backColor !== '' && backColor !== undefined) {
|
|
16990
|
-
return true;
|
|
16991
|
-
}
|
|
16992
|
-
else {
|
|
16993
|
-
return false;
|
|
16994
|
-
}
|
|
16995
|
-
};
|
|
16996
|
-
IsFormatted.prototype.isFontSize = function (node) {
|
|
16997
|
-
var size = node.style && node.style.fontSize;
|
|
16998
|
-
if (IsFormatted.inlineTags.indexOf(node.nodeName.toLowerCase()) !== -1 &&
|
|
16999
|
-
size !== null && size !== '' && size !== undefined) {
|
|
17000
|
-
return true;
|
|
17001
|
-
}
|
|
17002
|
-
else {
|
|
17003
|
-
return false;
|
|
17004
|
-
}
|
|
17005
|
-
};
|
|
17006
|
-
IsFormatted.prototype.isFontName = function (node) {
|
|
17007
|
-
var name = node.style && node.style.fontFamily;
|
|
17008
|
-
if (IsFormatted.inlineTags.indexOf(node.nodeName.toLowerCase()) !== -1 &&
|
|
17009
|
-
name !== null && name !== '' && name !== undefined) {
|
|
17010
|
-
return true;
|
|
17011
|
-
}
|
|
17012
|
-
else {
|
|
17013
|
-
return false;
|
|
17014
|
-
}
|
|
17015
|
-
};
|
|
17016
|
-
// Get Formatted Node
|
|
17017
|
-
IsFormatted.inlineTags = [
|
|
17018
|
-
'a',
|
|
17019
|
-
'abbr',
|
|
17020
|
-
'acronym',
|
|
17021
|
-
'b',
|
|
17022
|
-
'bdo',
|
|
17023
|
-
'big',
|
|
17024
|
-
'cite',
|
|
17025
|
-
'code',
|
|
17026
|
-
'dfn',
|
|
17027
|
-
'em',
|
|
17028
|
-
'font',
|
|
17029
|
-
'i',
|
|
17030
|
-
'kbd',
|
|
17031
|
-
'label',
|
|
17032
|
-
'q',
|
|
17033
|
-
'samp',
|
|
17034
|
-
'small',
|
|
17035
|
-
'span',
|
|
17036
|
-
'strong',
|
|
17037
|
-
'sub',
|
|
17038
|
-
'sup',
|
|
17039
|
-
'tt',
|
|
17040
|
-
'u',
|
|
17041
|
-
'var',
|
|
17042
|
-
'del'
|
|
17043
|
-
];
|
|
17044
|
-
return IsFormatted;
|
|
17045
|
-
}());
|
|
17046
|
-
|
|
17047
17458
|
/**
|
|
17048
17459
|
* `Selection` module is used to handle RTE Selections.
|
|
17049
17460
|
*/
|
|
@@ -17413,6 +17824,10 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
17413
17824
|
liElement.style.fontStyle = 'normal';
|
|
17414
17825
|
}
|
|
17415
17826
|
}
|
|
17827
|
+
else if (!isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li'
|
|
17828
|
+
&& liElement.textContent.trim() !== nodes[index].textContent.trim()) {
|
|
17829
|
+
SelectionCommands.conCatenateTextNode(liElement, format, '', 'normal');
|
|
17830
|
+
}
|
|
17416
17831
|
}
|
|
17417
17832
|
if (child[0] && !isFontStyle) {
|
|
17418
17833
|
var nodeTraverse = child[index] ? child[index] : child[0];
|
|
@@ -17471,6 +17886,10 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
17471
17886
|
liElement.style.fontFamily = value;
|
|
17472
17887
|
}
|
|
17473
17888
|
}
|
|
17889
|
+
if (!isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li'
|
|
17890
|
+
&& liElement.textContent.trim() !== nodes[index].textContent.trim()) {
|
|
17891
|
+
SelectionCommands.conCatenateTextNode(liElement, format, liElement.textContent, format, value);
|
|
17892
|
+
}
|
|
17474
17893
|
if (child[num].textContent === startText) {
|
|
17475
17894
|
if (num === 0) {
|
|
17476
17895
|
range.setStartBefore(child[num]);
|
|
@@ -17578,7 +17997,7 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
17578
17997
|
parentElement = parentElement.parentElement;
|
|
17579
17998
|
liElement = parentElement;
|
|
17580
17999
|
}
|
|
17581
|
-
if (format === 'fontcolor' || format === 'fontname') {
|
|
18000
|
+
if (format === 'fontcolor' || format === 'fontname' || format === 'fontsize') {
|
|
17582
18001
|
var parentElem = nodes[index].parentElement;
|
|
17583
18002
|
if (!isNullOrUndefined(parentElem) && parentElem.childNodes) {
|
|
17584
18003
|
for (var i = 0; i < parentElem.childNodes.length; i++) {
|
|
@@ -17598,6 +18017,9 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
17598
18017
|
case 'fontname':
|
|
17599
18018
|
liElement_1.style.fontFamily = value;
|
|
17600
18019
|
break;
|
|
18020
|
+
case 'fontsize':
|
|
18021
|
+
liElement_1.style.fontSize = value;
|
|
18022
|
+
break;
|
|
17601
18023
|
default:
|
|
17602
18024
|
break;
|
|
17603
18025
|
}
|
|
@@ -17613,6 +18035,9 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
17613
18035
|
case 'fontname':
|
|
17614
18036
|
childElement.style.fontFamily = 'initial';
|
|
17615
18037
|
break;
|
|
18038
|
+
case 'fontsize':
|
|
18039
|
+
childElement.style.fontSize = 'initial';
|
|
18040
|
+
break;
|
|
17616
18041
|
default:
|
|
17617
18042
|
break;
|
|
17618
18043
|
}
|
|
@@ -17672,6 +18097,10 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
17672
18097
|
}
|
|
17673
18098
|
nodeList[0] = currentFormatNode;
|
|
17674
18099
|
this.applyStyles(nodeList, 0, element);
|
|
18100
|
+
if (!isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li'
|
|
18101
|
+
&& liElement.textContent.trim() !== nodes[index].textContent.trim()) {
|
|
18102
|
+
SelectionCommands.conCatenateTextNode(liElement, format, liElement.textContent, format, value);
|
|
18103
|
+
}
|
|
17675
18104
|
}
|
|
17676
18105
|
else {
|
|
17677
18106
|
nodes[index] = this.applyStyles(nodes, index, element);
|
|
@@ -17692,6 +18121,10 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
17692
18121
|
liElement.style.fontStyle = 'italic';
|
|
17693
18122
|
}
|
|
17694
18123
|
}
|
|
18124
|
+
else if (!isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li'
|
|
18125
|
+
&& liElement.textContent.trim() !== nodes[index].textContent.trim()) {
|
|
18126
|
+
SelectionCommands.conCatenateTextNode(liElement, format, liElement.textContent, format);
|
|
18127
|
+
}
|
|
17695
18128
|
}
|
|
17696
18129
|
}
|
|
17697
18130
|
}
|
|
@@ -17895,7 +18328,9 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
17895
18328
|
}
|
|
17896
18329
|
var blockChildNodes = parent.parentElement.childNodes;
|
|
17897
18330
|
for (var k = 0; k < blockChildNodes.length; k++) {
|
|
17898
|
-
if (blockChildNodes[k].textContent.trim() === '' || blockChildNodes[k].textContent.length === 0)
|
|
18331
|
+
if ((blockChildNodes[k].textContent.trim() === '' || blockChildNodes[k].textContent.length === 0) &&
|
|
18332
|
+
blockChildNodes[k].textContent.charCodeAt(0) !== 160) {
|
|
18333
|
+
// 160 is the char code for
|
|
17899
18334
|
detach(blockChildNodes[k]);
|
|
17900
18335
|
}
|
|
17901
18336
|
}
|
|
@@ -17931,6 +18366,64 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
17931
18366
|
}
|
|
17932
18367
|
return result;
|
|
17933
18368
|
};
|
|
18369
|
+
SelectionCommands.conCatenateTextNode = function (liElement, format, value, formatStr, constVal) {
|
|
18370
|
+
var result = '';
|
|
18371
|
+
switch (format) {
|
|
18372
|
+
case 'bold':
|
|
18373
|
+
liElement.querySelectorAll('strong').forEach(function (e) {
|
|
18374
|
+
result = result + e.textContent;
|
|
18375
|
+
});
|
|
18376
|
+
if (result === value) {
|
|
18377
|
+
liElement.style.fontWeight = formatStr;
|
|
18378
|
+
}
|
|
18379
|
+
break;
|
|
18380
|
+
case 'italic':
|
|
18381
|
+
liElement.querySelectorAll('em').forEach(function (e) {
|
|
18382
|
+
result = result + e.textContent;
|
|
18383
|
+
});
|
|
18384
|
+
if (result === value) {
|
|
18385
|
+
liElement.style.fontStyle = formatStr;
|
|
18386
|
+
}
|
|
18387
|
+
break;
|
|
18388
|
+
case 'fontcolor':
|
|
18389
|
+
var colorStyle_1 = '';
|
|
18390
|
+
liElement.querySelectorAll('span').forEach(function (span) {
|
|
18391
|
+
colorStyle_1 = span.style.color;
|
|
18392
|
+
if (colorStyle_1 === constVal) {
|
|
18393
|
+
result = result + span.textContent;
|
|
18394
|
+
}
|
|
18395
|
+
});
|
|
18396
|
+
if (result === value) {
|
|
18397
|
+
liElement.style.color = colorStyle_1;
|
|
18398
|
+
liElement.style.textDecoration = 'inherit';
|
|
18399
|
+
}
|
|
18400
|
+
break;
|
|
18401
|
+
case 'fontsize':
|
|
18402
|
+
var fontSize_1 = '';
|
|
18403
|
+
liElement.querySelectorAll('span').forEach(function (span) {
|
|
18404
|
+
fontSize_1 = span.style.getPropertyValue('font-size');
|
|
18405
|
+
if (fontSize_1 === constVal) {
|
|
18406
|
+
result = result + span.textContent;
|
|
18407
|
+
}
|
|
18408
|
+
});
|
|
18409
|
+
if (result === value) {
|
|
18410
|
+
liElement.style.fontSize = fontSize_1;
|
|
18411
|
+
}
|
|
18412
|
+
break;
|
|
18413
|
+
case 'fontname':
|
|
18414
|
+
var fontFamily_1 = '';
|
|
18415
|
+
liElement.querySelectorAll('span').forEach(function (span) {
|
|
18416
|
+
fontFamily_1 = span.style.getPropertyValue('font-family');
|
|
18417
|
+
if (fontFamily_1 === constVal) {
|
|
18418
|
+
result = result + span.textContent;
|
|
18419
|
+
}
|
|
18420
|
+
});
|
|
18421
|
+
if (result === value) {
|
|
18422
|
+
liElement.style.fontFamily = fontFamily_1;
|
|
18423
|
+
}
|
|
18424
|
+
break;
|
|
18425
|
+
}
|
|
18426
|
+
};
|
|
17934
18427
|
SelectionCommands.enterAction = 'P';
|
|
17935
18428
|
return SelectionCommands;
|
|
17936
18429
|
}());
|
|
@@ -19686,376 +20179,6 @@ var InsertTextExec = /** @__PURE__ @class */ (function () {
|
|
|
19686
20179
|
return InsertTextExec;
|
|
19687
20180
|
}());
|
|
19688
20181
|
|
|
19689
|
-
/**
|
|
19690
|
-
* Update Toolbar Status
|
|
19691
|
-
*
|
|
19692
|
-
* @hidden
|
|
19693
|
-
* @deprecated
|
|
19694
|
-
*/
|
|
19695
|
-
var statusCollection = getDefaultHtmlTbStatus();
|
|
19696
|
-
var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
19697
|
-
function ToolbarStatus() {
|
|
19698
|
-
}
|
|
19699
|
-
/**
|
|
19700
|
-
* get method
|
|
19701
|
-
*
|
|
19702
|
-
* @param {Document} docElement - specifies the document element
|
|
19703
|
-
* @param {Node} rootNode - specifies the content editable element
|
|
19704
|
-
* @param {string[]} formatNode - specifies the format node
|
|
19705
|
-
* @param {string[]} fontSize - specifies the font size
|
|
19706
|
-
* @param {string[]} fontName - specifies the font name.
|
|
19707
|
-
* @param {Node} documentNode - specifies the document node.
|
|
19708
|
-
* @returns {IToolbarStatus} - returns the toolbar status
|
|
19709
|
-
* @hidden
|
|
19710
|
-
* @deprecated
|
|
19711
|
-
*/
|
|
19712
|
-
ToolbarStatus.get = function (docElement, rootNode, formatNode, fontSize, fontName, documentNode) {
|
|
19713
|
-
var formatCollection = JSON.parse(JSON.stringify(statusCollection));
|
|
19714
|
-
var nodeCollection = JSON.parse(JSON.stringify(statusCollection));
|
|
19715
|
-
var nodeSelection = new NodeSelection();
|
|
19716
|
-
var range = nodeSelection.getRange(docElement);
|
|
19717
|
-
var nodes = documentNode ? [documentNode] : range.collapsed ? nodeSelection.getNodeCollection(range) :
|
|
19718
|
-
nodeSelection.getSelectionNodeCollectionBr(range);
|
|
19719
|
-
var nodesLength = nodes.length;
|
|
19720
|
-
var isNodeChanged = false;
|
|
19721
|
-
for (var index = 0; index < nodes.length; index++) {
|
|
19722
|
-
while (nodes[index].nodeType === 3 && range.startContainer.nodeType === 3 && nodes[index].parentNode &&
|
|
19723
|
-
nodes[index].parentNode.lastElementChild && nodes[index].parentNode.lastElementChild.nodeName !== 'BR' &&
|
|
19724
|
-
(this.getImmediateBlockNode(nodes[index].parentNode)).textContent.replace(/\u200B/g, '').length === 0 &&
|
|
19725
|
-
range.startContainer.textContent.replace(/\u200B/g, '').length === 0 &&
|
|
19726
|
-
nodeSelection.get(docElement).toString().replace(/\u200B/g, '').length === 0) {
|
|
19727
|
-
nodes[index] = nodes[index].parentNode.lastElementChild.firstChild;
|
|
19728
|
-
isNodeChanged = true;
|
|
19729
|
-
}
|
|
19730
|
-
if (isNodeChanged && nodes[index]) {
|
|
19731
|
-
nodeSelection.setCursorPoint(docElement, nodes[index], nodes[index].textContent.length);
|
|
19732
|
-
isNodeChanged = false;
|
|
19733
|
-
}
|
|
19734
|
-
if ((nodes[index].nodeName !== 'BR' && nodes[index].nodeType !== 3) ||
|
|
19735
|
-
(nodesLength > 1 && nodes[index].nodeType === 3 && nodes[index].textContent.trim() === '')) {
|
|
19736
|
-
nodes.splice(index, 1);
|
|
19737
|
-
index--;
|
|
19738
|
-
}
|
|
19739
|
-
}
|
|
19740
|
-
for (var index = 0; index < nodes.length; index++) {
|
|
19741
|
-
// eslint-disable-next-line max-len
|
|
19742
|
-
formatCollection = this.getFormatParent(docElement, formatCollection, nodes[index], rootNode, formatNode, fontSize, fontName);
|
|
19743
|
-
if ((index === 0 && formatCollection.bold) || !formatCollection.bold) {
|
|
19744
|
-
nodeCollection.bold = formatCollection.bold;
|
|
19745
|
-
}
|
|
19746
|
-
if ((index === 0 && formatCollection.insertcode) || !formatCollection.insertcode) {
|
|
19747
|
-
nodeCollection.insertcode = formatCollection.insertcode;
|
|
19748
|
-
}
|
|
19749
|
-
if ((index === 0 && formatCollection.italic) || !formatCollection.italic) {
|
|
19750
|
-
nodeCollection.italic = formatCollection.italic;
|
|
19751
|
-
}
|
|
19752
|
-
if ((index === 0 && formatCollection.underline) || !formatCollection.underline) {
|
|
19753
|
-
nodeCollection.underline = formatCollection.underline;
|
|
19754
|
-
}
|
|
19755
|
-
if ((index === 0 && formatCollection.strikethrough) || !formatCollection.strikethrough) {
|
|
19756
|
-
nodeCollection.strikethrough = formatCollection.strikethrough;
|
|
19757
|
-
}
|
|
19758
|
-
if ((index === 0 && formatCollection.superscript) || !formatCollection.superscript) {
|
|
19759
|
-
nodeCollection.superscript = formatCollection.superscript;
|
|
19760
|
-
}
|
|
19761
|
-
if ((index === 0 && formatCollection.subscript) || !formatCollection.subscript) {
|
|
19762
|
-
nodeCollection.subscript = formatCollection.subscript;
|
|
19763
|
-
}
|
|
19764
|
-
if ((index === 0 && formatCollection.fontcolor) || !formatCollection.fontcolor) {
|
|
19765
|
-
nodeCollection.fontcolor = formatCollection.fontcolor;
|
|
19766
|
-
}
|
|
19767
|
-
if (index === 0 && formatCollection.fontname) {
|
|
19768
|
-
nodeCollection.fontname = formatCollection.fontname;
|
|
19769
|
-
}
|
|
19770
|
-
else {
|
|
19771
|
-
nodeCollection.fontname = formatCollection.fontname === nodeCollection.fontname ? formatCollection.fontname : 'empty';
|
|
19772
|
-
}
|
|
19773
|
-
if (index === 0 && formatCollection.fontsize) {
|
|
19774
|
-
nodeCollection.fontsize = formatCollection.fontsize;
|
|
19775
|
-
}
|
|
19776
|
-
else {
|
|
19777
|
-
nodeCollection.fontsize = formatCollection.fontsize === nodeCollection.fontsize ? formatCollection.fontsize : 'empty';
|
|
19778
|
-
}
|
|
19779
|
-
if ((index === 0 && formatCollection.backgroundcolor) || !formatCollection.backgroundcolor) {
|
|
19780
|
-
nodeCollection.backgroundcolor = formatCollection.backgroundcolor;
|
|
19781
|
-
}
|
|
19782
|
-
if ((index === 0 && formatCollection.orderedlist) || !formatCollection.orderedlist) {
|
|
19783
|
-
nodeCollection.orderedlist = formatCollection.orderedlist;
|
|
19784
|
-
}
|
|
19785
|
-
if ((index === 0 && formatCollection.unorderedlist) || !formatCollection.unorderedlist) {
|
|
19786
|
-
nodeCollection.unorderedlist = formatCollection.unorderedlist;
|
|
19787
|
-
}
|
|
19788
|
-
if ((index === 0 && formatCollection.alignments) || !formatCollection.alignments) {
|
|
19789
|
-
nodeCollection.alignments = formatCollection.alignments;
|
|
19790
|
-
}
|
|
19791
|
-
if (index === 0 && formatCollection.formats) {
|
|
19792
|
-
nodeCollection.formats = formatCollection.formats;
|
|
19793
|
-
}
|
|
19794
|
-
else {
|
|
19795
|
-
nodeCollection.formats = formatCollection.formats === nodeCollection.formats ? formatCollection.formats : 'empty';
|
|
19796
|
-
}
|
|
19797
|
-
if ((index === 0 && formatCollection.createlink) || !formatCollection.createlink) {
|
|
19798
|
-
nodeCollection.createlink = formatCollection.createlink;
|
|
19799
|
-
}
|
|
19800
|
-
if ((index === 0 && formatCollection.numberFormatList) || !formatCollection.numberFormatList) {
|
|
19801
|
-
nodeCollection.numberFormatList = formatCollection.numberFormatList;
|
|
19802
|
-
}
|
|
19803
|
-
if ((index === 0 && formatCollection.bulletFormatList) || !formatCollection.bulletFormatList) {
|
|
19804
|
-
nodeCollection.bulletFormatList = formatCollection.bulletFormatList;
|
|
19805
|
-
}
|
|
19806
|
-
formatCollection = JSON.parse(JSON.stringify(statusCollection));
|
|
19807
|
-
}
|
|
19808
|
-
return nodeCollection;
|
|
19809
|
-
};
|
|
19810
|
-
ToolbarStatus.getImmediateBlockNode = function (node) {
|
|
19811
|
-
do {
|
|
19812
|
-
node = node.parentNode;
|
|
19813
|
-
} while (node && BLOCK_TAGS.indexOf(node.nodeName.toLocaleLowerCase()) < 0);
|
|
19814
|
-
return node;
|
|
19815
|
-
};
|
|
19816
|
-
ToolbarStatus.getFormatParent = function (docElement, formatCollection, node, targetNode, formatNode, fontSize, fontName) {
|
|
19817
|
-
var isListUpdated = false;
|
|
19818
|
-
var isComplexListUpdated = false;
|
|
19819
|
-
if (targetNode.contains(node) ||
|
|
19820
|
-
(node.nodeType === 3 && targetNode.nodeType !== 3 && targetNode.contains(node.parentNode))) {
|
|
19821
|
-
do {
|
|
19822
|
-
formatCollection = this.isFormattedNode(docElement, formatCollection, node, isListUpdated, isComplexListUpdated, formatNode, fontSize, fontName);
|
|
19823
|
-
if (formatCollection.orderedlist || formatCollection.unorderedlist) {
|
|
19824
|
-
isListUpdated = true;
|
|
19825
|
-
}
|
|
19826
|
-
if (formatCollection.bulletFormatList || formatCollection.numberFormatList) {
|
|
19827
|
-
isComplexListUpdated = true;
|
|
19828
|
-
}
|
|
19829
|
-
node = node.parentNode;
|
|
19830
|
-
} while (node && (node !== targetNode));
|
|
19831
|
-
}
|
|
19832
|
-
return formatCollection;
|
|
19833
|
-
};
|
|
19834
|
-
ToolbarStatus.isFormattedNode = function (docElement, formatCollection, node, isListUpdated, isComplexListUpdated, formatNode, fontSize, fontName) {
|
|
19835
|
-
if (!formatCollection.bold) {
|
|
19836
|
-
formatCollection.bold = IsFormatted.isBold(node);
|
|
19837
|
-
}
|
|
19838
|
-
if (!formatCollection.italic) {
|
|
19839
|
-
formatCollection.italic = IsFormatted.isItalic(node);
|
|
19840
|
-
}
|
|
19841
|
-
if (!formatCollection.underline) {
|
|
19842
|
-
formatCollection.underline = IsFormatted.isUnderline(node);
|
|
19843
|
-
}
|
|
19844
|
-
if (!formatCollection.strikethrough) {
|
|
19845
|
-
formatCollection.strikethrough = IsFormatted.isStrikethrough(node);
|
|
19846
|
-
}
|
|
19847
|
-
if (!formatCollection.superscript) {
|
|
19848
|
-
formatCollection.superscript = IsFormatted.isSuperscript(node);
|
|
19849
|
-
}
|
|
19850
|
-
if (!formatCollection.subscript) {
|
|
19851
|
-
formatCollection.subscript = IsFormatted.isSubscript(node);
|
|
19852
|
-
}
|
|
19853
|
-
if (!formatCollection.fontcolor) {
|
|
19854
|
-
formatCollection.fontcolor = this.isFontColor(docElement, node);
|
|
19855
|
-
}
|
|
19856
|
-
if (!formatCollection.fontname) {
|
|
19857
|
-
formatCollection.fontname = this.isFontName(docElement, node, fontName);
|
|
19858
|
-
}
|
|
19859
|
-
if (!formatCollection.fontsize) {
|
|
19860
|
-
formatCollection.fontsize = this.isFontSize(docElement, node, fontSize);
|
|
19861
|
-
}
|
|
19862
|
-
if (!formatCollection.backgroundcolor) {
|
|
19863
|
-
formatCollection.backgroundcolor = this.isBackgroundColor(node);
|
|
19864
|
-
}
|
|
19865
|
-
if (!formatCollection.orderedlist && !isListUpdated) {
|
|
19866
|
-
formatCollection.orderedlist = this.isOrderedList(node);
|
|
19867
|
-
}
|
|
19868
|
-
if (!formatCollection.unorderedlist && !isListUpdated) {
|
|
19869
|
-
formatCollection.unorderedlist = this.isUnorderedList(node);
|
|
19870
|
-
}
|
|
19871
|
-
if (!formatCollection.alignments) {
|
|
19872
|
-
formatCollection.alignments = this.isAlignment(node);
|
|
19873
|
-
}
|
|
19874
|
-
if (!formatCollection.formats) {
|
|
19875
|
-
formatCollection.formats = this.isFormats(node, formatNode);
|
|
19876
|
-
if (formatCollection.formats === 'pre') {
|
|
19877
|
-
formatCollection.insertcode = true;
|
|
19878
|
-
}
|
|
19879
|
-
}
|
|
19880
|
-
if (!formatCollection.createlink) {
|
|
19881
|
-
formatCollection.createlink = this.isLink(node);
|
|
19882
|
-
}
|
|
19883
|
-
if (!formatCollection.numberFormatList && !isComplexListUpdated) {
|
|
19884
|
-
formatCollection.numberFormatList = this.isNumberFormatList(node);
|
|
19885
|
-
}
|
|
19886
|
-
if (!formatCollection.bulletFormatList && !isComplexListUpdated) {
|
|
19887
|
-
formatCollection.bulletFormatList = this.isBulletFormatList(node);
|
|
19888
|
-
}
|
|
19889
|
-
return formatCollection;
|
|
19890
|
-
};
|
|
19891
|
-
ToolbarStatus.isFontColor = function (docElement, node) {
|
|
19892
|
-
var color = node.style && node.style.color;
|
|
19893
|
-
if ((color === null || color === undefined || color === '') && node.nodeType !== 3) {
|
|
19894
|
-
color = this.getComputedStyle(docElement, node, 'color');
|
|
19895
|
-
}
|
|
19896
|
-
if (color !== null && color !== '' && color !== undefined) {
|
|
19897
|
-
return color;
|
|
19898
|
-
}
|
|
19899
|
-
else {
|
|
19900
|
-
return null;
|
|
19901
|
-
}
|
|
19902
|
-
};
|
|
19903
|
-
ToolbarStatus.isLink = function (node) {
|
|
19904
|
-
if (node.nodeName.toLocaleLowerCase() === 'a') {
|
|
19905
|
-
return true;
|
|
19906
|
-
}
|
|
19907
|
-
else {
|
|
19908
|
-
return false;
|
|
19909
|
-
}
|
|
19910
|
-
};
|
|
19911
|
-
ToolbarStatus.isBackgroundColor = function (node) {
|
|
19912
|
-
var backColor = node.style && node.style.backgroundColor;
|
|
19913
|
-
if (backColor !== null && backColor !== '' && backColor !== undefined) {
|
|
19914
|
-
return backColor;
|
|
19915
|
-
}
|
|
19916
|
-
else {
|
|
19917
|
-
return null;
|
|
19918
|
-
}
|
|
19919
|
-
};
|
|
19920
|
-
ToolbarStatus.isFontSize = function (docElement, node, fontSize) {
|
|
19921
|
-
var size = node.style && node.style.fontSize;
|
|
19922
|
-
if ((size === null || size === undefined || size === '') && node.nodeType !== 3 &&
|
|
19923
|
-
node.parentElement.classList.contains('e-content')) {
|
|
19924
|
-
size = this.getComputedStyle(docElement, node, 'font-size');
|
|
19925
|
-
}
|
|
19926
|
-
if ((size !== null && size !== '' && size !== undefined)
|
|
19927
|
-
&& (fontSize === null || fontSize === undefined || (fontSize.indexOf(size) > -1))) {
|
|
19928
|
-
return size;
|
|
19929
|
-
}
|
|
19930
|
-
else {
|
|
19931
|
-
return null;
|
|
19932
|
-
}
|
|
19933
|
-
};
|
|
19934
|
-
ToolbarStatus.isFontName = function (docElement, node, fontName) {
|
|
19935
|
-
var name = node.style && node.style.fontFamily;
|
|
19936
|
-
if ((name === null || name === undefined || name === '') && node.nodeType !== 3) {
|
|
19937
|
-
name = this.getComputedStyle(docElement, node, 'font-family');
|
|
19938
|
-
}
|
|
19939
|
-
var index = null;
|
|
19940
|
-
if ((name !== null && name !== '' && name !== undefined)
|
|
19941
|
-
&& (fontName === null || fontName === undefined || (fontName.filter(function (value, pos) {
|
|
19942
|
-
// eslint-disable-next-line
|
|
19943
|
-
var pattern = new RegExp(name, 'i');
|
|
19944
|
-
if ((value.replace(/"/g, '').replace(/ /g, '').toLowerCase() === name.replace(/"/g, '').replace(/ /g, '').toLowerCase()) ||
|
|
19945
|
-
(value.split(',')[0] && !isNullOrUndefined(value.split(',')[0].trim().match(pattern)) &&
|
|
19946
|
-
value.split(',')[0].trim() === value.split(',')[0].trim().match(pattern)[0])) {
|
|
19947
|
-
index = pos;
|
|
19948
|
-
}
|
|
19949
|
-
}) && (index !== null)))) {
|
|
19950
|
-
// eslint-disable-next-line
|
|
19951
|
-
return (index !== null) ? fontName[index] : name.replace(/"/g, '');
|
|
19952
|
-
}
|
|
19953
|
-
else {
|
|
19954
|
-
return null;
|
|
19955
|
-
}
|
|
19956
|
-
};
|
|
19957
|
-
ToolbarStatus.isOrderedList = function (node) {
|
|
19958
|
-
if (node.nodeName.toLocaleLowerCase() === 'ol') {
|
|
19959
|
-
return true;
|
|
19960
|
-
}
|
|
19961
|
-
else {
|
|
19962
|
-
return false;
|
|
19963
|
-
}
|
|
19964
|
-
};
|
|
19965
|
-
ToolbarStatus.isUnorderedList = function (node) {
|
|
19966
|
-
if (node.nodeName.toLocaleLowerCase() === 'ul') {
|
|
19967
|
-
return true;
|
|
19968
|
-
}
|
|
19969
|
-
else {
|
|
19970
|
-
return false;
|
|
19971
|
-
}
|
|
19972
|
-
};
|
|
19973
|
-
ToolbarStatus.isAlignment = function (node) {
|
|
19974
|
-
var align = node.style && node.style.textAlign;
|
|
19975
|
-
if (align === 'left') {
|
|
19976
|
-
return 'justifyleft';
|
|
19977
|
-
}
|
|
19978
|
-
else if (align === 'center') {
|
|
19979
|
-
return 'justifycenter';
|
|
19980
|
-
}
|
|
19981
|
-
else if (align === 'right') {
|
|
19982
|
-
return 'justifyright';
|
|
19983
|
-
}
|
|
19984
|
-
else if (align === 'justify') {
|
|
19985
|
-
return 'justifyfull';
|
|
19986
|
-
}
|
|
19987
|
-
else {
|
|
19988
|
-
return null;
|
|
19989
|
-
}
|
|
19990
|
-
};
|
|
19991
|
-
ToolbarStatus.isFormats = function (node, formatNode) {
|
|
19992
|
-
if (((formatNode === undefined || formatNode === null)
|
|
19993
|
-
&& BLOCK_TAGS.indexOf(node.nodeName.toLocaleLowerCase()) > -1)
|
|
19994
|
-
|| (formatNode !== null && formatNode !== undefined
|
|
19995
|
-
&& formatNode.indexOf(node.nodeName.toLocaleLowerCase()) > -1)) {
|
|
19996
|
-
return node.nodeName.toLocaleLowerCase();
|
|
19997
|
-
}
|
|
19998
|
-
else {
|
|
19999
|
-
return null;
|
|
20000
|
-
}
|
|
20001
|
-
};
|
|
20002
|
-
ToolbarStatus.getComputedStyle = function (docElement, node, prop) {
|
|
20003
|
-
return docElement.defaultView.getComputedStyle(node, null).getPropertyValue(prop);
|
|
20004
|
-
};
|
|
20005
|
-
ToolbarStatus.isNumberFormatList = function (node) {
|
|
20006
|
-
var list = node.style && node.style.listStyleType;
|
|
20007
|
-
if (list === 'lower-alpha') {
|
|
20008
|
-
return 'Lower Alpha';
|
|
20009
|
-
}
|
|
20010
|
-
else if (list === 'number') {
|
|
20011
|
-
return 'Number';
|
|
20012
|
-
}
|
|
20013
|
-
else if (list === 'upper-alpha') {
|
|
20014
|
-
return 'Upper Alpha';
|
|
20015
|
-
}
|
|
20016
|
-
else if (list === 'lower-roman') {
|
|
20017
|
-
return 'Lower Roman';
|
|
20018
|
-
}
|
|
20019
|
-
else if (list === 'upper-roman') {
|
|
20020
|
-
return 'Upper Roman';
|
|
20021
|
-
}
|
|
20022
|
-
else if (list === 'lower-greek') {
|
|
20023
|
-
return 'Lower Greek';
|
|
20024
|
-
}
|
|
20025
|
-
else if (list === 'none') {
|
|
20026
|
-
return 'None';
|
|
20027
|
-
}
|
|
20028
|
-
else if (this.isOrderedList(node)) {
|
|
20029
|
-
return true;
|
|
20030
|
-
}
|
|
20031
|
-
else {
|
|
20032
|
-
return null;
|
|
20033
|
-
}
|
|
20034
|
-
};
|
|
20035
|
-
ToolbarStatus.isBulletFormatList = function (node) {
|
|
20036
|
-
var list = node.style && node.style.listStyleType;
|
|
20037
|
-
if (list === 'circle') {
|
|
20038
|
-
return 'Circle';
|
|
20039
|
-
}
|
|
20040
|
-
else if (list === 'square') {
|
|
20041
|
-
return 'Square';
|
|
20042
|
-
}
|
|
20043
|
-
else if (list === 'none') {
|
|
20044
|
-
return 'None';
|
|
20045
|
-
}
|
|
20046
|
-
else if (list === 'disc') {
|
|
20047
|
-
return 'Disc';
|
|
20048
|
-
}
|
|
20049
|
-
else if (this.isUnorderedList(node)) {
|
|
20050
|
-
return true;
|
|
20051
|
-
}
|
|
20052
|
-
else {
|
|
20053
|
-
return null;
|
|
20054
|
-
}
|
|
20055
|
-
};
|
|
20056
|
-
return ToolbarStatus;
|
|
20057
|
-
}());
|
|
20058
|
-
|
|
20059
20182
|
var EmojiPickerAction = /** @__PURE__ @class */ (function () {
|
|
20060
20183
|
function EmojiPickerAction(parent) {
|
|
20061
20184
|
this.parent = parent;
|
|
@@ -21901,12 +22024,17 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
21901
22024
|
}
|
|
21902
22025
|
var lastNode = this.oldRangeElement.lastChild ? this.oldRangeElement.lastChild : this.oldRangeElement;
|
|
21903
22026
|
while (lastNode.nodeType !== 3 && lastNode.nodeName !== '#text' &&
|
|
21904
|
-
lastNode.nodeName !== 'BR') {
|
|
22027
|
+
lastNode.nodeName !== 'BR' && !isNullOrUndefined(lastNode.lastChild)) {
|
|
21905
22028
|
lastNode = lastNode.lastChild;
|
|
21906
22029
|
}
|
|
21907
|
-
|
|
21908
|
-
|
|
21909
|
-
|
|
22030
|
+
if (lastNode.nodeName === 'IMG') {
|
|
22031
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), lastNode.parentElement, lastNode.parentElement.childNodes.length);
|
|
22032
|
+
}
|
|
22033
|
+
else {
|
|
22034
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(),
|
|
22035
|
+
// eslint-disable-next-line
|
|
22036
|
+
lastNode, lastNode.textContent.length);
|
|
22037
|
+
}
|
|
21910
22038
|
if (this.oldRangeElement.nodeName !== '#text' && this.oldRangeElement.querySelectorAll('BR').length === 1) {
|
|
21911
22039
|
detach(this.oldRangeElement.querySelector('BR'));
|
|
21912
22040
|
}
|
|
@@ -24236,6 +24364,9 @@ var FormatPainter = /** @__PURE__ @class */ (function () {
|
|
|
24236
24364
|
if ((originalEvent.action === 'format-copy' || originalEvent.action === 'format-paste')) {
|
|
24237
24365
|
originalEvent.stopPropagation();
|
|
24238
24366
|
}
|
|
24367
|
+
if (Browser.userAgent.indexOf('Firefox') !== -1) {
|
|
24368
|
+
originalEvent.preventDefault();
|
|
24369
|
+
}
|
|
24239
24370
|
this.actionHandler(event, 'keyBoard');
|
|
24240
24371
|
}
|
|
24241
24372
|
};
|
|
@@ -24982,7 +25113,7 @@ var EmojiPicker = /** @__PURE__ @class */ (function () {
|
|
|
24982
25113
|
}
|
|
24983
25114
|
}
|
|
24984
25115
|
}
|
|
24985
|
-
if (noEMoji && !this.parent.element.querySelector('.e-rte-emojiSearch-noEmoji') && (inputValue !== '' && value !== ':')) {
|
|
25116
|
+
if (noEMoji && !this.parent.element.querySelector('.e-rte-emojiSearch-noEmoji') && (inputValue !== '' && value !== ':' && value !== ': :')) {
|
|
24986
25117
|
noEmojiObj.innerHTML = '<span style="color: rgba(0, 0, 0, 0.75); font-weight: 500; font-size: 16px;">' + this.i10n.getConstant('emojiPickerNoResultFound') + ' 😥 </span>' + '<br>' + '<span style="color: rgba(0, 0, 0, 0.75);"> ' + this.i10n.getConstant('emojiPickerTrySomethingElse') + ' ? </span>';
|
|
24987
25118
|
noEmojiObj.style.margin = '55px';
|
|
24988
25119
|
emojipickerAll.appendChild(noEmojiObj);
|
|
@@ -27220,7 +27351,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
27220
27351
|
_this.uploadObj.remove();
|
|
27221
27352
|
}
|
|
27222
27353
|
_this.parent.isBlur = false;
|
|
27223
|
-
if (event && event.event.returnValue) {
|
|
27354
|
+
if (event && !isNullOrUndefined(event.event) && event.event.returnValue) {
|
|
27224
27355
|
if (_this.parent.editorMode === 'HTML') {
|
|
27225
27356
|
selection.restore();
|
|
27226
27357
|
}
|
|
@@ -27339,6 +27470,9 @@ var Image$1 = /** @__PURE__ @class */ (function () {
|
|
|
27339
27470
|
removeClass([items[i]], 'e-resize');
|
|
27340
27471
|
}
|
|
27341
27472
|
}
|
|
27473
|
+
if (this.parent.inlineMode.enable && target && this.dialogObj && !closest(target, '#' + this.dialogObj.element.id)) {
|
|
27474
|
+
this.dialogObj.hide();
|
|
27475
|
+
}
|
|
27342
27476
|
};
|
|
27343
27477
|
Image.prototype.removeResizeEle = function () {
|
|
27344
27478
|
EventHandler.remove(this.contentModule.getDocument(), Browser.touchMoveEvent, this.resizing);
|
|
@@ -28188,6 +28322,7 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
28188
28322
|
this.parent.on(editAreaClick, this.editAreaClickHandler, this);
|
|
28189
28323
|
this.parent.on(insertCompleted, this.showAudioQuickToolbar, this);
|
|
28190
28324
|
this.parent.on(destroy, this.removeEventListener, this);
|
|
28325
|
+
this.parent.on(iframeMouseDown, this.closeDialog, this);
|
|
28191
28326
|
};
|
|
28192
28327
|
Audio.prototype.removeEventListener = function () {
|
|
28193
28328
|
if (this.parent.isDestroyed) {
|
|
@@ -28206,6 +28341,7 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
28206
28341
|
this.parent.off(editAreaClick, this.editAreaClickHandler);
|
|
28207
28342
|
this.parent.off(insertCompleted, this.showAudioQuickToolbar);
|
|
28208
28343
|
this.parent.off(destroy, this.removeEventListener);
|
|
28344
|
+
this.parent.off(iframeMouseDown, this.closeDialog);
|
|
28209
28345
|
if (!isNullOrUndefined(this.contentModule)) {
|
|
28210
28346
|
EventHandler.remove(this.parent.contentModule.getEditPanel(), Browser.touchStartEvent, this.touchStart);
|
|
28211
28347
|
EventHandler.remove(this.contentModule.getEditPanel(), Browser.touchEndEvent, this.audioClick);
|
|
@@ -28454,7 +28590,7 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
28454
28590
|
this.parent.formatter.saveData();
|
|
28455
28591
|
}
|
|
28456
28592
|
e.selection.restore();
|
|
28457
|
-
this.parent.formatter.process(this.parent, e.args, e.args, {
|
|
28593
|
+
this.parent.formatter.process(this.parent, e.args, e.args.originalEvent, {
|
|
28458
28594
|
selectNode: e.selectNode,
|
|
28459
28595
|
subCommand: e.args.item.subCommand
|
|
28460
28596
|
});
|
|
@@ -28550,6 +28686,9 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
28550
28686
|
this.prevSelectedAudEle.style.outline = '';
|
|
28551
28687
|
}
|
|
28552
28688
|
}
|
|
28689
|
+
if (this.parent.inlineMode.enable && target && this.dialogObj && !closest(target, '#' + this.dialogObj.element.id)) {
|
|
28690
|
+
this.dialogObj.hide();
|
|
28691
|
+
}
|
|
28553
28692
|
};
|
|
28554
28693
|
Audio.prototype.alignmentSelect = function (e) {
|
|
28555
28694
|
var item = e.item;
|
|
@@ -28582,7 +28721,7 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
28582
28721
|
}
|
|
28583
28722
|
var subCommand = (e.args.item) ?
|
|
28584
28723
|
e.args.item.subCommand : 'Break';
|
|
28585
|
-
this.parent.formatter.process(this.parent, e.args, e.args, { selectNode: e.selectNode, subCommand: subCommand });
|
|
28724
|
+
this.parent.formatter.process(this.parent, e.args, e.args.originalEvent, { selectNode: e.selectNode, subCommand: subCommand });
|
|
28586
28725
|
};
|
|
28587
28726
|
Audio.prototype.inline = function (e) {
|
|
28588
28727
|
if (e.selectNode[0].nodeName !== 'AUDIO') {
|
|
@@ -28590,7 +28729,7 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
28590
28729
|
}
|
|
28591
28730
|
var subCommand = (e.args.item) ?
|
|
28592
28731
|
e.args.item.subCommand : 'Inline';
|
|
28593
|
-
this.parent.formatter.process(this.parent, e.args, e.args, { selectNode: e.selectNode, subCommand: subCommand });
|
|
28732
|
+
this.parent.formatter.process(this.parent, e.args, e.args.originalEvent, { selectNode: e.selectNode, subCommand: subCommand });
|
|
28594
28733
|
};
|
|
28595
28734
|
Audio.prototype.editAreaClickHandler = function (e) {
|
|
28596
28735
|
if (this.parent.readonly) {
|
|
@@ -28730,7 +28869,7 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
28730
28869
|
_this.uploadObj.removing();
|
|
28731
28870
|
}
|
|
28732
28871
|
_this.parent.isBlur = false;
|
|
28733
|
-
if (event && event.event.returnValue) {
|
|
28872
|
+
if (event && !isNullOrUndefined(event.event) && event.event.returnValue) {
|
|
28734
28873
|
if (_this.parent.editorMode === 'HTML') {
|
|
28735
28874
|
selection.restore();
|
|
28736
28875
|
}
|
|
@@ -29823,7 +29962,7 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
29823
29962
|
this.parent.formatter.saveData();
|
|
29824
29963
|
}
|
|
29825
29964
|
e.selection.restore();
|
|
29826
|
-
this.parent.formatter.process(this.parent, e.args, e.args, {
|
|
29965
|
+
this.parent.formatter.process(this.parent, e.args, e.args.originalEvent, {
|
|
29827
29966
|
selectNode: e.selectNode,
|
|
29828
29967
|
subCommand: e.args.item.subCommand
|
|
29829
29968
|
});
|
|
@@ -29913,6 +30052,9 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
29913
30052
|
this.prevSelectedVidEle.style.outline = '';
|
|
29914
30053
|
}
|
|
29915
30054
|
}
|
|
30055
|
+
if (this.parent.inlineMode.enable && target && this.dialogObj && !closest(target, '#' + this.dialogObj.element.id)) {
|
|
30056
|
+
this.dialogObj.hide();
|
|
30057
|
+
}
|
|
29916
30058
|
};
|
|
29917
30059
|
Video.prototype.removeResizeEle = function () {
|
|
29918
30060
|
EventHandler.remove(this.contentModule.getDocument(), Browser.touchMoveEvent, this.resizing);
|
|
@@ -29930,7 +30072,7 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
29930
30072
|
}
|
|
29931
30073
|
var subCommand = (e.args.item) ?
|
|
29932
30074
|
e.args.item.subCommand : 'Break';
|
|
29933
|
-
this.parent.formatter.process(this.parent, e.args, e.args, { selectNode: e.selectNode, subCommand: subCommand });
|
|
30075
|
+
this.parent.formatter.process(this.parent, e.args, e.args.originalEvent, { selectNode: e.selectNode, subCommand: subCommand });
|
|
29934
30076
|
};
|
|
29935
30077
|
Video.prototype.inline = function (e) {
|
|
29936
30078
|
if (e.selectNode[0].nodeName !== 'VIDEO' && !this.isEmbedVidElem(e.selectNode[0])) {
|
|
@@ -29938,12 +30080,12 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
29938
30080
|
}
|
|
29939
30081
|
var subCommand = (e.args.item) ?
|
|
29940
30082
|
e.args.item.subCommand : 'Inline';
|
|
29941
|
-
this.parent.formatter.process(this.parent, e.args, e.args, { selectNode: e.selectNode, subCommand: subCommand });
|
|
30083
|
+
this.parent.formatter.process(this.parent, e.args, e.args.originalEvent, { selectNode: e.selectNode, subCommand: subCommand });
|
|
29942
30084
|
};
|
|
29943
30085
|
Video.prototype.alignVideo = function (e, type) {
|
|
29944
30086
|
var subCommand = (e.args.item) ?
|
|
29945
30087
|
e.args.item.subCommand : type;
|
|
29946
|
-
this.parent.formatter.process(this.parent, e.args, e.args, { selectNode: e.selectNode, subCommand: subCommand });
|
|
30088
|
+
this.parent.formatter.process(this.parent, e.args, e.args.originalEvent, { selectNode: e.selectNode, subCommand: subCommand });
|
|
29947
30089
|
};
|
|
29948
30090
|
Video.prototype.editAreaClickHandler = function (e) {
|
|
29949
30091
|
if (this.parent.readonly) {
|
|
@@ -30087,7 +30229,7 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
30087
30229
|
_this.uploadObj.removing();
|
|
30088
30230
|
}
|
|
30089
30231
|
_this.parent.isBlur = false;
|
|
30090
|
-
if (event && event.event.returnValue) {
|
|
30232
|
+
if (event && !isNullOrUndefined(event.event) && event.event.returnValue) {
|
|
30091
30233
|
if (_this.parent.editorMode === 'HTML') {
|
|
30092
30234
|
selection.restore();
|
|
30093
30235
|
}
|
|
@@ -30179,21 +30321,26 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
30179
30321
|
}
|
|
30180
30322
|
}
|
|
30181
30323
|
});
|
|
30182
|
-
if (e.selectNode &&
|
|
30183
|
-
e.selectNode[0].nodeName
|
|
30184
|
-
|
|
30185
|
-
e.selectNode[0].
|
|
30186
|
-
|
|
30187
|
-
|
|
30188
|
-
|
|
30189
|
-
|
|
30324
|
+
if (e.selectNode && e.selectNode[0] && (e.selectNode[0].nodeName === 'VIDEO' || this.isEmbedVidElem(e.selectNode[0]))) {
|
|
30325
|
+
if (e.selectNode[0].nodeName === 'VIDEO') {
|
|
30326
|
+
var regex = new RegExp(/([^\S]|^)(((https?\:\/\/)|(www\.))(\S+))/gi);
|
|
30327
|
+
var sourceElement = e.selectNode[0].querySelector('source');
|
|
30328
|
+
this.inputUrl.value = sourceElement && sourceElement.src && sourceElement.src.match(regex) ? sourceElement.src : '';
|
|
30329
|
+
}
|
|
30330
|
+
else {
|
|
30331
|
+
this.embedInputUrl.value = e.selectNode[0].nodeName === 'IFRAME' ? e.selectNode[0].outerHTML
|
|
30332
|
+
: e.selectNode[0].querySelector('iframe').outerHTML;
|
|
30333
|
+
}
|
|
30190
30334
|
}
|
|
30335
|
+
var isWebUrl = this.inputUrl.value ? true : false;
|
|
30191
30336
|
var embedUrlBtn = new RadioButton({
|
|
30192
30337
|
label: this.i10n.getConstant('embeddedCode'),
|
|
30193
|
-
checked:
|
|
30338
|
+
checked: !isWebUrl,
|
|
30194
30339
|
name: 'URL',
|
|
30195
30340
|
created: function () {
|
|
30196
|
-
|
|
30341
|
+
if (!isWebUrl) {
|
|
30342
|
+
urlContent.appendChild(_this.embedInputUrl);
|
|
30343
|
+
}
|
|
30197
30344
|
},
|
|
30198
30345
|
change: function () {
|
|
30199
30346
|
urlContent.innerHTML = '';
|
|
@@ -30203,7 +30350,13 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
30203
30350
|
embedUrlBtn.appendTo(videoUrl.querySelector('#embedURL'));
|
|
30204
30351
|
var webUrlBtn = new RadioButton({
|
|
30205
30352
|
label: this.i10n.getConstant('webUrl'),
|
|
30353
|
+
checked: isWebUrl,
|
|
30206
30354
|
name: 'URL',
|
|
30355
|
+
created: function () {
|
|
30356
|
+
if (isWebUrl) {
|
|
30357
|
+
urlContent.appendChild(_this.inputUrl);
|
|
30358
|
+
}
|
|
30359
|
+
},
|
|
30207
30360
|
change: function () {
|
|
30208
30361
|
urlContent.innerHTML = '';
|
|
30209
30362
|
urlContent.appendChild(_this.inputUrl);
|
|
@@ -31363,13 +31516,14 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
31363
31516
|
}
|
|
31364
31517
|
var target = e.target || e.targetTouches[0].target;
|
|
31365
31518
|
var closestTable = closest(target, 'table.e-rte-table, table.e-rte-paste-table');
|
|
31366
|
-
|
|
31519
|
+
var isResizing = this.parent.contentModule.getEditPanel().querySelectorAll('.e-table-box.e-rbox-select, .e-table-rhelper.e-column-helper, .e-table-rhelper.e-row-helper').length > 0;
|
|
31520
|
+
if (!isResizing && !isNullOrUndefined(this.curTable) && !isNullOrUndefined(closestTable) && closestTable !== this.curTable &&
|
|
31367
31521
|
this.parent.contentModule.getEditPanel().contains(closestTable)) {
|
|
31368
31522
|
this.removeResizeElement();
|
|
31369
31523
|
this.removeHelper(e);
|
|
31370
31524
|
this.cancelResizeAction();
|
|
31371
31525
|
}
|
|
31372
|
-
if (target.nodeName === 'TABLE' || target.nodeName === 'TD' || target.nodeName === 'TH') {
|
|
31526
|
+
if (!isResizing && (target.nodeName === 'TABLE' || target.nodeName === 'TD' || target.nodeName === 'TH')) {
|
|
31373
31527
|
this.curTable = (closestTable && this.parent.contentModule.getEditPanel().contains(closestTable))
|
|
31374
31528
|
&& (target.nodeName === 'TD' || target.nodeName === 'TH') ?
|
|
31375
31529
|
closestTable : target;
|
|
@@ -31515,7 +31669,6 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
31515
31669
|
e.preventDefault();
|
|
31516
31670
|
this.parent.preventDefaultResize(e);
|
|
31517
31671
|
removeClass(this.curTable.querySelectorAll('td,th'), CLS_TABLE_SEL);
|
|
31518
|
-
this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument());
|
|
31519
31672
|
this.pageX = this.getPointX(e);
|
|
31520
31673
|
this.pageY = this.getPointY(e);
|
|
31521
31674
|
this.resizeBtnInit();
|
|
@@ -31775,7 +31928,8 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
31775
31928
|
var width = parseFloat(_this.curTable.style.width);
|
|
31776
31929
|
currentMarginLeft = 100 - width;
|
|
31777
31930
|
}
|
|
31778
|
-
|
|
31931
|
+
// For table pasted from word, Margin left can be anything so we are avoiding the below process.
|
|
31932
|
+
if (!_this.curTable.classList.contains('e-rte-paste-table') && currentMarginLeft && currentMarginLeft < 1) {
|
|
31779
31933
|
_this.curTable.style.marginLeft = null;
|
|
31780
31934
|
_this.curTable.style.width = '100%';
|
|
31781
31935
|
return;
|
|
@@ -31941,7 +32095,13 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
31941
32095
|
tableTrPercentage[i] = percentage;
|
|
31942
32096
|
}
|
|
31943
32097
|
for (var i = 0; i < currentTableTrElement.length; i++) {
|
|
31944
|
-
currentTableTrElement[i].
|
|
32098
|
+
if (currentTableTrElement[i].parentElement.nodeName === 'THEAD') {
|
|
32099
|
+
currentTableTrElement[i].parentElement.style.height = tableTrPercentage[i] + '%';
|
|
32100
|
+
currentTableTrElement[i].style.height = tableTrPercentage[i] + '%';
|
|
32101
|
+
}
|
|
32102
|
+
else {
|
|
32103
|
+
currentTableTrElement[i].style.height = tableTrPercentage[i] + '%';
|
|
32104
|
+
}
|
|
31945
32105
|
}
|
|
31946
32106
|
var args = { event: e, requestType: 'table' };
|
|
31947
32107
|
this.parent.trigger(resizeStop, args);
|
|
@@ -32091,6 +32251,9 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
32091
32251
|
if (this.popupObj) {
|
|
32092
32252
|
this.popupObj.hide();
|
|
32093
32253
|
}
|
|
32254
|
+
if (this.parent.inlineMode.enable && this.editdlgObj) {
|
|
32255
|
+
this.editdlgObj.hide();
|
|
32256
|
+
}
|
|
32094
32257
|
};
|
|
32095
32258
|
Table.prototype.docClick = function (e) {
|
|
32096
32259
|
var target = e.args.target;
|
|
@@ -33383,7 +33546,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
33383
33546
|
curElement = curElement.parentElement;
|
|
33384
33547
|
blockElement = curElement;
|
|
33385
33548
|
}
|
|
33386
|
-
isTableEnter = blockElement.tagName === 'TD' || blockElement.tagName === 'TBODY' ? false : true;
|
|
33549
|
+
isTableEnter = blockElement.tagName === 'TH' || blockElement.tagName === 'TD' || blockElement.tagName === 'TBODY' ? false : true;
|
|
33387
33550
|
}
|
|
33388
33551
|
if (e.args.which === 13 && !e.args.ctrlKey && (!Browser.isDevice ? e.args.code === 'Enter' : e.args.key === 'Enter')) {
|
|
33389
33552
|
if (isNullOrUndefined(this.startNode.closest('LI, UL, OL')) && isNullOrUndefined(this.endNode.closest('LI, UL, OL')) &&
|
|
@@ -33398,6 +33561,9 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
33398
33561
|
};
|
|
33399
33562
|
this.parent.trigger(actionBegin, actionBeginArgs, function (actionBeginArgs) {
|
|
33400
33563
|
if (!actionBeginArgs.cancel) {
|
|
33564
|
+
if (_this.parent.formatter.getUndoRedoStack().length === 0) {
|
|
33565
|
+
_this.parent.formatter.saveData();
|
|
33566
|
+
}
|
|
33401
33567
|
if (!(_this.range.startOffset === _this.range.endOffset && _this.range.startContainer === _this.range.endContainer)) {
|
|
33402
33568
|
if (!(_this.range.startContainer.nodeName === 'SPAN' && (_this.range.startContainer.classList.contains('e-video-wrap') ||
|
|
33403
33569
|
_this.range.startContainer.classList.contains('e-audio-wrap')))) {
|
|
@@ -34560,8 +34726,8 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
34560
34726
|
!(e.altKey || e.shiftKey || (e.altKey && e.shiftKey && e.which == 67))) {
|
|
34561
34727
|
this.formatter.saveData();
|
|
34562
34728
|
}
|
|
34563
|
-
|
|
34564
|
-
|
|
34729
|
+
var keyboardEventAction = ['insert-link', 'format-copy', 'format-paste', 'insert-image', 'insert-table', 'insert-audio', 'insert-video'];
|
|
34730
|
+
if (keyboardEventAction.indexOf(e.action) === -1 &&
|
|
34565
34731
|
(!e.target || !(e.target.classList.contains('e-mention') && !isNullOrUndefined(document.querySelector('#' + e.target.id + '_popup.e-popup-open')) && e.code === 'Tab')) &&
|
|
34566
34732
|
(e.action && e.action !== 'paste' && e.action !== 'space'
|
|
34567
34733
|
|| e.which === 9 || (e.code === 'Backspace' && e.which === 8))) {
|
|
@@ -36217,12 +36383,9 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
36217
36383
|
* @deprecated
|
|
36218
36384
|
*/
|
|
36219
36385
|
RichTextEditor.prototype.autoResize = function () {
|
|
36220
|
-
var _this = this;
|
|
36221
36386
|
if (this.height === 'auto') {
|
|
36222
36387
|
if (this.editorMode === 'Markdown') {
|
|
36223
|
-
|
|
36224
|
-
_this.setAutoHeight(_this.inputElement);
|
|
36225
|
-
}, 0);
|
|
36388
|
+
this.setAutoHeight(this.inputElement);
|
|
36226
36389
|
}
|
|
36227
36390
|
else if (this.iframeSettings.enable) {
|
|
36228
36391
|
var iframeElement = this.element.querySelector('#' + this.getID() + '_rte-view');
|
|
@@ -36235,21 +36398,10 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
36235
36398
|
}
|
|
36236
36399
|
};
|
|
36237
36400
|
RichTextEditor.prototype.setAutoHeight = function (element) {
|
|
36238
|
-
if (!isNullOrUndefined(element)
|
|
36401
|
+
if (!isNullOrUndefined(element)) {
|
|
36239
36402
|
element.style.height = this.inputElement.scrollHeight + 'px';
|
|
36240
36403
|
element.style.overflow = 'hidden';
|
|
36241
36404
|
}
|
|
36242
|
-
else if (!isNullOrUndefined(element) && !isNullOrUndefined(element.parentElement) && this.iframeSettings.enable) {
|
|
36243
|
-
var newRange = this.getRange();
|
|
36244
|
-
element.style.height = 'auto';
|
|
36245
|
-
var newHeight = element.contentDocument.body.scrollHeight + 'px';
|
|
36246
|
-
element.style.height = newHeight;
|
|
36247
|
-
element.style.overflow = 'hidden';
|
|
36248
|
-
// 16 px added for padding doesn't affect the editor height
|
|
36249
|
-
if (newRange.startContainer.nodeName !== '#text' && newRange.startContainer.nodeName !== 'BODY' && window.innerHeight < newRange.startContainer.getBoundingClientRect().top + element.getBoundingClientRect().top + 16) {
|
|
36250
|
-
newRange.startContainer.scrollIntoView(false);
|
|
36251
|
-
}
|
|
36252
|
-
}
|
|
36253
36405
|
};
|
|
36254
36406
|
RichTextEditor.prototype.wireEvents = function () {
|
|
36255
36407
|
this.element.addEventListener('focusin', this.onFocusHandler, true);
|
|
@@ -36748,5 +36900,5 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
36748
36900
|
* Rich Text Editor component exported items
|
|
36749
36901
|
*/
|
|
36750
36902
|
|
|
36751
|
-
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,
|
|
36903
|
+
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, 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 };
|
|
36752
36904
|
//# sourceMappingURL=ej2-richtexteditor.es5.js.map
|