@syncfusion/ej2-richtexteditor 19.2.62 → 19.3.43
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 +1 -1
- package/CHANGELOG.md +21 -9
- 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 +858 -245
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +864 -243
- 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 +12 -12
- package/src/common/types.d.ts +8 -0
- package/src/editor-manager/base/editor-manager.d.ts +1 -1
- package/src/editor-manager/base/editor-manager.js +6 -6
- package/src/editor-manager/base/interface.d.ts +7 -1
- package/src/editor-manager/plugin/clearformat-exec.js +2 -2
- package/src/editor-manager/plugin/clearformat.d.ts +3 -1
- package/src/editor-manager/plugin/clearformat.js +19 -9
- package/src/editor-manager/plugin/dom-node.js +2 -2
- package/src/editor-manager/plugin/formats.d.ts +1 -0
- package/src/editor-manager/plugin/formats.js +87 -7
- package/src/editor-manager/plugin/image.js +55 -47
- package/src/editor-manager/plugin/inserthtml.js +10 -2
- package/src/editor-manager/plugin/isformatted.js +2 -1
- package/src/editor-manager/plugin/lists.d.ts +1 -0
- package/src/editor-manager/plugin/lists.js +87 -8
- package/src/editor-manager/plugin/nodecutter.d.ts +1 -0
- package/src/editor-manager/plugin/nodecutter.js +1 -0
- package/src/editor-manager/plugin/selection-commands.d.ts +2 -1
- package/src/editor-manager/plugin/selection-commands.js +14 -6
- package/src/editor-manager/plugin/selection-exec.js +2 -2
- package/src/editor-manager/plugin/table.js +19 -9
- package/src/rich-text-editor/actions/base-quick-toolbar.js +3 -4
- package/src/rich-text-editor/actions/enter-key.d.ts +18 -0
- package/src/rich-text-editor/actions/enter-key.js +290 -0
- package/src/rich-text-editor/actions/html-editor.js +30 -20
- package/src/rich-text-editor/actions/paste-clean-up.js +5 -5
- package/src/rich-text-editor/actions/resize.js +4 -4
- package/src/rich-text-editor/base/constant.d.ts +5 -0
- package/src/rich-text-editor/base/constant.js +5 -0
- package/src/rich-text-editor/base/interface.d.ts +15 -3
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +27 -1
- package/src/rich-text-editor/base/rich-text-editor.d.ts +34 -5
- package/src/rich-text-editor/base/rich-text-editor.js +58 -56
- package/src/rich-text-editor/base/util.d.ts +7 -1
- package/src/rich-text-editor/base/util.js +45 -11
- package/src/rich-text-editor/formatter/formatter.js +9 -7
- package/src/rich-text-editor/models/items.js +3 -3
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +2 -2
- package/src/rich-text-editor/renderer/image-module.d.ts +6 -0
- package/src/rich-text-editor/renderer/image-module.js +70 -26
- package/src/rich-text-editor/renderer/link-module.js +4 -3
- package/src/rich-text-editor/renderer/popup-renderer.js +1 -2
- package/src/rich-text-editor/renderer/render.js +10 -2
- package/src/rich-text-editor/renderer/table-module.js +13 -5
- package/src/rich-text-editor/renderer/view-source.js +21 -3
- package/styles/bootstrap-dark.css +25 -12
- package/styles/bootstrap.css +25 -12
- package/styles/bootstrap4.css +21 -13
- package/styles/bootstrap5-dark.css +3058 -0
- package/styles/bootstrap5-dark.scss +1 -0
- package/styles/bootstrap5.css +3058 -0
- package/styles/bootstrap5.scss +1 -0
- package/styles/fabric-dark.css +20 -12
- package/styles/fabric.css +20 -12
- package/styles/highcontrast-light.css +20 -12
- package/styles/highcontrast.css +19 -18
- package/styles/material-dark.css +22 -14
- package/styles/material.css +19 -11
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +1 -1
- package/styles/rich-text-editor/_bootstrap-definition.scss +1 -1
- package/styles/rich-text-editor/_bootstrap4-definition.scss +2 -2
- package/styles/rich-text-editor/_bootstrap5-dark-definition.scss +1 -0
- package/styles/rich-text-editor/_bootstrap5-definition.scss +168 -0
- package/styles/rich-text-editor/_fabric-dark-definition.scss +1 -1
- package/styles/rich-text-editor/_fabric-definition.scss +1 -1
- package/styles/rich-text-editor/_highcontrast-definition.scss +2 -2
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +1 -1
- package/styles/rich-text-editor/_layout.scss +64 -7
- package/styles/rich-text-editor/_tailwind-dark-definition.scss +1 -165
- package/styles/rich-text-editor/_tailwind-definition.scss +74 -72
- package/styles/rich-text-editor/_theme.scss +103 -3
- package/styles/rich-text-editor/bootstrap-dark.css +25 -12
- package/styles/rich-text-editor/bootstrap.css +25 -12
- package/styles/rich-text-editor/bootstrap4.css +21 -13
- package/styles/rich-text-editor/bootstrap5-dark.css +3058 -0
- package/styles/rich-text-editor/bootstrap5-dark.scss +4 -0
- package/styles/rich-text-editor/bootstrap5.css +3058 -0
- package/styles/rich-text-editor/bootstrap5.scss +4 -0
- package/styles/rich-text-editor/fabric-dark.css +20 -12
- package/styles/rich-text-editor/fabric.css +20 -12
- package/styles/rich-text-editor/highcontrast-light.css +20 -12
- package/styles/rich-text-editor/highcontrast.css +19 -18
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_bootstrap.scss +1 -1
- package/styles/rich-text-editor/icons/_bootstrap4.scss +1 -1
- package/styles/rich-text-editor/icons/_bootstrap5-dark.scss +1 -0
- package/styles/rich-text-editor/icons/_bootstrap5.scss +303 -0
- package/styles/rich-text-editor/icons/_fabric-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_fabric.scss +1 -1
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +1 -1
- package/styles/rich-text-editor/icons/_highcontrast.scss +1 -1
- package/styles/rich-text-editor/icons/_material-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_material.scss +1 -1
- package/styles/rich-text-editor/icons/_tailwind-dark.scss +1 -304
- package/styles/rich-text-editor/icons/_tailwind.scss +2 -2
- package/styles/rich-text-editor/material-dark.css +22 -14
- package/styles/rich-text-editor/material.css +19 -11
- package/styles/rich-text-editor/tailwind-dark.css +51 -20
- package/styles/rich-text-editor/tailwind.css +49 -18
- package/styles/tailwind-dark.css +51 -20
- package/styles/tailwind.css +49 -18
|
@@ -1,8 +1,8 @@
|
|
|
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,
|
|
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
4
|
import { Dialog, Popup, getScrollableParent, isCollide } from '@syncfusion/ej2-popups';
|
|
5
|
-
import { ColorPicker, NumericTextBox, Uploader } from '@syncfusion/ej2-inputs';
|
|
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';
|
|
8
8
|
|
|
@@ -449,6 +449,11 @@ var readOnlyMode = 'readOnlyMode';
|
|
|
449
449
|
* @deprecated
|
|
450
450
|
*/
|
|
451
451
|
var pasteClean = 'pasteClean';
|
|
452
|
+
/**
|
|
453
|
+
* @hidden
|
|
454
|
+
* @deprecated
|
|
455
|
+
*/
|
|
456
|
+
var enterHandler = 'enterHandler';
|
|
452
457
|
/**
|
|
453
458
|
* @hidden
|
|
454
459
|
* @deprecated
|
|
@@ -1351,14 +1356,14 @@ var tools = {
|
|
|
1351
1356
|
'numberformatlist': {
|
|
1352
1357
|
'id': 'NumberFormatList',
|
|
1353
1358
|
'icon': 'e-order-list',
|
|
1354
|
-
'tooltip': '
|
|
1359
|
+
'tooltip': 'Number Format List',
|
|
1355
1360
|
'command': 'NumberFormatList',
|
|
1356
1361
|
'subCommand': 'NumberFormatList'
|
|
1357
1362
|
},
|
|
1358
1363
|
'bulletformatlist': {
|
|
1359
1364
|
'id': 'BulletFormatList',
|
|
1360
1365
|
'icon': 'e-unorder-list',
|
|
1361
|
-
'tooltip': '
|
|
1366
|
+
'tooltip': 'Bullet Format List',
|
|
1362
1367
|
'command': 'BulletFormatList',
|
|
1363
1368
|
'subCommand': 'BulletFormatList'
|
|
1364
1369
|
},
|
|
@@ -1532,7 +1537,7 @@ var tools = {
|
|
|
1532
1537
|
},
|
|
1533
1538
|
'dimension': {
|
|
1534
1539
|
'id': 'Dimension',
|
|
1535
|
-
'icon': 'e-dimension',
|
|
1540
|
+
'icon': 'e-img-dimension',
|
|
1536
1541
|
'tooltip': 'Change Size',
|
|
1537
1542
|
'command': 'Images',
|
|
1538
1543
|
'subCommand': 'Dimension'
|
|
@@ -2492,11 +2497,19 @@ function toObjectLowerCase(obj) {
|
|
|
2492
2497
|
function getEditValue(value, rteObj) {
|
|
2493
2498
|
var val;
|
|
2494
2499
|
if (value !== null && value !== '') {
|
|
2495
|
-
val = rteObj.enableHtmlEncode ? updateTextNode(decode(value)) : updateTextNode(value);
|
|
2500
|
+
val = rteObj.enableHtmlEncode ? updateTextNode(decode(value), rteObj) : updateTextNode(value, rteObj);
|
|
2496
2501
|
rteObj.setProperties({ value: val }, true);
|
|
2497
2502
|
}
|
|
2498
2503
|
else {
|
|
2499
|
-
|
|
2504
|
+
if (rteObj.enterKey === 'DIV') {
|
|
2505
|
+
val = rteObj.enableHtmlEncode ? '<div><br/></div>' : '<div><br/></div>';
|
|
2506
|
+
}
|
|
2507
|
+
else if (rteObj.enterKey === 'BR') {
|
|
2508
|
+
val = rteObj.enableHtmlEncode ? '<br/>' : '<br/>';
|
|
2509
|
+
}
|
|
2510
|
+
else {
|
|
2511
|
+
val = rteObj.enableHtmlEncode ? '<p><br/></p>' : '<p><br/></p>';
|
|
2512
|
+
}
|
|
2500
2513
|
}
|
|
2501
2514
|
return val;
|
|
2502
2515
|
}
|
|
@@ -2505,7 +2518,7 @@ function getEditValue(value, rteObj) {
|
|
|
2505
2518
|
* @returns {string} - returns the string
|
|
2506
2519
|
* @hidden
|
|
2507
2520
|
*/
|
|
2508
|
-
function updateTextNode(value) {
|
|
2521
|
+
function updateTextNode(value, rteObj) {
|
|
2509
2522
|
var tempNode = document.createElement('div');
|
|
2510
2523
|
var resultElm = document.createElement('div');
|
|
2511
2524
|
var childNodes = tempNode.childNodes;
|
|
@@ -2514,20 +2527,25 @@ function updateTextNode(value) {
|
|
|
2514
2527
|
if (childNodes.length > 0) {
|
|
2515
2528
|
var isPreviousInlineElem = void 0;
|
|
2516
2529
|
var previousParent = void 0;
|
|
2517
|
-
var
|
|
2530
|
+
var insertElem = void 0;
|
|
2518
2531
|
while (tempNode.firstChild) {
|
|
2519
|
-
if ((tempNode.firstChild.nodeName === '#text' &&
|
|
2532
|
+
if (rteObj.enterKey !== 'BR' && ((tempNode.firstChild.nodeName === '#text' &&
|
|
2520
2533
|
(tempNode.firstChild.textContent.indexOf('\n') < 0 || tempNode.firstChild.textContent.trim() !== '')) ||
|
|
2521
|
-
inlineNode.indexOf(tempNode.firstChild.nodeName.toLocaleLowerCase()) >= 0) {
|
|
2534
|
+
inlineNode.indexOf(tempNode.firstChild.nodeName.toLocaleLowerCase()) >= 0)) {
|
|
2522
2535
|
if (!isPreviousInlineElem) {
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2536
|
+
if (rteObj.enterKey === 'DIV') {
|
|
2537
|
+
insertElem = createElement('div');
|
|
2538
|
+
}
|
|
2539
|
+
else {
|
|
2540
|
+
insertElem = createElement('p');
|
|
2541
|
+
}
|
|
2542
|
+
resultElm.appendChild(insertElem);
|
|
2543
|
+
insertElem.appendChild(tempNode.firstChild);
|
|
2526
2544
|
}
|
|
2527
2545
|
else {
|
|
2528
2546
|
previousParent.appendChild(tempNode.firstChild);
|
|
2529
2547
|
}
|
|
2530
|
-
previousParent =
|
|
2548
|
+
previousParent = insertElem;
|
|
2531
2549
|
isPreviousInlineElem = true;
|
|
2532
2550
|
}
|
|
2533
2551
|
else if (tempNode.firstChild.nodeName === '#text' && (tempNode.firstChild.textContent === '\n' ||
|
|
@@ -2552,13 +2570,34 @@ function updateTextNode(value) {
|
|
|
2552
2570
|
}
|
|
2553
2571
|
return resultElm.innerHTML;
|
|
2554
2572
|
}
|
|
2573
|
+
/**
|
|
2574
|
+
* @param {IRichTextEditor} rteObj - specifies the rte object
|
|
2575
|
+
* @returns {string} - returns the value based on enter configuration.
|
|
2576
|
+
* @hidden
|
|
2577
|
+
*/
|
|
2578
|
+
function getDefaultValue(rteObj) {
|
|
2579
|
+
var currentVal;
|
|
2580
|
+
if (rteObj.enterKey === 'DIV') {
|
|
2581
|
+
currentVal = rteObj.enableHtmlEncode ? '<div><br/></div>' : '<div><br/></div>';
|
|
2582
|
+
}
|
|
2583
|
+
else if (rteObj.enterKey === 'BR') {
|
|
2584
|
+
currentVal = rteObj.enableHtmlEncode ? '<br/>' : '<br/>';
|
|
2585
|
+
}
|
|
2586
|
+
else {
|
|
2587
|
+
currentVal = rteObj.enableHtmlEncode ? '<p><br/></p>' : '<p><br/></p>';
|
|
2588
|
+
}
|
|
2589
|
+
return currentVal;
|
|
2590
|
+
}
|
|
2555
2591
|
/**
|
|
2556
2592
|
* @param {string} value - specifies the value
|
|
2557
2593
|
* @returns {boolean} - returns the boolean value
|
|
2558
2594
|
* @hidden
|
|
2559
2595
|
*/
|
|
2560
2596
|
function isEditableValueEmpty(value) {
|
|
2561
|
-
return (value === '<p><br></p>' || value === '<p><br></p>'
|
|
2597
|
+
return (value === '<p><br></p>' || value === '<p><br></p>'
|
|
2598
|
+
|| value === '<div><br></div>' || value === '<div><br></div>'
|
|
2599
|
+
|| value === '<br>' || value === '<br>'
|
|
2600
|
+
|| value === '') ? true : false;
|
|
2562
2601
|
}
|
|
2563
2602
|
/**
|
|
2564
2603
|
* @param {string} value - specifies the string value
|
|
@@ -5292,8 +5331,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
5292
5331
|
*/
|
|
5293
5332
|
BaseQuickToolbar.prototype.showPopup = function (x, y, target) {
|
|
5294
5333
|
var _this = this;
|
|
5295
|
-
var eventArgs =
|
|
5296
|
-
{ popup: this.popupObj, cancel: false, targetElement: target };
|
|
5334
|
+
var eventArgs = { popup: this.popupObj, cancel: false, targetElement: target };
|
|
5297
5335
|
this.parent.trigger(beforeQuickToolbarOpen, eventArgs, function (beforeQuickToolbarArgs) {
|
|
5298
5336
|
if (!beforeQuickToolbarArgs.cancel) {
|
|
5299
5337
|
var editPanelTop = void 0;
|
|
@@ -5420,7 +5458,7 @@ var BaseQuickToolbar = /** @__PURE__ @class */ (function () {
|
|
|
5420
5458
|
this.colorPickerObj.destroyColorPicker();
|
|
5421
5459
|
removeClass([this.element], [CLS_POP]);
|
|
5422
5460
|
detach(element);
|
|
5423
|
-
var args =
|
|
5461
|
+
var args = this.popupObj;
|
|
5424
5462
|
this.parent.trigger(quickToolbarClose, args);
|
|
5425
5463
|
}
|
|
5426
5464
|
};
|
|
@@ -5530,7 +5568,7 @@ var PopupRenderer = /** @__PURE__ @class */ (function () {
|
|
|
5530
5568
|
this.parent = parent;
|
|
5531
5569
|
}
|
|
5532
5570
|
PopupRenderer.prototype.quickToolbarOpen = function () {
|
|
5533
|
-
var args =
|
|
5571
|
+
var args = this.popupObj;
|
|
5534
5572
|
this.parent.trigger(quickToolbarOpen, args);
|
|
5535
5573
|
};
|
|
5536
5574
|
/**
|
|
@@ -6820,10 +6858,6 @@ var Formatter = /** @__PURE__ @class */ (function () {
|
|
|
6820
6858
|
itemCollection: value
|
|
6821
6859
|
};
|
|
6822
6860
|
extend(args, args, items, true);
|
|
6823
|
-
if (isBlazor()) {
|
|
6824
|
-
delete args.item;
|
|
6825
|
-
delete args.itemCollection;
|
|
6826
|
-
}
|
|
6827
6861
|
self.trigger(actionBegin, args, function (actionBeginArgs) {
|
|
6828
6862
|
if (actionBeginArgs.cancel) {
|
|
6829
6863
|
if (action_1 === 'paste' || action_1 === 'cut' || action_1 === 'copy') {
|
|
@@ -6835,10 +6869,16 @@ var Formatter = /** @__PURE__ @class */ (function () {
|
|
|
6835
6869
|
var isTableModule = isNullOrUndefined(self.tableModule) ? true : self.tableModule ?
|
|
6836
6870
|
self.tableModule.ensureInsideTableList : false;
|
|
6837
6871
|
if ((event.which === 9 && isTableModule) || event.which !== 9) {
|
|
6872
|
+
if (event.which === 13 && self.editorMode === 'HTML') {
|
|
6873
|
+
value = {
|
|
6874
|
+
'enterAction': self.enterKey
|
|
6875
|
+
};
|
|
6876
|
+
}
|
|
6838
6877
|
this.editorManager.observer.notify((event.type === 'keydown' ? KEY_DOWN : KEY_UP), {
|
|
6839
6878
|
event: event,
|
|
6840
6879
|
callBack: this.onSuccess.bind(this, self),
|
|
6841
|
-
value: value
|
|
6880
|
+
value: value,
|
|
6881
|
+
enterAction: self.enterKey
|
|
6842
6882
|
});
|
|
6843
6883
|
}
|
|
6844
6884
|
}
|
|
@@ -6866,7 +6906,7 @@ var Formatter = /** @__PURE__ @class */ (function () {
|
|
|
6866
6906
|
else {
|
|
6867
6907
|
_this.editorManager.observer.notify(checkUndo, { subCommand: actionBeginArgs.item.subCommand });
|
|
6868
6908
|
_this.editorManager.execCommand(actionBeginArgs.item.command, actionBeginArgs.item.subCommand, event, _this.onSuccess.bind(_this, self), actionBeginArgs.item.value, actionBeginArgs.item.subCommand === 'Pre' && args.name === 'dropDownSelect' ?
|
|
6869
|
-
{ name: args.name } : value, ('#' + self.getID() + ' iframe'));
|
|
6909
|
+
{ name: args.name } : value, ('#' + self.getID() + ' iframe'), self.enterKey);
|
|
6870
6910
|
}
|
|
6871
6911
|
}
|
|
6872
6912
|
});
|
|
@@ -10258,8 +10298,8 @@ var DOMNode = /** @__PURE__ @class */ (function () {
|
|
|
10258
10298
|
this.replaceWith(start, this.marker(className, this.encode(start.textContent)));
|
|
10259
10299
|
}
|
|
10260
10300
|
else if (start.tagName === 'BR') {
|
|
10261
|
-
this.replaceWith(start, this.marker(
|
|
10262
|
-
var markerStart = range.startContainer.querySelector('.' +
|
|
10301
|
+
this.replaceWith(start, this.marker(className, this.encode(start.textContent)));
|
|
10302
|
+
var markerStart = range.startContainer.querySelector('.' + className);
|
|
10263
10303
|
markerStart.appendChild(start);
|
|
10264
10304
|
}
|
|
10265
10305
|
else {
|
|
@@ -10501,7 +10541,7 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
10501
10541
|
var olListStartRegex = [/^[1]+[.]+$/, /^[i]+[.]+$/, /^[a]+[.]+$/];
|
|
10502
10542
|
if (!isNullOrUndefined(range.startContainer.textContent.slice(0, range.startOffset))) {
|
|
10503
10543
|
for (var i = 0; i < olListStartRegex.length; i++) {
|
|
10504
|
-
if (olListStartRegex[i].test(range.startContainer.textContent.slice(0, range.startOffset).trim())) {
|
|
10544
|
+
if (olListStartRegex[i].test(range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim())) {
|
|
10505
10545
|
return true;
|
|
10506
10546
|
}
|
|
10507
10547
|
}
|
|
@@ -10529,8 +10569,8 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
10529
10569
|
this.applyListsHandler({ subCommand: 'OL', callBack: e.callBack });
|
|
10530
10570
|
e.event.preventDefault();
|
|
10531
10571
|
}
|
|
10532
|
-
else if (range.startContainer.textContent.slice(0, range.startOffset).trim() === '*' ||
|
|
10533
|
-
range.startContainer.textContent.slice(0, range.startOffset).trim() === '-') {
|
|
10572
|
+
else if (range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim() === '*' ||
|
|
10573
|
+
range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim() === '-') {
|
|
10534
10574
|
range.startContainer.textContent = range.startContainer.textContent.slice(range.startOffset, range.startContainer.textContent.length);
|
|
10535
10575
|
this.applyListsHandler({ subCommand: 'UL', callBack: e.callBack });
|
|
10536
10576
|
e.event.preventDefault();
|
|
@@ -10551,15 +10591,24 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
10551
10591
|
var startNodeParent = startNode.parentElement;
|
|
10552
10592
|
if (isNullOrUndefined(startNodeParent.parentElement.closest('UL')) && isNullOrUndefined(startNodeParent.parentElement.closest('OL'))) {
|
|
10553
10593
|
if (!isNullOrUndefined(startNode.nextElementSibling)) {
|
|
10554
|
-
//startNode.classList.add('innerNode');
|
|
10555
10594
|
var nearBlockNode = this.parent.domNode.blockParentNode(startNode);
|
|
10556
10595
|
this.parent.nodeCutter.GetSpliceNode(range, nearBlockNode);
|
|
10557
10596
|
}
|
|
10558
|
-
var
|
|
10559
|
-
|
|
10560
|
-
|
|
10597
|
+
var insertTag = void 0;
|
|
10598
|
+
if (e.enterAction === 'DIV') {
|
|
10599
|
+
insertTag = createElement('div');
|
|
10600
|
+
insertTag.innerHTML = '<br>';
|
|
10601
|
+
}
|
|
10602
|
+
else if (e.enterAction === 'P') {
|
|
10603
|
+
insertTag = createElement('p');
|
|
10604
|
+
insertTag.innerHTML = '<br>';
|
|
10605
|
+
}
|
|
10606
|
+
else {
|
|
10607
|
+
insertTag = createElement('br');
|
|
10608
|
+
}
|
|
10609
|
+
this.parent.domNode.insertAfter(insertTag, startNodeParent);
|
|
10561
10610
|
e.event.preventDefault();
|
|
10562
|
-
this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,
|
|
10611
|
+
this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, insertTag, 0);
|
|
10563
10612
|
if (startNodeParent.textContent === '') {
|
|
10564
10613
|
detach(startNodeParent);
|
|
10565
10614
|
}
|
|
@@ -10856,6 +10905,66 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
10856
10905
|
this.currentAction = e.subCommand = this.currentAction === 'NumberFormatList' ? 'OL' : this.currentAction === 'BulletFormatList' ? 'UL' : this.currentAction;
|
|
10857
10906
|
this.domNode.setMarker(this.saveSelection);
|
|
10858
10907
|
var listsNodes = this.domNode.blockNodes();
|
|
10908
|
+
if (e.enterAction === 'BR') {
|
|
10909
|
+
this.setSelectionBRConfig();
|
|
10910
|
+
var allSelectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument);
|
|
10911
|
+
var selectedNodes = this.parent.nodeSelection.getSelectionNodes(allSelectedNode);
|
|
10912
|
+
var currentFormatNodes = [];
|
|
10913
|
+
if (selectedNodes.length === 0) {
|
|
10914
|
+
selectedNodes.push(listsNodes[0]);
|
|
10915
|
+
}
|
|
10916
|
+
for (var i = 0; i < selectedNodes.length; i++) {
|
|
10917
|
+
var currentNode = selectedNodes[i];
|
|
10918
|
+
var previousCurrentNode = void 0;
|
|
10919
|
+
while (!this.parent.domNode.isBlockNode(currentNode) && currentNode !== this.parent.editableElement) {
|
|
10920
|
+
previousCurrentNode = currentNode;
|
|
10921
|
+
currentNode = currentNode.parentElement;
|
|
10922
|
+
}
|
|
10923
|
+
if (this.parent.domNode.isBlockNode(currentNode) && currentNode === this.parent.editableElement) {
|
|
10924
|
+
currentFormatNodes.push(previousCurrentNode);
|
|
10925
|
+
}
|
|
10926
|
+
}
|
|
10927
|
+
for (var i = 0; i < currentFormatNodes.length; i++) {
|
|
10928
|
+
if (!this.parent.domNode.isBlockNode(currentFormatNodes[i])) {
|
|
10929
|
+
var currentNode = currentFormatNodes[i];
|
|
10930
|
+
var previousNode = currentNode;
|
|
10931
|
+
while (currentNode === this.parent.editableElement) {
|
|
10932
|
+
previousNode = currentNode;
|
|
10933
|
+
currentNode = currentNode.parentElement;
|
|
10934
|
+
}
|
|
10935
|
+
var tempElem = void 0;
|
|
10936
|
+
if (this.parent.domNode.isBlockNode(previousNode.parentElement) &&
|
|
10937
|
+
previousNode.parentElement === this.parent.editableElement) {
|
|
10938
|
+
tempElem = createElement('p');
|
|
10939
|
+
previousNode.parentElement.insertBefore(tempElem, previousNode);
|
|
10940
|
+
tempElem.appendChild(previousNode);
|
|
10941
|
+
}
|
|
10942
|
+
else {
|
|
10943
|
+
tempElem = previousNode;
|
|
10944
|
+
}
|
|
10945
|
+
var preNode = tempElem.previousSibling;
|
|
10946
|
+
while (!isNullOrUndefined(preNode) && preNode.nodeName !== 'BR' &&
|
|
10947
|
+
!this.parent.domNode.isBlockNode(preNode)) {
|
|
10948
|
+
tempElem.firstChild.parentElement.insertBefore(preNode, tempElem.firstChild);
|
|
10949
|
+
preNode = tempElem.previousSibling;
|
|
10950
|
+
}
|
|
10951
|
+
if (!isNullOrUndefined(preNode) && preNode.nodeName === 'BR') {
|
|
10952
|
+
detach(preNode);
|
|
10953
|
+
}
|
|
10954
|
+
var postNode = tempElem.nextSibling;
|
|
10955
|
+
while (!isNullOrUndefined(postNode) && postNode.nodeName !== 'BR' &&
|
|
10956
|
+
!this.parent.domNode.isBlockNode(postNode)) {
|
|
10957
|
+
tempElem.appendChild(postNode);
|
|
10958
|
+
postNode = tempElem.nextSibling;
|
|
10959
|
+
}
|
|
10960
|
+
if (!isNullOrUndefined(postNode) && postNode.nodeName === 'BR') {
|
|
10961
|
+
detach(postNode);
|
|
10962
|
+
}
|
|
10963
|
+
}
|
|
10964
|
+
}
|
|
10965
|
+
this.setSelectionBRConfig();
|
|
10966
|
+
listsNodes = this.parent.domNode.blockNodes();
|
|
10967
|
+
}
|
|
10859
10968
|
for (var i = 0; i < listsNodes.length; i++) {
|
|
10860
10969
|
if (listsNodes[i].tagName === 'TABLE' && !range.collapsed) {
|
|
10861
10970
|
listsNodes.splice(i, 1);
|
|
@@ -10876,6 +10985,16 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
10876
10985
|
});
|
|
10877
10986
|
}
|
|
10878
10987
|
};
|
|
10988
|
+
Lists.prototype.setSelectionBRConfig = function () {
|
|
10989
|
+
var startElem = this.parent.editableElement.querySelector('.' + markerClassName.startSelection);
|
|
10990
|
+
var endElem = this.parent.editableElement.querySelector('.' + markerClassName.endSelection);
|
|
10991
|
+
if (isNullOrUndefined(endElem)) {
|
|
10992
|
+
this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, startElem, 0);
|
|
10993
|
+
}
|
|
10994
|
+
else {
|
|
10995
|
+
this.parent.nodeSelection.setSelectionText(this.parent.currentDocument, startElem, endElem, 0, 0);
|
|
10996
|
+
}
|
|
10997
|
+
};
|
|
10879
10998
|
Lists.prototype.applyLists = function (elements, type, selector, item) {
|
|
10880
10999
|
if (this.isRevert(elements, type) && isNullOrUndefined(item)) {
|
|
10881
11000
|
this.revertList(elements);
|
|
@@ -11220,6 +11339,7 @@ var InsertMethods = /** @__PURE__ @class */ (function () {
|
|
|
11220
11339
|
*/
|
|
11221
11340
|
var NodeCutter = /** @__PURE__ @class */ (function () {
|
|
11222
11341
|
function NodeCutter() {
|
|
11342
|
+
this.enterAction = 'P';
|
|
11223
11343
|
this.position = -1;
|
|
11224
11344
|
this.nodeSelection = new NodeSelection();
|
|
11225
11345
|
}
|
|
@@ -11453,7 +11573,7 @@ var Formats = /** @__PURE__ @class */ (function () {
|
|
|
11453
11573
|
if (e.event.which === 13 && range.startContainer === endCon && endCon.nodeType !== 3) {
|
|
11454
11574
|
var pTag = createElement('p');
|
|
11455
11575
|
pTag.innerHTML = '<br>';
|
|
11456
|
-
if (lastChild && lastChild.nodeName === 'BR' && (lastChild.previousSibling && lastChild.previousSibling.nodeName === 'TABLE')) {
|
|
11576
|
+
if (!isNullOrUndefined(lastChild) && lastChild && lastChild.nodeName === 'BR' && (lastChild.previousSibling && lastChild.previousSibling.nodeName === 'TABLE')) {
|
|
11457
11577
|
endCon.replaceChild(pTag, lastChild);
|
|
11458
11578
|
this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, pTag, 0);
|
|
11459
11579
|
}
|
|
@@ -11496,7 +11616,7 @@ var Formats = /** @__PURE__ @class */ (function () {
|
|
|
11496
11616
|
var startParent = range.startContainer;
|
|
11497
11617
|
if (!isNullOrUndefined(lastEmpty) && !isNullOrUndefined(lastBeforeBr) && isNullOrUndefined(lastEmpty.nextSibling) &&
|
|
11498
11618
|
lastEmpty.nodeName === 'BR' && lastBeforeBr.nodeName === 'BR') {
|
|
11499
|
-
this.paraFocus(range.startContainer);
|
|
11619
|
+
this.paraFocus(range.startContainer, e.enterAction);
|
|
11500
11620
|
}
|
|
11501
11621
|
else if ((startParent.textContent.charCodeAt(0) === 8203 &&
|
|
11502
11622
|
startParent.textContent.length === 1) || startParent.textContent.length === 0) {
|
|
@@ -11539,11 +11659,21 @@ var Formats = /** @__PURE__ @class */ (function () {
|
|
|
11539
11659
|
range.deleteContents();
|
|
11540
11660
|
}
|
|
11541
11661
|
};
|
|
11542
|
-
Formats.prototype.paraFocus = function (referNode) {
|
|
11543
|
-
var
|
|
11544
|
-
|
|
11545
|
-
|
|
11546
|
-
|
|
11662
|
+
Formats.prototype.paraFocus = function (referNode, enterAction) {
|
|
11663
|
+
var insertTag;
|
|
11664
|
+
if (enterAction === 'DIV') {
|
|
11665
|
+
insertTag = createElement('div');
|
|
11666
|
+
insertTag.innerHTML = '<br>';
|
|
11667
|
+
}
|
|
11668
|
+
else if (enterAction === 'BR') {
|
|
11669
|
+
insertTag = createElement('br');
|
|
11670
|
+
}
|
|
11671
|
+
else {
|
|
11672
|
+
insertTag = createElement('p');
|
|
11673
|
+
insertTag.innerHTML = '<br>';
|
|
11674
|
+
}
|
|
11675
|
+
this.parent.domNode.insertAfter(insertTag, referNode);
|
|
11676
|
+
this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, insertTag, 0);
|
|
11547
11677
|
detach(referNode.lastChild);
|
|
11548
11678
|
};
|
|
11549
11679
|
Formats.prototype.isNotEndCursor = function (preElem, range) {
|
|
@@ -11625,6 +11755,66 @@ var Formats = /** @__PURE__ @class */ (function () {
|
|
|
11625
11755
|
var save = this.parent.nodeSelection.save(range, this.parent.currentDocument);
|
|
11626
11756
|
this.parent.domNode.setMarker(save);
|
|
11627
11757
|
var formatsNodes = this.parent.domNode.blockNodes();
|
|
11758
|
+
if (e.enterAction === 'BR') {
|
|
11759
|
+
this.setSelectionBRConfig();
|
|
11760
|
+
var allSelectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument);
|
|
11761
|
+
var selectedNodes = this.parent.nodeSelection.getSelectionNodes(allSelectedNode);
|
|
11762
|
+
var currentFormatNodes = [];
|
|
11763
|
+
if (selectedNodes.length === 0) {
|
|
11764
|
+
selectedNodes.push(formatsNodes[0]);
|
|
11765
|
+
}
|
|
11766
|
+
for (var i = 0; i < selectedNodes.length; i++) {
|
|
11767
|
+
var currentNode = selectedNodes[i];
|
|
11768
|
+
var previousCurrentNode = void 0;
|
|
11769
|
+
while (!this.parent.domNode.isBlockNode(currentNode) && currentNode !== this.parent.editableElement) {
|
|
11770
|
+
previousCurrentNode = currentNode;
|
|
11771
|
+
currentNode = currentNode.parentElement;
|
|
11772
|
+
}
|
|
11773
|
+
if (this.parent.domNode.isBlockNode(currentNode) && currentNode === this.parent.editableElement) {
|
|
11774
|
+
currentFormatNodes.push(previousCurrentNode);
|
|
11775
|
+
}
|
|
11776
|
+
}
|
|
11777
|
+
for (var i = 0; i < currentFormatNodes.length; i++) {
|
|
11778
|
+
if (!this.parent.domNode.isBlockNode(currentFormatNodes[i])) {
|
|
11779
|
+
var currentNode = currentFormatNodes[i];
|
|
11780
|
+
var previousNode = currentNode;
|
|
11781
|
+
while (currentNode === this.parent.editableElement) {
|
|
11782
|
+
previousNode = currentNode;
|
|
11783
|
+
currentNode = currentNode.parentElement;
|
|
11784
|
+
}
|
|
11785
|
+
var tempElem = void 0;
|
|
11786
|
+
if (this.parent.domNode.isBlockNode(previousNode.parentElement) &&
|
|
11787
|
+
previousNode.parentElement === this.parent.editableElement) {
|
|
11788
|
+
tempElem = createElement('div');
|
|
11789
|
+
previousNode.parentElement.insertBefore(tempElem, previousNode);
|
|
11790
|
+
tempElem.appendChild(previousNode);
|
|
11791
|
+
}
|
|
11792
|
+
else {
|
|
11793
|
+
tempElem = previousNode;
|
|
11794
|
+
}
|
|
11795
|
+
var preNode = tempElem.previousSibling;
|
|
11796
|
+
while (!isNullOrUndefined(preNode) && preNode.nodeName !== 'BR' &&
|
|
11797
|
+
!this.parent.domNode.isBlockNode(preNode)) {
|
|
11798
|
+
tempElem.firstChild.parentElement.insertBefore(preNode, tempElem.firstChild);
|
|
11799
|
+
preNode = tempElem.previousSibling;
|
|
11800
|
+
}
|
|
11801
|
+
if (!isNullOrUndefined(preNode) && preNode.nodeName === 'BR') {
|
|
11802
|
+
detach(preNode);
|
|
11803
|
+
}
|
|
11804
|
+
var postNode = tempElem.nextSibling;
|
|
11805
|
+
while (!isNullOrUndefined(postNode) && postNode.nodeName !== 'BR' &&
|
|
11806
|
+
!this.parent.domNode.isBlockNode(postNode)) {
|
|
11807
|
+
tempElem.appendChild(postNode);
|
|
11808
|
+
postNode = tempElem.nextSibling;
|
|
11809
|
+
}
|
|
11810
|
+
if (!isNullOrUndefined(postNode) && postNode.nodeName === 'BR') {
|
|
11811
|
+
detach(postNode);
|
|
11812
|
+
}
|
|
11813
|
+
}
|
|
11814
|
+
}
|
|
11815
|
+
this.setSelectionBRConfig();
|
|
11816
|
+
formatsNodes = this.parent.domNode.blockNodes();
|
|
11817
|
+
}
|
|
11628
11818
|
for (var i = 0; i < formatsNodes.length; i++) {
|
|
11629
11819
|
var parentNode = void 0;
|
|
11630
11820
|
var replaceHTML = void 0;
|
|
@@ -11683,6 +11873,16 @@ var Formats = /** @__PURE__ @class */ (function () {
|
|
|
11683
11873
|
});
|
|
11684
11874
|
}
|
|
11685
11875
|
};
|
|
11876
|
+
Formats.prototype.setSelectionBRConfig = function () {
|
|
11877
|
+
var startElem = this.parent.editableElement.querySelector('.' + markerClassName.startSelection);
|
|
11878
|
+
var endElem = this.parent.editableElement.querySelector('.' + markerClassName.endSelection);
|
|
11879
|
+
if (isNullOrUndefined(endElem)) {
|
|
11880
|
+
this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, startElem, 0);
|
|
11881
|
+
}
|
|
11882
|
+
else {
|
|
11883
|
+
this.parent.nodeSelection.setSelectionText(this.parent.currentDocument, startElem, endElem, 0, 0);
|
|
11884
|
+
}
|
|
11885
|
+
};
|
|
11686
11886
|
Formats.prototype.preFormatMerge = function () {
|
|
11687
11887
|
var preNodes = this.parent.editableElement.querySelectorAll('PRE');
|
|
11688
11888
|
if (!isNullOrUndefined(preNodes)) {
|
|
@@ -11816,7 +12016,7 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
11816
12016
|
}
|
|
11817
12017
|
else {
|
|
11818
12018
|
range.deleteContents();
|
|
11819
|
-
if (isCursor && range.startContainer.textContent === '') {
|
|
12019
|
+
if (isCursor && range.startContainer.textContent === '' && range.startContainer.nodeName !== 'BR') {
|
|
11820
12020
|
range.startContainer.innerHTML = '';
|
|
11821
12021
|
}
|
|
11822
12022
|
if (Browser.isIE) {
|
|
@@ -11835,7 +12035,12 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
11835
12035
|
}
|
|
11836
12036
|
}
|
|
11837
12037
|
else {
|
|
11838
|
-
range.
|
|
12038
|
+
if (range.startContainer.nodeName === 'BR') {
|
|
12039
|
+
range.startContainer.parentElement.insertBefore(node, range.startContainer);
|
|
12040
|
+
}
|
|
12041
|
+
else {
|
|
12042
|
+
range.insertNode(node);
|
|
12043
|
+
}
|
|
11839
12044
|
}
|
|
11840
12045
|
if (node.nodeType !== 3 && node.childNodes.length > 0) {
|
|
11841
12046
|
nodeSelection.setSelectionText(docElement, node, node, 1, 1);
|
|
@@ -12047,6 +12252,9 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
|
|
|
12047
12252
|
range.setStart(editNode.firstElementChild, editNode.firstElementChild.textContent.length);
|
|
12048
12253
|
range.setEnd(editNode.firstElementChild, editNode.firstElementChild.textContent.length);
|
|
12049
12254
|
}
|
|
12255
|
+
if (blockNode.nodeName === 'BODY' && range.startContainer === range.endContainer && range.startContainer.nodeType === 1) {
|
|
12256
|
+
blockNode = range.startContainer;
|
|
12257
|
+
}
|
|
12050
12258
|
if (blockNode.nodeName === 'TD' || blockNode.nodeName === 'TH') {
|
|
12051
12259
|
var tempSpan = createElement('span', { className: 'tempSpan' });
|
|
12052
12260
|
range.insertNode(tempSpan);
|
|
@@ -12904,8 +13112,10 @@ var ImageCommand = /** @__PURE__ @class */ (function () {
|
|
|
12904
13112
|
var selectNode = e.item.selectNode[0];
|
|
12905
13113
|
selectNode.style.height = '';
|
|
12906
13114
|
selectNode.style.width = '';
|
|
12907
|
-
selectNode.width = e.item.width
|
|
12908
|
-
|
|
13115
|
+
e.item.width !== 'auto' ? selectNode.style.width = formatUnit(e.item.width) :
|
|
13116
|
+
selectNode.removeAttribute('width');
|
|
13117
|
+
e.item.height !== 'auto' ? selectNode.style.height = formatUnit(e.item.height) :
|
|
13118
|
+
selectNode.removeAttribute('height');
|
|
12909
13119
|
this.callBack(e);
|
|
12910
13120
|
};
|
|
12911
13121
|
ImageCommand.prototype.imageCaption = function (e) {
|
|
@@ -12914,59 +13124,65 @@ var ImageCommand = /** @__PURE__ @class */ (function () {
|
|
|
12914
13124
|
};
|
|
12915
13125
|
ImageCommand.prototype.imageJustifyLeft = function (e) {
|
|
12916
13126
|
var selectNode = e.item.selectNode[0];
|
|
12917
|
-
selectNode
|
|
12918
|
-
|
|
12919
|
-
|
|
12920
|
-
|
|
12921
|
-
|
|
12922
|
-
|
|
12923
|
-
|
|
12924
|
-
|
|
12925
|
-
|
|
12926
|
-
|
|
12927
|
-
|
|
12928
|
-
|
|
12929
|
-
|
|
13127
|
+
if (!isNullOrUndefined(selectNode)) {
|
|
13128
|
+
selectNode.removeAttribute('class');
|
|
13129
|
+
addClass([selectNode], 'e-rte-image');
|
|
13130
|
+
if (!isNullOrUndefined(closest(selectNode, '.' + CLASS_CAPTION))) {
|
|
13131
|
+
removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_RIGHT);
|
|
13132
|
+
addClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_LEFT);
|
|
13133
|
+
}
|
|
13134
|
+
if (selectNode.parentElement.nodeName === 'A') {
|
|
13135
|
+
removeClass([selectNode.parentElement], CLASS_IMAGE_RIGHT);
|
|
13136
|
+
addClass([selectNode.parentElement], CLASS_IMAGE_LEFT);
|
|
13137
|
+
addClass([selectNode], CLASS_IMAGE_LEFT);
|
|
13138
|
+
}
|
|
13139
|
+
else {
|
|
13140
|
+
addClass([selectNode], CLASS_IMAGE_LEFT);
|
|
13141
|
+
}
|
|
13142
|
+
this.callBack(e);
|
|
12930
13143
|
}
|
|
12931
|
-
this.callBack(e);
|
|
12932
13144
|
};
|
|
12933
13145
|
ImageCommand.prototype.imageJustifyCenter = function (e) {
|
|
12934
13146
|
var selectNode = e.item.selectNode[0];
|
|
12935
|
-
selectNode
|
|
12936
|
-
|
|
12937
|
-
|
|
12938
|
-
|
|
12939
|
-
|
|
12940
|
-
|
|
12941
|
-
|
|
12942
|
-
|
|
12943
|
-
|
|
12944
|
-
|
|
12945
|
-
|
|
12946
|
-
|
|
12947
|
-
|
|
12948
|
-
|
|
12949
|
-
|
|
13147
|
+
if (!isNullOrUndefined(selectNode)) {
|
|
13148
|
+
selectNode.removeAttribute('class');
|
|
13149
|
+
addClass([selectNode], 'e-rte-image');
|
|
13150
|
+
if (!isNullOrUndefined(closest(selectNode, '.' + CLASS_CAPTION))) {
|
|
13151
|
+
removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_LEFT);
|
|
13152
|
+
removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_RIGHT);
|
|
13153
|
+
addClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_CENTER);
|
|
13154
|
+
}
|
|
13155
|
+
if (selectNode.parentElement.nodeName === 'A') {
|
|
13156
|
+
removeClass([selectNode.parentElement], CLASS_IMAGE_LEFT);
|
|
13157
|
+
removeClass([selectNode.parentElement], CLASS_IMAGE_RIGHT);
|
|
13158
|
+
addClass([selectNode.parentElement], CLASS_IMAGE_CENTER);
|
|
13159
|
+
addClass([selectNode], CLASS_IMAGE_CENTER);
|
|
13160
|
+
}
|
|
13161
|
+
else {
|
|
13162
|
+
addClass([selectNode], CLASS_IMAGE_CENTER);
|
|
13163
|
+
}
|
|
13164
|
+
this.callBack(e);
|
|
12950
13165
|
}
|
|
12951
|
-
this.callBack(e);
|
|
12952
13166
|
};
|
|
12953
13167
|
ImageCommand.prototype.imageJustifyRight = function (e) {
|
|
12954
13168
|
var selectNode = e.item.selectNode[0];
|
|
12955
|
-
selectNode
|
|
12956
|
-
|
|
12957
|
-
|
|
12958
|
-
|
|
12959
|
-
|
|
12960
|
-
|
|
12961
|
-
|
|
12962
|
-
|
|
12963
|
-
|
|
12964
|
-
|
|
12965
|
-
|
|
12966
|
-
|
|
12967
|
-
|
|
13169
|
+
if (!isNullOrUndefined(selectNode)) {
|
|
13170
|
+
selectNode.removeAttribute('class');
|
|
13171
|
+
addClass([selectNode], 'e-rte-image');
|
|
13172
|
+
if (!isNullOrUndefined(closest(selectNode, '.' + CLASS_CAPTION))) {
|
|
13173
|
+
removeClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_LEFT);
|
|
13174
|
+
addClass([closest(selectNode, '.' + CLASS_CAPTION)], CLASS_IMAGE_RIGHT);
|
|
13175
|
+
}
|
|
13176
|
+
if (selectNode.parentElement.nodeName === 'A') {
|
|
13177
|
+
removeClass([selectNode.parentElement], CLASS_IMAGE_LEFT);
|
|
13178
|
+
addClass([selectNode.parentElement], CLASS_IMAGE_RIGHT);
|
|
13179
|
+
addClass([selectNode], CLASS_IMAGE_RIGHT);
|
|
13180
|
+
}
|
|
13181
|
+
else {
|
|
13182
|
+
addClass([selectNode], CLASS_IMAGE_RIGHT);
|
|
13183
|
+
}
|
|
13184
|
+
this.callBack(e);
|
|
12968
13185
|
}
|
|
12969
|
-
this.callBack(e);
|
|
12970
13186
|
};
|
|
12971
13187
|
ImageCommand.prototype.imageInline = function (e) {
|
|
12972
13188
|
var selectNode = e.item.selectNode[0];
|
|
@@ -13056,7 +13272,7 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
13056
13272
|
}
|
|
13057
13273
|
var tdWid = parseInt(e.item.width.width, 10) > 100 ?
|
|
13058
13274
|
100 / e.item.columns : parseInt(e.item.width.width, 10) / e.item.columns;
|
|
13059
|
-
for (var i = 0; i < e.item.
|
|
13275
|
+
for (var i = 0; i < e.item.rows; i++) {
|
|
13060
13276
|
var row = createElement('tr');
|
|
13061
13277
|
for (var j = 0; j < e.item.columns; j++) {
|
|
13062
13278
|
var cell = createElement('td');
|
|
@@ -13072,9 +13288,19 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
13072
13288
|
this.removeEmptyNode();
|
|
13073
13289
|
e.item.selection.setSelectionText(this.parent.currentDocument, table.querySelector('td'), table.querySelector('td'), 0, 0);
|
|
13074
13290
|
if (table.nextElementSibling === null) {
|
|
13075
|
-
var
|
|
13076
|
-
|
|
13077
|
-
|
|
13291
|
+
var insertElem = void 0;
|
|
13292
|
+
if (e.enterAction === 'DIV') {
|
|
13293
|
+
insertElem = createElement('div');
|
|
13294
|
+
insertElem.appendChild(createElement('br'));
|
|
13295
|
+
}
|
|
13296
|
+
else if (e.enterAction === 'BR') {
|
|
13297
|
+
insertElem = createElement('br');
|
|
13298
|
+
}
|
|
13299
|
+
else {
|
|
13300
|
+
insertElem = createElement('p');
|
|
13301
|
+
insertElem.appendChild(createElement('br'));
|
|
13302
|
+
}
|
|
13303
|
+
this.insertAfter(insertElem, table);
|
|
13078
13304
|
}
|
|
13079
13305
|
table.querySelector('td').classList.add('e-cell-select');
|
|
13080
13306
|
if (e.callBack) {
|
|
@@ -13213,16 +13439,16 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
13213
13439
|
var curRow = closest(selectedCell, 'tr');
|
|
13214
13440
|
var curCell;
|
|
13215
13441
|
var allRows = closest((curRow), 'table').rows;
|
|
13216
|
-
var colIndex = Array.prototype.slice.call(curRow.querySelectorAll('th
|
|
13217
|
-
var previousWidth = parseInt(e.item.width, 10) / (curRow.querySelectorAll('td,th').length);
|
|
13218
|
-
var currentWidth = parseInt(e.item.width, 10) / (curRow.querySelectorAll('td,th').length + 1);
|
|
13442
|
+
var colIndex = Array.prototype.slice.call(curRow.querySelectorAll(':scope > td, :scope > th')).indexOf(selectedCell);
|
|
13443
|
+
var previousWidth = parseInt(e.item.width, 10) / (curRow.querySelectorAll(':scope > td, :scope > th').length);
|
|
13444
|
+
var currentWidth = parseInt(e.item.width, 10) / (curRow.querySelectorAll(':scope > td, :scope > th').length + 1);
|
|
13219
13445
|
var currentTabElm = closest(curRow, 'table');
|
|
13220
13446
|
var thTdElm = closest(curRow, 'table').querySelectorAll('th,td');
|
|
13221
13447
|
for (var i = 0; i < thTdElm.length; i++) {
|
|
13222
13448
|
thTdElm[i].dataset.oldWidth = (thTdElm[i].offsetWidth / currentTabElm.offsetWidth * 100) + "%";
|
|
13223
13449
|
}
|
|
13224
13450
|
for (var i = 0; i < allRows.length; i++) {
|
|
13225
|
-
curCell = allRows[i].querySelectorAll('th
|
|
13451
|
+
curCell = allRows[i].querySelectorAll(':scope > td, :scope > th')[colIndex];
|
|
13226
13452
|
var colTemplate = curCell.cloneNode(true);
|
|
13227
13453
|
colTemplate.innerHTML = '';
|
|
13228
13454
|
colTemplate.appendChild(createElement('br'));
|
|
@@ -13755,7 +13981,7 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
13755
13981
|
// eslint-disable-next-line
|
|
13756
13982
|
var _this = this;
|
|
13757
13983
|
var colspan = 0;
|
|
13758
|
-
var allRows = _this.curTable.
|
|
13984
|
+
var allRows = _this.curTable.rows;
|
|
13759
13985
|
for (var i = 0; i <= allRows.length - 1; i++) {
|
|
13760
13986
|
var ele = allRows[i];
|
|
13761
13987
|
var index = 0;
|
|
@@ -14156,7 +14382,8 @@ var IsFormatted = /** @__PURE__ @class */ (function () {
|
|
|
14156
14382
|
'sup',
|
|
14157
14383
|
'tt',
|
|
14158
14384
|
'u',
|
|
14159
|
-
'var'
|
|
14385
|
+
'var',
|
|
14386
|
+
'del'
|
|
14160
14387
|
];
|
|
14161
14388
|
return IsFormatted;
|
|
14162
14389
|
}());
|
|
@@ -14179,7 +14406,8 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
14179
14406
|
* @hidden
|
|
14180
14407
|
* @deprecated
|
|
14181
14408
|
*/
|
|
14182
|
-
SelectionCommands.applyFormat = function (docElement, format, endNode, value, selector) {
|
|
14409
|
+
SelectionCommands.applyFormat = function (docElement, format, endNode, enterAction, value, selector) {
|
|
14410
|
+
this.enterAction = enterAction;
|
|
14183
14411
|
var validFormats = ['bold', 'italic', 'underline', 'strikethrough', 'superscript',
|
|
14184
14412
|
'subscript', 'uppercase', 'lowercase', 'fontcolor', 'fontname', 'fontsize', 'backgroundcolor'];
|
|
14185
14413
|
if (validFormats.indexOf(format) > -1) {
|
|
@@ -14255,7 +14483,7 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
14255
14483
|
save.restore();
|
|
14256
14484
|
}
|
|
14257
14485
|
if (isSubSup) {
|
|
14258
|
-
this.applyFormat(docElement, format, endNode);
|
|
14486
|
+
this.applyFormat(docElement, format, endNode, enterAction);
|
|
14259
14487
|
}
|
|
14260
14488
|
}
|
|
14261
14489
|
};
|
|
@@ -14275,6 +14503,10 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
14275
14503
|
cursorNodes[0].firstElementChild.tagName.toLowerCase() === 'br')) {
|
|
14276
14504
|
cursorNodes[0].innerHTML = '';
|
|
14277
14505
|
}
|
|
14506
|
+
if (cursorNodes.length === 1 && range.startOffset === 0 && (cursorNodes[0].nodeName === 'BR' ||
|
|
14507
|
+
cursorNodes[0].nextSibling.nodeName === 'BR')) {
|
|
14508
|
+
detach(cursorNodes[0].nodeName === '#text' ? cursorNodes[0].nextSibling : cursorNodes[0]);
|
|
14509
|
+
}
|
|
14278
14510
|
cursorNode = this.getInsertNode(docElement, range, format, value).firstChild;
|
|
14279
14511
|
}
|
|
14280
14512
|
return cursorNode;
|
|
@@ -14490,10 +14722,12 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
14490
14722
|
return nodes[index];
|
|
14491
14723
|
};
|
|
14492
14724
|
SelectionCommands.applyStyles = function (nodes, index, element) {
|
|
14493
|
-
nodes[index]
|
|
14494
|
-
|
|
14495
|
-
|
|
14496
|
-
|
|
14725
|
+
if (!(nodes[index].nodeName === 'BR' && this.enterAction === 'BR')) {
|
|
14726
|
+
nodes[index] = (index === (nodes.length - 1)) || nodes[index].nodeName === 'BR' ?
|
|
14727
|
+
InsertMethods.Wrap(nodes[index], element)
|
|
14728
|
+
: InsertMethods.WrapBefore(nodes[index], element, true);
|
|
14729
|
+
nodes[index] = this.getChildNode(nodes[index], element);
|
|
14730
|
+
}
|
|
14497
14731
|
return nodes[index];
|
|
14498
14732
|
};
|
|
14499
14733
|
SelectionCommands.getInsertNode = function (docElement, range, format, value) {
|
|
@@ -14588,6 +14822,7 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
14588
14822
|
ele.setAttribute('style', styles);
|
|
14589
14823
|
}
|
|
14590
14824
|
};
|
|
14825
|
+
SelectionCommands.enterAction = 'P';
|
|
14591
14826
|
return SelectionCommands;
|
|
14592
14827
|
}());
|
|
14593
14828
|
|
|
@@ -14618,12 +14853,12 @@ var SelectionBasedExec = /** @__PURE__ @class */ (function () {
|
|
|
14618
14853
|
'subscript', 'uppercase', 'lowercase'];
|
|
14619
14854
|
if (e.event.ctrlKey && validFormats.indexOf(e.event.action) > -1) {
|
|
14620
14855
|
e.event.preventDefault();
|
|
14621
|
-
SelectionCommands.applyFormat(this.parent.currentDocument, e.event.action, this.parent.editableElement);
|
|
14856
|
+
SelectionCommands.applyFormat(this.parent.currentDocument, e.event.action, this.parent.editableElement, e.enterAction);
|
|
14622
14857
|
this.callBack(e, e.event.action);
|
|
14623
14858
|
}
|
|
14624
14859
|
};
|
|
14625
14860
|
SelectionBasedExec.prototype.applySelection = function (e) {
|
|
14626
|
-
SelectionCommands.applyFormat(this.parent.currentDocument, e.subCommand.toLocaleLowerCase(), this.parent.editableElement, e.value, e.selector);
|
|
14861
|
+
SelectionCommands.applyFormat(this.parent.currentDocument, e.subCommand.toLocaleLowerCase(), this.parent.editableElement, e.enterAction, e.value, e.selector);
|
|
14627
14862
|
this.callBack(e, e.subCommand);
|
|
14628
14863
|
};
|
|
14629
14864
|
SelectionBasedExec.prototype.callBack = function (event, action) {
|
|
@@ -14706,7 +14941,9 @@ var ClearFormat$1 = /** @__PURE__ @class */ (function () {
|
|
|
14706
14941
|
* @hidden
|
|
14707
14942
|
* @deprecated
|
|
14708
14943
|
*/
|
|
14709
|
-
ClearFormat.clear = function (docElement, endNode, selector) {
|
|
14944
|
+
ClearFormat.clear = function (docElement, endNode, enterAction, selector) {
|
|
14945
|
+
this.domNode = new DOMNode(endNode, docElement);
|
|
14946
|
+
this.defaultTag = enterAction === 'P' ? this.defaultTag : 'div';
|
|
14710
14947
|
var nodeSelection = new NodeSelection();
|
|
14711
14948
|
var nodeCutter = new NodeCutter();
|
|
14712
14949
|
var range = nodeSelection.getRange(docElement);
|
|
@@ -14851,12 +15088,12 @@ var ClearFormat$1 = /** @__PURE__ @class */ (function () {
|
|
|
14851
15088
|
&& this.IGNORE_PARENT_TAGS.indexOf(parentNodes[index1].childNodes[0].nodeName.toLocaleLowerCase()) > -1)
|
|
14852
15089
|
&& !(parentNodes[index1].childNodes.length === 1
|
|
14853
15090
|
&& parentNodes[index1].childNodes[0].nodeName.toLocaleLowerCase() === 'p')) {
|
|
14854
|
-
InsertMethods.Wrap(parentNodes[index1], docElement.createElement(
|
|
15091
|
+
InsertMethods.Wrap(parentNodes[index1], docElement.createElement(this.defaultTag));
|
|
14855
15092
|
}
|
|
14856
15093
|
var childNodes = InsertMethods.unwrap(parentNodes[index1]);
|
|
14857
15094
|
if (childNodes.length === 1
|
|
14858
15095
|
&& childNodes[0].parentNode.nodeName.toLocaleLowerCase() === 'p') {
|
|
14859
|
-
InsertMethods.Wrap(parentNodes[index1], docElement.createElement(
|
|
15096
|
+
InsertMethods.Wrap(parentNodes[index1], docElement.createElement(this.defaultTag));
|
|
14860
15097
|
InsertMethods.unwrap(parentNodes[index1]);
|
|
14861
15098
|
}
|
|
14862
15099
|
for (var index2 = 0; index2 < childNodes.length; index2++) {
|
|
@@ -14874,13 +15111,13 @@ var ClearFormat$1 = /** @__PURE__ @class */ (function () {
|
|
|
14874
15111
|
}
|
|
14875
15112
|
else if (this.BLOCK_TAGS.indexOf(childNodes[index2].nodeName.toLocaleLowerCase()) > -1 &&
|
|
14876
15113
|
childNodes[index2].nodeName.toLocaleLowerCase() === 'p') {
|
|
14877
|
-
InsertMethods.Wrap(childNodes[index2], docElement.createElement(
|
|
15114
|
+
InsertMethods.Wrap(childNodes[index2], docElement.createElement(this.defaultTag));
|
|
14878
15115
|
InsertMethods.unwrap(childNodes[index2]);
|
|
14879
15116
|
}
|
|
14880
15117
|
}
|
|
14881
15118
|
}
|
|
14882
15119
|
else {
|
|
14883
|
-
InsertMethods.Wrap(parentNodes[index1], docElement.createElement(
|
|
15120
|
+
InsertMethods.Wrap(parentNodes[index1], docElement.createElement(this.defaultTag));
|
|
14884
15121
|
InsertMethods.unwrap(parentNodes[index1]);
|
|
14885
15122
|
}
|
|
14886
15123
|
}
|
|
@@ -14889,10 +15126,16 @@ var ClearFormat$1 = /** @__PURE__ @class */ (function () {
|
|
|
14889
15126
|
// eslint-disable-next-line
|
|
14890
15127
|
endNode) {
|
|
14891
15128
|
for (var index = 0; index < textNodes.length; index++) {
|
|
14892
|
-
|
|
14893
|
-
|
|
14894
|
-
|
|
14895
|
-
|
|
15129
|
+
var currentInlineNode = textNodes[index];
|
|
15130
|
+
var currentNode = void 0;
|
|
15131
|
+
while (!this.domNode.isBlockNode(currentInlineNode)) {
|
|
15132
|
+
currentNode = currentInlineNode;
|
|
15133
|
+
currentInlineNode = currentInlineNode.parentElement;
|
|
15134
|
+
}
|
|
15135
|
+
if (currentNode &&
|
|
15136
|
+
IsFormatted.inlineTags.indexOf(currentNode.nodeName.toLocaleLowerCase()) > -1) {
|
|
15137
|
+
nodeCutter.GetSpliceNode(range, currentNode);
|
|
15138
|
+
this.removeInlineParent(currentNode);
|
|
14896
15139
|
}
|
|
14897
15140
|
}
|
|
14898
15141
|
};
|
|
@@ -14915,6 +15158,7 @@ var ClearFormat$1 = /** @__PURE__ @class */ (function () {
|
|
|
14915
15158
|
ClearFormat.NONVALID_PARENT_TAGS = ['thead', 'tbody', 'ul', 'ol', 'table', 'tfoot', 'tr'];
|
|
14916
15159
|
ClearFormat.IGNORE_PARENT_TAGS = ['ul', 'ol', 'table'];
|
|
14917
15160
|
ClearFormat.NONVALID_TAGS = ['thead', 'tbody', 'figcaption', 'td', 'tr', 'th', 'tfoot', 'figcaption', 'li'];
|
|
15161
|
+
ClearFormat.defaultTag = 'p';
|
|
14918
15162
|
return ClearFormat;
|
|
14919
15163
|
}());
|
|
14920
15164
|
|
|
@@ -14944,14 +15188,14 @@ var ClearFormatExec = /** @__PURE__ @class */ (function () {
|
|
|
14944
15188
|
ClearFormatExec.prototype.onKeyDown = function (e) {
|
|
14945
15189
|
switch (e.event.action) {
|
|
14946
15190
|
case 'clear-format':
|
|
14947
|
-
this.applyClear({ subCommand: 'ClearFormat', callBack: e.callBack });
|
|
15191
|
+
this.applyClear({ subCommand: 'ClearFormat', callBack: e.callBack, enterAction: e.enterAction });
|
|
14948
15192
|
e.event.preventDefault();
|
|
14949
15193
|
break;
|
|
14950
15194
|
}
|
|
14951
15195
|
};
|
|
14952
15196
|
ClearFormatExec.prototype.applyClear = function (e) {
|
|
14953
15197
|
if (e.subCommand === 'ClearFormat') {
|
|
14954
|
-
ClearFormat$1.clear(this.parent.currentDocument, this.parent.editableElement, e.selector);
|
|
15198
|
+
ClearFormat$1.clear(this.parent.currentDocument, this.parent.editableElement, e.enterAction, e.selector);
|
|
14955
15199
|
if (e.callBack) {
|
|
14956
15200
|
e.callBack({
|
|
14957
15201
|
requestType: e.subCommand,
|
|
@@ -15932,15 +16176,15 @@ var EditorManager = /** @__PURE__ @class */ (function () {
|
|
|
15932
16176
|
* @deprecated
|
|
15933
16177
|
*/
|
|
15934
16178
|
/* eslint-enable */
|
|
15935
|
-
EditorManager.prototype.execCommand = function (command, value, event, callBack, text, exeValue, selector) {
|
|
16179
|
+
EditorManager.prototype.execCommand = function (command, value, event, callBack, text, exeValue, selector, enterAction) {
|
|
15936
16180
|
switch (command.toLocaleLowerCase()) {
|
|
15937
16181
|
case 'lists':
|
|
15938
16182
|
this.observer.notify(LIST_TYPE, { subCommand: value, event: event, callBack: callBack,
|
|
15939
|
-
selector: selector, item: exeValue });
|
|
16183
|
+
selector: selector, item: exeValue, enterAction: enterAction });
|
|
15940
16184
|
break;
|
|
15941
16185
|
case 'formats':
|
|
15942
16186
|
this.observer.notify(FORMAT_TYPE, { subCommand: value, event: event, callBack: callBack,
|
|
15943
|
-
selector: selector, exeValue: exeValue
|
|
16187
|
+
selector: selector, exeValue: exeValue, enterAction: enterAction
|
|
15944
16188
|
});
|
|
15945
16189
|
break;
|
|
15946
16190
|
case 'alignments':
|
|
@@ -15969,7 +16213,7 @@ var EditorManager = /** @__PURE__ @class */ (function () {
|
|
|
15969
16213
|
case 'table':
|
|
15970
16214
|
switch (value.toString().toLocaleLowerCase()) {
|
|
15971
16215
|
case 'createtable':
|
|
15972
|
-
this.observer.notify(TABLE, { item: exeValue, event: event, callBack: callBack });
|
|
16216
|
+
this.observer.notify(TABLE, { item: exeValue, event: event, callBack: callBack, enterAction: enterAction });
|
|
15973
16217
|
break;
|
|
15974
16218
|
case 'insertrowbefore':
|
|
15975
16219
|
case 'insertrowafter':
|
|
@@ -16011,7 +16255,7 @@ var EditorManager = /** @__PURE__ @class */ (function () {
|
|
|
16011
16255
|
case 'style':
|
|
16012
16256
|
case 'effects':
|
|
16013
16257
|
case 'casing':
|
|
16014
|
-
this.observer.notify(SELECTION_TYPE, { subCommand: value, event: event, callBack: callBack, value: text, selector: selector });
|
|
16258
|
+
this.observer.notify(SELECTION_TYPE, { subCommand: value, event: event, callBack: callBack, value: text, selector: selector, enterAction: enterAction });
|
|
16015
16259
|
break;
|
|
16016
16260
|
case 'inserthtml':
|
|
16017
16261
|
this.observer.notify(INSERTHTML_TYPE, { subCommand: value, callBack: callBack, value: text });
|
|
@@ -16020,7 +16264,7 @@ var EditorManager = /** @__PURE__ @class */ (function () {
|
|
|
16020
16264
|
this.observer.notify(INSERT_TEXT_TYPE, { subCommand: value, callBack: callBack, value: text });
|
|
16021
16265
|
break;
|
|
16022
16266
|
case 'clear':
|
|
16023
|
-
this.observer.notify(CLEAR_TYPE, { subCommand: value, event: event, callBack: callBack, selector: selector });
|
|
16267
|
+
this.observer.notify(CLEAR_TYPE, { subCommand: value, event: event, callBack: callBack, selector: selector, enterAction: enterAction });
|
|
16024
16268
|
break;
|
|
16025
16269
|
case 'actions':
|
|
16026
16270
|
this.observer.notify(ACTION, { subCommand: value, event: event, callBack: callBack, selector: selector });
|
|
@@ -16598,10 +16842,10 @@ var IframeContentRender = /** @__PURE__ @class */ (function (_super) {
|
|
|
16598
16842
|
rteContent + '</body></html>';
|
|
16599
16843
|
var iFrameContent = IFRAMEHEADER + iFrameBodyContent;
|
|
16600
16844
|
var iframe = this.parent.createElement('iframe', {
|
|
16601
|
-
innerHTML: iFrameContent,
|
|
16602
16845
|
id: this.parent.getID() + '_rte-view',
|
|
16603
16846
|
className: 'e-rte-content',
|
|
16604
|
-
styles: 'display:block;'
|
|
16847
|
+
styles: 'display:block;',
|
|
16848
|
+
attrs: { 'srcdoc': iFrameContent }
|
|
16605
16849
|
});
|
|
16606
16850
|
this.setPanel(iframe);
|
|
16607
16851
|
rteObj.element.appendChild(iframe);
|
|
@@ -16906,33 +17150,40 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
16906
17150
|
HtmlEditor.prototype.onKeyDown = function (e) {
|
|
16907
17151
|
var _this = this;
|
|
16908
17152
|
var currentRange;
|
|
17153
|
+
var args = e.args;
|
|
16909
17154
|
if (Browser.info.name === 'chrome') {
|
|
16910
17155
|
currentRange = this.parent.getRange();
|
|
16911
17156
|
this.backSpaceCleanup(e, currentRange);
|
|
16912
17157
|
this.deleteCleanup(e, currentRange);
|
|
16913
17158
|
}
|
|
16914
|
-
if (
|
|
16915
|
-
|
|
16916
|
-
|
|
16917
|
-
|
|
16918
|
-
|
|
16919
|
-
|
|
16920
|
-
|
|
16921
|
-
|
|
16922
|
-
|
|
16923
|
-
|
|
16924
|
-
|
|
16925
|
-
this.rangeCollection
|
|
16926
|
-
|
|
16927
|
-
|
|
16928
|
-
|
|
16929
|
-
|
|
17159
|
+
if (args.keyCode === 9 && this.parent.enableTabKey) {
|
|
17160
|
+
if (!isNullOrUndefined(args.target) && isNullOrUndefined(closest(args.target, '.e-rte-toolbar'))) {
|
|
17161
|
+
var range = this.nodeSelectionObj.getRange(this.contentRenderer.getDocument());
|
|
17162
|
+
var parentNode = this.nodeSelectionObj.getParentNodeCollection(range);
|
|
17163
|
+
if (!((parentNode[0].nodeName === 'LI' || closest(parentNode[0], 'li') ||
|
|
17164
|
+
closest(parentNode[0], 'table')) && range.startOffset === 0)) {
|
|
17165
|
+
args.preventDefault();
|
|
17166
|
+
if (!args.shiftKey) {
|
|
17167
|
+
InsertHtml.Insert(this.contentRenderer.getDocument(), ' ');
|
|
17168
|
+
this.rangeCollection.push(this.nodeSelectionObj.getRange(this.contentRenderer.getDocument()));
|
|
17169
|
+
}
|
|
17170
|
+
else if (this.rangeCollection.length > 0 &&
|
|
17171
|
+
this.rangeCollection[this.rangeCollection.length - 1].startContainer.textContent.length === 4) {
|
|
17172
|
+
var textCont = this.rangeCollection[this.rangeCollection.length - 1].startContainer;
|
|
17173
|
+
this.nodeSelectionObj.setSelectionText(this.contentRenderer.getDocument(), textCont, textCont, 0, textCont.textContent.length);
|
|
17174
|
+
InsertHtml.Insert(this.contentRenderer.getDocument(), document.createTextNode(''));
|
|
17175
|
+
this.rangeCollection.pop();
|
|
17176
|
+
}
|
|
16930
17177
|
}
|
|
16931
17178
|
}
|
|
16932
17179
|
}
|
|
16933
17180
|
if (e.args.action === 'space' ||
|
|
16934
|
-
e.args.action === 'enter'
|
|
17181
|
+
e.args.action === 'enter' ||
|
|
17182
|
+
e.args.keyCode === 13) {
|
|
16935
17183
|
this.spaceLink(e.args);
|
|
17184
|
+
if (this.parent.editorMode === 'HTML' && !((this.parent.shiftEnterKey === 'BR' && e.args.shiftKey))) {
|
|
17185
|
+
this.parent.notify(enterHandler, { args: e.args });
|
|
17186
|
+
}
|
|
16936
17187
|
}
|
|
16937
17188
|
if (e.args.action === 'space') {
|
|
16938
17189
|
var currentRange_1 = this.parent.getRange();
|
|
@@ -16974,10 +17225,11 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
16974
17225
|
this.oldRangeElement = null;
|
|
16975
17226
|
this.deleteRangeElement = null;
|
|
16976
17227
|
this.deleteOldRangeElement = null;
|
|
16977
|
-
|
|
17228
|
+
args.preventDefault();
|
|
16978
17229
|
}
|
|
16979
17230
|
};
|
|
16980
17231
|
HtmlEditor.prototype.isOrderedList = function (editorValue) {
|
|
17232
|
+
editorValue = editorValue.replace(/\u200B/g, '');
|
|
16981
17233
|
var olListStartRegex = [/^[1]+[.]+$/, /^[i]+[.]+$/, /^[a]+[.]+$/];
|
|
16982
17234
|
if (!isNullOrUndefined(editorValue)) {
|
|
16983
17235
|
for (var i = 0; i < olListStartRegex.length; i++) {
|
|
@@ -16989,6 +17241,7 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
16989
17241
|
return false;
|
|
16990
17242
|
};
|
|
16991
17243
|
HtmlEditor.prototype.isUnOrderedList = function (editorValue) {
|
|
17244
|
+
editorValue = editorValue.replace(/\u200B/g, '');
|
|
16992
17245
|
var ulListStartRegex = [/^[*]$/, /^[-]$/];
|
|
16993
17246
|
if (!isNullOrUndefined(editorValue)) {
|
|
16994
17247
|
for (var i = 0; i < ulListStartRegex.length; i++) {
|
|
@@ -17174,7 +17427,7 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
17174
17427
|
var contentInnerElem = '';
|
|
17175
17428
|
for (var i = 0; i < enterSplitText.length; i++) {
|
|
17176
17429
|
if (enterSplitText[i].trim() === '') {
|
|
17177
|
-
contentInnerElem +=
|
|
17430
|
+
contentInnerElem += getDefaultValue(this.parent);
|
|
17178
17431
|
}
|
|
17179
17432
|
else {
|
|
17180
17433
|
var contentWithSpace = '';
|
|
@@ -17603,7 +17856,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
17603
17856
|
var contentInnerElem = '';
|
|
17604
17857
|
for (var i = 0; i < enterSplitText.length; i++) {
|
|
17605
17858
|
if (enterSplitText[i].trim() === '') {
|
|
17606
|
-
contentInnerElem +=
|
|
17859
|
+
contentInnerElem += getDefaultValue(this.parent);
|
|
17607
17860
|
}
|
|
17608
17861
|
else {
|
|
17609
17862
|
var contentWithSpace = this.makeSpace(enterSplitText[i]);
|
|
@@ -17937,7 +18190,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
17937
18190
|
dialog.hide();
|
|
17938
18191
|
_this.parent.height = isHeight ? preRTEHeight : _this.parent.height;
|
|
17939
18192
|
isHeight = false;
|
|
17940
|
-
var argument =
|
|
18193
|
+
var argument = dialog;
|
|
17941
18194
|
_this.dialogRenderObj.close(argument);
|
|
17942
18195
|
dialog.destroy();
|
|
17943
18196
|
_this.selectFormatting(value, args, keepChecked, cleanChecked);
|
|
@@ -17955,7 +18208,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
17955
18208
|
dialog.hide();
|
|
17956
18209
|
_this.parent.height = isHeight ? preRTEHeight : _this.parent.height;
|
|
17957
18210
|
isHeight = false;
|
|
17958
|
-
var args_1 =
|
|
18211
|
+
var args_1 = dialog;
|
|
17959
18212
|
_this.dialogRenderObj.close(args_1);
|
|
17960
18213
|
dialog.destroy();
|
|
17961
18214
|
}
|
|
@@ -18376,7 +18629,7 @@ var Resize = /** @__PURE__ @class */ (function () {
|
|
|
18376
18629
|
}
|
|
18377
18630
|
this.wireResizeEvents();
|
|
18378
18631
|
this.parent.notify(resizeInitialized, {});
|
|
18379
|
-
var args =
|
|
18632
|
+
var args = { event: e, requestType: 'editor' };
|
|
18380
18633
|
this.parent.trigger(resizeStart, args, function (resizeStartArgs) {
|
|
18381
18634
|
if (resizeStartArgs.cancel) {
|
|
18382
18635
|
_this.unwireResizeEvents();
|
|
@@ -18385,7 +18638,7 @@ var Resize = /** @__PURE__ @class */ (function () {
|
|
|
18385
18638
|
};
|
|
18386
18639
|
Resize.prototype.performResize = function (e) {
|
|
18387
18640
|
var _this = this;
|
|
18388
|
-
var args =
|
|
18641
|
+
var args = { event: e, requestType: 'editor' };
|
|
18389
18642
|
this.parent.trigger(onResize, args, function (resizingArgs) {
|
|
18390
18643
|
if (resizingArgs.cancel) {
|
|
18391
18644
|
_this.unwireResizeEvents();
|
|
@@ -18409,7 +18662,7 @@ var Resize = /** @__PURE__ @class */ (function () {
|
|
|
18409
18662
|
Resize.prototype.stopResize = function (e) {
|
|
18410
18663
|
this.parent.refreshUI();
|
|
18411
18664
|
this.unwireResizeEvents();
|
|
18412
|
-
var args =
|
|
18665
|
+
var args = { event: e, requestType: 'editor' };
|
|
18413
18666
|
this.parent.trigger(resizeStop, args);
|
|
18414
18667
|
};
|
|
18415
18668
|
Resize.prototype.getEventType = function (e) {
|
|
@@ -18998,9 +19251,17 @@ var Render = /** @__PURE__ @class */ (function () {
|
|
|
18998
19251
|
var childNodes = this.parent.contentModule.getEditPanel().childNodes;
|
|
18999
19252
|
if ((childNodes.length === 0) ||
|
|
19000
19253
|
(childNodes.length === 1 && childNodes[0].childNodes.length === 0 && ((childNodes[0].tagName === 'BR') ||
|
|
19001
|
-
(childNodes[0].tagName === 'P' && childNodes[0].textContent === '')))) {
|
|
19254
|
+
((childNodes[0].tagName === 'P' || childNodes[0].tagName === 'DIV') && childNodes[0].textContent === '')))) {
|
|
19002
19255
|
var node = this.parent.contentModule.getEditPanel();
|
|
19003
|
-
|
|
19256
|
+
if (this.parent.enterKey === 'DIV') {
|
|
19257
|
+
node.innerHTML = '<div><br/></div>';
|
|
19258
|
+
}
|
|
19259
|
+
else if (this.parent.enterKey === 'BR') {
|
|
19260
|
+
node.innerHTML = '<br/>';
|
|
19261
|
+
}
|
|
19262
|
+
else {
|
|
19263
|
+
node.innerHTML = '<p><br/></p>';
|
|
19264
|
+
}
|
|
19004
19265
|
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), node.childNodes[0], 0);
|
|
19005
19266
|
}
|
|
19006
19267
|
break;
|
|
@@ -19297,7 +19558,7 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
19297
19558
|
}
|
|
19298
19559
|
_this.dialogObj.destroy();
|
|
19299
19560
|
detach(_this.dialogObj.element);
|
|
19300
|
-
var args =
|
|
19561
|
+
var args = _this.dialogObj;
|
|
19301
19562
|
_this.dialogRenderObj.close(args);
|
|
19302
19563
|
_this.dialogObj = null;
|
|
19303
19564
|
}
|
|
@@ -19389,7 +19650,8 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
19389
19650
|
proxy.parent.formatter.saveData();
|
|
19390
19651
|
}
|
|
19391
19652
|
var argsValue;
|
|
19392
|
-
if (this.args
|
|
19653
|
+
if (!isNullOrUndefined(this.args) &&
|
|
19654
|
+
this.args.code === 'KeyK') {
|
|
19393
19655
|
var originalEvent = this.args;
|
|
19394
19656
|
extend(this.args, { item: { command: 'Links', subCommand: 'CreateLink' }, originalEvent: originalEvent }, true);
|
|
19395
19657
|
var argsVal = {
|
|
@@ -19519,6 +19781,7 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
19519
19781
|
var Image = /** @__PURE__ @class */ (function () {
|
|
19520
19782
|
function Image(parent, serviceLocator) {
|
|
19521
19783
|
this.isImgUploaded = false;
|
|
19784
|
+
this.isAllowedTypes = true;
|
|
19522
19785
|
this.pageX = null;
|
|
19523
19786
|
this.pageY = null;
|
|
19524
19787
|
this.deletedImg = [];
|
|
@@ -19639,7 +19902,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
19639
19902
|
if (Browser.isDevice) {
|
|
19640
19903
|
removeClass([e.target.parentElement], 'e-mob-span');
|
|
19641
19904
|
}
|
|
19642
|
-
var args =
|
|
19905
|
+
var args = { event: e, requestType: 'images' };
|
|
19643
19906
|
this.parent.trigger(resizeStop, args);
|
|
19644
19907
|
/* eslint-disable */
|
|
19645
19908
|
var pageX = this.getPointX(e);
|
|
@@ -19693,7 +19956,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
19693
19956
|
addClass([this.imgResizeDiv], 'e-mob-span');
|
|
19694
19957
|
}
|
|
19695
19958
|
else {
|
|
19696
|
-
var args =
|
|
19959
|
+
var args = { event: e, requestType: 'images' };
|
|
19697
19960
|
this.parent.trigger(resizeStart, args, function (resizeStartArgs) {
|
|
19698
19961
|
if (resizeStartArgs.cancel) {
|
|
19699
19962
|
_this.cancelResizeAction();
|
|
@@ -19828,6 +20091,12 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
19828
20091
|
img.style.height = null;
|
|
19829
20092
|
img.removeAttribute('height');
|
|
19830
20093
|
}
|
|
20094
|
+
else if (img.style.width === '' && img.style.height !== '') {
|
|
20095
|
+
img.style.height = expectedY + 'px';
|
|
20096
|
+
}
|
|
20097
|
+
else if (img.style.width !== '' && img.style.height === '') {
|
|
20098
|
+
img.style.width = ((width / height * expectedY) + width / height).toString() + 'px';
|
|
20099
|
+
}
|
|
19831
20100
|
else if (img.style.width !== '') {
|
|
19832
20101
|
img.style.width = (width / height * expectedY) + 'px';
|
|
19833
20102
|
img.style.height = expectedY + 'px';
|
|
@@ -19876,7 +20145,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
19876
20145
|
};
|
|
19877
20146
|
Image.prototype.imgDupMouseMove = function (width, height, e) {
|
|
19878
20147
|
var _this = this;
|
|
19879
|
-
var args =
|
|
20148
|
+
var args = { event: e, requestType: 'images' };
|
|
19880
20149
|
this.parent.trigger(onResize, args, function (resizingArgs) {
|
|
19881
20150
|
if (resizingArgs.cancel) {
|
|
19882
20151
|
_this.cancelResizeAction();
|
|
@@ -20703,7 +20972,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
20703
20972
|
isModal: Browser.isDevice,
|
|
20704
20973
|
buttons: [{
|
|
20705
20974
|
click: this.insertImageUrl.bind(selectObj),
|
|
20706
|
-
buttonModel: { content: imgInsert, cssClass: 'e-flat e-insertImage', isPrimary: true }
|
|
20975
|
+
buttonModel: { content: imgInsert, cssClass: 'e-flat e-insertImage', isPrimary: true, disabled: true }
|
|
20707
20976
|
},
|
|
20708
20977
|
{
|
|
20709
20978
|
click: function (e) {
|
|
@@ -20829,12 +21098,23 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
20829
21098
|
};
|
|
20830
21099
|
// eslint-disable-next-line
|
|
20831
21100
|
Image.prototype.imageUrlPopup = function (e) {
|
|
21101
|
+
var _this = this;
|
|
20832
21102
|
var imgUrl = this.parent.createElement('div', { className: 'imgUrl' });
|
|
20833
21103
|
var placeUrl = this.i10n.getConstant('imageUrl');
|
|
20834
21104
|
this.inputUrl = this.parent.createElement('input', {
|
|
20835
21105
|
className: 'e-input e-img-url',
|
|
20836
21106
|
attrs: { placeholder: placeUrl, spellcheck: 'false' }
|
|
20837
21107
|
});
|
|
21108
|
+
this.inputUrl.addEventListener('input', function () {
|
|
21109
|
+
if (!isNullOrUndefined(_this.inputUrl)) {
|
|
21110
|
+
if (_this.inputUrl.value.length === 0) {
|
|
21111
|
+
_this.dialogObj.getButtons(0).element.disabled = true;
|
|
21112
|
+
}
|
|
21113
|
+
else {
|
|
21114
|
+
_this.dialogObj.getButtons(0).element.removeAttribute('disabled');
|
|
21115
|
+
}
|
|
21116
|
+
}
|
|
21117
|
+
});
|
|
20838
21118
|
imgUrl.appendChild(this.inputUrl);
|
|
20839
21119
|
return imgUrl;
|
|
20840
21120
|
};
|
|
@@ -20885,42 +21165,58 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
20885
21165
|
}
|
|
20886
21166
|
};
|
|
20887
21167
|
Image.prototype.imgsizeInput = function (e) {
|
|
21168
|
+
var _this = this;
|
|
20888
21169
|
var selectNode = e.selectNode[0];
|
|
20889
21170
|
var imgHeight = this.i10n.getConstant('imageHeight');
|
|
20890
21171
|
var imgWidth = this.i10n.getConstant('imageWidth');
|
|
20891
21172
|
var imgSizeWrap = this.parent.createElement('div', { className: 'e-img-sizewrap' });
|
|
20892
|
-
var widthVal = (selectNode.
|
|
20893
|
-
|
|
20894
|
-
|
|
20895
|
-
|
|
21173
|
+
var widthVal = isNullOrUndefined(this.changedWidthValue) && (selectNode.style.width.toString() === 'auto' ||
|
|
21174
|
+
selectNode.style.width !== "") ? selectNode.style.width : !isNullOrUndefined(this.changedWidthValue) ?
|
|
21175
|
+
this.changedWidthValue : (parseInt(selectNode.getClientRects()[0].width.toString())).toString();
|
|
21176
|
+
var heightVal = isNullOrUndefined(this.changedHeightValue) && (selectNode.style.height.toString() === 'auto' ||
|
|
21177
|
+
selectNode.style.height !== "") ? selectNode.style.height : !isNullOrUndefined(this.changedHeightValue) ?
|
|
21178
|
+
this.changedHeightValue : (parseInt(selectNode.getClientRects()[0].height.toString())).toString();
|
|
21179
|
+
this.changedWidthValue = null;
|
|
21180
|
+
this.changedHeightValue = null;
|
|
20896
21181
|
var content = '<div class="e-rte-label"><label>' + imgWidth +
|
|
20897
|
-
'</label></div><div class="e-rte-field"><input type="text"
|
|
21182
|
+
'</label></div><div class="e-rte-field"><input type="text" id="imgwidth" class="e-img-width" value=' +
|
|
20898
21183
|
widthVal
|
|
20899
21184
|
+ ' /></div>' +
|
|
20900
21185
|
'<div class="e-rte-label">' + '<label>' + imgHeight + '</label></div><div class="e-rte-field"> ' +
|
|
20901
|
-
'<input type="text"
|
|
21186
|
+
'<input type="text" id="imgheight" class="e-img-height" value=' +
|
|
20902
21187
|
heightVal
|
|
20903
21188
|
+ ' /></div>';
|
|
20904
21189
|
var contentElem = parseHtml(content);
|
|
20905
21190
|
imgSizeWrap.appendChild(contentElem);
|
|
20906
|
-
var widthNum = new
|
|
20907
|
-
|
|
20908
|
-
|
|
20909
|
-
|
|
21191
|
+
var widthNum = new TextBox({
|
|
21192
|
+
value: formatUnit(widthVal),
|
|
21193
|
+
enableRtl: this.parent.enableRtl,
|
|
21194
|
+
input: function (e) {
|
|
21195
|
+
_this.inputWidthValue = formatUnit(_this.inputValue(e.value));
|
|
21196
|
+
}
|
|
20910
21197
|
});
|
|
20911
|
-
widthNum.isStringTemplate = true;
|
|
20912
21198
|
widthNum.createElement = this.parent.createElement;
|
|
20913
21199
|
widthNum.appendTo(imgSizeWrap.querySelector('#imgwidth'));
|
|
20914
|
-
var heightNum = new
|
|
20915
|
-
|
|
20916
|
-
|
|
20917
|
-
|
|
21200
|
+
var heightNum = new TextBox({
|
|
21201
|
+
value: formatUnit(heightVal),
|
|
21202
|
+
enableRtl: this.parent.enableRtl,
|
|
21203
|
+
input: function (e) {
|
|
21204
|
+
_this.inputHeightValue = formatUnit(_this.inputValue(e.value));
|
|
21205
|
+
}
|
|
20918
21206
|
});
|
|
20919
|
-
heightNum.isStringTemplate = true;
|
|
20920
21207
|
heightNum.createElement = this.parent.createElement;
|
|
20921
21208
|
heightNum.appendTo(imgSizeWrap.querySelector('#imgheight'));
|
|
20922
21209
|
return imgSizeWrap;
|
|
20923
21210
|
};
|
|
21211
|
+
Image.prototype.inputValue = function (value) {
|
|
21212
|
+
if (value === 'auto' || value.indexOf('%') !== -1 || value.indexOf('px') !== -1
|
|
21213
|
+
|| value.match(/(\d+)/)) {
|
|
21214
|
+
return value;
|
|
21215
|
+
}
|
|
21216
|
+
else {
|
|
21217
|
+
return "auto";
|
|
21218
|
+
}
|
|
21219
|
+
};
|
|
20924
21220
|
Image.prototype.insertSize = function (e) {
|
|
20925
21221
|
e.selection.restore();
|
|
20926
21222
|
var proxy = e.selfImage;
|
|
@@ -20928,8 +21224,10 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
20928
21224
|
proxy.parent.formatter.saveData();
|
|
20929
21225
|
}
|
|
20930
21226
|
var dialogEle = proxy.dialogObj.element;
|
|
20931
|
-
|
|
20932
|
-
|
|
21227
|
+
this.changedWidthValue = this.inputWidthValue;
|
|
21228
|
+
this.changedHeightValue = this.inputHeightValue;
|
|
21229
|
+
var width = dialogEle.querySelector('.e-img-width').value;
|
|
21230
|
+
var height = dialogEle.parentElement.querySelector('.e-img-height').value;
|
|
20933
21231
|
proxy.parent.formatter.process(this.parent, e.args, e.args, {
|
|
20934
21232
|
width: width, height: height, selectNode: e.selectNode,
|
|
20935
21233
|
subCommand: e.args.item.subCommand
|
|
@@ -21039,6 +21337,10 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
21039
21337
|
}
|
|
21040
21338
|
};
|
|
21041
21339
|
proxy.inputUrl.setAttribute('disabled', 'true');
|
|
21340
|
+
if (isNullOrUndefined(proxy.parent.insertImageSettings.saveUrl) && _this.isAllowedTypes
|
|
21341
|
+
&& !isNullOrUndefined(_this.dialogObj)) {
|
|
21342
|
+
_this.dialogObj.getButtons(0).element.removeAttribute('disabled');
|
|
21343
|
+
}
|
|
21042
21344
|
});
|
|
21043
21345
|
reader_1.readAsDataURL(selectArgs.filesData[0].rawFile);
|
|
21044
21346
|
}
|
|
@@ -21094,6 +21396,9 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
21094
21396
|
};
|
|
21095
21397
|
proxy.inputUrl.setAttribute('disabled', 'true');
|
|
21096
21398
|
}
|
|
21399
|
+
if (e.operation === 'upload' && !isNullOrUndefined(_this.dialogObj)) {
|
|
21400
|
+
_this.dialogObj.getButtons(0).element.removeAttribute('disabled');
|
|
21401
|
+
}
|
|
21097
21402
|
});
|
|
21098
21403
|
},
|
|
21099
21404
|
failure: function (e) {
|
|
@@ -21103,11 +21408,11 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
21103
21408
|
// eslint-disable-next-line
|
|
21104
21409
|
_this.parent.trigger(imageRemoving, e, function (e) {
|
|
21105
21410
|
proxy.isImgUploaded = false;
|
|
21411
|
+
_this.dialogObj.getButtons(0).element.disabled = true;
|
|
21106
21412
|
proxy.inputUrl.removeAttribute('disabled');
|
|
21107
21413
|
if (proxy.uploadUrl) {
|
|
21108
21414
|
proxy.uploadUrl.url = '';
|
|
21109
21415
|
}
|
|
21110
|
-
_this.dialogObj.getButtons(0).element.removeAttribute('disabled');
|
|
21111
21416
|
});
|
|
21112
21417
|
}
|
|
21113
21418
|
});
|
|
@@ -21120,9 +21425,10 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
21120
21425
|
if (this.uploadObj.allowedExtensions) {
|
|
21121
21426
|
if (this.uploadObj.allowedExtensions.toLocaleLowerCase().indexOf(('.' + e.type).toLocaleLowerCase()) === -1) {
|
|
21122
21427
|
this.dialogObj.getButtons(0).element.setAttribute('disabled', 'disabled');
|
|
21428
|
+
this.isAllowedTypes = false;
|
|
21123
21429
|
}
|
|
21124
21430
|
else {
|
|
21125
|
-
this.
|
|
21431
|
+
this.isAllowedTypes = true;
|
|
21126
21432
|
}
|
|
21127
21433
|
}
|
|
21128
21434
|
};
|
|
@@ -21792,7 +22098,21 @@ var ViewSource = /** @__PURE__ @class */ (function () {
|
|
|
21792
22098
|
baseToolbar: this.parent.getBaseToolbarObject()
|
|
21793
22099
|
});
|
|
21794
22100
|
var serializeValue = this.parent.serializeValue(editHTML.value);
|
|
21795
|
-
var value
|
|
22101
|
+
var value;
|
|
22102
|
+
if (serializeValue === null || serializeValue === '') {
|
|
22103
|
+
if (this.parent.enterKey === 'DIV') {
|
|
22104
|
+
value = '<div><br/></div>';
|
|
22105
|
+
}
|
|
22106
|
+
else if (this.parent.enterKey === 'BR') {
|
|
22107
|
+
value = '<br/>';
|
|
22108
|
+
}
|
|
22109
|
+
else {
|
|
22110
|
+
value = '<p><br/></p>';
|
|
22111
|
+
}
|
|
22112
|
+
}
|
|
22113
|
+
else {
|
|
22114
|
+
value = serializeValue;
|
|
22115
|
+
}
|
|
21796
22116
|
if (this.parent.iframeSettings.enable) {
|
|
21797
22117
|
editHTML.parentElement.style.display = 'none';
|
|
21798
22118
|
editHTML.style.display = 'none';
|
|
@@ -21824,9 +22144,13 @@ var ViewSource = /** @__PURE__ @class */ (function () {
|
|
|
21824
22144
|
};
|
|
21825
22145
|
ViewSource.prototype.getTextAreaValue = function () {
|
|
21826
22146
|
return (this.contentModule.getEditPanel().innerHTML === '<p><br></p>') ||
|
|
22147
|
+
(this.contentModule.getEditPanel().innerHTML === '<div><br></div>') ||
|
|
22148
|
+
(this.contentModule.getEditPanel().innerHTML === '<br>') ||
|
|
21827
22149
|
(this.contentModule.getEditPanel().childNodes.length === 1 &&
|
|
21828
|
-
this.contentModule.getEditPanel().childNodes[0].tagName === 'P' &&
|
|
21829
|
-
|
|
22150
|
+
(this.contentModule.getEditPanel().childNodes[0].tagName === 'P' &&
|
|
22151
|
+
this.contentModule.getEditPanel().innerHTML.length === 7) ||
|
|
22152
|
+
(this.contentModule.getEditPanel().childNodes[0].tagName === 'DIV' &&
|
|
22153
|
+
this.contentModule.getEditPanel().innerHTML.length === 11)) ? '' : this.parent.value;
|
|
21830
22154
|
};
|
|
21831
22155
|
/**
|
|
21832
22156
|
* getPanel method
|
|
@@ -21965,6 +22289,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
21965
22289
|
break;
|
|
21966
22290
|
case 'Dashed':
|
|
21967
22291
|
case 'Alternate':
|
|
22292
|
+
case 'Custom':
|
|
21968
22293
|
this.tableStyles(args, item.subCommand);
|
|
21969
22294
|
break;
|
|
21970
22295
|
case 'Merge':
|
|
@@ -22088,6 +22413,13 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
22088
22413
|
table.classList.add(CLS_TB_ALT_BOR);
|
|
22089
22414
|
/* eslint-enable */
|
|
22090
22415
|
}
|
|
22416
|
+
if (args.args && args.args.item.cssClass) {
|
|
22417
|
+
var classList = args.args.item.cssClass.split(' ');
|
|
22418
|
+
for (var i = 0; i < classList.length; i++) {
|
|
22419
|
+
(table.classList.contains(classList[i])) ? table.classList.remove(classList[i]) :
|
|
22420
|
+
table.classList.add(classList[i]);
|
|
22421
|
+
}
|
|
22422
|
+
}
|
|
22091
22423
|
this.parent.formatter.saveData();
|
|
22092
22424
|
this.parent.formatter.editorManager.nodeSelection.restore();
|
|
22093
22425
|
};
|
|
@@ -22304,7 +22636,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
22304
22636
|
selectionObj.selection = proxy.parent.formatter.editorManager.nodeSelection.save(range, proxy.contentModule.getDocument());
|
|
22305
22637
|
}
|
|
22306
22638
|
var value = {
|
|
22307
|
-
|
|
22639
|
+
rows: row, columns: col, width: {
|
|
22308
22640
|
minWidth: proxy.parent.tableSettings.minWidth,
|
|
22309
22641
|
maxWidth: proxy.parent.tableSettings.maxWidth,
|
|
22310
22642
|
width: proxy.parent.tableSettings.width
|
|
@@ -22503,7 +22835,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
22503
22835
|
EventHandler.add(this.helper, Browser.touchStartEvent, this.resizeStart, this);
|
|
22504
22836
|
}
|
|
22505
22837
|
else {
|
|
22506
|
-
var args =
|
|
22838
|
+
var args = { event: e, requestType: 'Table' };
|
|
22507
22839
|
this.parent.trigger(resizeStart, args, function (resizeStartArgs) {
|
|
22508
22840
|
if (resizeStartArgs.cancel) {
|
|
22509
22841
|
_this.cancelResizeAction();
|
|
@@ -22580,7 +22912,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
22580
22912
|
var mouseY = (this.parent.enableRtl) ? -(pageY - this.pageY) : (pageY - this.pageY);
|
|
22581
22913
|
this.pageX = pageX;
|
|
22582
22914
|
this.pageY = pageY;
|
|
22583
|
-
var args =
|
|
22915
|
+
var args = { event: e, requestType: 'table' };
|
|
22584
22916
|
this.parent.trigger(onResize, args, function (resizingArgs) {
|
|
22585
22917
|
if (resizingArgs.cancel) {
|
|
22586
22918
|
_this.cancelResizeAction();
|
|
@@ -22667,7 +22999,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
22667
22999
|
this.pageY = null;
|
|
22668
23000
|
this.moveEle = null;
|
|
22669
23001
|
}
|
|
22670
|
-
var args =
|
|
23002
|
+
var args = { event: e, requestType: 'table' };
|
|
22671
23003
|
this.parent.trigger(resizeStop, args);
|
|
22672
23004
|
this.parent.formatter.saveData();
|
|
22673
23005
|
};
|
|
@@ -23772,6 +24104,294 @@ var InlineMode = /** @__PURE__ @class */ (function (_super) {
|
|
|
23772
24104
|
return InlineMode;
|
|
23773
24105
|
}(ChildProperty));
|
|
23774
24106
|
|
|
24107
|
+
/**
|
|
24108
|
+
* `EnterKey` module is used to handle enter key press actions.
|
|
24109
|
+
*/
|
|
24110
|
+
var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
24111
|
+
function EnterKeyAction(parent) {
|
|
24112
|
+
this.parent = parent;
|
|
24113
|
+
this.addEventListener();
|
|
24114
|
+
}
|
|
24115
|
+
EnterKeyAction.prototype.addEventListener = function () {
|
|
24116
|
+
this.parent.on(enterHandler, this.enterHandler, this);
|
|
24117
|
+
this.parent.on(destroy, this.destroy, this);
|
|
24118
|
+
};
|
|
24119
|
+
EnterKeyAction.prototype.destroy = function () {
|
|
24120
|
+
this.removeEventListener();
|
|
24121
|
+
};
|
|
24122
|
+
EnterKeyAction.prototype.removeEventListener = function () {
|
|
24123
|
+
this.parent.off(enterHandler, this.enterHandler);
|
|
24124
|
+
this.parent.off(destroy, this.destroy);
|
|
24125
|
+
};
|
|
24126
|
+
EnterKeyAction.prototype.getRangeNode = function () {
|
|
24127
|
+
this.range = this.parent.getRange();
|
|
24128
|
+
this.startNode = this.range.startContainer.nodeName === '#text' ? this.range.startContainer.parentElement :
|
|
24129
|
+
this.range.startContainer;
|
|
24130
|
+
this.endNode = this.range.endContainer.nodeName === '#text' ? this.range.endContainer.parentElement :
|
|
24131
|
+
this.range.endContainer;
|
|
24132
|
+
};
|
|
24133
|
+
EnterKeyAction.prototype.enterHandler = function (e) {
|
|
24134
|
+
var _this = this;
|
|
24135
|
+
this.getRangeNode();
|
|
24136
|
+
if (e.args.which === 13 && e.args.code === 'Enter') {
|
|
24137
|
+
if (isNullOrUndefined(this.startNode.closest('LI')) && isNullOrUndefined(this.endNode.closest('LI')) && isNullOrUndefined(this.startNode.closest('TABLE')) &&
|
|
24138
|
+
isNullOrUndefined(this.endNode.closest('TABLE')) && isNullOrUndefined(this.startNode.closest('PRE')) && isNullOrUndefined(this.endNode.closest('PRE'))) {
|
|
24139
|
+
var shiftKey_1 = e.args.shiftKey;
|
|
24140
|
+
var actionBeginArgs = {
|
|
24141
|
+
cancel: false,
|
|
24142
|
+
name: actionBegin,
|
|
24143
|
+
requestType: shiftKey_1 ? 'ShiftEnterAction' : 'EnterAction',
|
|
24144
|
+
originalEvent: e.args
|
|
24145
|
+
};
|
|
24146
|
+
this.parent.trigger(actionBegin, actionBeginArgs, function (actionBeginArgs) {
|
|
24147
|
+
if (!actionBeginArgs.cancel) {
|
|
24148
|
+
if (!(_this.range.startOffset === _this.range.endOffset && _this.range.startContainer === _this.range.endContainer)) {
|
|
24149
|
+
_this.range.deleteContents();
|
|
24150
|
+
if (_this.range.startContainer.nodeName === '#text' && _this.range.startContainer.textContent.length === 0 &&
|
|
24151
|
+
_this.range.startContainer.parentElement !== _this.parent.inputElement) {
|
|
24152
|
+
if (_this.parent.enterKey === 'BR') {
|
|
24153
|
+
_this.range.startContainer.parentElement.innerHTML = '​';
|
|
24154
|
+
}
|
|
24155
|
+
else {
|
|
24156
|
+
_this.range.startContainer.parentElement.innerHTML = '<br>';
|
|
24157
|
+
}
|
|
24158
|
+
}
|
|
24159
|
+
else if (_this.range.startContainer === _this.parent.inputElement && _this.range.startContainer.innerHTML === '') {
|
|
24160
|
+
_this.range.startContainer.innerHTML = '<br>';
|
|
24161
|
+
var focusElem = _this.range.startContainer.childNodes[_this.range.startOffset];
|
|
24162
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), focusElem, 0);
|
|
24163
|
+
}
|
|
24164
|
+
else if (_this.parent.inputElement === _this.range.startContainer) {
|
|
24165
|
+
var focusElem = _this.range.startContainer.childNodes[_this.range.startOffset];
|
|
24166
|
+
if (focusElem.nodeName === '#text' && focusElem.textContent.length === 0) {
|
|
24167
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), focusElem, focusElem.previousSibling.textContent.length);
|
|
24168
|
+
}
|
|
24169
|
+
else {
|
|
24170
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), focusElem, focusElem.textContent.length >= 0 ? 0 : 1);
|
|
24171
|
+
if (focusElem.previousSibling.textContent.length === 0) {
|
|
24172
|
+
detach(focusElem.previousSibling);
|
|
24173
|
+
}
|
|
24174
|
+
else if (focusElem.textContent.length === 0) {
|
|
24175
|
+
var currentFocusElem = focusElem.previousSibling.lastChild;
|
|
24176
|
+
var finalFocusElem = void 0;
|
|
24177
|
+
while (currentFocusElem.nodeName !== '#text') {
|
|
24178
|
+
finalFocusElem = currentFocusElem;
|
|
24179
|
+
currentFocusElem = currentFocusElem.lastChild;
|
|
24180
|
+
}
|
|
24181
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), currentFocusElem, currentFocusElem.textContent.length);
|
|
24182
|
+
detach(focusElem);
|
|
24183
|
+
}
|
|
24184
|
+
else if (_this.parent.enterKey !== 'BR' &&
|
|
24185
|
+
focusElem.previousSibling.textContent.length !== 0 && focusElem.textContent.length !== 0) {
|
|
24186
|
+
e.args.preventDefault();
|
|
24187
|
+
return;
|
|
24188
|
+
}
|
|
24189
|
+
}
|
|
24190
|
+
_this.getRangeNode();
|
|
24191
|
+
}
|
|
24192
|
+
}
|
|
24193
|
+
if (_this.range.startContainer === _this.range.endContainer && _this.range.startOffset === 0 &&
|
|
24194
|
+
_this.range.startOffset == _this.range.endOffset && _this.range.startContainer === _this.parent.inputElement) {
|
|
24195
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), _this.range.startContainer.childNodes[_this.range.startOffset], _this.range.startOffset);
|
|
24196
|
+
_this.getRangeNode();
|
|
24197
|
+
}
|
|
24198
|
+
if (_this.parent.enterKey === 'P' || _this.parent.enterKey === 'DIV' ||
|
|
24199
|
+
(_this.parent.shiftEnterKey === 'P' && shiftKey_1) ||
|
|
24200
|
+
(_this.parent.shiftEnterKey === 'DIV' && shiftKey_1)) {
|
|
24201
|
+
var nearBlockNode = _this.parent.formatter.editorManager.domNode.blockParentNode(_this.startNode);
|
|
24202
|
+
var isImageNode = false;
|
|
24203
|
+
if (_this.range.startOffset === 0 && _this.range.endOffset === 0 && !(!isNullOrUndefined(_this.range.startContainer.previousSibling) && _this.range.startContainer.previousSibling.nodeName === 'IMG')) {
|
|
24204
|
+
var isNearBlockLengthZero = void 0;
|
|
24205
|
+
var newElem = void 0;
|
|
24206
|
+
if (_this.range.startContainer.nodeName === 'IMG') {
|
|
24207
|
+
newElem = _this.createInsertElement(shiftKey_1);
|
|
24208
|
+
isImageNode = true;
|
|
24209
|
+
isNearBlockLengthZero = false;
|
|
24210
|
+
}
|
|
24211
|
+
else {
|
|
24212
|
+
if (nearBlockNode.textContent.length !== 0) {
|
|
24213
|
+
newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
|
|
24214
|
+
isNearBlockLengthZero = false;
|
|
24215
|
+
}
|
|
24216
|
+
else {
|
|
24217
|
+
newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, true).cloneNode(true);
|
|
24218
|
+
isNearBlockLengthZero = true;
|
|
24219
|
+
}
|
|
24220
|
+
}
|
|
24221
|
+
var insertElem = _this.createInsertElement(shiftKey_1);
|
|
24222
|
+
while (newElem.firstChild) {
|
|
24223
|
+
insertElem.appendChild(newElem.firstChild);
|
|
24224
|
+
}
|
|
24225
|
+
nearBlockNode.parentElement.insertBefore(insertElem, nearBlockNode);
|
|
24226
|
+
if (!isNearBlockLengthZero) {
|
|
24227
|
+
var currentFocusElem = insertElem;
|
|
24228
|
+
var finalFocusElem = void 0;
|
|
24229
|
+
while (!isNullOrUndefined(currentFocusElem) && currentFocusElem.nodeName !== '#text') {
|
|
24230
|
+
finalFocusElem = currentFocusElem;
|
|
24231
|
+
currentFocusElem = currentFocusElem.lastChild;
|
|
24232
|
+
}
|
|
24233
|
+
finalFocusElem.innerHTML = '<br>';
|
|
24234
|
+
if (!isImageNode) {
|
|
24235
|
+
detach(nearBlockNode);
|
|
24236
|
+
}
|
|
24237
|
+
}
|
|
24238
|
+
}
|
|
24239
|
+
else if (nearBlockNode.textContent.length === 0 && !(!isNullOrUndefined(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG')) {
|
|
24240
|
+
if (!isNullOrUndefined(nearBlockNode.children[0]) && nearBlockNode.children[0].tagName !== 'BR') {
|
|
24241
|
+
var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
|
|
24242
|
+
_this.parent.formatter.editorManager.domNode.insertAfter(newElem, nearBlockNode);
|
|
24243
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), newElem, newElem.textContent.length >= 0 ? 0 : 1);
|
|
24244
|
+
}
|
|
24245
|
+
else {
|
|
24246
|
+
var insertElem = _this.createInsertElement(shiftKey_1);
|
|
24247
|
+
insertElem.innerHTML = '<br>';
|
|
24248
|
+
_this.parent.formatter.editorManager.domNode.insertAfter(insertElem, nearBlockNode);
|
|
24249
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), insertElem, 0);
|
|
24250
|
+
}
|
|
24251
|
+
}
|
|
24252
|
+
else {
|
|
24253
|
+
var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, true);
|
|
24254
|
+
if (!isNullOrUndefined(newElem.childNodes[0]) && newElem.childNodes[0].nodeName === '#text' &&
|
|
24255
|
+
newElem.childNodes[0].textContent.length === 0) {
|
|
24256
|
+
detach(newElem.childNodes[0]);
|
|
24257
|
+
}
|
|
24258
|
+
if (newElem.textContent.trim().length === 0) {
|
|
24259
|
+
var brElm = _this.parent.createElement('br');
|
|
24260
|
+
_this.startNode.appendChild(brElm);
|
|
24261
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), _this.startNode, 0);
|
|
24262
|
+
}
|
|
24263
|
+
if (((_this.parent.enterKey === 'P' || _this.parent.enterKey === 'DIV') && !shiftKey_1) || ((_this.parent.shiftEnterKey === 'DIV' ||
|
|
24264
|
+
_this.parent.shiftEnterKey === 'P') && shiftKey_1)) {
|
|
24265
|
+
var insertElm = _this.createInsertElement(shiftKey_1);
|
|
24266
|
+
while (newElem.firstChild) {
|
|
24267
|
+
insertElm.appendChild(newElem.firstChild);
|
|
24268
|
+
}
|
|
24269
|
+
_this.parent.formatter.editorManager.domNode.insertAfter(insertElm, newElem);
|
|
24270
|
+
detach(newElem);
|
|
24271
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), insertElm, insertElm.textContent.length >= 0 ? 0 : 1);
|
|
24272
|
+
}
|
|
24273
|
+
}
|
|
24274
|
+
e.args.preventDefault();
|
|
24275
|
+
}
|
|
24276
|
+
if (_this.parent.enterKey === 'BR' && !shiftKey_1) {
|
|
24277
|
+
var currentParent = void 0;
|
|
24278
|
+
if (!_this.parent.formatter.editorManager.domNode.isBlockNode(_this.startNode)) {
|
|
24279
|
+
var currentNode = _this.startNode;
|
|
24280
|
+
var previousNode = currentNode;
|
|
24281
|
+
while (!_this.parent.formatter.editorManager.domNode.isBlockNode(currentNode)) {
|
|
24282
|
+
previousNode = currentNode;
|
|
24283
|
+
currentNode = currentNode.parentElement;
|
|
24284
|
+
}
|
|
24285
|
+
currentParent = currentNode === _this.parent.inputElement ?
|
|
24286
|
+
previousNode : currentNode;
|
|
24287
|
+
}
|
|
24288
|
+
else {
|
|
24289
|
+
currentParent = _this.startNode;
|
|
24290
|
+
}
|
|
24291
|
+
var isEmptyBrInserted = false;
|
|
24292
|
+
if (currentParent !== _this.parent.inputElement &&
|
|
24293
|
+
_this.parent.formatter.editorManager.domNode.isBlockNode(currentParent) &&
|
|
24294
|
+
_this.range.startOffset === _this.range.endOffset &&
|
|
24295
|
+
_this.range.startOffset === currentParent.textContent.length) {
|
|
24296
|
+
var outerBRElem = _this.parent.createElement('br');
|
|
24297
|
+
_this.parent.formatter.editorManager.domNode.insertAfter(outerBRElem, currentParent);
|
|
24298
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), outerBRElem, 0);
|
|
24299
|
+
}
|
|
24300
|
+
else if (!isNullOrUndefined(currentParent) && currentParent !== _this.parent.inputElement && currentParent.nodeName !== 'BR') {
|
|
24301
|
+
if (currentParent.textContent.trim().length === 0 || (currentParent.textContent.trim().length === 1 &&
|
|
24302
|
+
currentParent.textContent.charCodeAt(0) === 8203)) {
|
|
24303
|
+
var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, currentParent, true).cloneNode(true);
|
|
24304
|
+
_this.parent.formatter.editorManager.domNode.insertAfter(newElem, currentParent);
|
|
24305
|
+
var outerBRElem = _this.parent.createElement('br');
|
|
24306
|
+
newElem.parentElement.insertBefore(outerBRElem, newElem);
|
|
24307
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), newElem, 0);
|
|
24308
|
+
}
|
|
24309
|
+
else {
|
|
24310
|
+
var newElem = void 0;
|
|
24311
|
+
var focusElem = void 0;
|
|
24312
|
+
var outerBRElem = _this.parent.createElement('br');
|
|
24313
|
+
if (_this.range.startOffset === 0 && _this.range.endOffset === 0 &&
|
|
24314
|
+
!isNullOrUndefined(currentParent.previousSibling) && currentParent.previousSibling.nodeName === 'BR') {
|
|
24315
|
+
focusElem = _this.range.startContainer;
|
|
24316
|
+
newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, currentParent, false).cloneNode(true);
|
|
24317
|
+
_this.parent.formatter.editorManager.domNode.insertAfter(outerBRElem, currentParent);
|
|
24318
|
+
_this.insertFocusContent();
|
|
24319
|
+
var currentFocusElem = outerBRElem.nextSibling;
|
|
24320
|
+
var finalFocusElem = void 0;
|
|
24321
|
+
while (!isNullOrUndefined(currentFocusElem) && currentFocusElem.nodeName !== '#text') {
|
|
24322
|
+
finalFocusElem = currentFocusElem;
|
|
24323
|
+
currentFocusElem = currentFocusElem.lastChild;
|
|
24324
|
+
}
|
|
24325
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), currentFocusElem, 0);
|
|
24326
|
+
isEmptyBrInserted = true;
|
|
24327
|
+
}
|
|
24328
|
+
else {
|
|
24329
|
+
newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, currentParent, true);
|
|
24330
|
+
newElem.parentElement.insertBefore(outerBRElem, newElem);
|
|
24331
|
+
_this.insertFocusContent();
|
|
24332
|
+
}
|
|
24333
|
+
}
|
|
24334
|
+
}
|
|
24335
|
+
else {
|
|
24336
|
+
var brElm = _this.parent.createElement('br');
|
|
24337
|
+
if (_this.startNode.nodeName === 'BR' && _this.endNode.nodeName === 'BR' && _this.range.startOffset === 0 && _this.range.startOffset === _this.range.endOffset) {
|
|
24338
|
+
_this.parent.formatter.editorManager.domNode.insertAfter(brElm, _this.startNode);
|
|
24339
|
+
isEmptyBrInserted = true;
|
|
24340
|
+
}
|
|
24341
|
+
else {
|
|
24342
|
+
if (_this.startNode === _this.parent.inputElement && !isNullOrUndefined(_this.range.startContainer.previousSibling) &&
|
|
24343
|
+
_this.range.startContainer.previousSibling.nodeName === 'BR' && _this.range.startContainer.textContent.length === 0) {
|
|
24344
|
+
isEmptyBrInserted = true;
|
|
24345
|
+
}
|
|
24346
|
+
_this.range.insertNode(brElm);
|
|
24347
|
+
}
|
|
24348
|
+
if (isEmptyBrInserted || (!isNullOrUndefined(brElm.nextElementSibling) && brElm.nextElementSibling.tagName === 'BR') || (!isNullOrUndefined(brElm.nextSibling) && brElm.nextSibling.textContent.length > 0)) {
|
|
24349
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), !isNullOrUndefined(brElm.nextSibling) ? brElm.nextSibling : brElm, 0);
|
|
24350
|
+
isEmptyBrInserted = false;
|
|
24351
|
+
}
|
|
24352
|
+
else {
|
|
24353
|
+
var brElm2 = _this.parent.createElement('br');
|
|
24354
|
+
_this.range.insertNode(brElm2);
|
|
24355
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), brElm, 0);
|
|
24356
|
+
}
|
|
24357
|
+
}
|
|
24358
|
+
e.args.preventDefault();
|
|
24359
|
+
}
|
|
24360
|
+
if (_this.range.startContainer.nodeName === '#text') {
|
|
24361
|
+
_this.range.startContainer.parentElement.scrollIntoView(false);
|
|
24362
|
+
}
|
|
24363
|
+
else {
|
|
24364
|
+
_this.range.startContainer.scrollIntoView(false);
|
|
24365
|
+
}
|
|
24366
|
+
_this.parent.trigger(actionComplete, { requestType: shiftKey_1 ? 'ShiftEnterAction' : 'EnterAction', args: e.args });
|
|
24367
|
+
}
|
|
24368
|
+
});
|
|
24369
|
+
}
|
|
24370
|
+
}
|
|
24371
|
+
};
|
|
24372
|
+
EnterKeyAction.prototype.insertFocusContent = function () {
|
|
24373
|
+
if (this.range.startContainer.textContent.length === 0) {
|
|
24374
|
+
if (this.range.startContainer.nodeName === '#text') {
|
|
24375
|
+
this.range.startContainer.parentElement.innerHTML = '​';
|
|
24376
|
+
}
|
|
24377
|
+
else {
|
|
24378
|
+
this.range.startContainer.innerHTML = '​';
|
|
24379
|
+
}
|
|
24380
|
+
}
|
|
24381
|
+
};
|
|
24382
|
+
EnterKeyAction.prototype.createInsertElement = function (shiftKey) {
|
|
24383
|
+
var insertElem;
|
|
24384
|
+
if ((this.parent.enterKey === 'DIV' && !shiftKey) || (this.parent.shiftEnterKey === 'DIV' && shiftKey)) {
|
|
24385
|
+
insertElem = this.parent.createElement('div');
|
|
24386
|
+
}
|
|
24387
|
+
else if ((this.parent.enterKey === 'P' && !shiftKey) || (this.parent.shiftEnterKey === 'P' && shiftKey)) {
|
|
24388
|
+
insertElem = this.parent.createElement('p');
|
|
24389
|
+
}
|
|
24390
|
+
return insertElem;
|
|
24391
|
+
};
|
|
24392
|
+
return EnterKeyAction;
|
|
24393
|
+
}());
|
|
24394
|
+
|
|
23775
24395
|
var __extends$4 = (undefined && undefined.__extends) || (function () {
|
|
23776
24396
|
var extendStatics = function (d, b) {
|
|
23777
24397
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -23953,9 +24573,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
23953
24573
|
this.htmlAttributes = { 'tabindex': this.element.getAttribute('tabindex') };
|
|
23954
24574
|
this.element.removeAttribute('tabindex');
|
|
23955
24575
|
}
|
|
23956
|
-
|
|
23957
|
-
this.element.innerHTML = '';
|
|
23958
|
-
}
|
|
24576
|
+
this.element.innerHTML = '';
|
|
23959
24577
|
var invalidAttr = ['class', 'style', 'id', 'ejs-for'];
|
|
23960
24578
|
var htmlAttr = {};
|
|
23961
24579
|
for (var a = 0; a < this.element.attributes.length; a++) {
|
|
@@ -23973,23 +24591,10 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
23973
24591
|
var rteOuterWrapper = this.createElement('div', {
|
|
23974
24592
|
className: this.element.getAttribute('class')
|
|
23975
24593
|
});
|
|
23976
|
-
|
|
23977
|
-
this.element.innerHTML = '';
|
|
23978
|
-
}
|
|
24594
|
+
this.element.innerHTML = '';
|
|
23979
24595
|
this.element.parentElement.insertBefore(rteOuterWrapper, this.element);
|
|
23980
|
-
|
|
23981
|
-
rteOuterWrapper.appendChild(this.element);
|
|
23982
|
-
this.valueContainer = this.createElement('textarea', {
|
|
23983
|
-
id: this.element.id + '-value'
|
|
23984
|
-
});
|
|
23985
|
-
}
|
|
23986
|
-
else {
|
|
23987
|
-
this.valueContainer = this.element;
|
|
23988
|
-
}
|
|
24596
|
+
this.valueContainer = this.element;
|
|
23989
24597
|
removeClass([this.valueContainer], this.element.getAttribute('class').split(' '));
|
|
23990
|
-
if (this.isBlazor()) {
|
|
23991
|
-
addClass([this.element], CLS_RTE_HIDDEN);
|
|
23992
|
-
}
|
|
23993
24598
|
this.element = rteOuterWrapper;
|
|
23994
24599
|
}
|
|
23995
24600
|
else {
|
|
@@ -24206,12 +24811,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
24206
24811
|
}
|
|
24207
24812
|
this.setContentHeight();
|
|
24208
24813
|
if (this.value !== null) {
|
|
24209
|
-
|
|
24210
|
-
this.valueContainer.defaultValue = this.value;
|
|
24211
|
-
}
|
|
24212
|
-
else {
|
|
24213
|
-
this.defaultResetValue = this.value;
|
|
24214
|
-
}
|
|
24814
|
+
this.valueContainer.defaultValue = this.value;
|
|
24215
24815
|
}
|
|
24216
24816
|
// eslint-disable-next-line
|
|
24217
24817
|
(!this.enabled) ? this.unWireEvents() : this.eventInitializer();
|
|
@@ -24314,7 +24914,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
24314
24914
|
this.notify(keyUp, { member: 'keyup', args: e });
|
|
24315
24915
|
if (e.code === 'KeyX' && e.which === 88 && e.keyCode === 88 && e.ctrlKey && (this.inputElement.innerHTML === '' ||
|
|
24316
24916
|
this.inputElement.innerHTML === '<br>')) {
|
|
24317
|
-
this.inputElement.innerHTML = getEditValue(
|
|
24917
|
+
this.inputElement.innerHTML = getEditValue(getDefaultValue(this), this);
|
|
24318
24918
|
}
|
|
24319
24919
|
var allowedKeys = e.which === 32 || e.which === 13 || e.which === 8 || e.which === 46;
|
|
24320
24920
|
if (((e.key !== 'shift' && !e.ctrlKey) && e.key && e.key.length === 1 || allowedKeys) || (this.editorMode === 'Markdown'
|
|
@@ -24326,7 +24926,10 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
24326
24926
|
this.notify(toolbarRefresh, { args: e });
|
|
24327
24927
|
}
|
|
24328
24928
|
if (!isNullOrUndefined(this.placeholder)) {
|
|
24329
|
-
this.
|
|
24929
|
+
if (!(e.key === 'Enter' && e.keyCode === 13) && (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
|
|
24930
|
+
this.inputElement.innerHTML === '<br>')) {
|
|
24931
|
+
this.setPlaceHolder();
|
|
24932
|
+
}
|
|
24330
24933
|
}
|
|
24331
24934
|
};
|
|
24332
24935
|
/**
|
|
@@ -24555,22 +25158,16 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
24555
25158
|
}
|
|
24556
25159
|
this.unWireEvents();
|
|
24557
25160
|
if (this.originalElement.tagName === 'TEXTAREA') {
|
|
24558
|
-
if (isBlazor()) {
|
|
24559
|
-
detach(this.valueContainer);
|
|
24560
|
-
this.valueContainer = this.element.querySelector('.e-blazor-hidden.e-control.e-richtexteditor');
|
|
24561
|
-
}
|
|
24562
25161
|
this.element.parentElement.insertBefore(this.valueContainer, this.element);
|
|
24563
25162
|
this.valueContainer.id = this.getID();
|
|
24564
25163
|
this.valueContainer.removeAttribute('name');
|
|
24565
25164
|
detach(this.element);
|
|
24566
25165
|
if (this.originalElement.innerHTML.trim() !== '') {
|
|
24567
|
-
|
|
24568
|
-
|
|
24569
|
-
this.setProperties({ value: (!isNullOrUndefined(this.initialValue) ? this.initialValue : null) }, true);
|
|
24570
|
-
}
|
|
25166
|
+
this.valueContainer.value = this.originalElement.innerHTML.trim();
|
|
25167
|
+
this.setProperties({ value: (!isNullOrUndefined(this.initialValue) ? this.initialValue : null) }, true);
|
|
24571
25168
|
}
|
|
24572
25169
|
else {
|
|
24573
|
-
this.valueContainer.value =
|
|
25170
|
+
this.valueContainer.value = this.valueContainer.defaultValue;
|
|
24574
25171
|
}
|
|
24575
25172
|
this.element = this.valueContainer;
|
|
24576
25173
|
for (var i = 0; i < this.originalElement.classList.length; i++) {
|
|
@@ -24646,12 +25243,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
24646
25243
|
* @returns {Element} - specifies the element.
|
|
24647
25244
|
*/
|
|
24648
25245
|
RichTextEditor.prototype.getContent = function () {
|
|
24649
|
-
|
|
24650
|
-
return this.inputElement;
|
|
24651
|
-
}
|
|
24652
|
-
else {
|
|
24653
|
-
return this.contentModule.getPanel();
|
|
24654
|
-
}
|
|
25246
|
+
return this.contentModule.getPanel();
|
|
24655
25247
|
};
|
|
24656
25248
|
/**
|
|
24657
25249
|
* Returns the text content as string.
|
|
@@ -24723,10 +25315,23 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
24723
25315
|
for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
|
|
24724
25316
|
var prop = _a[_i];
|
|
24725
25317
|
switch (prop) {
|
|
25318
|
+
case 'enterKey':
|
|
24726
25319
|
case 'value': {
|
|
24727
|
-
var nVal =
|
|
25320
|
+
var nVal = void 0;
|
|
25321
|
+
if (prop === 'enterKey') {
|
|
25322
|
+
if (this.value === null || this.value === '<div><br></div>' || this.value === '<p><br></p>' ||
|
|
25323
|
+
this.value === '<br>') {
|
|
25324
|
+
nVal = null;
|
|
25325
|
+
}
|
|
25326
|
+
else {
|
|
25327
|
+
nVal = this.value;
|
|
25328
|
+
}
|
|
25329
|
+
}
|
|
25330
|
+
else {
|
|
25331
|
+
nVal = newProp[prop];
|
|
25332
|
+
}
|
|
24728
25333
|
var val = this.editorMode === 'HTML' ? getEditValue(nVal, this) : nVal;
|
|
24729
|
-
if (!isNullOrUndefined(nVal) && nVal !== '') {
|
|
25334
|
+
if ((!isNullOrUndefined(nVal) && nVal !== '') || prop === 'enterKey') {
|
|
24730
25335
|
this.value = this.serializeValue(((this.enableHtmlEncode) ? this.encode(decode(val)) : val));
|
|
24731
25336
|
}
|
|
24732
25337
|
this.updatePanelValue();
|
|
@@ -24892,7 +25497,18 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
24892
25497
|
getTextArea.value = '';
|
|
24893
25498
|
}
|
|
24894
25499
|
if (this.editorMode === 'HTML') {
|
|
24895
|
-
this.
|
|
25500
|
+
if (this.enterKey === 'DIV') {
|
|
25501
|
+
this.inputElement.innerHTML = '<div><br/></div>';
|
|
25502
|
+
}
|
|
25503
|
+
else if (this.enterKey === 'BR') {
|
|
25504
|
+
this.inputElement.innerHTML = '<br/>';
|
|
25505
|
+
}
|
|
25506
|
+
else {
|
|
25507
|
+
this.inputElement.innerHTML = '<p><br/></p>';
|
|
25508
|
+
if (value === '' && this.formatter && this.inputElement) {
|
|
25509
|
+
this.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(), this.inputElement.firstElementChild, this.inputElement.firstElementChild.childElementCount);
|
|
25510
|
+
}
|
|
25511
|
+
}
|
|
24896
25512
|
}
|
|
24897
25513
|
else {
|
|
24898
25514
|
this.inputElement.value = '';
|
|
@@ -24940,10 +25556,9 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
24940
25556
|
});
|
|
24941
25557
|
}
|
|
24942
25558
|
this.placeHolderWrapper.innerHTML = this.placeholder;
|
|
24943
|
-
if (this.inputElement.textContent.length === 0 &&
|
|
24944
|
-
|
|
24945
|
-
|
|
24946
|
-
this.inputElement.innerHTML !== '<p><br></p><p><br></p>') {
|
|
25559
|
+
if (this.inputElement.textContent.length === 0 && !isNullOrUndefined(this.inputElement.firstChild) && (this.inputElement.firstChild.nodeName === 'BR' ||
|
|
25560
|
+
((this.inputElement.firstChild.nodeName === 'P' || this.inputElement.firstChild.nodeName === 'DIV') && !isNullOrUndefined(this.inputElement.firstChild.firstChild) &&
|
|
25561
|
+
this.inputElement.firstChild.firstChild.nodeName === 'BR'))) {
|
|
24947
25562
|
this.placeHolderWrapper.style.display = 'block';
|
|
24948
25563
|
}
|
|
24949
25564
|
else {
|
|
@@ -25105,6 +25720,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
25105
25720
|
var rendererFactory = this.serviceLocator.getService('rendererFactory');
|
|
25106
25721
|
this.contentModule = rendererFactory.getRenderer(RenderType.Content);
|
|
25107
25722
|
this.fullScreenModule = new FullScreen(this);
|
|
25723
|
+
this.enterKeyModule = new EnterKeyAction(this);
|
|
25108
25724
|
this.renderModule.render();
|
|
25109
25725
|
this.inputElement = this.contentModule.getEditPanel();
|
|
25110
25726
|
this.setHeight(this.height);
|
|
@@ -25174,9 +25790,6 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
25174
25790
|
styleEle.rel = 'stylesheet';
|
|
25175
25791
|
return styleEle;
|
|
25176
25792
|
};
|
|
25177
|
-
RichTextEditor.prototype.isBlazor = function () {
|
|
25178
|
-
return (!isBlazor() ? false : true);
|
|
25179
|
-
};
|
|
25180
25793
|
RichTextEditor.prototype.setValue = function () {
|
|
25181
25794
|
if (this.valueTemplate) {
|
|
25182
25795
|
if (typeof this.valueTemplate === 'string') {
|
|
@@ -25483,7 +26096,8 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
25483
26096
|
this.isFocusOut = false;
|
|
25484
26097
|
addClass([this.element], [CLS_FOCUS]);
|
|
25485
26098
|
if (this.editorMode === 'HTML') {
|
|
25486
|
-
this.cloneValue = (this.inputElement.innerHTML === '<p><br></p>'
|
|
26099
|
+
this.cloneValue = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
|
|
26100
|
+
this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
|
|
25487
26101
|
this.encode(decode(this.inputElement.innerHTML)) : this.inputElement.innerHTML;
|
|
25488
26102
|
}
|
|
25489
26103
|
else {
|
|
@@ -25532,7 +26146,8 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
25532
26146
|
}
|
|
25533
26147
|
var getTextArea = this.element.querySelector('.e-rte-srctextarea');
|
|
25534
26148
|
if (this.editorMode === 'HTML') {
|
|
25535
|
-
value = (this.inputElement.innerHTML === '<p><br></p>'
|
|
26149
|
+
value = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
|
|
26150
|
+
this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
|
|
25536
26151
|
this.encode(decode(this.inputElement.innerHTML)) : this.inputElement.innerHTML;
|
|
25537
26152
|
if (getTextArea && getTextArea.style.display === 'block') {
|
|
25538
26153
|
value = getTextArea.value;
|
|
@@ -25716,7 +26331,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
25716
26331
|
};
|
|
25717
26332
|
RichTextEditor.prototype.resetHandler = function () {
|
|
25718
26333
|
var defaultValue = this.valueContainer.defaultValue.trim();
|
|
25719
|
-
this.setProperties({ value: defaultValue === '' ? null :
|
|
26334
|
+
this.setProperties({ value: defaultValue === '' ? null : defaultValue });
|
|
25720
26335
|
};
|
|
25721
26336
|
/**
|
|
25722
26337
|
* @returns {void}
|
|
@@ -25932,6 +26547,12 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
25932
26547
|
__decorate$1([
|
|
25933
26548
|
Property(null)
|
|
25934
26549
|
], RichTextEditor.prototype, "value", void 0);
|
|
26550
|
+
__decorate$1([
|
|
26551
|
+
Property('P')
|
|
26552
|
+
], RichTextEditor.prototype, "enterKey", void 0);
|
|
26553
|
+
__decorate$1([
|
|
26554
|
+
Property('BR')
|
|
26555
|
+
], RichTextEditor.prototype, "shiftEnterKey", void 0);
|
|
25935
26556
|
__decorate$1([
|
|
25936
26557
|
Property(30)
|
|
25937
26558
|
], RichTextEditor.prototype, "undoRedoSteps", void 0);
|
|
@@ -26129,5 +26750,5 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
26129
26750
|
* Rich Text Editor component exported items
|
|
26130
26751
|
*/
|
|
26131
26752
|
|
|
26132
|
-
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, ViewSource, Table, DialogRenderer, IframeContentRender, MarkdownRender, PopupRenderer, RichTextEditor, RenderType, ToolbarType, DialogType, executeGroup, created, destroyed, load, initialLoad, contentChanged, initialEnd, iframeMouseDown, destroy, toolbarClick, toolbarRefresh, refreshBegin, toolbarUpdated, bindOnEnd, renderColorPicker, htmlToolbarClick, markdownToolbarClick, destroyColorPicker, modelChanged, keyUp, keyDown, mouseUp, toolbarCreated, toolbarRenderComplete, enableFullScreen, disableFullScreen, dropDownSelect, beforeDropDownItemRender, execCommandCallBack, imageToolbarAction, linkToolbarAction, windowResize, resizeStart, onResize, resizeStop, undo, redo, insertLink, unLink, editLink, openLink, actionBegin, actionComplete, updatedToolbarStatus, actionSuccess, updateToolbarItem, insertImage, insertCompleted, imageLeft, imageRight, imageCenter, imageBreak, imageInline, imageLink, imageAlt, imageDelete, imageCaption, imageSize, 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, pasteClean, beforeDialogOpen, clearDialogObj, dialogOpen, beforeDialogClose, dialogClose, beforeQuickToolbarOpen, quickToolbarOpen, quickToolbarClose, popupHide, imageSelected, imageUploading, imageUploadSuccess, imageUploadFailed, imageRemoving, afterImageDelete, drop, xhtmlValidation, beforeImageUpload, resizeInitialized, renderFileManager, beforeImageDrop, dynamicModule, beforePasteCleanup, afterPasteCleanup, updateTbItemsStatus, showLinkDialog, closeLinkDialog, showImageDialog, closeImageDialog, showTableDialog, closeTableDialog, 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_CAPTION, CLS_RTE_CAPTION, CLS_CAPINLINE, CLS_IMGINLINE, 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_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_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, getIndex, hasClass, getDropDownValue, isIDevice, getFormattedFontSize, pageYOffset, getTooltipText, setToolbarStatus, getCollection, getTBarItemsIndex, updateUndoRedoStatus, dispatchEvent, parseHtml, getTextNodesUnder, toObjectLowerCase, getEditValue, updateTextNode, isEditableValueEmpty, decode, sanitizeHelper, convertToBlob, getLocaleFontFormat, updateDropDownFontFormatLocale, ServiceLocator, RendererFactory, EditorManager, IMAGE, 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, CLASS_IMAGE_RIGHT, CLASS_IMAGE_LEFT, CLASS_IMAGE_CENTER, CLASS_IMAGE_BREAK, CLASS_CAPTION, CLASS_RTE_CAPTION, CLASS_CAPTION_INLINE, CLASS_IMAGE_INLINE, Lists, markerClassName, DOMNode, Alignments, Indents, Formats, LinkCommand, InsertMethods, InsertTextExec, InsertHtmlExec, InsertHtml, IsFormatted, MsWordPaste, NodeCutter, ImageCommand, SelectionCommands, SelectionBasedExec, ClearFormatExec, UndoRedoManager, TableCommand, statusCollection, ToolbarStatus, NodeSelection, MarkdownParser, LISTS_COMMAND, selectionCommand, LINK_COMMAND, CLEAR_COMMAND, MD_TABLE, 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 };
|
|
26753
|
+
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, ViewSource, Table, DialogRenderer, IframeContentRender, MarkdownRender, PopupRenderer, RichTextEditor, RenderType, ToolbarType, DialogType, executeGroup, created, destroyed, load, initialLoad, contentChanged, initialEnd, iframeMouseDown, destroy, toolbarClick, toolbarRefresh, refreshBegin, toolbarUpdated, bindOnEnd, renderColorPicker, htmlToolbarClick, markdownToolbarClick, destroyColorPicker, modelChanged, keyUp, keyDown, mouseUp, toolbarCreated, toolbarRenderComplete, enableFullScreen, disableFullScreen, dropDownSelect, beforeDropDownItemRender, execCommandCallBack, imageToolbarAction, linkToolbarAction, windowResize, resizeStart, onResize, resizeStop, undo, redo, insertLink, unLink, editLink, openLink, actionBegin, actionComplete, updatedToolbarStatus, actionSuccess, updateToolbarItem, insertImage, insertCompleted, imageLeft, imageRight, imageCenter, imageBreak, imageInline, imageLink, imageAlt, imageDelete, imageCaption, imageSize, 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, pasteClean, enterHandler, beforeDialogOpen, clearDialogObj, dialogOpen, beforeDialogClose, dialogClose, beforeQuickToolbarOpen, quickToolbarOpen, quickToolbarClose, popupHide, imageSelected, imageUploading, imageUploadSuccess, imageUploadFailed, imageRemoving, afterImageDelete, drop, xhtmlValidation, beforeImageUpload, resizeInitialized, renderFileManager, beforeImageDrop, dynamicModule, beforePasteCleanup, afterPasteCleanup, updateTbItemsStatus, showLinkDialog, closeLinkDialog, showImageDialog, closeImageDialog, showTableDialog, closeTableDialog, 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_CAPTION, CLS_RTE_CAPTION, CLS_CAPINLINE, CLS_IMGINLINE, 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_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_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, 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, 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, CLASS_IMAGE_RIGHT, CLASS_IMAGE_LEFT, CLASS_IMAGE_CENTER, CLASS_IMAGE_BREAK, CLASS_CAPTION, CLASS_RTE_CAPTION, CLASS_CAPTION_INLINE, CLASS_IMAGE_INLINE, Lists, markerClassName, DOMNode, Alignments, Indents, Formats, LinkCommand, InsertMethods, InsertTextExec, InsertHtmlExec, InsertHtml, IsFormatted, MsWordPaste, NodeCutter, ImageCommand, SelectionCommands, SelectionBasedExec, ClearFormatExec, UndoRedoManager, TableCommand, statusCollection, ToolbarStatus, NodeSelection, MarkdownParser, LISTS_COMMAND, selectionCommand, LINK_COMMAND, CLEAR_COMMAND, MD_TABLE, 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 };
|
|
26133
26754
|
//# sourceMappingURL=ej2-richtexteditor.es5.js.map
|