@syncfusion/ej2-richtexteditor 20.3.60 → 20.4.38
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 +16 -1
- package/CHANGELOG.md +0 -24
- package/README.md +53 -45
- package/dist/ej2-richtexteditor.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +316 -182
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +304 -169
- 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 +15 -15
- package/src/editor-manager/plugin/clearformat.js +2 -1
- package/src/editor-manager/plugin/dom-node.js +1 -1
- package/src/editor-manager/plugin/formats.js +1 -0
- package/src/editor-manager/plugin/image.js +1 -0
- package/src/editor-manager/plugin/link.js +3 -1
- package/src/editor-manager/plugin/lists.js +15 -7
- package/src/editor-manager/plugin/ms-word-clean-up.js +6 -2
- package/src/editor-manager/plugin/nodecutter.js +1 -0
- package/src/editor-manager/plugin/selection-commands.js +8 -41
- package/src/editor-manager/plugin/table.js +6 -0
- package/src/editor-manager/plugin/toolbar-status.js +4 -1
- package/src/editor-manager/plugin/video.js +2 -2
- package/src/markdown-parser/plugin/clearformat.js +9 -7
- package/src/markdown-parser/plugin/formats.js +6 -5
- package/src/markdown-parser/plugin/lists.js +5 -0
- package/src/markdown-parser/plugin/markdown-selection.js +3 -0
- package/src/markdown-parser/plugin/md-selection-formats.js +13 -10
- package/src/rich-text-editor/actions/enter-key.js +66 -15
- package/src/rich-text-editor/actions/file-manager.js +1 -0
- package/src/rich-text-editor/actions/html-attributes.js +8 -8
- package/src/rich-text-editor/actions/html-editor.js +2 -0
- package/src/rich-text-editor/actions/keyboard.js +4 -4
- package/src/rich-text-editor/actions/markdown-toolbar-status.js +2 -1
- package/src/rich-text-editor/actions/paste-clean-up.js +2 -1
- package/src/rich-text-editor/actions/toolbar.js +2 -0
- package/src/rich-text-editor/base/constant.d.ts +8 -8
- package/src/rich-text-editor/base/constant.js +8 -8
- package/src/rich-text-editor/base/rich-text-editor.d.ts +2 -0
- package/src/rich-text-editor/base/rich-text-editor.js +45 -10
- package/src/rich-text-editor/base/util.js +9 -9
- package/src/rich-text-editor/renderer/audio-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/audio-module.js +7 -5
- package/src/rich-text-editor/renderer/image-module.js +10 -6
- package/src/rich-text-editor/renderer/link-module.js +5 -4
- package/src/rich-text-editor/renderer/table-module.js +19 -5
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +1 -0
- package/src/rich-text-editor/renderer/toolbar-renderer.js +1 -0
- package/src/rich-text-editor/renderer/video-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/video-module.js +13 -4
- package/src/rich-text-editor/services/renderer-factory.js +4 -4
- package/src/rich-text-editor/services/service-locator.js +4 -4
- package/src/selection/selection.js +2 -0
- package/styles/bootstrap-dark.css +12 -5
- package/styles/bootstrap.css +12 -5
- package/styles/bootstrap4.css +12 -5
- package/styles/bootstrap5-dark.css +12 -5
- package/styles/bootstrap5.css +12 -5
- package/styles/fabric-dark.css +12 -5
- package/styles/fabric.css +12 -5
- package/styles/fluent-dark.css +12 -5
- package/styles/fluent.css +12 -5
- package/styles/highcontrast-light.css +12 -5
- package/styles/highcontrast.css +12 -5
- package/styles/material-dark.css +12 -5
- package/styles/material.css +12 -5
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +1 -0
- package/styles/rich-text-editor/_bootstrap-definition.scss +1 -0
- package/styles/rich-text-editor/_bootstrap4-definition.scss +1 -0
- package/styles/rich-text-editor/_bootstrap5-definition.scss +1 -0
- package/styles/rich-text-editor/_fabric-dark-definition.scss +1 -0
- package/styles/rich-text-editor/_fabric-definition.scss +1 -0
- package/styles/rich-text-editor/_fluent-definition.scss +1 -0
- package/styles/rich-text-editor/_fusionnew-definition.scss +1 -0
- package/styles/rich-text-editor/_highcontrast-definition.scss +1 -0
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +1 -0
- package/styles/rich-text-editor/_material-dark-definition.scss +1 -0
- package/styles/rich-text-editor/_material-definition.scss +1 -0
- package/styles/rich-text-editor/_material3-definition.scss +1 -0
- package/styles/rich-text-editor/_tailwind-definition.scss +1 -0
- package/styles/rich-text-editor/_theme.scss +11 -6
- package/styles/rich-text-editor/bootstrap-dark.css +12 -5
- package/styles/rich-text-editor/bootstrap.css +12 -5
- package/styles/rich-text-editor/bootstrap4.css +12 -5
- package/styles/rich-text-editor/bootstrap5-dark.css +12 -5
- package/styles/rich-text-editor/bootstrap5.css +12 -5
- package/styles/rich-text-editor/fabric-dark.css +12 -5
- package/styles/rich-text-editor/fabric.css +12 -5
- package/styles/rich-text-editor/fluent-dark.css +12 -5
- package/styles/rich-text-editor/fluent.css +12 -5
- package/styles/rich-text-editor/highcontrast-light.css +12 -5
- package/styles/rich-text-editor/highcontrast.css +12 -5
- package/styles/rich-text-editor/material-dark.css +12 -5
- package/styles/rich-text-editor/material.css +12 -5
- package/styles/rich-text-editor/tailwind-dark.css +12 -5
- package/styles/rich-text-editor/tailwind.css +12 -5
- package/styles/tailwind-dark.css +12 -5
- package/styles/tailwind.css +12 -5
|
@@ -580,24 +580,24 @@ var imageRemoving = 'imageRemoving';
|
|
|
580
580
|
*/
|
|
581
581
|
var fileSelected = 'fileSelected';
|
|
582
582
|
/**
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
583
|
+
* @hidden
|
|
584
|
+
* @deprecated
|
|
585
|
+
*/
|
|
586
586
|
var fileUploading = 'fileUploading';
|
|
587
587
|
/**
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
588
|
+
* @hidden
|
|
589
|
+
* @deprecated
|
|
590
|
+
*/
|
|
591
591
|
var fileUploadSuccess = 'fileUploadSuccess';
|
|
592
592
|
/**
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
593
|
+
* @hidden
|
|
594
|
+
* @deprecated
|
|
595
|
+
*/
|
|
596
596
|
var fileUploadFailed = 'fileUploadFailed';
|
|
597
597
|
/**
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
598
|
+
* @hidden
|
|
599
|
+
* @deprecated
|
|
600
|
+
*/
|
|
601
601
|
var fileRemoving = 'fileRemoving';
|
|
602
602
|
/**
|
|
603
603
|
* @hidden
|
|
@@ -2577,7 +2577,7 @@ function pageYOffset(e, parentElement, isIFrame) {
|
|
|
2577
2577
|
*/
|
|
2578
2578
|
function getTooltipText(item, serviceLocator) {
|
|
2579
2579
|
var i10n = serviceLocator.getService('rteLocale');
|
|
2580
|
-
var itemLocale = toolsLocale[item];
|
|
2580
|
+
var itemLocale = toolsLocale["" + item];
|
|
2581
2581
|
var tooltipText = i10n.getConstant(itemLocale);
|
|
2582
2582
|
return tooltipText;
|
|
2583
2583
|
}
|
|
@@ -2600,17 +2600,17 @@ function setToolbarStatus(e, isPopToolbar, self) {
|
|
|
2600
2600
|
var itemStr = item && item.toLocaleLowerCase();
|
|
2601
2601
|
if (item && (itemStr === key) || (item === 'UL' && key === 'unorderedlist') || (item === 'OL' && key === 'orderedlist') ||
|
|
2602
2602
|
(itemStr === 'pre' && key === 'insertcode')) {
|
|
2603
|
-
if (typeof data[key] === 'boolean') {
|
|
2604
|
-
if (data[key] === true) {
|
|
2603
|
+
if (typeof data["" + key] === 'boolean') {
|
|
2604
|
+
if (data["" + key] === true) {
|
|
2605
2605
|
addClass([e.tbElements[j]], [CLS_ACTIVE]);
|
|
2606
2606
|
}
|
|
2607
2607
|
else {
|
|
2608
2608
|
removeClass([e.tbElements[j]], [CLS_ACTIVE]);
|
|
2609
2609
|
}
|
|
2610
2610
|
}
|
|
2611
|
-
else if ((typeof data[key] === 'string' || data[key] === null) &&
|
|
2611
|
+
else if ((typeof data["" + key] === 'string' || data["" + key] === null) &&
|
|
2612
2612
|
getIndex(key, e.parent.toolbarSettings.items) > -1) {
|
|
2613
|
-
var value = ((data[key]) ? data[key] : '');
|
|
2613
|
+
var value = ((data["" + key]) ? data["" + key] : '');
|
|
2614
2614
|
var result = '';
|
|
2615
2615
|
switch (key) {
|
|
2616
2616
|
case 'formats': {
|
|
@@ -2624,7 +2624,7 @@ function setToolbarStatus(e, isPopToolbar, self) {
|
|
|
2624
2624
|
result = getDropDownValue(formatItems$$1, value, 'subCommand', 'text');
|
|
2625
2625
|
dropDown.formatDropDown.content = ('<span style="display: inline-flex;' +
|
|
2626
2626
|
'width:' + e.parent.format.width + '" >' +
|
|
2627
|
-
'<span class="e-rte-dropdown-btn-text' + ' ' + e.parent.cssClass + '">'
|
|
2627
|
+
'<span class="e-rte-dropdown-btn-text' + (isNullOrUndefined(e.parent.cssClass) ? '' : ' ' + e.parent.cssClass) + '">'
|
|
2628
2628
|
+ (isNullOrUndefined(result) ? formatContent : result) +
|
|
2629
2629
|
'</span></span>');
|
|
2630
2630
|
dropDown.formatDropDown.dataBind();
|
|
@@ -2654,7 +2654,7 @@ function setToolbarStatus(e, isPopToolbar, self) {
|
|
|
2654
2654
|
e.tbElements[j].title = name_1;
|
|
2655
2655
|
dropDown.fontNameDropDown.content = ('<span style="display: inline-flex;' +
|
|
2656
2656
|
'width:' + e.parent.fontFamily.width + '" >' +
|
|
2657
|
-
'<span class="e-rte-dropdown-btn-text' + ' ' + e.parent.cssClass + '">'
|
|
2657
|
+
'<span class="e-rte-dropdown-btn-text' + (isNullOrUndefined(e.parent.cssClass) ? '' : ' ' + e.parent.cssClass) + '">'
|
|
2658
2658
|
+ name_1 + '</span></span>');
|
|
2659
2659
|
dropDown.fontNameDropDown.dataBind();
|
|
2660
2660
|
break;
|
|
@@ -2670,7 +2670,7 @@ function setToolbarStatus(e, isPopToolbar, self) {
|
|
|
2670
2670
|
result = getDropDownValue(fontSizeItems, (value === '' ? fontSizeContent.replace(/\s/g, '') : value), 'value', 'text');
|
|
2671
2671
|
dropDown.fontSizeDropDown.content = ('<span style="display: inline-flex;' +
|
|
2672
2672
|
'width:' + e.parent.fontSize.width + '" >' +
|
|
2673
|
-
'<span class="e-rte-dropdown-btn-text' + ' ' + e.parent.cssClass + '">'
|
|
2673
|
+
'<span class="e-rte-dropdown-btn-text' + (isNullOrUndefined(e.parent.cssClass) ? '' : ' ' + e.parent.cssClass) + '">'
|
|
2674
2674
|
+ getFormattedFontSize(result) + '</span></span>');
|
|
2675
2675
|
dropDown.fontSizeDropDown.dataBind();
|
|
2676
2676
|
break;
|
|
@@ -2752,7 +2752,7 @@ function updateUndoRedoStatus(baseToolbar, undoRedoStatus) {
|
|
|
2752
2752
|
var key = keys_2[_i];
|
|
2753
2753
|
var target = tbItems[trgItems[i]];
|
|
2754
2754
|
if (target) {
|
|
2755
|
-
baseToolbar.toolbarObj.enableItems(target, undoRedoStatus[key]);
|
|
2755
|
+
baseToolbar.toolbarObj.enableItems(target, undoRedoStatus["" + key]);
|
|
2756
2756
|
}
|
|
2757
2757
|
i++;
|
|
2758
2758
|
}
|
|
@@ -3304,6 +3304,7 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
|
|
|
3304
3304
|
* @param {IColorPickerModel} args - specifies the arguments.
|
|
3305
3305
|
* @param {string} item - specifies the item.
|
|
3306
3306
|
* @param {ColorPicker} colorPicker - specifies the colorpicker.
|
|
3307
|
+
* @param {string} defaultColor -specifies the defaultColor.
|
|
3307
3308
|
* @returns {void}
|
|
3308
3309
|
* @hidden
|
|
3309
3310
|
* @deprecated
|
|
@@ -4316,8 +4317,8 @@ var ServiceLocator = /** @__PURE__ @class */ (function () {
|
|
|
4316
4317
|
*/
|
|
4317
4318
|
/* eslint-enable */
|
|
4318
4319
|
ServiceLocator.prototype.register = function (name, type) {
|
|
4319
|
-
if (isNullOrUndefined(this.services[name])) {
|
|
4320
|
-
this.services[name] = type;
|
|
4320
|
+
if (isNullOrUndefined(this.services["" + name])) {
|
|
4321
|
+
this.services["" + name] = type;
|
|
4321
4322
|
}
|
|
4322
4323
|
};
|
|
4323
4324
|
/**
|
|
@@ -4329,11 +4330,11 @@ var ServiceLocator = /** @__PURE__ @class */ (function () {
|
|
|
4329
4330
|
* @deprecated
|
|
4330
4331
|
*/
|
|
4331
4332
|
ServiceLocator.prototype.getService = function (name) {
|
|
4332
|
-
if (isNullOrUndefined(this.services[name])) {
|
|
4333
|
+
if (isNullOrUndefined(this.services["" + name])) {
|
|
4333
4334
|
// eslint-disable-next-line
|
|
4334
4335
|
throw "The service " + name + " is not registered";
|
|
4335
4336
|
}
|
|
4336
|
-
return this.services[name];
|
|
4337
|
+
return this.services["" + name];
|
|
4337
4338
|
};
|
|
4338
4339
|
return ServiceLocator;
|
|
4339
4340
|
}());
|
|
@@ -4359,8 +4360,8 @@ var RendererFactory = /** @__PURE__ @class */ (function () {
|
|
|
4359
4360
|
*/
|
|
4360
4361
|
RendererFactory.prototype.addRenderer = function (name, type) {
|
|
4361
4362
|
var rName = getEnumValue(RenderType, name);
|
|
4362
|
-
if (isNullOrUndefined(this.rendererMap[rName])) {
|
|
4363
|
-
this.rendererMap[rName] = type;
|
|
4363
|
+
if (isNullOrUndefined(this.rendererMap["" + rName])) {
|
|
4364
|
+
this.rendererMap["" + rName] = type;
|
|
4364
4365
|
}
|
|
4365
4366
|
};
|
|
4366
4367
|
/**
|
|
@@ -4373,12 +4374,12 @@ var RendererFactory = /** @__PURE__ @class */ (function () {
|
|
|
4373
4374
|
*/
|
|
4374
4375
|
RendererFactory.prototype.getRenderer = function (name) {
|
|
4375
4376
|
var rName = getEnumValue(RenderType, name);
|
|
4376
|
-
if (isNullOrUndefined(this.rendererMap[rName])) {
|
|
4377
|
+
if (isNullOrUndefined(this.rendererMap["" + rName])) {
|
|
4377
4378
|
// eslint-disable-next-line
|
|
4378
4379
|
throw "The renderer " + rName + " is not found";
|
|
4379
4380
|
}
|
|
4380
4381
|
else {
|
|
4381
|
-
return this.rendererMap[rName];
|
|
4382
|
+
return this.rendererMap["" + rName];
|
|
4382
4383
|
}
|
|
4383
4384
|
};
|
|
4384
4385
|
return RendererFactory;
|
|
@@ -4581,6 +4582,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
4581
4582
|
this.isTransformChild = false;
|
|
4582
4583
|
var transformElements = selectAll('[style*="transform"]', document);
|
|
4583
4584
|
for (var i = 0; i < transformElements.length; i++) {
|
|
4585
|
+
// eslint-disable-next-line max-len
|
|
4584
4586
|
if (!isNullOrUndefined(transformElements[i].contains) && transformElements[i].contains(this.parent.element)) {
|
|
4585
4587
|
this.isTransformChild = true;
|
|
4586
4588
|
break;
|
|
@@ -5079,6 +5081,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5079
5081
|
this.parent.off(toolbarClick, this.toolbarClickHandler);
|
|
5080
5082
|
}
|
|
5081
5083
|
};
|
|
5084
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
5082
5085
|
Toolbar$$1.prototype.setCssClass = function (e) {
|
|
5083
5086
|
if (this.toolbarObj && e.cssClass) {
|
|
5084
5087
|
if (isNullOrUndefined(e.oldCssClass)) {
|
|
@@ -5263,7 +5266,7 @@ var KeyboardEvents$1 = /** @__PURE__ @class */ (function (_super) {
|
|
|
5263
5266
|
var keys = Object.keys(_this.keyConfigs);
|
|
5264
5267
|
for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
|
|
5265
5268
|
var key = keys_1[_i];
|
|
5266
|
-
var configCollection = _this.keyConfigs[key].split(',');
|
|
5269
|
+
var configCollection = _this.keyConfigs["" + key].split(',');
|
|
5267
5270
|
for (var _a = 0, configCollection_1 = configCollection; _a < configCollection_1.length; _a++) {
|
|
5268
5271
|
var rconfig = configCollection_1[_a];
|
|
5269
5272
|
var rKeyObj = KeyboardEvents_1.getKeyConfigData(rconfig.trim());
|
|
@@ -5337,7 +5340,7 @@ var KeyboardEvents$1 = /** @__PURE__ @class */ (function (_super) {
|
|
|
5337
5340
|
*/
|
|
5338
5341
|
KeyboardEvents$$1.getKeyConfigData = function (config) {
|
|
5339
5342
|
if (config in this.configCache) {
|
|
5340
|
-
return this.configCache[config];
|
|
5343
|
+
return this.configCache["" + config];
|
|
5341
5344
|
}
|
|
5342
5345
|
var keys = config.toLowerCase().split('+');
|
|
5343
5346
|
var keyData = {
|
|
@@ -5352,12 +5355,12 @@ var KeyboardEvents$1 = /** @__PURE__ @class */ (function (_super) {
|
|
|
5352
5355
|
else {
|
|
5353
5356
|
keyData.keyCode = KeyboardEvents_1.getKeyCode(keys[keys.length - 1]);
|
|
5354
5357
|
}
|
|
5355
|
-
KeyboardEvents_1.configCache[config] = keyData;
|
|
5358
|
+
KeyboardEvents_1.configCache["" + config] = keyData;
|
|
5356
5359
|
return keyData;
|
|
5357
5360
|
};
|
|
5358
5361
|
// Return the keycode value as string
|
|
5359
5362
|
KeyboardEvents$$1.getKeyCode = function (keyVal) {
|
|
5360
|
-
return keyCode[keyVal] || keyVal.toUpperCase().charCodeAt(0);
|
|
5363
|
+
return keyCode["" + keyVal] || keyVal.toUpperCase().charCodeAt(0);
|
|
5361
5364
|
};
|
|
5362
5365
|
var KeyboardEvents_1;
|
|
5363
5366
|
KeyboardEvents$$1.configCache = {};
|
|
@@ -6904,7 +6907,9 @@ var MarkdownSelection = /** @__PURE__ @class */ (function () {
|
|
|
6904
6907
|
var isStart = false;
|
|
6905
6908
|
if (line) {
|
|
6906
6909
|
var reg = line.trim() === command.trim() ?
|
|
6910
|
+
// eslint-disable-next-line
|
|
6907
6911
|
new RegExp('^(' + this.replaceSpecialChar(command.trim()) + ')', 'gim') :
|
|
6912
|
+
// eslint-disable-next-line
|
|
6908
6913
|
new RegExp('^(' + this.replaceSpecialChar(command) + ')', 'gim');
|
|
6909
6914
|
isStart = reg.test(line.trim());
|
|
6910
6915
|
}
|
|
@@ -6934,6 +6939,7 @@ var MarkdownSelection = /** @__PURE__ @class */ (function () {
|
|
|
6934
6939
|
MarkdownSelection.prototype.isClear = function (parents, regex) {
|
|
6935
6940
|
var isClear = false;
|
|
6936
6941
|
for (var i = 0; i < parents.length; i++) {
|
|
6942
|
+
// eslint-disable-next-line
|
|
6937
6943
|
if (new RegExp(regex, 'gim').test(parents[i].text)) {
|
|
6938
6944
|
return true;
|
|
6939
6945
|
}
|
|
@@ -7184,7 +7190,7 @@ var MarkdownToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
7184
7190
|
}
|
|
7185
7191
|
else {
|
|
7186
7192
|
for (var i = 0; i < lines.length; i++) {
|
|
7187
|
-
if (!this.selection.isStartWith(lines[i].text, this.parent.formatter.listTags[type])) {
|
|
7193
|
+
if (!this.selection.isStartWith(lines[i].text, this.parent.formatter.listTags["" + type])) {
|
|
7188
7194
|
isApply = false;
|
|
7189
7195
|
break;
|
|
7190
7196
|
}
|
|
@@ -7244,6 +7250,7 @@ var MarkdownToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
7244
7250
|
return text.search('\\' + cmd + '') !== -1;
|
|
7245
7251
|
};
|
|
7246
7252
|
MarkdownToolbarStatus.prototype.multiCharRegx = function (cmd) {
|
|
7253
|
+
// eslint-disable-next-line
|
|
7247
7254
|
return new RegExp('(\\' + cmd + ')', 'g');
|
|
7248
7255
|
};
|
|
7249
7256
|
return MarkdownToolbarStatus;
|
|
@@ -7703,6 +7710,7 @@ var MDLists = /** @__PURE__ @class */ (function () {
|
|
|
7703
7710
|
var regex = this.getListRegex();
|
|
7704
7711
|
this.currentAction = this.getAction(parents[0].text);
|
|
7705
7712
|
for (var i = 0; i < parents.length; i++) {
|
|
7713
|
+
// eslint-disable-next-line max-len
|
|
7706
7714
|
var prevIndex = event.event.shiftKey ? parents[i].line - 1 : parents[i].line - 1;
|
|
7707
7715
|
var prevLine = this.selection.getLine(textArea, prevIndex);
|
|
7708
7716
|
if (prevLine && (!event.event.shiftKey && isNotFirst || (event.event.shiftKey))) {
|
|
@@ -7750,6 +7758,7 @@ var MDLists = /** @__PURE__ @class */ (function () {
|
|
|
7750
7758
|
addedLength += tabSpaceLength;
|
|
7751
7759
|
if (parents.length !== 1) {
|
|
7752
7760
|
for (var j = i; j < parents.length; j++) {
|
|
7761
|
+
// eslint-disable-next-line max-len
|
|
7753
7762
|
parents[j].start = j !== 0 ? parents[j].start + tabSpaceLength : parents[j].start;
|
|
7754
7763
|
parents[j].end = parents[j].end + tabSpaceLength;
|
|
7755
7764
|
}
|
|
@@ -7880,6 +7889,7 @@ var MDLists = /** @__PURE__ @class */ (function () {
|
|
|
7880
7889
|
var ol = line.split('. ')[0];
|
|
7881
7890
|
// eslint-disable-next-line
|
|
7882
7891
|
var currentState = /^\d+$/.test(ol.trim());
|
|
7892
|
+
// eslint-disable-next-line
|
|
7883
7893
|
var ul = line.trim().split(new RegExp('^(' + this.selection.replaceSpecialChar(this.syntax.UL).trim() + ')'))[1];
|
|
7884
7894
|
return (currentState ? 'OL' : ul ? 'UL' : 'NOTLIST');
|
|
7885
7895
|
};
|
|
@@ -8039,6 +8049,7 @@ var MDLists = /** @__PURE__ @class */ (function () {
|
|
|
8039
8049
|
};
|
|
8040
8050
|
MDLists.prototype.appliedLine = function (line, prefixPattern, perfixObj, preTabSpaceLength) {
|
|
8041
8051
|
var points = {};
|
|
8052
|
+
// eslint-disable-next-line
|
|
8042
8053
|
var regex = new RegExp('^[' + this.syntax.UL.trim() + ']');
|
|
8043
8054
|
var lineSplit = line.split('. ');
|
|
8044
8055
|
var currentPrefix = lineSplit[0] + '. ';
|
|
@@ -8101,6 +8112,7 @@ var MDLists = /** @__PURE__ @class */ (function () {
|
|
|
8101
8112
|
regex += regex === '' ? '^(' + syntax + ')|^(' + syntax.trim() + ')' :
|
|
8102
8113
|
'|^(' + syntax + ')|^(' + syntax.trim() + ')';
|
|
8103
8114
|
}
|
|
8115
|
+
// eslint-disable-next-line
|
|
8104
8116
|
return new RegExp(regex);
|
|
8105
8117
|
};
|
|
8106
8118
|
return MDLists;
|
|
@@ -8226,6 +8238,7 @@ var MDFormats = /** @__PURE__ @class */ (function () {
|
|
|
8226
8238
|
if (configKey[j] === command) {
|
|
8227
8239
|
continue;
|
|
8228
8240
|
}
|
|
8241
|
+
// eslint-disable-next-line
|
|
8229
8242
|
var regex = new RegExp('^(' + this.selection.replaceSpecialChar(removeText) + ')', 'gim');
|
|
8230
8243
|
if (regex.test(parents[i].text)) {
|
|
8231
8244
|
parents[i].text = parents[i].text.replace(regex, '');
|
|
@@ -8268,14 +8281,14 @@ var MDFormats = /** @__PURE__ @class */ (function () {
|
|
|
8268
8281
|
!this.selection.isStartWith(lastNextText, this.syntax.pre.split('\n')[0])) {
|
|
8269
8282
|
var lines = textArea.value.substring(start, end).split('\n');
|
|
8270
8283
|
var lastLine = lines[lines.length - 1] === '' ? '' : '\n';
|
|
8271
|
-
textArea.value = textArea.value.substr(0, start) + this.syntax[command] + textArea.value.substring(start, end) +
|
|
8272
|
-
lastLine + this.syntax[command] +
|
|
8284
|
+
textArea.value = textArea.value.substr(0, start) + this.syntax["" + command] + textArea.value.substring(start, end) +
|
|
8285
|
+
lastLine + this.syntax["" + command] +
|
|
8273
8286
|
textArea.value.substr(end, textArea.value.length);
|
|
8274
|
-
start = this.selection.selectionStart + this.syntax[command].length;
|
|
8275
|
-
end = this.selection.selectionEnd + this.syntax[command].length - 1;
|
|
8287
|
+
start = this.selection.selectionStart + this.syntax["" + command].length;
|
|
8288
|
+
end = this.selection.selectionEnd + this.syntax["" + command].length - 1;
|
|
8276
8289
|
}
|
|
8277
8290
|
else {
|
|
8278
|
-
var cmd = this.syntax[command];
|
|
8291
|
+
var cmd = this.syntax["" + command];
|
|
8279
8292
|
var selection = this.parent.markdownSelection.getSelectedInlinePoints(textArea);
|
|
8280
8293
|
var startNo = textArea.value.substr(0, textArea.selectionStart).lastIndexOf(cmd);
|
|
8281
8294
|
var endNo = textArea.value.substr(textArea.selectionEnd, textArea.selectionEnd).indexOf(cmd);
|
|
@@ -8403,9 +8416,11 @@ var MDSelectionFormats = /** @__PURE__ @class */ (function () {
|
|
|
8403
8416
|
return matchText;
|
|
8404
8417
|
};
|
|
8405
8418
|
MDSelectionFormats.prototype.multiCharRegx = function (cmd) {
|
|
8419
|
+
// eslint-disable-next-line
|
|
8406
8420
|
return new RegExp('(\\' + cmd + '\\' + cmd + ')', 'g');
|
|
8407
8421
|
};
|
|
8408
8422
|
MDSelectionFormats.prototype.singleCharRegx = function (cmd) {
|
|
8423
|
+
// eslint-disable-next-line
|
|
8409
8424
|
return new RegExp('(\\' + cmd + ')', 'g');
|
|
8410
8425
|
};
|
|
8411
8426
|
MDSelectionFormats.prototype.isAppliedCommand = function (cmd) {
|
|
@@ -8593,22 +8608,22 @@ var MDSelectionFormats = /** @__PURE__ @class */ (function () {
|
|
|
8593
8608
|
}
|
|
8594
8609
|
};
|
|
8595
8610
|
MDSelectionFormats.prototype.textReplace = function (text, command) {
|
|
8596
|
-
var regx = this.singleCharRegx(this.syntax[command]);
|
|
8611
|
+
var regx = this.singleCharRegx(this.syntax["" + command]);
|
|
8597
8612
|
switch (command) {
|
|
8598
8613
|
case 'Bold':
|
|
8599
|
-
regx = this.multiCharRegx(this.syntax[command].substr(0, 1));
|
|
8614
|
+
regx = this.multiCharRegx(this.syntax["" + command].substr(0, 1));
|
|
8600
8615
|
text = text.replace(regx, '');
|
|
8601
8616
|
break;
|
|
8602
8617
|
case 'Italic':
|
|
8603
|
-
if (!this.isBold(text, this.syntax[command].substr(0, 1))) {
|
|
8618
|
+
if (!this.isBold(text, this.syntax["" + command].substr(0, 1))) {
|
|
8604
8619
|
text = text.replace(regx, '');
|
|
8605
8620
|
}
|
|
8606
8621
|
else {
|
|
8607
|
-
var regxB = this.multiCharRegx(this.syntax[command].substr(0, 1));
|
|
8622
|
+
var regxB = this.multiCharRegx(this.syntax["" + command].substr(0, 1));
|
|
8608
8623
|
var repText = text;
|
|
8609
8624
|
repText = repText.replace(regxB, '$%@').replace(regx, '');
|
|
8610
8625
|
var regxTemp = new RegExp('\\$%@', 'g');
|
|
8611
|
-
text = repText.replace(regxTemp, this.syntax[command].substr(0, 1) + this.syntax[command].substr(0, 1));
|
|
8626
|
+
text = repText.replace(regxTemp, this.syntax["" + command].substr(0, 1) + this.syntax["" + command].substr(0, 1));
|
|
8612
8627
|
}
|
|
8613
8628
|
break;
|
|
8614
8629
|
case 'StrikeThrough':
|
|
@@ -8627,23 +8642,24 @@ var MDSelectionFormats = /** @__PURE__ @class */ (function () {
|
|
|
8627
8642
|
return text;
|
|
8628
8643
|
};
|
|
8629
8644
|
MDSelectionFormats.prototype.isApplied = function (line, command) {
|
|
8630
|
-
var regx = this.singleCharRegx(this.syntax[command]);
|
|
8645
|
+
var regx = this.singleCharRegx(this.syntax["" + command]);
|
|
8631
8646
|
switch (command) {
|
|
8632
8647
|
case 'SubScript':
|
|
8633
8648
|
case 'SuperScript':
|
|
8634
|
-
regx = this.singleCharRegx(this.syntax[command]);
|
|
8649
|
+
regx = this.singleCharRegx(this.syntax["" + command]);
|
|
8635
8650
|
return regx.test(line.text);
|
|
8636
8651
|
case 'Bold':
|
|
8637
8652
|
case 'StrikeThrough':
|
|
8638
|
-
regx = this.multiCharRegx(this.syntax[command].substr(0, 1));
|
|
8653
|
+
regx = this.multiCharRegx(this.syntax["" + command].substr(0, 1));
|
|
8639
8654
|
return regx.test(line.text);
|
|
8640
8655
|
case 'UpperCase':
|
|
8641
8656
|
case 'LowerCase':
|
|
8642
|
-
|
|
8657
|
+
// eslint-disable-next-line
|
|
8658
|
+
regx = new RegExp('^[' + this.syntax["" + command] + ']*$', 'g');
|
|
8643
8659
|
return regx.test(line.text);
|
|
8644
8660
|
case 'Italic': {
|
|
8645
8661
|
var regTest = void 0;
|
|
8646
|
-
var regxB = this.multiCharRegx(this.syntax[command].substr(0, 1));
|
|
8662
|
+
var regxB = this.multiCharRegx(this.syntax["" + command].substr(0, 1));
|
|
8647
8663
|
if (regxB.test(line.text)) {
|
|
8648
8664
|
var repText = line.text;
|
|
8649
8665
|
repText = repText.replace(regxB, '$%#');
|
|
@@ -9301,23 +9317,25 @@ var ClearFormat = /** @__PURE__ @class */ (function () {
|
|
|
9301
9317
|
var key = keys[num];
|
|
9302
9318
|
// eslint-disable-next-line
|
|
9303
9319
|
if (data.hasOwnProperty(key) && data[key] !== '') {
|
|
9304
|
-
var expString = this.replaceRegex(data[key]);
|
|
9320
|
+
var expString = this.replaceRegex(data["" + key]);
|
|
9305
9321
|
var regExp = void 0;
|
|
9306
|
-
var startExp = data[key].length;
|
|
9307
|
-
var endExp = (data[key] === '<sup>' || data[key] === '<sub>') ? data[key].length + 1 : data[key].length;
|
|
9308
|
-
if (data[key] === '<sup>') {
|
|
9322
|
+
var startExp = data["" + key].length;
|
|
9323
|
+
var endExp = (data["" + key] === '<sup>' || data["" + key] === '<sub>') ? data["" + key].length + 1 : data["" + key].length;
|
|
9324
|
+
if (data["" + key] === '<sup>') {
|
|
9309
9325
|
// eslint-disable-next-line
|
|
9310
9326
|
regExp = new RegExp('<sup>(.*?)<\/sup>', 'ig');
|
|
9311
9327
|
}
|
|
9312
|
-
else if (data[key] === '<sub>') {
|
|
9328
|
+
else if (data["" + key] === '<sub>') {
|
|
9313
9329
|
// eslint-disable-next-line
|
|
9314
9330
|
regExp = new RegExp('<sub>(.*?)<\/sub>', 'ig');
|
|
9315
9331
|
}
|
|
9316
9332
|
else {
|
|
9333
|
+
// eslint-disable-next-line
|
|
9317
9334
|
regExp = new RegExp(expString + '(.*?)' + expString, 'ig');
|
|
9318
9335
|
}
|
|
9319
9336
|
var val = text.match(regExp);
|
|
9320
9337
|
for (var index = 0; val && index < val.length && val[index] !== ''; index++) {
|
|
9338
|
+
// eslint-disable-next-line max-len
|
|
9321
9339
|
text = text.replace(val[index], val[index].substr(startExp, val[index].length - endExp - startExp));
|
|
9322
9340
|
}
|
|
9323
9341
|
}
|
|
@@ -9339,8 +9357,8 @@ var ClearFormat = /** @__PURE__ @class */ (function () {
|
|
|
9339
9357
|
var key = keys[index];
|
|
9340
9358
|
// eslint-disable-next-line
|
|
9341
9359
|
if (data.hasOwnProperty(key) && data[key] !== '') {
|
|
9342
|
-
if (lines[len].indexOf(data[key]) === 0) {
|
|
9343
|
-
lines[len] = lines[len].replace(data[key], '');
|
|
9360
|
+
if (lines[len].indexOf(data["" + key]) === 0) {
|
|
9361
|
+
lines[len] = lines[len].replace(data["" + key], '');
|
|
9344
9362
|
lines[len] = this.clearFormatLines([lines[len]]);
|
|
9345
9363
|
}
|
|
9346
9364
|
}
|
|
@@ -10144,6 +10162,7 @@ var NodeSelection = /** @__PURE__ @class */ (function () {
|
|
|
10144
10162
|
*/
|
|
10145
10163
|
NodeSelection.prototype.getSelectionNodes = function (nodeCollection) {
|
|
10146
10164
|
nodeCollection = nodeCollection.reverse();
|
|
10165
|
+
// eslint-disable-next-line
|
|
10147
10166
|
var regEx = new RegExp(String.fromCharCode(8203), 'g');
|
|
10148
10167
|
for (var index = 0; index < nodeCollection.length; index++) {
|
|
10149
10168
|
if (nodeCollection[index].nodeType !== 3 || (nodeCollection[index].textContent.trim() === '' ||
|
|
@@ -10164,6 +10183,7 @@ var NodeSelection = /** @__PURE__ @class */ (function () {
|
|
|
10164
10183
|
*/
|
|
10165
10184
|
NodeSelection.prototype.getSelectionNodesBr = function (nodeCollection) {
|
|
10166
10185
|
nodeCollection = nodeCollection.reverse();
|
|
10186
|
+
// eslint-disable-next-line
|
|
10167
10187
|
var regEx = new RegExp(String.fromCharCode(8203), 'g');
|
|
10168
10188
|
for (var index = 0; index < nodeCollection.length; index++) {
|
|
10169
10189
|
if (nodeCollection[index].nodeName !== 'BR' &&
|
|
@@ -10497,7 +10517,7 @@ var DOMNode = /** @__PURE__ @class */ (function () {
|
|
|
10497
10517
|
var orderRawAttr = Object.keys(rawAttr).sort();
|
|
10498
10518
|
for (var e = 0; e < orderRawAttr.length; e++) {
|
|
10499
10519
|
var attrKey = orderRawAttr[e];
|
|
10500
|
-
var attrValue = rawAttr[attrKey];
|
|
10520
|
+
var attrValue = rawAttr["" + attrKey];
|
|
10501
10521
|
/* eslint-disable */
|
|
10502
10522
|
if (attrValue.indexOf("'") < 0 && attrValue.indexOf('"') >= 0) {
|
|
10503
10523
|
attr += ' ' + attrKey + "='" + attrValue + "'";
|
|
@@ -11249,8 +11269,15 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
11249
11269
|
range.startContainer.parentElement.closest('LI');
|
|
11250
11270
|
var endNode = range.endContainer.nodeName === 'LI' ? range.endContainer :
|
|
11251
11271
|
range.endContainer.parentElement.closest('LI');
|
|
11272
|
+
// Checks for Image, Audio , Video Element inside List Element
|
|
11273
|
+
var hasMediaElem = false;
|
|
11274
|
+
if (!isNullOrUndefined(startNode)) {
|
|
11275
|
+
var videoElemList = startNode.querySelectorAll('.e-video-clickelem');
|
|
11276
|
+
var embedVideoElem = videoElemList.length > 0 && videoElemList[0].childNodes[0].nodeName === 'IFRAME';
|
|
11277
|
+
hasMediaElem = startNode.querySelectorAll('IMG').length > 0 || startNode.querySelectorAll('AUDIO').length > 0 || startNode.querySelectorAll('VIDEO').length > 0 || embedVideoElem;
|
|
11278
|
+
}
|
|
11252
11279
|
if (!isNullOrUndefined(startNode) && !isNullOrUndefined(endNode) && startNode === endNode && startNode.tagName === 'LI' &&
|
|
11253
|
-
startNode.textContent.trim() === '' &&
|
|
11280
|
+
startNode.textContent.trim() === '' && !hasMediaElem) {
|
|
11254
11281
|
if (startNode.innerHTML.indexOf(' ') >= 0) {
|
|
11255
11282
|
return;
|
|
11256
11283
|
}
|
|
@@ -11287,7 +11314,6 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
11287
11314
|
}
|
|
11288
11315
|
}
|
|
11289
11316
|
};
|
|
11290
|
-
// eslint-disable-next-line
|
|
11291
11317
|
Lists.prototype.backspaceList = function (e) {
|
|
11292
11318
|
var range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
|
|
11293
11319
|
var startNode = this.parent.domNode.getSelectedNode(range.startContainer, range.startOffset);
|
|
@@ -11373,7 +11399,8 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
11373
11399
|
detach(currentLIElem);
|
|
11374
11400
|
}
|
|
11375
11401
|
};
|
|
11376
|
-
|
|
11402
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11403
|
+
Lists.prototype.firstListBackSpace = function (range, _e) {
|
|
11377
11404
|
var startNode = this.parent.domNode.getSelectedNode(range.startContainer, range.startOffset);
|
|
11378
11405
|
if (!isNullOrUndefined(startNode.closest('OL'))) {
|
|
11379
11406
|
this.commonLIParent = startNode.closest('OL');
|
|
@@ -11636,6 +11663,7 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
11636
11663
|
range.startOffset]) || range.startContainer);
|
|
11637
11664
|
var endNode = (range.endContainer.childNodes[(range.endOffset > 0) ? (range.endOffset - 1) :
|
|
11638
11665
|
range.endOffset] || range.endContainer);
|
|
11666
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11639
11667
|
var lastSelectionNode = endNode.lastChild.nodeName === 'BR' ? (isNullOrUndefined(endNode.lastChild.previousSibling) ? endNode
|
|
11640
11668
|
: endNode.lastChild.previousSibling) : endNode.lastChild;
|
|
11641
11669
|
while (!isNullOrUndefined(lastSelectionNode) && lastSelectionNode.nodeName !== '#text' && lastSelectionNode.nodeName !== 'IMG' &&
|
|
@@ -11776,8 +11804,8 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
11776
11804
|
var openTag = '<' + type + '>';
|
|
11777
11805
|
var closeTag = '</' + type + '>';
|
|
11778
11806
|
var newTag = 'li' + elemAtt;
|
|
11779
|
-
var replaceHTML = (elements[i].tagName.toLowerCase() === DEFAULT_TAG ?
|
|
11780
|
-
elements[i].outerHTML);
|
|
11807
|
+
var replaceHTML = (elements[i].tagName.toLowerCase() === DEFAULT_TAG ?
|
|
11808
|
+
elements[i].innerHTML : elements[i].outerHTML);
|
|
11781
11809
|
var innerHTML = this.domNode.createTagString(newTag, null, replaceHTML);
|
|
11782
11810
|
var collectionString = openTag + innerHTML + closeTag;
|
|
11783
11811
|
this.domNode.replaceWith(elements[i], collectionString);
|
|
@@ -11788,8 +11816,8 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
11788
11816
|
var openTag = '<' + type + elemAtt + '>';
|
|
11789
11817
|
var closeTag = '</' + type + '>';
|
|
11790
11818
|
var newTag = 'li';
|
|
11791
|
-
var replaceHTML = (elements[i].tagName.toLowerCase() === DEFAULT_TAG ?
|
|
11792
|
-
elements[i].outerHTML);
|
|
11819
|
+
var replaceHTML = (elements[i].tagName.toLowerCase() === DEFAULT_TAG ?
|
|
11820
|
+
elements[i].innerHTML : elements[i].outerHTML);
|
|
11793
11821
|
var innerHTML = this.domNode.createTagString(newTag, null, replaceHTML);
|
|
11794
11822
|
var collectionString = openTag + innerHTML + closeTag;
|
|
11795
11823
|
this.domNode.replaceWith(elements[i], collectionString);
|
|
@@ -12192,6 +12220,7 @@ var NodeCutter = /** @__PURE__ @class */ (function () {
|
|
|
12192
12220
|
for (var i = 0; !isNullOrUndefined(firstChild.childNodes) && i < firstChild.childNodes.length; i++) {
|
|
12193
12221
|
if (firstChild.childNodes[i].nodeName === 'IMG' || (firstChild.childNodes[i].nodeName === 'SPAN' &&
|
|
12194
12222
|
(firstChild.childNodes[i].classList.contains('e-video-wrap') ||
|
|
12223
|
+
firstChild.childNodes[i].classList.contains('e-embed-video-wrap') ||
|
|
12195
12224
|
firstChild.childNodes[i].classList.contains('e-audio-wrap')))) {
|
|
12196
12225
|
result = false;
|
|
12197
12226
|
}
|
|
@@ -12406,6 +12435,7 @@ var Formats = /** @__PURE__ @class */ (function () {
|
|
|
12406
12435
|
}
|
|
12407
12436
|
};
|
|
12408
12437
|
Formats.prototype.removeCodeContent = function (range) {
|
|
12438
|
+
// eslint-disable-next-line
|
|
12409
12439
|
var regEx = new RegExp(String.fromCharCode(65279), 'g');
|
|
12410
12440
|
if (!isNullOrUndefined(range.endContainer.textContent.match(regEx))) {
|
|
12411
12441
|
var pointer = range.endContainer.textContent.charCodeAt(range.endOffset - 1) === 65279 ?
|
|
@@ -13310,7 +13340,8 @@ var LinkCommand = /** @__PURE__ @class */ (function () {
|
|
|
13310
13340
|
finalinlineNodes[j_1] = inlineNodes[i];
|
|
13311
13341
|
}
|
|
13312
13342
|
if (inlineNodes.length > 1 && i < inlineNodes.length - 1) {
|
|
13313
|
-
if ((inlineNodes[i].parentElement === inlineNodes[i + 1].parentElement) &&
|
|
13343
|
+
if ((inlineNodes[i].parentElement === inlineNodes[i + 1].parentElement) &&
|
|
13344
|
+
(inlineNodes[i] === inlineNodes[i + 1])) {
|
|
13314
13345
|
continue;
|
|
13315
13346
|
}
|
|
13316
13347
|
else {
|
|
@@ -13407,6 +13438,7 @@ var LinkCommand = /** @__PURE__ @class */ (function () {
|
|
|
13407
13438
|
return arr.join(' ') + ' ';
|
|
13408
13439
|
};
|
|
13409
13440
|
LinkCommand.prototype.openLink = function (e) {
|
|
13441
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
|
13410
13442
|
document.defaultView.open(e.item.url, e.item.target);
|
|
13411
13443
|
this.callBack(e);
|
|
13412
13444
|
};
|
|
@@ -13874,6 +13906,7 @@ var ImageCommand = /** @__PURE__ @class */ (function () {
|
|
|
13874
13906
|
this.callBack(e);
|
|
13875
13907
|
};
|
|
13876
13908
|
ImageCommand.prototype.openImageLink = function (e) {
|
|
13909
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
|
13877
13910
|
document.defaultView.open(e.item.url, e.item.target);
|
|
13878
13911
|
this.callBack(e);
|
|
13879
13912
|
};
|
|
@@ -14360,8 +14393,8 @@ var VideoCommand = /** @__PURE__ @class */ (function () {
|
|
|
14360
14393
|
videoElm_1.load();
|
|
14361
14394
|
}
|
|
14362
14395
|
if (Browser.userAgent.indexOf('Firefox') !== -1) {
|
|
14363
|
-
vidElement.addEventListener('play', function (
|
|
14364
|
-
vidElement.addEventListener('pause', function (
|
|
14396
|
+
vidElement.addEventListener('play', function () { _this.editAreaVideoClick(e); });
|
|
14397
|
+
vidElement.addEventListener('pause', function () { _this.editAreaVideoClick(e); });
|
|
14365
14398
|
}
|
|
14366
14399
|
}
|
|
14367
14400
|
};
|
|
@@ -14601,6 +14634,7 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
14601
14634
|
var newRow = createElement('tr');
|
|
14602
14635
|
var isHeaderSelect = this.curTable.querySelectorAll('th.e-cell-select').length > 0;
|
|
14603
14636
|
for (var i = 0; i < allCells[minVal].length; i++) {
|
|
14637
|
+
// eslint-disable-next-line max-len
|
|
14604
14638
|
if (isBelow && minVal < allCells.length - 1 && allCells[minVal][i] === allCells[minVal + 1][i] ||
|
|
14605
14639
|
!isBelow && 0 < minVal && allCells[minVal][i] === allCells[minVal - 1][i]) {
|
|
14606
14640
|
if (0 === i || 0 < i && allCells[minVal][i] !== allCells[minVal][i - 1]) {
|
|
@@ -14780,10 +14814,12 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
14780
14814
|
1 === rowSpanVal ? allCells[maxI][j].removeAttribute('rowspan') : allCells[maxI][j].setAttribute('rowspan', rowSpanVal.toString());
|
|
14781
14815
|
}
|
|
14782
14816
|
}
|
|
14817
|
+
// eslint-disable-next-line max-len
|
|
14783
14818
|
if (maxI < allCells.length - 1 && allCells[maxI][j] === allCells[maxI + 1][j] && (0 === maxI ||
|
|
14784
14819
|
allCells[maxI][j] !== allCells[maxI - 1][j])) {
|
|
14785
14820
|
var element = allCells[maxI][j];
|
|
14786
14821
|
var index = void 0;
|
|
14822
|
+
// eslint-disable-next-line max-len
|
|
14787
14823
|
for (index = j; 0 < index && allCells[maxI][index] === allCells[maxI][index - 1]; index--) {
|
|
14788
14824
|
if (index === 0) {
|
|
14789
14825
|
this.curTable.rows[maxI + 1].prepend(element);
|
|
@@ -14996,6 +15032,7 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
14996
15032
|
for (rowValue = min; rowValue <= max; rowValue++) {
|
|
14997
15033
|
// eslint-disable-next-line
|
|
14998
15034
|
if (!(min < rowValue && eleArray[rowValue][0] === eleArray[rowValue - 1][0])
|
|
15035
|
+
// eslint-disable-next-line no-cond-assign
|
|
14999
15036
|
&& eleArray[rowValue][0] && 1 < (index = Math.min(parseInt(eleArray[rowValue][0].getAttribute('rowspan'), 10) ||
|
|
15000
15037
|
1, max - min + 1)) && eleArray[rowValue][0] === eleArray[rowValue + 1][0]) {
|
|
15001
15038
|
for (count = index - 1, colIndex = 1; colIndex < eleArray[0].length; colIndex++) {
|
|
@@ -15032,6 +15069,7 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
15032
15069
|
min < rowIndex && elements[rowIndex][colIndex] === elements[rowIndex - 1][colIndex] ||
|
|
15033
15070
|
firstIndex < colIndex && elements[rowIndex][colIndex] === elements[rowIndex][colIndex - 1] ||
|
|
15034
15071
|
1 < (spanCount = parseInt(elements[rowIndex][colIndex].getAttribute(attr), 10) || 1) &&
|
|
15072
|
+
// eslint-disable-next-line max-len
|
|
15035
15073
|
(1 < spanCount - index ? elements[rowIndex][colIndex].setAttribute(attr, (spanCount - index).toString()) :
|
|
15036
15074
|
elements[rowIndex][colIndex].removeAttribute(attr));
|
|
15037
15075
|
}
|
|
@@ -15095,6 +15133,7 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
15095
15133
|
var colIndex = void 0;
|
|
15096
15134
|
for (avgRowIndex = activeCellIndex[0] + Math.ceil(activeCellRowSpan / 2), colIndex = 0 === activeCellIndex[1] ? activeCellIndex[1]
|
|
15097
15135
|
: activeCellIndex[1] - 1; 0 <= colIndex && (correspondingCells[avgRowIndex][colIndex] ===
|
|
15136
|
+
// eslint-disable-next-line max-len
|
|
15098
15137
|
correspondingCells[avgRowIndex][colIndex - 1] || 0 < avgRowIndex && correspondingCells[avgRowIndex][colIndex]
|
|
15099
15138
|
=== correspondingCells[avgRowIndex - 1][colIndex]);) {
|
|
15100
15139
|
colIndex--;
|
|
@@ -15641,7 +15680,7 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15641
15680
|
var currentFormatNode = isFormatted.getFormattedNode(range.startContainer, format, endNode);
|
|
15642
15681
|
var currentSelector = !isNullOrUndefined(currentFormatNode) ?
|
|
15643
15682
|
(currentFormatNode.getAttribute('style') === null ? currentFormatNode.nodeName :
|
|
15644
|
-
currentFormatNode.nodeName +
|
|
15683
|
+
currentFormatNode.nodeName + '[style=\'' + currentFormatNode.getAttribute('style') + '\']') : null;
|
|
15645
15684
|
if (nodes.length > 0) {
|
|
15646
15685
|
isCollapsed = true;
|
|
15647
15686
|
range = nodeCutter.GetCursorRange(docElement, range, nodes[0]);
|
|
@@ -15650,7 +15689,9 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15650
15689
|
range.startOffset > 0 && range.startContainer.parentElement.firstElementChild.tagName.toLowerCase() !== 'br') ||
|
|
15651
15690
|
!isNullOrUndefined(currentFormatNode) && currentFormatNode ===
|
|
15652
15691
|
(range.startContainer.parentElement.closest(currentSelector)) &&
|
|
15653
|
-
((range.startContainer.parentElement.closest(currentSelector)).textContent.replace(
|
|
15692
|
+
((range.startContainer.parentElement.closest(currentSelector)).textContent.replace(
|
|
15693
|
+
// eslint-disable-next-line
|
|
15694
|
+
new RegExp(String.fromCharCode(8203), 'g'), '').trim().length !== 0))) {
|
|
15654
15695
|
isCollapsed = true;
|
|
15655
15696
|
range = nodeCutter.GetCursorRange(docElement, range, range.startContainer);
|
|
15656
15697
|
nodes.push(range.startContainer);
|
|
@@ -15685,15 +15726,6 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15685
15726
|
isSubSup = formatNode === null ? false : true;
|
|
15686
15727
|
}
|
|
15687
15728
|
}
|
|
15688
|
-
else if (formatNode.textContent !== nodes[index].textContent && formatNode.nodeName === 'SPAN' && formatNode.style[0] === 'font-size') {
|
|
15689
|
-
var currentParentElem = nodes[index].parentElement.textContent !== nodes[index].textContent ? nodes[index] : nodes[index].parentElement;
|
|
15690
|
-
var isSameTextContent = true;
|
|
15691
|
-
while (currentParentElem.textContent !== nodes[index].textContent && nodes[index].style[0] !== format && currentParentElem.nodeName === 'SPAN') {
|
|
15692
|
-
isSameTextContent = currentParentElem.textContent === currentParentElem.parentElement.textContent;
|
|
15693
|
-
currentParentElem = !isNullOrUndefined(currentParentElem.parentElement) && isSameTextContent ? currentParentElem.parentElement : currentParentElem;
|
|
15694
|
-
}
|
|
15695
|
-
formatNode = currentParentElem;
|
|
15696
|
-
}
|
|
15697
15729
|
if (index === 0 && formatNode === null) {
|
|
15698
15730
|
isFormat = true;
|
|
15699
15731
|
}
|
|
@@ -15727,6 +15759,7 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15727
15759
|
if (cursorFormat) {
|
|
15728
15760
|
cursorNode = cursorNodes[0];
|
|
15729
15761
|
if (cursorFormat.firstChild.textContent.charCodeAt(0) === 8203 && cursorFormat.firstChild.nodeType === 3) {
|
|
15762
|
+
// eslint-disable-next-line
|
|
15730
15763
|
var regEx = new RegExp(String.fromCharCode(8203), 'g');
|
|
15731
15764
|
var emptySpaceNode = void 0;
|
|
15732
15765
|
if (cursorFormat.firstChild === cursorNode) {
|
|
@@ -15737,7 +15770,6 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15737
15770
|
cursorFormat.parentElement.firstChild && cursorFormat.parentElement.firstChild.nodeType === 1) ?
|
|
15738
15771
|
cursorNode.textContent : cursorNode.textContent.replace(regEx, ''));
|
|
15739
15772
|
emptySpaceNode = cursorNode;
|
|
15740
|
-
|
|
15741
15773
|
}
|
|
15742
15774
|
else {
|
|
15743
15775
|
cursorFormat.firstChild.textContent = cursorFormat.firstChild.textContent.replace(regEx, '');
|
|
@@ -15909,7 +15941,8 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15909
15941
|
}
|
|
15910
15942
|
if (child.length > 0 && isFontStyle) {
|
|
15911
15943
|
for (var num = 0; num < child.length; num++) {
|
|
15912
|
-
if (child[num].nodeType !== 3 || (child[num].textContent &&
|
|
15944
|
+
if (child[num].nodeType !== 3 || (child[num].textContent &&
|
|
15945
|
+
child[num].textContent.trim().length > 0)) {
|
|
15913
15946
|
child[num] = InsertMethods.Wrap(child[num], this.GetFormatNode(format, value, formatNodeTagName, formatNodeStyles));
|
|
15914
15947
|
if (child[num].textContent === startText) {
|
|
15915
15948
|
if (num === 0) {
|
|
@@ -15985,33 +16018,7 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15985
16018
|
liElement.style.textDecoration = 'inherit';
|
|
15986
16019
|
}
|
|
15987
16020
|
}
|
|
15988
|
-
|
|
15989
|
-
var currentNode = nodes[index];
|
|
15990
|
-
var isNestedNode = !isNullOrUndefined(currentNode) && nodes[index].nodeName === '#text' && nodes[index].parentElement.nodeName !== enterType;
|
|
15991
|
-
var currentParentElem = currentNode.parentElement.textContent !== currentNode.textContent ? currentNode : currentNode.parentElement;
|
|
15992
|
-
if (isNestedNode) {
|
|
15993
|
-
var isSameTextContent = true;
|
|
15994
|
-
isNestedNode = false;
|
|
15995
|
-
while (!isNullOrUndefined(currentParentElem) && isSameTextContent && currentParentElem.parentElement.nodeName !== enterType
|
|
15996
|
-
&& (currentParentElem.nodeName === 'SPAN' && (currentParentElem.style.textDecoration === 'line-through' || 'underline')
|
|
15997
|
-
|| currentParentElem.nodeName === 'SPAN' && (currentParentElem.style[0] === 'background-color' || 'font-family' || 'color')
|
|
15998
|
-
|| (currentParentElem.nodeName === 'EM' || 'STRONG' || 'SUB' || 'SUP'))) {
|
|
15999
|
-
isSameTextContent = currentParentElem.textContent === currentParentElem.parentElement.textContent;
|
|
16000
|
-
currentParentElem = !isNullOrUndefined(currentParentElem.parentElement) && isSameTextContent ? currentParentElem.parentElement : currentParentElem;
|
|
16001
|
-
}
|
|
16002
|
-
if (!isNullOrUndefined(currentParentElem) && currentParentElem.childNodes.length > 0) {
|
|
16003
|
-
var nodeList = currentParentElem.querySelectorAll('span,strong,em,sub,sup');
|
|
16004
|
-
isNestedNode = nodeList.length > 0 && isSameTextContent;
|
|
16005
|
-
}
|
|
16006
|
-
}
|
|
16007
|
-
if (isNestedNode) {
|
|
16008
|
-
var nodeList = [];
|
|
16009
|
-
nodeList[0] = currentParentElem;
|
|
16010
|
-
this.applyStyles(nodeList, index, element);
|
|
16011
|
-
}
|
|
16012
|
-
else {
|
|
16013
|
-
nodes[index] = this.applyStyles(nodes, index, element);
|
|
16014
|
-
}
|
|
16021
|
+
nodes[index] = this.applyStyles(nodes, index, element);
|
|
16015
16022
|
if (format === 'fontsize') {
|
|
16016
16023
|
var bg = closest(nodes[index].parentElement, 'span[style*=' + 'background-color' + ']');
|
|
16017
16024
|
if (!isNullOrUndefined(bg)) {
|
|
@@ -16426,7 +16433,8 @@ var ClearFormat$1 = /** @__PURE__ @class */ (function () {
|
|
|
16426
16433
|
this.unWrap(docElement, blockNodes, nodeCutter, nodeSelection);
|
|
16427
16434
|
}
|
|
16428
16435
|
else if (this.BLOCK_TAGS.indexOf(childNodes[index2].nodeName.toLocaleLowerCase()) > -1 &&
|
|
16429
|
-
childNodes[index2].parentNode.nodeName.toLocaleLowerCase() ===
|
|
16436
|
+
childNodes[index2].parentNode.nodeName.toLocaleLowerCase() ===
|
|
16437
|
+
childNodes[index2].nodeName.toLocaleLowerCase()) {
|
|
16430
16438
|
InsertMethods.unwrap(childNodes[index2]);
|
|
16431
16439
|
}
|
|
16432
16440
|
else if (this.BLOCK_TAGS.indexOf(childNodes[index2].nodeName.toLocaleLowerCase()) > -1 &&
|
|
@@ -16944,6 +16952,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
16944
16952
|
MsWordPaste.prototype.hexConversion = function (rtfData) {
|
|
16945
16953
|
// eslint-disable-next-line
|
|
16946
16954
|
var picHead = /\{\\pict[\s\S]+?\\bliptag\-?\d+(\\blipupi\-?\d+)?(\{\\\*\\blipuid\s?[\da-fA-F]+)?[\s\}]*?/;
|
|
16955
|
+
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
16947
16956
|
var pic = new RegExp('(?:(' + picHead.source + '))([\\da-fA-F\\s]+)\\}', 'g');
|
|
16948
16957
|
var fullImg = rtfData.match(pic);
|
|
16949
16958
|
var imgType;
|
|
@@ -17007,7 +17016,9 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
17007
17016
|
MsWordPaste.prototype.removeUnwantedElements = function (elm) {
|
|
17008
17017
|
var innerElement = elm.innerHTML;
|
|
17009
17018
|
for (var i = 0; i < this.removableElements.length; i++) {
|
|
17019
|
+
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
17010
17020
|
var regExpStartElem = new RegExp('<' + this.removableElements[i] + '>', 'g');
|
|
17021
|
+
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
17011
17022
|
var regExpEndElem = new RegExp('</' + this.removableElements[i] + '>', 'g');
|
|
17012
17023
|
innerElement = innerElement.replace(regExpStartElem, '');
|
|
17013
17024
|
innerElement = innerElement.replace(regExpEndElem, '');
|
|
@@ -17056,7 +17067,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
17056
17067
|
var styleClassObject_1 = !isNullOrUndefined(styles) ? this.findStyleObject(styles) : null;
|
|
17057
17068
|
var keys = Object.keys(styleClassObject_1);
|
|
17058
17069
|
var values = keys.map(function (key) {
|
|
17059
|
-
return styleClassObject_1[key];
|
|
17070
|
+
return styleClassObject_1["" + key];
|
|
17060
17071
|
});
|
|
17061
17072
|
values = this.removeUnwantedStyle(values, wordPasteStyleConfig);
|
|
17062
17073
|
this.filterStyles(elm, wordPasteStyleConfig);
|
|
@@ -17337,7 +17348,8 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
17337
17348
|
for (var j = 0; j < collection[index].nestedLevel - pLevel; j++) {
|
|
17338
17349
|
prevList.appendChild(temp = createElement(collection[index].listType));
|
|
17339
17350
|
prevList = createElement('li');
|
|
17340
|
-
if (j !== collection[index].nestedLevel - pLevel - 1 &&
|
|
17351
|
+
if (j !== collection[index].nestedLevel - pLevel - 1 &&
|
|
17352
|
+
collection[index].nestedLevel - pLevel > 1) {
|
|
17341
17353
|
prevList.style.listStyleType = 'none';
|
|
17342
17354
|
}
|
|
17343
17355
|
temp.appendChild(prevList);
|
|
@@ -17765,6 +17777,7 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
17765
17777
|
}
|
|
17766
17778
|
}
|
|
17767
17779
|
for (var index = 0; index < nodes.length; index++) {
|
|
17780
|
+
// eslint-disable-next-line max-len
|
|
17768
17781
|
formatCollection = this.getFormatParent(docElement, formatCollection, nodes[index], targetNode, formatNode, fontSize, fontName);
|
|
17769
17782
|
if ((index === 0 && formatCollection.bold) || !formatCollection.bold) {
|
|
17770
17783
|
nodeCollection.bold = formatCollection.bold;
|
|
@@ -17944,12 +17957,14 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
17944
17957
|
var index = null;
|
|
17945
17958
|
if ((name !== null && name !== '' && name !== undefined)
|
|
17946
17959
|
&& (fontName === null || fontName === undefined || (fontName.filter(function (value, pos) {
|
|
17960
|
+
// eslint-disable-next-line
|
|
17947
17961
|
var pattern = new RegExp(name, 'i');
|
|
17948
17962
|
if ((value.replace(/"/g, '').replace(/ /g, '').toLowerCase() === name.replace(/"/g, '').replace(/ /g, '').toLowerCase()) ||
|
|
17949
|
-
(value.search(pattern) > -1)) {
|
|
17963
|
+
(value.split(',')[0] && value.split(',')[0].search(pattern) > -1)) {
|
|
17950
17964
|
index = pos;
|
|
17951
17965
|
}
|
|
17952
17966
|
}) && (index !== null)))) {
|
|
17967
|
+
// eslint-disable-next-line
|
|
17953
17968
|
return (index !== null) ? fontName[index] : name.replace(/"/g, '');
|
|
17954
17969
|
}
|
|
17955
17970
|
else {
|
|
@@ -18551,10 +18566,12 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
18551
18566
|
var restrictKeys = [8, 9, 13, 16, 17, 18, 20, 27, 37, 38, 39, 40, 44, 45, 46, 91,
|
|
18552
18567
|
112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123];
|
|
18553
18568
|
var range = this.parent.getRange();
|
|
18569
|
+
// eslint-disable-next-line
|
|
18554
18570
|
var regEx = new RegExp(String.fromCharCode(8203), 'g');
|
|
18555
18571
|
var pointer;
|
|
18556
18572
|
if (restrictKeys.indexOf(args.keyCode) < 0 && !args.shiftKey && !args.ctrlKey && !args.altKey) {
|
|
18557
18573
|
pointer = range.startOffset;
|
|
18574
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
18558
18575
|
range.startContainer.nodeName === '#text' ? range.startContainer.parentElement.classList.add('currentStartMark') : range.startContainer.classList.add('currentStartMark');
|
|
18559
18576
|
if (range.startContainer.textContent.charCodeAt(0) === 8203) {
|
|
18560
18577
|
pointer = range.startOffset === 0 ? range.startOffset : range.startOffset - 1;
|
|
@@ -19788,6 +19805,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
19788
19805
|
}
|
|
19789
19806
|
}
|
|
19790
19807
|
};
|
|
19808
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
19791
19809
|
PasteCleanup.prototype.setCssClass = function (e) {
|
|
19792
19810
|
if (this.popupObj && e.cssClass) {
|
|
19793
19811
|
if (isNullOrUndefined(e.oldCssClass)) {
|
|
@@ -20039,7 +20057,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
20039
20057
|
var groupingTags = deniedTags.slice();
|
|
20040
20058
|
var keys = Object.keys(pasteCleanupGroupingTags);
|
|
20041
20059
|
var values = keys.map(function (key) {
|
|
20042
|
-
return pasteCleanupGroupingTags[key];
|
|
20060
|
+
return pasteCleanupGroupingTags["" + key];
|
|
20043
20061
|
});
|
|
20044
20062
|
var addTags = [];
|
|
20045
20063
|
for (var i = 0; i < groupingTags.length; i++) {
|
|
@@ -20361,6 +20379,7 @@ var FileManager$1 = /** @__PURE__ @class */ (function () {
|
|
|
20361
20379
|
this.dialogObj.show(Browser.isDevice ? true : false);
|
|
20362
20380
|
this.setCssClass({ cssClass: this.parent.cssClass });
|
|
20363
20381
|
};
|
|
20382
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
20364
20383
|
FileManager$$1.prototype.setCssClass = function (e) {
|
|
20365
20384
|
if (this.dialogObj && e.cssClass) {
|
|
20366
20385
|
if (isNullOrUndefined(e.oldCssClass)) {
|
|
@@ -20725,33 +20744,33 @@ function setAttributes(htmlAttributes, rte, isFrame, initial) {
|
|
|
20725
20744
|
for (var _i = 0, _a = Object.keys(htmlAttributes); _i < _a.length; _i++) {
|
|
20726
20745
|
var htmlAttr = _a[_i];
|
|
20727
20746
|
if (htmlAttr === 'class') {
|
|
20728
|
-
target.classList.add(htmlAttributes[htmlAttr]);
|
|
20747
|
+
target.classList.add(htmlAttributes["" + htmlAttr]);
|
|
20729
20748
|
}
|
|
20730
|
-
else if (htmlAttr === 'disabled' && htmlAttributes[htmlAttr] === 'disabled') {
|
|
20749
|
+
else if (htmlAttr === 'disabled' && htmlAttributes["" + htmlAttr] === 'disabled') {
|
|
20731
20750
|
rte.enabled = false;
|
|
20732
20751
|
rte.setEnable();
|
|
20733
20752
|
}
|
|
20734
|
-
else if (htmlAttr === 'readonly' && htmlAttributes[htmlAttr] === 'readonly') {
|
|
20753
|
+
else if (htmlAttr === 'readonly' && htmlAttributes["" + htmlAttr] === 'readonly') {
|
|
20735
20754
|
rte.readonly = true;
|
|
20736
20755
|
rte.setReadOnly(initial);
|
|
20737
20756
|
}
|
|
20738
20757
|
else if (htmlAttr === 'style') {
|
|
20739
|
-
target.setAttribute('style', htmlAttributes[htmlAttr]);
|
|
20758
|
+
target.setAttribute('style', htmlAttributes["" + htmlAttr]);
|
|
20740
20759
|
}
|
|
20741
20760
|
else if (htmlAttr === 'tabindex') {
|
|
20742
|
-
rte.inputElement.setAttribute('tabindex', htmlAttributes[htmlAttr]);
|
|
20761
|
+
rte.inputElement.setAttribute('tabindex', htmlAttributes["" + htmlAttr]);
|
|
20743
20762
|
}
|
|
20744
20763
|
else if (htmlAttr === 'placeholder') {
|
|
20745
|
-
rte.placeholder = htmlAttributes[htmlAttr];
|
|
20764
|
+
rte.placeholder = htmlAttributes["" + htmlAttr];
|
|
20746
20765
|
rte.setPlaceHolder();
|
|
20747
20766
|
}
|
|
20748
20767
|
else {
|
|
20749
20768
|
var validateAttr = ['name', 'required'];
|
|
20750
20769
|
if (validateAttr.indexOf(htmlAttr) > -1) {
|
|
20751
|
-
rte.valueContainer.setAttribute(htmlAttr, htmlAttributes[htmlAttr]);
|
|
20770
|
+
rte.valueContainer.setAttribute(htmlAttr, htmlAttributes["" + htmlAttr]);
|
|
20752
20771
|
}
|
|
20753
20772
|
else {
|
|
20754
|
-
target.setAttribute(htmlAttr, htmlAttributes[htmlAttr]);
|
|
20773
|
+
target.setAttribute(htmlAttr, htmlAttributes["" + htmlAttr]);
|
|
20755
20774
|
}
|
|
20756
20775
|
}
|
|
20757
20776
|
}
|
|
@@ -20947,6 +20966,7 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
20947
20966
|
}
|
|
20948
20967
|
}
|
|
20949
20968
|
};
|
|
20969
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
20950
20970
|
Link.prototype.setCssClass = function (e) {
|
|
20951
20971
|
this.updateCss(this.checkBoxObj, e);
|
|
20952
20972
|
this.updateCss(this.dialogObj, e);
|
|
@@ -21120,13 +21140,13 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
21120
21140
|
});
|
|
21121
21141
|
var htmlTextbox = (this.parent.editorMode === 'HTML') ? '<label>' + linkTooltip +
|
|
21122
21142
|
'</label></div><div class="e-rte-field' + ' ' + this.parent.cssClass + '">' +
|
|
21123
|
-
'<input type="text" data-role ="none" spellcheck="false" placeholder = "' + title + '" class="e-input e-rte-linkTitle' + ' ' + this.parent.cssClass + '"></div>' +
|
|
21143
|
+
'<input type="text" data-role ="none" spellcheck="false" placeholder = "' + title + '"aria-label="' + this.i10n.getConstant('linkTitle') + '" class="e-input e-rte-linkTitle' + ' ' + this.parent.cssClass + '"></div>' +
|
|
21124
21144
|
'<div class="e-rte-label' + ' ' + this.parent.cssClass + '"></div>' + '<div class="e-rte-field' + ' ' + this.parent.cssClass + '">' +
|
|
21125
21145
|
'<input type="checkbox" class="e-rte-linkTarget' + ' ' + this.parent.cssClass + '" data-role ="none"></div>' : '';
|
|
21126
21146
|
var content = '<div class="e-rte-label' + ' ' + this.parent.cssClass + '"><label>' + linkWebAddress + '</label></div>' + '<div class="e-rte-field' + ' ' + this.parent.cssClass + '">' +
|
|
21127
|
-
'<input type="text" data-role ="none" spellcheck="false" placeholder="' + urlPlace + '" class="e-input e-rte-linkurl' + ' ' + this.parent.cssClass + '"/></div>' +
|
|
21147
|
+
'<input type="text" data-role ="none" spellcheck="false" placeholder="' + urlPlace + '"aria-label="' + this.i10n.getConstant('linkWebUrl') + '" class="e-input e-rte-linkurl' + ' ' + this.parent.cssClass + '"/></div>' +
|
|
21128
21148
|
'<div class="e-rte-label' + ' ' + this.parent.cssClass + '">' + '<label>' + linkDisplayText + '</label></div><div class="e-rte-field' + ' ' + this.parent.cssClass + '"> ' +
|
|
21129
|
-
'<input type="text" data-role ="none" spellcheck="false" class="e-input e-rte-linkText' + ' ' + this.parent.cssClass + '" placeholder="' + textPlace + '">' +
|
|
21149
|
+
'<input type="text" data-role ="none" spellcheck="false" class="e-input e-rte-linkText' + ' ' + this.parent.cssClass + '"aria-label="' + this.i10n.getConstant('linkText') + '" placeholder="' + textPlace + '">' +
|
|
21130
21150
|
'</div><div class="e-rte-label' + ' ' + this.parent.cssClass + '">' + htmlTextbox;
|
|
21131
21151
|
var contentElem = parseHtml(content);
|
|
21132
21152
|
linkContent.appendChild(contentElem);
|
|
@@ -21152,7 +21172,7 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
21152
21172
|
cssClass: CLS_RTE_ELEMENTS + ' ' + this.parent.cssClass,
|
|
21153
21173
|
enableRtl: this.parent.enableRtl,
|
|
21154
21174
|
locale: this.parent.locale,
|
|
21155
|
-
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '310px',
|
|
21175
|
+
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '310px',
|
|
21156
21176
|
isModal: Browser.isDevice,
|
|
21157
21177
|
buttons: [{
|
|
21158
21178
|
click: this.insertlink.bind(selectObj),
|
|
@@ -21495,6 +21515,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
21495
21515
|
}
|
|
21496
21516
|
}
|
|
21497
21517
|
};
|
|
21518
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
21498
21519
|
Image.prototype.setCssClass = function (e) {
|
|
21499
21520
|
if (this.popupObj && e.cssClass) {
|
|
21500
21521
|
if (isNullOrUndefined(e.oldCssClass)) {
|
|
@@ -21688,8 +21709,8 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
21688
21709
|
var pos = this.calcPos(e);
|
|
21689
21710
|
var top = pos.top;
|
|
21690
21711
|
var left = pos.left;
|
|
21691
|
-
var imgWid = e.width;
|
|
21692
|
-
var imgHgt = e.height;
|
|
21712
|
+
var imgWid = e.getBoundingClientRect().width;
|
|
21713
|
+
var imgHgt = e.getBoundingClientRect().height;
|
|
21693
21714
|
var borWid = (Browser.isDevice) ? (4 * parseInt((e.style.outline.slice(-3)), 10)) + 2 :
|
|
21694
21715
|
(2 * parseInt((e.style.outline.slice(-3)), 10)) + 2; //span border width + image outline width
|
|
21695
21716
|
var devWid = ((Browser.isDevice) ? 0 : 2); // span border width
|
|
@@ -21716,7 +21737,6 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
21716
21737
|
offsetParent = offsetParent.parentNode;
|
|
21717
21738
|
}
|
|
21718
21739
|
if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) {
|
|
21719
|
-
// eslint-disable-next-line
|
|
21720
21740
|
parentOffset = offsetParent.getBoundingClientRect();
|
|
21721
21741
|
}
|
|
21722
21742
|
if (elem.offsetParent && (elem.offsetParent.classList.contains('e-img-caption'))) {
|
|
@@ -21737,6 +21757,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
21737
21757
|
if (isNullOrUndefined(img.width)) {
|
|
21738
21758
|
return;
|
|
21739
21759
|
}
|
|
21760
|
+
// eslint-disable-next-line security/detect-unsafe-regex
|
|
21740
21761
|
var width = img.style.width !== '' ? img.style.width.match(/^\d+(\.\d*)?%$/g) ? parseFloat(img.style.width) :
|
|
21741
21762
|
parseInt(img.style.width, 10) : img.width;
|
|
21742
21763
|
var height = img.style.height !== '' ? parseInt(img.style.height, 10) : img.height;
|
|
@@ -22537,6 +22558,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
22537
22558
|
}
|
|
22538
22559
|
};
|
|
22539
22560
|
Image.prototype.imageRemovePost = function (src) {
|
|
22561
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
22540
22562
|
var proxy = this;
|
|
22541
22563
|
var absoluteUrl = '';
|
|
22542
22564
|
if (isNullOrUndefined(this.parent.insertImageSettings.removeUrl) || this.parent.insertImageSettings.removeUrl === '') {
|
|
@@ -22548,8 +22570,9 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
22548
22570
|
else {
|
|
22549
22571
|
absoluteUrl = new URL(src, document.baseURI).href;
|
|
22550
22572
|
}
|
|
22551
|
-
this.removingImgName = absoluteUrl.replace(/^.*[
|
|
22573
|
+
this.removingImgName = absoluteUrl.replace(/^.*[\\/]/, '');
|
|
22552
22574
|
var xhr = new XMLHttpRequest();
|
|
22575
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
22553
22576
|
xhr.addEventListener('readystatechange', function () {
|
|
22554
22577
|
if (this.readyState === 4 && this.status === 200) {
|
|
22555
22578
|
proxy.triggerPost(this.response);
|
|
@@ -22564,6 +22587,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
22564
22587
|
if (isNullOrUndefined(removeUrl) || removeUrl === '') {
|
|
22565
22588
|
return;
|
|
22566
22589
|
}
|
|
22590
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
22567
22591
|
var file = new File([response], this.removingImgName);
|
|
22568
22592
|
var ajax = new Ajax(removeUrl, 'POST', true, null);
|
|
22569
22593
|
var formData = new FormData();
|
|
@@ -22713,7 +22737,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
22713
22737
|
cssClass: CLS_RTE_ELEMENTS + ' ' + this.parent.cssClass,
|
|
22714
22738
|
enableRtl: this.parent.enableRtl,
|
|
22715
22739
|
locale: this.parent.locale,
|
|
22716
|
-
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
|
|
22740
|
+
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
|
|
22717
22741
|
position: { X: 'center', Y: (Browser.isDevice) ? 'center' : 'top' },
|
|
22718
22742
|
isModal: Browser.isDevice,
|
|
22719
22743
|
buttons: [{
|
|
@@ -22862,7 +22886,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
22862
22886
|
var placeUrl = this.i10n.getConstant('imageUrl');
|
|
22863
22887
|
this.inputUrl = this.parent.createElement('input', {
|
|
22864
22888
|
className: 'e-input e-img-url' + ' ' + this.parent.cssClass,
|
|
22865
|
-
attrs: { placeholder: placeUrl, spellcheck: 'false' }
|
|
22889
|
+
attrs: { placeholder: placeUrl, spellcheck: 'false', 'aria-label': this.i10n.getConstant('imageLinkHeader') }
|
|
22866
22890
|
});
|
|
22867
22891
|
this.inputUrl.addEventListener('input', function () {
|
|
22868
22892
|
if (!isNullOrUndefined(_this.inputUrl)) {
|
|
@@ -23799,6 +23823,7 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
23799
23823
|
}
|
|
23800
23824
|
}
|
|
23801
23825
|
};
|
|
23826
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
23802
23827
|
Audio.prototype.touchStart = function (e, ele) {
|
|
23803
23828
|
if (this.parent.readonly) {
|
|
23804
23829
|
return;
|
|
@@ -24005,6 +24030,7 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
24005
24030
|
}
|
|
24006
24031
|
};
|
|
24007
24032
|
Audio.prototype.audioRemovePost = function (src) {
|
|
24033
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
24008
24034
|
var proxy = this;
|
|
24009
24035
|
var absoluteUrl = '';
|
|
24010
24036
|
if (isNullOrUndefined(this.parent.insertAudioSettings.removeUrl) || this.parent.insertAudioSettings.removeUrl === '') {
|
|
@@ -24016,8 +24042,9 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
24016
24042
|
else {
|
|
24017
24043
|
absoluteUrl = new URL(src, document.baseURI).href;
|
|
24018
24044
|
}
|
|
24019
|
-
this.removingAudioName = absoluteUrl.replace(/^.*[
|
|
24045
|
+
this.removingAudioName = absoluteUrl.replace(/^.*[\\/]/, '');
|
|
24020
24046
|
var xhr = new XMLHttpRequest();
|
|
24047
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
24021
24048
|
xhr.addEventListener('readystatechange', function () {
|
|
24022
24049
|
if (this.readyState === 4 && this.status === 200) {
|
|
24023
24050
|
proxy.triggerPost(this.response);
|
|
@@ -24051,6 +24078,7 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
24051
24078
|
}
|
|
24052
24079
|
}
|
|
24053
24080
|
if (this.isAudioElem(e.target)) {
|
|
24081
|
+
this.audEle = e.target.querySelector('audio');
|
|
24054
24082
|
e.preventDefault();
|
|
24055
24083
|
}
|
|
24056
24084
|
};
|
|
@@ -24190,8 +24218,6 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
24190
24218
|
addClass([target.querySelector('audio')], [CLS_AUD_FOCUS]);
|
|
24191
24219
|
target.querySelector('audio').style.outline = '2px solid #4a90e2';
|
|
24192
24220
|
}
|
|
24193
|
-
var pageY = (this.parent.iframeSettings.enable) ? window.pageYOffset +
|
|
24194
|
-
this.parent.element.getBoundingClientRect().top + args.clientY : args.pageY;
|
|
24195
24221
|
if (this.parent.quickToolbarModule.audioQTBar) {
|
|
24196
24222
|
if (e.isNotify) {
|
|
24197
24223
|
setTimeout(function () {
|
|
@@ -24247,7 +24273,7 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
24247
24273
|
cssClass: CLS_RTE_ELEMENTS,
|
|
24248
24274
|
enableRtl: this.parent.enableRtl,
|
|
24249
24275
|
locale: this.parent.locale,
|
|
24250
|
-
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
|
|
24276
|
+
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
|
|
24251
24277
|
position: { X: 'center', Y: (Browser.isDevice) ? 'center' : 'top' },
|
|
24252
24278
|
isModal: Browser.isDevice,
|
|
24253
24279
|
buttons: [{
|
|
@@ -24319,7 +24345,7 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
24319
24345
|
var placeUrl = this.i10n.getConstant('audioUrl');
|
|
24320
24346
|
this.inputUrl = this.parent.createElement('input', {
|
|
24321
24347
|
className: 'e-input e-audio-url',
|
|
24322
|
-
attrs: { placeholder: placeUrl, spellcheck: 'false' }
|
|
24348
|
+
attrs: { placeholder: placeUrl, spellcheck: 'false', 'aria-label': this.i10n.getConstant('audioLinkHeader') }
|
|
24323
24349
|
});
|
|
24324
24350
|
this.inputUrl.addEventListener('input', function () {
|
|
24325
24351
|
if (!isNullOrUndefined(_this.inputUrl)) {
|
|
@@ -24951,7 +24977,6 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
24951
24977
|
offsetParent = offsetParent.parentNode;
|
|
24952
24978
|
}
|
|
24953
24979
|
if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) {
|
|
24954
|
-
// eslint-disable-next-line
|
|
24955
24980
|
parentOffset = offsetParent.getBoundingClientRect();
|
|
24956
24981
|
}
|
|
24957
24982
|
if (elem && elem.nodeType === 1 && elem.tagName === 'IFRAME') {
|
|
@@ -24973,6 +24998,7 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
24973
24998
|
if (isNullOrUndefined(vidEleStyle)) {
|
|
24974
24999
|
return;
|
|
24975
25000
|
}
|
|
25001
|
+
// eslint-disable-next-line
|
|
24976
25002
|
var width = vidEleStyle.width !== '' ? vidEleStyle.width.match(/^\d+(\.\d*)?%$/g) ? parseFloat(vidEleStyle.width) :
|
|
24977
25003
|
parseInt(vidEleStyle.width, 10) : vid.style.width !== '' ? vid.style.width : vid.width;
|
|
24978
25004
|
var height = vidEleStyle.height !== '' ? parseInt(vidEleStyle.height, 10) : vid.style.height !== '' ? vid.style.height : vid.height;
|
|
@@ -25371,6 +25397,7 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
25371
25397
|
}
|
|
25372
25398
|
};
|
|
25373
25399
|
Video.prototype.videoRemovePost = function (src) {
|
|
25400
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
25374
25401
|
var proxy = this;
|
|
25375
25402
|
var absoluteUrl = '';
|
|
25376
25403
|
if (isNullOrUndefined(this.parent.insertVideoSettings.removeUrl) || this.parent.insertVideoSettings.removeUrl === '') {
|
|
@@ -25382,8 +25409,10 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
25382
25409
|
else {
|
|
25383
25410
|
absoluteUrl = new URL(src, document.baseURI).href;
|
|
25384
25411
|
}
|
|
25412
|
+
// eslint-disable-next-line no-useless-escape
|
|
25385
25413
|
this.removingVideoName = absoluteUrl.replace(/^.*[\\\/]/, '');
|
|
25386
25414
|
var xhr = new XMLHttpRequest();
|
|
25415
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
25387
25416
|
xhr.addEventListener('readystatechange', function () {
|
|
25388
25417
|
if (this.readyState === 4 && this.status === 200) {
|
|
25389
25418
|
proxy.triggerPost(this.response);
|
|
@@ -25514,7 +25543,7 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
25514
25543
|
};
|
|
25515
25544
|
Video.prototype.showVideoQuickToolbar = function (e) {
|
|
25516
25545
|
var _this = this;
|
|
25517
|
-
if (e.type !== 'Videos' || isNullOrUndefined(this.parent.quickToolbarModule)
|
|
25546
|
+
if (e.type !== 'Videos' || e.args.detail === 2 || isNullOrUndefined(this.parent.quickToolbarModule)
|
|
25518
25547
|
|| isNullOrUndefined(this.parent.quickToolbarModule.videoQTBar) || isNullOrUndefined(e.args)) {
|
|
25519
25548
|
return;
|
|
25520
25549
|
}
|
|
@@ -25547,6 +25576,12 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
25547
25576
|
Video.prototype.hideVideoQuickToolbar = function () {
|
|
25548
25577
|
if (!isNullOrUndefined(this.contentModule.getEditPanel().querySelector('.' + CLS_VID_FOCUS))) {
|
|
25549
25578
|
removeClass([this.contentModule.getEditPanel().querySelector('.' + CLS_VID_FOCUS)], CLS_VID_FOCUS);
|
|
25579
|
+
if (!isNullOrUndefined(this.videoEle)) {
|
|
25580
|
+
this.videoEle.style.outline = '';
|
|
25581
|
+
}
|
|
25582
|
+
if (!isNullOrUndefined(this.contentModule.getEditPanel().querySelector('.e-vid-resize'))) {
|
|
25583
|
+
detach(this.contentModule.getEditPanel().querySelector('.e-vid-resize'));
|
|
25584
|
+
}
|
|
25550
25585
|
if (this.quickToolObj && this.quickToolObj.videoQTBar && document.body.contains(this.quickToolObj.videoQTBar.element)) {
|
|
25551
25586
|
this.quickToolObj.videoQTBar.hidePopup();
|
|
25552
25587
|
}
|
|
@@ -25592,7 +25627,7 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
25592
25627
|
cssClass: CLS_RTE_ELEMENTS,
|
|
25593
25628
|
enableRtl: this.parent.enableRtl,
|
|
25594
25629
|
locale: this.parent.locale,
|
|
25595
|
-
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
|
|
25630
|
+
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
|
|
25596
25631
|
position: { X: 'center', Y: (Browser.isDevice) ? 'center' : 'top' },
|
|
25597
25632
|
isModal: Browser.isDevice,
|
|
25598
25633
|
buttons: [{
|
|
@@ -25675,7 +25710,7 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
25675
25710
|
videoUrl.appendChild(urlContent);
|
|
25676
25711
|
this.embedInputUrl = this.parent.createElement('textarea', {
|
|
25677
25712
|
className: 'e-input e-embed-video-url',
|
|
25678
|
-
attrs: { placeholder: 'Paste Embed URL here', type: 'text', tabindex: '-1' }
|
|
25713
|
+
attrs: { placeholder: 'Paste Embed URL here', type: 'text', tabindex: '-1', 'aria-label': this.i10n.getConstant('embedVideoLinkHeader') }
|
|
25679
25714
|
});
|
|
25680
25715
|
this.embedInputUrl.addEventListener('keyup', function () {
|
|
25681
25716
|
if (!isNullOrUndefined(_this.embedInputUrl)) {
|
|
@@ -26325,6 +26360,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
26325
26360
|
}
|
|
26326
26361
|
}
|
|
26327
26362
|
};
|
|
26363
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
26328
26364
|
Table.prototype.setCssClass = function (e) {
|
|
26329
26365
|
if (this.popupObj && e.cssClass) {
|
|
26330
26366
|
if (isNullOrUndefined(e.oldCssClass)) {
|
|
@@ -26457,18 +26493,17 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
26457
26493
|
}
|
|
26458
26494
|
}
|
|
26459
26495
|
};
|
|
26496
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
26460
26497
|
Table.prototype.tableModulekeyUp = function (e) {
|
|
26461
|
-
var event = e.args;
|
|
26462
26498
|
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) && this.contentModule) {
|
|
26463
26499
|
var range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
|
|
26464
|
-
var selection = this.parent.formatter.editorManager.nodeSelection.save(range, this.contentModule.getDocument());
|
|
26465
26500
|
var ele = this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range)[0];
|
|
26466
26501
|
ele = (ele && ele.tagName !== 'TD' && ele.tagName !== 'TH') ? ele.parentElement : ele;
|
|
26467
26502
|
if (ele && ele.tagName !== 'TD' && ele.tagName !== 'TH') {
|
|
26468
26503
|
var closestTd = closest(ele, 'td');
|
|
26469
26504
|
ele = !isNullOrUndefined(closestTd) && this.parent.inputElement.contains(closestTd) ? closestTd : ele;
|
|
26470
26505
|
}
|
|
26471
|
-
if (this.previousTableElement
|
|
26506
|
+
if (this.previousTableElement !== ele && !isNullOrUndefined(this.previousTableElement)) {
|
|
26472
26507
|
this.previousTableElement.classList.remove(CLS_TABLE_SEL);
|
|
26473
26508
|
}
|
|
26474
26509
|
}
|
|
@@ -26897,7 +26932,6 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
26897
26932
|
top: 0,
|
|
26898
26933
|
left: 0
|
|
26899
26934
|
};
|
|
26900
|
-
// eslint-disable-next-line
|
|
26901
26935
|
var offset = elem.getBoundingClientRect();
|
|
26902
26936
|
var doc = elem.ownerDocument;
|
|
26903
26937
|
var offsetParent = elem.offsetParent || doc.documentElement;
|
|
@@ -26912,7 +26946,6 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
26912
26946
|
isNestedTable = true;
|
|
26913
26947
|
}
|
|
26914
26948
|
if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) {
|
|
26915
|
-
// eslint-disable-next-line
|
|
26916
26949
|
parentOffset = offsetParent.getBoundingClientRect();
|
|
26917
26950
|
}
|
|
26918
26951
|
if (isNestedTable) {
|
|
@@ -27081,6 +27114,8 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
27081
27114
|
var mouseY = (this.parent.enableRtl) ? -(pageY - this.pageY) : (pageY - this.pageY);
|
|
27082
27115
|
this.pageX = pageX;
|
|
27083
27116
|
this.pageY = pageY;
|
|
27117
|
+
var maxiumWidth;
|
|
27118
|
+
var currentTdElement = this.curTable.closest('td');
|
|
27084
27119
|
var args = { event: e, requestType: 'table' };
|
|
27085
27120
|
this.parent.trigger(onResize, args, function (resizingArgs) {
|
|
27086
27121
|
if (resizingArgs.cancel) {
|
|
@@ -27113,6 +27148,10 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
27113
27148
|
if (_this.currentColumnResize === 'first') {
|
|
27114
27149
|
mouseX = mouseX - 0.75; //This was done for to make the gripper and the table first/last column will be close.
|
|
27115
27150
|
_this.removeResizeElement();
|
|
27151
|
+
if (currentTdElement) {
|
|
27152
|
+
maxiumWidth = _this.curTable.getBoundingClientRect().right - _this.calcPos(currentTdElement).left;
|
|
27153
|
+
_this.curTable.style.maxWidth = maxiumWidth + 'px';
|
|
27154
|
+
}
|
|
27116
27155
|
// Below the value '100' is the 100% width of the parent element.
|
|
27117
27156
|
if (((mouseX !== 0 && 5 < currentColumnCellWidth) || mouseX < 0) && currentTableWidth <= 100 &&
|
|
27118
27157
|
_this.convertPixelToPercentage(tableWidth - mouseX, widthCompare) <= 100) {
|
|
@@ -27130,6 +27169,10 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
27130
27169
|
else if (_this.currentColumnResize === 'last') {
|
|
27131
27170
|
mouseX = mouseX + 0.75; //This was done for to make the gripper and the table first/last column will be close.
|
|
27132
27171
|
_this.removeResizeElement();
|
|
27172
|
+
if (currentTdElement) {
|
|
27173
|
+
maxiumWidth = currentTdElement.getBoundingClientRect().right - _this.curTable.getBoundingClientRect().left;
|
|
27174
|
+
_this.curTable.style.maxWidth = maxiumWidth + 'px';
|
|
27175
|
+
}
|
|
27133
27176
|
// Below the value '100' is the 100% width of the parent element.
|
|
27134
27177
|
if (((mouseX !== 0 && 5 < currentColumnCellWidth) || mouseX > 0) &&
|
|
27135
27178
|
currentTableWidth <= 100 && _this.convertPixelToPercentage(tableWidth + mouseX, widthCompare) <= 100) {
|
|
@@ -27180,6 +27223,12 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
27180
27223
|
if (!Browser.isDevice) {
|
|
27181
27224
|
EventHandler.remove(_this.contentModule.getEditPanel(), 'mouseover', _this.resizeHelper);
|
|
27182
27225
|
}
|
|
27226
|
+
if (currentTdElement) {
|
|
27227
|
+
// eslint-disable-next-line max-len
|
|
27228
|
+
var tableBoxPosition = _this.curTable.getBoundingClientRect().left - currentTdElement.getBoundingClientRect().left;
|
|
27229
|
+
maxiumWidth = Math.abs(tableBoxPosition - currentTdElement.getBoundingClientRect().width) - 5;
|
|
27230
|
+
_this.curTable.style.maxWidth = maxiumWidth + 'px';
|
|
27231
|
+
}
|
|
27183
27232
|
var widthType = _this.curTable.style.width.indexOf('%') > -1;
|
|
27184
27233
|
_this.curTable.style.width = widthType ? _this.convertPixelToPercentage(tableWidth + mouseX, widthCompare) + '%'
|
|
27185
27234
|
: tableWidth + mouseX + 'px';
|
|
@@ -28509,8 +28558,8 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28509
28558
|
var curElement = this.startNode;
|
|
28510
28559
|
var blockElement = curElement;
|
|
28511
28560
|
while (!this.parent.formatter.editorManager.domNode.isBlockNode(curElement)) {
|
|
28512
|
-
blockElement = curElement;
|
|
28513
28561
|
curElement = curElement.parentElement;
|
|
28562
|
+
blockElement = curElement;
|
|
28514
28563
|
}
|
|
28515
28564
|
isTableEnter = blockElement.tagName === 'TD' || blockElement.tagName === 'TBODY' ? false : true;
|
|
28516
28565
|
}
|
|
@@ -28527,7 +28576,10 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28527
28576
|
this.parent.trigger(actionBegin, actionBeginArgs, function (actionBeginArgs) {
|
|
28528
28577
|
if (!actionBeginArgs.cancel) {
|
|
28529
28578
|
if (!(_this.range.startOffset === _this.range.endOffset && _this.range.startContainer === _this.range.endContainer)) {
|
|
28530
|
-
_this.range.
|
|
28579
|
+
if (!(_this.range.startContainer.nodeName === 'SPAN' && (_this.range.startContainer.classList.contains('e-video-wrap') ||
|
|
28580
|
+
_this.range.startContainer.classList.contains('e-audio-wrap')))) {
|
|
28581
|
+
_this.range.deleteContents();
|
|
28582
|
+
}
|
|
28531
28583
|
if (_this.range.startContainer.nodeName === '#text' && _this.range.startContainer.textContent.length === 0 &&
|
|
28532
28584
|
_this.range.startContainer.parentElement !== _this.parent.inputElement) {
|
|
28533
28585
|
if (_this.parent.enterKey === 'BR') {
|
|
@@ -28556,8 +28608,8 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28556
28608
|
while (!isNullOrUndefined(currentFocusElem) && currentFocusElem.nodeName !== '#text' && currentFocusElem.nodeName !== 'BR') {
|
|
28557
28609
|
currentFocusElem = currentFocusElem.lastChild;
|
|
28558
28610
|
}
|
|
28559
|
-
if (currentFocusElem.nodeName
|
|
28560
|
-
currentFocusElem.parentElement.nodeName
|
|
28611
|
+
if (currentFocusElem.nodeName !== 'BR' && currentFocusElem.parentElement.textContent.length === 0 && currentFocusElem.parentElement.innerHTML.length === 0 &&
|
|
28612
|
+
currentFocusElem.parentElement.nodeName !== 'BR') {
|
|
28561
28613
|
currentFocusElem.parentElement.appendChild(_this.parent.createElement('BR'));
|
|
28562
28614
|
}
|
|
28563
28615
|
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), currentFocusElem.nodeName === 'BR' ? currentFocusElem : currentFocusElem.parentElement, currentFocusElem.parentElement.textContent.length >= 0 || currentFocusElem.nodeName === 'BR' ? 0 : 1);
|
|
@@ -28609,13 +28661,14 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28609
28661
|
else {
|
|
28610
28662
|
nearBlockNode = _this.parent.formatter.editorManager.domNode.blockParentNode(_this.startNode);
|
|
28611
28663
|
}
|
|
28612
|
-
var
|
|
28664
|
+
var isMediaNode = false; // To check the image audio and video node cases
|
|
28613
28665
|
var isFocusedFirst = false;
|
|
28614
28666
|
if (_this.range.startOffset !== 0 && _this.range.endOffset !== 0 &&
|
|
28615
28667
|
_this.range.startContainer === _this.range.endContainer && !(!isNullOrUndefined(nearBlockNode.childNodes[0])
|
|
28616
|
-
&& nearBlockNode.childNodes[0].nodeName === 'IMG')) {
|
|
28668
|
+
&& nearBlockNode.childNodes[0].nodeName === 'IMG' && nearBlockNode.querySelectorAll('img,audio,video').length > 0)) {
|
|
28617
28669
|
var startNodeText = _this.range.startContainer.textContent;
|
|
28618
28670
|
var splitFirstText = startNodeText.substring(0, _this.range.startOffset);
|
|
28671
|
+
// eslint-disable-next-line max-len
|
|
28619
28672
|
if (splitFirstText.charCodeAt(_this.range.startOffset - 1) !== 160 && splitFirstText.trim().length === 0) {
|
|
28620
28673
|
isFocusedFirst = true;
|
|
28621
28674
|
}
|
|
@@ -28627,26 +28680,29 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28627
28680
|
var fireFoxEnterAtMiddle = Browser.userAgent.indexOf('Firefox') !== -1 && _this.range.startOffset === 0 && _this.range.startContainer === _this.range.endContainer &&
|
|
28628
28681
|
_this.range.startContainer.nodeName === '#text' && !_this.parent.formatter.editorManager.domNode.isBlockNode(_this.range.startContainer.previousSibling) &&
|
|
28629
28682
|
_this.range.startContainer.parentElement === _this.range.startContainer.previousSibling.parentElement;
|
|
28683
|
+
// eslint-disable-next-line max-len
|
|
28630
28684
|
if (!fireFoxEnterAtMiddle && ((_this.range.startOffset === 0 && _this.range.endOffset === 0) || isFocusedFirst) &&
|
|
28631
28685
|
!(!isNullOrUndefined(_this.range.startContainer.previousSibling) &&
|
|
28632
28686
|
(_this.range.startContainer.previousSibling.nodeName === 'IMG' || _this.range.startContainer.previousSibling.nodeName === 'BR'))) {
|
|
28633
28687
|
var isNearBlockLengthZero = void 0;
|
|
28634
28688
|
var newElem = void 0;
|
|
28635
|
-
if (_this.range.startContainer.
|
|
28689
|
+
if (!isNullOrUndefined(_this.range.startContainer.childNodes) && _this.range.startContainer.textContent.length === 0 &&
|
|
28690
|
+
(_this.range.startContainer.querySelectorAll('img,audio,video').length > 0 ||
|
|
28691
|
+
_this.range.startContainer.nodeName === 'IMG' || _this.range.startContainer.nodeName === 'TABLE')) {
|
|
28636
28692
|
newElem = _this.createInsertElement(shiftKey_1);
|
|
28637
|
-
|
|
28693
|
+
isMediaNode = true;
|
|
28638
28694
|
isNearBlockLengthZero = false;
|
|
28639
28695
|
}
|
|
28640
28696
|
else {
|
|
28641
28697
|
if ((nearBlockNode.textContent.trim().length !== 0 ||
|
|
28642
28698
|
nearBlockNode.childNodes[0].nodeName === 'IMG' ||
|
|
28643
|
-
(nearBlockNode.textContent.trim() === '' && nearBlockNode.querySelectorAll('img').length > 0))) {
|
|
28644
|
-
if ((_this.range.startOffset === _this.range.endOffset && _this.range.startOffset
|
|
28699
|
+
(nearBlockNode.textContent.trim() === '' && nearBlockNode.querySelectorAll('img,audio,video').length > 0))) {
|
|
28700
|
+
if ((_this.range.startOffset === _this.range.endOffset && _this.range.startOffset !== 0)) {
|
|
28645
28701
|
newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
|
|
28646
28702
|
}
|
|
28647
28703
|
else {
|
|
28648
28704
|
newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, true).cloneNode(true);
|
|
28649
|
-
|
|
28705
|
+
isMediaNode = true;
|
|
28650
28706
|
}
|
|
28651
28707
|
isNearBlockLengthZero = false;
|
|
28652
28708
|
}
|
|
@@ -28669,7 +28725,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28669
28725
|
if (!isNearBlockLengthZero) {
|
|
28670
28726
|
var currentFocusElem = insertElem;
|
|
28671
28727
|
var finalFocusElem = void 0;
|
|
28672
|
-
if (_this.range.startOffset === _this.range.endOffset && _this.range.startOffset
|
|
28728
|
+
if (_this.range.startOffset === _this.range.endOffset && _this.range.startOffset !== 0) {
|
|
28673
28729
|
while (!isNullOrUndefined(currentFocusElem) && currentFocusElem.nodeName !== '#text' &&
|
|
28674
28730
|
currentFocusElem.nodeName !== 'BR') {
|
|
28675
28731
|
finalFocusElem = currentFocusElem;
|
|
@@ -28680,7 +28736,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28680
28736
|
finalFocusElem = currentFocusElem;
|
|
28681
28737
|
}
|
|
28682
28738
|
finalFocusElem.innerHTML = '<br>';
|
|
28683
|
-
if (!
|
|
28739
|
+
if (!isMediaNode) {
|
|
28684
28740
|
detach(nearBlockNode);
|
|
28685
28741
|
}
|
|
28686
28742
|
}
|
|
@@ -28699,6 +28755,48 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28699
28755
|
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), insertElem, 0);
|
|
28700
28756
|
}
|
|
28701
28757
|
}
|
|
28758
|
+
else if (_this.range.startContainer === _this.range.endContainer && _this.range.startContainer.nodeName === 'SPAN' &&
|
|
28759
|
+
(_this.range.startContainer.classList.contains('e-video-wrap') ||
|
|
28760
|
+
_this.range.startContainer.classList.contains('e-audio-wrap'))) {
|
|
28761
|
+
if (nearBlockNode.textContent.trim().length > 0) {
|
|
28762
|
+
var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, true);
|
|
28763
|
+
var audioVideoElem = !isNullOrUndefined(newElem.previousSibling.querySelector('.e-video-wrap')) ?
|
|
28764
|
+
newElem.previousSibling.querySelector('.e-video-wrap') : newElem.previousSibling.querySelector('.e-audio-wrap');
|
|
28765
|
+
var isBRInserted = false;
|
|
28766
|
+
var lastNode = audioVideoElem.previousSibling;
|
|
28767
|
+
while (!isNullOrUndefined(lastNode) && lastNode.nodeName !== '#text') {
|
|
28768
|
+
lastNode = lastNode.lastChild;
|
|
28769
|
+
}
|
|
28770
|
+
if (isNullOrUndefined(lastNode)) {
|
|
28771
|
+
var brElm = _this.parent.createElement('br');
|
|
28772
|
+
audioVideoElem.parentElement.appendChild(brElm);
|
|
28773
|
+
isBRInserted = true;
|
|
28774
|
+
}
|
|
28775
|
+
if (isBRInserted) {
|
|
28776
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), audioVideoElem.parentElement, 0);
|
|
28777
|
+
}
|
|
28778
|
+
else {
|
|
28779
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), lastNode, lastNode.textContent.length);
|
|
28780
|
+
}
|
|
28781
|
+
detach(audioVideoElem);
|
|
28782
|
+
}
|
|
28783
|
+
else {
|
|
28784
|
+
var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, true);
|
|
28785
|
+
var focusElem = newElem.previousSibling;
|
|
28786
|
+
while (!isNullOrUndefined(focusElem.firstChild)) {
|
|
28787
|
+
detach(focusElem.firstChild);
|
|
28788
|
+
}
|
|
28789
|
+
var brElm = _this.parent.createElement('br');
|
|
28790
|
+
focusElem.appendChild(brElm);
|
|
28791
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), focusElem, 0);
|
|
28792
|
+
}
|
|
28793
|
+
if (!isNullOrUndefined(_this.parent.audioModule)) {
|
|
28794
|
+
_this.parent.audioModule.hideAudioQuickToolbar();
|
|
28795
|
+
}
|
|
28796
|
+
if (!isNullOrUndefined(_this.parent.videoModule)) {
|
|
28797
|
+
_this.parent.videoModule.hideVideoQuickToolbar();
|
|
28798
|
+
}
|
|
28799
|
+
}
|
|
28702
28800
|
else {
|
|
28703
28801
|
var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, true);
|
|
28704
28802
|
if (!isNullOrUndefined(newElem.childNodes[0]) && newElem.childNodes[0].nodeName === '#text' &&
|
|
@@ -28714,7 +28812,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28714
28812
|
_this.startNode = startParentElem;
|
|
28715
28813
|
}
|
|
28716
28814
|
else {
|
|
28717
|
-
if (_this.startNode.nodeName
|
|
28815
|
+
if (_this.startNode.nodeName !== 'BR') {
|
|
28718
28816
|
_this.startNode.appendChild(brElm);
|
|
28719
28817
|
}
|
|
28720
28818
|
}
|
|
@@ -28797,6 +28895,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28797
28895
|
var outerBRElem = _this.parent.createElement('br');
|
|
28798
28896
|
if (_this.range.startOffset === 0 && _this.range.endOffset === 0 &&
|
|
28799
28897
|
!isNullOrUndefined(currentParent.previousSibling) && currentParent.previousSibling.nodeName === 'BR') {
|
|
28898
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
28800
28899
|
newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, currentParent, false).cloneNode(true);
|
|
28801
28900
|
_this.parent.formatter.editorManager.domNode.insertAfter(outerBRElem, currentParent);
|
|
28802
28901
|
_this.insertFocusContent();
|
|
@@ -28805,6 +28904,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28805
28904
|
currentFocusElem = currentFocusElem.lastChild;
|
|
28806
28905
|
}
|
|
28807
28906
|
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), currentFocusElem, 0);
|
|
28907
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
28808
28908
|
|
|
28809
28909
|
}
|
|
28810
28910
|
else {
|
|
@@ -28834,7 +28934,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28834
28934
|
EnterKeyAction.prototype.insertBRElement = function () {
|
|
28835
28935
|
var isEmptyBrInserted = false;
|
|
28836
28936
|
var isFocusTextNode = true;
|
|
28837
|
-
if (this.range.endContainer.textContent.length
|
|
28937
|
+
if (this.range.endContainer.textContent.length === 0 && this.range.startContainer.nodeName === 'BR') {
|
|
28838
28938
|
isFocusTextNode = false;
|
|
28839
28939
|
}
|
|
28840
28940
|
var brElm = this.parent.createElement('br');
|
|
@@ -29194,7 +29294,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29194
29294
|
this.focusIn();
|
|
29195
29295
|
}
|
|
29196
29296
|
}
|
|
29197
|
-
var tool = executeGroup[commandName];
|
|
29297
|
+
var tool = executeGroup["" + commandName];
|
|
29198
29298
|
if (option && option.undo) {
|
|
29199
29299
|
if (option.undo && this.formatter.getUndoRedoStack().length === 0) {
|
|
29200
29300
|
this.formatter.saveData();
|
|
@@ -29419,8 +29519,10 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29419
29519
|
audioElm[i].classList.add('e-rte-audio');
|
|
29420
29520
|
audioElm[i].classList.add(CLS_AUDIOINLINE);
|
|
29421
29521
|
}
|
|
29522
|
+
// eslint-disable-next-line max-len
|
|
29422
29523
|
if (!audioElm[i].parentElement.classList.contains(CLS_CLICKELEM) && !audioElm[i].parentElement.classList.contains(CLS_AUDIOWRAP)) {
|
|
29423
29524
|
var audioWrapElem = this.createElement('span', { className: CLS_AUDIOWRAP });
|
|
29525
|
+
audioWrapElem.setAttribute('style', 'width:300px; margin:0 auto;');
|
|
29424
29526
|
audioWrapElem.contentEditable = 'false';
|
|
29425
29527
|
var audioInnerWrapElem = this.createElement('span', { className: CLS_CLICKELEM });
|
|
29426
29528
|
audioWrapElem.appendChild(audioInnerWrapElem);
|
|
@@ -29438,6 +29540,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29438
29540
|
videoElm[i].classList.add('e-rte-video');
|
|
29439
29541
|
videoElm[i].classList.add(CLS_VIDEOINLINE);
|
|
29440
29542
|
}
|
|
29543
|
+
// eslint-disable-next-line max-len
|
|
29441
29544
|
if (!videoElm[i].parentElement.classList.contains(CLS_CLICKELEM) && !videoElm[i].parentElement.classList.contains(CLS_VIDEOWRAP)) {
|
|
29442
29545
|
var videoWrapElem = this.createElement('span', { className: CLS_VIDEOWRAP });
|
|
29443
29546
|
videoWrapElem.contentEditable = 'false';
|
|
@@ -29449,10 +29552,12 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29449
29552
|
}
|
|
29450
29553
|
}
|
|
29451
29554
|
if (Browser.userAgent.indexOf('Firefox') !== -1) {
|
|
29555
|
+
// eslint-disable-next-line
|
|
29452
29556
|
videoElm[i].addEventListener('play', function (args) {
|
|
29453
29557
|
_this.notify(mouseDown, { args: args });
|
|
29454
29558
|
_this.notify('editAreaClick', { args: args });
|
|
29455
29559
|
});
|
|
29560
|
+
// eslint-disable-next-line
|
|
29456
29561
|
videoElm[i].addEventListener('pause', function (args) {
|
|
29457
29562
|
_this.notify(mouseDown, { args: args });
|
|
29458
29563
|
_this.notify('editAreaClick', { args: args });
|
|
@@ -29471,6 +29576,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29471
29576
|
RichTextEditor.prototype.eventInitializer = function () {
|
|
29472
29577
|
this.wireEvents();
|
|
29473
29578
|
};
|
|
29579
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
29474
29580
|
RichTextEditor.prototype.cleanList = function (e) {
|
|
29475
29581
|
var range = this.getRange();
|
|
29476
29582
|
var currentStartContainer = range.startContainer;
|
|
@@ -29518,6 +29624,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29518
29624
|
if (closest(startNode, 'pre') &&
|
|
29519
29625
|
(e.which === 8 && range.startContainer.textContent.charCodeAt(range.startOffset - 1) === 8203) ||
|
|
29520
29626
|
(e.which === 46 && range.startContainer.textContent.charCodeAt(range.startOffset) === 8203)) {
|
|
29627
|
+
// eslint-disable-next-line
|
|
29521
29628
|
var regEx = new RegExp(String.fromCharCode(8203), 'g');
|
|
29522
29629
|
var pointer = e.which === 8 ? range.startOffset - 1 : range.startOffset;
|
|
29523
29630
|
range.startContainer.textContent = range.startContainer.textContent.replace(regEx, '');
|
|
@@ -29536,6 +29643,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29536
29643
|
var bool = true;
|
|
29537
29644
|
var removeNodeArray = [];
|
|
29538
29645
|
for (i = index; i >= 0; i--) {
|
|
29646
|
+
// eslint-disable-next-line max-len
|
|
29539
29647
|
if (parentEle.childNodes[i].nodeType === 3 && parentEle.childNodes[i].textContent.charCodeAt(0) === 8203 && bool) {
|
|
29540
29648
|
removeNodeArray.push(i);
|
|
29541
29649
|
}
|
|
@@ -29594,7 +29702,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29594
29702
|
}
|
|
29595
29703
|
}
|
|
29596
29704
|
this.notify(keyUp, { member: 'keyup', args: e });
|
|
29597
|
-
if (e.keyCode
|
|
29705
|
+
if (e.keyCode === 39 || e.keyCode === 37) {
|
|
29598
29706
|
this.notify(tableModulekeyUp, { member: 'tableModulekeyUp', args: e });
|
|
29599
29707
|
}
|
|
29600
29708
|
if (e.code === 'KeyX' && e.which === 88 && e.keyCode === 88 && e.ctrlKey && (this.inputElement.innerHTML === '' ||
|
|
@@ -30013,6 +30121,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30013
30121
|
* @hidden
|
|
30014
30122
|
* @deprecated
|
|
30015
30123
|
*/
|
|
30124
|
+
/* eslint-disable */
|
|
30016
30125
|
RichTextEditor.prototype.onPropertyChanged = function (newProp, oldProp) {
|
|
30017
30126
|
for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
|
|
30018
30127
|
var prop = _a[_i];
|
|
@@ -30052,7 +30161,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30052
30161
|
break;
|
|
30053
30162
|
}
|
|
30054
30163
|
case 'valueTemplate':
|
|
30055
|
-
this.setValue();
|
|
30164
|
+
this.setValue(true);
|
|
30056
30165
|
if (this.showCharCount) {
|
|
30057
30166
|
this.countModule.refresh();
|
|
30058
30167
|
}
|
|
@@ -30148,7 +30257,6 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30148
30257
|
this.notify(xhtmlValidation, { module: 'XhtmlValidation', newProp: newProp, oldProp: oldProp });
|
|
30149
30258
|
break;
|
|
30150
30259
|
case 'quickToolbarSettings':
|
|
30151
|
-
// eslint-disable-next-line
|
|
30152
30260
|
newProp.quickToolbarSettings.showOnRightClick ? this.wireContextEvent() : this.unWireContextEvent();
|
|
30153
30261
|
this.notify(modelChanged, { newProp: newProp, oldProp: oldProp });
|
|
30154
30262
|
break;
|
|
@@ -30158,6 +30266,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30158
30266
|
}
|
|
30159
30267
|
}
|
|
30160
30268
|
};
|
|
30269
|
+
/* eslint-enable */
|
|
30161
30270
|
/**
|
|
30162
30271
|
* @hidden
|
|
30163
30272
|
* @returns {void}
|
|
@@ -30299,9 +30408,11 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30299
30408
|
this.notify(rtlMode, { enableRtl: this.enableRtl });
|
|
30300
30409
|
if (this.enableRtl) {
|
|
30301
30410
|
this.element.classList.add(CLS_RTL);
|
|
30411
|
+
this.inputElement.classList.add(CLS_RTL);
|
|
30302
30412
|
}
|
|
30303
30413
|
else {
|
|
30304
30414
|
this.element.classList.remove(CLS_RTL);
|
|
30415
|
+
this.inputElement.classList.remove(CLS_RTL);
|
|
30305
30416
|
}
|
|
30306
30417
|
};
|
|
30307
30418
|
RichTextEditor.prototype.updateReadOnly = function () {
|
|
@@ -30497,7 +30608,8 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30497
30608
|
styleEle.rel = 'stylesheet';
|
|
30498
30609
|
return styleEle;
|
|
30499
30610
|
};
|
|
30500
|
-
RichTextEditor.prototype.setValue = function () {
|
|
30611
|
+
RichTextEditor.prototype.setValue = function (isPropertyChange) {
|
|
30612
|
+
var _this = this;
|
|
30501
30613
|
if (this.valueTemplate) {
|
|
30502
30614
|
var regEx = new RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i);
|
|
30503
30615
|
if (regEx.test(this.valueTemplate)) {
|
|
@@ -30505,11 +30617,30 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30505
30617
|
}
|
|
30506
30618
|
else {
|
|
30507
30619
|
var compiledTemplate = compile(this.valueTemplate)('', this, 'valueTemplate');
|
|
30508
|
-
|
|
30509
|
-
|
|
30510
|
-
|
|
30620
|
+
if (typeof this.valueTemplate !== 'string' && this.isReact) {
|
|
30621
|
+
this.displayTempElem = this.createElement('div');
|
|
30622
|
+
for (var i = 0; i < compiledTemplate.length; i++) {
|
|
30623
|
+
var item = compiledTemplate[i];
|
|
30624
|
+
append([item], this.displayTempElem);
|
|
30625
|
+
}
|
|
30626
|
+
this.renderTemplates(function () {
|
|
30627
|
+
_this.inputElement.innerHTML = _this.displayTempElem.childNodes[0].innerHTML;
|
|
30628
|
+
_this.setProperties({ value: _this.inputElement.innerHTML.trim() });
|
|
30629
|
+
});
|
|
30630
|
+
}
|
|
30631
|
+
else {
|
|
30632
|
+
var appendElem = this.element;
|
|
30633
|
+
if (isPropertyChange) {
|
|
30634
|
+
this.inputElement.innerHTML = '';
|
|
30635
|
+
appendElem = this.inputElement;
|
|
30636
|
+
}
|
|
30637
|
+
for (var i = 0; i < compiledTemplate.length; i++) {
|
|
30638
|
+
var item = compiledTemplate[i];
|
|
30639
|
+
append([item], appendElem);
|
|
30640
|
+
}
|
|
30641
|
+
this.setProperties({ value: appendElem.innerHTML.trim() });
|
|
30642
|
+
this.renderReactTemplates();
|
|
30511
30643
|
}
|
|
30512
|
-
this.setProperties({ value: this.element.innerHTML.trim() });
|
|
30513
30644
|
}
|
|
30514
30645
|
}
|
|
30515
30646
|
else {
|
|
@@ -30525,6 +30656,10 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30525
30656
|
}
|
|
30526
30657
|
}
|
|
30527
30658
|
};
|
|
30659
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30660
|
+
RichTextEditor.prototype.renderTemplates = function (callBack) {
|
|
30661
|
+
this.renderReactTemplates(callBack);
|
|
30662
|
+
};
|
|
30528
30663
|
RichTextEditor.prototype.updateResizeFlag = function () {
|
|
30529
30664
|
this.isResizeInitialized = true;
|
|
30530
30665
|
};
|
|
@@ -30594,7 +30729,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30594
30729
|
var rzHandle = this.element.querySelector('.' + CLS_RTE_RES_HANDLE);
|
|
30595
30730
|
var rzHeight = this.enableResize ? (!isNullOrUndefined(rzHandle) ? (rzHandle.offsetHeight + 8) : 0) : 0;
|
|
30596
30731
|
var expandPopHeight = this.getToolbar() ? this.toolbarModule.getExpandTBarPopHeight() : 0;
|
|
30597
|
-
if (this.toolbarSettings.type === ToolbarType.Expand && isExpand
|
|
30732
|
+
if (this.toolbarSettings.type === ToolbarType.Expand && isExpand) {
|
|
30598
30733
|
heightValue = (this.height === 'auto' && rzHeight === 0) ? 'auto' : rteHeight - (tbHeight + expandPopHeight + rzHeight) + 'px';
|
|
30599
30734
|
topValue = (!this.toolbarSettings.enableFloating) ? expandPopHeight : 0;
|
|
30600
30735
|
}
|