@syncfusion/ej2-richtexteditor 20.3.61 → 20.4.40
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 +4 -32
- 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 +332 -187
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +320 -174
- 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 +16 -16
- 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/full-screen.js +1 -0
- package/src/rich-text-editor/actions/html-attributes.js +8 -8
- package/src/rich-text-editor/actions/html-editor.js +18 -6
- 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 +6 -1
- 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;
|
|
@@ -4752,6 +4754,9 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
4752
4754
|
*/
|
|
4753
4755
|
Toolbar$$1.prototype.updateItem = function (args) {
|
|
4754
4756
|
var item = this.tools[args.updateItem.toLocaleLowerCase()];
|
|
4757
|
+
if (this.parent.locale !== 'en-US') {
|
|
4758
|
+
item.tooltip = getTooltipText(args.updateItem.toLocaleLowerCase(), this.locator);
|
|
4759
|
+
}
|
|
4755
4760
|
var trgItem = this.tools[args.targetItem.toLocaleLowerCase()];
|
|
4756
4761
|
var index = getTBarItemsIndex(getCollection(trgItem.subCommand), args.baseToolbar.toolbarObj.items)[0];
|
|
4757
4762
|
if (!isNullOrUndefined(index)) {
|
|
@@ -5079,6 +5084,7 @@ var Toolbar$2 = /** @__PURE__ @class */ (function () {
|
|
|
5079
5084
|
this.parent.off(toolbarClick, this.toolbarClickHandler);
|
|
5080
5085
|
}
|
|
5081
5086
|
};
|
|
5087
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
5082
5088
|
Toolbar$$1.prototype.setCssClass = function (e) {
|
|
5083
5089
|
if (this.toolbarObj && e.cssClass) {
|
|
5084
5090
|
if (isNullOrUndefined(e.oldCssClass)) {
|
|
@@ -5263,7 +5269,7 @@ var KeyboardEvents$1 = /** @__PURE__ @class */ (function (_super) {
|
|
|
5263
5269
|
var keys = Object.keys(_this.keyConfigs);
|
|
5264
5270
|
for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
|
|
5265
5271
|
var key = keys_1[_i];
|
|
5266
|
-
var configCollection = _this.keyConfigs[key].split(',');
|
|
5272
|
+
var configCollection = _this.keyConfigs["" + key].split(',');
|
|
5267
5273
|
for (var _a = 0, configCollection_1 = configCollection; _a < configCollection_1.length; _a++) {
|
|
5268
5274
|
var rconfig = configCollection_1[_a];
|
|
5269
5275
|
var rKeyObj = KeyboardEvents_1.getKeyConfigData(rconfig.trim());
|
|
@@ -5337,7 +5343,7 @@ var KeyboardEvents$1 = /** @__PURE__ @class */ (function (_super) {
|
|
|
5337
5343
|
*/
|
|
5338
5344
|
KeyboardEvents$$1.getKeyConfigData = function (config) {
|
|
5339
5345
|
if (config in this.configCache) {
|
|
5340
|
-
return this.configCache[config];
|
|
5346
|
+
return this.configCache["" + config];
|
|
5341
5347
|
}
|
|
5342
5348
|
var keys = config.toLowerCase().split('+');
|
|
5343
5349
|
var keyData = {
|
|
@@ -5352,12 +5358,12 @@ var KeyboardEvents$1 = /** @__PURE__ @class */ (function (_super) {
|
|
|
5352
5358
|
else {
|
|
5353
5359
|
keyData.keyCode = KeyboardEvents_1.getKeyCode(keys[keys.length - 1]);
|
|
5354
5360
|
}
|
|
5355
|
-
KeyboardEvents_1.configCache[config] = keyData;
|
|
5361
|
+
KeyboardEvents_1.configCache["" + config] = keyData;
|
|
5356
5362
|
return keyData;
|
|
5357
5363
|
};
|
|
5358
5364
|
// Return the keycode value as string
|
|
5359
5365
|
KeyboardEvents$$1.getKeyCode = function (keyVal) {
|
|
5360
|
-
return keyCode[keyVal] || keyVal.toUpperCase().charCodeAt(0);
|
|
5366
|
+
return keyCode["" + keyVal] || keyVal.toUpperCase().charCodeAt(0);
|
|
5361
5367
|
};
|
|
5362
5368
|
var KeyboardEvents_1;
|
|
5363
5369
|
KeyboardEvents$$1.configCache = {};
|
|
@@ -6904,7 +6910,9 @@ var MarkdownSelection = /** @__PURE__ @class */ (function () {
|
|
|
6904
6910
|
var isStart = false;
|
|
6905
6911
|
if (line) {
|
|
6906
6912
|
var reg = line.trim() === command.trim() ?
|
|
6913
|
+
// eslint-disable-next-line
|
|
6907
6914
|
new RegExp('^(' + this.replaceSpecialChar(command.trim()) + ')', 'gim') :
|
|
6915
|
+
// eslint-disable-next-line
|
|
6908
6916
|
new RegExp('^(' + this.replaceSpecialChar(command) + ')', 'gim');
|
|
6909
6917
|
isStart = reg.test(line.trim());
|
|
6910
6918
|
}
|
|
@@ -6934,6 +6942,7 @@ var MarkdownSelection = /** @__PURE__ @class */ (function () {
|
|
|
6934
6942
|
MarkdownSelection.prototype.isClear = function (parents, regex) {
|
|
6935
6943
|
var isClear = false;
|
|
6936
6944
|
for (var i = 0; i < parents.length; i++) {
|
|
6945
|
+
// eslint-disable-next-line
|
|
6937
6946
|
if (new RegExp(regex, 'gim').test(parents[i].text)) {
|
|
6938
6947
|
return true;
|
|
6939
6948
|
}
|
|
@@ -7184,7 +7193,7 @@ var MarkdownToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
7184
7193
|
}
|
|
7185
7194
|
else {
|
|
7186
7195
|
for (var i = 0; i < lines.length; i++) {
|
|
7187
|
-
if (!this.selection.isStartWith(lines[i].text, this.parent.formatter.listTags[type])) {
|
|
7196
|
+
if (!this.selection.isStartWith(lines[i].text, this.parent.formatter.listTags["" + type])) {
|
|
7188
7197
|
isApply = false;
|
|
7189
7198
|
break;
|
|
7190
7199
|
}
|
|
@@ -7244,6 +7253,7 @@ var MarkdownToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
7244
7253
|
return text.search('\\' + cmd + '') !== -1;
|
|
7245
7254
|
};
|
|
7246
7255
|
MarkdownToolbarStatus.prototype.multiCharRegx = function (cmd) {
|
|
7256
|
+
// eslint-disable-next-line
|
|
7247
7257
|
return new RegExp('(\\' + cmd + ')', 'g');
|
|
7248
7258
|
};
|
|
7249
7259
|
return MarkdownToolbarStatus;
|
|
@@ -7703,6 +7713,7 @@ var MDLists = /** @__PURE__ @class */ (function () {
|
|
|
7703
7713
|
var regex = this.getListRegex();
|
|
7704
7714
|
this.currentAction = this.getAction(parents[0].text);
|
|
7705
7715
|
for (var i = 0; i < parents.length; i++) {
|
|
7716
|
+
// eslint-disable-next-line max-len
|
|
7706
7717
|
var prevIndex = event.event.shiftKey ? parents[i].line - 1 : parents[i].line - 1;
|
|
7707
7718
|
var prevLine = this.selection.getLine(textArea, prevIndex);
|
|
7708
7719
|
if (prevLine && (!event.event.shiftKey && isNotFirst || (event.event.shiftKey))) {
|
|
@@ -7750,6 +7761,7 @@ var MDLists = /** @__PURE__ @class */ (function () {
|
|
|
7750
7761
|
addedLength += tabSpaceLength;
|
|
7751
7762
|
if (parents.length !== 1) {
|
|
7752
7763
|
for (var j = i; j < parents.length; j++) {
|
|
7764
|
+
// eslint-disable-next-line max-len
|
|
7753
7765
|
parents[j].start = j !== 0 ? parents[j].start + tabSpaceLength : parents[j].start;
|
|
7754
7766
|
parents[j].end = parents[j].end + tabSpaceLength;
|
|
7755
7767
|
}
|
|
@@ -7880,6 +7892,7 @@ var MDLists = /** @__PURE__ @class */ (function () {
|
|
|
7880
7892
|
var ol = line.split('. ')[0];
|
|
7881
7893
|
// eslint-disable-next-line
|
|
7882
7894
|
var currentState = /^\d+$/.test(ol.trim());
|
|
7895
|
+
// eslint-disable-next-line
|
|
7883
7896
|
var ul = line.trim().split(new RegExp('^(' + this.selection.replaceSpecialChar(this.syntax.UL).trim() + ')'))[1];
|
|
7884
7897
|
return (currentState ? 'OL' : ul ? 'UL' : 'NOTLIST');
|
|
7885
7898
|
};
|
|
@@ -8039,6 +8052,7 @@ var MDLists = /** @__PURE__ @class */ (function () {
|
|
|
8039
8052
|
};
|
|
8040
8053
|
MDLists.prototype.appliedLine = function (line, prefixPattern, perfixObj, preTabSpaceLength) {
|
|
8041
8054
|
var points = {};
|
|
8055
|
+
// eslint-disable-next-line
|
|
8042
8056
|
var regex = new RegExp('^[' + this.syntax.UL.trim() + ']');
|
|
8043
8057
|
var lineSplit = line.split('. ');
|
|
8044
8058
|
var currentPrefix = lineSplit[0] + '. ';
|
|
@@ -8101,6 +8115,7 @@ var MDLists = /** @__PURE__ @class */ (function () {
|
|
|
8101
8115
|
regex += regex === '' ? '^(' + syntax + ')|^(' + syntax.trim() + ')' :
|
|
8102
8116
|
'|^(' + syntax + ')|^(' + syntax.trim() + ')';
|
|
8103
8117
|
}
|
|
8118
|
+
// eslint-disable-next-line
|
|
8104
8119
|
return new RegExp(regex);
|
|
8105
8120
|
};
|
|
8106
8121
|
return MDLists;
|
|
@@ -8226,6 +8241,7 @@ var MDFormats = /** @__PURE__ @class */ (function () {
|
|
|
8226
8241
|
if (configKey[j] === command) {
|
|
8227
8242
|
continue;
|
|
8228
8243
|
}
|
|
8244
|
+
// eslint-disable-next-line
|
|
8229
8245
|
var regex = new RegExp('^(' + this.selection.replaceSpecialChar(removeText) + ')', 'gim');
|
|
8230
8246
|
if (regex.test(parents[i].text)) {
|
|
8231
8247
|
parents[i].text = parents[i].text.replace(regex, '');
|
|
@@ -8268,14 +8284,14 @@ var MDFormats = /** @__PURE__ @class */ (function () {
|
|
|
8268
8284
|
!this.selection.isStartWith(lastNextText, this.syntax.pre.split('\n')[0])) {
|
|
8269
8285
|
var lines = textArea.value.substring(start, end).split('\n');
|
|
8270
8286
|
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] +
|
|
8287
|
+
textArea.value = textArea.value.substr(0, start) + this.syntax["" + command] + textArea.value.substring(start, end) +
|
|
8288
|
+
lastLine + this.syntax["" + command] +
|
|
8273
8289
|
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;
|
|
8290
|
+
start = this.selection.selectionStart + this.syntax["" + command].length;
|
|
8291
|
+
end = this.selection.selectionEnd + this.syntax["" + command].length - 1;
|
|
8276
8292
|
}
|
|
8277
8293
|
else {
|
|
8278
|
-
var cmd = this.syntax[command];
|
|
8294
|
+
var cmd = this.syntax["" + command];
|
|
8279
8295
|
var selection = this.parent.markdownSelection.getSelectedInlinePoints(textArea);
|
|
8280
8296
|
var startNo = textArea.value.substr(0, textArea.selectionStart).lastIndexOf(cmd);
|
|
8281
8297
|
var endNo = textArea.value.substr(textArea.selectionEnd, textArea.selectionEnd).indexOf(cmd);
|
|
@@ -8403,9 +8419,11 @@ var MDSelectionFormats = /** @__PURE__ @class */ (function () {
|
|
|
8403
8419
|
return matchText;
|
|
8404
8420
|
};
|
|
8405
8421
|
MDSelectionFormats.prototype.multiCharRegx = function (cmd) {
|
|
8422
|
+
// eslint-disable-next-line
|
|
8406
8423
|
return new RegExp('(\\' + cmd + '\\' + cmd + ')', 'g');
|
|
8407
8424
|
};
|
|
8408
8425
|
MDSelectionFormats.prototype.singleCharRegx = function (cmd) {
|
|
8426
|
+
// eslint-disable-next-line
|
|
8409
8427
|
return new RegExp('(\\' + cmd + ')', 'g');
|
|
8410
8428
|
};
|
|
8411
8429
|
MDSelectionFormats.prototype.isAppliedCommand = function (cmd) {
|
|
@@ -8593,22 +8611,22 @@ var MDSelectionFormats = /** @__PURE__ @class */ (function () {
|
|
|
8593
8611
|
}
|
|
8594
8612
|
};
|
|
8595
8613
|
MDSelectionFormats.prototype.textReplace = function (text, command) {
|
|
8596
|
-
var regx = this.singleCharRegx(this.syntax[command]);
|
|
8614
|
+
var regx = this.singleCharRegx(this.syntax["" + command]);
|
|
8597
8615
|
switch (command) {
|
|
8598
8616
|
case 'Bold':
|
|
8599
|
-
regx = this.multiCharRegx(this.syntax[command].substr(0, 1));
|
|
8617
|
+
regx = this.multiCharRegx(this.syntax["" + command].substr(0, 1));
|
|
8600
8618
|
text = text.replace(regx, '');
|
|
8601
8619
|
break;
|
|
8602
8620
|
case 'Italic':
|
|
8603
|
-
if (!this.isBold(text, this.syntax[command].substr(0, 1))) {
|
|
8621
|
+
if (!this.isBold(text, this.syntax["" + command].substr(0, 1))) {
|
|
8604
8622
|
text = text.replace(regx, '');
|
|
8605
8623
|
}
|
|
8606
8624
|
else {
|
|
8607
|
-
var regxB = this.multiCharRegx(this.syntax[command].substr(0, 1));
|
|
8625
|
+
var regxB = this.multiCharRegx(this.syntax["" + command].substr(0, 1));
|
|
8608
8626
|
var repText = text;
|
|
8609
8627
|
repText = repText.replace(regxB, '$%@').replace(regx, '');
|
|
8610
8628
|
var regxTemp = new RegExp('\\$%@', 'g');
|
|
8611
|
-
text = repText.replace(regxTemp, this.syntax[command].substr(0, 1) + this.syntax[command].substr(0, 1));
|
|
8629
|
+
text = repText.replace(regxTemp, this.syntax["" + command].substr(0, 1) + this.syntax["" + command].substr(0, 1));
|
|
8612
8630
|
}
|
|
8613
8631
|
break;
|
|
8614
8632
|
case 'StrikeThrough':
|
|
@@ -8627,23 +8645,24 @@ var MDSelectionFormats = /** @__PURE__ @class */ (function () {
|
|
|
8627
8645
|
return text;
|
|
8628
8646
|
};
|
|
8629
8647
|
MDSelectionFormats.prototype.isApplied = function (line, command) {
|
|
8630
|
-
var regx = this.singleCharRegx(this.syntax[command]);
|
|
8648
|
+
var regx = this.singleCharRegx(this.syntax["" + command]);
|
|
8631
8649
|
switch (command) {
|
|
8632
8650
|
case 'SubScript':
|
|
8633
8651
|
case 'SuperScript':
|
|
8634
|
-
regx = this.singleCharRegx(this.syntax[command]);
|
|
8652
|
+
regx = this.singleCharRegx(this.syntax["" + command]);
|
|
8635
8653
|
return regx.test(line.text);
|
|
8636
8654
|
case 'Bold':
|
|
8637
8655
|
case 'StrikeThrough':
|
|
8638
|
-
regx = this.multiCharRegx(this.syntax[command].substr(0, 1));
|
|
8656
|
+
regx = this.multiCharRegx(this.syntax["" + command].substr(0, 1));
|
|
8639
8657
|
return regx.test(line.text);
|
|
8640
8658
|
case 'UpperCase':
|
|
8641
8659
|
case 'LowerCase':
|
|
8642
|
-
|
|
8660
|
+
// eslint-disable-next-line
|
|
8661
|
+
regx = new RegExp('^[' + this.syntax["" + command] + ']*$', 'g');
|
|
8643
8662
|
return regx.test(line.text);
|
|
8644
8663
|
case 'Italic': {
|
|
8645
8664
|
var regTest = void 0;
|
|
8646
|
-
var regxB = this.multiCharRegx(this.syntax[command].substr(0, 1));
|
|
8665
|
+
var regxB = this.multiCharRegx(this.syntax["" + command].substr(0, 1));
|
|
8647
8666
|
if (regxB.test(line.text)) {
|
|
8648
8667
|
var repText = line.text;
|
|
8649
8668
|
repText = repText.replace(regxB, '$%#');
|
|
@@ -9301,23 +9320,25 @@ var ClearFormat = /** @__PURE__ @class */ (function () {
|
|
|
9301
9320
|
var key = keys[num];
|
|
9302
9321
|
// eslint-disable-next-line
|
|
9303
9322
|
if (data.hasOwnProperty(key) && data[key] !== '') {
|
|
9304
|
-
var expString = this.replaceRegex(data[key]);
|
|
9323
|
+
var expString = this.replaceRegex(data["" + key]);
|
|
9305
9324
|
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>') {
|
|
9325
|
+
var startExp = data["" + key].length;
|
|
9326
|
+
var endExp = (data["" + key] === '<sup>' || data["" + key] === '<sub>') ? data["" + key].length + 1 : data["" + key].length;
|
|
9327
|
+
if (data["" + key] === '<sup>') {
|
|
9309
9328
|
// eslint-disable-next-line
|
|
9310
9329
|
regExp = new RegExp('<sup>(.*?)<\/sup>', 'ig');
|
|
9311
9330
|
}
|
|
9312
|
-
else if (data[key] === '<sub>') {
|
|
9331
|
+
else if (data["" + key] === '<sub>') {
|
|
9313
9332
|
// eslint-disable-next-line
|
|
9314
9333
|
regExp = new RegExp('<sub>(.*?)<\/sub>', 'ig');
|
|
9315
9334
|
}
|
|
9316
9335
|
else {
|
|
9336
|
+
// eslint-disable-next-line
|
|
9317
9337
|
regExp = new RegExp(expString + '(.*?)' + expString, 'ig');
|
|
9318
9338
|
}
|
|
9319
9339
|
var val = text.match(regExp);
|
|
9320
9340
|
for (var index = 0; val && index < val.length && val[index] !== ''; index++) {
|
|
9341
|
+
// eslint-disable-next-line max-len
|
|
9321
9342
|
text = text.replace(val[index], val[index].substr(startExp, val[index].length - endExp - startExp));
|
|
9322
9343
|
}
|
|
9323
9344
|
}
|
|
@@ -9339,8 +9360,8 @@ var ClearFormat = /** @__PURE__ @class */ (function () {
|
|
|
9339
9360
|
var key = keys[index];
|
|
9340
9361
|
// eslint-disable-next-line
|
|
9341
9362
|
if (data.hasOwnProperty(key) && data[key] !== '') {
|
|
9342
|
-
if (lines[len].indexOf(data[key]) === 0) {
|
|
9343
|
-
lines[len] = lines[len].replace(data[key], '');
|
|
9363
|
+
if (lines[len].indexOf(data["" + key]) === 0) {
|
|
9364
|
+
lines[len] = lines[len].replace(data["" + key], '');
|
|
9344
9365
|
lines[len] = this.clearFormatLines([lines[len]]);
|
|
9345
9366
|
}
|
|
9346
9367
|
}
|
|
@@ -10144,6 +10165,7 @@ var NodeSelection = /** @__PURE__ @class */ (function () {
|
|
|
10144
10165
|
*/
|
|
10145
10166
|
NodeSelection.prototype.getSelectionNodes = function (nodeCollection) {
|
|
10146
10167
|
nodeCollection = nodeCollection.reverse();
|
|
10168
|
+
// eslint-disable-next-line
|
|
10147
10169
|
var regEx = new RegExp(String.fromCharCode(8203), 'g');
|
|
10148
10170
|
for (var index = 0; index < nodeCollection.length; index++) {
|
|
10149
10171
|
if (nodeCollection[index].nodeType !== 3 || (nodeCollection[index].textContent.trim() === '' ||
|
|
@@ -10164,6 +10186,7 @@ var NodeSelection = /** @__PURE__ @class */ (function () {
|
|
|
10164
10186
|
*/
|
|
10165
10187
|
NodeSelection.prototype.getSelectionNodesBr = function (nodeCollection) {
|
|
10166
10188
|
nodeCollection = nodeCollection.reverse();
|
|
10189
|
+
// eslint-disable-next-line
|
|
10167
10190
|
var regEx = new RegExp(String.fromCharCode(8203), 'g');
|
|
10168
10191
|
for (var index = 0; index < nodeCollection.length; index++) {
|
|
10169
10192
|
if (nodeCollection[index].nodeName !== 'BR' &&
|
|
@@ -10497,7 +10520,7 @@ var DOMNode = /** @__PURE__ @class */ (function () {
|
|
|
10497
10520
|
var orderRawAttr = Object.keys(rawAttr).sort();
|
|
10498
10521
|
for (var e = 0; e < orderRawAttr.length; e++) {
|
|
10499
10522
|
var attrKey = orderRawAttr[e];
|
|
10500
|
-
var attrValue = rawAttr[attrKey];
|
|
10523
|
+
var attrValue = rawAttr["" + attrKey];
|
|
10501
10524
|
/* eslint-disable */
|
|
10502
10525
|
if (attrValue.indexOf("'") < 0 && attrValue.indexOf('"') >= 0) {
|
|
10503
10526
|
attr += ' ' + attrKey + "='" + attrValue + "'";
|
|
@@ -11249,8 +11272,15 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
11249
11272
|
range.startContainer.parentElement.closest('LI');
|
|
11250
11273
|
var endNode = range.endContainer.nodeName === 'LI' ? range.endContainer :
|
|
11251
11274
|
range.endContainer.parentElement.closest('LI');
|
|
11275
|
+
// Checks for Image, Audio , Video Element inside List Element
|
|
11276
|
+
var hasMediaElem = false;
|
|
11277
|
+
if (!isNullOrUndefined(startNode)) {
|
|
11278
|
+
var videoElemList = startNode.querySelectorAll('.e-video-clickelem');
|
|
11279
|
+
var embedVideoElem = videoElemList.length > 0 && videoElemList[0].childNodes[0].nodeName === 'IFRAME';
|
|
11280
|
+
hasMediaElem = startNode.querySelectorAll('IMG').length > 0 || startNode.querySelectorAll('AUDIO').length > 0 || startNode.querySelectorAll('VIDEO').length > 0 || embedVideoElem;
|
|
11281
|
+
}
|
|
11252
11282
|
if (!isNullOrUndefined(startNode) && !isNullOrUndefined(endNode) && startNode === endNode && startNode.tagName === 'LI' &&
|
|
11253
|
-
startNode.textContent.trim() === '' &&
|
|
11283
|
+
startNode.textContent.trim() === '' && !hasMediaElem) {
|
|
11254
11284
|
if (startNode.innerHTML.indexOf(' ') >= 0) {
|
|
11255
11285
|
return;
|
|
11256
11286
|
}
|
|
@@ -11287,7 +11317,6 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
11287
11317
|
}
|
|
11288
11318
|
}
|
|
11289
11319
|
};
|
|
11290
|
-
// eslint-disable-next-line
|
|
11291
11320
|
Lists.prototype.backspaceList = function (e) {
|
|
11292
11321
|
var range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
|
|
11293
11322
|
var startNode = this.parent.domNode.getSelectedNode(range.startContainer, range.startOffset);
|
|
@@ -11373,7 +11402,8 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
11373
11402
|
detach(currentLIElem);
|
|
11374
11403
|
}
|
|
11375
11404
|
};
|
|
11376
|
-
|
|
11405
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11406
|
+
Lists.prototype.firstListBackSpace = function (range, _e) {
|
|
11377
11407
|
var startNode = this.parent.domNode.getSelectedNode(range.startContainer, range.startOffset);
|
|
11378
11408
|
if (!isNullOrUndefined(startNode.closest('OL'))) {
|
|
11379
11409
|
this.commonLIParent = startNode.closest('OL');
|
|
@@ -11636,6 +11666,7 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
11636
11666
|
range.startOffset]) || range.startContainer);
|
|
11637
11667
|
var endNode = (range.endContainer.childNodes[(range.endOffset > 0) ? (range.endOffset - 1) :
|
|
11638
11668
|
range.endOffset] || range.endContainer);
|
|
11669
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11639
11670
|
var lastSelectionNode = endNode.lastChild.nodeName === 'BR' ? (isNullOrUndefined(endNode.lastChild.previousSibling) ? endNode
|
|
11640
11671
|
: endNode.lastChild.previousSibling) : endNode.lastChild;
|
|
11641
11672
|
while (!isNullOrUndefined(lastSelectionNode) && lastSelectionNode.nodeName !== '#text' && lastSelectionNode.nodeName !== 'IMG' &&
|
|
@@ -11776,8 +11807,8 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
11776
11807
|
var openTag = '<' + type + '>';
|
|
11777
11808
|
var closeTag = '</' + type + '>';
|
|
11778
11809
|
var newTag = 'li' + elemAtt;
|
|
11779
|
-
var replaceHTML = (elements[i].tagName.toLowerCase() === DEFAULT_TAG ?
|
|
11780
|
-
elements[i].outerHTML);
|
|
11810
|
+
var replaceHTML = (elements[i].tagName.toLowerCase() === DEFAULT_TAG ?
|
|
11811
|
+
elements[i].innerHTML : elements[i].outerHTML);
|
|
11781
11812
|
var innerHTML = this.domNode.createTagString(newTag, null, replaceHTML);
|
|
11782
11813
|
var collectionString = openTag + innerHTML + closeTag;
|
|
11783
11814
|
this.domNode.replaceWith(elements[i], collectionString);
|
|
@@ -11788,8 +11819,8 @@ var Lists = /** @__PURE__ @class */ (function () {
|
|
|
11788
11819
|
var openTag = '<' + type + elemAtt + '>';
|
|
11789
11820
|
var closeTag = '</' + type + '>';
|
|
11790
11821
|
var newTag = 'li';
|
|
11791
|
-
var replaceHTML = (elements[i].tagName.toLowerCase() === DEFAULT_TAG ?
|
|
11792
|
-
elements[i].outerHTML);
|
|
11822
|
+
var replaceHTML = (elements[i].tagName.toLowerCase() === DEFAULT_TAG ?
|
|
11823
|
+
elements[i].innerHTML : elements[i].outerHTML);
|
|
11793
11824
|
var innerHTML = this.domNode.createTagString(newTag, null, replaceHTML);
|
|
11794
11825
|
var collectionString = openTag + innerHTML + closeTag;
|
|
11795
11826
|
this.domNode.replaceWith(elements[i], collectionString);
|
|
@@ -12407,6 +12438,7 @@ var Formats = /** @__PURE__ @class */ (function () {
|
|
|
12407
12438
|
}
|
|
12408
12439
|
};
|
|
12409
12440
|
Formats.prototype.removeCodeContent = function (range) {
|
|
12441
|
+
// eslint-disable-next-line
|
|
12410
12442
|
var regEx = new RegExp(String.fromCharCode(65279), 'g');
|
|
12411
12443
|
if (!isNullOrUndefined(range.endContainer.textContent.match(regEx))) {
|
|
12412
12444
|
var pointer = range.endContainer.textContent.charCodeAt(range.endOffset - 1) === 65279 ?
|
|
@@ -13311,7 +13343,8 @@ var LinkCommand = /** @__PURE__ @class */ (function () {
|
|
|
13311
13343
|
finalinlineNodes[j_1] = inlineNodes[i];
|
|
13312
13344
|
}
|
|
13313
13345
|
if (inlineNodes.length > 1 && i < inlineNodes.length - 1) {
|
|
13314
|
-
if ((inlineNodes[i].parentElement === inlineNodes[i + 1].parentElement) &&
|
|
13346
|
+
if ((inlineNodes[i].parentElement === inlineNodes[i + 1].parentElement) &&
|
|
13347
|
+
(inlineNodes[i] === inlineNodes[i + 1])) {
|
|
13315
13348
|
continue;
|
|
13316
13349
|
}
|
|
13317
13350
|
else {
|
|
@@ -13408,6 +13441,7 @@ var LinkCommand = /** @__PURE__ @class */ (function () {
|
|
|
13408
13441
|
return arr.join(' ') + ' ';
|
|
13409
13442
|
};
|
|
13410
13443
|
LinkCommand.prototype.openLink = function (e) {
|
|
13444
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
|
13411
13445
|
document.defaultView.open(e.item.url, e.item.target);
|
|
13412
13446
|
this.callBack(e);
|
|
13413
13447
|
};
|
|
@@ -13875,6 +13909,7 @@ var ImageCommand = /** @__PURE__ @class */ (function () {
|
|
|
13875
13909
|
this.callBack(e);
|
|
13876
13910
|
};
|
|
13877
13911
|
ImageCommand.prototype.openImageLink = function (e) {
|
|
13912
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
|
13878
13913
|
document.defaultView.open(e.item.url, e.item.target);
|
|
13879
13914
|
this.callBack(e);
|
|
13880
13915
|
};
|
|
@@ -14361,8 +14396,8 @@ var VideoCommand = /** @__PURE__ @class */ (function () {
|
|
|
14361
14396
|
videoElm_1.load();
|
|
14362
14397
|
}
|
|
14363
14398
|
if (Browser.userAgent.indexOf('Firefox') !== -1) {
|
|
14364
|
-
vidElement.addEventListener('play', function (
|
|
14365
|
-
vidElement.addEventListener('pause', function (
|
|
14399
|
+
vidElement.addEventListener('play', function () { _this.editAreaVideoClick(e); });
|
|
14400
|
+
vidElement.addEventListener('pause', function () { _this.editAreaVideoClick(e); });
|
|
14366
14401
|
}
|
|
14367
14402
|
}
|
|
14368
14403
|
};
|
|
@@ -14602,6 +14637,7 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
14602
14637
|
var newRow = createElement('tr');
|
|
14603
14638
|
var isHeaderSelect = this.curTable.querySelectorAll('th.e-cell-select').length > 0;
|
|
14604
14639
|
for (var i = 0; i < allCells[minVal].length; i++) {
|
|
14640
|
+
// eslint-disable-next-line max-len
|
|
14605
14641
|
if (isBelow && minVal < allCells.length - 1 && allCells[minVal][i] === allCells[minVal + 1][i] ||
|
|
14606
14642
|
!isBelow && 0 < minVal && allCells[minVal][i] === allCells[minVal - 1][i]) {
|
|
14607
14643
|
if (0 === i || 0 < i && allCells[minVal][i] !== allCells[minVal][i - 1]) {
|
|
@@ -14781,10 +14817,12 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
14781
14817
|
1 === rowSpanVal ? allCells[maxI][j].removeAttribute('rowspan') : allCells[maxI][j].setAttribute('rowspan', rowSpanVal.toString());
|
|
14782
14818
|
}
|
|
14783
14819
|
}
|
|
14820
|
+
// eslint-disable-next-line max-len
|
|
14784
14821
|
if (maxI < allCells.length - 1 && allCells[maxI][j] === allCells[maxI + 1][j] && (0 === maxI ||
|
|
14785
14822
|
allCells[maxI][j] !== allCells[maxI - 1][j])) {
|
|
14786
14823
|
var element = allCells[maxI][j];
|
|
14787
14824
|
var index = void 0;
|
|
14825
|
+
// eslint-disable-next-line max-len
|
|
14788
14826
|
for (index = j; 0 < index && allCells[maxI][index] === allCells[maxI][index - 1]; index--) {
|
|
14789
14827
|
if (index === 0) {
|
|
14790
14828
|
this.curTable.rows[maxI + 1].prepend(element);
|
|
@@ -14997,6 +15035,7 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
14997
15035
|
for (rowValue = min; rowValue <= max; rowValue++) {
|
|
14998
15036
|
// eslint-disable-next-line
|
|
14999
15037
|
if (!(min < rowValue && eleArray[rowValue][0] === eleArray[rowValue - 1][0])
|
|
15038
|
+
// eslint-disable-next-line no-cond-assign
|
|
15000
15039
|
&& eleArray[rowValue][0] && 1 < (index = Math.min(parseInt(eleArray[rowValue][0].getAttribute('rowspan'), 10) ||
|
|
15001
15040
|
1, max - min + 1)) && eleArray[rowValue][0] === eleArray[rowValue + 1][0]) {
|
|
15002
15041
|
for (count = index - 1, colIndex = 1; colIndex < eleArray[0].length; colIndex++) {
|
|
@@ -15033,6 +15072,7 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
15033
15072
|
min < rowIndex && elements[rowIndex][colIndex] === elements[rowIndex - 1][colIndex] ||
|
|
15034
15073
|
firstIndex < colIndex && elements[rowIndex][colIndex] === elements[rowIndex][colIndex - 1] ||
|
|
15035
15074
|
1 < (spanCount = parseInt(elements[rowIndex][colIndex].getAttribute(attr), 10) || 1) &&
|
|
15075
|
+
// eslint-disable-next-line max-len
|
|
15036
15076
|
(1 < spanCount - index ? elements[rowIndex][colIndex].setAttribute(attr, (spanCount - index).toString()) :
|
|
15037
15077
|
elements[rowIndex][colIndex].removeAttribute(attr));
|
|
15038
15078
|
}
|
|
@@ -15096,6 +15136,7 @@ var TableCommand = /** @__PURE__ @class */ (function () {
|
|
|
15096
15136
|
var colIndex = void 0;
|
|
15097
15137
|
for (avgRowIndex = activeCellIndex[0] + Math.ceil(activeCellRowSpan / 2), colIndex = 0 === activeCellIndex[1] ? activeCellIndex[1]
|
|
15098
15138
|
: activeCellIndex[1] - 1; 0 <= colIndex && (correspondingCells[avgRowIndex][colIndex] ===
|
|
15139
|
+
// eslint-disable-next-line max-len
|
|
15099
15140
|
correspondingCells[avgRowIndex][colIndex - 1] || 0 < avgRowIndex && correspondingCells[avgRowIndex][colIndex]
|
|
15100
15141
|
=== correspondingCells[avgRowIndex - 1][colIndex]);) {
|
|
15101
15142
|
colIndex--;
|
|
@@ -15642,7 +15683,7 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15642
15683
|
var currentFormatNode = isFormatted.getFormattedNode(range.startContainer, format, endNode);
|
|
15643
15684
|
var currentSelector = !isNullOrUndefined(currentFormatNode) ?
|
|
15644
15685
|
(currentFormatNode.getAttribute('style') === null ? currentFormatNode.nodeName :
|
|
15645
|
-
currentFormatNode.nodeName +
|
|
15686
|
+
currentFormatNode.nodeName + '[style=\'' + currentFormatNode.getAttribute('style') + '\']') : null;
|
|
15646
15687
|
if (nodes.length > 0) {
|
|
15647
15688
|
isCollapsed = true;
|
|
15648
15689
|
range = nodeCutter.GetCursorRange(docElement, range, nodes[0]);
|
|
@@ -15651,7 +15692,9 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15651
15692
|
range.startOffset > 0 && range.startContainer.parentElement.firstElementChild.tagName.toLowerCase() !== 'br') ||
|
|
15652
15693
|
!isNullOrUndefined(currentFormatNode) && currentFormatNode ===
|
|
15653
15694
|
(range.startContainer.parentElement.closest(currentSelector)) &&
|
|
15654
|
-
((range.startContainer.parentElement.closest(currentSelector)).textContent.replace(
|
|
15695
|
+
((range.startContainer.parentElement.closest(currentSelector)).textContent.replace(
|
|
15696
|
+
// eslint-disable-next-line
|
|
15697
|
+
new RegExp(String.fromCharCode(8203), 'g'), '').trim().length !== 0))) {
|
|
15655
15698
|
isCollapsed = true;
|
|
15656
15699
|
range = nodeCutter.GetCursorRange(docElement, range, range.startContainer);
|
|
15657
15700
|
nodes.push(range.startContainer);
|
|
@@ -15686,15 +15729,6 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15686
15729
|
isSubSup = formatNode === null ? false : true;
|
|
15687
15730
|
}
|
|
15688
15731
|
}
|
|
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
15732
|
if (index === 0 && formatNode === null) {
|
|
15699
15733
|
isFormat = true;
|
|
15700
15734
|
}
|
|
@@ -15728,6 +15762,7 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15728
15762
|
if (cursorFormat) {
|
|
15729
15763
|
cursorNode = cursorNodes[0];
|
|
15730
15764
|
if (cursorFormat.firstChild.textContent.charCodeAt(0) === 8203 && cursorFormat.firstChild.nodeType === 3) {
|
|
15765
|
+
// eslint-disable-next-line
|
|
15731
15766
|
var regEx = new RegExp(String.fromCharCode(8203), 'g');
|
|
15732
15767
|
var emptySpaceNode = void 0;
|
|
15733
15768
|
if (cursorFormat.firstChild === cursorNode) {
|
|
@@ -15738,7 +15773,6 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15738
15773
|
cursorFormat.parentElement.firstChild && cursorFormat.parentElement.firstChild.nodeType === 1) ?
|
|
15739
15774
|
cursorNode.textContent : cursorNode.textContent.replace(regEx, ''));
|
|
15740
15775
|
emptySpaceNode = cursorNode;
|
|
15741
|
-
|
|
15742
15776
|
}
|
|
15743
15777
|
else {
|
|
15744
15778
|
cursorFormat.firstChild.textContent = cursorFormat.firstChild.textContent.replace(regEx, '');
|
|
@@ -15910,7 +15944,8 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15910
15944
|
}
|
|
15911
15945
|
if (child.length > 0 && isFontStyle) {
|
|
15912
15946
|
for (var num = 0; num < child.length; num++) {
|
|
15913
|
-
if (child[num].nodeType !== 3 || (child[num].textContent &&
|
|
15947
|
+
if (child[num].nodeType !== 3 || (child[num].textContent &&
|
|
15948
|
+
child[num].textContent.trim().length > 0)) {
|
|
15914
15949
|
child[num] = InsertMethods.Wrap(child[num], this.GetFormatNode(format, value, formatNodeTagName, formatNodeStyles));
|
|
15915
15950
|
if (child[num].textContent === startText) {
|
|
15916
15951
|
if (num === 0) {
|
|
@@ -15986,33 +16021,7 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
|
|
|
15986
16021
|
liElement.style.textDecoration = 'inherit';
|
|
15987
16022
|
}
|
|
15988
16023
|
}
|
|
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
|
-
}
|
|
16024
|
+
nodes[index] = this.applyStyles(nodes, index, element);
|
|
16016
16025
|
if (format === 'fontsize') {
|
|
16017
16026
|
var bg = closest(nodes[index].parentElement, 'span[style*=' + 'background-color' + ']');
|
|
16018
16027
|
if (!isNullOrUndefined(bg)) {
|
|
@@ -16427,7 +16436,8 @@ var ClearFormat$1 = /** @__PURE__ @class */ (function () {
|
|
|
16427
16436
|
this.unWrap(docElement, blockNodes, nodeCutter, nodeSelection);
|
|
16428
16437
|
}
|
|
16429
16438
|
else if (this.BLOCK_TAGS.indexOf(childNodes[index2].nodeName.toLocaleLowerCase()) > -1 &&
|
|
16430
|
-
childNodes[index2].parentNode.nodeName.toLocaleLowerCase() ===
|
|
16439
|
+
childNodes[index2].parentNode.nodeName.toLocaleLowerCase() ===
|
|
16440
|
+
childNodes[index2].nodeName.toLocaleLowerCase()) {
|
|
16431
16441
|
InsertMethods.unwrap(childNodes[index2]);
|
|
16432
16442
|
}
|
|
16433
16443
|
else if (this.BLOCK_TAGS.indexOf(childNodes[index2].nodeName.toLocaleLowerCase()) > -1 &&
|
|
@@ -16945,6 +16955,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
16945
16955
|
MsWordPaste.prototype.hexConversion = function (rtfData) {
|
|
16946
16956
|
// eslint-disable-next-line
|
|
16947
16957
|
var picHead = /\{\\pict[\s\S]+?\\bliptag\-?\d+(\\blipupi\-?\d+)?(\{\\\*\\blipuid\s?[\da-fA-F]+)?[\s\}]*?/;
|
|
16958
|
+
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
16948
16959
|
var pic = new RegExp('(?:(' + picHead.source + '))([\\da-fA-F\\s]+)\\}', 'g');
|
|
16949
16960
|
var fullImg = rtfData.match(pic);
|
|
16950
16961
|
var imgType;
|
|
@@ -17008,7 +17019,9 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
17008
17019
|
MsWordPaste.prototype.removeUnwantedElements = function (elm) {
|
|
17009
17020
|
var innerElement = elm.innerHTML;
|
|
17010
17021
|
for (var i = 0; i < this.removableElements.length; i++) {
|
|
17022
|
+
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
17011
17023
|
var regExpStartElem = new RegExp('<' + this.removableElements[i] + '>', 'g');
|
|
17024
|
+
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
17012
17025
|
var regExpEndElem = new RegExp('</' + this.removableElements[i] + '>', 'g');
|
|
17013
17026
|
innerElement = innerElement.replace(regExpStartElem, '');
|
|
17014
17027
|
innerElement = innerElement.replace(regExpEndElem, '');
|
|
@@ -17057,7 +17070,7 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
17057
17070
|
var styleClassObject_1 = !isNullOrUndefined(styles) ? this.findStyleObject(styles) : null;
|
|
17058
17071
|
var keys = Object.keys(styleClassObject_1);
|
|
17059
17072
|
var values = keys.map(function (key) {
|
|
17060
|
-
return styleClassObject_1[key];
|
|
17073
|
+
return styleClassObject_1["" + key];
|
|
17061
17074
|
});
|
|
17062
17075
|
values = this.removeUnwantedStyle(values, wordPasteStyleConfig);
|
|
17063
17076
|
this.filterStyles(elm, wordPasteStyleConfig);
|
|
@@ -17338,7 +17351,8 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
|
|
|
17338
17351
|
for (var j = 0; j < collection[index].nestedLevel - pLevel; j++) {
|
|
17339
17352
|
prevList.appendChild(temp = createElement(collection[index].listType));
|
|
17340
17353
|
prevList = createElement('li');
|
|
17341
|
-
if (j !== collection[index].nestedLevel - pLevel - 1 &&
|
|
17354
|
+
if (j !== collection[index].nestedLevel - pLevel - 1 &&
|
|
17355
|
+
collection[index].nestedLevel - pLevel > 1) {
|
|
17342
17356
|
prevList.style.listStyleType = 'none';
|
|
17343
17357
|
}
|
|
17344
17358
|
temp.appendChild(prevList);
|
|
@@ -17766,6 +17780,7 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
17766
17780
|
}
|
|
17767
17781
|
}
|
|
17768
17782
|
for (var index = 0; index < nodes.length; index++) {
|
|
17783
|
+
// eslint-disable-next-line max-len
|
|
17769
17784
|
formatCollection = this.getFormatParent(docElement, formatCollection, nodes[index], targetNode, formatNode, fontSize, fontName);
|
|
17770
17785
|
if ((index === 0 && formatCollection.bold) || !formatCollection.bold) {
|
|
17771
17786
|
nodeCollection.bold = formatCollection.bold;
|
|
@@ -17945,12 +17960,14 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
|
|
|
17945
17960
|
var index = null;
|
|
17946
17961
|
if ((name !== null && name !== '' && name !== undefined)
|
|
17947
17962
|
&& (fontName === null || fontName === undefined || (fontName.filter(function (value, pos) {
|
|
17963
|
+
// eslint-disable-next-line
|
|
17948
17964
|
var pattern = new RegExp(name, 'i');
|
|
17949
17965
|
if ((value.replace(/"/g, '').replace(/ /g, '').toLowerCase() === name.replace(/"/g, '').replace(/ /g, '').toLowerCase()) ||
|
|
17950
17966
|
(value.split(',')[0] && value.split(',')[0].search(pattern) > -1)) {
|
|
17951
17967
|
index = pos;
|
|
17952
17968
|
}
|
|
17953
17969
|
}) && (index !== null)))) {
|
|
17970
|
+
// eslint-disable-next-line
|
|
17954
17971
|
return (index !== null) ? fontName[index] : name.replace(/"/g, '');
|
|
17955
17972
|
}
|
|
17956
17973
|
else {
|
|
@@ -18552,10 +18569,12 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
18552
18569
|
var restrictKeys = [8, 9, 13, 16, 17, 18, 20, 27, 37, 38, 39, 40, 44, 45, 46, 91,
|
|
18553
18570
|
112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123];
|
|
18554
18571
|
var range = this.parent.getRange();
|
|
18572
|
+
// eslint-disable-next-line
|
|
18555
18573
|
var regEx = new RegExp(String.fromCharCode(8203), 'g');
|
|
18556
18574
|
var pointer;
|
|
18557
18575
|
if (restrictKeys.indexOf(args.keyCode) < 0 && !args.shiftKey && !args.ctrlKey && !args.altKey) {
|
|
18558
18576
|
pointer = range.startOffset;
|
|
18577
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
18559
18578
|
range.startContainer.nodeName === '#text' ? range.startContainer.parentElement.classList.add('currentStartMark') : range.startContainer.classList.add('currentStartMark');
|
|
18560
18579
|
if (range.startContainer.textContent.charCodeAt(0) === 8203) {
|
|
18561
18580
|
pointer = range.startOffset === 0 ? range.startOffset : range.startOffset - 1;
|
|
@@ -18564,22 +18583,32 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
|
|
|
18564
18583
|
}
|
|
18565
18584
|
var previousLength = this.parent.inputElement.innerHTML.length;
|
|
18566
18585
|
var currentLength = this.parent.inputElement.innerHTML.replace(regEx, '').length;
|
|
18586
|
+
var focusNode = range.startContainer;
|
|
18567
18587
|
if (previousLength > currentLength) {
|
|
18568
18588
|
var currentChild = this.parent.inputElement.firstChild;
|
|
18569
18589
|
while (!isNullOrUndefined(currentChild) && currentChild.textContent.replace(regEx, '').trim().length > 0) {
|
|
18570
18590
|
currentChild.innerHTML = currentChild.innerHTML.replace(regEx, '');
|
|
18571
18591
|
currentChild = currentChild.nextElementSibling;
|
|
18572
18592
|
}
|
|
18573
|
-
|
|
18574
|
-
|
|
18575
|
-
for (var i = 0; i <
|
|
18576
|
-
if (
|
|
18577
|
-
detach(
|
|
18593
|
+
var currentChildNode = this.parent.inputElement.querySelector('.currentStartMark').childNodes;
|
|
18594
|
+
if (currentChildNode.length > 1) {
|
|
18595
|
+
for (var i = 0; i < currentChildNode.length; i++) {
|
|
18596
|
+
if (currentChildNode[i].nodeName === '#text' && currentChildNode[i].textContent.length === 0) {
|
|
18597
|
+
detach(currentChildNode[i]);
|
|
18578
18598
|
i--;
|
|
18579
18599
|
}
|
|
18600
|
+
if (focusNode.textContent.replace(regEx, '') === currentChildNode[i].textContent) {
|
|
18601
|
+
pointer = focusNode.textContent.length > 1 ? focusNode.textContent.length - 1 : focusNode.textContent.length;
|
|
18602
|
+
focusNode = currentChildNode[i];
|
|
18603
|
+
}
|
|
18604
|
+
}
|
|
18605
|
+
}
|
|
18606
|
+
else if (currentChildNode.length === 1) {
|
|
18607
|
+
if (focusNode.textContent.replace(regEx, '') === currentChildNode[0].textContent) {
|
|
18608
|
+
focusNode = currentChildNode[0];
|
|
18580
18609
|
}
|
|
18581
18610
|
}
|
|
18582
|
-
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(),
|
|
18611
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), focusNode, pointer);
|
|
18583
18612
|
}
|
|
18584
18613
|
var currentElem = this.parent.inputElement.querySelector('.currentStartMark');
|
|
18585
18614
|
if (!isNullOrUndefined(currentElem)) {
|
|
@@ -19789,6 +19818,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
19789
19818
|
}
|
|
19790
19819
|
}
|
|
19791
19820
|
};
|
|
19821
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
19792
19822
|
PasteCleanup.prototype.setCssClass = function (e) {
|
|
19793
19823
|
if (this.popupObj && e.cssClass) {
|
|
19794
19824
|
if (isNullOrUndefined(e.oldCssClass)) {
|
|
@@ -20040,7 +20070,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
|
|
|
20040
20070
|
var groupingTags = deniedTags.slice();
|
|
20041
20071
|
var keys = Object.keys(pasteCleanupGroupingTags);
|
|
20042
20072
|
var values = keys.map(function (key) {
|
|
20043
|
-
return pasteCleanupGroupingTags[key];
|
|
20073
|
+
return pasteCleanupGroupingTags["" + key];
|
|
20044
20074
|
});
|
|
20045
20075
|
var addTags = [];
|
|
20046
20076
|
for (var i = 0; i < groupingTags.length; i++) {
|
|
@@ -20362,6 +20392,7 @@ var FileManager$1 = /** @__PURE__ @class */ (function () {
|
|
|
20362
20392
|
this.dialogObj.show(Browser.isDevice ? true : false);
|
|
20363
20393
|
this.setCssClass({ cssClass: this.parent.cssClass });
|
|
20364
20394
|
};
|
|
20395
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
20365
20396
|
FileManager$$1.prototype.setCssClass = function (e) {
|
|
20366
20397
|
if (this.dialogObj && e.cssClass) {
|
|
20367
20398
|
if (isNullOrUndefined(e.oldCssClass)) {
|
|
@@ -20638,6 +20669,7 @@ var FullScreen = /** @__PURE__ @class */ (function () {
|
|
|
20638
20669
|
_this.parent.toolbarModule.addFixedTBarClass();
|
|
20639
20670
|
}
|
|
20640
20671
|
}
|
|
20672
|
+
_this.parent.refreshUI();
|
|
20641
20673
|
_this.parent.trigger(actionComplete, { requestType: 'Minimize', targetItem: 'Minimize', args: event });
|
|
20642
20674
|
}
|
|
20643
20675
|
});
|
|
@@ -20726,33 +20758,33 @@ function setAttributes(htmlAttributes, rte, isFrame, initial) {
|
|
|
20726
20758
|
for (var _i = 0, _a = Object.keys(htmlAttributes); _i < _a.length; _i++) {
|
|
20727
20759
|
var htmlAttr = _a[_i];
|
|
20728
20760
|
if (htmlAttr === 'class') {
|
|
20729
|
-
target.classList.add(htmlAttributes[htmlAttr]);
|
|
20761
|
+
target.classList.add(htmlAttributes["" + htmlAttr]);
|
|
20730
20762
|
}
|
|
20731
|
-
else if (htmlAttr === 'disabled' && htmlAttributes[htmlAttr] === 'disabled') {
|
|
20763
|
+
else if (htmlAttr === 'disabled' && htmlAttributes["" + htmlAttr] === 'disabled') {
|
|
20732
20764
|
rte.enabled = false;
|
|
20733
20765
|
rte.setEnable();
|
|
20734
20766
|
}
|
|
20735
|
-
else if (htmlAttr === 'readonly' && htmlAttributes[htmlAttr] === 'readonly') {
|
|
20767
|
+
else if (htmlAttr === 'readonly' && htmlAttributes["" + htmlAttr] === 'readonly') {
|
|
20736
20768
|
rte.readonly = true;
|
|
20737
20769
|
rte.setReadOnly(initial);
|
|
20738
20770
|
}
|
|
20739
20771
|
else if (htmlAttr === 'style') {
|
|
20740
|
-
target.setAttribute('style', htmlAttributes[htmlAttr]);
|
|
20772
|
+
target.setAttribute('style', htmlAttributes["" + htmlAttr]);
|
|
20741
20773
|
}
|
|
20742
20774
|
else if (htmlAttr === 'tabindex') {
|
|
20743
|
-
rte.inputElement.setAttribute('tabindex', htmlAttributes[htmlAttr]);
|
|
20775
|
+
rte.inputElement.setAttribute('tabindex', htmlAttributes["" + htmlAttr]);
|
|
20744
20776
|
}
|
|
20745
20777
|
else if (htmlAttr === 'placeholder') {
|
|
20746
|
-
rte.placeholder = htmlAttributes[htmlAttr];
|
|
20778
|
+
rte.placeholder = htmlAttributes["" + htmlAttr];
|
|
20747
20779
|
rte.setPlaceHolder();
|
|
20748
20780
|
}
|
|
20749
20781
|
else {
|
|
20750
20782
|
var validateAttr = ['name', 'required'];
|
|
20751
20783
|
if (validateAttr.indexOf(htmlAttr) > -1) {
|
|
20752
|
-
rte.valueContainer.setAttribute(htmlAttr, htmlAttributes[htmlAttr]);
|
|
20784
|
+
rte.valueContainer.setAttribute(htmlAttr, htmlAttributes["" + htmlAttr]);
|
|
20753
20785
|
}
|
|
20754
20786
|
else {
|
|
20755
|
-
target.setAttribute(htmlAttr, htmlAttributes[htmlAttr]);
|
|
20787
|
+
target.setAttribute(htmlAttr, htmlAttributes["" + htmlAttr]);
|
|
20756
20788
|
}
|
|
20757
20789
|
}
|
|
20758
20790
|
}
|
|
@@ -20948,6 +20980,7 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
20948
20980
|
}
|
|
20949
20981
|
}
|
|
20950
20982
|
};
|
|
20983
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
20951
20984
|
Link.prototype.setCssClass = function (e) {
|
|
20952
20985
|
this.updateCss(this.checkBoxObj, e);
|
|
20953
20986
|
this.updateCss(this.dialogObj, e);
|
|
@@ -21121,13 +21154,13 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
21121
21154
|
});
|
|
21122
21155
|
var htmlTextbox = (this.parent.editorMode === 'HTML') ? '<label>' + linkTooltip +
|
|
21123
21156
|
'</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>' +
|
|
21157
|
+
'<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
21158
|
'<div class="e-rte-label' + ' ' + this.parent.cssClass + '"></div>' + '<div class="e-rte-field' + ' ' + this.parent.cssClass + '">' +
|
|
21126
21159
|
'<input type="checkbox" class="e-rte-linkTarget' + ' ' + this.parent.cssClass + '" data-role ="none"></div>' : '';
|
|
21127
21160
|
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>' +
|
|
21161
|
+
'<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
21162
|
'<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 + '">' +
|
|
21163
|
+
'<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
21164
|
'</div><div class="e-rte-label' + ' ' + this.parent.cssClass + '">' + htmlTextbox;
|
|
21132
21165
|
var contentElem = parseHtml(content);
|
|
21133
21166
|
linkContent.appendChild(contentElem);
|
|
@@ -21153,7 +21186,7 @@ var Link = /** @__PURE__ @class */ (function () {
|
|
|
21153
21186
|
cssClass: CLS_RTE_ELEMENTS + ' ' + this.parent.cssClass,
|
|
21154
21187
|
enableRtl: this.parent.enableRtl,
|
|
21155
21188
|
locale: this.parent.locale,
|
|
21156
|
-
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '310px',
|
|
21189
|
+
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '310px',
|
|
21157
21190
|
isModal: Browser.isDevice,
|
|
21158
21191
|
buttons: [{
|
|
21159
21192
|
click: this.insertlink.bind(selectObj),
|
|
@@ -21496,6 +21529,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
21496
21529
|
}
|
|
21497
21530
|
}
|
|
21498
21531
|
};
|
|
21532
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
21499
21533
|
Image.prototype.setCssClass = function (e) {
|
|
21500
21534
|
if (this.popupObj && e.cssClass) {
|
|
21501
21535
|
if (isNullOrUndefined(e.oldCssClass)) {
|
|
@@ -21689,8 +21723,8 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
21689
21723
|
var pos = this.calcPos(e);
|
|
21690
21724
|
var top = pos.top;
|
|
21691
21725
|
var left = pos.left;
|
|
21692
|
-
var imgWid = e.width;
|
|
21693
|
-
var imgHgt = e.height;
|
|
21726
|
+
var imgWid = e.getBoundingClientRect().width;
|
|
21727
|
+
var imgHgt = e.getBoundingClientRect().height;
|
|
21694
21728
|
var borWid = (Browser.isDevice) ? (4 * parseInt((e.style.outline.slice(-3)), 10)) + 2 :
|
|
21695
21729
|
(2 * parseInt((e.style.outline.slice(-3)), 10)) + 2; //span border width + image outline width
|
|
21696
21730
|
var devWid = ((Browser.isDevice) ? 0 : 2); // span border width
|
|
@@ -21717,7 +21751,6 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
21717
21751
|
offsetParent = offsetParent.parentNode;
|
|
21718
21752
|
}
|
|
21719
21753
|
if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) {
|
|
21720
|
-
// eslint-disable-next-line
|
|
21721
21754
|
parentOffset = offsetParent.getBoundingClientRect();
|
|
21722
21755
|
}
|
|
21723
21756
|
if (elem.offsetParent && (elem.offsetParent.classList.contains('e-img-caption'))) {
|
|
@@ -21738,6 +21771,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
21738
21771
|
if (isNullOrUndefined(img.width)) {
|
|
21739
21772
|
return;
|
|
21740
21773
|
}
|
|
21774
|
+
// eslint-disable-next-line security/detect-unsafe-regex
|
|
21741
21775
|
var width = img.style.width !== '' ? img.style.width.match(/^\d+(\.\d*)?%$/g) ? parseFloat(img.style.width) :
|
|
21742
21776
|
parseInt(img.style.width, 10) : img.width;
|
|
21743
21777
|
var height = img.style.height !== '' ? parseInt(img.style.height, 10) : img.height;
|
|
@@ -22538,6 +22572,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
22538
22572
|
}
|
|
22539
22573
|
};
|
|
22540
22574
|
Image.prototype.imageRemovePost = function (src) {
|
|
22575
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
22541
22576
|
var proxy = this;
|
|
22542
22577
|
var absoluteUrl = '';
|
|
22543
22578
|
if (isNullOrUndefined(this.parent.insertImageSettings.removeUrl) || this.parent.insertImageSettings.removeUrl === '') {
|
|
@@ -22549,8 +22584,9 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
22549
22584
|
else {
|
|
22550
22585
|
absoluteUrl = new URL(src, document.baseURI).href;
|
|
22551
22586
|
}
|
|
22552
|
-
this.removingImgName = absoluteUrl.replace(/^.*[
|
|
22587
|
+
this.removingImgName = absoluteUrl.replace(/^.*[\\/]/, '');
|
|
22553
22588
|
var xhr = new XMLHttpRequest();
|
|
22589
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
22554
22590
|
xhr.addEventListener('readystatechange', function () {
|
|
22555
22591
|
if (this.readyState === 4 && this.status === 200) {
|
|
22556
22592
|
proxy.triggerPost(this.response);
|
|
@@ -22565,6 +22601,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
22565
22601
|
if (isNullOrUndefined(removeUrl) || removeUrl === '') {
|
|
22566
22602
|
return;
|
|
22567
22603
|
}
|
|
22604
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
22568
22605
|
var file = new File([response], this.removingImgName);
|
|
22569
22606
|
var ajax = new Ajax(removeUrl, 'POST', true, null);
|
|
22570
22607
|
var formData = new FormData();
|
|
@@ -22714,7 +22751,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
22714
22751
|
cssClass: CLS_RTE_ELEMENTS + ' ' + this.parent.cssClass,
|
|
22715
22752
|
enableRtl: this.parent.enableRtl,
|
|
22716
22753
|
locale: this.parent.locale,
|
|
22717
|
-
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
|
|
22754
|
+
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
|
|
22718
22755
|
position: { X: 'center', Y: (Browser.isDevice) ? 'center' : 'top' },
|
|
22719
22756
|
isModal: Browser.isDevice,
|
|
22720
22757
|
buttons: [{
|
|
@@ -22863,7 +22900,7 @@ var Image = /** @__PURE__ @class */ (function () {
|
|
|
22863
22900
|
var placeUrl = this.i10n.getConstant('imageUrl');
|
|
22864
22901
|
this.inputUrl = this.parent.createElement('input', {
|
|
22865
22902
|
className: 'e-input e-img-url' + ' ' + this.parent.cssClass,
|
|
22866
|
-
attrs: { placeholder: placeUrl, spellcheck: 'false' }
|
|
22903
|
+
attrs: { placeholder: placeUrl, spellcheck: 'false', 'aria-label': this.i10n.getConstant('imageLinkHeader') }
|
|
22867
22904
|
});
|
|
22868
22905
|
this.inputUrl.addEventListener('input', function () {
|
|
22869
22906
|
if (!isNullOrUndefined(_this.inputUrl)) {
|
|
@@ -23800,6 +23837,7 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
23800
23837
|
}
|
|
23801
23838
|
}
|
|
23802
23839
|
};
|
|
23840
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
23803
23841
|
Audio.prototype.touchStart = function (e, ele) {
|
|
23804
23842
|
if (this.parent.readonly) {
|
|
23805
23843
|
return;
|
|
@@ -24006,6 +24044,7 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
24006
24044
|
}
|
|
24007
24045
|
};
|
|
24008
24046
|
Audio.prototype.audioRemovePost = function (src) {
|
|
24047
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
24009
24048
|
var proxy = this;
|
|
24010
24049
|
var absoluteUrl = '';
|
|
24011
24050
|
if (isNullOrUndefined(this.parent.insertAudioSettings.removeUrl) || this.parent.insertAudioSettings.removeUrl === '') {
|
|
@@ -24017,8 +24056,9 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
24017
24056
|
else {
|
|
24018
24057
|
absoluteUrl = new URL(src, document.baseURI).href;
|
|
24019
24058
|
}
|
|
24020
|
-
this.removingAudioName = absoluteUrl.replace(/^.*[
|
|
24059
|
+
this.removingAudioName = absoluteUrl.replace(/^.*[\\/]/, '');
|
|
24021
24060
|
var xhr = new XMLHttpRequest();
|
|
24061
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
24022
24062
|
xhr.addEventListener('readystatechange', function () {
|
|
24023
24063
|
if (this.readyState === 4 && this.status === 200) {
|
|
24024
24064
|
proxy.triggerPost(this.response);
|
|
@@ -24052,6 +24092,7 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
24052
24092
|
}
|
|
24053
24093
|
}
|
|
24054
24094
|
if (this.isAudioElem(e.target)) {
|
|
24095
|
+
this.audEle = e.target.querySelector('audio');
|
|
24055
24096
|
e.preventDefault();
|
|
24056
24097
|
}
|
|
24057
24098
|
};
|
|
@@ -24191,8 +24232,6 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
24191
24232
|
addClass([target.querySelector('audio')], [CLS_AUD_FOCUS]);
|
|
24192
24233
|
target.querySelector('audio').style.outline = '2px solid #4a90e2';
|
|
24193
24234
|
}
|
|
24194
|
-
var pageY = (this.parent.iframeSettings.enable) ? window.pageYOffset +
|
|
24195
|
-
this.parent.element.getBoundingClientRect().top + args.clientY : args.pageY;
|
|
24196
24235
|
if (this.parent.quickToolbarModule.audioQTBar) {
|
|
24197
24236
|
if (e.isNotify) {
|
|
24198
24237
|
setTimeout(function () {
|
|
@@ -24248,7 +24287,7 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
24248
24287
|
cssClass: CLS_RTE_ELEMENTS,
|
|
24249
24288
|
enableRtl: this.parent.enableRtl,
|
|
24250
24289
|
locale: this.parent.locale,
|
|
24251
|
-
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
|
|
24290
|
+
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
|
|
24252
24291
|
position: { X: 'center', Y: (Browser.isDevice) ? 'center' : 'top' },
|
|
24253
24292
|
isModal: Browser.isDevice,
|
|
24254
24293
|
buttons: [{
|
|
@@ -24320,7 +24359,7 @@ var Audio = /** @__PURE__ @class */ (function () {
|
|
|
24320
24359
|
var placeUrl = this.i10n.getConstant('audioUrl');
|
|
24321
24360
|
this.inputUrl = this.parent.createElement('input', {
|
|
24322
24361
|
className: 'e-input e-audio-url',
|
|
24323
|
-
attrs: { placeholder: placeUrl, spellcheck: 'false' }
|
|
24362
|
+
attrs: { placeholder: placeUrl, spellcheck: 'false', 'aria-label': this.i10n.getConstant('audioLinkHeader') }
|
|
24324
24363
|
});
|
|
24325
24364
|
this.inputUrl.addEventListener('input', function () {
|
|
24326
24365
|
if (!isNullOrUndefined(_this.inputUrl)) {
|
|
@@ -24952,7 +24991,6 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
24952
24991
|
offsetParent = offsetParent.parentNode;
|
|
24953
24992
|
}
|
|
24954
24993
|
if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) {
|
|
24955
|
-
// eslint-disable-next-line
|
|
24956
24994
|
parentOffset = offsetParent.getBoundingClientRect();
|
|
24957
24995
|
}
|
|
24958
24996
|
if (elem && elem.nodeType === 1 && elem.tagName === 'IFRAME') {
|
|
@@ -24974,6 +25012,7 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
24974
25012
|
if (isNullOrUndefined(vidEleStyle)) {
|
|
24975
25013
|
return;
|
|
24976
25014
|
}
|
|
25015
|
+
// eslint-disable-next-line
|
|
24977
25016
|
var width = vidEleStyle.width !== '' ? vidEleStyle.width.match(/^\d+(\.\d*)?%$/g) ? parseFloat(vidEleStyle.width) :
|
|
24978
25017
|
parseInt(vidEleStyle.width, 10) : vid.style.width !== '' ? vid.style.width : vid.width;
|
|
24979
25018
|
var height = vidEleStyle.height !== '' ? parseInt(vidEleStyle.height, 10) : vid.style.height !== '' ? vid.style.height : vid.height;
|
|
@@ -25372,6 +25411,7 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
25372
25411
|
}
|
|
25373
25412
|
};
|
|
25374
25413
|
Video.prototype.videoRemovePost = function (src) {
|
|
25414
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
25375
25415
|
var proxy = this;
|
|
25376
25416
|
var absoluteUrl = '';
|
|
25377
25417
|
if (isNullOrUndefined(this.parent.insertVideoSettings.removeUrl) || this.parent.insertVideoSettings.removeUrl === '') {
|
|
@@ -25383,8 +25423,10 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
25383
25423
|
else {
|
|
25384
25424
|
absoluteUrl = new URL(src, document.baseURI).href;
|
|
25385
25425
|
}
|
|
25426
|
+
// eslint-disable-next-line no-useless-escape
|
|
25386
25427
|
this.removingVideoName = absoluteUrl.replace(/^.*[\\\/]/, '');
|
|
25387
25428
|
var xhr = new XMLHttpRequest();
|
|
25429
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
25388
25430
|
xhr.addEventListener('readystatechange', function () {
|
|
25389
25431
|
if (this.readyState === 4 && this.status === 200) {
|
|
25390
25432
|
proxy.triggerPost(this.response);
|
|
@@ -25515,7 +25557,7 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
25515
25557
|
};
|
|
25516
25558
|
Video.prototype.showVideoQuickToolbar = function (e) {
|
|
25517
25559
|
var _this = this;
|
|
25518
|
-
if (e.type !== 'Videos' || isNullOrUndefined(this.parent.quickToolbarModule)
|
|
25560
|
+
if (e.type !== 'Videos' || e.args.detail === 2 || isNullOrUndefined(this.parent.quickToolbarModule)
|
|
25519
25561
|
|| isNullOrUndefined(this.parent.quickToolbarModule.videoQTBar) || isNullOrUndefined(e.args)) {
|
|
25520
25562
|
return;
|
|
25521
25563
|
}
|
|
@@ -25548,6 +25590,12 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
25548
25590
|
Video.prototype.hideVideoQuickToolbar = function () {
|
|
25549
25591
|
if (!isNullOrUndefined(this.contentModule.getEditPanel().querySelector('.' + CLS_VID_FOCUS))) {
|
|
25550
25592
|
removeClass([this.contentModule.getEditPanel().querySelector('.' + CLS_VID_FOCUS)], CLS_VID_FOCUS);
|
|
25593
|
+
if (!isNullOrUndefined(this.videoEle)) {
|
|
25594
|
+
this.videoEle.style.outline = '';
|
|
25595
|
+
}
|
|
25596
|
+
if (!isNullOrUndefined(this.contentModule.getEditPanel().querySelector('.e-vid-resize'))) {
|
|
25597
|
+
detach(this.contentModule.getEditPanel().querySelector('.e-vid-resize'));
|
|
25598
|
+
}
|
|
25551
25599
|
if (this.quickToolObj && this.quickToolObj.videoQTBar && document.body.contains(this.quickToolObj.videoQTBar.element)) {
|
|
25552
25600
|
this.quickToolObj.videoQTBar.hidePopup();
|
|
25553
25601
|
}
|
|
@@ -25593,7 +25641,7 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
25593
25641
|
cssClass: CLS_RTE_ELEMENTS,
|
|
25594
25642
|
enableRtl: this.parent.enableRtl,
|
|
25595
25643
|
locale: this.parent.locale,
|
|
25596
|
-
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
|
|
25644
|
+
showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
|
|
25597
25645
|
position: { X: 'center', Y: (Browser.isDevice) ? 'center' : 'top' },
|
|
25598
25646
|
isModal: Browser.isDevice,
|
|
25599
25647
|
buttons: [{
|
|
@@ -25676,7 +25724,7 @@ var Video = /** @__PURE__ @class */ (function () {
|
|
|
25676
25724
|
videoUrl.appendChild(urlContent);
|
|
25677
25725
|
this.embedInputUrl = this.parent.createElement('textarea', {
|
|
25678
25726
|
className: 'e-input e-embed-video-url',
|
|
25679
|
-
attrs: { placeholder: 'Paste Embed URL here', type: 'text', tabindex: '-1' }
|
|
25727
|
+
attrs: { placeholder: 'Paste Embed URL here', type: 'text', tabindex: '-1', 'aria-label': this.i10n.getConstant('embedVideoLinkHeader') }
|
|
25680
25728
|
});
|
|
25681
25729
|
this.embedInputUrl.addEventListener('keyup', function () {
|
|
25682
25730
|
if (!isNullOrUndefined(_this.embedInputUrl)) {
|
|
@@ -26326,6 +26374,7 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
26326
26374
|
}
|
|
26327
26375
|
}
|
|
26328
26376
|
};
|
|
26377
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
26329
26378
|
Table.prototype.setCssClass = function (e) {
|
|
26330
26379
|
if (this.popupObj && e.cssClass) {
|
|
26331
26380
|
if (isNullOrUndefined(e.oldCssClass)) {
|
|
@@ -26458,18 +26507,17 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
26458
26507
|
}
|
|
26459
26508
|
}
|
|
26460
26509
|
};
|
|
26510
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
26461
26511
|
Table.prototype.tableModulekeyUp = function (e) {
|
|
26462
|
-
var event = e.args;
|
|
26463
26512
|
if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) && this.contentModule) {
|
|
26464
26513
|
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
26514
|
var ele = this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range)[0];
|
|
26467
26515
|
ele = (ele && ele.tagName !== 'TD' && ele.tagName !== 'TH') ? ele.parentElement : ele;
|
|
26468
26516
|
if (ele && ele.tagName !== 'TD' && ele.tagName !== 'TH') {
|
|
26469
26517
|
var closestTd = closest(ele, 'td');
|
|
26470
26518
|
ele = !isNullOrUndefined(closestTd) && this.parent.inputElement.contains(closestTd) ? closestTd : ele;
|
|
26471
26519
|
}
|
|
26472
|
-
if (this.previousTableElement
|
|
26520
|
+
if (this.previousTableElement !== ele && !isNullOrUndefined(this.previousTableElement)) {
|
|
26473
26521
|
this.previousTableElement.classList.remove(CLS_TABLE_SEL);
|
|
26474
26522
|
}
|
|
26475
26523
|
}
|
|
@@ -26898,7 +26946,6 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
26898
26946
|
top: 0,
|
|
26899
26947
|
left: 0
|
|
26900
26948
|
};
|
|
26901
|
-
// eslint-disable-next-line
|
|
26902
26949
|
var offset = elem.getBoundingClientRect();
|
|
26903
26950
|
var doc = elem.ownerDocument;
|
|
26904
26951
|
var offsetParent = elem.offsetParent || doc.documentElement;
|
|
@@ -26913,7 +26960,6 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
26913
26960
|
isNestedTable = true;
|
|
26914
26961
|
}
|
|
26915
26962
|
if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) {
|
|
26916
|
-
// eslint-disable-next-line
|
|
26917
26963
|
parentOffset = offsetParent.getBoundingClientRect();
|
|
26918
26964
|
}
|
|
26919
26965
|
if (isNestedTable) {
|
|
@@ -27082,6 +27128,8 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
27082
27128
|
var mouseY = (this.parent.enableRtl) ? -(pageY - this.pageY) : (pageY - this.pageY);
|
|
27083
27129
|
this.pageX = pageX;
|
|
27084
27130
|
this.pageY = pageY;
|
|
27131
|
+
var maxiumWidth;
|
|
27132
|
+
var currentTdElement = this.curTable.closest('td');
|
|
27085
27133
|
var args = { event: e, requestType: 'table' };
|
|
27086
27134
|
this.parent.trigger(onResize, args, function (resizingArgs) {
|
|
27087
27135
|
if (resizingArgs.cancel) {
|
|
@@ -27114,6 +27162,10 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
27114
27162
|
if (_this.currentColumnResize === 'first') {
|
|
27115
27163
|
mouseX = mouseX - 0.75; //This was done for to make the gripper and the table first/last column will be close.
|
|
27116
27164
|
_this.removeResizeElement();
|
|
27165
|
+
if (currentTdElement) {
|
|
27166
|
+
maxiumWidth = _this.curTable.getBoundingClientRect().right - _this.calcPos(currentTdElement).left;
|
|
27167
|
+
_this.curTable.style.maxWidth = maxiumWidth + 'px';
|
|
27168
|
+
}
|
|
27117
27169
|
// Below the value '100' is the 100% width of the parent element.
|
|
27118
27170
|
if (((mouseX !== 0 && 5 < currentColumnCellWidth) || mouseX < 0) && currentTableWidth <= 100 &&
|
|
27119
27171
|
_this.convertPixelToPercentage(tableWidth - mouseX, widthCompare) <= 100) {
|
|
@@ -27131,6 +27183,10 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
27131
27183
|
else if (_this.currentColumnResize === 'last') {
|
|
27132
27184
|
mouseX = mouseX + 0.75; //This was done for to make the gripper and the table first/last column will be close.
|
|
27133
27185
|
_this.removeResizeElement();
|
|
27186
|
+
if (currentTdElement) {
|
|
27187
|
+
maxiumWidth = currentTdElement.getBoundingClientRect().right - _this.curTable.getBoundingClientRect().left;
|
|
27188
|
+
_this.curTable.style.maxWidth = maxiumWidth + 'px';
|
|
27189
|
+
}
|
|
27134
27190
|
// Below the value '100' is the 100% width of the parent element.
|
|
27135
27191
|
if (((mouseX !== 0 && 5 < currentColumnCellWidth) || mouseX > 0) &&
|
|
27136
27192
|
currentTableWidth <= 100 && _this.convertPixelToPercentage(tableWidth + mouseX, widthCompare) <= 100) {
|
|
@@ -27181,6 +27237,12 @@ var Table = /** @__PURE__ @class */ (function () {
|
|
|
27181
27237
|
if (!Browser.isDevice) {
|
|
27182
27238
|
EventHandler.remove(_this.contentModule.getEditPanel(), 'mouseover', _this.resizeHelper);
|
|
27183
27239
|
}
|
|
27240
|
+
if (currentTdElement) {
|
|
27241
|
+
// eslint-disable-next-line max-len
|
|
27242
|
+
var tableBoxPosition = _this.curTable.getBoundingClientRect().left - currentTdElement.getBoundingClientRect().left;
|
|
27243
|
+
maxiumWidth = Math.abs(tableBoxPosition - currentTdElement.getBoundingClientRect().width) - 5;
|
|
27244
|
+
_this.curTable.style.maxWidth = maxiumWidth + 'px';
|
|
27245
|
+
}
|
|
27184
27246
|
var widthType = _this.curTable.style.width.indexOf('%') > -1;
|
|
27185
27247
|
_this.curTable.style.width = widthType ? _this.convertPixelToPercentage(tableWidth + mouseX, widthCompare) + '%'
|
|
27186
27248
|
: tableWidth + mouseX + 'px';
|
|
@@ -28510,8 +28572,8 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28510
28572
|
var curElement = this.startNode;
|
|
28511
28573
|
var blockElement = curElement;
|
|
28512
28574
|
while (!this.parent.formatter.editorManager.domNode.isBlockNode(curElement)) {
|
|
28513
|
-
blockElement = curElement;
|
|
28514
28575
|
curElement = curElement.parentElement;
|
|
28576
|
+
blockElement = curElement;
|
|
28515
28577
|
}
|
|
28516
28578
|
isTableEnter = blockElement.tagName === 'TD' || blockElement.tagName === 'TBODY' ? false : true;
|
|
28517
28579
|
}
|
|
@@ -28528,7 +28590,10 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28528
28590
|
this.parent.trigger(actionBegin, actionBeginArgs, function (actionBeginArgs) {
|
|
28529
28591
|
if (!actionBeginArgs.cancel) {
|
|
28530
28592
|
if (!(_this.range.startOffset === _this.range.endOffset && _this.range.startContainer === _this.range.endContainer)) {
|
|
28531
|
-
_this.range.
|
|
28593
|
+
if (!(_this.range.startContainer.nodeName === 'SPAN' && (_this.range.startContainer.classList.contains('e-video-wrap') ||
|
|
28594
|
+
_this.range.startContainer.classList.contains('e-audio-wrap')))) {
|
|
28595
|
+
_this.range.deleteContents();
|
|
28596
|
+
}
|
|
28532
28597
|
if (_this.range.startContainer.nodeName === '#text' && _this.range.startContainer.textContent.length === 0 &&
|
|
28533
28598
|
_this.range.startContainer.parentElement !== _this.parent.inputElement) {
|
|
28534
28599
|
if (_this.parent.enterKey === 'BR') {
|
|
@@ -28557,8 +28622,8 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28557
28622
|
while (!isNullOrUndefined(currentFocusElem) && currentFocusElem.nodeName !== '#text' && currentFocusElem.nodeName !== 'BR') {
|
|
28558
28623
|
currentFocusElem = currentFocusElem.lastChild;
|
|
28559
28624
|
}
|
|
28560
|
-
if (currentFocusElem.nodeName
|
|
28561
|
-
currentFocusElem.parentElement.nodeName
|
|
28625
|
+
if (currentFocusElem.nodeName !== 'BR' && currentFocusElem.parentElement.textContent.length === 0 && currentFocusElem.parentElement.innerHTML.length === 0 &&
|
|
28626
|
+
currentFocusElem.parentElement.nodeName !== 'BR') {
|
|
28562
28627
|
currentFocusElem.parentElement.appendChild(_this.parent.createElement('BR'));
|
|
28563
28628
|
}
|
|
28564
28629
|
_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 +28675,14 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28610
28675
|
else {
|
|
28611
28676
|
nearBlockNode = _this.parent.formatter.editorManager.domNode.blockParentNode(_this.startNode);
|
|
28612
28677
|
}
|
|
28613
|
-
var
|
|
28678
|
+
var isMediaNode = false; // To check the image audio and video node cases
|
|
28614
28679
|
var isFocusedFirst = false;
|
|
28615
28680
|
if (_this.range.startOffset !== 0 && _this.range.endOffset !== 0 &&
|
|
28616
28681
|
_this.range.startContainer === _this.range.endContainer && !(!isNullOrUndefined(nearBlockNode.childNodes[0])
|
|
28617
|
-
&& nearBlockNode.childNodes[0].nodeName === 'IMG')) {
|
|
28682
|
+
&& nearBlockNode.childNodes[0].nodeName === 'IMG' && nearBlockNode.querySelectorAll('img,audio,video').length > 0)) {
|
|
28618
28683
|
var startNodeText = _this.range.startContainer.textContent;
|
|
28619
28684
|
var splitFirstText = startNodeText.substring(0, _this.range.startOffset);
|
|
28685
|
+
// eslint-disable-next-line max-len
|
|
28620
28686
|
if (splitFirstText.charCodeAt(_this.range.startOffset - 1) !== 160 && splitFirstText.trim().length === 0) {
|
|
28621
28687
|
isFocusedFirst = true;
|
|
28622
28688
|
}
|
|
@@ -28628,26 +28694,29 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28628
28694
|
var fireFoxEnterAtMiddle = Browser.userAgent.indexOf('Firefox') !== -1 && _this.range.startOffset === 0 && _this.range.startContainer === _this.range.endContainer &&
|
|
28629
28695
|
_this.range.startContainer.nodeName === '#text' && !_this.parent.formatter.editorManager.domNode.isBlockNode(_this.range.startContainer.previousSibling) &&
|
|
28630
28696
|
_this.range.startContainer.parentElement === _this.range.startContainer.previousSibling.parentElement;
|
|
28697
|
+
// eslint-disable-next-line max-len
|
|
28631
28698
|
if (!fireFoxEnterAtMiddle && ((_this.range.startOffset === 0 && _this.range.endOffset === 0) || isFocusedFirst) &&
|
|
28632
28699
|
!(!isNullOrUndefined(_this.range.startContainer.previousSibling) &&
|
|
28633
28700
|
(_this.range.startContainer.previousSibling.nodeName === 'IMG' || _this.range.startContainer.previousSibling.nodeName === 'BR'))) {
|
|
28634
28701
|
var isNearBlockLengthZero = void 0;
|
|
28635
28702
|
var newElem = void 0;
|
|
28636
|
-
if (_this.range.startContainer.
|
|
28703
|
+
if (!isNullOrUndefined(_this.range.startContainer.childNodes) && _this.range.startContainer.textContent.length === 0 &&
|
|
28704
|
+
(_this.range.startContainer.querySelectorAll('img,audio,video').length > 0 ||
|
|
28705
|
+
_this.range.startContainer.nodeName === 'IMG' || _this.range.startContainer.nodeName === 'TABLE')) {
|
|
28637
28706
|
newElem = _this.createInsertElement(shiftKey_1);
|
|
28638
|
-
|
|
28707
|
+
isMediaNode = true;
|
|
28639
28708
|
isNearBlockLengthZero = false;
|
|
28640
28709
|
}
|
|
28641
28710
|
else {
|
|
28642
28711
|
if ((nearBlockNode.textContent.trim().length !== 0 ||
|
|
28643
28712
|
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
|
|
28713
|
+
(nearBlockNode.textContent.trim() === '' && nearBlockNode.querySelectorAll('img,audio,video').length > 0))) {
|
|
28714
|
+
if ((_this.range.startOffset === _this.range.endOffset && _this.range.startOffset !== 0)) {
|
|
28646
28715
|
newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
|
|
28647
28716
|
}
|
|
28648
28717
|
else {
|
|
28649
28718
|
newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, true).cloneNode(true);
|
|
28650
|
-
|
|
28719
|
+
isMediaNode = true;
|
|
28651
28720
|
}
|
|
28652
28721
|
isNearBlockLengthZero = false;
|
|
28653
28722
|
}
|
|
@@ -28670,7 +28739,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28670
28739
|
if (!isNearBlockLengthZero) {
|
|
28671
28740
|
var currentFocusElem = insertElem;
|
|
28672
28741
|
var finalFocusElem = void 0;
|
|
28673
|
-
if (_this.range.startOffset === _this.range.endOffset && _this.range.startOffset
|
|
28742
|
+
if (_this.range.startOffset === _this.range.endOffset && _this.range.startOffset !== 0) {
|
|
28674
28743
|
while (!isNullOrUndefined(currentFocusElem) && currentFocusElem.nodeName !== '#text' &&
|
|
28675
28744
|
currentFocusElem.nodeName !== 'BR') {
|
|
28676
28745
|
finalFocusElem = currentFocusElem;
|
|
@@ -28681,7 +28750,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28681
28750
|
finalFocusElem = currentFocusElem;
|
|
28682
28751
|
}
|
|
28683
28752
|
finalFocusElem.innerHTML = '<br>';
|
|
28684
|
-
if (!
|
|
28753
|
+
if (!isMediaNode) {
|
|
28685
28754
|
detach(nearBlockNode);
|
|
28686
28755
|
}
|
|
28687
28756
|
}
|
|
@@ -28700,6 +28769,48 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28700
28769
|
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), insertElem, 0);
|
|
28701
28770
|
}
|
|
28702
28771
|
}
|
|
28772
|
+
else if (_this.range.startContainer === _this.range.endContainer && _this.range.startContainer.nodeName === 'SPAN' &&
|
|
28773
|
+
(_this.range.startContainer.classList.contains('e-video-wrap') ||
|
|
28774
|
+
_this.range.startContainer.classList.contains('e-audio-wrap'))) {
|
|
28775
|
+
if (nearBlockNode.textContent.trim().length > 0) {
|
|
28776
|
+
var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, true);
|
|
28777
|
+
var audioVideoElem = !isNullOrUndefined(newElem.previousSibling.querySelector('.e-video-wrap')) ?
|
|
28778
|
+
newElem.previousSibling.querySelector('.e-video-wrap') : newElem.previousSibling.querySelector('.e-audio-wrap');
|
|
28779
|
+
var isBRInserted = false;
|
|
28780
|
+
var lastNode = audioVideoElem.previousSibling;
|
|
28781
|
+
while (!isNullOrUndefined(lastNode) && lastNode.nodeName !== '#text') {
|
|
28782
|
+
lastNode = lastNode.lastChild;
|
|
28783
|
+
}
|
|
28784
|
+
if (isNullOrUndefined(lastNode)) {
|
|
28785
|
+
var brElm = _this.parent.createElement('br');
|
|
28786
|
+
audioVideoElem.parentElement.appendChild(brElm);
|
|
28787
|
+
isBRInserted = true;
|
|
28788
|
+
}
|
|
28789
|
+
if (isBRInserted) {
|
|
28790
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), audioVideoElem.parentElement, 0);
|
|
28791
|
+
}
|
|
28792
|
+
else {
|
|
28793
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), lastNode, lastNode.textContent.length);
|
|
28794
|
+
}
|
|
28795
|
+
detach(audioVideoElem);
|
|
28796
|
+
}
|
|
28797
|
+
else {
|
|
28798
|
+
var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, true);
|
|
28799
|
+
var focusElem = newElem.previousSibling;
|
|
28800
|
+
while (!isNullOrUndefined(focusElem.firstChild)) {
|
|
28801
|
+
detach(focusElem.firstChild);
|
|
28802
|
+
}
|
|
28803
|
+
var brElm = _this.parent.createElement('br');
|
|
28804
|
+
focusElem.appendChild(brElm);
|
|
28805
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), focusElem, 0);
|
|
28806
|
+
}
|
|
28807
|
+
if (!isNullOrUndefined(_this.parent.audioModule)) {
|
|
28808
|
+
_this.parent.audioModule.hideAudioQuickToolbar();
|
|
28809
|
+
}
|
|
28810
|
+
if (!isNullOrUndefined(_this.parent.videoModule)) {
|
|
28811
|
+
_this.parent.videoModule.hideVideoQuickToolbar();
|
|
28812
|
+
}
|
|
28813
|
+
}
|
|
28703
28814
|
else {
|
|
28704
28815
|
var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, true);
|
|
28705
28816
|
if (!isNullOrUndefined(newElem.childNodes[0]) && newElem.childNodes[0].nodeName === '#text' &&
|
|
@@ -28715,7 +28826,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28715
28826
|
_this.startNode = startParentElem;
|
|
28716
28827
|
}
|
|
28717
28828
|
else {
|
|
28718
|
-
if (_this.startNode.nodeName
|
|
28829
|
+
if (_this.startNode.nodeName !== 'BR') {
|
|
28719
28830
|
_this.startNode.appendChild(brElm);
|
|
28720
28831
|
}
|
|
28721
28832
|
}
|
|
@@ -28798,6 +28909,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28798
28909
|
var outerBRElem = _this.parent.createElement('br');
|
|
28799
28910
|
if (_this.range.startOffset === 0 && _this.range.endOffset === 0 &&
|
|
28800
28911
|
!isNullOrUndefined(currentParent.previousSibling) && currentParent.previousSibling.nodeName === 'BR') {
|
|
28912
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
28801
28913
|
newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, currentParent, false).cloneNode(true);
|
|
28802
28914
|
_this.parent.formatter.editorManager.domNode.insertAfter(outerBRElem, currentParent);
|
|
28803
28915
|
_this.insertFocusContent();
|
|
@@ -28806,6 +28918,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28806
28918
|
currentFocusElem = currentFocusElem.lastChild;
|
|
28807
28919
|
}
|
|
28808
28920
|
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), currentFocusElem, 0);
|
|
28921
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
28809
28922
|
|
|
28810
28923
|
}
|
|
28811
28924
|
else {
|
|
@@ -28835,7 +28948,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
|
|
|
28835
28948
|
EnterKeyAction.prototype.insertBRElement = function () {
|
|
28836
28949
|
var isEmptyBrInserted = false;
|
|
28837
28950
|
var isFocusTextNode = true;
|
|
28838
|
-
if (this.range.endContainer.textContent.length
|
|
28951
|
+
if (this.range.endContainer.textContent.length === 0 && this.range.startContainer.nodeName === 'BR') {
|
|
28839
28952
|
isFocusTextNode = false;
|
|
28840
28953
|
}
|
|
28841
28954
|
var brElm = this.parent.createElement('br');
|
|
@@ -29195,7 +29308,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29195
29308
|
this.focusIn();
|
|
29196
29309
|
}
|
|
29197
29310
|
}
|
|
29198
|
-
var tool = executeGroup[commandName];
|
|
29311
|
+
var tool = executeGroup["" + commandName];
|
|
29199
29312
|
if (option && option.undo) {
|
|
29200
29313
|
if (option.undo && this.formatter.getUndoRedoStack().length === 0) {
|
|
29201
29314
|
this.formatter.saveData();
|
|
@@ -29420,8 +29533,10 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29420
29533
|
audioElm[i].classList.add('e-rte-audio');
|
|
29421
29534
|
audioElm[i].classList.add(CLS_AUDIOINLINE);
|
|
29422
29535
|
}
|
|
29536
|
+
// eslint-disable-next-line max-len
|
|
29423
29537
|
if (!audioElm[i].parentElement.classList.contains(CLS_CLICKELEM) && !audioElm[i].parentElement.classList.contains(CLS_AUDIOWRAP)) {
|
|
29424
29538
|
var audioWrapElem = this.createElement('span', { className: CLS_AUDIOWRAP });
|
|
29539
|
+
audioWrapElem.setAttribute('style', 'width:300px; margin:0 auto;');
|
|
29425
29540
|
audioWrapElem.contentEditable = 'false';
|
|
29426
29541
|
var audioInnerWrapElem = this.createElement('span', { className: CLS_CLICKELEM });
|
|
29427
29542
|
audioWrapElem.appendChild(audioInnerWrapElem);
|
|
@@ -29439,6 +29554,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29439
29554
|
videoElm[i].classList.add('e-rte-video');
|
|
29440
29555
|
videoElm[i].classList.add(CLS_VIDEOINLINE);
|
|
29441
29556
|
}
|
|
29557
|
+
// eslint-disable-next-line max-len
|
|
29442
29558
|
if (!videoElm[i].parentElement.classList.contains(CLS_CLICKELEM) && !videoElm[i].parentElement.classList.contains(CLS_VIDEOWRAP)) {
|
|
29443
29559
|
var videoWrapElem = this.createElement('span', { className: CLS_VIDEOWRAP });
|
|
29444
29560
|
videoWrapElem.contentEditable = 'false';
|
|
@@ -29450,10 +29566,12 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29450
29566
|
}
|
|
29451
29567
|
}
|
|
29452
29568
|
if (Browser.userAgent.indexOf('Firefox') !== -1) {
|
|
29569
|
+
// eslint-disable-next-line
|
|
29453
29570
|
videoElm[i].addEventListener('play', function (args) {
|
|
29454
29571
|
_this.notify(mouseDown, { args: args });
|
|
29455
29572
|
_this.notify('editAreaClick', { args: args });
|
|
29456
29573
|
});
|
|
29574
|
+
// eslint-disable-next-line
|
|
29457
29575
|
videoElm[i].addEventListener('pause', function (args) {
|
|
29458
29576
|
_this.notify(mouseDown, { args: args });
|
|
29459
29577
|
_this.notify('editAreaClick', { args: args });
|
|
@@ -29472,6 +29590,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29472
29590
|
RichTextEditor.prototype.eventInitializer = function () {
|
|
29473
29591
|
this.wireEvents();
|
|
29474
29592
|
};
|
|
29593
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
29475
29594
|
RichTextEditor.prototype.cleanList = function (e) {
|
|
29476
29595
|
var range = this.getRange();
|
|
29477
29596
|
var currentStartContainer = range.startContainer;
|
|
@@ -29519,6 +29638,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29519
29638
|
if (closest(startNode, 'pre') &&
|
|
29520
29639
|
(e.which === 8 && range.startContainer.textContent.charCodeAt(range.startOffset - 1) === 8203) ||
|
|
29521
29640
|
(e.which === 46 && range.startContainer.textContent.charCodeAt(range.startOffset) === 8203)) {
|
|
29641
|
+
// eslint-disable-next-line
|
|
29522
29642
|
var regEx = new RegExp(String.fromCharCode(8203), 'g');
|
|
29523
29643
|
var pointer = e.which === 8 ? range.startOffset - 1 : range.startOffset;
|
|
29524
29644
|
range.startContainer.textContent = range.startContainer.textContent.replace(regEx, '');
|
|
@@ -29537,6 +29657,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29537
29657
|
var bool = true;
|
|
29538
29658
|
var removeNodeArray = [];
|
|
29539
29659
|
for (i = index; i >= 0; i--) {
|
|
29660
|
+
// eslint-disable-next-line max-len
|
|
29540
29661
|
if (parentEle.childNodes[i].nodeType === 3 && parentEle.childNodes[i].textContent.charCodeAt(0) === 8203 && bool) {
|
|
29541
29662
|
removeNodeArray.push(i);
|
|
29542
29663
|
}
|
|
@@ -29595,7 +29716,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
29595
29716
|
}
|
|
29596
29717
|
}
|
|
29597
29718
|
this.notify(keyUp, { member: 'keyup', args: e });
|
|
29598
|
-
if (e.keyCode
|
|
29719
|
+
if (e.keyCode === 39 || e.keyCode === 37) {
|
|
29599
29720
|
this.notify(tableModulekeyUp, { member: 'tableModulekeyUp', args: e });
|
|
29600
29721
|
}
|
|
29601
29722
|
if (e.code === 'KeyX' && e.which === 88 && e.keyCode === 88 && e.ctrlKey && (this.inputElement.innerHTML === '' ||
|
|
@@ -30014,6 +30135,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30014
30135
|
* @hidden
|
|
30015
30136
|
* @deprecated
|
|
30016
30137
|
*/
|
|
30138
|
+
/* eslint-disable */
|
|
30017
30139
|
RichTextEditor.prototype.onPropertyChanged = function (newProp, oldProp) {
|
|
30018
30140
|
for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
|
|
30019
30141
|
var prop = _a[_i];
|
|
@@ -30053,7 +30175,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30053
30175
|
break;
|
|
30054
30176
|
}
|
|
30055
30177
|
case 'valueTemplate':
|
|
30056
|
-
this.setValue();
|
|
30178
|
+
this.setValue(true);
|
|
30057
30179
|
if (this.showCharCount) {
|
|
30058
30180
|
this.countModule.refresh();
|
|
30059
30181
|
}
|
|
@@ -30149,7 +30271,6 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30149
30271
|
this.notify(xhtmlValidation, { module: 'XhtmlValidation', newProp: newProp, oldProp: oldProp });
|
|
30150
30272
|
break;
|
|
30151
30273
|
case 'quickToolbarSettings':
|
|
30152
|
-
// eslint-disable-next-line
|
|
30153
30274
|
newProp.quickToolbarSettings.showOnRightClick ? this.wireContextEvent() : this.unWireContextEvent();
|
|
30154
30275
|
this.notify(modelChanged, { newProp: newProp, oldProp: oldProp });
|
|
30155
30276
|
break;
|
|
@@ -30159,6 +30280,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30159
30280
|
}
|
|
30160
30281
|
}
|
|
30161
30282
|
};
|
|
30283
|
+
/* eslint-enable */
|
|
30162
30284
|
/**
|
|
30163
30285
|
* @hidden
|
|
30164
30286
|
* @returns {void}
|
|
@@ -30500,7 +30622,8 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30500
30622
|
styleEle.rel = 'stylesheet';
|
|
30501
30623
|
return styleEle;
|
|
30502
30624
|
};
|
|
30503
|
-
RichTextEditor.prototype.setValue = function () {
|
|
30625
|
+
RichTextEditor.prototype.setValue = function (isPropertyChange) {
|
|
30626
|
+
var _this = this;
|
|
30504
30627
|
if (this.valueTemplate) {
|
|
30505
30628
|
var regEx = new RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i);
|
|
30506
30629
|
if (regEx.test(this.valueTemplate)) {
|
|
@@ -30508,11 +30631,30 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30508
30631
|
}
|
|
30509
30632
|
else {
|
|
30510
30633
|
var compiledTemplate = compile(this.valueTemplate)('', this, 'valueTemplate');
|
|
30511
|
-
|
|
30512
|
-
|
|
30513
|
-
|
|
30634
|
+
if (typeof this.valueTemplate !== 'string' && this.isReact) {
|
|
30635
|
+
this.displayTempElem = this.createElement('div');
|
|
30636
|
+
for (var i = 0; i < compiledTemplate.length; i++) {
|
|
30637
|
+
var item = compiledTemplate[i];
|
|
30638
|
+
append([item], this.displayTempElem);
|
|
30639
|
+
}
|
|
30640
|
+
this.renderTemplates(function () {
|
|
30641
|
+
_this.inputElement.innerHTML = _this.displayTempElem.childNodes[0].innerHTML;
|
|
30642
|
+
_this.setProperties({ value: _this.inputElement.innerHTML.trim() });
|
|
30643
|
+
});
|
|
30644
|
+
}
|
|
30645
|
+
else {
|
|
30646
|
+
var appendElem = this.element;
|
|
30647
|
+
if (isPropertyChange) {
|
|
30648
|
+
this.inputElement.innerHTML = '';
|
|
30649
|
+
appendElem = this.inputElement;
|
|
30650
|
+
}
|
|
30651
|
+
for (var i = 0; i < compiledTemplate.length; i++) {
|
|
30652
|
+
var item = compiledTemplate[i];
|
|
30653
|
+
append([item], appendElem);
|
|
30654
|
+
}
|
|
30655
|
+
this.setProperties({ value: appendElem.innerHTML.trim() });
|
|
30656
|
+
this.renderReactTemplates();
|
|
30514
30657
|
}
|
|
30515
|
-
this.setProperties({ value: this.element.innerHTML.trim() });
|
|
30516
30658
|
}
|
|
30517
30659
|
}
|
|
30518
30660
|
else {
|
|
@@ -30528,6 +30670,10 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30528
30670
|
}
|
|
30529
30671
|
}
|
|
30530
30672
|
};
|
|
30673
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30674
|
+
RichTextEditor.prototype.renderTemplates = function (callBack) {
|
|
30675
|
+
this.renderReactTemplates(callBack);
|
|
30676
|
+
};
|
|
30531
30677
|
RichTextEditor.prototype.updateResizeFlag = function () {
|
|
30532
30678
|
this.isResizeInitialized = true;
|
|
30533
30679
|
};
|
|
@@ -30597,7 +30743,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
30597
30743
|
var rzHandle = this.element.querySelector('.' + CLS_RTE_RES_HANDLE);
|
|
30598
30744
|
var rzHeight = this.enableResize ? (!isNullOrUndefined(rzHandle) ? (rzHandle.offsetHeight + 8) : 0) : 0;
|
|
30599
30745
|
var expandPopHeight = this.getToolbar() ? this.toolbarModule.getExpandTBarPopHeight() : 0;
|
|
30600
|
-
if (this.toolbarSettings.type === ToolbarType.Expand && isExpand
|
|
30746
|
+
if (this.toolbarSettings.type === ToolbarType.Expand && isExpand) {
|
|
30601
30747
|
heightValue = (this.height === 'auto' && rzHeight === 0) ? 'auto' : rteHeight - (tbHeight + expandPopHeight + rzHeight) + 'px';
|
|
30602
30748
|
topValue = (!this.toolbarSettings.enableFloating) ? expandPopHeight : 0;
|
|
30603
30749
|
}
|