@syncfusion/ej2-richtexteditor 23.2.7-52849 → 24.1.41
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/.eslintrc.json +260 -0
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +40 -40
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +27 -27
- package/CHANGELOG.md +1775 -1751
- package/README.md +76 -76
- package/dist/ej2-richtexteditor.min.js +10 -0
- package/dist/ej2-richtexteditor.umd.min.js +10 -1
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +682 -434
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +791 -543
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/dist/global/ej2-richtexteditor.min.js +11 -0
- package/dist/global/ej2-richtexteditor.min.js.map +1 -0
- package/dist/global/index.d.ts +14 -0
- package/helpers/e2e/index.js +3 -3
- package/helpers/e2e/rte-helper.js +13 -13
- package/license +9 -9
- package/package.json +74 -74
- package/src/common/config.js +1 -1
- package/src/common/interface.d.ts +7 -7
- package/src/editor-manager/base/classes.d.ts +1 -1
- package/src/editor-manager/base/classes.js +1 -1
- package/src/editor-manager/base/editor-manager.d.ts +3 -3
- package/src/editor-manager/base/editor-manager.js +3 -3
- package/src/editor-manager/base/enum.d.ts +2 -2
- package/src/editor-manager/base/interface.d.ts +9 -9
- package/src/editor-manager/base/types.d.ts +1 -1
- package/src/editor-manager/plugin/alignments.d.ts +2 -2
- package/src/editor-manager/plugin/alignments.js +2 -2
- package/src/editor-manager/plugin/audio.d.ts +3 -3
- package/src/editor-manager/plugin/audio.js +16 -6
- package/src/editor-manager/plugin/clearformat-exec.d.ts +2 -2
- package/src/editor-manager/plugin/clearformat-exec.js +2 -2
- package/src/editor-manager/plugin/clearformat.d.ts +1 -1
- package/src/editor-manager/plugin/clearformat.js +1 -1
- package/src/editor-manager/plugin/dom-node.d.ts +34 -34
- package/src/editor-manager/plugin/dom-node.js +35 -48
- package/src/editor-manager/plugin/format-painter-actions.d.ts +1 -1
- package/src/editor-manager/plugin/format-painter-actions.js +1 -1
- package/src/editor-manager/plugin/formats.d.ts +2 -2
- package/src/editor-manager/plugin/formats.js +2 -2
- package/src/editor-manager/plugin/image.d.ts +3 -3
- package/src/editor-manager/plugin/image.js +33 -6
- package/src/editor-manager/plugin/indents.d.ts +2 -2
- package/src/editor-manager/plugin/indents.js +2 -2
- package/src/editor-manager/plugin/insert-methods.d.ts +4 -4
- package/src/editor-manager/plugin/insert-methods.js +4 -4
- package/src/editor-manager/plugin/insert-text.d.ts +2 -2
- package/src/editor-manager/plugin/insert-text.js +2 -2
- package/src/editor-manager/plugin/inserthtml-exec.d.ts +2 -2
- package/src/editor-manager/plugin/inserthtml-exec.js +2 -2
- package/src/editor-manager/plugin/inserthtml.d.ts +2 -2
- package/src/editor-manager/plugin/inserthtml.js +7 -4
- package/src/editor-manager/plugin/isformatted.d.ts +8 -8
- package/src/editor-manager/plugin/isformatted.js +8 -8
- package/src/editor-manager/plugin/link.d.ts +2 -2
- package/src/editor-manager/plugin/link.js +2 -2
- package/src/editor-manager/plugin/lists.d.ts +2 -2
- package/src/editor-manager/plugin/lists.js +2 -2
- package/src/editor-manager/plugin/ms-word-clean-up.d.ts +1 -1
- package/src/editor-manager/plugin/ms-word-clean-up.js +5 -2
- package/src/editor-manager/plugin/nodecutter.d.ts +6 -6
- package/src/editor-manager/plugin/nodecutter.js +7 -7
- package/src/editor-manager/plugin/selection-commands.d.ts +1 -1
- package/src/editor-manager/plugin/selection-commands.js +40 -1
- package/src/editor-manager/plugin/selection-exec.d.ts +2 -2
- package/src/editor-manager/plugin/selection-exec.js +2 -2
- package/src/editor-manager/plugin/table.d.ts +2 -2
- package/src/editor-manager/plugin/table.js +2 -2
- package/src/editor-manager/plugin/toolbar-status.d.ts +2 -2
- package/src/editor-manager/plugin/toolbar-status.js +2 -2
- package/src/editor-manager/plugin/undo.d.ts +6 -6
- package/src/editor-manager/plugin/undo.js +6 -6
- package/src/editor-manager/plugin/video.d.ts +3 -3
- package/src/editor-manager/plugin/video.js +3 -3
- package/src/markdown-parser/base/interface.d.ts +10 -10
- package/src/markdown-parser/base/markdown-parser.d.ts +3 -3
- package/src/markdown-parser/base/markdown-parser.js +3 -3
- package/src/markdown-parser/base/types.d.ts +1 -1
- package/src/markdown-parser/plugin/clearformat.d.ts +2 -2
- package/src/markdown-parser/plugin/clearformat.js +2 -2
- package/src/markdown-parser/plugin/formats.d.ts +2 -2
- package/src/markdown-parser/plugin/formats.js +2 -2
- package/src/markdown-parser/plugin/insert-text.d.ts +2 -2
- package/src/markdown-parser/plugin/insert-text.js +2 -2
- package/src/markdown-parser/plugin/link.d.ts +2 -2
- package/src/markdown-parser/plugin/link.js +2 -2
- package/src/markdown-parser/plugin/markdown-selection.d.ts +14 -14
- package/src/markdown-parser/plugin/markdown-selection.js +14 -14
- package/src/markdown-parser/plugin/md-selection-formats.d.ts +1 -1
- package/src/markdown-parser/plugin/md-selection-formats.js +1 -1
- package/src/markdown-parser/plugin/table.d.ts +3 -3
- package/src/markdown-parser/plugin/table.js +3 -3
- package/src/markdown-parser/plugin/undo.d.ts +6 -6
- package/src/markdown-parser/plugin/undo.js +6 -6
- package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +9 -9
- package/src/rich-text-editor/actions/base-quick-toolbar.js +27 -13
- package/src/rich-text-editor/actions/base-toolbar.d.ts +3 -3
- package/src/rich-text-editor/actions/base-toolbar.js +3 -3
- package/src/rich-text-editor/actions/color-picker.d.ts +2 -2
- package/src/rich-text-editor/actions/color-picker.js +5 -5
- package/src/rich-text-editor/actions/count.d.ts +3 -3
- package/src/rich-text-editor/actions/count.js +3 -3
- package/src/rich-text-editor/actions/dropdown-buttons.d.ts +2 -2
- package/src/rich-text-editor/actions/dropdown-buttons.js +6 -4
- package/src/rich-text-editor/actions/emoji-picker.d.ts +1 -1
- package/src/rich-text-editor/actions/emoji-picker.js +13 -4
- package/src/rich-text-editor/actions/enter-key.js +2 -1
- package/src/rich-text-editor/actions/file-manager.js +1 -1
- package/src/rich-text-editor/actions/format-painter.js +1 -1
- package/src/rich-text-editor/actions/full-screen.d.ts +3 -3
- package/src/rich-text-editor/actions/full-screen.js +5 -5
- package/src/rich-text-editor/actions/html-editor.d.ts +5 -3
- package/src/rich-text-editor/actions/html-editor.js +32 -6
- package/src/rich-text-editor/actions/keyboard-model.d.ts +16 -16
- package/src/rich-text-editor/actions/keyboard.d.ts +1 -1
- package/src/rich-text-editor/actions/keyboard.js +20 -20
- package/src/rich-text-editor/actions/markdown-editor.d.ts +2 -2
- package/src/rich-text-editor/actions/markdown-editor.js +2 -2
- package/src/rich-text-editor/actions/paste-clean-up.d.ts +3 -1
- package/src/rich-text-editor/actions/paste-clean-up.js +73 -20
- package/src/rich-text-editor/actions/quick-toolbar.d.ts +9 -9
- package/src/rich-text-editor/actions/quick-toolbar.js +33 -14
- package/src/rich-text-editor/actions/toolbar.d.ts +14 -13
- package/src/rich-text-editor/actions/toolbar.js +31 -23
- package/src/rich-text-editor/actions/xhtml-validation.d.ts +1 -1
- package/src/rich-text-editor/actions/xhtml-validation.js +1 -1
- package/src/rich-text-editor/base/classes.d.ts +126 -121
- package/src/rich-text-editor/base/classes.js +126 -121
- package/src/rich-text-editor/base/constant.d.ts +155 -150
- package/src/rich-text-editor/base/constant.js +155 -150
- package/src/rich-text-editor/base/enum.d.ts +1 -1
- package/src/rich-text-editor/base/enum.js +1 -1
- package/src/rich-text-editor/base/interface.d.ts +59 -49
- package/src/rich-text-editor/base/interface.js +1 -1
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +891 -891
- package/src/rich-text-editor/base/rich-text-editor.d.ts +69 -60
- package/src/rich-text-editor/base/rich-text-editor.js +143 -80
- package/src/rich-text-editor/base/util.d.ts +1 -1
- package/src/rich-text-editor/base/util.js +12 -3
- package/src/rich-text-editor/formatter/formatter.d.ts +8 -8
- package/src/rich-text-editor/formatter/formatter.js +9 -9
- package/src/rich-text-editor/formatter/html-formatter.d.ts +2 -2
- package/src/rich-text-editor/formatter/html-formatter.js +15 -15
- package/src/rich-text-editor/formatter/markdown-formatter.d.ts +2 -2
- package/src/rich-text-editor/formatter/markdown-formatter.js +15 -15
- package/src/rich-text-editor/models/default-locale.js +2 -0
- package/src/rich-text-editor/models/iframe-settings-model.d.ts +26 -26
- package/src/rich-text-editor/models/iframe-settings.js +19 -19
- package/src/rich-text-editor/models/inline-mode-model.d.ts +11 -11
- package/src/rich-text-editor/models/inline-mode.js +19 -19
- package/src/rich-text-editor/models/items.js +1 -1
- package/src/rich-text-editor/models/toolbar-settings-model.d.ts +760 -760
- package/src/rich-text-editor/models/toolbar-settings.js +19 -19
- package/src/rich-text-editor/renderer/audio-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/audio-module.js +1 -1
- package/src/rich-text-editor/renderer/content-renderer.d.ts +6 -6
- package/src/rich-text-editor/renderer/content-renderer.js +6 -6
- package/src/rich-text-editor/renderer/dialog-renderer.d.ts +2 -2
- package/src/rich-text-editor/renderer/dialog-renderer.js +12 -3
- package/src/rich-text-editor/renderer/iframe-content-renderer.d.ts +4 -4
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +17 -17
- package/src/rich-text-editor/renderer/image-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/image-module.js +53 -53
- package/src/rich-text-editor/renderer/link-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/link-module.js +44 -24
- package/src/rich-text-editor/renderer/markdown-renderer.d.ts +6 -6
- package/src/rich-text-editor/renderer/markdown-renderer.js +6 -6
- package/src/rich-text-editor/renderer/popup-renderer.d.ts +5 -5
- package/src/rich-text-editor/renderer/popup-renderer.js +5 -5
- package/src/rich-text-editor/renderer/render.d.ts +2 -2
- package/src/rich-text-editor/renderer/render.js +2 -2
- package/src/rich-text-editor/renderer/table-module.d.ts +3 -1
- package/src/rich-text-editor/renderer/table-module.js +44 -31
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +9 -15
- package/src/rich-text-editor/renderer/toolbar-renderer.js +22 -102
- package/src/rich-text-editor/renderer/video-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/video-module.js +1 -1
- package/src/rich-text-editor/renderer/view-source.d.ts +6 -6
- package/src/rich-text-editor/renderer/view-source.js +9 -7
- package/src/rich-text-editor/services/renderer-factory.d.ts +3 -3
- package/src/rich-text-editor/services/renderer-factory.js +3 -3
- package/src/rich-text-editor/services/service-locator.d.ts +3 -3
- package/src/rich-text-editor/services/service-locator.js +3 -3
- package/src/selection/selection.d.ts +22 -22
- package/src/selection/selection.js +22 -22
- package/styles/_all.scss +1 -1
- package/styles/bootstrap-dark.css +194 -52
- package/styles/bootstrap.css +197 -53
- package/styles/bootstrap4.css +194 -52
- package/styles/bootstrap5-dark.css +195 -53
- package/styles/bootstrap5.css +195 -53
- package/styles/fabric-dark.css +194 -52
- package/styles/fabric.css +194 -52
- package/styles/fluent-dark.css +197 -53
- package/styles/fluent.css +197 -53
- package/styles/highcontrast-light.css +194 -52
- package/styles/highcontrast.css +194 -52
- package/styles/material-dark.css +196 -53
- package/styles/material.css +196 -53
- package/styles/material3-dark.css +194 -52
- package/styles/material3-dark.scss +1 -1
- package/styles/material3.css +194 -52
- package/styles/material3.scss +1 -1
- package/styles/rich-text-editor/_all.scss +2 -2
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +277 -277
- package/styles/rich-text-editor/_bootstrap-definition.scss +334 -334
- package/styles/rich-text-editor/_bootstrap4-definition.scss +460 -460
- package/styles/rich-text-editor/_bootstrap5-definition.scss +262 -262
- package/styles/rich-text-editor/_fabric-dark-definition.scss +259 -259
- package/styles/rich-text-editor/_fabric-definition.scss +257 -257
- package/styles/rich-text-editor/_fluent-definition.scss +263 -263
- package/styles/rich-text-editor/_fusionnew-definition.scss +261 -261
- package/styles/rich-text-editor/_highcontrast-definition.scss +257 -257
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +257 -257
- package/styles/rich-text-editor/_layout.scss +2147 -2072
- package/styles/rich-text-editor/_material-dark-definition.scss +262 -262
- package/styles/rich-text-editor/_material-definition.scss +260 -260
- package/styles/rich-text-editor/_material3-definition.scss +262 -262
- package/styles/rich-text-editor/_tailwind-definition.scss +257 -257
- package/styles/rich-text-editor/_theme.scss +837 -837
- package/styles/rich-text-editor/bootstrap-dark.css +194 -52
- package/styles/rich-text-editor/bootstrap.css +197 -53
- package/styles/rich-text-editor/bootstrap4.css +194 -52
- package/styles/rich-text-editor/bootstrap5-dark.css +195 -53
- package/styles/rich-text-editor/bootstrap5.css +195 -53
- package/styles/rich-text-editor/fabric-dark.css +194 -52
- package/styles/rich-text-editor/fabric.css +194 -52
- package/styles/rich-text-editor/fluent-dark.css +197 -53
- package/styles/rich-text-editor/fluent.css +197 -53
- package/styles/rich-text-editor/highcontrast-light.css +194 -52
- package/styles/rich-text-editor/highcontrast.css +194 -52
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +349 -349
- package/styles/rich-text-editor/icons/_bootstrap.scss +349 -349
- package/styles/rich-text-editor/icons/_bootstrap4.scss +349 -349
- package/styles/rich-text-editor/icons/_bootstrap5.scss +348 -348
- package/styles/rich-text-editor/icons/_fabric-dark.scss +349 -349
- package/styles/rich-text-editor/icons/_fabric.scss +349 -349
- package/styles/rich-text-editor/icons/_fluent.scss +348 -348
- package/styles/rich-text-editor/icons/_fusionnew.scss +348 -348
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +349 -349
- package/styles/rich-text-editor/icons/_highcontrast.scss +349 -349
- package/styles/rich-text-editor/icons/_material-dark.scss +349 -349
- package/styles/rich-text-editor/icons/_material.scss +349 -349
- package/styles/rich-text-editor/icons/_material3.scss +348 -348
- package/styles/rich-text-editor/icons/_tailwind.scss +348 -348
- package/styles/rich-text-editor/material-dark.css +196 -53
- package/styles/rich-text-editor/material.css +196 -53
- package/styles/rich-text-editor/material3-dark.css +194 -52
- package/styles/rich-text-editor/material3-dark.scss +1 -1
- package/styles/rich-text-editor/material3.css +194 -52
- package/styles/rich-text-editor/material3.scss +1 -1
- package/styles/rich-text-editor/tailwind-dark.css +194 -52
- package/styles/rich-text-editor/tailwind.css +194 -52
- package/styles/tailwind-dark.css +194 -52
- package/styles/tailwind.css +194 -52
- package/tslint.json +111 -0
- package/src/global.d.ts +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { addClass, Browser, removeClass,
|
|
2
|
-
import { getInstance, closest, selectAll
|
|
1
|
+
import { addClass, Browser, removeClass, formatUnit, isNullOrUndefined, isNullOrUndefined as isNOU } from '@syncfusion/ej2-base';
|
|
2
|
+
import { getInstance, closest, selectAll } from '@syncfusion/ej2-base';
|
|
3
3
|
import { Toolbar } from '@syncfusion/ej2-navigations';
|
|
4
4
|
import { DropDownButton } from '@syncfusion/ej2-splitbuttons';
|
|
5
5
|
import { Popup, Tooltip } from '@syncfusion/ej2-popups';
|
|
@@ -12,7 +12,7 @@ import { hasClass } from '../base/util';
|
|
|
12
12
|
* `Toolbar renderer` module is used to render toolbar in RichTextEditor.
|
|
13
13
|
*
|
|
14
14
|
* @hidden
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
*/
|
|
17
17
|
var ToolbarRenderer = /** @class */ (function () {
|
|
18
18
|
/**
|
|
@@ -30,21 +30,19 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
30
30
|
}
|
|
31
31
|
ToolbarRenderer.prototype.wireEvent = function () {
|
|
32
32
|
this.parent.on(events.destroy, this.unWireEvent, this);
|
|
33
|
-
this.parent.on(events.
|
|
33
|
+
this.parent.on(events.destroyTooltip, this.destroyTooltip, this);
|
|
34
34
|
};
|
|
35
35
|
ToolbarRenderer.prototype.destroyTooltip = function () {
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
var currentDocument = this.parent.iframeSettings.enable ? this.parent.contentModule.getPanel().ownerDocument :
|
|
37
|
+
this.parent.contentModule.getDocument();
|
|
38
|
+
if (!isNullOrUndefined(currentDocument.querySelector('.e-tooltip-wrap')) && !isNullOrUndefined(currentDocument.querySelector('[data-tooltip-id]'))) {
|
|
39
|
+
var tooltipTargetEle = currentDocument.querySelector('[data-tooltip-id]');
|
|
38
40
|
var event_1 = new MouseEvent('mouseleave', { bubbles: true, cancelable: true });
|
|
39
41
|
tooltipTargetEle.dispatchEvent(event_1);
|
|
40
42
|
}
|
|
41
43
|
};
|
|
42
44
|
ToolbarRenderer.prototype.unWireEvent = function () {
|
|
43
45
|
this.parent.off(events.destroy, this.unWireEvent);
|
|
44
|
-
if (this.popupOverlay) {
|
|
45
|
-
EventHandler.remove(this.popupOverlay, 'click touchmove', this.onPopupOverlay);
|
|
46
|
-
}
|
|
47
|
-
this.removePopupContainer();
|
|
48
46
|
};
|
|
49
47
|
ToolbarRenderer.prototype.toolbarBeforeCreate = function (e) {
|
|
50
48
|
if (this.mode === 'Extended') {
|
|
@@ -65,7 +63,6 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
65
63
|
};
|
|
66
64
|
ToolbarRenderer.prototype.dropDownSelected = function (args) {
|
|
67
65
|
this.parent.notify(events.dropDownSelect, args);
|
|
68
|
-
this.onPopupOverlay();
|
|
69
66
|
};
|
|
70
67
|
ToolbarRenderer.prototype.beforeDropDownItemRender = function (args) {
|
|
71
68
|
if (this.parent.readonly || !this.parent.enabled) {
|
|
@@ -102,34 +99,18 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
102
99
|
addClass([listEle[1], listEle[2]], 'e-disabled');
|
|
103
100
|
}
|
|
104
101
|
}
|
|
105
|
-
if (Browser.isDevice && !args.element.parentElement.classList.contains(classes.CLS_QUICK_DROPDOWN)) {
|
|
106
|
-
this.popupModal(args.element.parentElement);
|
|
107
|
-
}
|
|
108
102
|
this.parent.notify(events.selectionSave, args);
|
|
109
103
|
};
|
|
110
104
|
ToolbarRenderer.prototype.dropDownClose = function (args) {
|
|
111
|
-
this.removePopupContainer();
|
|
112
105
|
this.parent.notify(events.selectionRestore, args);
|
|
113
106
|
};
|
|
114
|
-
ToolbarRenderer.prototype.removePopupContainer = function () {
|
|
115
|
-
if (Browser.isDevice && !isNullOrUndefined(this.popupContainer)) {
|
|
116
|
-
var popupEle = this.popupContainer.querySelector('.e-dropdown-popup.e-tbar-btn.e-control');
|
|
117
|
-
if (popupEle) {
|
|
118
|
-
this.popupContainer.parentNode.insertBefore(popupEle, this.popupContainer.nextSibling);
|
|
119
|
-
popupEle.style.removeProperty('position');
|
|
120
|
-
removeClass([popupEle], 'e-popup-modal');
|
|
121
|
-
}
|
|
122
|
-
detach(this.popupContainer);
|
|
123
|
-
this.popupContainer = undefined;
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
107
|
/**
|
|
127
108
|
* renderToolbar method
|
|
128
109
|
*
|
|
129
110
|
* @param {IToolbarOptions} args - specifies the arguments.
|
|
130
111
|
* @returns {void}
|
|
131
112
|
* @hidden
|
|
132
|
-
|
|
113
|
+
|
|
133
114
|
*/
|
|
134
115
|
ToolbarRenderer.prototype.renderToolbar = function (args) {
|
|
135
116
|
this.setPanel(args.target);
|
|
@@ -156,7 +137,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
156
137
|
openDelay: 400,
|
|
157
138
|
opensOn: 'Hover',
|
|
158
139
|
beforeRender: this.tooltipBeforeRender.bind(this),
|
|
159
|
-
cssClass: this.parent.
|
|
140
|
+
cssClass: this.parent.getCssClass(),
|
|
160
141
|
windowCollision: true,
|
|
161
142
|
position: 'BottomCenter'
|
|
162
143
|
});
|
|
@@ -169,7 +150,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
169
150
|
* @param {IDropDownModel} args - specifies the the arguments.
|
|
170
151
|
* @returns {void}
|
|
171
152
|
* @hidden
|
|
172
|
-
|
|
153
|
+
|
|
173
154
|
*/
|
|
174
155
|
ToolbarRenderer.prototype.renderDropDownButton = function (args) {
|
|
175
156
|
var _this = this;
|
|
@@ -216,7 +197,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
216
197
|
}
|
|
217
198
|
//Alignments preselect
|
|
218
199
|
var alignEle = proxy.parent.getRange().startContainer;
|
|
219
|
-
while (alignEle !== proxy.parent.
|
|
200
|
+
while (alignEle !== proxy.parent.inputElement && !isNOU(alignEle.parentElement)) {
|
|
220
201
|
if (alignEle.nodeName === '#text') {
|
|
221
202
|
alignEle = alignEle.parentElement;
|
|
222
203
|
}
|
|
@@ -242,7 +223,8 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
242
223
|
alignEle = alignEle.parentElement;
|
|
243
224
|
}
|
|
244
225
|
//image preselect
|
|
245
|
-
var
|
|
226
|
+
var closestNode = startNode.closest('img');
|
|
227
|
+
var imageEle = closestNode ? closestNode : startNode.querySelector('img');
|
|
246
228
|
if (args.items[0].command === 'Images') {
|
|
247
229
|
if (!isNOU(imageEle)) {
|
|
248
230
|
var index = void 0;
|
|
@@ -297,7 +279,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
297
279
|
* @param {IDropDownModel} args - specifies the the arguments.
|
|
298
280
|
* @returns {void}
|
|
299
281
|
* @hidden
|
|
300
|
-
|
|
282
|
+
|
|
301
283
|
*/
|
|
302
284
|
ToolbarRenderer.prototype.renderListDropDown = function (args) {
|
|
303
285
|
// eslint-disable-next-line
|
|
@@ -354,39 +336,6 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
354
336
|
};
|
|
355
337
|
return dropDown;
|
|
356
338
|
};
|
|
357
|
-
// eslint-disable-next-line
|
|
358
|
-
ToolbarRenderer.prototype.onPopupOverlay = function (args) {
|
|
359
|
-
if (!isNullOrUndefined(this.popupOverlay)) {
|
|
360
|
-
closest(this.popupOverlay, '.e-popup-container').style.display = 'none';
|
|
361
|
-
this.popupOverlay.style.display = 'none';
|
|
362
|
-
removeClass([this.popupOverlay], 'e-popup-overlay');
|
|
363
|
-
}
|
|
364
|
-
};
|
|
365
|
-
ToolbarRenderer.prototype.setIsModel = function (element) {
|
|
366
|
-
if (!closest(element, '.e-popup-container')) {
|
|
367
|
-
this.popupContainer = this.parent.createElement('div', {
|
|
368
|
-
className: 'e-rte-modal-popup e-popup-container e-center'
|
|
369
|
-
});
|
|
370
|
-
element.parentNode.insertBefore(this.popupContainer, element);
|
|
371
|
-
this.popupContainer.appendChild(element);
|
|
372
|
-
this.popupContainer.style.zIndex = element.style.zIndex;
|
|
373
|
-
this.popupContainer.style.display = 'flex';
|
|
374
|
-
element.style.position = 'relative';
|
|
375
|
-
addClass([element], 'e-popup-modal');
|
|
376
|
-
this.popupOverlay = this.parent.createElement('div', { className: 'e-popup-overlay' });
|
|
377
|
-
// eslint-disable-next-line
|
|
378
|
-
this.popupOverlay.style.zIndex = (parseInt(element.style.zIndex, null) - 1).toString();
|
|
379
|
-
this.popupOverlay.style.display = 'block';
|
|
380
|
-
this.popupContainer.appendChild(this.popupOverlay);
|
|
381
|
-
EventHandler.add(this.popupOverlay, 'click touchmove', this.onPopupOverlay, this);
|
|
382
|
-
}
|
|
383
|
-
else {
|
|
384
|
-
element.parentElement.style.display = 'flex';
|
|
385
|
-
this.popupOverlay = element.nextElementSibling;
|
|
386
|
-
this.popupOverlay.style.display = 'block';
|
|
387
|
-
addClass([this.popupOverlay], 'e-popup-overlay');
|
|
388
|
-
}
|
|
389
|
-
};
|
|
390
339
|
ToolbarRenderer.prototype.paletteSelection = function (dropDownArgs, currentElement) {
|
|
391
340
|
var ele = dropDownArgs.element.querySelector('.e-control.e-colorpicker');
|
|
392
341
|
var colorbox = [].slice.call(selectAll('.e-tile', ele.parentElement));
|
|
@@ -407,7 +356,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
407
356
|
* @param {string} defaultColor -specifies the defaultColor.
|
|
408
357
|
* @returns {void}
|
|
409
358
|
* @hidden
|
|
410
|
-
|
|
359
|
+
|
|
411
360
|
*/
|
|
412
361
|
ToolbarRenderer.prototype.renderColorPickerDropDown = function (args, item, colorPicker, defaultColor) {
|
|
413
362
|
var _this = this;
|
|
@@ -415,7 +364,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
415
364
|
var proxy = this;
|
|
416
365
|
var css = CLS_RTE_ELEMENTS + ' ' + CLS_TB_BTN + ((this.parent.inlineMode) ? (' ' + CLS_INLINE_DROPDOWN) : '');
|
|
417
366
|
css += (' ' + ((item === 'backgroundcolor') ? CLS_BACKGROUND_COLOR_DROPDOWN : CLS_FONT_COLOR_DROPDOWN));
|
|
418
|
-
css +=
|
|
367
|
+
css += this.parent.getCssClass(true);
|
|
419
368
|
var content = proxy.parent.createElement('span', { className: CLS_COLOR_CONTENT });
|
|
420
369
|
var inlineEle = proxy.parent.createElement('span', { className: args.cssClass });
|
|
421
370
|
var range;
|
|
@@ -487,9 +436,6 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
487
436
|
if (focusEle) {
|
|
488
437
|
focusEle.focus();
|
|
489
438
|
}
|
|
490
|
-
if (Browser.isDevice) {
|
|
491
|
-
_this.popupModal(dropDownArgs.element.parentElement);
|
|
492
|
-
}
|
|
493
439
|
_this.pickerRefresh(dropDownArgs);
|
|
494
440
|
},
|
|
495
441
|
beforeClose: function (dropDownArgs) {
|
|
@@ -517,22 +463,6 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
517
463
|
},
|
|
518
464
|
close: function (dropDownArgs) {
|
|
519
465
|
proxy.parent.notify(events.selectionRestore, {});
|
|
520
|
-
var dropElement = closest(dropDownArgs.element.parentElement, '.e-popup-container');
|
|
521
|
-
if (dropElement) {
|
|
522
|
-
dropElement.style.display = 'none';
|
|
523
|
-
dropElement.lastElementChild.style.display = 'none';
|
|
524
|
-
removeClass([dropElement.lastElementChild], 'e-popup-overlay');
|
|
525
|
-
}
|
|
526
|
-
if (Browser.isDevice && !isNullOrUndefined(dropElement)) {
|
|
527
|
-
var popupEle = dropElement.querySelector('.e-dropdown-popup.e-tbar-btn.e-control');
|
|
528
|
-
if (popupEle) {
|
|
529
|
-
dropElement.parentNode.insertBefore(popupEle, dropElement.nextSibling);
|
|
530
|
-
popupEle.style.removeProperty('position');
|
|
531
|
-
removeClass([popupEle], 'e-popup-modal');
|
|
532
|
-
}
|
|
533
|
-
detach(dropElement);
|
|
534
|
-
proxy.popupContainer = undefined;
|
|
535
|
-
}
|
|
536
466
|
}
|
|
537
467
|
});
|
|
538
468
|
dropDown.isStringTemplate = true;
|
|
@@ -560,16 +490,6 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
560
490
|
popupElem.style.width = (popupElem.offsetWidth - 5).toString() + 'px';
|
|
561
491
|
}
|
|
562
492
|
};
|
|
563
|
-
ToolbarRenderer.prototype.popupModal = function (element) {
|
|
564
|
-
var popupInst = getInstance(element, Popup);
|
|
565
|
-
popupInst.relateTo = document.body;
|
|
566
|
-
popupInst.position = { X: 0, Y: 0 };
|
|
567
|
-
popupInst.targetType = 'container';
|
|
568
|
-
popupInst.collision = { X: 'fit', Y: 'fit' };
|
|
569
|
-
popupInst.offsetY = 4;
|
|
570
|
-
popupInst.dataBind();
|
|
571
|
-
this.setIsModel(element);
|
|
572
|
-
};
|
|
573
493
|
ToolbarRenderer.prototype.setColorPickerContentWidth = function (colorPicker) {
|
|
574
494
|
var colorPickerContent = colorPicker.element.nextSibling;
|
|
575
495
|
if (colorPickerContent.style.width === '0px') {
|
|
@@ -586,7 +506,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
586
506
|
* @param {string} item - specifies the string values
|
|
587
507
|
* @returns {void}
|
|
588
508
|
* @hidden
|
|
589
|
-
|
|
509
|
+
|
|
590
510
|
*/
|
|
591
511
|
ToolbarRenderer.prototype.renderColorPicker = function (args, item) {
|
|
592
512
|
var _this = this;
|
|
@@ -608,7 +528,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
608
528
|
args.element.classList.add(CLS_COLOR_PALETTE);
|
|
609
529
|
args.element.classList.add(CLS_CUSTOM_TILE);
|
|
610
530
|
if (!isNullOrUndefined(_this.parent.cssClass)) {
|
|
611
|
-
var allClassName = _this.parent.
|
|
531
|
+
var allClassName = _this.parent.getCssClass().split(' ');
|
|
612
532
|
for (var i = 0; i < allClassName.length; i++) {
|
|
613
533
|
if (allClassName[i].trim() !== '') {
|
|
614
534
|
args.element.classList.add(allClassName[i]);
|
|
@@ -661,7 +581,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
661
581
|
*
|
|
662
582
|
* @returns {void}
|
|
663
583
|
* @hidden
|
|
664
|
-
|
|
584
|
+
|
|
665
585
|
*/
|
|
666
586
|
ToolbarRenderer.prototype.renderPanel = function () {
|
|
667
587
|
this.getPanel().classList.add(CLS_TOOLBAR);
|
|
@@ -671,7 +591,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
671
591
|
*
|
|
672
592
|
* @returns {Element} - specifies the element.
|
|
673
593
|
* @hidden
|
|
674
|
-
|
|
594
|
+
|
|
675
595
|
*/
|
|
676
596
|
ToolbarRenderer.prototype.getPanel = function () {
|
|
677
597
|
return this.toolbarPanel;
|
|
@@ -682,7 +602,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
682
602
|
* @returns {void}
|
|
683
603
|
* @param {Element} panel - specifies the element.
|
|
684
604
|
* @hidden
|
|
685
|
-
|
|
605
|
+
|
|
686
606
|
*/
|
|
687
607
|
ToolbarRenderer.prototype.setPanel = function (panel) {
|
|
688
608
|
this.toolbarPanel = panel;
|
|
@@ -7,7 +7,7 @@ import { ClickEventArgs } from '@syncfusion/ej2-navigations';
|
|
|
7
7
|
* Content module is used to render Rich Text Editor content
|
|
8
8
|
*
|
|
9
9
|
* @hidden
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
*/
|
|
12
12
|
export declare class ViewSource {
|
|
13
13
|
private parent;
|
|
@@ -40,7 +40,7 @@ export declare class ViewSource {
|
|
|
40
40
|
* @param {ClickEventArgs} args - specifies the click event.
|
|
41
41
|
* @returns {void}
|
|
42
42
|
* @hidden
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
*/
|
|
45
45
|
sourceCode(args?: ClickEventArgs | IHtmlKeyboardEvent): void;
|
|
46
46
|
/**
|
|
@@ -49,7 +49,7 @@ export declare class ViewSource {
|
|
|
49
49
|
* @param {ClickEventArgs} args - specifies the click event.
|
|
50
50
|
* @returns {void}
|
|
51
51
|
* @hidden
|
|
52
|
-
|
|
52
|
+
|
|
53
53
|
*/
|
|
54
54
|
updateSourceCode(args?: ClickEventArgs | KeyboardEventArgs): void;
|
|
55
55
|
private getTextAreaValue;
|
|
@@ -58,7 +58,7 @@ export declare class ViewSource {
|
|
|
58
58
|
*
|
|
59
59
|
* @returns {void}
|
|
60
60
|
* @hidden
|
|
61
|
-
|
|
61
|
+
|
|
62
62
|
*/
|
|
63
63
|
getPanel(): HTMLTextAreaElement | Element;
|
|
64
64
|
/**
|
|
@@ -66,7 +66,7 @@ export declare class ViewSource {
|
|
|
66
66
|
*
|
|
67
67
|
* @returns {void}
|
|
68
68
|
* @hidden
|
|
69
|
-
|
|
69
|
+
|
|
70
70
|
*/
|
|
71
71
|
getViewPanel(): HTMLTextAreaElement | Element;
|
|
72
72
|
/**
|
|
@@ -74,7 +74,7 @@ export declare class ViewSource {
|
|
|
74
74
|
*
|
|
75
75
|
* @returns {void}
|
|
76
76
|
* @hidden
|
|
77
|
-
|
|
77
|
+
|
|
78
78
|
*/
|
|
79
79
|
destroy(): void;
|
|
80
80
|
private moduleDestroy;
|
|
@@ -8,7 +8,7 @@ import { KeyboardEvents } from '../actions/keyboard';
|
|
|
8
8
|
* Content module is used to render Rich Text Editor content
|
|
9
9
|
*
|
|
10
10
|
* @hidden
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
*/
|
|
13
13
|
var ViewSource = /** @class */ (function () {
|
|
14
14
|
/**
|
|
@@ -44,7 +44,7 @@ var ViewSource = /** @class */ (function () {
|
|
|
44
44
|
this.parent.formatter.editorManager.observer.off(CONSTANT.KEY_DOWN_HANDLER, this.onKeyDown);
|
|
45
45
|
};
|
|
46
46
|
ViewSource.prototype.getSourceCode = function () {
|
|
47
|
-
return this.parent.createElement('textarea', { className: CLS_RTE_SOURCE_CODE_TXTAREA +
|
|
47
|
+
return this.parent.createElement('textarea', { className: CLS_RTE_SOURCE_CODE_TXTAREA + this.parent.getCssClass(true) });
|
|
48
48
|
};
|
|
49
49
|
ViewSource.prototype.wireEvent = function (element) {
|
|
50
50
|
this.keyboardModule = new KeyboardEvents(element, {
|
|
@@ -105,7 +105,7 @@ var ViewSource = /** @class */ (function () {
|
|
|
105
105
|
* @param {ClickEventArgs} args - specifies the click event.
|
|
106
106
|
* @returns {void}
|
|
107
107
|
* @hidden
|
|
108
|
-
|
|
108
|
+
|
|
109
109
|
*/
|
|
110
110
|
ViewSource.prototype.sourceCode = function (args) {
|
|
111
111
|
this.parent.notify(events.hidePopup, {});
|
|
@@ -141,8 +141,10 @@ var ViewSource = /** @class */ (function () {
|
|
|
141
141
|
this.getPanel().style.display = 'block';
|
|
142
142
|
}
|
|
143
143
|
else {
|
|
144
|
+
var height = this.parent.inputElement.offsetHeight;
|
|
144
145
|
this.contentModule.getPanel().appendChild(this.previewElement);
|
|
145
146
|
this.getPanel().value = this.getTextAreaValue();
|
|
147
|
+
this.previewElement.style.height = height + 'px';
|
|
146
148
|
this.contentModule.getEditPanel().style.display = 'none';
|
|
147
149
|
this.previewElement.style.display = 'block';
|
|
148
150
|
}
|
|
@@ -171,7 +173,7 @@ var ViewSource = /** @class */ (function () {
|
|
|
171
173
|
* @param {ClickEventArgs} args - specifies the click event.
|
|
172
174
|
* @returns {void}
|
|
173
175
|
* @hidden
|
|
174
|
-
|
|
176
|
+
|
|
175
177
|
*/
|
|
176
178
|
ViewSource.prototype.updateSourceCode = function (args) {
|
|
177
179
|
this.parent.isBlur = false;
|
|
@@ -243,7 +245,7 @@ var ViewSource = /** @class */ (function () {
|
|
|
243
245
|
*
|
|
244
246
|
* @returns {void}
|
|
245
247
|
* @hidden
|
|
246
|
-
|
|
248
|
+
|
|
247
249
|
*/
|
|
248
250
|
ViewSource.prototype.getPanel = function () {
|
|
249
251
|
return this.parent.element && this.parent.element.querySelector('.e-rte-srctextarea');
|
|
@@ -253,7 +255,7 @@ var ViewSource = /** @class */ (function () {
|
|
|
253
255
|
*
|
|
254
256
|
* @returns {void}
|
|
255
257
|
* @hidden
|
|
256
|
-
|
|
258
|
+
|
|
257
259
|
*/
|
|
258
260
|
ViewSource.prototype.getViewPanel = function () {
|
|
259
261
|
return (this.parent.iframeSettings.enable && this.getPanel()) ? this.getPanel().parentElement : this.getPanel();
|
|
@@ -263,7 +265,7 @@ var ViewSource = /** @class */ (function () {
|
|
|
263
265
|
*
|
|
264
266
|
* @returns {void}
|
|
265
267
|
* @hidden
|
|
266
|
-
|
|
268
|
+
|
|
267
269
|
*/
|
|
268
270
|
ViewSource.prototype.destroy = function () {
|
|
269
271
|
if (isNullOrUndefined(this.parent)) {
|
|
@@ -4,7 +4,7 @@ import { RenderType } from '../base/enum';
|
|
|
4
4
|
* RendererFactory
|
|
5
5
|
*
|
|
6
6
|
* @hidden
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
*/
|
|
9
9
|
export declare class RendererFactory {
|
|
10
10
|
rendererMap: {
|
|
@@ -17,7 +17,7 @@ export declare class RendererFactory {
|
|
|
17
17
|
* @param {IRenderer} type - specifies the renderer.
|
|
18
18
|
* @returns {void}
|
|
19
19
|
* @hidden
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
*/
|
|
22
22
|
addRenderer(name: RenderType, type: IRenderer): void;
|
|
23
23
|
/**
|
|
@@ -26,7 +26,7 @@ export declare class RendererFactory {
|
|
|
26
26
|
* @param {RenderType} name - specifies the render type
|
|
27
27
|
* @returns {void}
|
|
28
28
|
* @hidden
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
*/
|
|
31
31
|
getRenderer(name: RenderType): IRenderer;
|
|
32
32
|
}
|
|
@@ -4,7 +4,7 @@ import { RenderType } from '../base/enum';
|
|
|
4
4
|
* RendererFactory
|
|
5
5
|
*
|
|
6
6
|
* @hidden
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
*/
|
|
9
9
|
var RendererFactory = /** @class */ (function () {
|
|
10
10
|
function RendererFactory() {
|
|
@@ -17,7 +17,7 @@ var RendererFactory = /** @class */ (function () {
|
|
|
17
17
|
* @param {IRenderer} type - specifies the renderer.
|
|
18
18
|
* @returns {void}
|
|
19
19
|
* @hidden
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
*/
|
|
22
22
|
RendererFactory.prototype.addRenderer = function (name, type) {
|
|
23
23
|
var rName = getEnumValue(RenderType, name);
|
|
@@ -31,7 +31,7 @@ var RendererFactory = /** @class */ (function () {
|
|
|
31
31
|
* @param {RenderType} name - specifies the render type
|
|
32
32
|
* @returns {void}
|
|
33
33
|
* @hidden
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
*/
|
|
36
36
|
RendererFactory.prototype.getRenderer = function (name) {
|
|
37
37
|
var rName = getEnumValue(RenderType, name);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ServiceLocator
|
|
3
3
|
*
|
|
4
4
|
* @hidden
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
*/
|
|
7
7
|
export declare class ServiceLocator {
|
|
8
8
|
private services;
|
|
@@ -13,7 +13,7 @@ export declare class ServiceLocator {
|
|
|
13
13
|
* @param {T} type - specifies the type.
|
|
14
14
|
* @returns {void}
|
|
15
15
|
* @hidden
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
*/
|
|
18
18
|
register<T>(name: string, type: T): void;
|
|
19
19
|
/**
|
|
@@ -22,7 +22,7 @@ export declare class ServiceLocator {
|
|
|
22
22
|
* @param {string} name - specifies the name.
|
|
23
23
|
* @returns {void}
|
|
24
24
|
* @hidden
|
|
25
|
-
|
|
25
|
+
|
|
26
26
|
*/
|
|
27
27
|
getService<T>(name: string): T;
|
|
28
28
|
}
|
|
@@ -3,7 +3,7 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
|
3
3
|
* ServiceLocator
|
|
4
4
|
*
|
|
5
5
|
* @hidden
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
*/
|
|
8
8
|
var ServiceLocator = /** @class */ (function () {
|
|
9
9
|
function ServiceLocator() {
|
|
@@ -17,7 +17,7 @@ var ServiceLocator = /** @class */ (function () {
|
|
|
17
17
|
* @param {T} type - specifies the type.
|
|
18
18
|
* @returns {void}
|
|
19
19
|
* @hidden
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
*/
|
|
22
22
|
/* eslint-enable */
|
|
23
23
|
ServiceLocator.prototype.register = function (name, type) {
|
|
@@ -31,7 +31,7 @@ var ServiceLocator = /** @class */ (function () {
|
|
|
31
31
|
* @param {string} name - specifies the name.
|
|
32
32
|
* @returns {void}
|
|
33
33
|
* @hidden
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
*/
|
|
36
36
|
ServiceLocator.prototype.getService = function (name) {
|
|
37
37
|
if (isNullOrUndefined(this.services["" + name])) {
|