@syncfusion/ej2-richtexteditor 24.1.41-569421 → 24.1.41-581025
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 +0 -176
- package/dist/ej2-richtexteditor.umd.min.js +1 -1
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +7822 -9502
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +5674 -7355
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/package.json +12 -12
- package/src/common/config.d.ts +0 -7
- package/src/common/config.js +0 -11
- package/src/common/constant.d.ts +0 -6
- package/src/common/constant.js +0 -6
- package/src/common/interface.d.ts +0 -12
- package/src/common/types.d.ts +0 -6
- package/src/common/util.d.ts +0 -6
- package/src/common/util.js +20 -61
- package/src/editor-manager/base/constant.d.ts +0 -6
- package/src/editor-manager/base/constant.js +0 -6
- package/src/editor-manager/base/editor-manager.d.ts +0 -5
- package/src/editor-manager/base/editor-manager.js +0 -59
- package/src/editor-manager/base/interface.d.ts +0 -8
- package/src/editor-manager/plugin/dom-node.d.ts +1 -5
- package/src/editor-manager/plugin/dom-node.js +15 -169
- package/src/editor-manager/plugin/format-painter-actions.d.ts +0 -1
- package/src/editor-manager/plugin/format-painter-actions.js +1 -19
- package/src/editor-manager/plugin/formats.d.ts +0 -1
- package/src/editor-manager/plugin/formats.js +3 -38
- package/src/editor-manager/plugin/image.js +16 -12
- package/src/editor-manager/plugin/indents.js +1 -1
- package/src/editor-manager/plugin/inserthtml.d.ts +0 -1
- package/src/editor-manager/plugin/inserthtml.js +18 -78
- package/src/editor-manager/plugin/link.js +3 -8
- package/src/editor-manager/plugin/lists.js +70 -159
- package/src/editor-manager/plugin/ms-word-clean-up.d.ts +0 -3
- package/src/editor-manager/plugin/ms-word-clean-up.js +85 -212
- package/src/editor-manager/plugin/nodecutter.js +2 -5
- package/src/editor-manager/plugin/selection-commands.d.ts +0 -2
- package/src/editor-manager/plugin/selection-commands.js +4 -209
- package/src/editor-manager/plugin/table.d.ts +1 -4
- package/src/editor-manager/plugin/table.js +49 -95
- package/src/editor-manager/plugin/toolbar-status.d.ts +2 -2
- package/src/editor-manager/plugin/toolbar-status.js +10 -20
- package/src/editor-manager/plugin/undo.d.ts +0 -1
- package/src/editor-manager/plugin/undo.js +1 -21
- package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +3 -4
- package/src/rich-text-editor/actions/base-quick-toolbar.js +10 -43
- package/src/rich-text-editor/actions/base-toolbar.js +34 -33
- package/src/rich-text-editor/actions/color-picker.d.ts +0 -1
- package/src/rich-text-editor/actions/color-picker.js +0 -10
- package/src/rich-text-editor/actions/count.js +1 -1
- package/src/rich-text-editor/actions/dropdown-buttons.d.ts +0 -1
- package/src/rich-text-editor/actions/dropdown-buttons.js +4 -8
- package/src/rich-text-editor/actions/emoji-picker.js +4 -4
- package/src/rich-text-editor/actions/enter-key.js +4 -8
- package/src/rich-text-editor/actions/format-painter.js +1 -4
- package/src/rich-text-editor/actions/full-screen.js +2 -3
- package/src/rich-text-editor/actions/html-editor.d.ts +2 -2
- package/src/rich-text-editor/actions/html-editor.js +42 -123
- package/src/rich-text-editor/actions/keyboard.js +1 -3
- package/src/rich-text-editor/actions/markdown-editor.js +1 -3
- package/src/rich-text-editor/actions/paste-clean-up.d.ts +0 -3
- package/src/rich-text-editor/actions/paste-clean-up.js +14 -85
- package/src/rich-text-editor/actions/quick-toolbar.d.ts +0 -8
- package/src/rich-text-editor/actions/quick-toolbar.js +9 -37
- package/src/rich-text-editor/actions/resize.js +1 -2
- package/src/rich-text-editor/actions/toolbar-action.js +1 -1
- package/src/rich-text-editor/actions/toolbar.d.ts +3 -2
- package/src/rich-text-editor/actions/toolbar.js +87 -18
- package/src/rich-text-editor/base/classes.d.ts +5 -0
- package/src/rich-text-editor/base/classes.js +5 -0
- package/src/rich-text-editor/base/constant.d.ts +0 -40
- package/src/rich-text-editor/base/constant.js +0 -209
- package/src/rich-text-editor/base/interface.d.ts +3 -37
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +3 -3
- package/src/rich-text-editor/base/rich-text-editor.d.ts +4 -7
- package/src/rich-text-editor/base/rich-text-editor.js +132 -156
- package/src/rich-text-editor/base/util.js +2 -11
- package/src/rich-text-editor/formatter/formatter.js +4 -16
- package/src/rich-text-editor/models/default-locale.js +26 -30
- package/src/rich-text-editor/models/items.js +2 -2
- package/src/rich-text-editor/models/toolbar-settings-model.d.ts +1 -1
- package/src/rich-text-editor/models/toolbar-settings.d.ts +1 -1
- package/src/rich-text-editor/models/toolbar-settings.js +1 -1
- package/src/rich-text-editor/renderer/audio-module.d.ts +0 -1
- package/src/rich-text-editor/renderer/audio-module.js +4 -22
- package/src/rich-text-editor/renderer/dialog-renderer.d.ts +0 -2
- package/src/rich-text-editor/renderer/dialog-renderer.js +1 -12
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +1 -2
- package/src/rich-text-editor/renderer/image-module.d.ts +1 -9
- package/src/rich-text-editor/renderer/image-module.js +168 -203
- package/src/rich-text-editor/renderer/link-module.js +1 -10
- package/src/rich-text-editor/renderer/table-module.d.ts +1 -8
- package/src/rich-text-editor/renderer/table-module.js +139 -301
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +0 -3
- package/src/rich-text-editor/renderer/toolbar-renderer.js +9 -94
- package/src/rich-text-editor/renderer/video-module.d.ts +0 -3
- package/src/rich-text-editor/renderer/video-module.js +41 -82
- package/src/rich-text-editor/renderer/view-source.d.ts +0 -1
- package/src/rich-text-editor/renderer/view-source.js +4 -12
- package/src/selection/selection.js +0 -3
- package/styles/bootstrap-dark.css +53 -161
- package/styles/bootstrap.css +61 -162
- package/styles/bootstrap4.css +46 -146
- package/styles/bootstrap5-dark.css +46 -151
- package/styles/bootstrap5.css +46 -151
- package/styles/fabric-dark.css +40 -140
- package/styles/fabric.css +41 -141
- package/styles/fluent-dark.css +47 -165
- package/styles/fluent.css +47 -165
- package/styles/highcontrast-light.css +40 -140
- package/styles/highcontrast.css +41 -144
- package/styles/material-dark.css +41 -145
- package/styles/material.css +41 -145
- package/styles/material3-dark.css +50 -156
- package/styles/material3.css +50 -156
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +13 -17
- package/styles/rich-text-editor/_bootstrap-definition.scss +19 -22
- package/styles/rich-text-editor/_bootstrap4-definition.scss +7 -11
- package/styles/rich-text-editor/_bootstrap5-definition.scss +3 -7
- package/styles/rich-text-editor/_fabric-dark-definition.scss +2 -6
- package/styles/rich-text-editor/_fabric-definition.scss +3 -7
- package/styles/rich-text-editor/_fluent-definition.scss +9 -13
- package/styles/rich-text-editor/_fusionnew-definition.scss +3 -7
- package/styles/rich-text-editor/_highcontrast-definition.scss +3 -7
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +2 -6
- package/styles/rich-text-editor/_layout.scss +31 -133
- package/styles/rich-text-editor/_material-dark-definition.scss +2 -6
- package/styles/rich-text-editor/_material-definition.scss +2 -6
- package/styles/rich-text-editor/_material3-definition.scss +12 -16
- package/styles/rich-text-editor/_tailwind-definition.scss +19 -23
- package/styles/rich-text-editor/_theme.scss +23 -112
- package/styles/rich-text-editor/bootstrap-dark.css +53 -161
- package/styles/rich-text-editor/bootstrap.css +61 -162
- package/styles/rich-text-editor/bootstrap4.css +46 -146
- package/styles/rich-text-editor/bootstrap5-dark.css +46 -151
- package/styles/rich-text-editor/bootstrap5.css +46 -151
- package/styles/rich-text-editor/fabric-dark.css +40 -140
- package/styles/rich-text-editor/fabric.css +41 -141
- package/styles/rich-text-editor/fluent-dark.css +47 -165
- package/styles/rich-text-editor/fluent.css +47 -165
- package/styles/rich-text-editor/highcontrast-light.css +40 -140
- package/styles/rich-text-editor/highcontrast.css +41 -144
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +2 -2
- package/styles/rich-text-editor/icons/_bootstrap.scss +2 -2
- package/styles/rich-text-editor/icons/_bootstrap4.scss +2 -2
- package/styles/rich-text-editor/icons/_bootstrap5.scss +2 -2
- package/styles/rich-text-editor/icons/_fabric-dark.scss +2 -2
- package/styles/rich-text-editor/icons/_fabric.scss +2 -2
- package/styles/rich-text-editor/icons/_fluent.scss +2 -2
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +2 -2
- package/styles/rich-text-editor/icons/_highcontrast.scss +2 -2
- package/styles/rich-text-editor/icons/_material-dark.scss +2 -2
- package/styles/rich-text-editor/icons/_material.scss +2 -2
- package/styles/rich-text-editor/icons/_material3.scss +2 -2
- package/styles/rich-text-editor/icons/_tailwind.scss +2 -2
- package/styles/rich-text-editor/material-dark.css +41 -145
- package/styles/rich-text-editor/material.css +41 -145
- package/styles/rich-text-editor/material3-dark.css +50 -156
- package/styles/rich-text-editor/material3.css +50 -156
- package/styles/rich-text-editor/tailwind-dark.css +63 -191
- package/styles/rich-text-editor/tailwind.css +63 -191
- package/styles/tailwind-dark.css +63 -191
- package/styles/tailwind.css +63 -191
- package/.eslintrc.json +0 -260
- package/src/global.d.ts +0 -1
- package/styles/rich-text-editor/_bds-definition.scss +0 -279
- package/styles/rich-text-editor/icons/_bds.scss +0 -348
|
@@ -98,25 +98,6 @@ var UndoRedoManager = /** @class */ (function () {
|
|
|
98
98
|
}
|
|
99
99
|
return textContent;
|
|
100
100
|
};
|
|
101
|
-
UndoRedoManager.prototype.isElementStructureEqual = function (previousFragment, currentFragment) {
|
|
102
|
-
if (previousFragment.childNodes.length !== currentFragment.childNodes.length) {
|
|
103
|
-
return false;
|
|
104
|
-
}
|
|
105
|
-
for (var i = 0; i < previousFragment.childNodes.length; i++) {
|
|
106
|
-
var previousFragmentNode = previousFragment.childNodes[i];
|
|
107
|
-
var currentFragmentNode = currentFragment.childNodes[i];
|
|
108
|
-
if (!previousFragmentNode || !currentFragmentNode) {
|
|
109
|
-
return false;
|
|
110
|
-
}
|
|
111
|
-
if (previousFragmentNode.nodeType !== currentFragmentNode.nodeType) {
|
|
112
|
-
return false;
|
|
113
|
-
}
|
|
114
|
-
if (previousFragmentNode.outerHTML !== currentFragmentNode.outerHTML) {
|
|
115
|
-
return false;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
return true;
|
|
119
|
-
};
|
|
120
101
|
/**
|
|
121
102
|
* RTE collection stored html format.
|
|
122
103
|
*
|
|
@@ -153,8 +134,7 @@ var UndoRedoManager = /** @class */ (function () {
|
|
|
153
134
|
(this.undoRedoStack[this.undoRedoStack.length - 1].range.endOffset === save.range.endOffset) &&
|
|
154
135
|
(this.undoRedoStack[this.undoRedoStack.length - 1].range.range.startContainer === save.range.startContainer) &&
|
|
155
136
|
(this.getTextContentFromFragment(this.undoRedoStack[this.undoRedoStack.length - 1].text).trim() ===
|
|
156
|
-
this.getTextContentFromFragment(changEle.text).trim())
|
|
157
|
-
this.isElementStructureEqual(this.undoRedoStack[this.undoRedoStack.length - 1].text, changEle.text)) {
|
|
137
|
+
this.getTextContentFromFragment(changEle.text).trim())) {
|
|
158
138
|
return;
|
|
159
139
|
}
|
|
160
140
|
this.undoRedoStack.push(changEle);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Popup } from '@syncfusion/ej2-popups';
|
|
2
|
-
import { IRichTextEditor
|
|
2
|
+
import { IRichTextEditor } from '../base/interface';
|
|
3
3
|
import { IToolbarItems, IQuickToolbarOptions } from '../base/interface';
|
|
4
4
|
import { ServiceLocator } from '../services/service-locator';
|
|
5
5
|
import { BaseToolbar } from './base-toolbar';
|
|
@@ -7,10 +7,10 @@ import { RichTextEditorModel } from '../base/rich-text-editor-model';
|
|
|
7
7
|
/**
|
|
8
8
|
* `Quick toolbar` module is used to handle Quick toolbar actions.
|
|
9
9
|
*/
|
|
10
|
-
export declare class BaseQuickToolbar
|
|
10
|
+
export declare class BaseQuickToolbar {
|
|
11
11
|
popupObj: Popup;
|
|
12
12
|
element: HTMLElement;
|
|
13
|
-
|
|
13
|
+
private isDOMElement;
|
|
14
14
|
quickTBarObj: BaseToolbar;
|
|
15
15
|
private stringItems;
|
|
16
16
|
private dropDownButtons;
|
|
@@ -48,7 +48,6 @@ export declare class BaseQuickToolbar implements IBaseQuickToolbar {
|
|
|
48
48
|
* @deprecated
|
|
49
49
|
*/
|
|
50
50
|
showPopup(x: number, y: number, target: Element, type?: string): void;
|
|
51
|
-
private tooltipBeforeRender;
|
|
52
51
|
/**
|
|
53
52
|
* hidePopup method
|
|
54
53
|
*
|
|
@@ -15,7 +15,7 @@ var BaseQuickToolbar = /** @class */ (function () {
|
|
|
15
15
|
function BaseQuickToolbar(parent, locator) {
|
|
16
16
|
this.parent = parent;
|
|
17
17
|
this.locator = locator;
|
|
18
|
-
this.
|
|
18
|
+
this.isDOMElement = false;
|
|
19
19
|
this.renderFactory = this.locator.getService('rendererFactory');
|
|
20
20
|
this.contentRenderer = this.renderFactory.getRenderer(RenderType.Content);
|
|
21
21
|
this.popupRenderer = this.renderFactory.getRenderer(RenderType.Popup);
|
|
@@ -79,18 +79,7 @@ var BaseQuickToolbar = /** @class */ (function () {
|
|
|
79
79
|
e.target.classList.contains('e-imgbreak')) ? false : true;
|
|
80
80
|
var target = !isNOU(imgWrapper) ? imgWrapper : e.target;
|
|
81
81
|
addClass([this.toolbarElement], [classes.CLS_RM_WHITE_SPACE]);
|
|
82
|
-
var targetOffsetTop;
|
|
83
|
-
if (!isNOU(closest(target, 'table'))) {
|
|
84
|
-
targetOffsetTop = target.offsetTop;
|
|
85
|
-
var parentTable = closest(target, 'table');
|
|
86
|
-
while (!isNOU(parentTable)) {
|
|
87
|
-
targetOffsetTop += parentTable.offsetTop;
|
|
88
|
-
parentTable = closest(parentTable.parentElement, 'table');
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
targetOffsetTop = (target.classList.contains("e-rte-audio")) ? target.parentElement.offsetTop : target.offsetTop;
|
|
93
|
-
}
|
|
82
|
+
var targetOffsetTop = target.offsetTop;
|
|
94
83
|
var parentOffsetTop = window.pageYOffset + e.parentData.top;
|
|
95
84
|
if ((targetOffsetTop - e.editTop) > e.popHeight) {
|
|
96
85
|
y = parentOffsetTop + e.tBarElementHeight + (targetOffsetTop - e.editTop) - e.popHeight - 5;
|
|
@@ -102,23 +91,11 @@ var BaseQuickToolbar = /** @class */ (function () {
|
|
|
102
91
|
y = e.y;
|
|
103
92
|
}
|
|
104
93
|
target = isAligned ? e.target : target;
|
|
105
|
-
var targetOffsetLeft;
|
|
106
|
-
if (!isNOU(closest(target, 'table'))) {
|
|
107
|
-
targetOffsetLeft = target.offsetLeft;
|
|
108
|
-
var parentTable = closest(target.parentElement, 'td');
|
|
109
|
-
while (!isNOU(parentTable)) {
|
|
110
|
-
targetOffsetLeft += parentTable.offsetLeft;
|
|
111
|
-
parentTable = closest(parentTable.parentElement, 'table');
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
targetOffsetLeft = (target.classList.contains("e-rte-audio")) ? target.parentElement.offsetLeft : target.offsetLeft;
|
|
116
|
-
}
|
|
117
94
|
if (target.offsetWidth > e.popWidth) {
|
|
118
|
-
x = (target.offsetWidth / 2) - (e.popWidth / 2) + e.parentData.left +
|
|
95
|
+
x = (target.offsetWidth / 2) - (e.popWidth / 2) + e.parentData.left + target.offsetLeft;
|
|
119
96
|
}
|
|
120
97
|
else {
|
|
121
|
-
x = e.parentData.left +
|
|
98
|
+
x = e.parentData.left + target.offsetLeft;
|
|
122
99
|
}
|
|
123
100
|
this.popupObj.position.X = ((x + e.popWidth) > e.parentData.right) ? e.parentData.right - e.popWidth : x;
|
|
124
101
|
this.popupObj.position.Y = (y >= 0) ? y : e.y + 5;
|
|
@@ -246,19 +223,14 @@ var BaseQuickToolbar = /** @class */ (function () {
|
|
|
246
223
|
_this.parent.disableToolbarItem(_this.parent.toolbarSettings.items);
|
|
247
224
|
_this.parent.enableToolbarItem(['Undo', 'Redo']);
|
|
248
225
|
}
|
|
249
|
-
else {
|
|
250
|
-
_this.parent.enableToolbarItem(_this.parent.toolbarSettings.items);
|
|
251
|
-
}
|
|
252
226
|
append([_this.element], document.body);
|
|
253
227
|
if (_this.parent.showTooltip) {
|
|
254
228
|
_this.tooltip = new Tooltip({
|
|
255
229
|
target: '#' + _this.element.id + ' [title]',
|
|
256
230
|
openDelay: 400,
|
|
257
231
|
showTipPointer: true,
|
|
258
|
-
beforeRender: _this.tooltipBeforeRender.bind(_this),
|
|
259
232
|
windowCollision: true,
|
|
260
|
-
position: 'BottomCenter'
|
|
261
|
-
cssClass: _this.parent.getCssClass()
|
|
233
|
+
position: 'BottomCenter'
|
|
262
234
|
});
|
|
263
235
|
_this.tooltip.appendTo(_this.element);
|
|
264
236
|
}
|
|
@@ -292,9 +264,9 @@ var BaseQuickToolbar = /** @class */ (function () {
|
|
|
292
264
|
parentData: parent_1.getBoundingClientRect(),
|
|
293
265
|
tBarElementHeight: tBarHeight
|
|
294
266
|
};
|
|
295
|
-
if (
|
|
267
|
+
if (target.tagName === 'IMG' || target.tagName === 'AUDIO' || target.tagName === 'VIDEO' || target.tagName === 'IFRAME' || (target.classList &&
|
|
296
268
|
(target.classList.contains(classes.CLS_AUDIOWRAP) || target.classList.contains(classes.CLS_CLICKELEM) ||
|
|
297
|
-
target.classList.contains(classes.CLS_VID_CLICK_ELEM))))
|
|
269
|
+
target.classList.contains(classes.CLS_VID_CLICK_ELEM)))) {
|
|
298
270
|
_this.setPosition(showPopupData);
|
|
299
271
|
}
|
|
300
272
|
if (!_this.parent.inlineMode.enable) {
|
|
@@ -312,15 +284,10 @@ var BaseQuickToolbar = /** @class */ (function () {
|
|
|
312
284
|
maxWidth: window.outerWidth + 'px'
|
|
313
285
|
});
|
|
314
286
|
addClass([_this.element], [classes.CLS_POP]);
|
|
315
|
-
_this.
|
|
287
|
+
_this.isDOMElement = true;
|
|
316
288
|
}
|
|
317
289
|
});
|
|
318
290
|
};
|
|
319
|
-
BaseQuickToolbar.prototype.tooltipBeforeRender = function (args) {
|
|
320
|
-
if (args.target.querySelector('.e-active')) {
|
|
321
|
-
args.cancel = true;
|
|
322
|
-
}
|
|
323
|
-
};
|
|
324
291
|
/**
|
|
325
292
|
* hidePopup method
|
|
326
293
|
*
|
|
@@ -354,7 +321,7 @@ var BaseQuickToolbar = /** @class */ (function () {
|
|
|
354
321
|
}
|
|
355
322
|
}
|
|
356
323
|
this.removeEleFromDOM();
|
|
357
|
-
this.
|
|
324
|
+
this.isDOMElement = false;
|
|
358
325
|
};
|
|
359
326
|
/**
|
|
360
327
|
* @param {string} item - specifies the string value
|
|
@@ -377,7 +344,7 @@ var BaseQuickToolbar = /** @class */ (function () {
|
|
|
377
344
|
};
|
|
378
345
|
BaseQuickToolbar.prototype.removeEleFromDOM = function () {
|
|
379
346
|
var element = this.popupObj.element;
|
|
380
|
-
if (this.
|
|
347
|
+
if (this.isDOMElement) {
|
|
381
348
|
this.dropDownButtons.destroyDropDowns();
|
|
382
349
|
this.colorPickerObj.destroyColorPicker();
|
|
383
350
|
removeClass([this.element], [classes.CLS_POP]);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { RenderType } from '../base/enum';
|
|
2
2
|
import { CLS_HR_SEPARATOR } from '../base/classes';
|
|
3
3
|
import * as events from '../base/constant';
|
|
4
|
-
import { getTooltipText, toObjectLowerCase } from '../base/util';
|
|
4
|
+
import { getTooltipText, isIDevice, toObjectLowerCase } from '../base/util';
|
|
5
5
|
import { tools, templateItems, windowKeys } from '../models/items';
|
|
6
|
-
import { isNullOrUndefined, extend } from '@syncfusion/ej2-base';
|
|
6
|
+
import { isNullOrUndefined, extend, Browser } from '@syncfusion/ej2-base';
|
|
7
7
|
/**
|
|
8
8
|
* `Toolbar` module is used to handle Toolbar actions.
|
|
9
9
|
*/
|
|
@@ -107,13 +107,23 @@ var BaseToolbar = /** @class */ (function () {
|
|
|
107
107
|
case '-':
|
|
108
108
|
return { type: 'Separator', cssClass: CLS_HR_SEPARATOR };
|
|
109
109
|
default:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
110
|
+
if (this.parent.showTooltip) {
|
|
111
|
+
return {
|
|
112
|
+
id: this.parent.getID() + '_' + container + '_' + this.tools[itemStr.toLocaleLowerCase()].id,
|
|
113
|
+
prefixIcon: this.tools[itemStr.toLocaleLowerCase()].icon,
|
|
114
|
+
tooltipText: getTooltipText(itemStr, this.locator),
|
|
115
|
+
command: this.tools[itemStr.toLocaleLowerCase()].command,
|
|
116
|
+
subCommand: this.tools[itemStr.toLocaleLowerCase()].subCommand
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
return {
|
|
121
|
+
id: this.parent.getID() + '_' + container + '_' + this.tools[itemStr.toLocaleLowerCase()].id,
|
|
122
|
+
prefixIcon: this.tools[itemStr.toLocaleLowerCase()].icon,
|
|
123
|
+
command: this.tools[itemStr.toLocaleLowerCase()].command,
|
|
124
|
+
subCommand: this.tools[itemStr.toLocaleLowerCase()].subCommand
|
|
125
|
+
};
|
|
126
|
+
}
|
|
117
127
|
}
|
|
118
128
|
}
|
|
119
129
|
};
|
|
@@ -144,14 +154,10 @@ var BaseToolbar = /** @class */ (function () {
|
|
|
144
154
|
_this.parent.formatter.saveData();
|
|
145
155
|
}
|
|
146
156
|
callback_1.call(_this);
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
currentContentElem.appendChild(clonedItem);
|
|
152
|
-
if (currentContentElem.innerHTML.trim() === _this.parent.inputElement.innerHTML.trim()) {
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
157
|
+
var currentContentElem = _this.parent.createElement('div');
|
|
158
|
+
currentContentElem.appendChild(_this.parent.formatter.getUndoRedoStack()[_this.parent.formatter.getUndoRedoStack().length - 1].text);
|
|
159
|
+
if (currentContentElem.innerHTML.trim() === _this.parent.inputElement.innerHTML.trim()) {
|
|
160
|
+
return;
|
|
155
161
|
}
|
|
156
162
|
if (proxy_1.undo) {
|
|
157
163
|
_this.parent.formatter.saveData();
|
|
@@ -166,22 +172,17 @@ var BaseToolbar = /** @class */ (function () {
|
|
|
166
172
|
var item = tbItems_1[_i];
|
|
167
173
|
_loop_1(item);
|
|
168
174
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
if (shortCutKey) {
|
|
181
|
-
if (!(items[num].command === "Images" && items[num].subCommand === "InsertLink")) {
|
|
182
|
-
items[num].tooltipText = (tooltipText !== shortCutKey) ? (isMacDev) ? shortCutKey : tooltipText + ' (' + shortCutKey + ')' : tooltipText;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
175
|
+
for (var num = 0; num < items.length; num++) {
|
|
176
|
+
var tooltipText = items[num].tooltipText;
|
|
177
|
+
var shortCutKey = void 0;
|
|
178
|
+
if (windowKeys["" + tooltipText]) {
|
|
179
|
+
shortCutKey = Browser.isDevice && isIDevice() ? windowKeys["" + tooltipText].replace('Ctrl', 'Cmd') : windowKeys["" + tooltipText];
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
shortCutKey = tooltipText;
|
|
183
|
+
}
|
|
184
|
+
if (shortCutKey) {
|
|
185
|
+
items[num].tooltipText = (tooltipText !== shortCutKey) ? tooltipText + ' (' + shortCutKey + ')' : tooltipText;
|
|
185
186
|
}
|
|
186
187
|
}
|
|
187
188
|
return items;
|
|
@@ -170,15 +170,6 @@ var ColorPickerInput = /** @class */ (function () {
|
|
|
170
170
|
this.parent.on(events.destroyColorPicker, this.destroyColorPicker, this);
|
|
171
171
|
this.parent.on(events.modelChanged, this.onPropertyChanged, this);
|
|
172
172
|
this.parent.on(events.bindCssClass, this.setCssClass, this);
|
|
173
|
-
this.parent.on(events.showColorPicker, this.showColorPicker, this);
|
|
174
|
-
};
|
|
175
|
-
ColorPickerInput.prototype.showColorPicker = function (e) {
|
|
176
|
-
if (!isNullOrUndefined(this.fontColorPicker) && (e.toolbarClick === "fontcolor")) {
|
|
177
|
-
this.fontColorDropDown.toggle();
|
|
178
|
-
}
|
|
179
|
-
else if (!isNullOrUndefined(this.backgroundColorPicker) && (e.toolbarClick === "backgroundcolor")) {
|
|
180
|
-
this.backgroundColorDropDown.toggle();
|
|
181
|
-
}
|
|
182
173
|
};
|
|
183
174
|
ColorPickerInput.prototype.onPropertyChanged = function (model) {
|
|
184
175
|
var newProp = model.newProp;
|
|
@@ -252,7 +243,6 @@ var ColorPickerInput = /** @class */ (function () {
|
|
|
252
243
|
this.parent.off(events.destroyColorPicker, this.destroyColorPicker);
|
|
253
244
|
this.parent.off(events.modelChanged, this.onPropertyChanged);
|
|
254
245
|
this.parent.off(events.bindCssClass, this.setCssClass);
|
|
255
|
-
this.parent.off(events.showColorPicker, this.showColorPicker);
|
|
256
246
|
};
|
|
257
247
|
return ColorPickerInput;
|
|
258
248
|
}());
|
|
@@ -35,7 +35,7 @@ var Count = /** @class */ (function () {
|
|
|
35
35
|
};
|
|
36
36
|
Count.prototype.appendCount = function () {
|
|
37
37
|
var htmlText = this.parent.editorMode === 'Markdown' ? this.editPanel.value :
|
|
38
|
-
|
|
38
|
+
this.editPanel.textContent;
|
|
39
39
|
if (this.parent.editorMode !== 'Markdown' && htmlText.indexOf('\u200B') !== -1) {
|
|
40
40
|
this.htmlLength = htmlText.replace(/\u200B/g, '').length;
|
|
41
41
|
}
|
|
@@ -134,7 +134,7 @@ var DropDownButtons = /** @class */ (function () {
|
|
|
134
134
|
if (isNullOrUndefined(targetElement) || targetElement.classList.contains(classes.CLS_DROPDOWN_BTN)) {
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
|
-
var fontsize =
|
|
137
|
+
var fontsize = _this.parent.fontSize.items.slice();
|
|
138
138
|
fontsize.forEach(function (item) {
|
|
139
139
|
Object.defineProperties(item, {
|
|
140
140
|
command: { value: 'Font', enumerable: true }, subCommand: { value: 'FontSize', enumerable: true }
|
|
@@ -333,7 +333,7 @@ var DropDownButtons = /** @class */ (function () {
|
|
|
333
333
|
if (targetElement.classList.contains(classes.CLS_DROPDOWN_BTN)) {
|
|
334
334
|
return;
|
|
335
335
|
}
|
|
336
|
-
this.
|
|
336
|
+
this.tableRowsDropDown = this.toolbarRenderer.renderDropDownButton({
|
|
337
337
|
iconCss: 'e-table-cell e-icons',
|
|
338
338
|
cssClass: classes.CLS_DROPDOWN_POPUP + ' ' + classes.CLS_DROPDOWN_ITEMS + ' ' + classes.CLS_QUICK_DROPDOWN,
|
|
339
339
|
itemName: 'TableCell',
|
|
@@ -441,10 +441,6 @@ var DropDownButtons = /** @class */ (function () {
|
|
|
441
441
|
this.removeDropDownClasses(this.tableColumnsDropDown.element);
|
|
442
442
|
this.tableColumnsDropDown.destroy();
|
|
443
443
|
}
|
|
444
|
-
if (this.tableCellDropDown) {
|
|
445
|
-
this.removeDropDownClasses(this.tableCellDropDown.element);
|
|
446
|
-
this.tableCellDropDown.destroy();
|
|
447
|
-
}
|
|
448
444
|
if (this.tableCellVerticalAlignDropDown) {
|
|
449
445
|
this.removeDropDownClasses(this.tableCellVerticalAlignDropDown.element);
|
|
450
446
|
this.tableCellVerticalAlignDropDown.destroy();
|
|
@@ -498,7 +494,7 @@ var DropDownButtons = /** @class */ (function () {
|
|
|
498
494
|
var dropDownObj = [
|
|
499
495
|
this.formatDropDown, this.fontNameDropDown, this.fontSizeDropDown, this.alignDropDown, this.imageAlignDropDown,
|
|
500
496
|
this.displayDropDown, this.numberFormatListDropDown, this.bulletFormatListDropDown, this.tableRowsDropDown,
|
|
501
|
-
this.tableColumnsDropDown, this.
|
|
497
|
+
this.tableColumnsDropDown, this.tableCellVerticalAlignDropDown
|
|
502
498
|
];
|
|
503
499
|
for (var i = 0; i < dropDownObj.length; i++) {
|
|
504
500
|
this.updateCss(dropDownObj[i], e);
|
|
@@ -516,7 +512,7 @@ var DropDownButtons = /** @class */ (function () {
|
|
|
516
512
|
this.parent.on(events.bindCssClass, this.setCssClass, this);
|
|
517
513
|
};
|
|
518
514
|
DropDownButtons.prototype.onIframeMouseDown = function () {
|
|
519
|
-
if (
|
|
515
|
+
if (this.parent.getToolbarElement().querySelectorAll('.e-rte-dropdown-btn[aria-expanded="true"]').length > 0) {
|
|
520
516
|
dispatchEvent(document, 'mousedown');
|
|
521
517
|
}
|
|
522
518
|
};
|
|
@@ -61,10 +61,10 @@ var EmojiPicker = /** @class */ (function () {
|
|
|
61
61
|
}
|
|
62
62
|
this.popDiv = this.parent.createElement('div', { className: 'e-rte-emojipicker-popup', id: this.parent.getID() + '_emojiPicker' });
|
|
63
63
|
if (!isNOU(this.parent.getToolbar()) && !this.parent.inlineMode.enable) {
|
|
64
|
-
this.parent.getToolbar().
|
|
64
|
+
this.parent.getToolbar().appendChild(this.popDiv);
|
|
65
65
|
}
|
|
66
66
|
else if (this.parent.inlineMode.enable) {
|
|
67
|
-
this.parent.
|
|
67
|
+
this.parent.inputElement.appendChild(this.popDiv);
|
|
68
68
|
}
|
|
69
69
|
EventHandler.add(this.popDiv, 'keydown', this.onKeyDown, this);
|
|
70
70
|
EventHandler.add(this.popDiv, 'keyup', this.searchFilter, this);
|
|
@@ -638,12 +638,12 @@ var EmojiPicker = /** @class */ (function () {
|
|
|
638
638
|
}
|
|
639
639
|
}
|
|
640
640
|
}
|
|
641
|
-
if (noEMoji && !this.parent.element.querySelector('.e-rte-emojiSearch-noEmoji') && (inputValue !== '' && value !== ':'
|
|
641
|
+
if (noEMoji && !this.parent.element.querySelector('.e-rte-emojiSearch-noEmoji') && (inputValue !== '' && value !== ':')) {
|
|
642
642
|
noEmojiObj.innerHTML = '<span style="color: rgba(0, 0, 0, 0.75); font-weight: 500; font-size: 16px;">' + this.i10n.getConstant('emojiPickerNoResultFound') + ' 😥 </span>' + '<br>' + '<span style="color: rgba(0, 0, 0, 0.75);"> ' + this.i10n.getConstant('emojiPickerTrySomethingElse') + ' ? </span>';
|
|
643
643
|
noEmojiObj.style.margin = '55px';
|
|
644
644
|
emojipickerAll.appendChild(noEmojiObj);
|
|
645
645
|
}
|
|
646
|
-
else if (!noEMoji && this.parent.element.querySelector('.e-rte-emojiSearch-noEmoji') || (inputValue === '' && value === ':')
|
|
646
|
+
else if (!noEMoji && this.parent.element.querySelector('.e-rte-emojiSearch-noEmoji') || (inputValue === '' && value === ':')) {
|
|
647
647
|
emojipickerAll.removeChild(this.parent.element.querySelector('.e-rte-emojiSearch-noEmoji'));
|
|
648
648
|
}
|
|
649
649
|
emojipickerAll.appendChild(emojiBtnDiv);
|
|
@@ -47,11 +47,10 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
47
47
|
curElement = curElement.parentElement;
|
|
48
48
|
blockElement = curElement;
|
|
49
49
|
}
|
|
50
|
-
isTableEnter = blockElement.tagName === '
|
|
50
|
+
isTableEnter = blockElement.tagName === 'TD' || blockElement.tagName === 'TBODY' ? false : true;
|
|
51
51
|
}
|
|
52
52
|
if (e.args.which === 13 && !e.args.ctrlKey && (!Browser.isDevice ? e.args.code === 'Enter' : e.args.key === 'Enter')) {
|
|
53
|
-
if (isNOU(this.startNode.closest('LI, UL, OL')) && isNOU(this.endNode.closest('LI, UL, OL')) &&
|
|
54
|
-
isNOU(this.startNode.closest('.e-img-inner')) && isTableEnter &&
|
|
53
|
+
if (isNOU(this.startNode.closest('LI, UL, OL')) && isNOU(this.endNode.closest('LI, UL, OL')) && isTableEnter &&
|
|
55
54
|
isNOU(this.startNode.closest('PRE')) && isNOU(this.endNode.closest('PRE'))) {
|
|
56
55
|
var shiftKey_1 = e.args.shiftKey;
|
|
57
56
|
var actionBeginArgs = {
|
|
@@ -62,9 +61,6 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
62
61
|
};
|
|
63
62
|
this.parent.trigger(events.actionBegin, actionBeginArgs, function (actionBeginArgs) {
|
|
64
63
|
if (!actionBeginArgs.cancel) {
|
|
65
|
-
if (_this.parent.formatter.getUndoRedoStack().length === 0) {
|
|
66
|
-
_this.parent.formatter.saveData();
|
|
67
|
-
}
|
|
68
64
|
if (!(_this.range.startOffset === _this.range.endOffset && _this.range.startContainer === _this.range.endContainer)) {
|
|
69
65
|
if (!(_this.range.startContainer.nodeName === 'SPAN' && (_this.range.startContainer.classList.contains('e-video-wrap') ||
|
|
70
66
|
_this.range.startContainer.classList.contains('e-audio-wrap')))) {
|
|
@@ -489,10 +485,10 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
489
485
|
}
|
|
490
486
|
var previousBlockNode = this.parent.formatter.editorManager.domNode.blockNodes()[0].previousSibling;
|
|
491
487
|
var nextBlockNode = this.parent.formatter.editorManager.domNode.blockNodes()[0].nextSibling;
|
|
492
|
-
if (!isNOU(previousBlockNode) && previousBlockNode.
|
|
488
|
+
if (!isNOU(previousBlockNode) && previousBlockNode.hasAttribute('style')) {
|
|
493
489
|
insertElem.setAttribute('style', previousBlockNode.getAttribute('style'));
|
|
494
490
|
}
|
|
495
|
-
if (isNOU(previousBlockNode) && !isNOU(nextBlockNode) && nextBlockNode.
|
|
491
|
+
if (isNOU(previousBlockNode) && !isNOU(nextBlockNode) && nextBlockNode.hasAttribute('style')) {
|
|
496
492
|
insertElem.setAttribute('style', nextBlockNode.getAttribute('style'));
|
|
497
493
|
}
|
|
498
494
|
return insertElem;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addClass,
|
|
1
|
+
import { addClass, isNullOrUndefined as isNOU, removeClass } from '@syncfusion/ej2-base';
|
|
2
2
|
import * as events from '../base/constant';
|
|
3
3
|
var FormatPainter = /** @class */ (function () {
|
|
4
4
|
function FormatPainter(parent) {
|
|
@@ -43,9 +43,6 @@ var FormatPainter = /** @class */ (function () {
|
|
|
43
43
|
if ((originalEvent.action === 'format-copy' || originalEvent.action === 'format-paste')) {
|
|
44
44
|
originalEvent.stopPropagation();
|
|
45
45
|
}
|
|
46
|
-
if (Browser.userAgent.indexOf('Firefox') !== -1) {
|
|
47
|
-
originalEvent.preventDefault();
|
|
48
|
-
}
|
|
49
46
|
this.actionHandler(event, 'keyBoard');
|
|
50
47
|
}
|
|
51
48
|
};
|
|
@@ -46,7 +46,7 @@ var FullScreen = /** @class */ (function () {
|
|
|
46
46
|
_this.parent.element.classList.add(classes.CLS_FULL_SCREEN);
|
|
47
47
|
_this.toggleParentOverflow(true);
|
|
48
48
|
var isExpand = _this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
|
|
49
|
-
_this.parent.setContentHeight(
|
|
49
|
+
_this.parent.setContentHeight(null, isExpand);
|
|
50
50
|
if (_this.parent.toolbarModule) {
|
|
51
51
|
if (!_this.parent.getBaseToolbarObject().toolbarObj.items[0].properties) {
|
|
52
52
|
_this.parent.getBaseToolbarObject().toolbarObj.removeItems(0);
|
|
@@ -98,7 +98,7 @@ var FullScreen = /** @class */ (function () {
|
|
|
98
98
|
removeClass([elem[i]], ['e-rte-overflow']);
|
|
99
99
|
}
|
|
100
100
|
var isExpand = _this.parent.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0 ? true : false;
|
|
101
|
-
_this.parent.setContentHeight(
|
|
101
|
+
_this.parent.setContentHeight(null, isExpand);
|
|
102
102
|
if (_this.parent.toolbarModule) {
|
|
103
103
|
if (!_this.parent.getBaseToolbarObject().toolbarObj.items[0].properties) {
|
|
104
104
|
_this.parent.getBaseToolbarObject().toolbarObj.removeItems(0);
|
|
@@ -112,7 +112,6 @@ var FullScreen = /** @class */ (function () {
|
|
|
112
112
|
_this.parent.toolbarModule.addFixedTBarClass();
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
_this.parent.refreshUI();
|
|
116
115
|
_this.parent.trigger(events.actionComplete, { requestType: 'Minimize', targetItem: 'Minimize', args: event });
|
|
117
116
|
}
|
|
118
117
|
});
|
|
@@ -22,6 +22,7 @@ export declare class HtmlEditor {
|
|
|
22
22
|
private saveSelection;
|
|
23
23
|
xhtmlValidation: XhtmlValidation;
|
|
24
24
|
private clickTimeout;
|
|
25
|
+
private tooltipTargetEle;
|
|
25
26
|
constructor(parent?: IRichTextEditor, serviceLocator?: ServiceLocator);
|
|
26
27
|
/**
|
|
27
28
|
* Destroys the Markdown.
|
|
@@ -44,8 +45,6 @@ export declare class HtmlEditor {
|
|
|
44
45
|
private onSelectionSave;
|
|
45
46
|
private onSelectionRestore;
|
|
46
47
|
private isTableClassAdded;
|
|
47
|
-
private onHandleFontsizeChange;
|
|
48
|
-
private convertFontSize;
|
|
49
48
|
private onKeyUp;
|
|
50
49
|
private onKeyDown;
|
|
51
50
|
private isOrderedList;
|
|
@@ -58,6 +57,7 @@ export declare class HtmlEditor {
|
|
|
58
57
|
private getRangeLiNode;
|
|
59
58
|
private onPaste;
|
|
60
59
|
private spaceLink;
|
|
60
|
+
private mouseOutHandler;
|
|
61
61
|
private onToolbarClick;
|
|
62
62
|
private renderColorPicker;
|
|
63
63
|
private instantiateRenderer;
|