@syncfusion/ej2-richtexteditor 20.4.52 → 21.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -2
- 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 +1623 -639
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +1638 -646
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/dist/global/ej2-richtexteditor.min.js +2 -2
- package/dist/global/ej2-richtexteditor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +13 -13
- package/src/common/config.js +3 -1
- package/src/common/constant.d.ts +6 -0
- package/src/common/constant.js +6 -0
- package/src/common/util.d.ts +2 -1
- package/src/common/util.js +15 -6
- package/src/editor-manager/base/editor-manager.d.ts +2 -0
- package/src/editor-manager/base/editor-manager.js +6 -1
- package/src/editor-manager/base/enum.d.ts +14 -0
- package/src/editor-manager/base/interface.d.ts +34 -0
- package/src/editor-manager/plugin/clearformat.js +13 -4
- package/src/editor-manager/plugin/format-painter-actions.d.ts +63 -0
- package/src/editor-manager/plugin/format-painter-actions.js +474 -0
- package/src/editor-manager/plugin/image.js +0 -1
- package/src/editor-manager/plugin/inserthtml-exec.js +1 -1
- package/src/editor-manager/plugin/inserthtml.d.ts +1 -1
- package/src/editor-manager/plugin/inserthtml.js +18 -10
- package/src/editor-manager/plugin/isformatted.js +1 -0
- package/src/editor-manager/plugin/link.js +0 -1
- package/src/editor-manager/plugin/lists.js +1 -1
- package/src/editor-manager/plugin/ms-word-clean-up.js +57 -19
- package/src/editor-manager/plugin/selection-commands.d.ts +4 -1
- package/src/editor-manager/plugin/selection-commands.js +70 -9
- package/src/editor-manager/plugin/video.js +2 -0
- package/src/editor-manager/plugin.d.ts +1 -0
- package/src/editor-manager/plugin.js +1 -0
- package/src/global.js +1 -1
- package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +1 -0
- package/src/rich-text-editor/actions/base-quick-toolbar.js +21 -1
- package/src/rich-text-editor/actions/base-toolbar.js +33 -10
- package/src/rich-text-editor/actions/enter-key.js +23 -16
- package/src/rich-text-editor/actions/format-painter.d.ts +24 -0
- package/src/rich-text-editor/actions/format-painter.js +142 -0
- package/src/rich-text-editor/actions/full-screen.js +0 -1
- package/src/rich-text-editor/actions/html-editor.d.ts +1 -0
- package/src/rich-text-editor/actions/html-editor.js +117 -97
- package/src/rich-text-editor/actions/paste-clean-up.js +2 -2
- package/src/rich-text-editor/actions/quick-toolbar.js +8 -1
- package/src/rich-text-editor/actions/toolbar.js +10 -0
- package/src/rich-text-editor/actions.d.ts +1 -0
- package/src/rich-text-editor/actions.js +1 -0
- package/src/rich-text-editor/base/constant.d.ts +10 -0
- package/src/rich-text-editor/base/constant.js +10 -0
- package/src/rich-text-editor/base/enum.d.ts +4 -0
- package/src/rich-text-editor/base/interface.d.ts +30 -3
- package/src/rich-text-editor/base/interface.js +12 -0
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +30 -4
- package/src/rich-text-editor/base/rich-text-editor.d.ts +35 -5
- package/src/rich-text-editor/base/rich-text-editor.js +46 -10
- package/src/rich-text-editor/base/util.js +2 -0
- package/src/rich-text-editor/formatter/formatter.js +22 -13
- package/src/rich-text-editor/formatter/html-formatter.d.ts +5 -3
- package/src/rich-text-editor/formatter/html-formatter.js +7 -5
- package/src/rich-text-editor/models/default-locale.js +4 -2
- package/src/rich-text-editor/models/items.d.ts +3 -0
- package/src/rich-text-editor/models/items.js +32 -0
- package/src/rich-text-editor/models/toolbar-settings-model.d.ts +29 -1
- package/src/rich-text-editor/models/toolbar-settings.d.ts +24 -1
- package/src/rich-text-editor/models/toolbar-settings.js +20 -0
- package/src/rich-text-editor/renderer/audio-module.js +6 -3
- package/src/rich-text-editor/renderer/image-module.js +11 -6
- package/src/rich-text-editor/renderer/link-module.js +2 -1
- package/src/rich-text-editor/renderer/table-module.js +18 -6
- package/src/rich-text-editor/renderer/toolbar-renderer.js +10 -1
- package/src/rich-text-editor/renderer/video-module.js +8 -5
- package/src/rich-text-editor/renderer/view-source.js +1 -1
- package/styles/bootstrap-dark.css +31 -1
- package/styles/bootstrap.css +31 -1
- package/styles/bootstrap4.css +31 -1
- package/styles/bootstrap5-dark.css +32 -2
- package/styles/bootstrap5.css +32 -2
- package/styles/fabric-dark.css +31 -1
- package/styles/fabric.css +31 -1
- package/styles/fluent-dark.css +34 -4
- package/styles/fluent.css +34 -4
- package/styles/highcontrast-light.css +31 -1
- package/styles/highcontrast.css +31 -1
- package/styles/material-dark.css +31 -1
- package/styles/material.css +31 -1
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +25 -1
- package/styles/rich-text-editor/_bootstrap-definition.scss +25 -1
- package/styles/rich-text-editor/_bootstrap4-definition.scss +25 -1
- package/styles/rich-text-editor/_bootstrap5-definition.scss +28 -5
- package/styles/rich-text-editor/_fabric-dark-definition.scss +25 -1
- package/styles/rich-text-editor/_fabric-definition.scss +25 -1
- package/styles/rich-text-editor/_fluent-definition.scss +30 -7
- package/styles/rich-text-editor/_fusionnew-definition.scss +26 -3
- package/styles/rich-text-editor/_highcontrast-definition.scss +25 -1
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +25 -1
- package/styles/rich-text-editor/_layout.scss +47 -15
- package/styles/rich-text-editor/_material-dark-definition.scss +26 -1
- package/styles/rich-text-editor/_material-definition.scss +25 -1
- package/styles/rich-text-editor/_tailwind-definition.scss +28 -5
- package/styles/rich-text-editor/_theme.scss +54 -6
- package/styles/rich-text-editor/bootstrap-dark.css +31 -1
- package/styles/rich-text-editor/bootstrap.css +31 -1
- package/styles/rich-text-editor/bootstrap4.css +31 -1
- package/styles/rich-text-editor/bootstrap5-dark.css +32 -2
- package/styles/rich-text-editor/bootstrap5.css +32 -2
- package/styles/rich-text-editor/fabric-dark.css +31 -1
- package/styles/rich-text-editor/fabric.css +31 -1
- package/styles/rich-text-editor/fluent-dark.css +34 -4
- package/styles/rich-text-editor/fluent.css +34 -4
- package/styles/rich-text-editor/highcontrast-light.css +31 -1
- package/styles/rich-text-editor/highcontrast.css +31 -1
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +8 -0
- package/styles/rich-text-editor/icons/_bootstrap.scss +8 -0
- package/styles/rich-text-editor/icons/_bootstrap4.scss +8 -0
- package/styles/rich-text-editor/icons/_bootstrap5.scss +8 -0
- package/styles/rich-text-editor/icons/_fabric-dark.scss +8 -0
- package/styles/rich-text-editor/icons/_fabric.scss +8 -0
- package/styles/rich-text-editor/icons/_fluent.scss +8 -0
- package/styles/rich-text-editor/icons/_fusionnew.scss +8 -0
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +8 -0
- package/styles/rich-text-editor/icons/_highcontrast.scss +8 -0
- package/styles/rich-text-editor/icons/_material-dark.scss +8 -0
- package/styles/rich-text-editor/icons/_material.scss +8 -0
- package/styles/rich-text-editor/icons/_material3.scss +8 -0
- package/styles/rich-text-editor/icons/_tailwind.scss +8 -0
- package/styles/rich-text-editor/material-dark.css +31 -1
- package/styles/rich-text-editor/material.css +31 -1
- package/styles/rich-text-editor/tailwind-dark.css +31 -1
- package/styles/rich-text-editor/tailwind.css +31 -1
- package/styles/tailwind-dark.css +31 -1
- package/styles/tailwind.css +31 -1
- package/GitLeaksReport.json +0 -1
- package/gitleaks-ci/gitleaks +0 -0
- package/gitleaks-ci.tar.gz +0 -0
- package/styles/rich-text-editor/_material3-definition.scss +0 -196
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Ajax, Base, Browser, ChildProperty, Complex, Component, Event, EventHandler, KeyboardEvents, L10n, NotifyPropertyChanges, Observer, Property, SanitizeHtmlHelper, Touch, addClass, append, attributes, closest, compile, createElement, debounce, detach, extend, formatUnit, getEnumValue, getInstance, getUniqueID, isNullOrUndefined, prepend, print, removeClass, select, selectAll, setStyleAttribute } from '@syncfusion/ej2-base';
|
|
2
2
|
import { Toolbar } from '@syncfusion/ej2-navigations';
|
|
3
3
|
import { DropDownButton } from '@syncfusion/ej2-splitbuttons';
|
|
4
|
-
import { Dialog, Popup, getScrollableParent, isCollide } from '@syncfusion/ej2-popups';
|
|
4
|
+
import { Dialog, Popup, Tooltip, getScrollableParent, isCollide } from '@syncfusion/ej2-popups';
|
|
5
5
|
import { ColorPicker, NumericTextBox, TextBox, Uploader } from '@syncfusion/ej2-inputs';
|
|
6
6
|
import { Button, CheckBox, RadioButton } from '@syncfusion/ej2-buttons';
|
|
7
7
|
import { AjaxSettings, ContextMenu, ContextMenuSettings, DetailsView, DetailsViewSettings, FileManager, NavigationPane, NavigationPaneSettings, SearchSettings, Toolbar as Toolbar$1, ToolbarSettings, UploadSettings } from '@syncfusion/ej2-filemanager';
|
|
@@ -719,6 +719,16 @@ var closeTableDialog = 'closeTableDialog';
|
|
|
719
719
|
* @deprecated
|
|
720
720
|
*/
|
|
721
721
|
var bindCssClass = 'closeTableDialog';
|
|
722
|
+
/**
|
|
723
|
+
* @hidden
|
|
724
|
+
* @deprecated
|
|
725
|
+
*/
|
|
726
|
+
var formatPainterClick = 'formatPainterClick';
|
|
727
|
+
/**
|
|
728
|
+
* @hidden
|
|
729
|
+
* @deprecated
|
|
730
|
+
*/
|
|
731
|
+
var formatPainterDoubleClick = 'formatPainterDoubleClick';
|
|
722
732
|
/**
|
|
723
733
|
* @hidden
|
|
724
734
|
* @deprecated
|
|
@@ -1946,6 +1956,13 @@ var tools = {
|
|
|
1946
1956
|
'tooltip': 'Styles',
|
|
1947
1957
|
'command': 'Table',
|
|
1948
1958
|
'subCommand': 'Styles'
|
|
1959
|
+
},
|
|
1960
|
+
'formatpainter': {
|
|
1961
|
+
'id': 'FormatPainter',
|
|
1962
|
+
'icon': 'e-rte-format-painter',
|
|
1963
|
+
'tooltip': 'Format Painter',
|
|
1964
|
+
'command': 'FormatPainter',
|
|
1965
|
+
'subCommand': 'FormatPainter'
|
|
1949
1966
|
}
|
|
1950
1967
|
};
|
|
1951
1968
|
var alignmentLocale = [
|
|
@@ -2135,6 +2152,31 @@ function updateDropDownLocale(self) {
|
|
|
2135
2152
|
TableStyleItems[i].text = getLocale(self, tableStyleLocale, TableStyleItems[i]);
|
|
2136
2153
|
});
|
|
2137
2154
|
}
|
|
2155
|
+
var windowKeys = {
|
|
2156
|
+
'Insert Link': 'Ctrl + K',
|
|
2157
|
+
'Insert Image': 'Ctrl + Shift + I',
|
|
2158
|
+
'Create Table': 'Ctrl + Shift + E',
|
|
2159
|
+
'Undo': 'Ctrl + Z',
|
|
2160
|
+
'Redo': 'Ctrl + Y',
|
|
2161
|
+
'Copy': 'Ctrl + C',
|
|
2162
|
+
'Cut': 'Ctrl + X',
|
|
2163
|
+
'Paste': 'Ctrl + V',
|
|
2164
|
+
'Bold': 'Ctrl + B',
|
|
2165
|
+
'Italic': 'Ctrl + I',
|
|
2166
|
+
'Underline': 'Ctrl + U',
|
|
2167
|
+
'Strikethrough': 'Ctrl + Shift + S',
|
|
2168
|
+
'Upper Case': 'Ctrl + Shift + U',
|
|
2169
|
+
'Lower Case': 'Ctrl + Shift + L',
|
|
2170
|
+
'Superscript': 'Ctrl + Shift + =',
|
|
2171
|
+
'Subscript': 'Ctrl + =',
|
|
2172
|
+
'Source Code': 'Ctrl + Shift + H',
|
|
2173
|
+
'Maximize': 'Ctrl + Shift + F',
|
|
2174
|
+
'Minimize': 'Esc',
|
|
2175
|
+
'Clear Format': 'Ctrl + Shift + R',
|
|
2176
|
+
'Numbered List': 'Ctrl + Shift + O',
|
|
2177
|
+
'Bulleted List': 'Ctrl + Alt + O',
|
|
2178
|
+
'Format Painter': 'Ctrl + Shift + C, Ctrl + Shift + V'
|
|
2179
|
+
};
|
|
2138
2180
|
|
|
2139
2181
|
/* eslint-disable */
|
|
2140
2182
|
/**
|
|
@@ -2328,7 +2370,8 @@ var defaultLocale = {
|
|
|
2328
2370
|
'bulletFormatListCircle': 'Circle',
|
|
2329
2371
|
'bulletFormatListSquare': 'Square',
|
|
2330
2372
|
'numberFormatListNone': 'None',
|
|
2331
|
-
'bulletFormatListNone': 'None'
|
|
2373
|
+
'bulletFormatListNone': 'None',
|
|
2374
|
+
'formatPainter': 'Format Painter'
|
|
2332
2375
|
};
|
|
2333
2376
|
var toolsLocale = {
|
|
2334
2377
|
'alignments': 'alignments',
|
|
@@ -2415,7 +2458,8 @@ var toolsLocale = {
|
|
|
2415
2458
|
'alignbottom': 'AlignBottom',
|
|
2416
2459
|
'insertrowbefore': 'insertRowBefore',
|
|
2417
2460
|
'insertrowafter': 'insertRowAfter',
|
|
2418
|
-
'deleterow': 'deleteRow'
|
|
2461
|
+
'deleterow': 'deleteRow',
|
|
2462
|
+
'formatpainter': 'formatPainter'
|
|
2419
2463
|
};
|
|
2420
2464
|
var fontNameLocale = [
|
|
2421
2465
|
{ locale: 'fontNameSegoeUI', value: 'Segoe UI' },
|
|
@@ -2959,6 +3003,8 @@ function decode(value) {
|
|
|
2959
3003
|
function sanitizeHelper(value, parent) {
|
|
2960
3004
|
if (parent.enableHtmlSanitizer) {
|
|
2961
3005
|
var item = SanitizeHtmlHelper.beforeSanitize();
|
|
3006
|
+
if (item.selectors.tags[2] && item.selectors.tags[2].indexOf('iframe') > -1)
|
|
3007
|
+
item.selectors.tags[2] = 'iframe:not(.e-rte-embed-url)';
|
|
2962
3008
|
var beforeEvent = {
|
|
2963
3009
|
cancel: false,
|
|
2964
3010
|
helper: null
|
|
@@ -3139,6 +3185,14 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3139
3185
|
args.rteToolbarObj.toolbarObj.isStringTemplate = true;
|
|
3140
3186
|
args.rteToolbarObj.toolbarObj.createElement = this.parent.createElement;
|
|
3141
3187
|
args.rteToolbarObj.toolbarObj.appendTo(args.target);
|
|
3188
|
+
if (this.parent.showTooltip) {
|
|
3189
|
+
var tooltip = new Tooltip({
|
|
3190
|
+
target: '#' + this.parent.getID() + '_toolbar_wrapper [title]',
|
|
3191
|
+
showTipPointer: true,
|
|
3192
|
+
cssClass: this.parent.cssClass
|
|
3193
|
+
});
|
|
3194
|
+
tooltip.appendTo(args.target);
|
|
3195
|
+
}
|
|
3142
3196
|
};
|
|
3143
3197
|
/**
|
|
3144
3198
|
* renderDropDownButton method
|
|
@@ -3245,6 +3299,7 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3245
3299
|
dropDown.createElement = proxy.parent.createElement;
|
|
3246
3300
|
dropDown.appendTo(args.element);
|
|
3247
3301
|
args.element.tabIndex = -1;
|
|
3302
|
+
args.element.setAttribute('role', 'button');
|
|
3248
3303
|
var popupElement = document.getElementById(dropDown.element.id + '-popup');
|
|
3249
3304
|
popupElement.setAttribute('aria-owns', this.parent.getID());
|
|
3250
3305
|
if (args.element.childElementCount === 1) {
|
|
@@ -3693,13 +3748,23 @@ var BaseToolbar = /** @__PURE__ @class */ (function () {
|
|
|
3693
3748
|
case '-':
|
|
3694
3749
|
return { type: 'Separator', cssClass: CLS_HR_SEPARATOR };
|
|
3695
3750
|
default:
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3751
|
+
if (this.parent.showTooltip) {
|
|
3752
|
+
return {
|
|
3753
|
+
id: this.parent.getID() + '_' + container + '_' + this.tools[itemStr.toLocaleLowerCase()].id,
|
|
3754
|
+
prefixIcon: this.tools[itemStr.toLocaleLowerCase()].icon,
|
|
3755
|
+
tooltipText: getTooltipText(itemStr, this.locator),
|
|
3756
|
+
command: this.tools[itemStr.toLocaleLowerCase()].command,
|
|
3757
|
+
subCommand: this.tools[itemStr.toLocaleLowerCase()].subCommand
|
|
3758
|
+
};
|
|
3759
|
+
}
|
|
3760
|
+
else {
|
|
3761
|
+
return {
|
|
3762
|
+
id: this.parent.getID() + '_' + container + '_' + this.tools[itemStr.toLocaleLowerCase()].id,
|
|
3763
|
+
prefixIcon: this.tools[itemStr.toLocaleLowerCase()].icon,
|
|
3764
|
+
command: this.tools[itemStr.toLocaleLowerCase()].command,
|
|
3765
|
+
subCommand: this.tools[itemStr.toLocaleLowerCase()].subCommand
|
|
3766
|
+
};
|
|
3767
|
+
}
|
|
3703
3768
|
}
|
|
3704
3769
|
}
|
|
3705
3770
|
};
|
|
@@ -3747,6 +3812,19 @@ var BaseToolbar = /** @__PURE__ @class */ (function () {
|
|
|
3747
3812
|
var item = tbItems_1[_i];
|
|
3748
3813
|
_loop_1(item);
|
|
3749
3814
|
}
|
|
3815
|
+
for (var num = 0; num < items.length; num++) {
|
|
3816
|
+
var tooltipText = items[num].tooltipText;
|
|
3817
|
+
var shortCutKey = void 0;
|
|
3818
|
+
if (windowKeys["" + tooltipText]) {
|
|
3819
|
+
shortCutKey = Browser.isDevice && isIDevice() ? windowKeys["" + tooltipText].replace('Ctrl', 'Cmd') : windowKeys["" + tooltipText];
|
|
3820
|
+
}
|
|
3821
|
+
else {
|
|
3822
|
+
shortCutKey = tooltipText;
|
|
3823
|
+
}
|
|
3824
|
+
if (shortCutKey) {
|
|
3825
|
+
items[num].tooltipText = (tooltipText !== shortCutKey) ? tooltipText + ' (' + shortCutKey + ')' : tooltipText;
|
|
3826
|
+
}
|
|
3827
|
+
}
|
|
3750
3828
|
return items;
|
|
3751
3829
|
};
|
|
3752
3830
|
BaseToolbar.prototype.getToolbarOptions = function (args) {
|
|
@@ -4768,6 +4846,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
4768
4846
|
args.baseToolbar.toolbarObj.items[index].tooltipText = item.tooltip;
|
|
4769
4847
|
args.baseToolbar.toolbarObj.items[index].subCommand = item.subCommand;
|
|
4770
4848
|
args.baseToolbar.toolbarObj.dataBind();
|
|
4849
|
+
args.baseToolbar.toolbarObj.refreshOverflow();
|
|
4771
4850
|
}
|
|
4772
4851
|
else {
|
|
4773
4852
|
this.addTBarItem(args, 0);
|
|
@@ -4908,7 +4987,11 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
4908
4987
|
* @deprecated
|
|
4909
4988
|
*/
|
|
4910
4989
|
Toolbar$$1.prototype.refreshToolbarOverflow = function () {
|
|
4990
|
+
this.parent.element.classList.remove(CLS_RTL);
|
|
4911
4991
|
this.baseToolbar.toolbarObj.refreshOverflow();
|
|
4992
|
+
if (this.parent.enableRtl) {
|
|
4993
|
+
this.parent.element.classList.add(CLS_RTL);
|
|
4994
|
+
}
|
|
4912
4995
|
};
|
|
4913
4996
|
Toolbar$$1.prototype.isToolbarDestroyed = function () {
|
|
4914
4997
|
return this.baseToolbar.toolbarObj && !this.baseToolbar.toolbarObj.isDestroyed;
|
|
@@ -5007,6 +5090,11 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5007
5090
|
Toolbar$$1.prototype.toolbarClickHandler = function (e) {
|
|
5008
5091
|
var trg = closest(e.originalEvent.target, '.e-hor-nav');
|
|
5009
5092
|
if (trg && this.parent.toolbarSettings.type === ToolbarType.Expand && !isNullOrUndefined(trg)) {
|
|
5093
|
+
var extendedTbar = this.tbElement.querySelector('.e-toolbar-extended');
|
|
5094
|
+
if (!isNullOrUndefined(extendedTbar)) {
|
|
5095
|
+
setStyleAttribute(extendedTbar, { maxHeight: '', display: 'block' });
|
|
5096
|
+
setStyleAttribute(extendedTbar, { maxHeight: extendedTbar.offsetHeight + 'px', display: '' });
|
|
5097
|
+
}
|
|
5010
5098
|
if (!trg.classList.contains('e-nav-active')) {
|
|
5011
5099
|
removeClass([this.tbElement], [CLS_EXPAND_OPEN]);
|
|
5012
5100
|
this.parent.setContentHeight('toolbar', false);
|
|
@@ -5688,6 +5776,8 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
5688
5776
|
var x;
|
|
5689
5777
|
var y;
|
|
5690
5778
|
var imgWrapper = closest(e.target, '.e-img-caption');
|
|
5779
|
+
var isAligned = (e.target.classList.contains('e-imginline') ||
|
|
5780
|
+
e.target.classList.contains('e-imgbreak')) ? false : true;
|
|
5691
5781
|
var target = !isNullOrUndefined(imgWrapper) ? imgWrapper : e.target;
|
|
5692
5782
|
addClass([this.toolbarElement], [CLS_RM_WHITE_SPACE]);
|
|
5693
5783
|
var targetOffsetTop = target.offsetTop;
|
|
@@ -5701,6 +5791,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
5701
5791
|
else {
|
|
5702
5792
|
y = e.y;
|
|
5703
5793
|
}
|
|
5794
|
+
target = isAligned ? e.target : target;
|
|
5704
5795
|
if (target.offsetWidth > e.popWidth) {
|
|
5705
5796
|
x = (target.offsetWidth / 2) - (e.popWidth / 2) + e.parentData.left + target.offsetLeft;
|
|
5706
5797
|
}
|
|
@@ -5832,6 +5923,13 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
5832
5923
|
_this.parent.enableToolbarItem(['Undo', 'Redo']);
|
|
5833
5924
|
}
|
|
5834
5925
|
append([_this.element], document.body);
|
|
5926
|
+
if (_this.parent.showTooltip) {
|
|
5927
|
+
_this.tooltip = new Tooltip({
|
|
5928
|
+
target: '#' + _this.element.id + ' [title]',
|
|
5929
|
+
showTipPointer: true
|
|
5930
|
+
});
|
|
5931
|
+
_this.tooltip.appendTo(_this.element);
|
|
5932
|
+
}
|
|
5835
5933
|
_this.popupObj.position.X = x + 20;
|
|
5836
5934
|
_this.popupObj.position.Y = y + 20;
|
|
5837
5935
|
_this.popupObj.dataBind();
|
|
@@ -5898,6 +5996,16 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
5898
5996
|
if (Browser.isDevice && !isIDevice()) {
|
|
5899
5997
|
removeClass([this.parent.getToolbar()], [CLS_HIDE]);
|
|
5900
5998
|
}
|
|
5999
|
+
if (!isNullOrUndefined(document.querySelector('.e-tooltip-wrap'))) {
|
|
6000
|
+
if (!isNullOrUndefined(document.querySelector('#' + this.element.id + ' [data-tooltip-id]'))) {
|
|
6001
|
+
var tooltipTargetEle = document.querySelector('#' + this.element.id + ' [data-tooltip-id]');
|
|
6002
|
+
var dataContent = tooltipTargetEle.getAttribute('data-content');
|
|
6003
|
+
tooltipTargetEle.removeAttribute('data-content');
|
|
6004
|
+
tooltipTargetEle.setAttribute('title', dataContent);
|
|
6005
|
+
tooltipTargetEle.removeAttribute('data-tooltip-id');
|
|
6006
|
+
}
|
|
6007
|
+
this.tooltip.destroy();
|
|
6008
|
+
}
|
|
5901
6009
|
if (!isNullOrUndefined(this.parent.getToolbar()) && !this.parent.inlineMode.enable) {
|
|
5902
6010
|
if (isNullOrUndefined(viewSourcePanel) || viewSourcePanel.style.display === 'none') {
|
|
5903
6011
|
this.parent.enableToolbarItem(this.parent.toolbarSettings.items);
|
|
@@ -6343,10 +6451,17 @@ var QuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
6343
6451
|
};
|
|
6344
6452
|
QuickToolbar.prototype.keyUpHandler = function (e) {
|
|
6345
6453
|
if (this.parent.inlineMode.enable && !Browser.isDevice) {
|
|
6454
|
+
var args = e.args;
|
|
6346
6455
|
if (this.parent.inlineMode.onSelection) {
|
|
6456
|
+
if (this.parent.getSelection().length > 0) {
|
|
6457
|
+
if ((args.ctrlKey && args.keyCode === 65) || (args.shiftKey && (args.keyCode === 33 || args.keyCode === 34 ||
|
|
6458
|
+
args.keyCode === 35 || args.keyCode === 36 || args.keyCode === 37 || args.keyCode === 38 ||
|
|
6459
|
+
args.keyCode === 39 || args.keyCode === 40))) {
|
|
6460
|
+
this.showInlineQTBar(this.offsetX, this.offsetY, args.target);
|
|
6461
|
+
}
|
|
6462
|
+
}
|
|
6347
6463
|
return;
|
|
6348
6464
|
}
|
|
6349
|
-
var args = e.args;
|
|
6350
6465
|
this.deBounce(this.offsetX, this.offsetY, args.target);
|
|
6351
6466
|
}
|
|
6352
6467
|
};
|
|
@@ -7003,10 +7118,11 @@ function setEditFrameFocus(editableElement, selector) {
|
|
|
7003
7118
|
}
|
|
7004
7119
|
/**
|
|
7005
7120
|
* @param {string} value - specifies the string value
|
|
7121
|
+
* @param {string} enterAction - specifies the enter key action API
|
|
7006
7122
|
* @returns {void}
|
|
7007
7123
|
* @hidden
|
|
7008
7124
|
*/
|
|
7009
|
-
function updateTextNode$1(value) {
|
|
7125
|
+
function updateTextNode$1(value, enterAction) {
|
|
7010
7126
|
var tempNode = document.createElement('div');
|
|
7011
7127
|
tempNode.innerHTML = value;
|
|
7012
7128
|
tempNode.setAttribute('class', 'tempDiv');
|
|
@@ -7021,15 +7137,23 @@ function updateTextNode$1(value) {
|
|
|
7021
7137
|
(tempNode.firstChild.textContent.indexOf('\n') < 0 || tempNode.firstChild.textContent.trim() !== '')) ||
|
|
7022
7138
|
inlineNode$1.indexOf(tempNode.firstChild.nodeName.toLocaleLowerCase()) >= 0) {
|
|
7023
7139
|
if (!isPreviousInlineElem) {
|
|
7024
|
-
|
|
7025
|
-
|
|
7026
|
-
|
|
7140
|
+
if (enterAction === 'BR') {
|
|
7141
|
+
resultElm.appendChild(tempNode.firstChild);
|
|
7142
|
+
previousParent = resultElm;
|
|
7143
|
+
}
|
|
7144
|
+
else {
|
|
7145
|
+
paraElm = createElement('p');
|
|
7146
|
+
resultElm.appendChild(paraElm);
|
|
7147
|
+
paraElm.appendChild(tempNode.firstChild);
|
|
7148
|
+
previousParent = paraElm;
|
|
7149
|
+
isPreviousInlineElem = true;
|
|
7150
|
+
}
|
|
7027
7151
|
}
|
|
7028
7152
|
else {
|
|
7029
7153
|
previousParent.appendChild(tempNode.firstChild);
|
|
7154
|
+
previousParent = paraElm;
|
|
7155
|
+
isPreviousInlineElem = true;
|
|
7030
7156
|
}
|
|
7031
|
-
previousParent = paraElm;
|
|
7032
|
-
isPreviousInlineElem = true;
|
|
7033
7157
|
}
|
|
7034
7158
|
else if (tempNode.firstChild.nodeName === '#text' && (tempNode.firstChild.textContent === '\n' ||
|
|
7035
7159
|
(tempNode.firstChild.textContent.indexOf('\n') >= 0 && tempNode.firstChild.textContent.trim() === ''))) {
|
|
@@ -7368,6 +7492,12 @@ var ON_BEGIN = 'onBegin';
|
|
|
7368
7492
|
* @hidden
|
|
7369
7493
|
*/
|
|
7370
7494
|
var SPACE_ACTION = 'actionBegin';
|
|
7495
|
+
/**
|
|
7496
|
+
* Format painter event constant
|
|
7497
|
+
*
|
|
7498
|
+
* @hidden
|
|
7499
|
+
*/
|
|
7500
|
+
var FORMAT_PAINTER_ACTIONS = 'format_painter_actions';
|
|
7371
7501
|
|
|
7372
7502
|
/**
|
|
7373
7503
|
* Formatter
|
|
@@ -7394,8 +7524,14 @@ var Formatter = /** @__PURE__ @class */ (function () {
|
|
|
7394
7524
|
var selection = self.contentModule.getDocument().getSelection();
|
|
7395
7525
|
var range = (selection.rangeCount > 0) ? selection.getRangeAt(selection.rangeCount - 1) : null;
|
|
7396
7526
|
var saveSelection;
|
|
7527
|
+
var isKeyboardVideoInsert = (!isNullOrUndefined(value) && !isNullOrUndefined(value.cssClass) &&
|
|
7528
|
+
value.cssClass !== 'e-video-inline');
|
|
7397
7529
|
if (self.editorMode === 'HTML') {
|
|
7398
|
-
|
|
7530
|
+
if (!isNullOrUndefined(args) && !isKeyboardVideoInsert) {
|
|
7531
|
+
if (isNullOrUndefined(args.name) || (!isNullOrUndefined(args.name) && args.name !== 'showDialog')) {
|
|
7532
|
+
saveSelection = this.editorManager.nodeSelection.save(range, self.contentModule.getDocument());
|
|
7533
|
+
}
|
|
7534
|
+
}
|
|
7399
7535
|
}
|
|
7400
7536
|
if (!isNullOrUndefined(args)
|
|
7401
7537
|
&& args.item.command
|
|
@@ -7471,18 +7607,21 @@ var Formatter = /** @__PURE__ @class */ (function () {
|
|
|
7471
7607
|
&& args.item.command !== 'Font')
|
|
7472
7608
|
|| ((args.item.subCommand === 'FontName' || args.item.subCommand === 'FontSize') && args.name === 'dropDownSelect')
|
|
7473
7609
|
|| ((args.item.subCommand === 'BackgroundColor' || args.item.subCommand === 'FontColor')
|
|
7474
|
-
&& args.name === 'colorPickerChanged'))) {
|
|
7610
|
+
&& args.name === 'colorPickerChanged') || args.item.subCommand === 'FormatPainter')) {
|
|
7475
7611
|
extend(args, args, { requestType: args.item.subCommand, cancel: false, itemCollection: value, selectType: args.name }, true);
|
|
7476
7612
|
self.trigger(actionBegin, args, function (actionBeginArgs) {
|
|
7477
7613
|
if (!actionBeginArgs.cancel) {
|
|
7614
|
+
var formatPainterCopyAction = !isNullOrUndefined(actionBeginArgs.name) && actionBeginArgs.name === 'format-copy';
|
|
7478
7615
|
if (_this.getUndoRedoStack().length === 0 && actionBeginArgs.item.command !== 'Links'
|
|
7479
|
-
&& actionBeginArgs.item.command !== 'Images') {
|
|
7616
|
+
&& actionBeginArgs.item.command !== 'Images' && !formatPainterCopyAction) {
|
|
7480
7617
|
_this.saveData();
|
|
7481
7618
|
}
|
|
7482
7619
|
self.isBlur = false;
|
|
7483
7620
|
self.contentModule.getEditPanel().focus();
|
|
7484
|
-
if (self.editorMode === 'HTML') {
|
|
7485
|
-
|
|
7621
|
+
if (self.editorMode === 'HTML' && !isKeyboardVideoInsert) {
|
|
7622
|
+
if (isNullOrUndefined(args.selectType) || (!isNullOrUndefined(args.selectType) && args.selectType !== 'showDialog')) {
|
|
7623
|
+
saveSelection.restore();
|
|
7624
|
+
}
|
|
7486
7625
|
}
|
|
7487
7626
|
var command = actionBeginArgs.item.subCommand.toLocaleLowerCase();
|
|
7488
7627
|
if (command === 'paste' || command === 'cut' || command === 'copy') {
|
|
@@ -8756,7 +8895,9 @@ var htmlKeyConfig = {
|
|
|
8756
8895
|
'space': '32',
|
|
8757
8896
|
'enter': '13',
|
|
8758
8897
|
'tab': 'tab',
|
|
8759
|
-
'delete': '46'
|
|
8898
|
+
'delete': '46',
|
|
8899
|
+
'format-copy': 'ctrl+shift+c',
|
|
8900
|
+
'format-paste': 'ctrl+shift+v'
|
|
8760
8901
|
};
|
|
8761
8902
|
/**
|
|
8762
8903
|
* Default markdown key config for adapter
|
|
@@ -11310,7 +11451,7 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
11310
11451
|
this.parent.domNode.insertAfter(insertTag, startNodeParent);
|
|
11311
11452
|
e.event.preventDefault();
|
|
11312
11453
|
this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, insertTag, 0);
|
|
11313
|
-
if (startNodeParent.textContent === '') {
|
|
11454
|
+
if (startNodeParent.textContent === '' && (startNodeParent.querySelectorAll('audio,video').length === 0)) {
|
|
11314
11455
|
detach(startNodeParent);
|
|
11315
11456
|
}
|
|
11316
11457
|
else {
|
|
@@ -12719,7 +12860,7 @@ var Formats = /** @__PURE__ @class */ (function () {
|
|
|
12719
12860
|
var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
12720
12861
|
function InsertHtml() {
|
|
12721
12862
|
}
|
|
12722
|
-
InsertHtml.Insert = function (docElement, insertNode, editNode, isExternal) {
|
|
12863
|
+
InsertHtml.Insert = function (docElement, insertNode, editNode, isExternal, enterAction) {
|
|
12723
12864
|
var node;
|
|
12724
12865
|
if (typeof insertNode === 'string') {
|
|
12725
12866
|
var divNode = document.createElement('div');
|
|
@@ -12741,7 +12882,8 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
12741
12882
|
var nodeCutter = new NodeCutter();
|
|
12742
12883
|
var range = nodeSelection.getRange(docElement);
|
|
12743
12884
|
if (range.startContainer === editNode && range.startContainer === range.endContainer && range.startOffset === 0 &&
|
|
12744
|
-
range.startOffset === range.endOffset && editNode.textContent.length === 0 &&
|
|
12885
|
+
range.startOffset === range.endOffset && editNode.textContent.length === 0 &&
|
|
12886
|
+
(editNode.children[0].tagName === 'P' || (editNode.children[0].tagName === 'BR'))) {
|
|
12745
12887
|
nodeSelection.setSelectionText(docElement, range.startContainer.children[0], range.startContainer.children[0], 0, 0);
|
|
12746
12888
|
range = nodeSelection.getRange(docElement);
|
|
12747
12889
|
}
|
|
@@ -12758,7 +12900,7 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
12758
12900
|
var closestParentNode = (node.nodeName.toLowerCase() === 'table') ? this.closestEle(nodes[0].parentNode, editNode) : nodes[0];
|
|
12759
12901
|
if (isExternal || (!isNullOrUndefined(node) && !isNullOrUndefined(node.classList) &&
|
|
12760
12902
|
node.classList.contains('pasteContent'))) {
|
|
12761
|
-
this.pasteInsertHTML(nodes, node, range, nodeSelection, nodeCutter, docElement, isCollapsed, closestParentNode, editNode);
|
|
12903
|
+
this.pasteInsertHTML(nodes, node, range, nodeSelection, nodeCutter, docElement, isCollapsed, closestParentNode, editNode, enterAction);
|
|
12762
12904
|
return;
|
|
12763
12905
|
}
|
|
12764
12906
|
if (editNode !== range.startContainer && ((!isCollapsed && !(closestParentNode.nodeType === Node.ELEMENT_NODE &&
|
|
@@ -12872,7 +13014,7 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
12872
13014
|
}
|
|
12873
13015
|
}
|
|
12874
13016
|
};
|
|
12875
|
-
InsertHtml.pasteInsertHTML = function (nodes, node, range, nodeSelection, nodeCutter, docElement, isCollapsed, closestParentNode, editNode) {
|
|
13017
|
+
InsertHtml.pasteInsertHTML = function (nodes, node, range, nodeSelection, nodeCutter, docElement, isCollapsed, closestParentNode, editNode, enterAction) {
|
|
12876
13018
|
var isCursor = range.startOffset === range.endOffset &&
|
|
12877
13019
|
range.startContainer === range.endContainer;
|
|
12878
13020
|
if (isCursor && range.startContainer === editNode && editNode.textContent === '') {
|
|
@@ -12926,7 +13068,9 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
12926
13068
|
}
|
|
12927
13069
|
else {
|
|
12928
13070
|
range.deleteContents();
|
|
12929
|
-
|
|
13071
|
+
if (!isNullOrUndefined(lasNode)) {
|
|
13072
|
+
detach(lasNode);
|
|
13073
|
+
}
|
|
12930
13074
|
// eslint-disable-next-line
|
|
12931
13075
|
!isNullOrUndefined(sibNode) ? sibNode.parentNode.appendChild(fragment) : editNode.appendChild(fragment);
|
|
12932
13076
|
}
|
|
@@ -12982,7 +13126,12 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
12982
13126
|
var firstParaElm = createElement('p');
|
|
12983
13127
|
node.parentElement.insertBefore(firstParaElm, node);
|
|
12984
13128
|
}
|
|
12985
|
-
node.previousElementSibling.
|
|
13129
|
+
if (node.previousElementSibling.nodeName === 'BR') {
|
|
13130
|
+
node.parentElement.insertBefore(node.firstChild, node);
|
|
13131
|
+
}
|
|
13132
|
+
else {
|
|
13133
|
+
node.previousElementSibling.appendChild(node.firstChild);
|
|
13134
|
+
}
|
|
12986
13135
|
}
|
|
12987
13136
|
else {
|
|
12988
13137
|
lastSelectionNode = node.firstChild;
|
|
@@ -13014,7 +13163,7 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
13014
13163
|
this.placeCursorEnd(lastSelectionNode, node, nodeSelection, docElement, editNode);
|
|
13015
13164
|
}
|
|
13016
13165
|
else {
|
|
13017
|
-
this.cursorPos(lastSelectionNode, node, nodeSelection, docElement, editNode);
|
|
13166
|
+
this.cursorPos(lastSelectionNode, node, nodeSelection, docElement, editNode, enterAction);
|
|
13018
13167
|
}
|
|
13019
13168
|
};
|
|
13020
13169
|
InsertHtml.placeCursorEnd = function (lastSelectionNode, node, nodeSelection, docElement, editNode) {
|
|
@@ -13107,7 +13256,7 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
13107
13256
|
detach(currentNode.nextSibling);
|
|
13108
13257
|
}
|
|
13109
13258
|
}
|
|
13110
|
-
else if ((currentNode.nodeName === '#text' || currentNode.nodeName ===
|
|
13259
|
+
else if ((currentNode.nodeName === '#text' || currentNode.nodeName === 'BR') && !isNullOrUndefined(currentNode.parentElement) &&
|
|
13111
13260
|
(currentNode.parentElement.nodeName === 'LI' || (blockNode === editNode && currentNode.parentElement === blockNode)) &&
|
|
13112
13261
|
currentNode.parentElement.textContent.trim().length > 0) {
|
|
13113
13262
|
splitedElm = currentNode;
|
|
@@ -13129,9 +13278,9 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
13129
13278
|
}
|
|
13130
13279
|
}
|
|
13131
13280
|
};
|
|
13132
|
-
InsertHtml.cursorPos = function (lastSelectionNode, node, nodeSelection, docElement, editNode) {
|
|
13281
|
+
InsertHtml.cursorPos = function (lastSelectionNode, node, nodeSelection, docElement, editNode, enterAction) {
|
|
13133
13282
|
lastSelectionNode.classList.add('lastNode');
|
|
13134
|
-
editNode.innerHTML = updateTextNode$1(editNode.innerHTML);
|
|
13283
|
+
editNode.innerHTML = updateTextNode$1(editNode.innerHTML, enterAction);
|
|
13135
13284
|
lastSelectionNode = editNode.querySelector('.lastNode');
|
|
13136
13285
|
if (!isNullOrUndefined(lastSelectionNode)) {
|
|
13137
13286
|
this.placeCursorEnd(lastSelectionNode, node, nodeSelection, docElement, editNode);
|
|
@@ -13458,7 +13607,6 @@ var LinkCommand = /** @__PURE__ @class */ (function () {
|
|
|
13458
13607
|
return arr.join(' ') + ' ';
|
|
13459
13608
|
};
|
|
13460
13609
|
LinkCommand.prototype.openLink = function (e) {
|
|
13461
|
-
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
|
13462
13610
|
document.defaultView.open(e.item.url, e.item.target);
|
|
13463
13611
|
this.callBack(e);
|
|
13464
13612
|
};
|
|
@@ -13926,7 +14074,6 @@ var ImageCommand = /** @__PURE__ @class */ (function () {
|
|
|
13926
14074
|
this.callBack(e);
|
|
13927
14075
|
};
|
|
13928
14076
|
ImageCommand.prototype.openImageLink = function (e) {
|
|
13929
|
-
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
|
13930
14077
|
document.defaultView.open(e.item.url, e.item.target);
|
|
13931
14078
|
this.callBack(e);
|
|
13932
14079
|
};
|
|
@@ -14400,6 +14547,8 @@ var VideoCommand = /** @__PURE__ @class */ (function () {
|
|
|
14400
14547
|
: (Browser.isIE ? selectedNode : !e.item.isEmbedUrl ? selectedNode.lastElementChild : selectedNode.querySelector('iframe'));
|
|
14401
14548
|
videoElm_1.addEventListener(videoElm_1.tagName !== 'IFRAME' ? 'loadeddata' : 'load', function () {
|
|
14402
14549
|
if (e.value !== 'VideoReplace' || !isReplaced) {
|
|
14550
|
+
if (e.item.isEmbedUrl && videoElm_1)
|
|
14551
|
+
videoElm_1.classList.add('e-rte-embed-url');
|
|
14403
14552
|
e.callBack({
|
|
14404
14553
|
requestType: 'Videos',
|
|
14405
14554
|
editorMode: 'HTML',
|
|
@@ -15638,6 +15787,7 @@ var IsFormatted = /** @__PURE__ @class */ (function () {
|
|
|
15638
15787
|
'code',
|
|
15639
15788
|
'dfn',
|
|
15640
15789
|
'em',
|
|
15790
|
+
'font',
|
|
15641
15791
|
'i',
|
|
15642
15792
|
'kbd',
|
|
15643
15793
|
'label',
|
|
@@ -15671,15 +15821,16 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15671
15821
|
* @param {string} enterAction - specifies the enter key action
|
|
15672
15822
|
* @param {string} value - specifies the string value
|
|
15673
15823
|
* @param {string} selector - specifies the string
|
|
15824
|
+
* @param {FormatPainterValue} painterValues specifies the element created and last child
|
|
15674
15825
|
* @returns {void}
|
|
15675
15826
|
* @hidden
|
|
15676
15827
|
* @deprecated
|
|
15677
15828
|
*/
|
|
15678
|
-
SelectionCommands.applyFormat = function (docElement, format, endNode, enterAction, value, selector) {
|
|
15829
|
+
SelectionCommands.applyFormat = function (docElement, format, endNode, enterAction, value, selector, painterValues) {
|
|
15679
15830
|
this.enterAction = enterAction;
|
|
15680
15831
|
var validFormats = ['bold', 'italic', 'underline', 'strikethrough', 'superscript',
|
|
15681
15832
|
'subscript', 'uppercase', 'lowercase', 'fontcolor', 'fontname', 'fontsize', 'backgroundcolor'];
|
|
15682
|
-
if (validFormats.indexOf(format) > -1) {
|
|
15833
|
+
if (validFormats.indexOf(format) > -1 || value === 'formatPainter') {
|
|
15683
15834
|
if (format === 'backgroundcolor' && value === '') {
|
|
15684
15835
|
value = 'transparent';
|
|
15685
15836
|
}
|
|
@@ -15755,8 +15906,10 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15755
15906
|
if (formatNode !== null && (!isFormat || isFontStyle)) {
|
|
15756
15907
|
nodes[index] = this.removeFormat(nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, domSelection, endNode, domNode);
|
|
15757
15908
|
}
|
|
15758
|
-
else if (range.startContainer.parentElement !== endNode ||
|
|
15759
|
-
|
|
15909
|
+
else if (range.startContainer.parentElement !== endNode ||
|
|
15910
|
+
(range.commonAncestorContainer !== endNode && range.startContainer.parentElement === endNode)
|
|
15911
|
+
|| (range.commonAncestorContainer === endNode || nodes.length === 1)) {
|
|
15912
|
+
nodes[index] = this.insertFormat(docElement, nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, painterValues, domNode, endNode);
|
|
15760
15913
|
}
|
|
15761
15914
|
domSelection = this.applySelection(nodes, domSelection, nodeCutter, index, isCollapsed);
|
|
15762
15915
|
}
|
|
@@ -16052,7 +16205,7 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
16052
16205
|
}
|
|
16053
16206
|
return nodes[index];
|
|
16054
16207
|
};
|
|
16055
|
-
SelectionCommands.insertFormat = function (docElement, nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, domNode, endNode) {
|
|
16208
|
+
SelectionCommands.insertFormat = function (docElement, nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, painterValues, domNode, endNode) {
|
|
16056
16209
|
var rootElementNode;
|
|
16057
16210
|
if (!isCursor) {
|
|
16058
16211
|
if ((formatNode === null && isFormat) || isFontStyle) {
|
|
@@ -16079,11 +16232,11 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
16079
16232
|
}
|
|
16080
16233
|
else if (!(isFontStyle === true && value === '')) {
|
|
16081
16234
|
var element = this.GetFormatNode(format, value);
|
|
16082
|
-
if (format === 'fontsize' || format === 'fontcolor' || format === 'fontname' || format === 'backgroundcolor') {
|
|
16235
|
+
if (value === 'formatPainter' || format === 'fontsize' || format === 'fontcolor' || format === 'fontname' || format === 'backgroundcolor') {
|
|
16083
16236
|
if (format !== 'fontname' && format !== 'backgroundcolor') {
|
|
16084
16237
|
var liElement = nodes[index].parentElement;
|
|
16085
16238
|
var parentElement = nodes[index].parentElement;
|
|
16086
|
-
while (!isNullOrUndefined(parentElement) && parentElement.tagName.toLowerCase() !== 'li'
|
|
16239
|
+
while (!isNullOrUndefined(parentElement) && parentElement.tagName.toLowerCase() !== 'li') {
|
|
16087
16240
|
parentElement = parentElement.parentElement;
|
|
16088
16241
|
liElement = parentElement;
|
|
16089
16242
|
}
|
|
@@ -16098,7 +16251,7 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
16098
16251
|
}
|
|
16099
16252
|
}
|
|
16100
16253
|
}
|
|
16101
|
-
if (rootElementNode && rootElementNode.nodeType !== 3) {
|
|
16254
|
+
if (rootElementNode && rootElementNode.nodeType !== 3 && rootElementNode.nodeName !== 'A') {
|
|
16102
16255
|
var save = new NodeSelection();
|
|
16103
16256
|
save.save(range, docElement);
|
|
16104
16257
|
domNode.setMarker(save);
|
|
@@ -16118,7 +16271,12 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
16118
16271
|
domNode.saveMarker(save, null);
|
|
16119
16272
|
}
|
|
16120
16273
|
else {
|
|
16121
|
-
|
|
16274
|
+
if (value === 'formatPainter') {
|
|
16275
|
+
return this.insertFormatPainterElem(nodes, index, range, nodeCutter, painterValues, domNode);
|
|
16276
|
+
}
|
|
16277
|
+
else {
|
|
16278
|
+
nodes[index] = this.applyStyles(nodes, index, element);
|
|
16279
|
+
}
|
|
16122
16280
|
}
|
|
16123
16281
|
if (format === 'fontsize') {
|
|
16124
16282
|
var bg = closest(nodes[index].parentElement, 'span[style*=' + 'background-color' + ']');
|
|
@@ -16249,6 +16407,59 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
16249
16407
|
ele.setAttribute('style', styles);
|
|
16250
16408
|
}
|
|
16251
16409
|
};
|
|
16410
|
+
// Below function is used to insert the element created by the format painter plugin.
|
|
16411
|
+
SelectionCommands.insertFormatPainterElem = function (nodes, index, range, nodeCutter, painterValues, domNode) {
|
|
16412
|
+
var parent = nodes[index].parentElement;
|
|
16413
|
+
if (!domNode.isBlockNode(parent)) {
|
|
16414
|
+
// The below code is used to remove the already present inline style from the text node.
|
|
16415
|
+
while (parent.textContent.trim() === parent.parentElement.textContent.trim() && !domNode.isBlockNode(parent.parentElement)) {
|
|
16416
|
+
parent = parent.parentElement;
|
|
16417
|
+
}
|
|
16418
|
+
if (parent.textContent.trim() !== nodes[index].textContent.trim()) {
|
|
16419
|
+
nodeCutter.SplitNode(range, parent, true);
|
|
16420
|
+
var childELemList = nodes[index].parentElement.childNodes;
|
|
16421
|
+
for (var i = 0; i < childELemList.length; i++) {
|
|
16422
|
+
if (childELemList[i].textContent.trim() === nodes[i].textContent.trim()) {
|
|
16423
|
+
parent.parentNode.insertBefore(childELemList[i], parent);
|
|
16424
|
+
break;
|
|
16425
|
+
}
|
|
16426
|
+
}
|
|
16427
|
+
var blockChildNodes = parent.parentElement.childNodes;
|
|
16428
|
+
for (var k = 0; k < blockChildNodes.length; k++) {
|
|
16429
|
+
if (blockChildNodes[k].textContent.trim() === '' || blockChildNodes[k].textContent.length === 0) {
|
|
16430
|
+
detach(blockChildNodes[k]);
|
|
16431
|
+
}
|
|
16432
|
+
}
|
|
16433
|
+
}
|
|
16434
|
+
else {
|
|
16435
|
+
InsertMethods.unwrap(parent);
|
|
16436
|
+
}
|
|
16437
|
+
}
|
|
16438
|
+
var elem = painterValues.element;
|
|
16439
|
+
if (!isNullOrUndefined(elem)) {
|
|
16440
|
+
// Step 1: Cloning the element that is created by format painter.
|
|
16441
|
+
// Step 2: Finding the last child of the nested elememt using the paintervalues.lastchild nodename
|
|
16442
|
+
// Step 3: Assigning the nodes[index] text content to the last child element.
|
|
16443
|
+
// Step 4: Wrapping the cloned element with the nodes[index]
|
|
16444
|
+
var clonedElement = elem.cloneNode(true);
|
|
16445
|
+
var elemList = clonedElement.querySelectorAll(painterValues.lastChild.nodeName);
|
|
16446
|
+
var lastElement = void 0;
|
|
16447
|
+
if (elemList.length > 0) {
|
|
16448
|
+
lastElement = elemList[elemList.length - 1];
|
|
16449
|
+
}
|
|
16450
|
+
else {
|
|
16451
|
+
if (!isNullOrUndefined(clonedElement) && clonedElement.nodeName === painterValues.lastChild.nodeName) {
|
|
16452
|
+
lastElement = clonedElement;
|
|
16453
|
+
}
|
|
16454
|
+
}
|
|
16455
|
+
lastElement.textContent = nodes[index].textContent;
|
|
16456
|
+
var lastChild = lastElement.childNodes[0];
|
|
16457
|
+
nodes[index] = InsertMethods.Wrap(nodes[index], clonedElement);
|
|
16458
|
+
nodes[index].textContent = '';
|
|
16459
|
+
nodes[index] = lastChild;
|
|
16460
|
+
}
|
|
16461
|
+
return nodes[index];
|
|
16462
|
+
};
|
|
16252
16463
|
SelectionCommands.enterAction = 'P';
|
|
16253
16464
|
return SelectionCommands;
|
|
16254
16465
|
}());
|
|
@@ -16324,7 +16535,7 @@ var InsertHtmlExec = /** @__PURE__ @class */ (function () {
|
|
|
16324
16535
|
this.parent.observer.on(INSERTHTML_TYPE, this.applyHtml, this);
|
|
16325
16536
|
};
|
|
16326
16537
|
InsertHtmlExec.prototype.applyHtml = function (e) {
|
|
16327
|
-
InsertHtml.Insert(this.parent.currentDocument, e.value, this.parent.editableElement, true);
|
|
16538
|
+
InsertHtml.Insert(this.parent.currentDocument, e.value, this.parent.editableElement, true, e.enterAction);
|
|
16328
16539
|
if (e.subCommand === 'pasteCleanup') {
|
|
16329
16540
|
var pastedElements = this.parent.editableElement.querySelectorAll('.pasteContent_RTE');
|
|
16330
16541
|
var allPastedElements = [].slice.call(pastedElements);
|
|
@@ -16375,12 +16586,18 @@ var ClearFormat$1 = /** @__PURE__ @class */ (function () {
|
|
|
16375
16586
|
var nodeSelection = new NodeSelection();
|
|
16376
16587
|
var nodeCutter = new NodeCutter();
|
|
16377
16588
|
var range = nodeSelection.getRange(docElement);
|
|
16378
|
-
var
|
|
16379
|
-
|
|
16589
|
+
var nodes = range.collapsed ? nodeSelection.getSelectionNodeCollection(range) :
|
|
16590
|
+
nodeSelection.getSelectionNodeCollectionBr(range);
|
|
16380
16591
|
var save = nodeSelection.save(range, docElement);
|
|
16592
|
+
var cursorRange = false;
|
|
16593
|
+
if (range.collapsed) {
|
|
16594
|
+
cursorRange = true;
|
|
16595
|
+
range = nodeCutter.GetCursorRange(docElement, range, nodes[0]);
|
|
16596
|
+
}
|
|
16597
|
+
var isCollapsed = range.collapsed;
|
|
16381
16598
|
if (!isCollapsed) {
|
|
16382
16599
|
var preNode = void 0;
|
|
16383
|
-
if (nodes[0].nodeName === 'BR' && closest(nodes[0], 'table')) {
|
|
16600
|
+
if (nodes.length > 0 && nodes[0].nodeName === 'BR' && closest(nodes[0], 'table')) {
|
|
16384
16601
|
preNode = nodeCutter.GetSpliceNode(range, closest(nodes[0], 'table'));
|
|
16385
16602
|
}
|
|
16386
16603
|
else {
|
|
@@ -16390,7 +16607,7 @@ var ClearFormat$1 = /** @__PURE__ @class */ (function () {
|
|
|
16390
16607
|
nodeSelection.setSelectionContents(docElement, preNode);
|
|
16391
16608
|
range = nodeSelection.getRange(docElement);
|
|
16392
16609
|
}
|
|
16393
|
-
else {
|
|
16610
|
+
else if (nodes.length > 1) {
|
|
16394
16611
|
var i = 1;
|
|
16395
16612
|
var lastText = nodes[nodes.length - i];
|
|
16396
16613
|
while (nodes.length <= i && nodes[nodes.length - i].nodeName === 'BR') {
|
|
@@ -16415,6 +16632,9 @@ var ClearFormat$1 = /** @__PURE__ @class */ (function () {
|
|
|
16415
16632
|
}
|
|
16416
16633
|
this.reSelection(docElement, save, exactNodes);
|
|
16417
16634
|
}
|
|
16635
|
+
if (cursorRange) {
|
|
16636
|
+
nodeSelection.setCursorPoint(docElement, range.endContainer, range.endOffset);
|
|
16637
|
+
}
|
|
16418
16638
|
};
|
|
16419
16639
|
ClearFormat.reSelection = function (docElement, save, exactNodes) {
|
|
16420
16640
|
var selectionNodes = save.getInsertNodes(exactNodes);
|
|
@@ -16924,7 +17144,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
16924
17144
|
if (pattern4.test(tempHTMLContent)) {
|
|
16925
17145
|
this.addTableBorderClass(elm);
|
|
16926
17146
|
}
|
|
16927
|
-
// Removing the margin for list items
|
|
17147
|
+
// Removing the margin for list items
|
|
16928
17148
|
var liChildren = elm.querySelectorAll('li');
|
|
16929
17149
|
if (liChildren.length > 0) {
|
|
16930
17150
|
for (var i = 0; i < liChildren.length; i++) {
|
|
@@ -17222,6 +17442,29 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
17222
17442
|
}
|
|
17223
17443
|
fromClass = false;
|
|
17224
17444
|
}
|
|
17445
|
+
var listClass = ['MsoListParagraphCxSpFirst', 'MsoListParagraphCxSpMiddle', 'MsoListParagraphCxSpLast'];
|
|
17446
|
+
for (var i = 0; i < listClass.length; i++) {
|
|
17447
|
+
if (keys.indexOf('li.' + listClass[i]) > -1) {
|
|
17448
|
+
var olULElems = elm.querySelectorAll('ol.' + listClass[i] + ', ul.' + listClass[i]);
|
|
17449
|
+
for (var j = 0; j < olULElems.length; j++) {
|
|
17450
|
+
var styleProperty = olULElems[j].getAttribute('style');
|
|
17451
|
+
if (!isNullOrUndefined(styleProperty) && styleProperty.trim() !== '' && olULElems[j].style.marginLeft !== '') {
|
|
17452
|
+
var valueSplit = values[keys.indexOf('li.' + listClass[i])].split(';');
|
|
17453
|
+
for (var k = 0; k < valueSplit.length; k++) {
|
|
17454
|
+
if ('margin-left'.indexOf(valueSplit[k].split(':')[0]) >= 0) {
|
|
17455
|
+
if (!isNullOrUndefined(valueSplit[k].split(':')[1]) &&
|
|
17456
|
+
valueSplit[k].split(':')[1].indexOf('in') >= 0 &&
|
|
17457
|
+
olULElems[j].style.marginLeft.indexOf('in') >= 0) {
|
|
17458
|
+
var classStyle = parseFloat(valueSplit[k].split(':')[1].split('in')[0]);
|
|
17459
|
+
var inlineStyle = parseFloat(olULElems[j].style.marginLeft.split('in')[0]);
|
|
17460
|
+
olULElems[j].style.marginLeft = (inlineStyle - classStyle) + 'in';
|
|
17461
|
+
}
|
|
17462
|
+
}
|
|
17463
|
+
}
|
|
17464
|
+
}
|
|
17465
|
+
}
|
|
17466
|
+
}
|
|
17467
|
+
}
|
|
17225
17468
|
}
|
|
17226
17469
|
};
|
|
17227
17470
|
MsWordPaste.prototype.filterStyles = function (elm, wordPasteStyleConfig) {
|
|
@@ -17342,22 +17585,29 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
17342
17585
|
var type = void 0;
|
|
17343
17586
|
var listStyleType = void 0;
|
|
17344
17587
|
var startAttr = void 0;
|
|
17588
|
+
var styleMarginLeft = void 0;
|
|
17345
17589
|
if (!isNullOrUndefined(this.listContents[0])) {
|
|
17346
17590
|
type = this.listContents[0].trim().length > 1 ? 'ol' : 'ul';
|
|
17347
17591
|
listStyleType = this.getlistStyleType(this.listContents[0], type);
|
|
17348
|
-
if (type === 'ol' && listNodes[i - 1] === null) {
|
|
17592
|
+
if (type === 'ol' && (i === 0 || listNodes[i - 1] === null)) {
|
|
17349
17593
|
var startString = this.listContents[0].split('.')[0];
|
|
17350
|
-
var listTypes = ['A', 'a', 'I', 'i', 'α', '1'];
|
|
17594
|
+
var listTypes = ['A', 'a', 'I', 'i', 'α', '1', '1-']; // Add '1-' for rare list type.
|
|
17351
17595
|
if (listTypes.indexOf(startString) === -1) {
|
|
17352
17596
|
if (listStyleType === 'decimal') {
|
|
17353
17597
|
// Bug in getlistStyleType() list style stype is returned as decimal for nested list with start attribute
|
|
17354
|
-
if (!isNaN(parseInt(startString))) {
|
|
17355
|
-
startAttr = parseInt(startString);
|
|
17598
|
+
if (!isNaN(parseInt(startString, 10))) {
|
|
17599
|
+
startAttr = parseInt(startString, 10);
|
|
17356
17600
|
}
|
|
17357
17601
|
}
|
|
17358
|
-
else if (listStyleType === 'upper-alpha'
|
|
17359
|
-
startAttr =
|
|
17602
|
+
else if (listStyleType === 'upper-alpha') {
|
|
17603
|
+
startAttr = (startString.split('.')[0].charCodeAt(0) - 64);
|
|
17360
17604
|
}
|
|
17605
|
+
else if (listStyleType === 'lower-alpha') {
|
|
17606
|
+
startAttr = (startString.split('.')[0].charCodeAt(0) - 96);
|
|
17607
|
+
}
|
|
17608
|
+
}
|
|
17609
|
+
if (listNodes[i].style.marginLeft !== '') {
|
|
17610
|
+
styleMarginLeft = listNodes[i].style.marginLeft;
|
|
17361
17611
|
}
|
|
17362
17612
|
}
|
|
17363
17613
|
var tempNode = [];
|
|
@@ -17376,7 +17626,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
17376
17626
|
}
|
|
17377
17627
|
}
|
|
17378
17628
|
collection.push({ listType: type, content: tempNode, nestedLevel: level, class: currentClassName,
|
|
17379
|
-
listStyle: currentListStyle, listStyleTypeName: listStyleType, start: startAttr });
|
|
17629
|
+
listStyle: currentListStyle, listStyleTypeName: listStyleType, start: startAttr, styleMarginLeft: styleMarginLeft });
|
|
17380
17630
|
}
|
|
17381
17631
|
}
|
|
17382
17632
|
stNode = listNodes.shift();
|
|
@@ -17402,23 +17652,30 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
17402
17652
|
};
|
|
17403
17653
|
MsWordPaste.prototype.getlistStyleType = function (listContent, type) {
|
|
17404
17654
|
var currentListClass;
|
|
17655
|
+
var upperRomanNumber = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX',
|
|
17656
|
+
'X', 'XI', 'XII', 'XIII', 'XIV', 'XV', 'XVI', 'XVII', 'XVIII', 'XIX', 'XX'];
|
|
17657
|
+
var lowerRomanNumber = ['i', 'ii', 'iii', 'iv', 'v', 'vi', 'vii', 'viii', 'ix',
|
|
17658
|
+
'x', 'xi', 'xii', 'xiii', 'xiv', 'xv', 'xvi', 'xvii', 'xviii', 'xix', 'xx'];
|
|
17659
|
+
var lowerGreekNumber = ['α', 'β', 'γ', 'δ', 'ε', 'ζ', 'η', 'θ', 'ι', 'κ', 'λ',
|
|
17660
|
+
'μ', 'ν', 'ξ', 'ο', 'π', 'ρ', 'σ', 'τ', 'υ', 'φ', 'χ', 'ψ', 'ω'];
|
|
17405
17661
|
if (type === 'ol') {
|
|
17406
|
-
|
|
17407
|
-
|
|
17408
|
-
|
|
17409
|
-
break;
|
|
17410
|
-
case 'a':
|
|
17411
|
-
currentListClass = 'lower-alpha';
|
|
17412
|
-
break;
|
|
17413
|
-
case 'I':
|
|
17662
|
+
var charCode = listContent.split('.')[0].charCodeAt(0);
|
|
17663
|
+
switch (true) {
|
|
17664
|
+
case upperRomanNumber.indexOf(listContent.split('.')[0]) > -1:
|
|
17414
17665
|
currentListClass = 'upper-roman';
|
|
17415
17666
|
break;
|
|
17416
|
-
case '
|
|
17667
|
+
case lowerRomanNumber.indexOf(listContent.split('.')[0]) > -1:
|
|
17417
17668
|
currentListClass = 'lower-roman';
|
|
17418
17669
|
break;
|
|
17419
|
-
case '
|
|
17670
|
+
case lowerGreekNumber.indexOf(listContent.split('.')[0]) > -1:
|
|
17420
17671
|
currentListClass = 'lower-greek';
|
|
17421
17672
|
break;
|
|
17673
|
+
case (charCode > 64 && charCode < 91):
|
|
17674
|
+
currentListClass = 'upper-alpha';
|
|
17675
|
+
break;
|
|
17676
|
+
case (charCode > 96 && charCode < 123):
|
|
17677
|
+
currentListClass = 'lower-alpha';
|
|
17678
|
+
break;
|
|
17422
17679
|
default:
|
|
17423
17680
|
currentListClass = 'decimal';
|
|
17424
17681
|
break;
|
|
@@ -17450,11 +17707,12 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
17450
17707
|
var pElement = createElement('p');
|
|
17451
17708
|
pElement.innerHTML = collection[index].content.join(' ');
|
|
17452
17709
|
if ((collection[index].nestedLevel === 1) && listCount === 0 && collection[index].content) {
|
|
17453
|
-
root.appendChild(temp = createElement(collection[index].listType));
|
|
17710
|
+
root.appendChild(temp = createElement(collection[index].listType, { className: collection[index].class }));
|
|
17454
17711
|
prevList = createElement('li');
|
|
17455
17712
|
prevList.appendChild(pElement);
|
|
17456
17713
|
temp.appendChild(prevList);
|
|
17457
17714
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
17715
|
+
temp.style.marginLeft = collection[index].styleMarginLeft;
|
|
17458
17716
|
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
17459
17717
|
}
|
|
17460
17718
|
else if (collection[index].nestedLevel === pLevel) {
|
|
@@ -17619,372 +17877,132 @@ var InsertTextExec = /** @__PURE__ @class */ (function () {
|
|
|
17619
17877
|
}());
|
|
17620
17878
|
|
|
17621
17879
|
/**
|
|
17622
|
-
*
|
|
17880
|
+
* Update Toolbar Status
|
|
17623
17881
|
*
|
|
17624
17882
|
* @hidden
|
|
17625
17883
|
* @deprecated
|
|
17626
17884
|
*/
|
|
17627
|
-
var
|
|
17885
|
+
var statusCollection = getDefaultHtmlTbStatus();
|
|
17886
|
+
var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
17887
|
+
function ToolbarStatus() {
|
|
17888
|
+
}
|
|
17628
17889
|
/**
|
|
17629
|
-
*
|
|
17890
|
+
* get method
|
|
17630
17891
|
*
|
|
17892
|
+
* @param {Document} docElement - specifies the document element
|
|
17893
|
+
* @param {Node} targetNode - specifies the target node
|
|
17894
|
+
* @param {string[]} formatNode - specifies the format node
|
|
17895
|
+
* @param {string[]} fontSize - specifies the font size
|
|
17896
|
+
* @param {string[]} fontName - specifies the font name.
|
|
17897
|
+
* @param {Node} documentNode - specifies the document node.
|
|
17898
|
+
* @returns {IToolbarStatus} - returns the toolbar status
|
|
17631
17899
|
* @hidden
|
|
17632
17900
|
* @deprecated
|
|
17633
|
-
* @param {ICommandModel} options - specifies the command Model
|
|
17634
17901
|
*/
|
|
17635
|
-
function
|
|
17636
|
-
|
|
17637
|
-
|
|
17638
|
-
|
|
17639
|
-
|
|
17640
|
-
|
|
17641
|
-
|
|
17642
|
-
|
|
17643
|
-
|
|
17644
|
-
|
|
17645
|
-
|
|
17646
|
-
|
|
17647
|
-
|
|
17648
|
-
|
|
17649
|
-
|
|
17650
|
-
|
|
17651
|
-
|
|
17652
|
-
|
|
17653
|
-
|
|
17654
|
-
|
|
17655
|
-
|
|
17656
|
-
|
|
17657
|
-
|
|
17658
|
-
|
|
17659
|
-
|
|
17660
|
-
|
|
17661
|
-
|
|
17662
|
-
|
|
17663
|
-
|
|
17664
|
-
|
|
17665
|
-
|
|
17666
|
-
|
|
17667
|
-
|
|
17668
|
-
|
|
17669
|
-
|
|
17670
|
-
|
|
17671
|
-
|
|
17902
|
+
ToolbarStatus.get = function (docElement, targetNode, formatNode, fontSize, fontName, documentNode) {
|
|
17903
|
+
var formatCollection = JSON.parse(JSON.stringify(statusCollection));
|
|
17904
|
+
var nodeCollection = JSON.parse(JSON.stringify(statusCollection));
|
|
17905
|
+
var nodeSelection = new NodeSelection();
|
|
17906
|
+
var range = nodeSelection.getRange(docElement);
|
|
17907
|
+
var nodes = documentNode ? [documentNode] : range.collapsed ? nodeSelection.getNodeCollection(range) :
|
|
17908
|
+
nodeSelection.getSelectionNodeCollectionBr(range);
|
|
17909
|
+
var nodesLength = nodes.length;
|
|
17910
|
+
var isNodeChanged = false;
|
|
17911
|
+
for (var index = 0; index < nodes.length; index++) {
|
|
17912
|
+
while (nodes[index].nodeType === 3 && range.startContainer.nodeType === 3 && nodes[index].parentNode &&
|
|
17913
|
+
nodes[index].parentNode.lastElementChild && nodes[index].parentNode.lastElementChild.nodeName !== 'BR' &&
|
|
17914
|
+
(this.getImmediateBlockNode(nodes[index].parentNode)).textContent.replace(/\u200B/g, '').length === 0 &&
|
|
17915
|
+
range.startContainer.textContent.replace(/\u200B/g, '').length === 0 &&
|
|
17916
|
+
nodeSelection.get(docElement).toString().replace(/\u200B/g, '').length === 0) {
|
|
17917
|
+
nodes[index] = nodes[index].parentNode.lastElementChild.firstChild;
|
|
17918
|
+
isNodeChanged = true;
|
|
17919
|
+
}
|
|
17920
|
+
if (isNodeChanged && nodes[index]) {
|
|
17921
|
+
nodeSelection.setCursorPoint(docElement, nodes[index], nodes[index].textContent.length);
|
|
17922
|
+
isNodeChanged = false;
|
|
17923
|
+
}
|
|
17924
|
+
if ((nodes[index].nodeName !== 'BR' && nodes[index].nodeType !== 3) ||
|
|
17925
|
+
(nodesLength > 1 && nodes[index].nodeType === 3 && nodes[index].textContent.trim() === '')) {
|
|
17926
|
+
nodes.splice(index, 1);
|
|
17927
|
+
index--;
|
|
17928
|
+
}
|
|
17929
|
+
}
|
|
17930
|
+
for (var index = 0; index < nodes.length; index++) {
|
|
17931
|
+
// eslint-disable-next-line max-len
|
|
17932
|
+
formatCollection = this.getFormatParent(docElement, formatCollection, nodes[index], targetNode, formatNode, fontSize, fontName);
|
|
17933
|
+
if ((index === 0 && formatCollection.bold) || !formatCollection.bold) {
|
|
17934
|
+
nodeCollection.bold = formatCollection.bold;
|
|
17935
|
+
}
|
|
17936
|
+
if ((index === 0 && formatCollection.insertcode) || !formatCollection.insertcode) {
|
|
17937
|
+
nodeCollection.insertcode = formatCollection.insertcode;
|
|
17938
|
+
}
|
|
17939
|
+
if ((index === 0 && formatCollection.italic) || !formatCollection.italic) {
|
|
17940
|
+
nodeCollection.italic = formatCollection.italic;
|
|
17941
|
+
}
|
|
17942
|
+
if ((index === 0 && formatCollection.underline) || !formatCollection.underline) {
|
|
17943
|
+
nodeCollection.underline = formatCollection.underline;
|
|
17944
|
+
}
|
|
17945
|
+
if ((index === 0 && formatCollection.strikethrough) || !formatCollection.strikethrough) {
|
|
17946
|
+
nodeCollection.strikethrough = formatCollection.strikethrough;
|
|
17947
|
+
}
|
|
17948
|
+
if ((index === 0 && formatCollection.superscript) || !formatCollection.superscript) {
|
|
17949
|
+
nodeCollection.superscript = formatCollection.superscript;
|
|
17950
|
+
}
|
|
17951
|
+
if ((index === 0 && formatCollection.subscript) || !formatCollection.subscript) {
|
|
17952
|
+
nodeCollection.subscript = formatCollection.subscript;
|
|
17953
|
+
}
|
|
17954
|
+
if ((index === 0 && formatCollection.fontcolor) || !formatCollection.fontcolor) {
|
|
17955
|
+
nodeCollection.fontcolor = formatCollection.fontcolor;
|
|
17956
|
+
}
|
|
17957
|
+
if ((index === 0 && formatCollection.fontname) || !formatCollection.fontname) {
|
|
17958
|
+
nodeCollection.fontname = formatCollection.fontname;
|
|
17959
|
+
}
|
|
17960
|
+
if ((index === 0 && formatCollection.fontsize) || !formatCollection.fontsize) {
|
|
17961
|
+
nodeCollection.fontsize = formatCollection.fontsize;
|
|
17962
|
+
}
|
|
17963
|
+
if ((index === 0 && formatCollection.backgroundcolor) || !formatCollection.backgroundcolor) {
|
|
17964
|
+
nodeCollection.backgroundcolor = formatCollection.backgroundcolor;
|
|
17965
|
+
}
|
|
17966
|
+
if ((index === 0 && formatCollection.orderedlist) || !formatCollection.orderedlist) {
|
|
17967
|
+
nodeCollection.orderedlist = formatCollection.orderedlist;
|
|
17968
|
+
}
|
|
17969
|
+
if ((index === 0 && formatCollection.unorderedlist) || !formatCollection.unorderedlist) {
|
|
17970
|
+
nodeCollection.unorderedlist = formatCollection.unorderedlist;
|
|
17971
|
+
}
|
|
17972
|
+
if ((index === 0 && formatCollection.alignments) || !formatCollection.alignments) {
|
|
17973
|
+
nodeCollection.alignments = formatCollection.alignments;
|
|
17974
|
+
}
|
|
17975
|
+
if ((index === 0 && formatCollection.formats) || !formatCollection.formats) {
|
|
17976
|
+
nodeCollection.formats = formatCollection.formats;
|
|
17977
|
+
}
|
|
17978
|
+
if ((index === 0 && formatCollection.createlink) || !formatCollection.createlink) {
|
|
17979
|
+
nodeCollection.createlink = formatCollection.createlink;
|
|
17980
|
+
}
|
|
17981
|
+
if ((index === 0 && formatCollection.numberFormatList) || !formatCollection.numberFormatList) {
|
|
17982
|
+
nodeCollection.numberFormatList = formatCollection.numberFormatList;
|
|
17983
|
+
}
|
|
17984
|
+
if ((index === 0 && formatCollection.bulletFormatList) || !formatCollection.bulletFormatList) {
|
|
17985
|
+
nodeCollection.bulletFormatList = formatCollection.bulletFormatList;
|
|
17986
|
+
}
|
|
17987
|
+
formatCollection = JSON.parse(JSON.stringify(statusCollection));
|
|
17988
|
+
}
|
|
17989
|
+
return nodeCollection;
|
|
17672
17990
|
};
|
|
17673
|
-
|
|
17674
|
-
|
|
17991
|
+
ToolbarStatus.getImmediateBlockNode = function (node) {
|
|
17992
|
+
do {
|
|
17993
|
+
node = node.parentNode;
|
|
17994
|
+
} while (node && BLOCK_TAGS.indexOf(node.nodeName.toLocaleLowerCase()) < 0);
|
|
17995
|
+
return node;
|
|
17675
17996
|
};
|
|
17676
|
-
|
|
17677
|
-
|
|
17678
|
-
|
|
17679
|
-
|
|
17680
|
-
|
|
17681
|
-
|
|
17682
|
-
|
|
17683
|
-
|
|
17684
|
-
|
|
17685
|
-
*
|
|
17686
|
-
* @param {ExecCommand} command - specifies the execution command
|
|
17687
|
-
* @param {T} value - specifes the value.
|
|
17688
|
-
* @param {Event} event - specifies the call back event
|
|
17689
|
-
* @param {Function} callBack - specifies the function
|
|
17690
|
-
* @param {string} text - specifies the string value
|
|
17691
|
-
* @param {T} exeValue - specifies the values to be executed
|
|
17692
|
-
* @param {string} selector - specifies the selector values
|
|
17693
|
-
* @returns {void}
|
|
17694
|
-
* @hidden
|
|
17695
|
-
* @deprecated
|
|
17696
|
-
*/
|
|
17697
|
-
/* eslint-enable */
|
|
17698
|
-
EditorManager.prototype.execCommand = function (command, value, event, callBack, text, exeValue, selector, enterAction) {
|
|
17699
|
-
switch (command.toLowerCase()) {
|
|
17700
|
-
case 'lists':
|
|
17701
|
-
this.observer.notify(LIST_TYPE, { subCommand: value, event: event, callBack: callBack,
|
|
17702
|
-
selector: selector, item: exeValue, enterAction: enterAction });
|
|
17703
|
-
break;
|
|
17704
|
-
case 'formats':
|
|
17705
|
-
this.observer.notify(FORMAT_TYPE, { subCommand: value, event: event, callBack: callBack,
|
|
17706
|
-
selector: selector, exeValue: exeValue, enterAction: enterAction
|
|
17707
|
-
});
|
|
17708
|
-
break;
|
|
17709
|
-
case 'alignments':
|
|
17710
|
-
this.observer.notify(ALIGNMENT_TYPE, {
|
|
17711
|
-
subCommand: value, event: event, callBack: callBack,
|
|
17712
|
-
selector: selector,
|
|
17713
|
-
value: exeValue
|
|
17714
|
-
});
|
|
17715
|
-
break;
|
|
17716
|
-
case 'indents':
|
|
17717
|
-
this.observer.notify(INDENT_TYPE, { subCommand: value, event: event, callBack: callBack, selector: selector });
|
|
17718
|
-
break;
|
|
17719
|
-
case 'links':
|
|
17720
|
-
this.observer.notify(LINK, { command: command, value: value, item: exeValue, event: event, callBack: callBack });
|
|
17721
|
-
break;
|
|
17722
|
-
case 'files':
|
|
17723
|
-
this.observer.notify(IMAGE, {
|
|
17724
|
-
command: command, value: 'Image', item: exeValue, event: event, callBack: callBack, selector: selector
|
|
17725
|
-
});
|
|
17726
|
-
break;
|
|
17727
|
-
case 'images':
|
|
17728
|
-
this.observer.notify(IMAGE, {
|
|
17729
|
-
command: command, value: value, item: exeValue, event: event, callBack: callBack, selector: selector
|
|
17730
|
-
});
|
|
17731
|
-
break;
|
|
17732
|
-
case 'audios':
|
|
17733
|
-
this.observer.notify(AUDIO, {
|
|
17734
|
-
command: command, value: value, item: exeValue, event: event, callBack: callBack, selector: selector
|
|
17735
|
-
});
|
|
17736
|
-
break;
|
|
17737
|
-
case 'videos':
|
|
17738
|
-
this.observer.notify(VIDEO, {
|
|
17739
|
-
command: command, value: value, item: exeValue, event: event, callBack: callBack, selector: selector
|
|
17740
|
-
});
|
|
17741
|
-
break;
|
|
17742
|
-
case 'table':
|
|
17743
|
-
switch (value.toString().toLocaleLowerCase()) {
|
|
17744
|
-
case 'createtable':
|
|
17745
|
-
this.observer.notify(TABLE, { item: exeValue, event: event, callBack: callBack, enterAction: enterAction });
|
|
17746
|
-
break;
|
|
17747
|
-
case 'insertrowbefore':
|
|
17748
|
-
case 'insertrowafter':
|
|
17749
|
-
this.observer.notify(INSERT_ROW, { item: exeValue, event: event, callBack: callBack });
|
|
17750
|
-
break;
|
|
17751
|
-
case 'insertcolumnleft':
|
|
17752
|
-
case 'insertcolumnright':
|
|
17753
|
-
this.observer.notify(INSERT_COLUMN, { item: exeValue, event: event, callBack: callBack });
|
|
17754
|
-
break;
|
|
17755
|
-
case 'deleterow':
|
|
17756
|
-
this.observer.notify(DELETEROW, { item: exeValue, event: event, callBack: callBack });
|
|
17757
|
-
break;
|
|
17758
|
-
case 'deletecolumn':
|
|
17759
|
-
this.observer.notify(DELETECOLUMN, { item: exeValue, event: event, callBack: callBack });
|
|
17760
|
-
break;
|
|
17761
|
-
case 'tableremove':
|
|
17762
|
-
this.observer.notify(REMOVETABLE, { item: exeValue, event: event, callBack: callBack });
|
|
17763
|
-
break;
|
|
17764
|
-
case 'tableheader':
|
|
17765
|
-
this.observer.notify(TABLEHEADER, { item: exeValue, event: event, callBack: callBack });
|
|
17766
|
-
break;
|
|
17767
|
-
case 'aligntop':
|
|
17768
|
-
case 'alignmiddle':
|
|
17769
|
-
case 'alignbottom':
|
|
17770
|
-
this.observer.notify(TABLE_VERTICAL_ALIGN, { item: exeValue, event: event, callBack: callBack });
|
|
17771
|
-
break;
|
|
17772
|
-
case 'merge':
|
|
17773
|
-
this.observer.notify(TABLE_MERGE, { item: exeValue, event: event, callBack: callBack });
|
|
17774
|
-
break;
|
|
17775
|
-
case 'horizontalsplit':
|
|
17776
|
-
this.observer.notify(TABLE_HORIZONTAL_SPLIT, { item: exeValue, event: event, callBack: callBack });
|
|
17777
|
-
break;
|
|
17778
|
-
case 'verticalsplit':
|
|
17779
|
-
this.observer.notify(TABLE_VERTICAL_SPLIT, { item: exeValue, event: event, callBack: callBack });
|
|
17780
|
-
break;
|
|
17781
|
-
}
|
|
17782
|
-
break;
|
|
17783
|
-
case 'font':
|
|
17784
|
-
case 'style':
|
|
17785
|
-
case 'effects':
|
|
17786
|
-
case 'casing':
|
|
17787
|
-
this.observer.notify(SELECTION_TYPE, { subCommand: value, event: event, callBack: callBack, value: text, selector: selector, enterAction: enterAction });
|
|
17788
|
-
break;
|
|
17789
|
-
case 'inserthtml':
|
|
17790
|
-
this.observer.notify(INSERTHTML_TYPE, { subCommand: value, callBack: callBack, value: text });
|
|
17791
|
-
break;
|
|
17792
|
-
case 'inserttext':
|
|
17793
|
-
this.observer.notify(INSERT_TEXT_TYPE, { subCommand: value, callBack: callBack, value: text });
|
|
17794
|
-
break;
|
|
17795
|
-
case 'clear':
|
|
17796
|
-
this.observer.notify(CLEAR_TYPE, { subCommand: value, event: event, callBack: callBack, selector: selector, enterAction: enterAction });
|
|
17797
|
-
break;
|
|
17798
|
-
case 'actions':
|
|
17799
|
-
this.observer.notify(ACTION, { subCommand: value, event: event, callBack: callBack, selector: selector });
|
|
17800
|
-
break;
|
|
17801
|
-
}
|
|
17802
|
-
};
|
|
17803
|
-
return EditorManager;
|
|
17804
|
-
}());
|
|
17805
|
-
|
|
17806
|
-
var __extends$2 = (undefined && undefined.__extends) || (function () {
|
|
17807
|
-
var extendStatics = function (d, b) {
|
|
17808
|
-
extendStatics = Object.setPrototypeOf ||
|
|
17809
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
17810
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
17811
|
-
return extendStatics(d, b);
|
|
17812
|
-
};
|
|
17813
|
-
return function (d, b) {
|
|
17814
|
-
extendStatics(d, b);
|
|
17815
|
-
function __() { this.constructor = d; }
|
|
17816
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
17817
|
-
};
|
|
17818
|
-
})();
|
|
17819
|
-
/**
|
|
17820
|
-
* HTML adapter
|
|
17821
|
-
*
|
|
17822
|
-
* @hidden
|
|
17823
|
-
* @deprecated
|
|
17824
|
-
*/
|
|
17825
|
-
var HTMLFormatter = /** @__PURE__ @class */ (function (_super) {
|
|
17826
|
-
__extends$2(HTMLFormatter, _super);
|
|
17827
|
-
function HTMLFormatter(options) {
|
|
17828
|
-
var _this = _super.call(this) || this;
|
|
17829
|
-
_this.initialize();
|
|
17830
|
-
extend(_this, _this, options, true);
|
|
17831
|
-
if (_this.currentDocument && _this.element) {
|
|
17832
|
-
_this.updateFormatter(_this.element, _this.currentDocument, options.options);
|
|
17833
|
-
}
|
|
17834
|
-
return _this;
|
|
17835
|
-
}
|
|
17836
|
-
HTMLFormatter.prototype.initialize = function () {
|
|
17837
|
-
this.keyConfig = htmlKeyConfig;
|
|
17838
|
-
};
|
|
17839
|
-
/**
|
|
17840
|
-
* Update the formatter of RichTextEditor
|
|
17841
|
-
*
|
|
17842
|
-
* @param {Element} editElement - specifies the edit element.
|
|
17843
|
-
* @param {Document} doc - specifies the doucment
|
|
17844
|
-
* @param {number} options - specifies the options
|
|
17845
|
-
* @returns {void}
|
|
17846
|
-
* @hidden
|
|
17847
|
-
* @deprecated
|
|
17848
|
-
*/
|
|
17849
|
-
HTMLFormatter.prototype.updateFormatter = function (editElement, doc, options) {
|
|
17850
|
-
if (editElement && doc) {
|
|
17851
|
-
this.editorManager = new EditorManager({
|
|
17852
|
-
document: doc,
|
|
17853
|
-
editableElement: editElement,
|
|
17854
|
-
options: options
|
|
17855
|
-
});
|
|
17856
|
-
}
|
|
17857
|
-
};
|
|
17858
|
-
return HTMLFormatter;
|
|
17859
|
-
}(Formatter));
|
|
17860
|
-
|
|
17861
|
-
/**
|
|
17862
|
-
* Update Toolbar Status
|
|
17863
|
-
*
|
|
17864
|
-
* @hidden
|
|
17865
|
-
* @deprecated
|
|
17866
|
-
*/
|
|
17867
|
-
var statusCollection = getDefaultHtmlTbStatus();
|
|
17868
|
-
var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
17869
|
-
function ToolbarStatus() {
|
|
17870
|
-
}
|
|
17871
|
-
/**
|
|
17872
|
-
* get method
|
|
17873
|
-
*
|
|
17874
|
-
* @param {Document} docElement - specifies the document element
|
|
17875
|
-
* @param {Node} targetNode - specifies the target node
|
|
17876
|
-
* @param {string[]} formatNode - specifies the format node
|
|
17877
|
-
* @param {string[]} fontSize - specifies the font size
|
|
17878
|
-
* @param {string[]} fontName - specifies the font name.
|
|
17879
|
-
* @param {Node} documentNode - specifies the document node.
|
|
17880
|
-
* @returns {IToolbarStatus} - returns the toolbar status
|
|
17881
|
-
* @hidden
|
|
17882
|
-
* @deprecated
|
|
17883
|
-
*/
|
|
17884
|
-
ToolbarStatus.get = function (docElement, targetNode, formatNode, fontSize, fontName, documentNode) {
|
|
17885
|
-
var formatCollection = JSON.parse(JSON.stringify(statusCollection));
|
|
17886
|
-
var nodeCollection = JSON.parse(JSON.stringify(statusCollection));
|
|
17887
|
-
var nodeSelection = new NodeSelection();
|
|
17888
|
-
var range = nodeSelection.getRange(docElement);
|
|
17889
|
-
var nodes = documentNode ? [documentNode] : range.collapsed ? nodeSelection.getNodeCollection(range) :
|
|
17890
|
-
nodeSelection.getSelectionNodeCollectionBr(range);
|
|
17891
|
-
var nodesLength = nodes.length;
|
|
17892
|
-
var isNodeChanged = false;
|
|
17893
|
-
for (var index = 0; index < nodes.length; index++) {
|
|
17894
|
-
while (nodes[index].nodeType === 3 && range.startContainer.nodeType === 3 && nodes[index].parentNode &&
|
|
17895
|
-
nodes[index].parentNode.lastElementChild && nodes[index].parentNode.lastElementChild.nodeName !== 'BR' &&
|
|
17896
|
-
(this.getImmediateBlockNode(nodes[index].parentNode)).textContent.replace(/\u200B/g, '').length === 0 &&
|
|
17897
|
-
range.startContainer.textContent.replace(/\u200B/g, '').length === 0 &&
|
|
17898
|
-
nodeSelection.get(docElement).toString().replace(/\u200B/g, '').length === 0) {
|
|
17899
|
-
nodes[index] = nodes[index].parentNode.lastElementChild.firstChild;
|
|
17900
|
-
isNodeChanged = true;
|
|
17901
|
-
}
|
|
17902
|
-
if (isNodeChanged && nodes[index]) {
|
|
17903
|
-
nodeSelection.setCursorPoint(docElement, nodes[index], nodes[index].textContent.length);
|
|
17904
|
-
isNodeChanged = false;
|
|
17905
|
-
}
|
|
17906
|
-
if ((nodes[index].nodeName !== 'BR' && nodes[index].nodeType !== 3) ||
|
|
17907
|
-
(nodesLength > 1 && nodes[index].nodeType === 3 && nodes[index].textContent.trim() === '')) {
|
|
17908
|
-
nodes.splice(index, 1);
|
|
17909
|
-
index--;
|
|
17910
|
-
}
|
|
17911
|
-
}
|
|
17912
|
-
for (var index = 0; index < nodes.length; index++) {
|
|
17913
|
-
// eslint-disable-next-line max-len
|
|
17914
|
-
formatCollection = this.getFormatParent(docElement, formatCollection, nodes[index], targetNode, formatNode, fontSize, fontName);
|
|
17915
|
-
if ((index === 0 && formatCollection.bold) || !formatCollection.bold) {
|
|
17916
|
-
nodeCollection.bold = formatCollection.bold;
|
|
17917
|
-
}
|
|
17918
|
-
if ((index === 0 && formatCollection.insertcode) || !formatCollection.insertcode) {
|
|
17919
|
-
nodeCollection.insertcode = formatCollection.insertcode;
|
|
17920
|
-
}
|
|
17921
|
-
if ((index === 0 && formatCollection.italic) || !formatCollection.italic) {
|
|
17922
|
-
nodeCollection.italic = formatCollection.italic;
|
|
17923
|
-
}
|
|
17924
|
-
if ((index === 0 && formatCollection.underline) || !formatCollection.underline) {
|
|
17925
|
-
nodeCollection.underline = formatCollection.underline;
|
|
17926
|
-
}
|
|
17927
|
-
if ((index === 0 && formatCollection.strikethrough) || !formatCollection.strikethrough) {
|
|
17928
|
-
nodeCollection.strikethrough = formatCollection.strikethrough;
|
|
17929
|
-
}
|
|
17930
|
-
if ((index === 0 && formatCollection.superscript) || !formatCollection.superscript) {
|
|
17931
|
-
nodeCollection.superscript = formatCollection.superscript;
|
|
17932
|
-
}
|
|
17933
|
-
if ((index === 0 && formatCollection.subscript) || !formatCollection.subscript) {
|
|
17934
|
-
nodeCollection.subscript = formatCollection.subscript;
|
|
17935
|
-
}
|
|
17936
|
-
if ((index === 0 && formatCollection.fontcolor) || !formatCollection.fontcolor) {
|
|
17937
|
-
nodeCollection.fontcolor = formatCollection.fontcolor;
|
|
17938
|
-
}
|
|
17939
|
-
if ((index === 0 && formatCollection.fontname) || !formatCollection.fontname) {
|
|
17940
|
-
nodeCollection.fontname = formatCollection.fontname;
|
|
17941
|
-
}
|
|
17942
|
-
if ((index === 0 && formatCollection.fontsize) || !formatCollection.fontsize) {
|
|
17943
|
-
nodeCollection.fontsize = formatCollection.fontsize;
|
|
17944
|
-
}
|
|
17945
|
-
if ((index === 0 && formatCollection.backgroundcolor) || !formatCollection.backgroundcolor) {
|
|
17946
|
-
nodeCollection.backgroundcolor = formatCollection.backgroundcolor;
|
|
17947
|
-
}
|
|
17948
|
-
if ((index === 0 && formatCollection.orderedlist) || !formatCollection.orderedlist) {
|
|
17949
|
-
nodeCollection.orderedlist = formatCollection.orderedlist;
|
|
17950
|
-
}
|
|
17951
|
-
if ((index === 0 && formatCollection.unorderedlist) || !formatCollection.unorderedlist) {
|
|
17952
|
-
nodeCollection.unorderedlist = formatCollection.unorderedlist;
|
|
17953
|
-
}
|
|
17954
|
-
if ((index === 0 && formatCollection.alignments) || !formatCollection.alignments) {
|
|
17955
|
-
nodeCollection.alignments = formatCollection.alignments;
|
|
17956
|
-
}
|
|
17957
|
-
if ((index === 0 && formatCollection.formats) || !formatCollection.formats) {
|
|
17958
|
-
nodeCollection.formats = formatCollection.formats;
|
|
17959
|
-
}
|
|
17960
|
-
if ((index === 0 && formatCollection.createlink) || !formatCollection.createlink) {
|
|
17961
|
-
nodeCollection.createlink = formatCollection.createlink;
|
|
17962
|
-
}
|
|
17963
|
-
if ((index === 0 && formatCollection.numberFormatList) || !formatCollection.numberFormatList) {
|
|
17964
|
-
nodeCollection.numberFormatList = formatCollection.numberFormatList;
|
|
17965
|
-
}
|
|
17966
|
-
if ((index === 0 && formatCollection.bulletFormatList) || !formatCollection.bulletFormatList) {
|
|
17967
|
-
nodeCollection.bulletFormatList = formatCollection.bulletFormatList;
|
|
17968
|
-
}
|
|
17969
|
-
formatCollection = JSON.parse(JSON.stringify(statusCollection));
|
|
17970
|
-
}
|
|
17971
|
-
return nodeCollection;
|
|
17972
|
-
};
|
|
17973
|
-
ToolbarStatus.getImmediateBlockNode = function (node) {
|
|
17974
|
-
do {
|
|
17975
|
-
node = node.parentNode;
|
|
17976
|
-
} while (node && BLOCK_TAGS.indexOf(node.nodeName.toLocaleLowerCase()) < 0);
|
|
17977
|
-
return node;
|
|
17978
|
-
};
|
|
17979
|
-
ToolbarStatus.getFormatParent = function (docElement, formatCollection, node, targetNode, formatNode, fontSize, fontName) {
|
|
17980
|
-
if (targetNode.contains(node) ||
|
|
17981
|
-
(node.nodeType === 3 && targetNode.nodeType !== 3 && targetNode.contains(node.parentNode))) {
|
|
17982
|
-
do {
|
|
17983
|
-
formatCollection = this.isFormattedNode(docElement, formatCollection, node, formatNode, fontSize, fontName);
|
|
17984
|
-
node = node.parentNode;
|
|
17985
|
-
} while (node && (node !== targetNode));
|
|
17986
|
-
}
|
|
17987
|
-
return formatCollection;
|
|
17997
|
+
ToolbarStatus.getFormatParent = function (docElement, formatCollection, node, targetNode, formatNode, fontSize, fontName) {
|
|
17998
|
+
if (targetNode.contains(node) ||
|
|
17999
|
+
(node.nodeType === 3 && targetNode.nodeType !== 3 && targetNode.contains(node.parentNode))) {
|
|
18000
|
+
do {
|
|
18001
|
+
formatCollection = this.isFormattedNode(docElement, formatCollection, node, formatNode, fontSize, fontName);
|
|
18002
|
+
node = node.parentNode;
|
|
18003
|
+
} while (node && (node !== targetNode));
|
|
18004
|
+
}
|
|
18005
|
+
return formatCollection;
|
|
17988
18006
|
};
|
|
17989
18007
|
ToolbarStatus.isFormattedNode = function (docElement, formatCollection, node, formatNode, fontSize, fontName) {
|
|
17990
18008
|
if (!formatCollection.bold) {
|
|
@@ -18116,93 +18134,814 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
18116
18134
|
return false;
|
|
18117
18135
|
}
|
|
18118
18136
|
};
|
|
18119
|
-
ToolbarStatus.isUnorderedList = function (node) {
|
|
18120
|
-
if (node.nodeName.toLocaleLowerCase() === 'ul') {
|
|
18121
|
-
return true;
|
|
18137
|
+
ToolbarStatus.isUnorderedList = function (node) {
|
|
18138
|
+
if (node.nodeName.toLocaleLowerCase() === 'ul') {
|
|
18139
|
+
return true;
|
|
18140
|
+
}
|
|
18141
|
+
else {
|
|
18142
|
+
return false;
|
|
18143
|
+
}
|
|
18144
|
+
};
|
|
18145
|
+
ToolbarStatus.isAlignment = function (node) {
|
|
18146
|
+
var align = node.style && node.style.textAlign;
|
|
18147
|
+
if (align === 'left') {
|
|
18148
|
+
return 'justifyleft';
|
|
18149
|
+
}
|
|
18150
|
+
else if (align === 'center') {
|
|
18151
|
+
return 'justifycenter';
|
|
18152
|
+
}
|
|
18153
|
+
else if (align === 'right') {
|
|
18154
|
+
return 'justifyright';
|
|
18155
|
+
}
|
|
18156
|
+
else if (align === 'justify') {
|
|
18157
|
+
return 'justifyfull';
|
|
18158
|
+
}
|
|
18159
|
+
else {
|
|
18160
|
+
return null;
|
|
18161
|
+
}
|
|
18162
|
+
};
|
|
18163
|
+
ToolbarStatus.isFormats = function (node, formatNode) {
|
|
18164
|
+
if (((formatNode === undefined || formatNode === null)
|
|
18165
|
+
&& BLOCK_TAGS.indexOf(node.nodeName.toLocaleLowerCase()) > -1)
|
|
18166
|
+
|| (formatNode !== null && formatNode !== undefined
|
|
18167
|
+
&& formatNode.indexOf(node.nodeName.toLocaleLowerCase()) > -1)) {
|
|
18168
|
+
return node.nodeName.toLocaleLowerCase();
|
|
18169
|
+
}
|
|
18170
|
+
else {
|
|
18171
|
+
return null;
|
|
18172
|
+
}
|
|
18173
|
+
};
|
|
18174
|
+
ToolbarStatus.getComputedStyle = function (docElement, node, prop) {
|
|
18175
|
+
return docElement.defaultView.getComputedStyle(node, null).getPropertyValue(prop);
|
|
18176
|
+
};
|
|
18177
|
+
ToolbarStatus.isNumberFormatList = function (node) {
|
|
18178
|
+
var list = node.style && node.style.listStyleType;
|
|
18179
|
+
if (list === 'lower-alpha') {
|
|
18180
|
+
return 'Lower Alpha';
|
|
18181
|
+
}
|
|
18182
|
+
else if (list === 'number') {
|
|
18183
|
+
return 'Number';
|
|
18184
|
+
}
|
|
18185
|
+
else if (list === 'upper-alpha') {
|
|
18186
|
+
return 'Upper Alpha';
|
|
18187
|
+
}
|
|
18188
|
+
else if (list === 'lower-roman') {
|
|
18189
|
+
return 'Lower Roman';
|
|
18190
|
+
}
|
|
18191
|
+
else if (list === 'upper-roman') {
|
|
18192
|
+
return 'Upper Roman';
|
|
18193
|
+
}
|
|
18194
|
+
else if (list === 'lower-greek') {
|
|
18195
|
+
return 'Lower Greek';
|
|
18196
|
+
}
|
|
18197
|
+
else if (list === 'none') {
|
|
18198
|
+
return 'None';
|
|
18199
|
+
}
|
|
18200
|
+
else {
|
|
18201
|
+
return null;
|
|
18202
|
+
}
|
|
18203
|
+
};
|
|
18204
|
+
ToolbarStatus.isBulletFormatList = function (node) {
|
|
18205
|
+
var list = node.style && node.style.listStyleType;
|
|
18206
|
+
if (list === 'circle') {
|
|
18207
|
+
return 'Circle';
|
|
18208
|
+
}
|
|
18209
|
+
else if (list === 'square') {
|
|
18210
|
+
return 'Square';
|
|
18211
|
+
}
|
|
18212
|
+
else if (list === 'none') {
|
|
18213
|
+
return 'None';
|
|
18214
|
+
}
|
|
18215
|
+
else if (list === 'disc') {
|
|
18216
|
+
return 'Disc';
|
|
18217
|
+
}
|
|
18218
|
+
else {
|
|
18219
|
+
return null;
|
|
18220
|
+
}
|
|
18221
|
+
};
|
|
18222
|
+
return ToolbarStatus;
|
|
18223
|
+
}());
|
|
18224
|
+
|
|
18225
|
+
/**
|
|
18226
|
+
* Base export
|
|
18227
|
+
*/
|
|
18228
|
+
|
|
18229
|
+
var FormatPainterActions = /** @__PURE__ @class */ (function () {
|
|
18230
|
+
function FormatPainterActions(parent, options) {
|
|
18231
|
+
this.parent = parent;
|
|
18232
|
+
this.settings = options;
|
|
18233
|
+
this.addEventListener();
|
|
18234
|
+
this.setDeniedFormats();
|
|
18235
|
+
}
|
|
18236
|
+
FormatPainterActions.prototype.addEventListener = function () {
|
|
18237
|
+
this.parent.observer.on(FORMAT_PAINTER_ACTIONS, this.actionHandler, this);
|
|
18238
|
+
};
|
|
18239
|
+
FormatPainterActions.prototype.actionHandler = function (args) {
|
|
18240
|
+
if (!isNullOrUndefined(args) && !isNullOrUndefined(args.item) && !isNullOrUndefined(args.item.formatPainterAction)) {
|
|
18241
|
+
switch (args.item.formatPainterAction) {
|
|
18242
|
+
case 'format-copy':
|
|
18243
|
+
this.copyAction();
|
|
18244
|
+
break;
|
|
18245
|
+
case 'format-paste':
|
|
18246
|
+
this.pasteAction();
|
|
18247
|
+
break;
|
|
18248
|
+
case 'escape':
|
|
18249
|
+
this.escapeAction();
|
|
18250
|
+
break;
|
|
18251
|
+
}
|
|
18252
|
+
}
|
|
18253
|
+
};
|
|
18254
|
+
FormatPainterActions.prototype.generateElement = function () {
|
|
18255
|
+
var copyCollection = this.copyCollection.slice(); // To clone without reversing the collcection array
|
|
18256
|
+
copyCollection.reverse();
|
|
18257
|
+
var length = copyCollection.length;
|
|
18258
|
+
var elemCollection = createElement('div', { className: 'e-format-paste-wrapper' });
|
|
18259
|
+
var lastAppendChild;
|
|
18260
|
+
for (var i = 0; i < length; i++) {
|
|
18261
|
+
var _a = copyCollection[i], attrs = _a.attrs, className = _a.className, styles = _a.styles, tagName = _a.tagName;
|
|
18262
|
+
var elem = createElement(tagName);
|
|
18263
|
+
if (className !== '') {
|
|
18264
|
+
elem.className = className;
|
|
18265
|
+
}
|
|
18266
|
+
for (var i_1 = 0; i_1 < attrs.length; i_1++) {
|
|
18267
|
+
var property = attrs[i_1].name;
|
|
18268
|
+
var value = attrs[i_1].value;
|
|
18269
|
+
elem.setAttribute(property, value);
|
|
18270
|
+
}
|
|
18271
|
+
for (var i_2 = 0; i_2 < styles.length; i_2++) {
|
|
18272
|
+
var property = styles[i_2].property;
|
|
18273
|
+
var value = styles[i_2].value;
|
|
18274
|
+
var priority = styles[i_2].priority;
|
|
18275
|
+
elem.style.setProperty(property, value, priority);
|
|
18276
|
+
}
|
|
18277
|
+
if (elemCollection.childElementCount === 0) {
|
|
18278
|
+
elemCollection.append(elem);
|
|
18279
|
+
lastAppendChild = elem;
|
|
18280
|
+
}
|
|
18281
|
+
else {
|
|
18282
|
+
lastAppendChild.append(elem);
|
|
18283
|
+
lastAppendChild = elem;
|
|
18284
|
+
}
|
|
18285
|
+
}
|
|
18286
|
+
var elemChild = this.removeDeniedFormats(elemCollection);
|
|
18287
|
+
var currentElem = elemChild;
|
|
18288
|
+
while (currentElem) {
|
|
18289
|
+
if (currentElem.firstChild === null) {
|
|
18290
|
+
lastAppendChild = currentElem;
|
|
18291
|
+
currentElem = undefined;
|
|
18292
|
+
}
|
|
18293
|
+
else {
|
|
18294
|
+
currentElem = currentElem.firstChild;
|
|
18295
|
+
}
|
|
18296
|
+
}
|
|
18297
|
+
this.newElem = elemChild;
|
|
18298
|
+
this.newElemLastChild = lastAppendChild;
|
|
18299
|
+
};
|
|
18300
|
+
FormatPainterActions.prototype.pasteAction = function () {
|
|
18301
|
+
if (isNullOrUndefined(this.copyCollection) || this.copyCollection.length === 0) {
|
|
18302
|
+
this.paintPlainTextFormat();
|
|
18303
|
+
return;
|
|
18304
|
+
}
|
|
18305
|
+
this.insertFormatNode(this.newElem, this.newElemLastChild);
|
|
18306
|
+
this.parent.undoRedoManager.saveData();
|
|
18307
|
+
};
|
|
18308
|
+
FormatPainterActions.prototype.removeDeniedFormats = function (parentElement) {
|
|
18309
|
+
if (!isNullOrUndefined(this.deniedFormatsCollection) && this.deniedFormatsCollection.length > 0) {
|
|
18310
|
+
var deniedPropArray = this.deniedFormatsCollection;
|
|
18311
|
+
var length_1 = deniedPropArray.length;
|
|
18312
|
+
for (var i = 0; i < length_1; i++) {
|
|
18313
|
+
var tag = deniedPropArray[i].tag;
|
|
18314
|
+
if (deniedPropArray[i].tag) {
|
|
18315
|
+
var elementsList = parentElement.querySelectorAll(tag);
|
|
18316
|
+
for (var j = 0; j < elementsList.length; j++) {
|
|
18317
|
+
if (deniedPropArray[i].classes.length > 0) {
|
|
18318
|
+
var classes = deniedPropArray[i].classes;
|
|
18319
|
+
var classLength = classes.length;
|
|
18320
|
+
for (var k = 0; k < classLength; k++) {
|
|
18321
|
+
if (elementsList[j].classList.contains(classes[k])) {
|
|
18322
|
+
removeClass([elementsList[j]], classes[k]);
|
|
18323
|
+
}
|
|
18324
|
+
}
|
|
18325
|
+
if (elementsList[j].classList.length === 0) {
|
|
18326
|
+
elementsList[j].removeAttribute('class');
|
|
18327
|
+
}
|
|
18328
|
+
}
|
|
18329
|
+
if (deniedPropArray[i].styles.length > 0) {
|
|
18330
|
+
var styles = deniedPropArray[i].styles;
|
|
18331
|
+
var styleLength = styles.length;
|
|
18332
|
+
for (var k = 0; k < styleLength; k++) {
|
|
18333
|
+
elementsList[j].style.removeProperty(styles[k]);
|
|
18334
|
+
}
|
|
18335
|
+
if (elementsList[j].style.length === 0) {
|
|
18336
|
+
elementsList[j].removeAttribute('style');
|
|
18337
|
+
}
|
|
18338
|
+
}
|
|
18339
|
+
if (deniedPropArray[i].attributes.length > 0) {
|
|
18340
|
+
var attributes$$1 = deniedPropArray[i].attributes;
|
|
18341
|
+
var attributeLength = attributes$$1.length;
|
|
18342
|
+
for (var k = 0; k < attributeLength; k++) {
|
|
18343
|
+
elementsList[j].removeAttribute(attributes$$1[k]);
|
|
18344
|
+
}
|
|
18345
|
+
}
|
|
18346
|
+
}
|
|
18347
|
+
}
|
|
18348
|
+
}
|
|
18349
|
+
}
|
|
18350
|
+
return parentElement.firstElementChild;
|
|
18351
|
+
};
|
|
18352
|
+
FormatPainterActions.prototype.copyAction = function () {
|
|
18353
|
+
var copyCollection = [];
|
|
18354
|
+
var range = this.parent.nodeSelection.getRange(document);
|
|
18355
|
+
var parentElem = range.startContainer.parentElement;
|
|
18356
|
+
var currentContext = this.findCurrentContext(parentElem);
|
|
18357
|
+
var allowedRulesArray = this.settings.allowedFormats.split(';');
|
|
18358
|
+
for (var i = 0; i < allowedRulesArray.length; i++) {
|
|
18359
|
+
allowedRulesArray[i] = allowedRulesArray[i].trim();
|
|
18360
|
+
}
|
|
18361
|
+
var _a = this.getRangeParentElem(currentContext, range), rangeParentElem = _a[0], context = _a[1];
|
|
18362
|
+
if (currentContext === null) {
|
|
18363
|
+
currentContext = context;
|
|
18364
|
+
}
|
|
18365
|
+
if (!isNullOrUndefined(currentContext) && this.settings.allowedContext.indexOf(currentContext) > -1) {
|
|
18366
|
+
if (range.startContainer.nodeName === '#text') {
|
|
18367
|
+
parentElem = range.startContainer.parentElement;
|
|
18368
|
+
}
|
|
18369
|
+
var lastElement = parentElem;
|
|
18370
|
+
do {
|
|
18371
|
+
if (allowedRulesArray.indexOf(parentElem.nodeName.toLowerCase()) > -1) {
|
|
18372
|
+
var allAttributes = parentElem.attributes;
|
|
18373
|
+
var attribute = [];
|
|
18374
|
+
for (var i = 0; i < allAttributes.length; i++) {
|
|
18375
|
+
if (allAttributes[i].name !== 'class' && allAttributes[i].name !== 'style') {
|
|
18376
|
+
attribute.push(allAttributes[i]);
|
|
18377
|
+
}
|
|
18378
|
+
}
|
|
18379
|
+
var classes = parentElem.className;
|
|
18380
|
+
var allStyles = parentElem.style;
|
|
18381
|
+
var styleProp = [];
|
|
18382
|
+
for (var i = 0; i < allStyles.length; i++) {
|
|
18383
|
+
var property = allStyles[i];
|
|
18384
|
+
var value = allStyles.getPropertyValue(property);
|
|
18385
|
+
var priority = allStyles.getPropertyPriority(property);
|
|
18386
|
+
styleProp.push({ property: property, value: value, priority: priority });
|
|
18387
|
+
}
|
|
18388
|
+
copyCollection.push({
|
|
18389
|
+
attrs: attribute, className: classes, styles: styleProp, tagName: parentElem.nodeName
|
|
18390
|
+
});
|
|
18391
|
+
}
|
|
18392
|
+
if (rangeParentElem === parentElem) {
|
|
18393
|
+
parentElem = undefined;
|
|
18394
|
+
}
|
|
18395
|
+
else if (!isNullOrUndefined(parentElem.parentElement)) {
|
|
18396
|
+
parentElem = parentElem.parentElement;
|
|
18397
|
+
}
|
|
18398
|
+
if (lastElement === parentElem) {
|
|
18399
|
+
break;
|
|
18400
|
+
}
|
|
18401
|
+
} while (!isNullOrUndefined(parentElem) || parentElem === this.parent.editableElement);
|
|
18402
|
+
this.copyCollection = copyCollection;
|
|
18403
|
+
}
|
|
18404
|
+
this.generateElement();
|
|
18405
|
+
};
|
|
18406
|
+
FormatPainterActions.prototype.getRangeParentElem = function (currentContext, range) {
|
|
18407
|
+
var startContainer = range.startContainer;
|
|
18408
|
+
var rangeParentELem;
|
|
18409
|
+
if (startContainer.nodeType === 3) {
|
|
18410
|
+
startContainer = startContainer.parentElement;
|
|
18411
|
+
}
|
|
18412
|
+
switch (currentContext) {
|
|
18413
|
+
case 'Table':
|
|
18414
|
+
rangeParentELem = closest(startContainer, 'td');
|
|
18415
|
+
if (isNullOrUndefined(rangeParentELem)) {
|
|
18416
|
+
rangeParentELem = closest(startContainer, 'th');
|
|
18417
|
+
}
|
|
18418
|
+
break;
|
|
18419
|
+
case 'List':
|
|
18420
|
+
rangeParentELem = closest(startContainer, 'li');
|
|
18421
|
+
break;
|
|
18422
|
+
case 'Text':
|
|
18423
|
+
rangeParentELem = closest(startContainer, 'p');
|
|
18424
|
+
break;
|
|
18425
|
+
}
|
|
18426
|
+
if (isNullOrUndefined(rangeParentELem)) {
|
|
18427
|
+
var nearBlockParentName = this.getNearestBlockParentElement(range);
|
|
18428
|
+
if (!isNullOrUndefined(nearBlockParentName) && nearBlockParentName !== 'UL' &&
|
|
18429
|
+
nearBlockParentName !== 'OL' && nearBlockParentName !== 'LI') {
|
|
18430
|
+
rangeParentELem = closest(startContainer, nearBlockParentName);
|
|
18431
|
+
currentContext = 'Text';
|
|
18432
|
+
}
|
|
18433
|
+
}
|
|
18434
|
+
if (currentContext === 'List') {
|
|
18435
|
+
rangeParentELem = rangeParentELem.parentElement;
|
|
18436
|
+
}
|
|
18437
|
+
return [rangeParentELem, currentContext];
|
|
18438
|
+
};
|
|
18439
|
+
FormatPainterActions.prototype.getNearestBlockParentElement = function (range) {
|
|
18440
|
+
var node = range.commonAncestorContainer;
|
|
18441
|
+
if (node.nodeType === 3) {
|
|
18442
|
+
node = node.parentNode;
|
|
18443
|
+
}
|
|
18444
|
+
// iterate untill the content editable div
|
|
18445
|
+
while (node && node !== this.parent.editableElement) {
|
|
18446
|
+
// If true return the block node name.
|
|
18447
|
+
if (!isNullOrUndefined(node) && this.isBlockElement(node)) {
|
|
18448
|
+
return node.nodeName;
|
|
18449
|
+
}
|
|
18450
|
+
// if false re assign node to parent node
|
|
18451
|
+
node = node.parentNode;
|
|
18452
|
+
}
|
|
18453
|
+
return null;
|
|
18454
|
+
};
|
|
18455
|
+
FormatPainterActions.prototype.isBlockElement = function (node) {
|
|
18456
|
+
var blockTags = ['P', 'DIV', 'UL', 'OL', 'LI', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6',
|
|
18457
|
+
'ADDRESS', 'ARTICLE', 'ASIDE', 'BLOCKQUOTE', 'FIGCAPTION', 'FIGURE', 'FOOTER', 'HEADER',
|
|
18458
|
+
'HR', 'MAIN', 'NAV', 'SECTION', 'SUMMARY', 'PRE'];
|
|
18459
|
+
return blockTags.indexOf(node.nodeName) > -1;
|
|
18460
|
+
};
|
|
18461
|
+
FormatPainterActions.prototype.escapeAction = function () {
|
|
18462
|
+
this.copyCollection = [];
|
|
18463
|
+
};
|
|
18464
|
+
FormatPainterActions.prototype.paintPlainTextFormat = function () {
|
|
18465
|
+
var range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
|
|
18466
|
+
var domSelection = this.parent.nodeSelection;
|
|
18467
|
+
var nodes = range.collapsed ? domSelection.getSelectionNodeCollection(range) :
|
|
18468
|
+
domSelection.getSelectionNodeCollectionBr(range);
|
|
18469
|
+
var isInValid;
|
|
18470
|
+
if (nodes.length > 1) {
|
|
18471
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
18472
|
+
isInValid = this.validateELementTag(nodes[i]);
|
|
18473
|
+
}
|
|
18474
|
+
}
|
|
18475
|
+
else {
|
|
18476
|
+
isInValid = this.validateELementTag(range.startContainer) && this.validateELementTag(range.endContainer);
|
|
18477
|
+
}
|
|
18478
|
+
if (!isInValid) {
|
|
18479
|
+
this.parent.execCommand('Clear', 'ClearFormat', null, null);
|
|
18480
|
+
}
|
|
18481
|
+
};
|
|
18482
|
+
FormatPainterActions.prototype.validateELementTag = function (node) {
|
|
18483
|
+
var INVALID_TAGS = ['A', 'AUDIO', 'IMG', 'VIDEO', 'IFRAME'];
|
|
18484
|
+
if (node.nodeType === 3) {
|
|
18485
|
+
node = node.parentElement;
|
|
18486
|
+
}
|
|
18487
|
+
return INVALID_TAGS.indexOf(node.tagName) > -1;
|
|
18488
|
+
};
|
|
18489
|
+
FormatPainterActions.prototype.findCurrentContext = function (parentElem) {
|
|
18490
|
+
if (closest(parentElem, 'td') || closest(parentElem, 'tr') || closest(parentElem, 'tbody')) {
|
|
18491
|
+
return 'Table';
|
|
18492
|
+
}
|
|
18493
|
+
else if (closest(parentElem, 'li')) {
|
|
18494
|
+
return 'List';
|
|
18495
|
+
}
|
|
18496
|
+
else if (closest(parentElem, 'p')) {
|
|
18497
|
+
return 'Text';
|
|
18498
|
+
}
|
|
18499
|
+
return null;
|
|
18500
|
+
};
|
|
18501
|
+
FormatPainterActions.prototype.insertFormatNode = function (elem, lastChild) {
|
|
18502
|
+
var endNode = this.parent.editableElement;
|
|
18503
|
+
var docElement = this.parent.currentDocument;
|
|
18504
|
+
var domSelection = this.parent.nodeSelection;
|
|
18505
|
+
var clonedElem = elem.cloneNode(true);
|
|
18506
|
+
var childElem = clonedElem.firstChild;
|
|
18507
|
+
var inlineElement;
|
|
18508
|
+
while (childElem) {
|
|
18509
|
+
if (this.isBlockElement(childElem)) {
|
|
18510
|
+
childElem = childElem.firstChild;
|
|
18511
|
+
}
|
|
18512
|
+
else {
|
|
18513
|
+
inlineElement = childElem.parentNode.removeChild(childElem);
|
|
18514
|
+
break;
|
|
18515
|
+
}
|
|
18122
18516
|
}
|
|
18123
|
-
|
|
18124
|
-
|
|
18517
|
+
var formatValues = {
|
|
18518
|
+
element: inlineElement,
|
|
18519
|
+
lastChild: lastChild
|
|
18520
|
+
};
|
|
18521
|
+
SelectionCommands.applyFormat(docElement, null, endNode, 'P', 'formatPainter', null, formatValues);
|
|
18522
|
+
var isFullNodeSelected;
|
|
18523
|
+
var range = this.parent.nodeSelection.getRange(docElement);
|
|
18524
|
+
var isCollapsed = range.collapsed;
|
|
18525
|
+
var nodes = range.collapsed ? domSelection.getSelectionNodeCollection(range) :
|
|
18526
|
+
domSelection.getSelectionNodeCollectionBr(range);
|
|
18527
|
+
if (nodes.length === 1) {
|
|
18528
|
+
while (!this.isBlockElement(nodes[0])) {
|
|
18529
|
+
nodes[0] = nodes[0].parentElement;
|
|
18530
|
+
}
|
|
18531
|
+
isFullNodeSelected = nodes[0].textContent.trim() === range.commonAncestorContainer.wholeText.trim();
|
|
18125
18532
|
}
|
|
18126
|
-
|
|
18127
|
-
|
|
18128
|
-
var align = node.style && node.style.textAlign;
|
|
18129
|
-
if (align === 'left') {
|
|
18130
|
-
return 'justifyleft';
|
|
18533
|
+
if (this.isBlockElement(elem) && isCollapsed || nodes.length > 1 || isFullNodeSelected) {
|
|
18534
|
+
this.insertBlockNode(elem, range, docElement, endNode, nodes);
|
|
18131
18535
|
}
|
|
18132
|
-
|
|
18133
|
-
|
|
18536
|
+
};
|
|
18537
|
+
FormatPainterActions.prototype.insertBlockNode = function (element, range, docElement, endNode, nodes) {
|
|
18538
|
+
var domSelection = this.parent.nodeSelection;
|
|
18539
|
+
var listElement; // To clone to multiple list elements
|
|
18540
|
+
var cloneListParentNode;
|
|
18541
|
+
if (element.nodeName === 'UL' || element.nodeName === 'OL') {
|
|
18542
|
+
cloneListParentNode = element.cloneNode(true);
|
|
18543
|
+
listElement = cloneListParentNode.firstChild;
|
|
18134
18544
|
}
|
|
18135
|
-
|
|
18136
|
-
|
|
18545
|
+
var textNode = range.startContainer; // To set cursor position
|
|
18546
|
+
for (var index = 0; index < nodes.length; index++) {
|
|
18547
|
+
var lastTextNode = nodes[index];
|
|
18548
|
+
if (nodes[index].nodeType === 3) {
|
|
18549
|
+
nodes[index] = nodes[index].parentElement;
|
|
18550
|
+
}
|
|
18551
|
+
while (!this.isBlockElement(nodes[index])) {
|
|
18552
|
+
nodes[index] = nodes[index].parentElement;
|
|
18553
|
+
}
|
|
18554
|
+
var cloneParentNode = void 0;
|
|
18555
|
+
if (!isNullOrUndefined(cloneListParentNode)) {
|
|
18556
|
+
cloneParentNode = listElement.cloneNode(true);
|
|
18557
|
+
}
|
|
18558
|
+
else {
|
|
18559
|
+
cloneParentNode = element.cloneNode(true);
|
|
18560
|
+
}
|
|
18561
|
+
// Appending all the child elements
|
|
18562
|
+
while (nodes[index].firstChild) {
|
|
18563
|
+
if (cloneParentNode.nodeName === 'LI') {
|
|
18564
|
+
cloneParentNode.appendChild(nodes[index].firstChild);
|
|
18565
|
+
}
|
|
18566
|
+
else {
|
|
18567
|
+
// Except list nodes other block nodes replaced here
|
|
18568
|
+
if (nodes[index].nodeType === 3) {
|
|
18569
|
+
cloneParentNode.appendChild(nodes[index].firstChild);
|
|
18570
|
+
}
|
|
18571
|
+
else {
|
|
18572
|
+
cloneParentNode.innerHTML = nodes[index].innerHTML;
|
|
18573
|
+
nodes[index].innerHTML = '';
|
|
18574
|
+
}
|
|
18575
|
+
nodes[index] = nodes[index].parentNode.replaceChild(cloneParentNode, nodes[index]);
|
|
18576
|
+
}
|
|
18577
|
+
}
|
|
18578
|
+
if (cloneParentNode.nodeName === 'LI') {
|
|
18579
|
+
// Appending the li nodes to the ol or ul node
|
|
18580
|
+
cloneListParentNode.append(cloneParentNode);
|
|
18581
|
+
if (index === 0) {
|
|
18582
|
+
var nodeName = nodes[index].nodeName;
|
|
18583
|
+
nodes[index] = nodes[index].parentNode.replaceChild(cloneListParentNode, nodes[index]);
|
|
18584
|
+
var parent_1 = nodeName === 'LI' ? cloneListParentNode.parentElement
|
|
18585
|
+
: cloneListParentNode;
|
|
18586
|
+
// Splicing and then inserting the node to previous element sibling of the Listparent.parent
|
|
18587
|
+
this.parent.nodeCutter.SplitNode(range, parent_1, true);
|
|
18588
|
+
if (!isNullOrUndefined(parent_1.previousElementSibling)) {
|
|
18589
|
+
parent_1.parentNode.insertBefore(cloneListParentNode, parent_1.nextElementSibling);
|
|
18590
|
+
}
|
|
18591
|
+
else {
|
|
18592
|
+
parent_1.parentElement.insertBefore(cloneListParentNode, parent_1);
|
|
18593
|
+
}
|
|
18594
|
+
}
|
|
18595
|
+
detach(nodes[index]);
|
|
18596
|
+
}
|
|
18597
|
+
/**Removing the inserted block node in list and appending to previous element sibling */
|
|
18598
|
+
if (cloneParentNode.nodeName !== 'LI' && (cloneParentNode.parentElement.nodeName === 'OL' ||
|
|
18599
|
+
cloneParentNode.parentElement.nodeName === 'UL')) {
|
|
18600
|
+
var parent_2 = cloneParentNode.parentElement;
|
|
18601
|
+
// Cutting single ul or ol to two ul or ol based on the range
|
|
18602
|
+
this.parent.nodeCutter.SplitNode(range, parent_2, true);
|
|
18603
|
+
if (!isNullOrUndefined(parent_2.previousElementSibling)) {
|
|
18604
|
+
parent_2.previousElementSibling.after(cloneParentNode);
|
|
18605
|
+
}
|
|
18606
|
+
else {
|
|
18607
|
+
parent_2.parentElement.prepend(cloneParentNode);
|
|
18608
|
+
}
|
|
18609
|
+
}
|
|
18610
|
+
nodes[index] = lastTextNode;
|
|
18137
18611
|
}
|
|
18138
|
-
|
|
18139
|
-
|
|
18612
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
18613
|
+
!isNullOrUndefined(listElement) ? detach(listElement) : false;
|
|
18614
|
+
this.cleanEmptyLists();
|
|
18615
|
+
if (nodes.length > 1) {
|
|
18616
|
+
var startSelectNode = nodes[0];
|
|
18617
|
+
var endSelectNode = nodes[nodes.length - 1];
|
|
18618
|
+
domSelection.setSelectionText(docElement, startSelectNode, endSelectNode, 0, endSelectNode.textContent.length);
|
|
18140
18619
|
}
|
|
18141
18620
|
else {
|
|
18142
|
-
|
|
18621
|
+
domSelection.setCursorPoint(docElement, textNode, textNode.textContent.length);
|
|
18143
18622
|
}
|
|
18144
18623
|
};
|
|
18145
|
-
|
|
18146
|
-
|
|
18147
|
-
|
|
18148
|
-
|
|
18149
|
-
|
|
18150
|
-
|
|
18624
|
+
FormatPainterActions.prototype.cleanEmptyLists = function () {
|
|
18625
|
+
var listElem = this.parent.editableElement.querySelectorAll('ol, ul');
|
|
18626
|
+
for (var i = 0; i < listElem.length; i++) {
|
|
18627
|
+
if (listElem[i].textContent.trim() === '') {
|
|
18628
|
+
detach(listElem[i]);
|
|
18629
|
+
}
|
|
18151
18630
|
}
|
|
18152
|
-
|
|
18153
|
-
|
|
18631
|
+
};
|
|
18632
|
+
FormatPainterActions.prototype.setDeniedFormats = function () {
|
|
18633
|
+
var deniedFormatsCollection = [];
|
|
18634
|
+
if (isNullOrUndefined(this.settings) || isNullOrUndefined(this.settings.deniedFormats)) {
|
|
18635
|
+
return;
|
|
18636
|
+
}
|
|
18637
|
+
var deniedFormats = this.settings.deniedFormats.split(';');
|
|
18638
|
+
var length = deniedFormats.length;
|
|
18639
|
+
for (var i = 0; i < length; i++) {
|
|
18640
|
+
var formatString = deniedFormats[i];
|
|
18641
|
+
if (formatString !== '') {
|
|
18642
|
+
formatString.trim();
|
|
18643
|
+
var collection = this.makeDeniedFormatsCollection(formatString);
|
|
18644
|
+
if (!isNullOrUndefined(collection)) {
|
|
18645
|
+
deniedFormatsCollection.push(collection);
|
|
18646
|
+
}
|
|
18647
|
+
}
|
|
18648
|
+
}
|
|
18649
|
+
this.deniedFormatsCollection = deniedFormatsCollection;
|
|
18650
|
+
};
|
|
18651
|
+
FormatPainterActions.prototype.makeDeniedFormatsCollection = function (value) {
|
|
18652
|
+
var openParenIndex = value.indexOf('(');
|
|
18653
|
+
var closeParenIndex = value.indexOf(')');
|
|
18654
|
+
var openBracketIndex = value.indexOf('[');
|
|
18655
|
+
var closeBracketIndex = value.indexOf(']');
|
|
18656
|
+
var openBraceIndex = value.indexOf('{');
|
|
18657
|
+
var closeBraceIndex = value.indexOf('}');
|
|
18658
|
+
var classes = [];
|
|
18659
|
+
var attributes$$1 = '';
|
|
18660
|
+
var styles = '';
|
|
18661
|
+
var tagName = '';
|
|
18662
|
+
var classList = [];
|
|
18663
|
+
var attributesList = [];
|
|
18664
|
+
var stylesList = [];
|
|
18665
|
+
if (openParenIndex > -1 && closeParenIndex > -1) {
|
|
18666
|
+
classes = value.substring(openParenIndex + 1, closeParenIndex).split(' ');
|
|
18667
|
+
classList = classes[0].split(')')[0].split(',');
|
|
18668
|
+
}
|
|
18669
|
+
if (openBracketIndex > -1 && closeBracketIndex > -1) {
|
|
18670
|
+
attributes$$1 = value.substring(openBracketIndex + 1, closeBracketIndex);
|
|
18671
|
+
attributesList = attributes$$1.split(',');
|
|
18672
|
+
}
|
|
18673
|
+
if (openBraceIndex > -1 && closeBraceIndex > -1) {
|
|
18674
|
+
styles = value.substring(openBraceIndex + 1, closeBraceIndex);
|
|
18675
|
+
stylesList = styles.split(',');
|
|
18676
|
+
}
|
|
18677
|
+
var openIndexArray = [openParenIndex, openBracketIndex, openBraceIndex];
|
|
18678
|
+
openIndexArray = openIndexArray.filter(function (index) { return index > -1; });
|
|
18679
|
+
var len = openIndexArray.length;
|
|
18680
|
+
var min;
|
|
18681
|
+
if (len === 1) {
|
|
18682
|
+
min = openIndexArray[0];
|
|
18683
|
+
}
|
|
18684
|
+
else if (len === 2) {
|
|
18685
|
+
min = Math.min(openIndexArray[0], openIndexArray[1]);
|
|
18686
|
+
}
|
|
18687
|
+
else if (len === 3) {
|
|
18688
|
+
min = Math.min(openIndexArray[0], openIndexArray[1], openIndexArray[2]);
|
|
18689
|
+
}
|
|
18690
|
+
tagName = value.substring(0, min);
|
|
18691
|
+
tagName.trim();
|
|
18692
|
+
return ({
|
|
18693
|
+
tag: tagName, styles: stylesList, classes: classList,
|
|
18694
|
+
attributes: attributesList
|
|
18695
|
+
});
|
|
18696
|
+
};
|
|
18697
|
+
return FormatPainterActions;
|
|
18698
|
+
}());
|
|
18699
|
+
|
|
18700
|
+
/**
|
|
18701
|
+
* EditorManager internal component
|
|
18702
|
+
*
|
|
18703
|
+
* @hidden
|
|
18704
|
+
* @deprecated
|
|
18705
|
+
*/
|
|
18706
|
+
var EditorManager = /** @__PURE__ @class */ (function () {
|
|
18707
|
+
/**
|
|
18708
|
+
* Constructor for creating the component
|
|
18709
|
+
*
|
|
18710
|
+
* @hidden
|
|
18711
|
+
* @deprecated
|
|
18712
|
+
* @param {ICommandModel} options - specifies the command Model
|
|
18713
|
+
*/
|
|
18714
|
+
function EditorManager(options) {
|
|
18715
|
+
this.currentDocument = options.document;
|
|
18716
|
+
this.editableElement = options.editableElement;
|
|
18717
|
+
this.nodeSelection = new NodeSelection();
|
|
18718
|
+
this.nodeCutter = new NodeCutter();
|
|
18719
|
+
this.domNode = new DOMNode(this.editableElement, this.currentDocument);
|
|
18720
|
+
this.observer = new Observer(this);
|
|
18721
|
+
this.listObj = new Lists(this);
|
|
18722
|
+
this.formatObj = new Formats(this);
|
|
18723
|
+
this.alignmentObj = new Alignments(this);
|
|
18724
|
+
this.indentsObj = new Indents(this);
|
|
18725
|
+
this.linkObj = new LinkCommand(this);
|
|
18726
|
+
this.imgObj = new ImageCommand(this);
|
|
18727
|
+
this.audioObj = new AudioCommand(this);
|
|
18728
|
+
this.videoObj = new VideoCommand(this);
|
|
18729
|
+
this.selectionObj = new SelectionBasedExec(this);
|
|
18730
|
+
this.inserthtmlObj = new InsertHtmlExec(this);
|
|
18731
|
+
this.insertTextObj = new InsertTextExec(this);
|
|
18732
|
+
this.clearObj = new ClearFormatExec(this);
|
|
18733
|
+
this.tableObj = new TableCommand(this);
|
|
18734
|
+
this.undoRedoManager = new UndoRedoManager(this, options.options);
|
|
18735
|
+
this.msWordPaste = new MsWordPaste(this);
|
|
18736
|
+
this.formatPaintetrObj = new FormatPainterActions(this, options.formatPainterSettings);
|
|
18737
|
+
this.wireEvents();
|
|
18738
|
+
}
|
|
18739
|
+
EditorManager.prototype.wireEvents = function () {
|
|
18740
|
+
this.observer.on(KEY_DOWN, this.editorKeyDown, this);
|
|
18741
|
+
this.observer.on(KEY_UP, this.editorKeyUp, this);
|
|
18742
|
+
this.observer.on(KEY_UP, this.editorKeyUp, this);
|
|
18743
|
+
this.observer.on(MODEL_CHANGED, this.onPropertyChanged, this);
|
|
18744
|
+
this.observer.on(MS_WORD_CLEANUP, this.onWordPaste, this);
|
|
18745
|
+
this.observer.on(ON_BEGIN, this.onBegin, this);
|
|
18746
|
+
};
|
|
18747
|
+
EditorManager.prototype.onWordPaste = function (e) {
|
|
18748
|
+
this.observer.notify(MS_WORD_CLEANUP_PLUGIN, e);
|
|
18749
|
+
};
|
|
18750
|
+
EditorManager.prototype.onPropertyChanged = function (props) {
|
|
18751
|
+
this.observer.notify(MODEL_CHANGED_PLUGIN, props);
|
|
18752
|
+
};
|
|
18753
|
+
EditorManager.prototype.editorKeyDown = function (e) {
|
|
18754
|
+
this.observer.notify(KEY_DOWN_HANDLER, e);
|
|
18755
|
+
};
|
|
18756
|
+
EditorManager.prototype.editorKeyUp = function (e) {
|
|
18757
|
+
this.observer.notify(KEY_UP_HANDLER, e);
|
|
18758
|
+
};
|
|
18759
|
+
EditorManager.prototype.onBegin = function (e) {
|
|
18760
|
+
this.observer.notify(SPACE_ACTION, e);
|
|
18761
|
+
};
|
|
18762
|
+
/* eslint-disable */
|
|
18763
|
+
/**
|
|
18764
|
+
* execCommand
|
|
18765
|
+
*
|
|
18766
|
+
* @param {ExecCommand} command - specifies the execution command
|
|
18767
|
+
* @param {T} value - specifes the value.
|
|
18768
|
+
* @param {Event} event - specifies the call back event
|
|
18769
|
+
* @param {Function} callBack - specifies the function
|
|
18770
|
+
* @param {string} text - specifies the string value
|
|
18771
|
+
* @param {T} exeValue - specifies the values to be executed
|
|
18772
|
+
* @param {string} selector - specifies the selector values
|
|
18773
|
+
* @returns {void}
|
|
18774
|
+
* @hidden
|
|
18775
|
+
* @deprecated
|
|
18776
|
+
*/
|
|
18777
|
+
/* eslint-enable */
|
|
18778
|
+
EditorManager.prototype.execCommand = function (command, value, event, callBack, text, exeValue, selector, enterAction) {
|
|
18779
|
+
switch (command.toLowerCase()) {
|
|
18780
|
+
case 'lists':
|
|
18781
|
+
this.observer.notify(LIST_TYPE, { subCommand: value, event: event, callBack: callBack,
|
|
18782
|
+
selector: selector, item: exeValue, enterAction: enterAction });
|
|
18783
|
+
break;
|
|
18784
|
+
case 'formats':
|
|
18785
|
+
this.observer.notify(FORMAT_TYPE, { subCommand: value, event: event, callBack: callBack,
|
|
18786
|
+
selector: selector, exeValue: exeValue, enterAction: enterAction
|
|
18787
|
+
});
|
|
18788
|
+
break;
|
|
18789
|
+
case 'alignments':
|
|
18790
|
+
this.observer.notify(ALIGNMENT_TYPE, {
|
|
18791
|
+
subCommand: value, event: event, callBack: callBack,
|
|
18792
|
+
selector: selector,
|
|
18793
|
+
value: exeValue
|
|
18794
|
+
});
|
|
18795
|
+
break;
|
|
18796
|
+
case 'indents':
|
|
18797
|
+
this.observer.notify(INDENT_TYPE, { subCommand: value, event: event, callBack: callBack, selector: selector });
|
|
18798
|
+
break;
|
|
18799
|
+
case 'links':
|
|
18800
|
+
this.observer.notify(LINK, { command: command, value: value, item: exeValue, event: event, callBack: callBack });
|
|
18801
|
+
break;
|
|
18802
|
+
case 'files':
|
|
18803
|
+
this.observer.notify(IMAGE, {
|
|
18804
|
+
command: command, value: 'Image', item: exeValue, event: event, callBack: callBack, selector: selector
|
|
18805
|
+
});
|
|
18806
|
+
break;
|
|
18807
|
+
case 'images':
|
|
18808
|
+
this.observer.notify(IMAGE, {
|
|
18809
|
+
command: command, value: value, item: exeValue, event: event, callBack: callBack, selector: selector
|
|
18810
|
+
});
|
|
18811
|
+
break;
|
|
18812
|
+
case 'audios':
|
|
18813
|
+
this.observer.notify(AUDIO, {
|
|
18814
|
+
command: command, value: value, item: exeValue, event: event, callBack: callBack, selector: selector
|
|
18815
|
+
});
|
|
18816
|
+
break;
|
|
18817
|
+
case 'videos':
|
|
18818
|
+
this.observer.notify(VIDEO, {
|
|
18819
|
+
command: command, value: value, item: exeValue, event: event, callBack: callBack, selector: selector
|
|
18820
|
+
});
|
|
18821
|
+
break;
|
|
18822
|
+
case 'table':
|
|
18823
|
+
switch (value.toString().toLocaleLowerCase()) {
|
|
18824
|
+
case 'createtable':
|
|
18825
|
+
this.observer.notify(TABLE, { item: exeValue, event: event, callBack: callBack, enterAction: enterAction });
|
|
18826
|
+
break;
|
|
18827
|
+
case 'insertrowbefore':
|
|
18828
|
+
case 'insertrowafter':
|
|
18829
|
+
this.observer.notify(INSERT_ROW, { item: exeValue, event: event, callBack: callBack });
|
|
18830
|
+
break;
|
|
18831
|
+
case 'insertcolumnleft':
|
|
18832
|
+
case 'insertcolumnright':
|
|
18833
|
+
this.observer.notify(INSERT_COLUMN, { item: exeValue, event: event, callBack: callBack });
|
|
18834
|
+
break;
|
|
18835
|
+
case 'deleterow':
|
|
18836
|
+
this.observer.notify(DELETEROW, { item: exeValue, event: event, callBack: callBack });
|
|
18837
|
+
break;
|
|
18838
|
+
case 'deletecolumn':
|
|
18839
|
+
this.observer.notify(DELETECOLUMN, { item: exeValue, event: event, callBack: callBack });
|
|
18840
|
+
break;
|
|
18841
|
+
case 'tableremove':
|
|
18842
|
+
this.observer.notify(REMOVETABLE, { item: exeValue, event: event, callBack: callBack });
|
|
18843
|
+
break;
|
|
18844
|
+
case 'tableheader':
|
|
18845
|
+
this.observer.notify(TABLEHEADER, { item: exeValue, event: event, callBack: callBack });
|
|
18846
|
+
break;
|
|
18847
|
+
case 'aligntop':
|
|
18848
|
+
case 'alignmiddle':
|
|
18849
|
+
case 'alignbottom':
|
|
18850
|
+
this.observer.notify(TABLE_VERTICAL_ALIGN, { item: exeValue, event: event, callBack: callBack });
|
|
18851
|
+
break;
|
|
18852
|
+
case 'merge':
|
|
18853
|
+
this.observer.notify(TABLE_MERGE, { item: exeValue, event: event, callBack: callBack });
|
|
18854
|
+
break;
|
|
18855
|
+
case 'horizontalsplit':
|
|
18856
|
+
this.observer.notify(TABLE_HORIZONTAL_SPLIT, { item: exeValue, event: event, callBack: callBack });
|
|
18857
|
+
break;
|
|
18858
|
+
case 'verticalsplit':
|
|
18859
|
+
this.observer.notify(TABLE_VERTICAL_SPLIT, { item: exeValue, event: event, callBack: callBack });
|
|
18860
|
+
break;
|
|
18861
|
+
}
|
|
18862
|
+
break;
|
|
18863
|
+
case 'font':
|
|
18864
|
+
case 'style':
|
|
18865
|
+
case 'effects':
|
|
18866
|
+
case 'casing':
|
|
18867
|
+
this.observer.notify(SELECTION_TYPE, { subCommand: value, event: event, callBack: callBack, value: text, selector: selector, enterAction: enterAction });
|
|
18868
|
+
break;
|
|
18869
|
+
case 'inserthtml':
|
|
18870
|
+
this.observer.notify(INSERTHTML_TYPE, { subCommand: value, callBack: callBack, value: text, enterAction: enterAction });
|
|
18871
|
+
break;
|
|
18872
|
+
case 'inserttext':
|
|
18873
|
+
this.observer.notify(INSERT_TEXT_TYPE, { subCommand: value, callBack: callBack, value: text });
|
|
18874
|
+
break;
|
|
18875
|
+
case 'clear':
|
|
18876
|
+
this.observer.notify(CLEAR_TYPE, { subCommand: value, event: event, callBack: callBack, selector: selector, enterAction: enterAction });
|
|
18877
|
+
break;
|
|
18878
|
+
case 'actions':
|
|
18879
|
+
this.observer.notify(ACTION, { subCommand: value, event: event, callBack: callBack, selector: selector });
|
|
18880
|
+
break;
|
|
18881
|
+
case 'formatpainter':
|
|
18882
|
+
this.observer.notify(FORMAT_PAINTER_ACTIONS, { item: exeValue, subCommand: value, event: event, callBack: callBack });
|
|
18883
|
+
break;
|
|
18154
18884
|
}
|
|
18155
18885
|
};
|
|
18156
|
-
|
|
18157
|
-
|
|
18886
|
+
return EditorManager;
|
|
18887
|
+
}());
|
|
18888
|
+
|
|
18889
|
+
var __extends$2 = (undefined && undefined.__extends) || (function () {
|
|
18890
|
+
var extendStatics = function (d, b) {
|
|
18891
|
+
extendStatics = Object.setPrototypeOf ||
|
|
18892
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
18893
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
18894
|
+
return extendStatics(d, b);
|
|
18895
|
+
};
|
|
18896
|
+
return function (d, b) {
|
|
18897
|
+
extendStatics(d, b);
|
|
18898
|
+
function __() { this.constructor = d; }
|
|
18899
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
18158
18900
|
};
|
|
18159
|
-
|
|
18160
|
-
|
|
18161
|
-
|
|
18162
|
-
|
|
18163
|
-
|
|
18164
|
-
|
|
18165
|
-
|
|
18166
|
-
|
|
18167
|
-
|
|
18168
|
-
|
|
18169
|
-
|
|
18170
|
-
|
|
18171
|
-
|
|
18172
|
-
|
|
18173
|
-
|
|
18174
|
-
return 'Upper Roman';
|
|
18175
|
-
}
|
|
18176
|
-
else if (list === 'lower-greek') {
|
|
18177
|
-
return 'Lower Greek';
|
|
18178
|
-
}
|
|
18179
|
-
else if (list === 'none') {
|
|
18180
|
-
return 'None';
|
|
18181
|
-
}
|
|
18182
|
-
else {
|
|
18183
|
-
return null;
|
|
18901
|
+
})();
|
|
18902
|
+
/**
|
|
18903
|
+
* HTML adapter
|
|
18904
|
+
*
|
|
18905
|
+
* @hidden
|
|
18906
|
+
* @deprecated
|
|
18907
|
+
*/
|
|
18908
|
+
var HTMLFormatter = /** @__PURE__ @class */ (function (_super) {
|
|
18909
|
+
__extends$2(HTMLFormatter, _super);
|
|
18910
|
+
function HTMLFormatter(options) {
|
|
18911
|
+
var _this = _super.call(this) || this;
|
|
18912
|
+
_this.initialize();
|
|
18913
|
+
extend(_this, _this, options, true);
|
|
18914
|
+
if (_this.currentDocument && _this.element) {
|
|
18915
|
+
_this.updateFormatter(_this.element, _this.currentDocument, options.options, options.formatPainterSettings);
|
|
18184
18916
|
}
|
|
18917
|
+
return _this;
|
|
18918
|
+
}
|
|
18919
|
+
HTMLFormatter.prototype.initialize = function () {
|
|
18920
|
+
this.keyConfig = htmlKeyConfig;
|
|
18185
18921
|
};
|
|
18186
|
-
|
|
18187
|
-
|
|
18188
|
-
|
|
18189
|
-
|
|
18190
|
-
|
|
18191
|
-
|
|
18192
|
-
|
|
18193
|
-
|
|
18194
|
-
|
|
18195
|
-
|
|
18196
|
-
|
|
18197
|
-
|
|
18198
|
-
|
|
18199
|
-
|
|
18200
|
-
|
|
18201
|
-
|
|
18922
|
+
/**
|
|
18923
|
+
* Update the formatter of RichTextEditor
|
|
18924
|
+
*
|
|
18925
|
+
* @param {Element} editElement - specifies the edit element.
|
|
18926
|
+
* @param {Document} doc - specifies the doucment
|
|
18927
|
+
* @param {number} options - specifies the options
|
|
18928
|
+
* @param {FormatPainterSettingsModel} formatPainterSettings - specifies the format painter settings
|
|
18929
|
+
* @returns {void}
|
|
18930
|
+
* @hidden
|
|
18931
|
+
* @deprecated
|
|
18932
|
+
*/
|
|
18933
|
+
HTMLFormatter.prototype.updateFormatter = function (editElement, doc, options, formatPainterSettings) {
|
|
18934
|
+
if (editElement && doc) {
|
|
18935
|
+
this.editorManager = new EditorManager({
|
|
18936
|
+
document: doc,
|
|
18937
|
+
editableElement: editElement,
|
|
18938
|
+
options: options,
|
|
18939
|
+
formatPainterSettings: formatPainterSettings
|
|
18940
|
+
});
|
|
18202
18941
|
}
|
|
18203
18942
|
};
|
|
18204
|
-
return
|
|
18205
|
-
}());
|
|
18943
|
+
return HTMLFormatter;
|
|
18944
|
+
}(Formatter));
|
|
18206
18945
|
|
|
18207
18946
|
/**
|
|
18208
18947
|
* HtmlToolbarStatus module for refresh the toolbar status
|
|
@@ -19147,117 +19886,136 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
19147
19886
|
}
|
|
19148
19887
|
};
|
|
19149
19888
|
HtmlEditor.prototype.onToolbarClick = function (args) {
|
|
19889
|
+
var _this = this;
|
|
19150
19890
|
var save;
|
|
19151
19891
|
var selectNodeEle;
|
|
19152
19892
|
var selectParentEle;
|
|
19153
19893
|
var item = args.item;
|
|
19154
19894
|
var closestElement = closest(args.originalEvent.target, '.e-rte-quick-popup');
|
|
19155
|
-
if (
|
|
19156
|
-
if (
|
|
19157
|
-
item.subCommand === '
|
|
19158
|
-
|
|
19159
|
-
|
|
19160
|
-
|
|
19161
|
-
|
|
19162
|
-
|
|
19163
|
-
selectNodeEle = this.nodeSelectionObj.getNodeCollection(range);
|
|
19164
|
-
selectParentEle = this.nodeSelectionObj.getParentNodeCollection(range);
|
|
19165
|
-
}
|
|
19166
|
-
if (item.command === 'Images') {
|
|
19167
|
-
this.parent.notify(imageToolbarAction, {
|
|
19168
|
-
member: 'image', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
|
|
19169
|
-
});
|
|
19170
|
-
}
|
|
19171
|
-
if (item.command === 'Audios') {
|
|
19172
|
-
this.parent.notify(audioToolbarAction, {
|
|
19173
|
-
member: 'audio', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
|
|
19174
|
-
});
|
|
19175
|
-
}
|
|
19176
|
-
if (item.command === 'Videos') {
|
|
19177
|
-
this.parent.notify(videoToolbarAction, {
|
|
19178
|
-
member: 'video', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
|
|
19179
|
-
});
|
|
19180
|
-
}
|
|
19181
|
-
if (item.command === 'Links') {
|
|
19182
|
-
this.parent.notify(linkToolbarAction, {
|
|
19183
|
-
member: 'link', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
|
|
19184
|
-
});
|
|
19185
|
-
}
|
|
19186
|
-
if (item.command === 'Table') {
|
|
19187
|
-
this.parent.notify(tableToolbarAction, {
|
|
19188
|
-
member: 'table', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
|
|
19189
|
-
});
|
|
19190
|
-
}
|
|
19191
|
-
}
|
|
19192
|
-
else {
|
|
19193
|
-
var linkDialog = document.getElementById(this.parent.getID() + '_rtelink');
|
|
19194
|
-
var imageDialog = document.getElementById(this.parent.getID() + '_image');
|
|
19195
|
-
if (!(item.subCommand === 'SourceCode' || item.subCommand === 'Preview' ||
|
|
19196
|
-
item.subCommand === 'FontColor' || item.subCommand === 'BackgroundColor')) {
|
|
19197
|
-
var range = this.nodeSelectionObj.getRange(this.parent.contentModule.getDocument());
|
|
19198
|
-
if (isNullOrUndefined(linkDialog) && isNullOrUndefined(imageDialog)) {
|
|
19895
|
+
if (item.command !== 'FormatPainter') {
|
|
19896
|
+
if (closestElement && !closestElement.classList.contains('e-rte-inline-popup')) {
|
|
19897
|
+
if (!(item.subCommand === 'SourceCode' || item.subCommand === 'Preview' ||
|
|
19898
|
+
item.subCommand === 'FontColor' || item.subCommand === 'BackgroundColor')) {
|
|
19899
|
+
if (isIDevice$1() && item.command === 'Images') {
|
|
19900
|
+
this.nodeSelectionObj.restore();
|
|
19901
|
+
}
|
|
19902
|
+
var range = this.nodeSelectionObj.getRange(this.parent.contentModule.getDocument());
|
|
19199
19903
|
save = this.nodeSelectionObj.save(range, this.parent.contentModule.getDocument());
|
|
19904
|
+
selectNodeEle = this.nodeSelectionObj.getNodeCollection(range);
|
|
19905
|
+
selectParentEle = this.nodeSelectionObj.getParentNodeCollection(range);
|
|
19200
19906
|
}
|
|
19201
|
-
|
|
19202
|
-
|
|
19203
|
-
}
|
|
19204
|
-
switch (item.subCommand) {
|
|
19205
|
-
case 'Maximize':
|
|
19206
|
-
this.parent.notify(enableFullScreen, { args: args });
|
|
19207
|
-
break;
|
|
19208
|
-
case 'Minimize':
|
|
19209
|
-
this.parent.notify(disableFullScreen, { args: args });
|
|
19210
|
-
break;
|
|
19211
|
-
case 'CreateLink':
|
|
19212
|
-
this.parent.notify(insertLink, {
|
|
19213
|
-
member: 'link', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
|
|
19214
|
-
});
|
|
19215
|
-
break;
|
|
19216
|
-
case 'RemoveLink':
|
|
19217
|
-
this.parent.notify(unLink, {
|
|
19218
|
-
member: 'link', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
|
|
19219
|
-
});
|
|
19220
|
-
break;
|
|
19221
|
-
case 'Print':
|
|
19222
|
-
this.parent.print();
|
|
19223
|
-
break;
|
|
19224
|
-
case 'Image':
|
|
19225
|
-
this.parent.notify(insertImage, {
|
|
19907
|
+
if (item.command === 'Images') {
|
|
19908
|
+
this.parent.notify(imageToolbarAction, {
|
|
19226
19909
|
member: 'image', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
|
|
19227
19910
|
});
|
|
19228
|
-
|
|
19229
|
-
|
|
19230
|
-
this.parent.notify(
|
|
19911
|
+
}
|
|
19912
|
+
if (item.command === 'Audios') {
|
|
19913
|
+
this.parent.notify(audioToolbarAction, {
|
|
19231
19914
|
member: 'audio', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
|
|
19232
19915
|
});
|
|
19233
|
-
|
|
19234
|
-
|
|
19235
|
-
this.parent.notify(
|
|
19916
|
+
}
|
|
19917
|
+
if (item.command === 'Videos') {
|
|
19918
|
+
this.parent.notify(videoToolbarAction, {
|
|
19236
19919
|
member: 'video', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
|
|
19237
19920
|
});
|
|
19238
|
-
|
|
19239
|
-
|
|
19240
|
-
this.parent.notify(
|
|
19241
|
-
member: '
|
|
19921
|
+
}
|
|
19922
|
+
if (item.command === 'Links') {
|
|
19923
|
+
this.parent.notify(linkToolbarAction, {
|
|
19924
|
+
member: 'link', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
|
|
19242
19925
|
});
|
|
19243
|
-
|
|
19244
|
-
|
|
19245
|
-
this.parent.notify(
|
|
19246
|
-
|
|
19247
|
-
case 'Preview':
|
|
19248
|
-
this.parent.notify(updateSource, { member: 'updateSource', args: args });
|
|
19249
|
-
break;
|
|
19250
|
-
case 'FontColor':
|
|
19251
|
-
case 'BackgroundColor':
|
|
19252
|
-
break;
|
|
19253
|
-
case 'File':
|
|
19254
|
-
this.parent.notify(renderFileManager, {
|
|
19255
|
-
member: 'fileManager', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
|
|
19926
|
+
}
|
|
19927
|
+
if (item.command === 'Table') {
|
|
19928
|
+
this.parent.notify(tableToolbarAction, {
|
|
19929
|
+
member: 'table', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
|
|
19256
19930
|
});
|
|
19257
|
-
|
|
19258
|
-
|
|
19259
|
-
|
|
19260
|
-
|
|
19931
|
+
}
|
|
19932
|
+
}
|
|
19933
|
+
else {
|
|
19934
|
+
var linkDialog = document.getElementById(this.parent.getID() + '_rtelink');
|
|
19935
|
+
var imageDialog = document.getElementById(this.parent.getID() + '_image');
|
|
19936
|
+
if (!(item.subCommand === 'SourceCode' || item.subCommand === 'Preview' ||
|
|
19937
|
+
item.subCommand === 'FontColor' || item.subCommand === 'BackgroundColor')) {
|
|
19938
|
+
var range = this.nodeSelectionObj.getRange(this.parent.contentModule.getDocument());
|
|
19939
|
+
if (isNullOrUndefined(linkDialog) && isNullOrUndefined(imageDialog)) {
|
|
19940
|
+
save = this.nodeSelectionObj.save(range, this.parent.contentModule.getDocument());
|
|
19941
|
+
}
|
|
19942
|
+
selectNodeEle = this.nodeSelectionObj.getNodeCollection(range);
|
|
19943
|
+
selectParentEle = this.nodeSelectionObj.getParentNodeCollection(range);
|
|
19944
|
+
}
|
|
19945
|
+
switch (item.subCommand) {
|
|
19946
|
+
case 'Maximize':
|
|
19947
|
+
this.parent.notify(enableFullScreen, { args: args });
|
|
19948
|
+
break;
|
|
19949
|
+
case 'Minimize':
|
|
19950
|
+
this.parent.notify(disableFullScreen, { args: args });
|
|
19951
|
+
break;
|
|
19952
|
+
case 'CreateLink':
|
|
19953
|
+
this.parent.notify(insertLink, {
|
|
19954
|
+
member: 'link', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
|
|
19955
|
+
});
|
|
19956
|
+
break;
|
|
19957
|
+
case 'RemoveLink':
|
|
19958
|
+
this.parent.notify(unLink, {
|
|
19959
|
+
member: 'link', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
|
|
19960
|
+
});
|
|
19961
|
+
break;
|
|
19962
|
+
case 'Print':
|
|
19963
|
+
this.parent.print();
|
|
19964
|
+
break;
|
|
19965
|
+
case 'Image':
|
|
19966
|
+
this.parent.notify(insertImage, {
|
|
19967
|
+
member: 'image', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
|
|
19968
|
+
});
|
|
19969
|
+
break;
|
|
19970
|
+
case 'Audio':
|
|
19971
|
+
this.parent.notify(insertAudio, {
|
|
19972
|
+
member: 'audio', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
|
|
19973
|
+
});
|
|
19974
|
+
break;
|
|
19975
|
+
case 'Video':
|
|
19976
|
+
this.parent.notify(insertVideo, {
|
|
19977
|
+
member: 'video', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
|
|
19978
|
+
});
|
|
19979
|
+
break;
|
|
19980
|
+
case 'CreateTable':
|
|
19981
|
+
this.parent.notify(createTable, {
|
|
19982
|
+
member: 'table', args: args, selection: save
|
|
19983
|
+
});
|
|
19984
|
+
break;
|
|
19985
|
+
case 'SourceCode':
|
|
19986
|
+
this.parent.notify(sourceCode, { member: 'viewSource', args: args });
|
|
19987
|
+
break;
|
|
19988
|
+
case 'Preview':
|
|
19989
|
+
this.parent.notify(updateSource, { member: 'updateSource', args: args });
|
|
19990
|
+
break;
|
|
19991
|
+
case 'FontColor':
|
|
19992
|
+
case 'BackgroundColor':
|
|
19993
|
+
break;
|
|
19994
|
+
case 'File':
|
|
19995
|
+
this.parent.notify(renderFileManager, {
|
|
19996
|
+
member: 'fileManager', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
|
|
19997
|
+
});
|
|
19998
|
+
break;
|
|
19999
|
+
default:
|
|
20000
|
+
this.parent.formatter.process(this.parent, args, args.originalEvent, null);
|
|
20001
|
+
break;
|
|
20002
|
+
}
|
|
20003
|
+
}
|
|
20004
|
+
}
|
|
20005
|
+
else {
|
|
20006
|
+
if (args.originalEvent.detail === 1) {
|
|
20007
|
+
clearTimeout(this.clickTimeout);
|
|
20008
|
+
this.clickTimeout = setTimeout(function () {
|
|
20009
|
+
_this.parent.notify(formatPainterClick, {
|
|
20010
|
+
member: 'formatPainter', args: args
|
|
20011
|
+
});
|
|
20012
|
+
}, 200);
|
|
20013
|
+
}
|
|
20014
|
+
else {
|
|
20015
|
+
clearTimeout(this.clickTimeout);
|
|
20016
|
+
this.parent.notify(formatPainterDoubleClick, {
|
|
20017
|
+
member: 'formatPainter', args: args
|
|
20018
|
+
});
|
|
19261
20019
|
}
|
|
19262
20020
|
}
|
|
19263
20021
|
};
|
|
@@ -19300,7 +20058,8 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
19300
20058
|
var formatterClass = new HTMLFormatter({
|
|
19301
20059
|
currentDocument: this.contentRenderer.getDocument(),
|
|
19302
20060
|
element: editElement,
|
|
19303
|
-
options: option
|
|
20061
|
+
options: option,
|
|
20062
|
+
formatPainterSettings: this.parent.formatPainterSettings
|
|
19304
20063
|
});
|
|
19305
20064
|
this.parent.setProperties({ formatter: formatterClass }, true);
|
|
19306
20065
|
}
|
|
@@ -20025,7 +20784,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
20025
20784
|
this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
|
|
20026
20785
|
extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
|
|
20027
20786
|
_this.parent.formatter.onSuccess(_this.parent, args);
|
|
20028
|
-
}, clipBoardElem);
|
|
20787
|
+
}, clipBoardElem, null, null, this.parent.enterKey);
|
|
20029
20788
|
this.removeTempClass();
|
|
20030
20789
|
this.parent.notify(toolbarRefresh, {});
|
|
20031
20790
|
this.imgUploading(this.parent.inputElement);
|
|
@@ -20095,7 +20854,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
20095
20854
|
this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
|
|
20096
20855
|
extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
|
|
20097
20856
|
_this.parent.formatter.onSuccess(_this.parent, args);
|
|
20098
|
-
}, clipBoardElem);
|
|
20857
|
+
}, clipBoardElem, null, null, this.parent.enterKey);
|
|
20099
20858
|
this.removeTempClass();
|
|
20100
20859
|
}
|
|
20101
20860
|
else {
|
|
@@ -20794,7 +21553,6 @@ var FullScreen = /** @__PURE__ @class */ (function () {
|
|
|
20794
21553
|
_this.parent.toolbarModule.addFixedTBarClass();
|
|
20795
21554
|
}
|
|
20796
21555
|
}
|
|
20797
|
-
_this.parent.refreshUI();
|
|
20798
21556
|
_this.parent.trigger(actionComplete, { requestType: 'Minimize', targetItem: 'Minimize', args: event });
|
|
20799
21557
|
}
|
|
20800
21558
|
});
|
|
@@ -20916,6 +21674,146 @@ function setAttributes(htmlAttributes, rte, isFrame, initial) {
|
|
|
20916
21674
|
}
|
|
20917
21675
|
}
|
|
20918
21676
|
|
|
21677
|
+
var FormatPainter = /** @__PURE__ @class */ (function () {
|
|
21678
|
+
function FormatPainter(parent) {
|
|
21679
|
+
this.isSticky = false;
|
|
21680
|
+
this.isActive = false;
|
|
21681
|
+
this.parent = parent;
|
|
21682
|
+
this.addEventListener();
|
|
21683
|
+
}
|
|
21684
|
+
FormatPainter.prototype.addEventListener = function () {
|
|
21685
|
+
this.parent.on(formatPainterClick, this.toolbarClick, this);
|
|
21686
|
+
this.parent.on(formatPainterDoubleClick, this.toolbarDoubleClick, this);
|
|
21687
|
+
this.parent.on(editAreaClick, this.editAreaClick, this);
|
|
21688
|
+
this.parent.on(keyDown, this.onKeyDown, this);
|
|
21689
|
+
this.parent.on(destroy, this.destroy, this);
|
|
21690
|
+
};
|
|
21691
|
+
FormatPainter.prototype.toolbarClick = function (args) {
|
|
21692
|
+
this.isActive = true;
|
|
21693
|
+
this.parent.focusIn();
|
|
21694
|
+
this.actionHandler(args, 'click');
|
|
21695
|
+
};
|
|
21696
|
+
FormatPainter.prototype.toolbarDoubleClick = function (args) {
|
|
21697
|
+
this.isActive = true;
|
|
21698
|
+
this.isSticky = true;
|
|
21699
|
+
this.parent.focusIn();
|
|
21700
|
+
this.actionHandler(args, 'dbClick');
|
|
21701
|
+
};
|
|
21702
|
+
FormatPainter.prototype.onKeyDown = function (event) {
|
|
21703
|
+
var originalEvent = event.args;
|
|
21704
|
+
if ((originalEvent.ctrlKey && originalEvent.shiftKey && (originalEvent.action === 'format-copy' || originalEvent.action === 'format-paste'))
|
|
21705
|
+
|| (originalEvent.action === 'escape' && (this.previousAction === 'format-copy' || this.previousAction === 'format-paste'))) {
|
|
21706
|
+
if (!isNullOrUndefined(originalEvent.key) && originalEvent.key.toLowerCase() === 'c') {
|
|
21707
|
+
originalEvent.preventDefault();
|
|
21708
|
+
}
|
|
21709
|
+
if (!isNullOrUndefined(originalEvent.key) && originalEvent.key.toLowerCase() === 'v' &&
|
|
21710
|
+
this.previousAction === 'format-copy' || this.previousAction === 'format-paste' || this.isSticky) {
|
|
21711
|
+
originalEvent.preventDefault();
|
|
21712
|
+
}
|
|
21713
|
+
this.actionHandler(event, 'keyBoard');
|
|
21714
|
+
}
|
|
21715
|
+
};
|
|
21716
|
+
FormatPainter.prototype.actionHandler = function (event, type) {
|
|
21717
|
+
var action;
|
|
21718
|
+
var isKeyboard = false;
|
|
21719
|
+
var originalEvent;
|
|
21720
|
+
var args;
|
|
21721
|
+
var item;
|
|
21722
|
+
switch (type) {
|
|
21723
|
+
case 'dbClick':
|
|
21724
|
+
args = event.args;
|
|
21725
|
+
item = args.item;
|
|
21726
|
+
originalEvent = event.args.originalEvent;
|
|
21727
|
+
action = 'format-copy';
|
|
21728
|
+
break;
|
|
21729
|
+
case 'keyBoard':
|
|
21730
|
+
args = null;
|
|
21731
|
+
originalEvent = event.args;
|
|
21732
|
+
isKeyboard = true;
|
|
21733
|
+
action = event.args.action;
|
|
21734
|
+
if (action === 'escape') {
|
|
21735
|
+
this.isSticky = false;
|
|
21736
|
+
this.isActive = false;
|
|
21737
|
+
}
|
|
21738
|
+
break;
|
|
21739
|
+
case 'click':
|
|
21740
|
+
args = event.args;
|
|
21741
|
+
item = args.item;
|
|
21742
|
+
originalEvent = event.args.originalEvent;
|
|
21743
|
+
action = 'format-copy';
|
|
21744
|
+
break;
|
|
21745
|
+
case 'docClick':
|
|
21746
|
+
originalEvent = event;
|
|
21747
|
+
action = 'format-paste';
|
|
21748
|
+
break;
|
|
21749
|
+
}
|
|
21750
|
+
this.updateCursor(isKeyboard);
|
|
21751
|
+
var enable = type === 'docClick' || action === 'escape' ? false : true;
|
|
21752
|
+
this.updateToolbarBtn(enable);
|
|
21753
|
+
if (isNullOrUndefined(item)) {
|
|
21754
|
+
item = {
|
|
21755
|
+
command: 'FormatPainter',
|
|
21756
|
+
subCommand: 'FormatPainter'
|
|
21757
|
+
};
|
|
21758
|
+
}
|
|
21759
|
+
var actionBeginArgs = {
|
|
21760
|
+
requestType: 'FormatPainter', originalEvent: originalEvent, name: action, item: item
|
|
21761
|
+
};
|
|
21762
|
+
var value = {
|
|
21763
|
+
formatPainterAction: action
|
|
21764
|
+
};
|
|
21765
|
+
this.parent.formatter.process(this.parent, actionBeginArgs, originalEvent, value);
|
|
21766
|
+
this.previousAction = action;
|
|
21767
|
+
};
|
|
21768
|
+
FormatPainter.prototype.updateCursor = function (isKeyboard) {
|
|
21769
|
+
if (!this.parent.inputElement.classList.contains('e-rte-cursor-brush') && !isKeyboard) {
|
|
21770
|
+
addClass([this.parent.inputElement], 'e-rte-cursor-brush');
|
|
21771
|
+
}
|
|
21772
|
+
else if (!this.isSticky) {
|
|
21773
|
+
removeClass([this.parent.inputElement], 'e-rte-cursor-brush');
|
|
21774
|
+
}
|
|
21775
|
+
};
|
|
21776
|
+
FormatPainter.prototype.updateToolbarBtn = function (enable) {
|
|
21777
|
+
var toolbarBtn = this.parent.element.querySelector('.e-rte-format-painter').parentElement.parentElement;
|
|
21778
|
+
if (enable) {
|
|
21779
|
+
addClass([toolbarBtn], 'e-active');
|
|
21780
|
+
}
|
|
21781
|
+
else if (!this.isSticky) {
|
|
21782
|
+
removeClass([toolbarBtn], 'e-active');
|
|
21783
|
+
}
|
|
21784
|
+
};
|
|
21785
|
+
FormatPainter.prototype.editAreaClick = function (args) {
|
|
21786
|
+
if (this.isActive) {
|
|
21787
|
+
if (!this.isSticky) {
|
|
21788
|
+
this.isActive = false;
|
|
21789
|
+
}
|
|
21790
|
+
this.actionHandler(args, 'docClick');
|
|
21791
|
+
this.updateToolbarBtn(false);
|
|
21792
|
+
}
|
|
21793
|
+
};
|
|
21794
|
+
FormatPainter.prototype.destroy = function () {
|
|
21795
|
+
/**Removeeventlistener */
|
|
21796
|
+
if (this.parent.isDestroyed) {
|
|
21797
|
+
return;
|
|
21798
|
+
}
|
|
21799
|
+
this.parent.off(formatPainterClick, this.toolbarClick);
|
|
21800
|
+
this.parent.off(editAreaClick, this.editAreaClick);
|
|
21801
|
+
this.parent.off(formatPainterDoubleClick, this.toolbarDoubleClick);
|
|
21802
|
+
this.parent.off(keyDown, this.onKeyDown);
|
|
21803
|
+
this.parent.off(destroy, this.destroy);
|
|
21804
|
+
};
|
|
21805
|
+
/**
|
|
21806
|
+
* For internal use only - Get the module name.
|
|
21807
|
+
*
|
|
21808
|
+
* @returns {void}
|
|
21809
|
+
* @hidden
|
|
21810
|
+
*/
|
|
21811
|
+
FormatPainter.prototype.getModuleName = function () {
|
|
21812
|
+
return 'formatPainter';
|
|
21813
|
+
};
|
|
21814
|
+
return FormatPainter;
|
|
21815
|
+
}());
|
|
21816
|
+
|
|
20919
21817
|
/**
|
|
20920
21818
|
* Action export
|
|
20921
21819
|
*/
|
|
@@ -21215,7 +22113,8 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
21215
22113
|
var eventArgs = {
|
|
21216
22114
|
args: event ? event.args : {
|
|
21217
22115
|
item: { command: 'Links', subCommand: 'CreateLink' },
|
|
21218
|
-
originalEvent: undefined
|
|
22116
|
+
originalEvent: undefined,
|
|
22117
|
+
name: !isInternal ? 'showDialog' : null
|
|
21219
22118
|
},
|
|
21220
22119
|
selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
|
|
21221
22120
|
};
|
|
@@ -21934,7 +22833,8 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
21934
22833
|
img.setAttribute('width', (img.width + this.mouseX).toString());
|
|
21935
22834
|
}
|
|
21936
22835
|
else {
|
|
21937
|
-
img.
|
|
22836
|
+
var currentWidth = img.offsetWidth === 0 ? img.width + this.mouseX + parseInt(img.style.outlineWidth.split('p')[0]) : img.offsetWidth + this.mouseX;
|
|
22837
|
+
img.setAttribute('width', (currentWidth).toString());
|
|
21938
22838
|
}
|
|
21939
22839
|
}
|
|
21940
22840
|
}
|
|
@@ -22017,7 +22917,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
22017
22917
|
var pageX = this.getPointX(e);
|
|
22018
22918
|
var pageY = this.getPointY(e);
|
|
22019
22919
|
var mouseX = (this.resizeBtnStat.botLeft || this.resizeBtnStat.topLeft) ? -(pageX - this.pageX) : (pageX - this.pageX);
|
|
22020
|
-
var mouseY = (this.resizeBtnStat.
|
|
22920
|
+
var mouseY = (this.resizeBtnStat.botLeft || this.resizeBtnStat.topLeft) ? -(pageY - this.pageY) : (pageY - this.pageY);
|
|
22021
22921
|
var width = parseInt(this.imgDupPos.width, 10) + mouseX;
|
|
22022
22922
|
var height = parseInt(this.imgDupPos.height, 10) + mouseY;
|
|
22023
22923
|
this.mouseX = mouseX;
|
|
@@ -22188,8 +23088,9 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
22188
23088
|
}
|
|
22189
23089
|
if (originalEvent.keyCode === 8 || originalEvent.keyCode === 46) {
|
|
22190
23090
|
if (selectNodeEle && selectNodeEle[0].nodeName === 'IMG' && selectNodeEle.length < 1) {
|
|
22191
|
-
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
|
|
23091
|
+
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
|
|
22192
23092
|
save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
23093
|
+
}
|
|
22193
23094
|
originalEvent.preventDefault();
|
|
22194
23095
|
var event_1 = {
|
|
22195
23096
|
selectNode: selectNodeEle, selection: save, selectParent: selectParentEle,
|
|
@@ -22248,8 +23149,9 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
22248
23149
|
}
|
|
22249
23150
|
break;
|
|
22250
23151
|
case 'insert-image':
|
|
22251
|
-
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
|
|
23152
|
+
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
|
|
22252
23153
|
save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
23154
|
+
}
|
|
22253
23155
|
this.openDialog(true, originalEvent, save, selectNodeEle, selectParentEle);
|
|
22254
23156
|
originalEvent.preventDefault();
|
|
22255
23157
|
break;
|
|
@@ -22275,7 +23177,8 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
22275
23177
|
this.insertImage({
|
|
22276
23178
|
args: {
|
|
22277
23179
|
item: { command: 'Images', subCommand: 'Image' },
|
|
22278
|
-
originalEvent: event
|
|
23180
|
+
originalEvent: event,
|
|
23181
|
+
name: !isInternal ? 'showDialog' : null
|
|
22279
23182
|
},
|
|
22280
23183
|
selectNode: selectNodeEle,
|
|
22281
23184
|
selection: save,
|
|
@@ -22286,7 +23189,8 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
22286
23189
|
this.insertImage({
|
|
22287
23190
|
args: {
|
|
22288
23191
|
item: { command: 'Images', subCommand: 'Image' },
|
|
22289
|
-
originalEvent: event
|
|
23192
|
+
originalEvent: event,
|
|
23193
|
+
name: !isInternal ? 'showDialog' : null
|
|
22290
23194
|
},
|
|
22291
23195
|
member: 'image',
|
|
22292
23196
|
text: this.parent.formatter.editorManager.markdownSelection.getSelectedText(this.parent.contentModule.getEditPanel()),
|
|
@@ -24052,8 +24956,9 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
24052
24956
|
}
|
|
24053
24957
|
if (originalEvent.keyCode === 8 || originalEvent.keyCode === 46) {
|
|
24054
24958
|
if (selectNodeEle && this.isAudioElem(selectNodeEle[0]) && selectNodeEle.length < 1) {
|
|
24055
|
-
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
|
|
24959
|
+
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
|
|
24056
24960
|
save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
24961
|
+
}
|
|
24057
24962
|
originalEvent.preventDefault();
|
|
24058
24963
|
var event_1 = {
|
|
24059
24964
|
selectNode: selectNodeEle, selection: save, selectParent: selectParentEle,
|
|
@@ -24102,8 +25007,9 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
24102
25007
|
}
|
|
24103
25008
|
break;
|
|
24104
25009
|
case 'insert-audio':
|
|
24105
|
-
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
|
|
25010
|
+
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
|
|
24106
25011
|
save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
25012
|
+
}
|
|
24107
25013
|
this.openDialog(true, originalEvent, save, selectNodeEle, selectParentEle);
|
|
24108
25014
|
originalEvent.preventDefault();
|
|
24109
25015
|
break;
|
|
@@ -24129,7 +25035,8 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
24129
25035
|
this.insertAudio({
|
|
24130
25036
|
args: {
|
|
24131
25037
|
item: { command: 'Audios', subCommand: 'Audio' },
|
|
24132
|
-
originalEvent: event
|
|
25038
|
+
originalEvent: event,
|
|
25039
|
+
name: !isInternal ? 'showDialog' : null
|
|
24133
25040
|
},
|
|
24134
25041
|
selectNode: selectNodeEle,
|
|
24135
25042
|
selection: save,
|
|
@@ -25153,7 +26060,7 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
25153
26060
|
var height = vidEleStyle.height !== '' ? parseInt(vidEleStyle.height, 10) : vid.style.height !== '' ? vid.style.height : vid.height;
|
|
25154
26061
|
if (width > height) {
|
|
25155
26062
|
vid.style.minWidth = this.parent.insertVideoSettings.minWidth === 0 ? '140px' : formatUnit(this.parent.insertVideoSettings.minWidth);
|
|
25156
|
-
vid.style.minHeight = this.parent.insertVideoSettings.minHeight === 0 ? '
|
|
26063
|
+
vid.style.minHeight = this.parent.insertVideoSettings.minHeight === 0 ? '60px' : formatUnit(this.parent.insertVideoSettings.minHeight);
|
|
25157
26064
|
if (this.parent.insertVideoSettings.resizeByPercent) {
|
|
25158
26065
|
if (parseInt('' + vid.getBoundingClientRect().width + '', 10) !== 0 && parseInt('' + width + '', 10) !== 0) {
|
|
25159
26066
|
var percentageValue = this.pixToPerc((parseInt(width.toString(), 10) / parseInt(height.toString(), 10) * expectedY), (vid.previousElementSibling || vid.parentElement));
|
|
@@ -25365,8 +26272,9 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
25365
26272
|
}
|
|
25366
26273
|
if (originalEvent.keyCode === 8 || originalEvent.keyCode === 46) {
|
|
25367
26274
|
if (selectNodeEle && (selectNodeEle[0].nodeName === 'VIDEO' || this.isEmbedVidElem(selectNodeEle[0])) && selectNodeEle.length < 1) {
|
|
25368
|
-
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
|
|
26275
|
+
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
|
|
25369
26276
|
save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
26277
|
+
}
|
|
25370
26278
|
originalEvent.preventDefault();
|
|
25371
26279
|
var event_1 = {
|
|
25372
26280
|
selectNode: selectNodeEle, selection: save, selectParent: selectParentEle,
|
|
@@ -25419,8 +26327,9 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
25419
26327
|
}
|
|
25420
26328
|
break;
|
|
25421
26329
|
case 'insert-video':
|
|
25422
|
-
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection))
|
|
26330
|
+
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
|
|
25423
26331
|
save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
26332
|
+
}
|
|
25424
26333
|
this.openDialog(true, originalEvent, save, selectNodeEle, selectParentEle);
|
|
25425
26334
|
originalEvent.preventDefault();
|
|
25426
26335
|
break;
|
|
@@ -25446,7 +26355,8 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
25446
26355
|
this.insertVideo({
|
|
25447
26356
|
args: {
|
|
25448
26357
|
item: { command: 'Videos', subCommand: 'Video' },
|
|
25449
|
-
originalEvent: event
|
|
26358
|
+
originalEvent: event,
|
|
26359
|
+
name: !isInternal ? 'showDialog' : null
|
|
25450
26360
|
},
|
|
25451
26361
|
selectNode: selectNodeEle,
|
|
25452
26362
|
selection: save,
|
|
@@ -25695,7 +26605,7 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
25695
26605
|
};
|
|
25696
26606
|
Video.prototype.showVideoQuickToolbar = function (e) {
|
|
25697
26607
|
var _this = this;
|
|
25698
|
-
if (e.type !== 'Videos' || e.args.detail === 2 || isNullOrUndefined(this.parent.quickToolbarModule)
|
|
26608
|
+
if (e.type !== 'Videos' || (!isNullOrUndefined(e.args) && e.args.detail === 2) || isNullOrUndefined(this.parent.quickToolbarModule)
|
|
25699
26609
|
|| isNullOrUndefined(this.parent.quickToolbarModule.videoQTBar) || isNullOrUndefined(e.args)) {
|
|
25700
26610
|
return;
|
|
25701
26611
|
}
|
|
@@ -26247,7 +27157,7 @@ var ViewSource = /** @__PURE__ @class */ (function () {
|
|
|
26247
27157
|
break;
|
|
26248
27158
|
case 'toolbar-focus':
|
|
26249
27159
|
if (this.parent.toolbarSettings.enable) {
|
|
26250
|
-
var selector = '.e-toolbar-item[
|
|
27160
|
+
var selector = '.e-toolbar-item[title] [tabindex]';
|
|
26251
27161
|
this.parent.toolbarModule.baseToolbar.toolbarObj.element.querySelector(selector).focus();
|
|
26252
27162
|
}
|
|
26253
27163
|
break;
|
|
@@ -26617,8 +27527,9 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
26617
27527
|
if ((event.keyCode === 8 || event.keyCode === 46) ||
|
|
26618
27528
|
(event.ctrlKey && event.keyCode === 88)) {
|
|
26619
27529
|
if (ele && ele.tagName === 'TBODY') {
|
|
26620
|
-
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) && this.contentModule)
|
|
27530
|
+
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) && this.contentModule) {
|
|
26621
27531
|
selection = this.parent.formatter.editorManager.nodeSelection.save(range, this.contentModule.getDocument());
|
|
27532
|
+
}
|
|
26622
27533
|
event.preventDefault();
|
|
26623
27534
|
proxy.removeTable(selection, event, true);
|
|
26624
27535
|
}
|
|
@@ -26632,8 +27543,9 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
26632
27543
|
ele = !isNullOrUndefined(closestTd) && this.parent.inputElement.contains(closestTd) ? closestTd : ele;
|
|
26633
27544
|
}
|
|
26634
27545
|
if (ele && (ele.tagName === 'TD' || ele.tagName === 'TH')) {
|
|
26635
|
-
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) && this.contentModule)
|
|
27546
|
+
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) && this.contentModule) {
|
|
26636
27547
|
selection = this.parent.formatter.editorManager.nodeSelection.save(range, this.contentModule.getDocument());
|
|
27548
|
+
}
|
|
26637
27549
|
switch (event.keyCode) {
|
|
26638
27550
|
case 9:
|
|
26639
27551
|
case 37:
|
|
@@ -26676,7 +27588,8 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
26676
27588
|
item: {
|
|
26677
27589
|
command: 'Table',
|
|
26678
27590
|
subCommand: 'CreateTable'
|
|
26679
|
-
}
|
|
27591
|
+
},
|
|
27592
|
+
name: !isInternal ? 'showDialog' : null
|
|
26680
27593
|
};
|
|
26681
27594
|
this.insertTableDialog({ self: this, args: args, selection: selection });
|
|
26682
27595
|
}
|
|
@@ -26901,9 +27814,18 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
26901
27814
|
var range_1 = this.parent.formatter.editorManager.nodeSelection.getRange(this.contentModule.getDocument());
|
|
26902
27815
|
this.parent.formatter.editorManager.nodeSelection.save(range_1, this.contentModule.getDocument());
|
|
26903
27816
|
this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument());
|
|
26904
|
-
var pageX =
|
|
26905
|
-
var pageY =
|
|
26906
|
-
|
|
27817
|
+
var pageX = void 0;
|
|
27818
|
+
var pageY = void 0;
|
|
27819
|
+
if (Browser.isDevice && e.args.touches) {
|
|
27820
|
+
pageX = e.args.changedTouches[0].pageX;
|
|
27821
|
+
pageY = e.args.changedTouches[0].pageY;
|
|
27822
|
+
}
|
|
27823
|
+
else {
|
|
27824
|
+
pageX = (this.parent.iframeSettings.enable) ? window.pageXOffset
|
|
27825
|
+
+ this.parent.element.getBoundingClientRect().left + args.clientX : args.pageX;
|
|
27826
|
+
pageY = (this.parent.iframeSettings.enable) ? window.pageYOffset +
|
|
27827
|
+
this.parent.element.getBoundingClientRect().top + args.clientY : args.pageY;
|
|
27828
|
+
}
|
|
26907
27829
|
this.quickToolObj.tableQTBar.showPopup(pageX, pageY, target);
|
|
26908
27830
|
this.parent.formatter.editorManager.nodeSelection.restore();
|
|
26909
27831
|
}
|
|
@@ -28123,6 +29045,18 @@ var executeGroup = {
|
|
|
28123
29045
|
'removeFormat': {
|
|
28124
29046
|
command: 'Clear',
|
|
28125
29047
|
subCommand: 'ClearFormat'
|
|
29048
|
+
},
|
|
29049
|
+
'copyFormatPainter': {
|
|
29050
|
+
command: 'FormatPainter',
|
|
29051
|
+
value: 'format-copy'
|
|
29052
|
+
},
|
|
29053
|
+
'applyFormatPainter': {
|
|
29054
|
+
command: 'FormatPainter',
|
|
29055
|
+
value: 'format-paste'
|
|
29056
|
+
},
|
|
29057
|
+
'escapeFormatPainter': {
|
|
29058
|
+
command: 'FormatPainter',
|
|
29059
|
+
value: 'escape'
|
|
28126
29060
|
}
|
|
28127
29061
|
};
|
|
28128
29062
|
|
|
@@ -28422,6 +29356,25 @@ var QuickToolbarSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
28422
29356
|
], QuickToolbarSettings.prototype, "table", void 0);
|
|
28423
29357
|
return QuickToolbarSettings;
|
|
28424
29358
|
}(ChildProperty));
|
|
29359
|
+
/**
|
|
29360
|
+
* Configure the format painter settings of the Rich Text Editor.
|
|
29361
|
+
*/
|
|
29362
|
+
var FormatPainterSettings = /** @__PURE__ @class */ (function (_super) {
|
|
29363
|
+
__extends$5(FormatPainterSettings, _super);
|
|
29364
|
+
function FormatPainterSettings() {
|
|
29365
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
29366
|
+
}
|
|
29367
|
+
__decorate$2([
|
|
29368
|
+
Property(['Text', 'List', 'Table'])
|
|
29369
|
+
], FormatPainterSettings.prototype, "allowedContext", void 0);
|
|
29370
|
+
__decorate$2([
|
|
29371
|
+
Property('b; em; font; sub; sup; kbd; i; s; u; code; strong; span; p; div; h1; h2; h3; h4; h5; h6; blockquote; table; thead; tbody; tr; td; th; ol; ul; li; pre;')
|
|
29372
|
+
], FormatPainterSettings.prototype, "allowedFormats", void 0);
|
|
29373
|
+
__decorate$2([
|
|
29374
|
+
Property(null)
|
|
29375
|
+
], FormatPainterSettings.prototype, "deniedFormats", void 0);
|
|
29376
|
+
return FormatPainterSettings;
|
|
29377
|
+
}(ChildProperty));
|
|
28425
29378
|
/**
|
|
28426
29379
|
* Configures the Paste Cleanup settings of the RichTextEditor.
|
|
28427
29380
|
*/
|
|
@@ -28722,7 +29675,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28722
29675
|
isTableEnter = blockElement.tagName === 'TD' || blockElement.tagName === 'TBODY' ? false : true;
|
|
28723
29676
|
}
|
|
28724
29677
|
if (e.args.which === 13 && e.args.code === 'Enter') {
|
|
28725
|
-
if (isNullOrUndefined(this.startNode.closest('LI,UL,OL')) && isNullOrUndefined(this.endNode.closest('LI,UL,OL')) && isTableEnter &&
|
|
29678
|
+
if (isNullOrUndefined(this.startNode.closest('LI, UL, OL')) && isNullOrUndefined(this.endNode.closest('LI, UL, OL')) && isTableEnter &&
|
|
28726
29679
|
isNullOrUndefined(this.startNode.closest('PRE')) && isNullOrUndefined(this.endNode.closest('PRE'))) {
|
|
28727
29680
|
var shiftKey_1 = e.args.shiftKey;
|
|
28728
29681
|
var actionBeginArgs = {
|
|
@@ -28792,13 +29745,17 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28792
29745
|
}
|
|
28793
29746
|
if (_this.range.startContainer === _this.range.endContainer &&
|
|
28794
29747
|
_this.range.startOffset === _this.range.endOffset && _this.range.startContainer === _this.parent.inputElement) {
|
|
28795
|
-
if (!isNullOrUndefined(_this.range.startContainer.childNodes[_this.range.startOffset]) &&
|
|
28796
|
-
!isNullOrUndefined(_this.range.startContainer.childNodes[_this.range.startOffset].previousElementSibling) &&
|
|
28797
|
-
_this.range.startContainer.childNodes[_this.range.startOffset].previousElementSibling.nodeName === 'TABLE') {
|
|
28798
|
-
_this.parent.tableModule.removeResizeElement();
|
|
28799
|
-
}
|
|
28800
29748
|
if (!(_this.parent.inputElement.childNodes.length === 1 && _this.parent.inputElement.childNodes[0].nodeName === 'TABLE')) {
|
|
28801
|
-
|
|
29749
|
+
if (isNullOrUndefined(_this.range.startContainer.childNodes[_this.range.startOffset])) {
|
|
29750
|
+
var currentLastElem = _this.range.startContainer.childNodes[_this.range.startOffset - 1];
|
|
29751
|
+
while (currentLastElem.lastChild !== null && currentLastElem.nodeName !== '#text') {
|
|
29752
|
+
currentLastElem = currentLastElem.lastChild;
|
|
29753
|
+
}
|
|
29754
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), currentLastElem, (currentLastElem.nodeName === 'BR' ? 0 : currentLastElem.textContent.length));
|
|
29755
|
+
}
|
|
29756
|
+
else {
|
|
29757
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), _this.range.startContainer.childNodes[_this.range.startOffset], 0);
|
|
29758
|
+
}
|
|
28802
29759
|
}
|
|
28803
29760
|
_this.getRangeNode();
|
|
28804
29761
|
}
|
|
@@ -28823,7 +29780,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28823
29780
|
var isFocusedFirst = false;
|
|
28824
29781
|
if (_this.range.startOffset !== 0 && _this.range.endOffset !== 0 &&
|
|
28825
29782
|
_this.range.startContainer === _this.range.endContainer && !(!isNullOrUndefined(nearBlockNode.childNodes[0])
|
|
28826
|
-
&& nearBlockNode.childNodes[0].nodeName === 'IMG' && nearBlockNode.querySelectorAll('img,audio,video').length > 0)) {
|
|
29783
|
+
&& nearBlockNode.childNodes[0].nodeName === 'IMG' && nearBlockNode.querySelectorAll('img, audio, video').length > 0)) {
|
|
28827
29784
|
var startNodeText = _this.range.startContainer.textContent;
|
|
28828
29785
|
var splitFirstText = startNodeText.substring(0, _this.range.startOffset);
|
|
28829
29786
|
// eslint-disable-next-line max-len
|
|
@@ -28844,8 +29801,8 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28844
29801
|
(_this.range.startContainer.previousSibling.nodeName === 'IMG' || _this.range.startContainer.previousSibling.nodeName === 'BR'))) {
|
|
28845
29802
|
var isNearBlockLengthZero = void 0;
|
|
28846
29803
|
var newElem = void 0;
|
|
28847
|
-
if (!isNullOrUndefined(_this.range.startContainer.childNodes) && _this.range.startContainer.textContent.length === 0
|
|
28848
|
-
(_this.range.startContainer.querySelectorAll('img,audio,video').length > 0 ||
|
|
29804
|
+
if (!isNullOrUndefined(_this.range.startContainer.childNodes) && _this.range.startContainer.textContent.length === 0
|
|
29805
|
+
&& (_this.range.startContainer.querySelectorAll('img, audio, video').length > 0 ||
|
|
28849
29806
|
_this.range.startContainer.nodeName === 'IMG' || _this.range.startContainer.nodeName === 'TABLE')) {
|
|
28850
29807
|
newElem = _this.createInsertElement(shiftKey_1);
|
|
28851
29808
|
isMediaNode = true;
|
|
@@ -28854,7 +29811,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28854
29811
|
else {
|
|
28855
29812
|
if ((nearBlockNode.textContent.trim().length !== 0 ||
|
|
28856
29813
|
nearBlockNode.childNodes[0].nodeName === 'IMG' ||
|
|
28857
|
-
(nearBlockNode.textContent.trim() === '' && nearBlockNode.querySelectorAll('img,audio,video').length > 0))) {
|
|
29814
|
+
(nearBlockNode.textContent.trim() === '' && nearBlockNode.querySelectorAll('img, audio, video').length > 0))) {
|
|
28858
29815
|
if ((_this.range.startOffset === _this.range.endOffset && _this.range.startOffset !== 0)) {
|
|
28859
29816
|
newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
|
|
28860
29817
|
}
|
|
@@ -29020,11 +29977,13 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
29020
29977
|
}
|
|
29021
29978
|
var isLastNodeLength = _this.range.startContainer === currentParentLastChild ?
|
|
29022
29979
|
_this.range.startContainer.textContent.length : currentParent.textContent.length;
|
|
29980
|
+
var isImageElement = (_this.range.startContainer.nodeName === 'IMG' || (_this.range.startContainer.childNodes.length > 0
|
|
29981
|
+
&& _this.range.startContainer.childNodes[_this.range.startOffset].nodeName === 'IMG'));
|
|
29023
29982
|
if (currentParent !== _this.parent.inputElement &&
|
|
29024
29983
|
_this.parent.formatter.editorManager.domNode.isBlockNode(currentParent) &&
|
|
29025
29984
|
_this.range.startOffset === _this.range.endOffset &&
|
|
29026
29985
|
(_this.range.startOffset === isLastNodeLength ||
|
|
29027
|
-
(currentParent.textContent.trim().length === 0 &&
|
|
29986
|
+
(currentParent.textContent.trim().length === 0 && isImageElement))) {
|
|
29028
29987
|
var focusBRElem = _this.parent.createElement('br');
|
|
29029
29988
|
if (_this.range.startOffset === 0 && _this.range.startContainer.nodeName === 'TABLE') {
|
|
29030
29989
|
_this.range.startContainer.parentElement.insertBefore(focusBRElem, _this.range.startContainer);
|
|
@@ -29033,10 +29992,11 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
29033
29992
|
if (currentParentLastChild.nodeName === 'BR' && currentParent.textContent.length === 0) {
|
|
29034
29993
|
_this.parent.formatter.editorManager.domNode.insertAfter(focusBRElem, currentParentLastChild);
|
|
29035
29994
|
}
|
|
29036
|
-
else if (_this.range.startOffset === 0 && _this.range.endOffset === 0 &&
|
|
29037
|
-
|
|
29038
|
-
|
|
29039
|
-
focusBRElem
|
|
29995
|
+
else if (_this.range.startOffset === 0 && _this.range.endOffset === 0 && isImageElement) {
|
|
29996
|
+
var imageElement = _this.range.startContainer.nodeName === 'IMG' ? _this.range.startContainer :
|
|
29997
|
+
_this.range.startContainer.childNodes[_this.range.startOffset];
|
|
29998
|
+
currentParent.insertBefore(focusBRElem, imageElement);
|
|
29999
|
+
focusBRElem = imageElement;
|
|
29040
30000
|
}
|
|
29041
30001
|
else {
|
|
29042
30002
|
var lineBreakBRElem = _this.parent.createElement('br');
|
|
@@ -29238,6 +30198,10 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29238
30198
|
member: 'video',
|
|
29239
30199
|
args: [this, this.serviceLocator]
|
|
29240
30200
|
});
|
|
30201
|
+
modules.push({
|
|
30202
|
+
member: 'formatPainter',
|
|
30203
|
+
args: [this]
|
|
30204
|
+
});
|
|
29241
30205
|
}
|
|
29242
30206
|
if (this.fileManagerSettings.enable) {
|
|
29243
30207
|
modules.push({ member: 'fileManager', args: [this, this.serviceLocator] });
|
|
@@ -29307,7 +30271,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29307
30271
|
this.setContainer();
|
|
29308
30272
|
this.persistData();
|
|
29309
30273
|
setStyleAttribute(this.element, { 'width': formatUnit(this.width) });
|
|
29310
|
-
attributes(this.element, { role: 'application' });
|
|
30274
|
+
attributes(this.element, { role: 'application', 'aria-label': 'Rich Text Editor' });
|
|
29311
30275
|
};
|
|
29312
30276
|
RichTextEditor.prototype.persistData = function () {
|
|
29313
30277
|
if (this.enablePersistence && this.originalElement.tagName === 'TEXTAREA') {
|
|
@@ -29448,6 +30412,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29448
30412
|
*/
|
|
29449
30413
|
RichTextEditor.prototype.executeCommand = function (commandName, value, option) {
|
|
29450
30414
|
value = this.htmlPurifier(commandName, value);
|
|
30415
|
+
var internalValue;
|
|
29451
30416
|
if (this.editorMode === 'HTML') {
|
|
29452
30417
|
var range = this.getRange();
|
|
29453
30418
|
if (this.iframeSettings.enable) {
|
|
@@ -29494,7 +30459,16 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29494
30459
|
return;
|
|
29495
30460
|
}
|
|
29496
30461
|
}
|
|
29497
|
-
|
|
30462
|
+
internalValue = value;
|
|
30463
|
+
if (tool.command === 'FormatPainter') {
|
|
30464
|
+
if (!isNullOrUndefined(value)) {
|
|
30465
|
+
this.formatPainterSettings = value;
|
|
30466
|
+
}
|
|
30467
|
+
internalValue = {
|
|
30468
|
+
formatPainterAction: tool.value
|
|
30469
|
+
};
|
|
30470
|
+
}
|
|
30471
|
+
this.formatter.editorManager.execCommand(tool.command, tool.subCommand ? tool.subCommand : (internalValue ? internalValue : tool.value), null, null, (internalValue ? internalValue : tool.value), (internalValue ? internalValue : tool.value));
|
|
29498
30472
|
if (option && option.undo) {
|
|
29499
30473
|
this.formatter.saveData();
|
|
29500
30474
|
this.formatter.enableUndo(this);
|
|
@@ -29752,11 +30726,13 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29752
30726
|
var endNode = range.endContainer.nodeName === '#text' ? range.endContainer.parentElement :
|
|
29753
30727
|
range.endContainer;
|
|
29754
30728
|
var closestLI = closest(endNode, 'LI');
|
|
30729
|
+
var isDetached = false;
|
|
29755
30730
|
if (!isNullOrUndefined(closestLI) && endNode.textContent.length === range.endOffset &&
|
|
29756
30731
|
!range.collapsed && isNullOrUndefined(endNode.nextElementSibling)) {
|
|
29757
30732
|
for (var i = 0; i < closestLI.childNodes.length; i++) {
|
|
29758
30733
|
if (closestLI.childNodes[i].nodeName === '#text' && closestLI.childNodes[i].textContent.trim().length === 0) {
|
|
29759
30734
|
detach(closestLI.childNodes[i]);
|
|
30735
|
+
isDetached = true;
|
|
29760
30736
|
i--;
|
|
29761
30737
|
}
|
|
29762
30738
|
}
|
|
@@ -29764,7 +30740,11 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29764
30740
|
while (currentLastElem.lastChild !== null && currentLastElem.nodeName !== '#text') {
|
|
29765
30741
|
currentLastElem = currentLastElem.lastChild;
|
|
29766
30742
|
}
|
|
29767
|
-
|
|
30743
|
+
if (isDetached) {
|
|
30744
|
+
var currentLast = currentLastElem.nodeName === 'BR' && !isNullOrUndefined(currentLastElem.previousSibling) ?
|
|
30745
|
+
currentLastElem.previousSibling : currentLastElem;
|
|
30746
|
+
this.formatter.editorManager.nodeSelection.setSelectionText(this.contentModule.getDocument(), isSameContainer ? currentLast : currentStartContainer, currentLast, currentStartOffset, (currentLast.nodeName === 'BR' ? 0 : currentLast.textContent.length));
|
|
30747
|
+
}
|
|
29768
30748
|
}
|
|
29769
30749
|
};
|
|
29770
30750
|
/**
|
|
@@ -29828,14 +30808,21 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29828
30808
|
this.formatter.saveData();
|
|
29829
30809
|
}
|
|
29830
30810
|
if (e.action !== 'insert-link' &&
|
|
30811
|
+
e.action !== 'format-copy' && e.action !== 'format-paste' &&
|
|
29831
30812
|
(e.action && e.action !== 'paste' && e.action !== 'space'
|
|
29832
30813
|
|| e.which === 9 || (e.code === 'Backspace' && e.which === 8))) {
|
|
29833
|
-
|
|
30814
|
+
var FormatPainterEscapeAction = false;
|
|
30815
|
+
if (!isNullOrUndefined(this.formatPainterModule)) {
|
|
30816
|
+
FormatPainterEscapeAction = this.formatPainterModule.previousAction === 'escape';
|
|
30817
|
+
}
|
|
30818
|
+
if (!FormatPainterEscapeAction) {
|
|
30819
|
+
this.formatter.process(this, null, e);
|
|
30820
|
+
}
|
|
29834
30821
|
switch (e.action) {
|
|
29835
30822
|
case 'toolbar-focus':
|
|
29836
30823
|
if (this.toolbarSettings.enable) {
|
|
29837
30824
|
// eslint-disable-next-line
|
|
29838
|
-
var selector = '.e-toolbar-item[
|
|
30825
|
+
var selector = '.e-toolbar-item[title] [tabindex]';
|
|
29839
30826
|
this.toolbarModule.baseToolbar.toolbarObj.element.querySelector(selector).focus();
|
|
29840
30827
|
}
|
|
29841
30828
|
break;
|
|
@@ -30783,6 +31770,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30783
31770
|
}
|
|
30784
31771
|
else {
|
|
30785
31772
|
var compiledTemplate = compile(this.valueTemplate)('', this, 'valueTemplate');
|
|
31773
|
+
// eslint-disable-next-line
|
|
30786
31774
|
if (typeof this.valueTemplate !== 'string' && this.isReact) {
|
|
30787
31775
|
this.displayTempElem = this.createElement('div');
|
|
30788
31776
|
for (var i = 0; i < compiledTemplate.length; i++) {
|
|
@@ -30822,7 +31810,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30822
31810
|
}
|
|
30823
31811
|
}
|
|
30824
31812
|
};
|
|
30825
|
-
// eslint-disable-next-line
|
|
31813
|
+
// eslint-disable-next-line
|
|
30826
31814
|
RichTextEditor.prototype.renderTemplates = function (callBack) {
|
|
30827
31815
|
this.renderReactTemplates(callBack);
|
|
30828
31816
|
};
|
|
@@ -30936,7 +31924,9 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30936
31924
|
* @public
|
|
30937
31925
|
*/
|
|
30938
31926
|
RichTextEditor.prototype.getHtml = function () {
|
|
30939
|
-
|
|
31927
|
+
var htmlValue = this.contentModule.getEditPanel().innerHTML;
|
|
31928
|
+
return (this.enableXhtml && (htmlValue === '<p><br></p>' || htmlValue === '<div><br></div>' ||
|
|
31929
|
+
htmlValue === '<br>') ? null : this.serializeValue(htmlValue));
|
|
30940
31930
|
};
|
|
30941
31931
|
/**
|
|
30942
31932
|
* Retrieves the Rich Text Editor's XHTML validated HTML content when `enableXhtml` property is enabled.
|
|
@@ -31187,8 +32177,8 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
31187
32177
|
}
|
|
31188
32178
|
var getTextArea = this.element.querySelector('.e-rte-srctextarea');
|
|
31189
32179
|
if (this.editorMode === 'HTML') {
|
|
31190
|
-
value = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>'
|
|
31191
|
-
|
|
32180
|
+
value = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
|
|
32181
|
+
this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
|
|
31192
32182
|
this.encode(decode(this.inputElement.innerHTML)) : this.inputElement.innerHTML;
|
|
31193
32183
|
if (getTextArea && getTextArea.style.display === 'block') {
|
|
31194
32184
|
value = getTextArea.value;
|
|
@@ -31540,6 +32530,9 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
31540
32530
|
__decorate$1([
|
|
31541
32531
|
Complex({}, PasteCleanupSettings)
|
|
31542
32532
|
], RichTextEditor.prototype, "pasteCleanupSettings", void 0);
|
|
32533
|
+
__decorate$1([
|
|
32534
|
+
Complex({}, FormatPainterSettings)
|
|
32535
|
+
], RichTextEditor.prototype, "formatPainterSettings", void 0);
|
|
31543
32536
|
__decorate$1([
|
|
31544
32537
|
Complex({}, IFrameSettings)
|
|
31545
32538
|
], RichTextEditor.prototype, "iframeSettings", void 0);
|
|
@@ -31570,6 +32563,9 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
31570
32563
|
__decorate$1([
|
|
31571
32564
|
Property(false)
|
|
31572
32565
|
], RichTextEditor.prototype, "enablePersistence", void 0);
|
|
32566
|
+
__decorate$1([
|
|
32567
|
+
Property(true)
|
|
32568
|
+
], RichTextEditor.prototype, "showTooltip", void 0);
|
|
31573
32569
|
__decorate$1([
|
|
31574
32570
|
Property(false)
|
|
31575
32571
|
], RichTextEditor.prototype, "enableResize", void 0);
|
|
@@ -31810,10 +32806,6 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
31810
32806
|
* Base export
|
|
31811
32807
|
*/
|
|
31812
32808
|
|
|
31813
|
-
/**
|
|
31814
|
-
* Base export
|
|
31815
|
-
*/
|
|
31816
|
-
|
|
31817
32809
|
/**
|
|
31818
32810
|
* Export all markdown plugins
|
|
31819
32811
|
*/
|
|
@@ -31830,5 +32822,5 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
31830
32822
|
* Rich Text Editor component exported items
|
|
31831
32823
|
*/
|
|
31832
32824
|
|
|
31833
|
-
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, HTMLFormatter, Formatter, MarkdownFormatter, ContentRender, Render, ToolbarRenderer, Link, 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, blockEmptyNodes, inlineEmptyNodes, CLS_RTE, CLS_RTL, CLS_CONTENT, CLS_DISABLED, CLS_SCRIPT_SHEET, CLS_STYLE_SHEET, CLS_TOOLBAR, CLS_TB_FIXED, CLS_TB_FLOAT, CLS_TB_ABS_FLOAT, CLS_INLINE, CLS_TB_INLINE, CLS_RTE_EXPAND_TB, CLS_FULL_SCREEN, CLS_QUICK_TB, CLS_POP, CLS_TB_STATIC, CLS_QUICK_POP, CLS_QUICK_DROPDOWN, CLS_IMAGE_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, 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, 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, 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, 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 };
|
|
32825
|
+
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, HTMLFormatter, Formatter, MarkdownFormatter, ContentRender, Render, ToolbarRenderer, Link, 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, blockEmptyNodes, inlineEmptyNodes, CLS_RTE, CLS_RTL, CLS_CONTENT, CLS_DISABLED, CLS_SCRIPT_SHEET, CLS_STYLE_SHEET, CLS_TOOLBAR, CLS_TB_FIXED, CLS_TB_FLOAT, CLS_TB_ABS_FLOAT, CLS_INLINE, CLS_TB_INLINE, CLS_RTE_EXPAND_TB, CLS_FULL_SCREEN, CLS_QUICK_TB, CLS_POP, CLS_TB_STATIC, CLS_QUICK_POP, CLS_QUICK_DROPDOWN, CLS_IMAGE_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, 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, 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, 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, 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 };
|
|
31834
32826
|
//# sourceMappingURL=ej2-richtexteditor.es5.js.map
|