@syncfusion/ej2-richtexteditor 20.3.61 → 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 -40
- 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 +312 -181
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +300 -168
- 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/selection-commands.js +8 -41
- package/src/editor-manager/plugin/table.js +6 -0
- package/src/editor-manager/plugin/toolbar-status.js +3 -0
- 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 +43 -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);
|
|
@@ -12407,6 +12435,7 @@ var Formats = /** @__PURE__ @class */ (function () {
|
|
|
12407
12435
|
}
|
|
12408
12436
|
};
|
|
12409
12437
|
Formats.prototype.removeCodeContent = function (range) {
|
|
12438
|
+
// eslint-disable-next-line
|
|
12410
12439
|
var regEx = new RegExp(String.fromCharCode(65279), 'g');
|
|
12411
12440
|
if (!isNullOrUndefined(range.endContainer.textContent.match(regEx))) {
|
|
12412
12441
|
var pointer = range.endContainer.textContent.charCodeAt(range.endOffset - 1) === 65279 ?
|
|
@@ -13311,7 +13340,8 @@ var LinkCommand = /** @__PURE__ @class */ (function () {
|
|
|
13311
13340
|
finalinlineNodes[j_1] = inlineNodes[i];
|
|
13312
13341
|
}
|
|
13313
13342
|
if (inlineNodes.length > 1 && i < inlineNodes.length - 1) {
|
|
13314
|
-
if ((inlineNodes[i].parentElement === inlineNodes[i + 1].parentElement) &&
|
|
13343
|
+
if ((inlineNodes[i].parentElement === inlineNodes[i + 1].parentElement) &&
|
|
13344
|
+
(inlineNodes[i] === inlineNodes[i + 1])) {
|
|
13315
13345
|
continue;
|
|
13316
13346
|
}
|
|
13317
13347
|
else {
|
|
@@ -13408,6 +13438,7 @@ var LinkCommand = /** @__PURE__ @class */ (function () {
|
|
|
13408
13438
|
return arr.join(' ') + ' ';
|
|
13409
13439
|
};
|
|
13410
13440
|
LinkCommand.prototype.openLink = function (e) {
|
|
13441
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
|
13411
13442
|
document.defaultView.open(e.item.url, e.item.target);
|
|
13412
13443
|
this.callBack(e);
|
|
13413
13444
|
};
|
|
@@ -13875,6 +13906,7 @@ var ImageCommand = /** @__PURE__ @class */ (function () {
|
|
|
13875
13906
|
this.callBack(e);
|
|
13876
13907
|
};
|
|
13877
13908
|
ImageCommand.prototype.openImageLink = function (e) {
|
|
13909
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
|
13878
13910
|
document.defaultView.open(e.item.url, e.item.target);
|
|
13879
13911
|
this.callBack(e);
|
|
13880
13912
|
};
|
|
@@ -14361,8 +14393,8 @@ var VideoCommand = /** @__PURE__ @class */ (function () {
|
|
|
14361
14393
|
videoElm_1.load();
|
|
14362
14394
|
}
|
|
14363
14395
|
if (Browser.userAgent.indexOf('Firefox') !== -1) {
|
|
14364
|
-
vidElement.addEventListener('play', function (
|
|
14365
|
-
vidElement.addEventListener('pause', function (
|
|
14396
|
+
vidElement.addEventListener('play', function () { _this.editAreaVideoClick(e); });
|
|
14397
|
+
vidElement.addEventListener('pause', function () { _this.editAreaVideoClick(e); });
|
|
14366
14398
|
}
|
|
14367
14399
|
}
|
|
14368
14400
|
};
|
|
@@ -14602,6 +14634,7 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
14602
14634
|
var newRow = createElement('tr');
|
|
14603
14635
|
var isHeaderSelect = this.curTable.querySelectorAll('th.e-cell-select').length > 0;
|
|
14604
14636
|
for (var i = 0; i < allCells[minVal].length; i++) {
|
|
14637
|
+
// eslint-disable-next-line max-len
|
|
14605
14638
|
if (isBelow && minVal < allCells.length - 1 && allCells[minVal][i] === allCells[minVal + 1][i] ||
|
|
14606
14639
|
!isBelow && 0 < minVal && allCells[minVal][i] === allCells[minVal - 1][i]) {
|
|
14607
14640
|
if (0 === i || 0 < i && allCells[minVal][i] !== allCells[minVal][i - 1]) {
|
|
@@ -14781,10 +14814,12 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
14781
14814
|
1 === rowSpanVal ? allCells[maxI][j].removeAttribute('rowspan') : allCells[maxI][j].setAttribute('rowspan', rowSpanVal.toString());
|
|
14782
14815
|
}
|
|
14783
14816
|
}
|
|
14817
|
+
// eslint-disable-next-line max-len
|
|
14784
14818
|
if (maxI < allCells.length - 1 && allCells[maxI][j] === allCells[maxI + 1][j] && (0 === maxI ||
|
|
14785
14819
|
allCells[maxI][j] !== allCells[maxI - 1][j])) {
|
|
14786
14820
|
var element = allCells[maxI][j];
|
|
14787
14821
|
var index = void 0;
|
|
14822
|
+
// eslint-disable-next-line max-len
|
|
14788
14823
|
for (index = j; 0 < index && allCells[maxI][index] === allCells[maxI][index - 1]; index--) {
|
|
14789
14824
|
if (index === 0) {
|
|
14790
14825
|
this.curTable.rows[maxI + 1].prepend(element);
|
|
@@ -14997,6 +15032,7 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
14997
15032
|
for (rowValue = min; rowValue <= max; rowValue++) {
|
|
14998
15033
|
// eslint-disable-next-line
|
|
14999
15034
|
if (!(min < rowValue && eleArray[rowValue][0] === eleArray[rowValue - 1][0])
|
|
15035
|
+
// eslint-disable-next-line no-cond-assign
|
|
15000
15036
|
&& eleArray[rowValue][0] && 1 < (index = Math.min(parseInt(eleArray[rowValue][0].getAttribute('rowspan'), 10) ||
|
|
15001
15037
|
1, max - min + 1)) && eleArray[rowValue][0] === eleArray[rowValue + 1][0]) {
|
|
15002
15038
|
for (count = index - 1, colIndex = 1; colIndex < eleArray[0].length; colIndex++) {
|
|
@@ -15033,6 +15069,7 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
15033
15069
|
min < rowIndex && elements[rowIndex][colIndex] === elements[rowIndex - 1][colIndex] ||
|
|
15034
15070
|
firstIndex < colIndex && elements[rowIndex][colIndex] === elements[rowIndex][colIndex - 1] ||
|
|
15035
15071
|
1 < (spanCount = parseInt(elements[rowIndex][colIndex].getAttribute(attr), 10) || 1) &&
|
|
15072
|
+
// eslint-disable-next-line max-len
|
|
15036
15073
|
(1 < spanCount - index ? elements[rowIndex][colIndex].setAttribute(attr, (spanCount - index).toString()) :
|
|
15037
15074
|
elements[rowIndex][colIndex].removeAttribute(attr));
|
|
15038
15075
|
}
|
|
@@ -15096,6 +15133,7 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
15096
15133
|
var colIndex = void 0;
|
|
15097
15134
|
for (avgRowIndex = activeCellIndex[0] + Math.ceil(activeCellRowSpan / 2), colIndex = 0 === activeCellIndex[1] ? activeCellIndex[1]
|
|
15098
15135
|
: activeCellIndex[1] - 1; 0 <= colIndex && (correspondingCells[avgRowIndex][colIndex] ===
|
|
15136
|
+
// eslint-disable-next-line max-len
|
|
15099
15137
|
correspondingCells[avgRowIndex][colIndex - 1] || 0 < avgRowIndex && correspondingCells[avgRowIndex][colIndex]
|
|
15100
15138
|
=== correspondingCells[avgRowIndex - 1][colIndex]);) {
|
|
15101
15139
|
colIndex--;
|
|
@@ -15642,7 +15680,7 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15642
15680
|
var currentFormatNode = isFormatted.getFormattedNode(range.startContainer, format, endNode);
|
|
15643
15681
|
var currentSelector = !isNullOrUndefined(currentFormatNode) ?
|
|
15644
15682
|
(currentFormatNode.getAttribute('style') === null ? currentFormatNode.nodeName :
|
|
15645
|
-
currentFormatNode.nodeName +
|
|
15683
|
+
currentFormatNode.nodeName + '[style=\'' + currentFormatNode.getAttribute('style') + '\']') : null;
|
|
15646
15684
|
if (nodes.length > 0) {
|
|
15647
15685
|
isCollapsed = true;
|
|
15648
15686
|
range = nodeCutter.GetCursorRange(docElement, range, nodes[0]);
|
|
@@ -15651,7 +15689,9 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15651
15689
|
range.startOffset > 0 && range.startContainer.parentElement.firstElementChild.tagName.toLowerCase() !== 'br') ||
|
|
15652
15690
|
!isNullOrUndefined(currentFormatNode) && currentFormatNode ===
|
|
15653
15691
|
(range.startContainer.parentElement.closest(currentSelector)) &&
|
|
15654
|
-
((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))) {
|
|
15655
15695
|
isCollapsed = true;
|
|
15656
15696
|
range = nodeCutter.GetCursorRange(docElement, range, range.startContainer);
|
|
15657
15697
|
nodes.push(range.startContainer);
|
|
@@ -15686,15 +15726,6 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15686
15726
|
isSubSup = formatNode === null ? false : true;
|
|
15687
15727
|
}
|
|
15688
15728
|
}
|
|
15689
|
-
else if (formatNode.textContent !== nodes[index].textContent && formatNode.nodeName === 'SPAN' && formatNode.style[0] === 'font-size') {
|
|
15690
|
-
var currentParentElem = nodes[index].parentElement.textContent !== nodes[index].textContent ? nodes[index] : nodes[index].parentElement;
|
|
15691
|
-
var isSameTextContent = true;
|
|
15692
|
-
while (currentParentElem.textContent !== nodes[index].textContent && nodes[index].style[0] !== format && currentParentElem.nodeName === 'SPAN') {
|
|
15693
|
-
isSameTextContent = currentParentElem.textContent === currentParentElem.parentElement.textContent;
|
|
15694
|
-
currentParentElem = !isNullOrUndefined(currentParentElem.parentElement) && isSameTextContent ? currentParentElem.parentElement : currentParentElem;
|
|
15695
|
-
}
|
|
15696
|
-
formatNode = currentParentElem;
|
|
15697
|
-
}
|
|
15698
15729
|
if (index === 0 && formatNode === null) {
|
|
15699
15730
|
isFormat = true;
|
|
15700
15731
|
}
|
|
@@ -15728,6 +15759,7 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15728
15759
|
if (cursorFormat) {
|
|
15729
15760
|
cursorNode = cursorNodes[0];
|
|
15730
15761
|
if (cursorFormat.firstChild.textContent.charCodeAt(0) === 8203 && cursorFormat.firstChild.nodeType === 3) {
|
|
15762
|
+
// eslint-disable-next-line
|
|
15731
15763
|
var regEx = new RegExp(String.fromCharCode(8203), 'g');
|
|
15732
15764
|
var emptySpaceNode = void 0;
|
|
15733
15765
|
if (cursorFormat.firstChild === cursorNode) {
|
|
@@ -15738,7 +15770,6 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15738
15770
|
cursorFormat.parentElement.firstChild && cursorFormat.parentElement.firstChild.nodeType === 1) ?
|
|
15739
15771
|
cursorNode.textContent : cursorNode.textContent.replace(regEx, ''));
|
|
15740
15772
|
emptySpaceNode = cursorNode;
|
|
15741
|
-
|
|
15742
15773
|
}
|
|
15743
15774
|
else {
|
|
15744
15775
|
cursorFormat.firstChild.textContent = cursorFormat.firstChild.textContent.replace(regEx, '');
|
|
@@ -15910,7 +15941,8 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15910
15941
|
}
|
|
15911
15942
|
if (child.length > 0 && isFontStyle) {
|
|
15912
15943
|
for (var num = 0; num < child.length; num++) {
|
|
15913
|
-
if (child[num].nodeType !== 3 || (child[num].textContent &&
|
|
15944
|
+
if (child[num].nodeType !== 3 || (child[num].textContent &&
|
|
15945
|
+
child[num].textContent.trim().length > 0)) {
|
|
15914
15946
|
child[num] = InsertMethods.Wrap(child[num], this.GetFormatNode(format, value, formatNodeTagName, formatNodeStyles));
|
|
15915
15947
|
if (child[num].textContent === startText) {
|
|
15916
15948
|
if (num === 0) {
|
|
@@ -15986,33 +16018,7 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15986
16018
|
liElement.style.textDecoration = 'inherit';
|
|
15987
16019
|
}
|
|
15988
16020
|
}
|
|
15989
|
-
|
|
15990
|
-
var currentNode = nodes[index];
|
|
15991
|
-
var isNestedNode = !isNullOrUndefined(currentNode) && nodes[index].nodeName === '#text' && nodes[index].parentElement.nodeName !== enterType;
|
|
15992
|
-
var currentParentElem = currentNode.parentElement.textContent !== currentNode.textContent ? currentNode : currentNode.parentElement;
|
|
15993
|
-
if (isNestedNode) {
|
|
15994
|
-
var isSameTextContent = true;
|
|
15995
|
-
isNestedNode = false;
|
|
15996
|
-
while (!isNullOrUndefined(currentParentElem) && isSameTextContent && currentParentElem.parentElement.nodeName !== enterType
|
|
15997
|
-
&& (currentParentElem.nodeName === 'SPAN' && (currentParentElem.style.textDecoration === 'line-through' || 'underline')
|
|
15998
|
-
|| currentParentElem.nodeName === 'SPAN' && (currentParentElem.style[0] === 'background-color' || 'font-family' || 'color')
|
|
15999
|
-
|| (currentParentElem.nodeName === 'EM' || 'STRONG' || 'SUB' || 'SUP'))) {
|
|
16000
|
-
isSameTextContent = currentParentElem.textContent === currentParentElem.parentElement.textContent;
|
|
16001
|
-
currentParentElem = !isNullOrUndefined(currentParentElem.parentElement) && isSameTextContent ? currentParentElem.parentElement : currentParentElem;
|
|
16002
|
-
}
|
|
16003
|
-
if (!isNullOrUndefined(currentParentElem) && currentParentElem.childNodes.length > 0) {
|
|
16004
|
-
var nodeList = currentParentElem.querySelectorAll('span,strong,em,sub,sup');
|
|
16005
|
-
isNestedNode = nodeList.length > 0 && isSameTextContent;
|
|
16006
|
-
}
|
|
16007
|
-
}
|
|
16008
|
-
if (isNestedNode) {
|
|
16009
|
-
var nodeList = [];
|
|
16010
|
-
nodeList[0] = currentParentElem;
|
|
16011
|
-
this.applyStyles(nodeList, index, element);
|
|
16012
|
-
}
|
|
16013
|
-
else {
|
|
16014
|
-
nodes[index] = this.applyStyles(nodes, index, element);
|
|
16015
|
-
}
|
|
16021
|
+
nodes[index] = this.applyStyles(nodes, index, element);
|
|
16016
16022
|
if (format === 'fontsize') {
|
|
16017
16023
|
var bg = closest(nodes[index].parentElement, 'span[style*=' + 'background-color' + ']');
|
|
16018
16024
|
if (!isNullOrUndefined(bg)) {
|
|
@@ -16427,7 +16433,8 @@ var ClearFormat$1 = /** @__PURE__ @class */ (function () {
|
|
|
16427
16433
|
this.unWrap(docElement, blockNodes, nodeCutter, nodeSelection);
|
|
16428
16434
|
}
|
|
16429
16435
|
else if (this.BLOCK_TAGS.indexOf(childNodes[index2].nodeName.toLocaleLowerCase()) > -1 &&
|
|
16430
|
-
childNodes[index2].parentNode.nodeName.toLocaleLowerCase() ===
|
|
16436
|
+
childNodes[index2].parentNode.nodeName.toLocaleLowerCase() ===
|
|
16437
|
+
childNodes[index2].nodeName.toLocaleLowerCase()) {
|
|
16431
16438
|
InsertMethods.unwrap(childNodes[index2]);
|
|
16432
16439
|
}
|
|
16433
16440
|
else if (this.BLOCK_TAGS.indexOf(childNodes[index2].nodeName.toLocaleLowerCase()) > -1 &&
|
|
@@ -16945,6 +16952,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
16945
16952
|
MsWordPaste.prototype.hexConversion = function (rtfData) {
|
|
16946
16953
|
// eslint-disable-next-line
|
|
16947
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
|
|
16948
16956
|
var pic = new RegExp('(?:(' + picHead.source + '))([\\da-fA-F\\s]+)\\}', 'g');
|
|
16949
16957
|
var fullImg = rtfData.match(pic);
|
|
16950
16958
|
var imgType;
|
|
@@ -17008,7 +17016,9 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
17008
17016
|
MsWordPaste.prototype.removeUnwantedElements = function (elm) {
|
|
17009
17017
|
var innerElement = elm.innerHTML;
|
|
17010
17018
|
for (var i = 0; i < this.removableElements.length; i++) {
|
|
17019
|
+
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
17011
17020
|
var regExpStartElem = new RegExp('<' + this.removableElements[i] + '>', 'g');
|
|
17021
|
+
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
17012
17022
|
var regExpEndElem = new RegExp('</' + this.removableElements[i] + '>', 'g');
|
|
17013
17023
|
innerElement = innerElement.replace(regExpStartElem, '');
|
|
17014
17024
|
innerElement = innerElement.replace(regExpEndElem, '');
|
|
@@ -17057,7 +17067,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
17057
17067
|
var styleClassObject_1 = !isNullOrUndefined(styles) ? this.findStyleObject(styles) : null;
|
|
17058
17068
|
var keys = Object.keys(styleClassObject_1);
|
|
17059
17069
|
var values = keys.map(function (key) {
|
|
17060
|
-
return styleClassObject_1[key];
|
|
17070
|
+
return styleClassObject_1["" + key];
|
|
17061
17071
|
});
|
|
17062
17072
|
values = this.removeUnwantedStyle(values, wordPasteStyleConfig);
|
|
17063
17073
|
this.filterStyles(elm, wordPasteStyleConfig);
|
|
@@ -17338,7 +17348,8 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
17338
17348
|
for (var j = 0; j < collection[index].nestedLevel - pLevel; j++) {
|
|
17339
17349
|
prevList.appendChild(temp = createElement(collection[index].listType));
|
|
17340
17350
|
prevList = createElement('li');
|
|
17341
|
-
if (j !== collection[index].nestedLevel - pLevel - 1 &&
|
|
17351
|
+
if (j !== collection[index].nestedLevel - pLevel - 1 &&
|
|
17352
|
+
collection[index].nestedLevel - pLevel > 1) {
|
|
17342
17353
|
prevList.style.listStyleType = 'none';
|
|
17343
17354
|
}
|
|
17344
17355
|
temp.appendChild(prevList);
|
|
@@ -17766,6 +17777,7 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
17766
17777
|
}
|
|
17767
17778
|
}
|
|
17768
17779
|
for (var index = 0; index < nodes.length; index++) {
|
|
17780
|
+
// eslint-disable-next-line max-len
|
|
17769
17781
|
formatCollection = this.getFormatParent(docElement, formatCollection, nodes[index], targetNode, formatNode, fontSize, fontName);
|
|
17770
17782
|
if ((index === 0 && formatCollection.bold) || !formatCollection.bold) {
|
|
17771
17783
|
nodeCollection.bold = formatCollection.bold;
|
|
@@ -17945,12 +17957,14 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
17945
17957
|
var index = null;
|
|
17946
17958
|
if ((name !== null && name !== '' && name !== undefined)
|
|
17947
17959
|
&& (fontName === null || fontName === undefined || (fontName.filter(function (value, pos) {
|
|
17960
|
+
// eslint-disable-next-line
|
|
17948
17961
|
var pattern = new RegExp(name, 'i');
|
|
17949
17962
|
if ((value.replace(/"/g, '').replace(/ /g, '').toLowerCase() === name.replace(/"/g, '').replace(/ /g, '').toLowerCase()) ||
|
|
17950
17963
|
(value.split(',')[0] && value.split(',')[0].search(pattern) > -1)) {
|
|
17951
17964
|
index = pos;
|
|
17952
17965
|
}
|
|
17953
17966
|
}) && (index !== null)))) {
|
|
17967
|
+
// eslint-disable-next-line
|
|
17954
17968
|
return (index !== null) ? fontName[index] : name.replace(/"/g, '');
|
|
17955
17969
|
}
|
|
17956
17970
|
else {
|
|
@@ -18552,10 +18566,12 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
18552
18566
|
var restrictKeys = [8, 9, 13, 16, 17, 18, 20, 27, 37, 38, 39, 40, 44, 45, 46, 91,
|
|
18553
18567
|
112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123];
|
|
18554
18568
|
var range = this.parent.getRange();
|
|
18569
|
+
// eslint-disable-next-line
|
|
18555
18570
|
var regEx = new RegExp(String.fromCharCode(8203), 'g');
|
|
18556
18571
|
var pointer;
|
|
18557
18572
|
if (restrictKeys.indexOf(args.keyCode) < 0 && !args.shiftKey && !args.ctrlKey && !args.altKey) {
|
|
18558
18573
|
pointer = range.startOffset;
|
|
18574
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
18559
18575
|
range.startContainer.nodeName === '#text' ? range.startContainer.parentElement.classList.add('currentStartMark') : range.startContainer.classList.add('currentStartMark');
|
|
18560
18576
|
if (range.startContainer.textContent.charCodeAt(0) === 8203) {
|
|
18561
18577
|
pointer = range.startOffset === 0 ? range.startOffset : range.startOffset - 1;
|
|
@@ -19789,6 +19805,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
19789
19805
|
}
|
|
19790
19806
|
}
|
|
19791
19807
|
};
|
|
19808
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
19792
19809
|
PasteCleanup.prototype.setCssClass = function (e) {
|
|
19793
19810
|
if (this.popupObj && e.cssClass) {
|
|
19794
19811
|
if (isNullOrUndefined(e.oldCssClass)) {
|
|
@@ -20040,7 +20057,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
20040
20057
|
var groupingTags = deniedTags.slice();
|
|
20041
20058
|
var keys = Object.keys(pasteCleanupGroupingTags);
|
|
20042
20059
|
var values = keys.map(function (key) {
|
|
20043
|
-
return pasteCleanupGroupingTags[key];
|
|
20060
|
+
return pasteCleanupGroupingTags["" + key];
|
|
20044
20061
|
});
|
|
20045
20062
|
var addTags = [];
|
|
20046
20063
|
for (var i = 0; i < groupingTags.length; i++) {
|
|
@@ -20362,6 +20379,7 @@ var FileManager$1 = /** @__PURE__ @class */ (function () {
|
|
|
20362
20379
|
this.dialogObj.show(Browser.isDevice ? true : false);
|
|
20363
20380
|
this.setCssClass({ cssClass: this.parent.cssClass });
|
|
20364
20381
|
};
|
|
20382
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
20365
20383
|
FileManager$$1.prototype.setCssClass = function (e) {
|
|
20366
20384
|
if (this.dialogObj && e.cssClass) {
|
|
20367
20385
|
if (isNullOrUndefined(e.oldCssClass)) {
|
|
@@ -20726,33 +20744,33 @@ function setAttributes(htmlAttributes, rte, isFrame, initial) {
|
|
|
20726
20744
|
for (var _i = 0, _a = Object.keys(htmlAttributes); _i < _a.length; _i++) {
|
|
20727
20745
|
var htmlAttr = _a[_i];
|
|
20728
20746
|
if (htmlAttr === 'class') {
|
|
20729
|
-
target.classList.add(htmlAttributes[htmlAttr]);
|
|
20747
|
+
target.classList.add(htmlAttributes["" + htmlAttr]);
|
|
20730
20748
|
}
|
|
20731
|
-
else if (htmlAttr === 'disabled' && htmlAttributes[htmlAttr] === 'disabled') {
|
|
20749
|
+
else if (htmlAttr === 'disabled' && htmlAttributes["" + htmlAttr] === 'disabled') {
|
|
20732
20750
|
rte.enabled = false;
|
|
20733
20751
|
rte.setEnable();
|
|
20734
20752
|
}
|
|
20735
|
-
else if (htmlAttr === 'readonly' && htmlAttributes[htmlAttr] === 'readonly') {
|
|
20753
|
+
else if (htmlAttr === 'readonly' && htmlAttributes["" + htmlAttr] === 'readonly') {
|
|
20736
20754
|
rte.readonly = true;
|
|
20737
20755
|
rte.setReadOnly(initial);
|
|
20738
20756
|
}
|
|
20739
20757
|
else if (htmlAttr === 'style') {
|
|
20740
|
-
target.setAttribute('style', htmlAttributes[htmlAttr]);
|
|
20758
|
+
target.setAttribute('style', htmlAttributes["" + htmlAttr]);
|
|
20741
20759
|
}
|
|
20742
20760
|
else if (htmlAttr === 'tabindex') {
|
|
20743
|
-
rte.inputElement.setAttribute('tabindex', htmlAttributes[htmlAttr]);
|
|
20761
|
+
rte.inputElement.setAttribute('tabindex', htmlAttributes["" + htmlAttr]);
|
|
20744
20762
|
}
|
|
20745
20763
|
else if (htmlAttr === 'placeholder') {
|
|
20746
|
-
rte.placeholder = htmlAttributes[htmlAttr];
|
|
20764
|
+
rte.placeholder = htmlAttributes["" + htmlAttr];
|
|
20747
20765
|
rte.setPlaceHolder();
|
|
20748
20766
|
}
|
|
20749
20767
|
else {
|
|
20750
20768
|
var validateAttr = ['name', 'required'];
|
|
20751
20769
|
if (validateAttr.indexOf(htmlAttr) > -1) {
|
|
20752
|
-
rte.valueContainer.setAttribute(htmlAttr, htmlAttributes[htmlAttr]);
|
|
20770
|
+
rte.valueContainer.setAttribute(htmlAttr, htmlAttributes["" + htmlAttr]);
|
|
20753
20771
|
}
|
|
20754
20772
|
else {
|
|
20755
|
-
target.setAttribute(htmlAttr, htmlAttributes[htmlAttr]);
|
|
20773
|
+
target.setAttribute(htmlAttr, htmlAttributes["" + htmlAttr]);
|
|
20756
20774
|
}
|
|
20757
20775
|
}
|
|
20758
20776
|
}
|
|
@@ -20948,6 +20966,7 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
20948
20966
|
}
|
|
20949
20967
|
}
|
|
20950
20968
|
};
|
|
20969
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
20951
20970
|
Link.prototype.setCssClass = function (e) {
|
|
20952
20971
|
this.updateCss(this.checkBoxObj, e);
|
|
20953
20972
|
this.updateCss(this.dialogObj, e);
|
|
@@ -21121,13 +21140,13 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
21121
21140
|
});
|
|
21122
21141
|
var htmlTextbox = (this.parent.editorMode === 'HTML') ? '<label>' + linkTooltip +
|
|
21123
21142
|
'</label></div><div class="e-rte-field' + ' ' + this.parent.cssClass + '">' +
|
|
21124
|
-
'<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>' +
|
|
21125
21144
|
'<div class="e-rte-label' + ' ' + this.parent.cssClass + '"></div>' + '<div class="e-rte-field' + ' ' + this.parent.cssClass + '">' +
|
|
21126
21145
|
'<input type="checkbox" class="e-rte-linkTarget' + ' ' + this.parent.cssClass + '" data-role ="none"></div>' : '';
|
|
21127
21146
|
var content = '<div class="e-rte-label' + ' ' + this.parent.cssClass + '"><label>' + linkWebAddress + '</label></div>' + '<div class="e-rte-field' + ' ' + this.parent.cssClass + '">' +
|
|
21128
|
-
'<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>' +
|
|
21129
21148
|
'<div class="e-rte-label' + ' ' + this.parent.cssClass + '">' + '<label>' + linkDisplayText + '</label></div><div class="e-rte-field' + ' ' + this.parent.cssClass + '"> ' +
|
|
21130
|
-
'<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 + '">' +
|
|
21131
21150
|
'</div><div class="e-rte-label' + ' ' + this.parent.cssClass + '">' + htmlTextbox;
|
|
21132
21151
|
var contentElem = parseHtml(content);
|
|
21133
21152
|
linkContent.appendChild(contentElem);
|
|
@@ -21153,7 +21172,7 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
21153
21172
|
cssClass: CLS_RTE_ELEMENTS + ' ' + this.parent.cssClass,
|
|
21154
21173
|
enableRtl: this.parent.enableRtl,
|
|
21155
21174
|
locale: this.parent.locale,
|
|
21156
|
-
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '310px',
|
|
21175
|
+
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '310px',
|
|
21157
21176
|
isModal: Browser.isDevice,
|
|
21158
21177
|
buttons: [{
|
|
21159
21178
|
click: this.insertlink.bind(selectObj),
|
|
@@ -21496,6 +21515,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
21496
21515
|
}
|
|
21497
21516
|
}
|
|
21498
21517
|
};
|
|
21518
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
21499
21519
|
Image.prototype.setCssClass = function (e) {
|
|
21500
21520
|
if (this.popupObj && e.cssClass) {
|
|
21501
21521
|
if (isNullOrUndefined(e.oldCssClass)) {
|
|
@@ -21689,8 +21709,8 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
21689
21709
|
var pos = this.calcPos(e);
|
|
21690
21710
|
var top = pos.top;
|
|
21691
21711
|
var left = pos.left;
|
|
21692
|
-
var imgWid = e.width;
|
|
21693
|
-
var imgHgt = e.height;
|
|
21712
|
+
var imgWid = e.getBoundingClientRect().width;
|
|
21713
|
+
var imgHgt = e.getBoundingClientRect().height;
|
|
21694
21714
|
var borWid = (Browser.isDevice) ? (4 * parseInt((e.style.outline.slice(-3)), 10)) + 2 :
|
|
21695
21715
|
(2 * parseInt((e.style.outline.slice(-3)), 10)) + 2; //span border width + image outline width
|
|
21696
21716
|
var devWid = ((Browser.isDevice) ? 0 : 2); // span border width
|
|
@@ -21717,7 +21737,6 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
21717
21737
|
offsetParent = offsetParent.parentNode;
|
|
21718
21738
|
}
|
|
21719
21739
|
if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) {
|
|
21720
|
-
// eslint-disable-next-line
|
|
21721
21740
|
parentOffset = offsetParent.getBoundingClientRect();
|
|
21722
21741
|
}
|
|
21723
21742
|
if (elem.offsetParent && (elem.offsetParent.classList.contains('e-img-caption'))) {
|
|
@@ -21738,6 +21757,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
21738
21757
|
if (isNullOrUndefined(img.width)) {
|
|
21739
21758
|
return;
|
|
21740
21759
|
}
|
|
21760
|
+
// eslint-disable-next-line security/detect-unsafe-regex
|
|
21741
21761
|
var width = img.style.width !== '' ? img.style.width.match(/^\d+(\.\d*)?%$/g) ? parseFloat(img.style.width) :
|
|
21742
21762
|
parseInt(img.style.width, 10) : img.width;
|
|
21743
21763
|
var height = img.style.height !== '' ? parseInt(img.style.height, 10) : img.height;
|
|
@@ -22538,6 +22558,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
22538
22558
|
}
|
|
22539
22559
|
};
|
|
22540
22560
|
Image.prototype.imageRemovePost = function (src) {
|
|
22561
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
22541
22562
|
var proxy = this;
|
|
22542
22563
|
var absoluteUrl = '';
|
|
22543
22564
|
if (isNullOrUndefined(this.parent.insertImageSettings.removeUrl) || this.parent.insertImageSettings.removeUrl === '') {
|
|
@@ -22549,8 +22570,9 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
22549
22570
|
else {
|
|
22550
22571
|
absoluteUrl = new URL(src, document.baseURI).href;
|
|
22551
22572
|
}
|
|
22552
|
-
this.removingImgName = absoluteUrl.replace(/^.*[
|
|
22573
|
+
this.removingImgName = absoluteUrl.replace(/^.*[\\/]/, '');
|
|
22553
22574
|
var xhr = new XMLHttpRequest();
|
|
22575
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
22554
22576
|
xhr.addEventListener('readystatechange', function () {
|
|
22555
22577
|
if (this.readyState === 4 && this.status === 200) {
|
|
22556
22578
|
proxy.triggerPost(this.response);
|
|
@@ -22565,6 +22587,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
22565
22587
|
if (isNullOrUndefined(removeUrl) || removeUrl === '') {
|
|
22566
22588
|
return;
|
|
22567
22589
|
}
|
|
22590
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
22568
22591
|
var file = new File([response], this.removingImgName);
|
|
22569
22592
|
var ajax = new Ajax(removeUrl, 'POST', true, null);
|
|
22570
22593
|
var formData = new FormData();
|
|
@@ -22714,7 +22737,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
22714
22737
|
cssClass: CLS_RTE_ELEMENTS + ' ' + this.parent.cssClass,
|
|
22715
22738
|
enableRtl: this.parent.enableRtl,
|
|
22716
22739
|
locale: this.parent.locale,
|
|
22717
|
-
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
|
|
22740
|
+
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
|
|
22718
22741
|
position: { X: 'center', Y: (Browser.isDevice) ? 'center' : 'top' },
|
|
22719
22742
|
isModal: Browser.isDevice,
|
|
22720
22743
|
buttons: [{
|
|
@@ -22863,7 +22886,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
22863
22886
|
var placeUrl = this.i10n.getConstant('imageUrl');
|
|
22864
22887
|
this.inputUrl = this.parent.createElement('input', {
|
|
22865
22888
|
className: 'e-input e-img-url' + ' ' + this.parent.cssClass,
|
|
22866
|
-
attrs: { placeholder: placeUrl, spellcheck: 'false' }
|
|
22889
|
+
attrs: { placeholder: placeUrl, spellcheck: 'false', 'aria-label': this.i10n.getConstant('imageLinkHeader') }
|
|
22867
22890
|
});
|
|
22868
22891
|
this.inputUrl.addEventListener('input', function () {
|
|
22869
22892
|
if (!isNullOrUndefined(_this.inputUrl)) {
|
|
@@ -23800,6 +23823,7 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
23800
23823
|
}
|
|
23801
23824
|
}
|
|
23802
23825
|
};
|
|
23826
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
23803
23827
|
Audio.prototype.touchStart = function (e, ele) {
|
|
23804
23828
|
if (this.parent.readonly) {
|
|
23805
23829
|
return;
|
|
@@ -24006,6 +24030,7 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
24006
24030
|
}
|
|
24007
24031
|
};
|
|
24008
24032
|
Audio.prototype.audioRemovePost = function (src) {
|
|
24033
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
24009
24034
|
var proxy = this;
|
|
24010
24035
|
var absoluteUrl = '';
|
|
24011
24036
|
if (isNullOrUndefined(this.parent.insertAudioSettings.removeUrl) || this.parent.insertAudioSettings.removeUrl === '') {
|
|
@@ -24017,8 +24042,9 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
24017
24042
|
else {
|
|
24018
24043
|
absoluteUrl = new URL(src, document.baseURI).href;
|
|
24019
24044
|
}
|
|
24020
|
-
this.removingAudioName = absoluteUrl.replace(/^.*[
|
|
24045
|
+
this.removingAudioName = absoluteUrl.replace(/^.*[\\/]/, '');
|
|
24021
24046
|
var xhr = new XMLHttpRequest();
|
|
24047
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
24022
24048
|
xhr.addEventListener('readystatechange', function () {
|
|
24023
24049
|
if (this.readyState === 4 && this.status === 200) {
|
|
24024
24050
|
proxy.triggerPost(this.response);
|
|
@@ -24052,6 +24078,7 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
24052
24078
|
}
|
|
24053
24079
|
}
|
|
24054
24080
|
if (this.isAudioElem(e.target)) {
|
|
24081
|
+
this.audEle = e.target.querySelector('audio');
|
|
24055
24082
|
e.preventDefault();
|
|
24056
24083
|
}
|
|
24057
24084
|
};
|
|
@@ -24191,8 +24218,6 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
24191
24218
|
addClass([target.querySelector('audio')], [CLS_AUD_FOCUS]);
|
|
24192
24219
|
target.querySelector('audio').style.outline = '2px solid #4a90e2';
|
|
24193
24220
|
}
|
|
24194
|
-
var pageY = (this.parent.iframeSettings.enable) ? window.pageYOffset +
|
|
24195
|
-
this.parent.element.getBoundingClientRect().top + args.clientY : args.pageY;
|
|
24196
24221
|
if (this.parent.quickToolbarModule.audioQTBar) {
|
|
24197
24222
|
if (e.isNotify) {
|
|
24198
24223
|
setTimeout(function () {
|
|
@@ -24248,7 +24273,7 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
24248
24273
|
cssClass: CLS_RTE_ELEMENTS,
|
|
24249
24274
|
enableRtl: this.parent.enableRtl,
|
|
24250
24275
|
locale: this.parent.locale,
|
|
24251
|
-
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
|
|
24276
|
+
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
|
|
24252
24277
|
position: { X: 'center', Y: (Browser.isDevice) ? 'center' : 'top' },
|
|
24253
24278
|
isModal: Browser.isDevice,
|
|
24254
24279
|
buttons: [{
|
|
@@ -24320,7 +24345,7 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
24320
24345
|
var placeUrl = this.i10n.getConstant('audioUrl');
|
|
24321
24346
|
this.inputUrl = this.parent.createElement('input', {
|
|
24322
24347
|
className: 'e-input e-audio-url',
|
|
24323
|
-
attrs: { placeholder: placeUrl, spellcheck: 'false' }
|
|
24348
|
+
attrs: { placeholder: placeUrl, spellcheck: 'false', 'aria-label': this.i10n.getConstant('audioLinkHeader') }
|
|
24324
24349
|
});
|
|
24325
24350
|
this.inputUrl.addEventListener('input', function () {
|
|
24326
24351
|
if (!isNullOrUndefined(_this.inputUrl)) {
|
|
@@ -24952,7 +24977,6 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
24952
24977
|
offsetParent = offsetParent.parentNode;
|
|
24953
24978
|
}
|
|
24954
24979
|
if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) {
|
|
24955
|
-
// eslint-disable-next-line
|
|
24956
24980
|
parentOffset = offsetParent.getBoundingClientRect();
|
|
24957
24981
|
}
|
|
24958
24982
|
if (elem && elem.nodeType === 1 && elem.tagName === 'IFRAME') {
|
|
@@ -24974,6 +24998,7 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
24974
24998
|
if (isNullOrUndefined(vidEleStyle)) {
|
|
24975
24999
|
return;
|
|
24976
25000
|
}
|
|
25001
|
+
// eslint-disable-next-line
|
|
24977
25002
|
var width = vidEleStyle.width !== '' ? vidEleStyle.width.match(/^\d+(\.\d*)?%$/g) ? parseFloat(vidEleStyle.width) :
|
|
24978
25003
|
parseInt(vidEleStyle.width, 10) : vid.style.width !== '' ? vid.style.width : vid.width;
|
|
24979
25004
|
var height = vidEleStyle.height !== '' ? parseInt(vidEleStyle.height, 10) : vid.style.height !== '' ? vid.style.height : vid.height;
|
|
@@ -25372,6 +25397,7 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
25372
25397
|
}
|
|
25373
25398
|
};
|
|
25374
25399
|
Video.prototype.videoRemovePost = function (src) {
|
|
25400
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
25375
25401
|
var proxy = this;
|
|
25376
25402
|
var absoluteUrl = '';
|
|
25377
25403
|
if (isNullOrUndefined(this.parent.insertVideoSettings.removeUrl) || this.parent.insertVideoSettings.removeUrl === '') {
|
|
@@ -25383,8 +25409,10 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
25383
25409
|
else {
|
|
25384
25410
|
absoluteUrl = new URL(src, document.baseURI).href;
|
|
25385
25411
|
}
|
|
25412
|
+
// eslint-disable-next-line no-useless-escape
|
|
25386
25413
|
this.removingVideoName = absoluteUrl.replace(/^.*[\\\/]/, '');
|
|
25387
25414
|
var xhr = new XMLHttpRequest();
|
|
25415
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
25388
25416
|
xhr.addEventListener('readystatechange', function () {
|
|
25389
25417
|
if (this.readyState === 4 && this.status === 200) {
|
|
25390
25418
|
proxy.triggerPost(this.response);
|
|
@@ -25515,7 +25543,7 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
25515
25543
|
};
|
|
25516
25544
|
Video.prototype.showVideoQuickToolbar = function (e) {
|
|
25517
25545
|
var _this = this;
|
|
25518
|
-
if (e.type !== 'Videos' || isNullOrUndefined(this.parent.quickToolbarModule)
|
|
25546
|
+
if (e.type !== 'Videos' || e.args.detail === 2 || isNullOrUndefined(this.parent.quickToolbarModule)
|
|
25519
25547
|
|| isNullOrUndefined(this.parent.quickToolbarModule.videoQTBar) || isNullOrUndefined(e.args)) {
|
|
25520
25548
|
return;
|
|
25521
25549
|
}
|
|
@@ -25548,6 +25576,12 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
25548
25576
|
Video.prototype.hideVideoQuickToolbar = function () {
|
|
25549
25577
|
if (!isNullOrUndefined(this.contentModule.getEditPanel().querySelector('.' + CLS_VID_FOCUS))) {
|
|
25550
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
|
+
}
|
|
25551
25585
|
if (this.quickToolObj && this.quickToolObj.videoQTBar && document.body.contains(this.quickToolObj.videoQTBar.element)) {
|
|
25552
25586
|
this.quickToolObj.videoQTBar.hidePopup();
|
|
25553
25587
|
}
|
|
@@ -25593,7 +25627,7 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
25593
25627
|
cssClass: CLS_RTE_ELEMENTS,
|
|
25594
25628
|
enableRtl: this.parent.enableRtl,
|
|
25595
25629
|
locale: this.parent.locale,
|
|
25596
|
-
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
|
|
25630
|
+
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
|
|
25597
25631
|
position: { X: 'center', Y: (Browser.isDevice) ? 'center' : 'top' },
|
|
25598
25632
|
isModal: Browser.isDevice,
|
|
25599
25633
|
buttons: [{
|
|
@@ -25676,7 +25710,7 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
25676
25710
|
videoUrl.appendChild(urlContent);
|
|
25677
25711
|
this.embedInputUrl = this.parent.createElement('textarea', {
|
|
25678
25712
|
className: 'e-input e-embed-video-url',
|
|
25679
|
-
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') }
|
|
25680
25714
|
});
|
|
25681
25715
|
this.embedInputUrl.addEventListener('keyup', function () {
|
|
25682
25716
|
if (!isNullOrUndefined(_this.embedInputUrl)) {
|
|
@@ -26326,6 +26360,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
26326
26360
|
}
|
|
26327
26361
|
}
|
|
26328
26362
|
};
|
|
26363
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
26329
26364
|
Table.prototype.setCssClass = function (e) {
|
|
26330
26365
|
if (this.popupObj && e.cssClass) {
|
|
26331
26366
|
if (isNullOrUndefined(e.oldCssClass)) {
|
|
@@ -26458,18 +26493,17 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
26458
26493
|
}
|
|
26459
26494
|
}
|
|
26460
26495
|
};
|
|
26496
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
26461
26497
|
Table.prototype.tableModulekeyUp = function (e) {
|
|
26462
|
-
var event = e.args;
|
|
26463
26498
|
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) && this.contentModule) {
|
|
26464
26499
|
var range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
|
|
26465
|
-
var selection = this.parent.formatter.editorManager.nodeSelection.save(range, this.contentModule.getDocument());
|
|
26466
26500
|
var ele = this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range)[0];
|
|
26467
26501
|
ele = (ele && ele.tagName !== 'TD' && ele.tagName !== 'TH') ? ele.parentElement : ele;
|
|
26468
26502
|
if (ele && ele.tagName !== 'TD' && ele.tagName !== 'TH') {
|
|
26469
26503
|
var closestTd = closest(ele, 'td');
|
|
26470
26504
|
ele = !isNullOrUndefined(closestTd) && this.parent.inputElement.contains(closestTd) ? closestTd : ele;
|
|
26471
26505
|
}
|
|
26472
|
-
if (this.previousTableElement
|
|
26506
|
+
if (this.previousTableElement !== ele && !isNullOrUndefined(this.previousTableElement)) {
|
|
26473
26507
|
this.previousTableElement.classList.remove(CLS_TABLE_SEL);
|
|
26474
26508
|
}
|
|
26475
26509
|
}
|
|
@@ -26898,7 +26932,6 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
26898
26932
|
top: 0,
|
|
26899
26933
|
left: 0
|
|
26900
26934
|
};
|
|
26901
|
-
// eslint-disable-next-line
|
|
26902
26935
|
var offset = elem.getBoundingClientRect();
|
|
26903
26936
|
var doc = elem.ownerDocument;
|
|
26904
26937
|
var offsetParent = elem.offsetParent || doc.documentElement;
|
|
@@ -26913,7 +26946,6 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
26913
26946
|
isNestedTable = true;
|
|
26914
26947
|
}
|
|
26915
26948
|
if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) {
|
|
26916
|
-
// eslint-disable-next-line
|
|
26917
26949
|
parentOffset = offsetParent.getBoundingClientRect();
|
|
26918
26950
|
}
|
|
26919
26951
|
if (isNestedTable) {
|
|
@@ -27082,6 +27114,8 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
27082
27114
|
var mouseY = (this.parent.enableRtl) ? -(pageY - this.pageY) : (pageY - this.pageY);
|
|
27083
27115
|
this.pageX = pageX;
|
|
27084
27116
|
this.pageY = pageY;
|
|
27117
|
+
var maxiumWidth;
|
|
27118
|
+
var currentTdElement = this.curTable.closest('td');
|
|
27085
27119
|
var args = { event: e, requestType: 'table' };
|
|
27086
27120
|
this.parent.trigger(onResize, args, function (resizingArgs) {
|
|
27087
27121
|
if (resizingArgs.cancel) {
|
|
@@ -27114,6 +27148,10 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
27114
27148
|
if (_this.currentColumnResize === 'first') {
|
|
27115
27149
|
mouseX = mouseX - 0.75; //This was done for to make the gripper and the table first/last column will be close.
|
|
27116
27150
|
_this.removeResizeElement();
|
|
27151
|
+
if (currentTdElement) {
|
|
27152
|
+
maxiumWidth = _this.curTable.getBoundingClientRect().right - _this.calcPos(currentTdElement).left;
|
|
27153
|
+
_this.curTable.style.maxWidth = maxiumWidth + 'px';
|
|
27154
|
+
}
|
|
27117
27155
|
// Below the value '100' is the 100% width of the parent element.
|
|
27118
27156
|
if (((mouseX !== 0 && 5 < currentColumnCellWidth) || mouseX < 0) && currentTableWidth <= 100 &&
|
|
27119
27157
|
_this.convertPixelToPercentage(tableWidth - mouseX, widthCompare) <= 100) {
|
|
@@ -27131,6 +27169,10 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
27131
27169
|
else if (_this.currentColumnResize === 'last') {
|
|
27132
27170
|
mouseX = mouseX + 0.75; //This was done for to make the gripper and the table first/last column will be close.
|
|
27133
27171
|
_this.removeResizeElement();
|
|
27172
|
+
if (currentTdElement) {
|
|
27173
|
+
maxiumWidth = currentTdElement.getBoundingClientRect().right - _this.curTable.getBoundingClientRect().left;
|
|
27174
|
+
_this.curTable.style.maxWidth = maxiumWidth + 'px';
|
|
27175
|
+
}
|
|
27134
27176
|
// Below the value '100' is the 100% width of the parent element.
|
|
27135
27177
|
if (((mouseX !== 0 && 5 < currentColumnCellWidth) || mouseX > 0) &&
|
|
27136
27178
|
currentTableWidth <= 100 && _this.convertPixelToPercentage(tableWidth + mouseX, widthCompare) <= 100) {
|
|
@@ -27181,6 +27223,12 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
27181
27223
|
if (!Browser.isDevice) {
|
|
27182
27224
|
EventHandler.remove(_this.contentModule.getEditPanel(), 'mouseover', _this.resizeHelper);
|
|
27183
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
|
+
}
|
|
27184
27232
|
var widthType = _this.curTable.style.width.indexOf('%') > -1;
|
|
27185
27233
|
_this.curTable.style.width = widthType ? _this.convertPixelToPercentage(tableWidth + mouseX, widthCompare) + '%'
|
|
27186
27234
|
: tableWidth + mouseX + 'px';
|
|
@@ -28510,8 +28558,8 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28510
28558
|
var curElement = this.startNode;
|
|
28511
28559
|
var blockElement = curElement;
|
|
28512
28560
|
while (!this.parent.formatter.editorManager.domNode.isBlockNode(curElement)) {
|
|
28513
|
-
blockElement = curElement;
|
|
28514
28561
|
curElement = curElement.parentElement;
|
|
28562
|
+
blockElement = curElement;
|
|
28515
28563
|
}
|
|
28516
28564
|
isTableEnter = blockElement.tagName === 'TD' || blockElement.tagName === 'TBODY' ? false : true;
|
|
28517
28565
|
}
|
|
@@ -28528,7 +28576,10 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28528
28576
|
this.parent.trigger(actionBegin, actionBeginArgs, function (actionBeginArgs) {
|
|
28529
28577
|
if (!actionBeginArgs.cancel) {
|
|
28530
28578
|
if (!(_this.range.startOffset === _this.range.endOffset && _this.range.startContainer === _this.range.endContainer)) {
|
|
28531
|
-
_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
|
+
}
|
|
28532
28583
|
if (_this.range.startContainer.nodeName === '#text' && _this.range.startContainer.textContent.length === 0 &&
|
|
28533
28584
|
_this.range.startContainer.parentElement !== _this.parent.inputElement) {
|
|
28534
28585
|
if (_this.parent.enterKey === 'BR') {
|
|
@@ -28557,8 +28608,8 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28557
28608
|
while (!isNullOrUndefined(currentFocusElem) && currentFocusElem.nodeName !== '#text' && currentFocusElem.nodeName !== 'BR') {
|
|
28558
28609
|
currentFocusElem = currentFocusElem.lastChild;
|
|
28559
28610
|
}
|
|
28560
|
-
if (currentFocusElem.nodeName
|
|
28561
|
-
currentFocusElem.parentElement.nodeName
|
|
28611
|
+
if (currentFocusElem.nodeName !== 'BR' && currentFocusElem.parentElement.textContent.length === 0 && currentFocusElem.parentElement.innerHTML.length === 0 &&
|
|
28612
|
+
currentFocusElem.parentElement.nodeName !== 'BR') {
|
|
28562
28613
|
currentFocusElem.parentElement.appendChild(_this.parent.createElement('BR'));
|
|
28563
28614
|
}
|
|
28564
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);
|
|
@@ -28610,13 +28661,14 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28610
28661
|
else {
|
|
28611
28662
|
nearBlockNode = _this.parent.formatter.editorManager.domNode.blockParentNode(_this.startNode);
|
|
28612
28663
|
}
|
|
28613
|
-
var
|
|
28664
|
+
var isMediaNode = false; // To check the image audio and video node cases
|
|
28614
28665
|
var isFocusedFirst = false;
|
|
28615
28666
|
if (_this.range.startOffset !== 0 && _this.range.endOffset !== 0 &&
|
|
28616
28667
|
_this.range.startContainer === _this.range.endContainer && !(!isNullOrUndefined(nearBlockNode.childNodes[0])
|
|
28617
|
-
&& nearBlockNode.childNodes[0].nodeName === 'IMG')) {
|
|
28668
|
+
&& nearBlockNode.childNodes[0].nodeName === 'IMG' && nearBlockNode.querySelectorAll('img,audio,video').length > 0)) {
|
|
28618
28669
|
var startNodeText = _this.range.startContainer.textContent;
|
|
28619
28670
|
var splitFirstText = startNodeText.substring(0, _this.range.startOffset);
|
|
28671
|
+
// eslint-disable-next-line max-len
|
|
28620
28672
|
if (splitFirstText.charCodeAt(_this.range.startOffset - 1) !== 160 && splitFirstText.trim().length === 0) {
|
|
28621
28673
|
isFocusedFirst = true;
|
|
28622
28674
|
}
|
|
@@ -28628,26 +28680,29 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28628
28680
|
var fireFoxEnterAtMiddle = Browser.userAgent.indexOf('Firefox') !== -1 && _this.range.startOffset === 0 && _this.range.startContainer === _this.range.endContainer &&
|
|
28629
28681
|
_this.range.startContainer.nodeName === '#text' && !_this.parent.formatter.editorManager.domNode.isBlockNode(_this.range.startContainer.previousSibling) &&
|
|
28630
28682
|
_this.range.startContainer.parentElement === _this.range.startContainer.previousSibling.parentElement;
|
|
28683
|
+
// eslint-disable-next-line max-len
|
|
28631
28684
|
if (!fireFoxEnterAtMiddle && ((_this.range.startOffset === 0 && _this.range.endOffset === 0) || isFocusedFirst) &&
|
|
28632
28685
|
!(!isNullOrUndefined(_this.range.startContainer.previousSibling) &&
|
|
28633
28686
|
(_this.range.startContainer.previousSibling.nodeName === 'IMG' || _this.range.startContainer.previousSibling.nodeName === 'BR'))) {
|
|
28634
28687
|
var isNearBlockLengthZero = void 0;
|
|
28635
28688
|
var newElem = void 0;
|
|
28636
|
-
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')) {
|
|
28637
28692
|
newElem = _this.createInsertElement(shiftKey_1);
|
|
28638
|
-
|
|
28693
|
+
isMediaNode = true;
|
|
28639
28694
|
isNearBlockLengthZero = false;
|
|
28640
28695
|
}
|
|
28641
28696
|
else {
|
|
28642
28697
|
if ((nearBlockNode.textContent.trim().length !== 0 ||
|
|
28643
28698
|
nearBlockNode.childNodes[0].nodeName === 'IMG' ||
|
|
28644
|
-
(nearBlockNode.textContent.trim() === '' && nearBlockNode.querySelectorAll('img').length > 0))) {
|
|
28645
|
-
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)) {
|
|
28646
28701
|
newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
|
|
28647
28702
|
}
|
|
28648
28703
|
else {
|
|
28649
28704
|
newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, true).cloneNode(true);
|
|
28650
|
-
|
|
28705
|
+
isMediaNode = true;
|
|
28651
28706
|
}
|
|
28652
28707
|
isNearBlockLengthZero = false;
|
|
28653
28708
|
}
|
|
@@ -28670,7 +28725,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28670
28725
|
if (!isNearBlockLengthZero) {
|
|
28671
28726
|
var currentFocusElem = insertElem;
|
|
28672
28727
|
var finalFocusElem = void 0;
|
|
28673
|
-
if (_this.range.startOffset === _this.range.endOffset && _this.range.startOffset
|
|
28728
|
+
if (_this.range.startOffset === _this.range.endOffset && _this.range.startOffset !== 0) {
|
|
28674
28729
|
while (!isNullOrUndefined(currentFocusElem) && currentFocusElem.nodeName !== '#text' &&
|
|
28675
28730
|
currentFocusElem.nodeName !== 'BR') {
|
|
28676
28731
|
finalFocusElem = currentFocusElem;
|
|
@@ -28681,7 +28736,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28681
28736
|
finalFocusElem = currentFocusElem;
|
|
28682
28737
|
}
|
|
28683
28738
|
finalFocusElem.innerHTML = '<br>';
|
|
28684
|
-
if (!
|
|
28739
|
+
if (!isMediaNode) {
|
|
28685
28740
|
detach(nearBlockNode);
|
|
28686
28741
|
}
|
|
28687
28742
|
}
|
|
@@ -28700,6 +28755,48 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28700
28755
|
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), insertElem, 0);
|
|
28701
28756
|
}
|
|
28702
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
|
+
}
|
|
28703
28800
|
else {
|
|
28704
28801
|
var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, true);
|
|
28705
28802
|
if (!isNullOrUndefined(newElem.childNodes[0]) && newElem.childNodes[0].nodeName === '#text' &&
|
|
@@ -28715,7 +28812,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28715
28812
|
_this.startNode = startParentElem;
|
|
28716
28813
|
}
|
|
28717
28814
|
else {
|
|
28718
|
-
if (_this.startNode.nodeName
|
|
28815
|
+
if (_this.startNode.nodeName !== 'BR') {
|
|
28719
28816
|
_this.startNode.appendChild(brElm);
|
|
28720
28817
|
}
|
|
28721
28818
|
}
|
|
@@ -28798,6 +28895,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28798
28895
|
var outerBRElem = _this.parent.createElement('br');
|
|
28799
28896
|
if (_this.range.startOffset === 0 && _this.range.endOffset === 0 &&
|
|
28800
28897
|
!isNullOrUndefined(currentParent.previousSibling) && currentParent.previousSibling.nodeName === 'BR') {
|
|
28898
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
28801
28899
|
newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, currentParent, false).cloneNode(true);
|
|
28802
28900
|
_this.parent.formatter.editorManager.domNode.insertAfter(outerBRElem, currentParent);
|
|
28803
28901
|
_this.insertFocusContent();
|
|
@@ -28806,6 +28904,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28806
28904
|
currentFocusElem = currentFocusElem.lastChild;
|
|
28807
28905
|
}
|
|
28808
28906
|
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), currentFocusElem, 0);
|
|
28907
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
28809
28908
|
|
|
28810
28909
|
}
|
|
28811
28910
|
else {
|
|
@@ -28835,7 +28934,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28835
28934
|
EnterKeyAction.prototype.insertBRElement = function () {
|
|
28836
28935
|
var isEmptyBrInserted = false;
|
|
28837
28936
|
var isFocusTextNode = true;
|
|
28838
|
-
if (this.range.endContainer.textContent.length
|
|
28937
|
+
if (this.range.endContainer.textContent.length === 0 && this.range.startContainer.nodeName === 'BR') {
|
|
28839
28938
|
isFocusTextNode = false;
|
|
28840
28939
|
}
|
|
28841
28940
|
var brElm = this.parent.createElement('br');
|
|
@@ -29195,7 +29294,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29195
29294
|
this.focusIn();
|
|
29196
29295
|
}
|
|
29197
29296
|
}
|
|
29198
|
-
var tool = executeGroup[commandName];
|
|
29297
|
+
var tool = executeGroup["" + commandName];
|
|
29199
29298
|
if (option && option.undo) {
|
|
29200
29299
|
if (option.undo && this.formatter.getUndoRedoStack().length === 0) {
|
|
29201
29300
|
this.formatter.saveData();
|
|
@@ -29420,8 +29519,10 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29420
29519
|
audioElm[i].classList.add('e-rte-audio');
|
|
29421
29520
|
audioElm[i].classList.add(CLS_AUDIOINLINE);
|
|
29422
29521
|
}
|
|
29522
|
+
// eslint-disable-next-line max-len
|
|
29423
29523
|
if (!audioElm[i].parentElement.classList.contains(CLS_CLICKELEM) && !audioElm[i].parentElement.classList.contains(CLS_AUDIOWRAP)) {
|
|
29424
29524
|
var audioWrapElem = this.createElement('span', { className: CLS_AUDIOWRAP });
|
|
29525
|
+
audioWrapElem.setAttribute('style', 'width:300px; margin:0 auto;');
|
|
29425
29526
|
audioWrapElem.contentEditable = 'false';
|
|
29426
29527
|
var audioInnerWrapElem = this.createElement('span', { className: CLS_CLICKELEM });
|
|
29427
29528
|
audioWrapElem.appendChild(audioInnerWrapElem);
|
|
@@ -29439,6 +29540,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29439
29540
|
videoElm[i].classList.add('e-rte-video');
|
|
29440
29541
|
videoElm[i].classList.add(CLS_VIDEOINLINE);
|
|
29441
29542
|
}
|
|
29543
|
+
// eslint-disable-next-line max-len
|
|
29442
29544
|
if (!videoElm[i].parentElement.classList.contains(CLS_CLICKELEM) && !videoElm[i].parentElement.classList.contains(CLS_VIDEOWRAP)) {
|
|
29443
29545
|
var videoWrapElem = this.createElement('span', { className: CLS_VIDEOWRAP });
|
|
29444
29546
|
videoWrapElem.contentEditable = 'false';
|
|
@@ -29450,10 +29552,12 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29450
29552
|
}
|
|
29451
29553
|
}
|
|
29452
29554
|
if (Browser.userAgent.indexOf('Firefox') !== -1) {
|
|
29555
|
+
// eslint-disable-next-line
|
|
29453
29556
|
videoElm[i].addEventListener('play', function (args) {
|
|
29454
29557
|
_this.notify(mouseDown, { args: args });
|
|
29455
29558
|
_this.notify('editAreaClick', { args: args });
|
|
29456
29559
|
});
|
|
29560
|
+
// eslint-disable-next-line
|
|
29457
29561
|
videoElm[i].addEventListener('pause', function (args) {
|
|
29458
29562
|
_this.notify(mouseDown, { args: args });
|
|
29459
29563
|
_this.notify('editAreaClick', { args: args });
|
|
@@ -29472,6 +29576,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29472
29576
|
RichTextEditor.prototype.eventInitializer = function () {
|
|
29473
29577
|
this.wireEvents();
|
|
29474
29578
|
};
|
|
29579
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
29475
29580
|
RichTextEditor.prototype.cleanList = function (e) {
|
|
29476
29581
|
var range = this.getRange();
|
|
29477
29582
|
var currentStartContainer = range.startContainer;
|
|
@@ -29519,6 +29624,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29519
29624
|
if (closest(startNode, 'pre') &&
|
|
29520
29625
|
(e.which === 8 && range.startContainer.textContent.charCodeAt(range.startOffset - 1) === 8203) ||
|
|
29521
29626
|
(e.which === 46 && range.startContainer.textContent.charCodeAt(range.startOffset) === 8203)) {
|
|
29627
|
+
// eslint-disable-next-line
|
|
29522
29628
|
var regEx = new RegExp(String.fromCharCode(8203), 'g');
|
|
29523
29629
|
var pointer = e.which === 8 ? range.startOffset - 1 : range.startOffset;
|
|
29524
29630
|
range.startContainer.textContent = range.startContainer.textContent.replace(regEx, '');
|
|
@@ -29537,6 +29643,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29537
29643
|
var bool = true;
|
|
29538
29644
|
var removeNodeArray = [];
|
|
29539
29645
|
for (i = index; i >= 0; i--) {
|
|
29646
|
+
// eslint-disable-next-line max-len
|
|
29540
29647
|
if (parentEle.childNodes[i].nodeType === 3 && parentEle.childNodes[i].textContent.charCodeAt(0) === 8203 && bool) {
|
|
29541
29648
|
removeNodeArray.push(i);
|
|
29542
29649
|
}
|
|
@@ -29595,7 +29702,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29595
29702
|
}
|
|
29596
29703
|
}
|
|
29597
29704
|
this.notify(keyUp, { member: 'keyup', args: e });
|
|
29598
|
-
if (e.keyCode
|
|
29705
|
+
if (e.keyCode === 39 || e.keyCode === 37) {
|
|
29599
29706
|
this.notify(tableModulekeyUp, { member: 'tableModulekeyUp', args: e });
|
|
29600
29707
|
}
|
|
29601
29708
|
if (e.code === 'KeyX' && e.which === 88 && e.keyCode === 88 && e.ctrlKey && (this.inputElement.innerHTML === '' ||
|
|
@@ -30014,6 +30121,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30014
30121
|
* @hidden
|
|
30015
30122
|
* @deprecated
|
|
30016
30123
|
*/
|
|
30124
|
+
/* eslint-disable */
|
|
30017
30125
|
RichTextEditor.prototype.onPropertyChanged = function (newProp, oldProp) {
|
|
30018
30126
|
for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
|
|
30019
30127
|
var prop = _a[_i];
|
|
@@ -30053,7 +30161,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30053
30161
|
break;
|
|
30054
30162
|
}
|
|
30055
30163
|
case 'valueTemplate':
|
|
30056
|
-
this.setValue();
|
|
30164
|
+
this.setValue(true);
|
|
30057
30165
|
if (this.showCharCount) {
|
|
30058
30166
|
this.countModule.refresh();
|
|
30059
30167
|
}
|
|
@@ -30149,7 +30257,6 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30149
30257
|
this.notify(xhtmlValidation, { module: 'XhtmlValidation', newProp: newProp, oldProp: oldProp });
|
|
30150
30258
|
break;
|
|
30151
30259
|
case 'quickToolbarSettings':
|
|
30152
|
-
// eslint-disable-next-line
|
|
30153
30260
|
newProp.quickToolbarSettings.showOnRightClick ? this.wireContextEvent() : this.unWireContextEvent();
|
|
30154
30261
|
this.notify(modelChanged, { newProp: newProp, oldProp: oldProp });
|
|
30155
30262
|
break;
|
|
@@ -30159,6 +30266,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30159
30266
|
}
|
|
30160
30267
|
}
|
|
30161
30268
|
};
|
|
30269
|
+
/* eslint-enable */
|
|
30162
30270
|
/**
|
|
30163
30271
|
* @hidden
|
|
30164
30272
|
* @returns {void}
|
|
@@ -30500,7 +30608,8 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30500
30608
|
styleEle.rel = 'stylesheet';
|
|
30501
30609
|
return styleEle;
|
|
30502
30610
|
};
|
|
30503
|
-
RichTextEditor.prototype.setValue = function () {
|
|
30611
|
+
RichTextEditor.prototype.setValue = function (isPropertyChange) {
|
|
30612
|
+
var _this = this;
|
|
30504
30613
|
if (this.valueTemplate) {
|
|
30505
30614
|
var regEx = new RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i);
|
|
30506
30615
|
if (regEx.test(this.valueTemplate)) {
|
|
@@ -30508,11 +30617,30 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30508
30617
|
}
|
|
30509
30618
|
else {
|
|
30510
30619
|
var compiledTemplate = compile(this.valueTemplate)('', this, 'valueTemplate');
|
|
30511
|
-
|
|
30512
|
-
|
|
30513
|
-
|
|
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();
|
|
30514
30643
|
}
|
|
30515
|
-
this.setProperties({ value: this.element.innerHTML.trim() });
|
|
30516
30644
|
}
|
|
30517
30645
|
}
|
|
30518
30646
|
else {
|
|
@@ -30528,6 +30656,10 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30528
30656
|
}
|
|
30529
30657
|
}
|
|
30530
30658
|
};
|
|
30659
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30660
|
+
RichTextEditor.prototype.renderTemplates = function (callBack) {
|
|
30661
|
+
this.renderReactTemplates(callBack);
|
|
30662
|
+
};
|
|
30531
30663
|
RichTextEditor.prototype.updateResizeFlag = function () {
|
|
30532
30664
|
this.isResizeInitialized = true;
|
|
30533
30665
|
};
|
|
@@ -30597,7 +30729,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30597
30729
|
var rzHandle = this.element.querySelector('.' + CLS_RTE_RES_HANDLE);
|
|
30598
30730
|
var rzHeight = this.enableResize ? (!isNullOrUndefined(rzHandle) ? (rzHandle.offsetHeight + 8) : 0) : 0;
|
|
30599
30731
|
var expandPopHeight = this.getToolbar() ? this.toolbarModule.getExpandTBarPopHeight() : 0;
|
|
30600
|
-
if (this.toolbarSettings.type === ToolbarType.Expand && isExpand
|
|
30732
|
+
if (this.toolbarSettings.type === ToolbarType.Expand && isExpand) {
|
|
30601
30733
|
heightValue = (this.height === 'auto' && rzHeight === 0) ? 'auto' : rteHeight - (tbHeight + expandPopHeight + rzHeight) + 'px';
|
|
30602
30734
|
topValue = (!this.toolbarSettings.enableFloating) ? expandPopHeight : 0;
|
|
30603
30735
|
}
|