@syncfusion/ej2-richtexteditor 21.1.39 → 21.2.3

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.
@@ -15910,18 +15910,13 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
15910
15910
  isSubSup = formatNode === null ? false : true;
15911
15911
  }
15912
15912
  }
15913
- else if ((format === 'fontsize' || format === 'fontname' || format === 'fontcolor' || format === 'backgroundcolor') && range.startContainer.parentElement === endNode) {
15914
- formatNode = null;
15915
- }
15916
15913
  if (index === 0 && formatNode === null) {
15917
15914
  isFormat = true;
15918
15915
  }
15919
15916
  if (formatNode !== null && (!isFormat || isFontStyle)) {
15920
15917
  nodes[index] = this.removeFormat(nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, domSelection, endNode, domNode);
15921
15918
  }
15922
- else if (range.startContainer.parentElement !== endNode ||
15923
- (range.commonAncestorContainer !== endNode && range.startContainer.parentElement === endNode)
15924
- || (range.commonAncestorContainer === endNode || nodes.length === 1)) {
15919
+ else {
15925
15920
  nodes[index] = this.insertFormat(docElement, nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, painterValues, domNode, endNode);
15926
15921
  }
15927
15922
  domSelection = this.applySelection(nodes, domSelection, nodeCutter, index, isCollapsed);
@@ -16073,6 +16068,27 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
16073
16068
  nodes[index] = lastNode.firstChild;
16074
16069
  }
16075
16070
  }
16071
+ else if (isFontStyle && !nodes[index].contains(formatNode) && nodes[index].nodeType === 3 &&
16072
+ nodes[index].textContent !== formatNode.textContent) {
16073
+ // If the selection is within the format node .
16074
+ var isFullNodeSelected = nodes[index].textContent === nodes[index].wholeText;
16075
+ var nodeTraverse = nodes[index];
16076
+ var styleElement = this.GetFormatNode(format, value);
16077
+ // while loop and traverse back until text content does not match with parent text content
16078
+ while (nodeTraverse && nodeTraverse.textContent === nodeTraverse.parentElement.textContent) {
16079
+ nodeTraverse = nodeTraverse.parentElement;
16080
+ }
16081
+ if (isFullNodeSelected && formatNode.textContent !== nodeTraverse.textContent) {
16082
+ var nodeArray = [];
16083
+ var priorityNode = this.getPriorityFormatNode(nodeTraverse, endNode);
16084
+ if (priorityNode && priorityNode.textContent === nodeTraverse.textContent) {
16085
+ nodeTraverse = priorityNode;
16086
+ }
16087
+ nodeArray.push(nodeTraverse);
16088
+ this.applyStyles(nodeArray, 0, styleElement);
16089
+ return nodes[index];
16090
+ }
16091
+ }
16076
16092
  var fontStyle;
16077
16093
  if (format === 'backgroundcolor') {
16078
16094
  fontStyle = formatNode.style.fontSize;
@@ -16219,23 +16235,9 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
16219
16235
  return nodes[index];
16220
16236
  };
16221
16237
  SelectionCommands.insertFormat = function (docElement, nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, painterValues, domNode, endNode) {
16222
- var rootElementNode;
16223
16238
  if (!isCursor) {
16224
16239
  if ((formatNode === null && isFormat) || isFontStyle) {
16225
16240
  if (nodes[index].nodeName !== 'BR') {
16226
- if (format === 'fontsize' || format === 'fontname' || format === 'fontcolor' || format === 'backgroundcolor') {
16227
- var rangeNode = nodes[index];
16228
- while (rangeNode && !domNode.isBlockNode(rangeNode) && rangeNode !== endNode) {
16229
- if (domNode.isBlockNode(rangeNode.parentElement)) {
16230
- rootElementNode = rangeNode;
16231
- }
16232
- rangeNode = rangeNode.parentElement;
16233
- }
16234
- if (rootElementNode && rootElementNode.nodeType !== 3) {
16235
- nodeCutter.SplitNode(range, rootElementNode, true).cloneNode(true);
16236
- nodeCutter.SplitNode(range, rootElementNode, false).cloneNode(false);
16237
- }
16238
- }
16239
16241
  nodes[index] = nodeCutter.GetSpliceNode(range, nodes[index]);
16240
16242
  nodes[index].textContent = nodeCutter.TrimLineBreak(nodes[index].textContent);
16241
16243
  }
@@ -16245,57 +16247,63 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
16245
16247
  }
16246
16248
  else if (!(isFontStyle === true && value === '')) {
16247
16249
  var element = this.GetFormatNode(format, value);
16248
- if (value === 'formatPainter' || format === 'fontsize' || format === 'fontcolor' || format === 'fontname' || format === 'backgroundcolor') {
16249
- if (format !== 'fontname' && format !== 'backgroundcolor') {
16250
- var liElement = nodes[index].parentElement;
16251
- var parentElement = nodes[index].parentElement;
16252
- while (!isNullOrUndefined(parentElement) && parentElement.tagName.toLowerCase() !== 'li') {
16253
- parentElement = parentElement.parentElement;
16254
- liElement = parentElement;
16250
+ if (value === 'formatPainter' || isFontStyle) {
16251
+ var liElement = nodes[index].parentElement;
16252
+ var parentElement = nodes[index].parentElement;
16253
+ while (!isNullOrUndefined(parentElement) && parentElement.tagName.toLowerCase() !== 'li') {
16254
+ parentElement = parentElement.parentElement;
16255
+ liElement = parentElement;
16256
+ }
16257
+ if (!isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li' &&
16258
+ liElement.textContent.trim() === nodes[index].textContent.trim()) {
16259
+ if (format === 'fontsize') {
16260
+ liElement.style.fontSize = value;
16255
16261
  }
16256
- if (!isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li' &&
16257
- liElement.textContent.trim() === nodes[index].textContent.trim()) {
16258
- if (format === 'fontsize') {
16259
- liElement.style.fontSize = value;
16260
- }
16261
- else {
16262
- liElement.style.color = value;
16263
- liElement.style.textDecoration = 'inherit';
16264
- }
16262
+ else if (format === 'fontcolor') {
16263
+ liElement.style.color = value;
16264
+ liElement.style.textDecoration = 'inherit';
16265
16265
  }
16266
16266
  }
16267
- if (rootElementNode && rootElementNode.nodeType !== 3 && rootElementNode.nodeName !== 'A') {
16268
- var save = new NodeSelection();
16269
- save.save(range, docElement);
16270
- domNode.setMarker(save);
16271
- var cloneNode = rootElementNode.cloneNode(true);
16272
- element.appendChild(cloneNode);
16273
- domNode.replaceWith(rootElementNode, element.outerHTML);
16274
- var currentStartNode = endNode.querySelector('.e-editor-select-start');
16275
- var currrentEndNode = endNode.querySelector('.e-editor-select-end');
16276
- if (index === 0) {
16277
- nodes[index] = currentStartNode ? currentStartNode.lastChild : nodes[index];
16278
- }
16279
- if (range.startContainer.parentElement === endNode) {
16280
- if (nodes.length > 1) {
16281
- nodes[nodes.length - 1] = currrentEndNode ? currrentEndNode.lastChild : nodes[index];
16267
+ if (value === 'formatPainter') {
16268
+ return this.insertFormatPainterElem(nodes, index, range, nodeCutter, painterValues, domNode);
16269
+ }
16270
+ var currentNode = nodes[index];
16271
+ var priorityNode = this.getPriorityFormatNode(currentNode, endNode);
16272
+ // 1. Checking is there any priority node present in the selection range. (Use case for nested styles);
16273
+ // 2 Or font style is applied. (Use case not a nested style)
16274
+ if (!isNullOrUndefined(priorityNode) || isFontStyle) {
16275
+ var currentFormatNode = isNullOrUndefined(priorityNode) ? currentNode : priorityNode;
16276
+ currentFormatNode = !isNullOrUndefined(priorityNode) && priorityNode.style.fontSize !== '' ?
16277
+ currentFormatNode.firstChild : currentFormatNode;
16278
+ if (isNullOrUndefined(priorityNode) || format === 'fontsize') {
16279
+ while (currentFormatNode) {
16280
+ var isSameTextContent = currentFormatNode.parentElement.textContent.trim()
16281
+ === nodes[index].textContent.trim();
16282
+ if (!domNode.isBlockNode(currentFormatNode.parentElement) && isSameTextContent) {
16283
+ currentFormatNode = currentFormatNode.parentElement;
16284
+ }
16285
+ else {
16286
+ break;
16287
+ }
16282
16288
  }
16283
16289
  }
16284
- domNode.saveMarker(save, null);
16285
- }
16286
- else {
16287
- if (value === 'formatPainter') {
16288
- return this.insertFormatPainterElem(nodes, index, range, nodeCutter, painterValues, domNode);
16290
+ var nodeList = [];
16291
+ // Since color is different for different themnes, we need to wrap the fontColor over the text node.
16292
+ if (format === 'fontcolor') {
16293
+ var closestAnchor = closest(nodes[index].parentElement, 'A');
16294
+ if (!isNullOrUndefined(closestAnchor) && closestAnchor.firstChild.textContent.trim()
16295
+ === nodes[index].textContent.trim()) {
16296
+ currentFormatNode = nodes[index];
16297
+ }
16289
16298
  }
16290
- else {
16291
- nodes[index] = this.applyStyles(nodes, index, element);
16299
+ if (nodes[index].textContent.trim() !== currentFormatNode.textContent.trim()) {
16300
+ currentFormatNode = nodes[index];
16292
16301
  }
16302
+ nodeList[0] = currentFormatNode;
16303
+ this.applyStyles(nodeList, 0, element);
16293
16304
  }
16294
- if (format === 'fontsize') {
16295
- var bg = closest(nodes[index].parentElement, 'span[style*=' + 'background-color' + ']');
16296
- if (!isNullOrUndefined(bg)) {
16297
- nodes[index].parentElement.style.backgroundColor = bg.style.backgroundColor;
16298
- }
16305
+ else {
16306
+ nodes[index] = this.applyStyles(nodes, index, element);
16299
16307
  }
16300
16308
  }
16301
16309
  else {
@@ -16328,6 +16336,37 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
16328
16336
  }
16329
16337
  return nodes[index];
16330
16338
  };
16339
+ SelectionCommands.getPriorityFormatNode = function (node, endNode) {
16340
+ var isFormatted = new IsFormatted();
16341
+ var fontSizeNode = isFormatted.getFormattedNode(node, 'fontsize', endNode);
16342
+ var fontColorNode;
16343
+ var backgroundColorNode;
16344
+ var fontNameNode;
16345
+ if (isNullOrUndefined(fontSizeNode)) {
16346
+ backgroundColorNode = isFormatted.getFormattedNode(node, 'backgroundcolor', endNode);
16347
+ if (isNullOrUndefined(backgroundColorNode)) {
16348
+ fontNameNode = isFormatted.getFormattedNode(node, 'fontname', endNode);
16349
+ if (isNullOrUndefined(fontNameNode)) {
16350
+ fontColorNode = isFormatted.getFormattedNode(node, 'fontcolor', endNode);
16351
+ if (isNullOrUndefined(fontColorNode)) {
16352
+ return null;
16353
+ }
16354
+ else {
16355
+ return fontColorNode;
16356
+ }
16357
+ }
16358
+ else {
16359
+ return fontNameNode;
16360
+ }
16361
+ }
16362
+ else {
16363
+ return backgroundColorNode;
16364
+ }
16365
+ }
16366
+ else {
16367
+ return fontSizeNode;
16368
+ }
16369
+ };
16331
16370
  SelectionCommands.getInsertNode = function (docElement, range, format, value) {
16332
16371
  var element = this.GetFormatNode(format, value);
16333
16372
  element.innerHTML = '​';
@@ -16593,7 +16632,7 @@ var ClearFormat$1 = /** @__PURE__ @class */ (function () {
16593
16632
  * @hidden
16594
16633
  * @deprecated
16595
16634
  */
16596
- ClearFormat.clear = function (docElement, endNode, enterAction, selector) {
16635
+ ClearFormat.clear = function (docElement, endNode, enterAction, selector, command) {
16597
16636
  this.domNode = new DOMNode(endNode, docElement);
16598
16637
  this.defaultTag = enterAction === 'P' ? this.defaultTag : 'div';
16599
16638
  var nodeSelection = new NodeSelection();
@@ -16603,7 +16642,7 @@ var ClearFormat$1 = /** @__PURE__ @class */ (function () {
16603
16642
  nodeSelection.getSelectionNodeCollectionBr(range);
16604
16643
  var save = nodeSelection.save(range, docElement);
16605
16644
  var cursorRange = false;
16606
- if (range.collapsed) {
16645
+ if (range.collapsed && command !== 'ClearFormat') {
16607
16646
  cursorRange = true;
16608
16647
  range = nodeCutter.GetCursorRange(docElement, range, nodes[0]);
16609
16648
  }
@@ -16858,7 +16897,7 @@ var ClearFormatExec = /** @__PURE__ @class */ (function () {
16858
16897
  };
16859
16898
  ClearFormatExec.prototype.applyClear = function (e) {
16860
16899
  if (e.subCommand === 'ClearFormat') {
16861
- ClearFormat$1.clear(this.parent.currentDocument, this.parent.editableElement, e.enterAction, e.selector);
16900
+ ClearFormat$1.clear(this.parent.currentDocument, this.parent.editableElement, e.enterAction, e.selector, e.subCommand);
16862
16901
  if (e.callBack) {
16863
16902
  e.callBack({
16864
16903
  requestType: e.subCommand,
@@ -19108,7 +19147,7 @@ var __extends$3 = (undefined && undefined.__extends) || (function () {
19108
19147
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
19109
19148
  };
19110
19149
  })();
19111
- var IFRAMEHEADER = "\n<!DOCTYPE html> \n <html>\n <head>\n <meta charset='utf-8' /> \n <style>\n @charset \"UTF-8\";\n body {\n font-family: \"Roboto\", sans-serif;\n font-size: 14px;\n }\n html, body{height: 100%;margin: 0;}\n body.e-cursor{cursor:default}\n span.e-selected-node\t{background-color: #939393;color: white;}\n span.e-selected-node.e-highlight {background-color: #1d9dd8;}\n body{color:#333;word-wrap:break-word;padding: 8px;box-sizing: border-box;}\n .e-rte-image, .e-rte-audio, .e-rte-video {border: 0;cursor: pointer;display:\n block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-imginline, .e-rte-audio.e-audio-inline, .e-rte-video.e-video-inline {display: inline-block;float: none;max-width: calc(100% - (2 * 5px));padding: 1px;vertical-align: bottom;}\n .e-rte-image.e-imgcenter, .e-rte-video.e-video-center {cursor: pointer;display: block;float: none;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-imgright, .e-rte-video.e-video-right { float: right; margin: 0 auto;margin-left: 5px;text-align: right;}\n .e-rte-image.e-imgleft, .e-rte-video.e-video-left {float: left;margin: 0 auto;margin-right: 5px;text-align: left;}\n .e-img-caption { display: inline-block; float: none; margin: 5px auto; max-width: 100%;position: relative;}\n .e-img-caption.e-caption-inline {display: inline-block;float: none;\n margin: 5px auto;margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));\n position: relativetext-align: center;vertical-align: bottom;}\n .e-img-inner {box-sizing: border-box;display: block;font-size: 16px;font-weight: initial;\n margin: auto;opacity: .9;text-align: center;width: 100%;}\n .e-img-wrap {display: inline-block;margin: auto;padding: 0;text-align: center;width: 100%;}\n .e-imgleft, .e-video-left {float: left;margin: 0 5px 0 0;text-align: left;}\n .e-imgright, .e-video-right {float: right;margin: 0 0 0 5px;text-align: right;}\n .e-imgcenter, .e-video-center {cursor: pointer;display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-control img:not(.e-resize) {border: 2px solid transparent; z-index: 1000}\n .e-imginline , .e-audio-inline, .e-video-inline {display: inline-block;float: none;margin-left: 5px;margin-right: 5px;\n max-width: calc(100% - (2 * 5px));vertical-align: bottom;}\n .e-imgbreak, .e-audio-break, .e-video-break {border: 0;cursor: pointer;\n display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-img-focus:not(.e-resize), .e-audio-focus:not(.e-resize), .e-video-focus:not(.e-resize) {border: solid 2px #4a90e2;}\n img.e-img-focus::selection, audio.e-audio-focus::selection, .e-video-focus::selection { background: transparent;color: transparent;}\n span.e-rte-imageboxmark { width: 10px; height: 10px; position: absolute; display: block;\n background: #4a90e2; border: 1px solid #fff; z-index: 1000;}\n .e-mob-rte.e-mob-span span.e-rte-imageboxmark { background: #4a90e2; border: 1px solid #fff; }\n .e-mob-rte span.e-rte-imageboxmark { background: #fff; border: 1px solid #4a90e2;\n border-radius: 15px; height: 20px; width: 20px; }\n .e-mob-rte.e-mob-span span.e-rte-imageboxmark { background: #4a90e2; border: 1px solid #fff; }\n .e-rte-content .e-content img.e-resize, .e-rte-content .e-content video.e-resize { z-index: 1000; }\n .e-img-caption .e-img-inner { outline: 0; }\n .e-img-caption a:focus-visible { outline: none; }\n .e-img-caption .e-rte-image.e-imgright, .e-img-caption .e-rte-image.e-imgleft { float: none; margin: 0;}\n body{box-sizing: border-box;min-height: 100px;outline: 0 solid transparent;\n overflow-x: auto;padding: 16px;position: relative;text-align: inherit;z-index: 2;}\n p{margin: 0 0 10px;margin-bottom: 10px;}\n li{margin-bottom: 10px;}\n h1{font-size: 2.17em;font-weight: 400;line-height: 1;margin: 10px 0;}\n h2{font-size: 1.74em;font-weight: 400;margin: 10px 0;}\n h3{font-size: 1.31em;font-weight: 400;margin: 10px 0;}\n h4{font-size: 16px;font-weight: 400;line-height: 1.5;margin: 0;}\n h5{font-size: 00.8em;font-weight: 400;margin: 0;}\n h6{font-size: 00.65em;font-weight: 400;margin: 0;}\n blockquote{margin: 10px 0;margin-left: 0;padding-left: 5px;border-left: solid 2px #5c5c5c;}\n pre{background-color: inherit;border: 0;border-radius: 0;color: #333;\n font-size: inherit;line-height: inherit;margin: 0 0 10px;overflow: visible;padding: 0;\n white-space: pre-wrap;word-break: inherit;word-wrap: break-word;}\n strong, b{font-weight: 700;}\n a{text-decoration: none;user-select: auto;}\n a:hover{text-decoration: underline;};\n p:last-child, pre:last-child, blockquote:last-child{margin-bottom: 0;}\n h3+h4, h4+h5, h5+h6{margin-top: 00.6em;}\n ul:last-child{margin-bottom: 0;}\n table { border-collapse: collapse; empty-cells: show;}\n table td,table th {border: 1px solid #BDBDBD; height: 20px; padding: 2px 5px; vertical-align: middle;}\n table.e-alternate-border tbody tr:nth-child(2n) {background-color: #F5F5F5;}\n table th {background-color: #E0E0E0;}\n table.e-dashed-border td,table.e-dashed-border th { border: 1px dashed #BDBDBD} \n table .e-cell-select {border: 1px double #4a90e2;}\n span.e-table-box { cursor: nwse-resize; display: block; height: 10px; position: absolute; width: 10px; }\n span.e-table-box.e-rmob {height: 14px;width: 14px;}\n .e-row-resize, .e-column-resize { background-color: transparent; background-repeat: repeat;\n bottom: 0;cursor: col-resize;height: 1px;overflow: visible;position: absolute;width: 1px; }\n .e-row-resize { cursor: row-resize; height: 1px;}\n .e-table-rhelper { cursor: col-resize; opacity: .87;position: absolute;}\n .e-table-rhelper.e-column-helper { width: 1px; }\n .e-table-rhelper.e-row-helper {height: 1px;}\n .e-reicon::before { border-bottom: 6px solid transparent; border-right: 6px solid;\n border-top: 6px solid transparent; content: ''; display: block; height: 0;\n position: absolute; right: 4px; top: 4px; width: 20px; }\n .e-reicon::after { border-bottom: 6px solid transparent; border-left: 6px solid;\n border-top: 6px solid transparent; content: ''; display: block;\n height: 0; left: 4px; position: absolute; top: 4px; width: 20px; z-index: 3; }\n .e-row-helper.e-reicon::after { top: 10px; transform: rotate(90deg); }\n .e-row-helper.e-reicon::before { left: 4px; top: -20px; transform: rotate(90deg); }\n span.e-table-box { background-color: #ffffff; border: 1px solid #BDBDBD; }\n span.e-table-box.e-rbox-select { background-color: #BDBDBD; border: 1px solid #BDBDBD; }\n .e-table-rhelper { background-color: #4a90e2;}\n .e-rtl { direction: rtl; }\n </style>\n </head>";
19150
+ var IFRAMEHEADER = "\n<!DOCTYPE html> \n <html>\n <head>\n <meta charset='utf-8' /> \n <style>\n @charset \"UTF-8\";\n body {\n font-family: \"Roboto\", sans-serif;\n font-size: 14px;\n }\n html, body{height: 100%;margin: 0;}\n body.e-cursor{cursor:default}\n span.e-selected-node\t{background-color: #939393;color: white;}\n span.e-selected-node.e-highlight {background-color: #1d9dd8;}\n body{color:#333;word-wrap:break-word;padding: 8px;box-sizing: border-box;}\n .e-rte-image, .e-rte-audio, .e-rte-video {border: 0;cursor: pointer;display:\n block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-imginline, .e-rte-audio.e-audio-inline, .e-rte-video.e-video-inline {display: inline-block;float: none;max-width: calc(100% - (2 * 5px));padding: 1px;vertical-align: bottom;}\n .e-rte-image.e-imgcenter, .e-rte-video.e-video-center {cursor: pointer;display: block;float: none;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-imgright, .e-rte-video.e-video-right { float: right; margin: 0 auto;margin-left: 5px;text-align: right;}\n .e-rte-image.e-imgleft, .e-rte-video.e-video-left {float: left;margin: 0 auto;margin-right: 5px;text-align: left;}\n .e-img-caption { display: inline-block; float: none; margin: 5px auto; max-width: 100%;position: relative;}\n .e-img-caption.e-caption-inline {display: inline-block;float: none;\n margin: 5px auto;margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));\n position: relativetext-align: center;vertical-align: bottom;}\n .e-img-inner {box-sizing: border-box;display: block;font-size: 16px;font-weight: initial;\n margin: auto;opacity: .9;text-align: center;width: 100%;}\n .e-img-wrap {display: inline-block;margin: auto;padding: 0;text-align: center;width: 100%;}\n .e-imgleft, .e-video-left {float: left;margin: 0 5px 0 0;text-align: left;}\n .e-imgright, .e-video-right {float: right;margin: 0 0 0 5px;text-align: right;}\n .e-imgcenter, .e-video-center {cursor: pointer;display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-control img:not(.e-resize) {border: 2px solid transparent; z-index: 1000}\n .e-imginline , .e-audio-inline, .e-video-inline {display: inline-block;float: none;margin-left: 5px;margin-right: 5px;\n max-width: calc(100% - (2 * 5px));vertical-align: bottom;}\n .e-imgbreak, .e-audio-break, .e-video-break {border: 0;cursor: pointer;\n display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-img-focus:not(.e-resize), .e-audio-focus:not(.e-resize), .e-video-focus:not(.e-resize) {border: solid 2px #4a90e2;}\n img.e-img-focus::selection, audio.e-audio-focus::selection, .e-video-focus::selection { background: transparent;color: transparent;}\n span.e-rte-imageboxmark { width: 10px; height: 10px; position: absolute; display: block;\n background: #4a90e2; border: 1px solid #fff; z-index: 1000;}\n .e-mob-rte.e-mob-span span.e-rte-imageboxmark { background: #4a90e2; border: 1px solid #fff; }\n .e-mob-rte span.e-rte-imageboxmark { background: #fff; border: 1px solid #4a90e2;\n border-radius: 15px; height: 20px; width: 20px; }\n .e-mob-rte.e-mob-span span.e-rte-imageboxmark { background: #4a90e2; border: 1px solid #fff; }\n .e-rte-content .e-content img.e-resize, .e-rte-content .e-content video.e-resize { z-index: 1000; }\n .e-img-caption .e-img-inner { outline: 0; }\n .e-img-caption a:focus-visible { outline: none; }\n .e-img-caption .e-rte-image.e-imgright, .e-img-caption .e-rte-image.e-imgleft { float: none; margin: 0;}\n body{box-sizing: border-box;min-height: 100px;outline: 0 solid transparent;\n overflow-x: auto;padding: 16px;position: relative;text-align: inherit;z-index: 2;}\n p{margin: 0 0 10px;margin-bottom: 10px;}\n li{margin-bottom: 10px;}\n h1{font-size: 2.17em;font-weight: 400;line-height: 1;margin: 10px 0;}\n h2{font-size: 1.74em;font-weight: 400;margin: 10px 0;}\n h3{font-size: 1.31em;font-weight: 400;margin: 10px 0;}\n h4{font-size: 16px;font-weight: 400;line-height: 1.5;margin: 0;}\n h5{font-size: 00.8em;font-weight: 400;margin: 0;}\n h6{font-size: 00.65em;font-weight: 400;margin: 0;}\n blockquote{margin: 10px 0;margin-left: 0;padding-left: 5px;border-left: solid 2px #5c5c5c;}\n pre{background-color: inherit;border: 0;border-radius: 0;color: #333;\n font-size: inherit;line-height: inherit;margin: 0 0 10px;overflow: visible;padding: 0;\n white-space: pre-wrap;word-break: inherit;word-wrap: break-word;}\n strong, b{font-weight: 700;}\n a{text-decoration: none;user-select: auto;}\n a:hover{text-decoration: underline;};\n p:last-child, pre:last-child, blockquote:last-child{margin-bottom: 0;}\n h3+h4, h4+h5, h5+h6{margin-top: 00.6em;}\n ul:last-child{margin-bottom: 0;}\n table { border-collapse: collapse; empty-cells: show;}\n table td,table th {border: 1px solid #BDBDBD; height: 20px; padding: 2px 5px; vertical-align: middle;}\n table.e-alternate-border tbody tr:nth-child(2n) {background-color: #F5F5F5;}\n table th {background-color: #E0E0E0;}\n table.e-dashed-border td,table.e-dashed-border th { border: 1px dashed #BDBDBD} \n table .e-cell-select {border: 1px double #4a90e2;}\n span.e-table-box { cursor: nwse-resize; display: block; height: 10px; position: absolute; width: 10px; }\n span.e-table-box.e-rmob {height: 14px;width: 14px;}\n .e-row-resize, .e-column-resize { background-color: transparent; background-repeat: repeat;\n bottom: 0;cursor: col-resize;height: 1px;overflow: visible;position: absolute;width: 1px; }\n .e-row-resize { cursor: row-resize; height: 1px;}\n .e-table-rhelper { cursor: col-resize; opacity: .87;position: absolute;}\n .e-table-rhelper.e-column-helper { width: 1px; }\n .e-table-rhelper.e-row-helper {height: 1px;}\n .e-reicon::before { border-bottom: 6px solid transparent; border-right: 6px solid;\n border-top: 6px solid transparent; content: ''; display: block; height: 0;\n position: absolute; right: 4px; top: 4px; width: 20px; }\n .e-reicon::after { border-bottom: 6px solid transparent; border-left: 6px solid;\n border-top: 6px solid transparent; content: ''; display: block;\n height: 0; left: 4px; position: absolute; top: 4px; width: 20px; z-index: 3; }\n .e-row-helper.e-reicon::after { top: 10px; transform: rotate(90deg); }\n .e-row-helper.e-reicon::before { left: 4px; top: -20px; transform: rotate(90deg); }\n span.e-table-box { background-color: #ffffff; border: 1px solid #BDBDBD; }\n span.e-table-box.e-rbox-select { background-color: #BDBDBD; border: 1px solid #BDBDBD; }\n .e-table-rhelper { background-color: #4a90e2;}\n .e-rtl { direction: rtl; }\n .e-rte-placeholder::before { content: attr(placeholder); opacity: 0.54; overflow: hidden;\n padding-top: 16px; position: absolute; text-align: start; top: 0; z-index: 1; }\n </style>\n </head>";
19112
19151
  /**
19113
19152
  * Content module is used to render Rich Text Editor content
19114
19153
  *
@@ -19329,7 +19368,8 @@ var XhtmlValidation = /** @__PURE__ @class */ (function () {
19329
19368
  var childEle = ele.childNodes[j];
19330
19369
  if (childEle.nodeType !== 3 && childEle.nodeName !== 'TABLE' && childEle.nodeName !== 'TBODY' &&
19331
19370
  childEle.nodeName !== 'THEAD' && childEle.nodeName !== 'TH' && childEle.nodeName !== 'TR' &&
19332
- childEle.nodeName !== 'TD' && childEle.hasAttribute(attrName)) {
19371
+ childEle.nodeName !== 'TD' && childEle.hasAttribute(attrName) &&
19372
+ !childEle.classList.contains('e-mention-chip')) {
19333
19373
  childEle.removeAttribute(attrName);
19334
19374
  }
19335
19375
  if (childEle.hasChildNodes()) {
@@ -20267,14 +20307,22 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
20267
20307
  this.parent.trigger(afterPasteCleanup, { value: value }, function (updatedArgs) {
20268
20308
  value = updatedArgs.value;
20269
20309
  });
20310
+ var tempDivElem = this.parent.createElement('div');
20311
+ tempDivElem.innerHTML = value;
20312
+ var isValueNotEmpty = tempDivElem.textContent !== '' || !isNullOrUndefined(tempDivElem.querySelector('img')) ||
20313
+ !isNullOrUndefined(tempDivElem.querySelector('table'));
20270
20314
  if (this.parent.pasteCleanupSettings.prompt) {
20271
- e.args.preventDefault();
20272
- var tempDivElem = this.parent.createElement('div');
20273
- tempDivElem.innerHTML = value;
20274
- if (tempDivElem.textContent !== '' || !isNullOrUndefined(tempDivElem.querySelector('img')) ||
20275
- !isNullOrUndefined(tempDivElem.querySelector('table'))) {
20315
+ if (isValueNotEmpty) {
20316
+ e.args.preventDefault();
20276
20317
  this.pasteDialog(value, args);
20277
20318
  }
20319
+ else if (Browser.userAgent.indexOf('Firefox') !== -1) {
20320
+ this.fireFoxImageUpload();
20321
+ }
20322
+ }
20323
+ else if (!isValueNotEmpty && !this.parent.pasteCleanupSettings.plainText &&
20324
+ Browser.userAgent.indexOf('Firefox') !== -1) {
20325
+ this.fireFoxImageUpload();
20278
20326
  }
20279
20327
  else if (this.parent.pasteCleanupSettings.plainText) {
20280
20328
  e.args.preventDefault();
@@ -20290,6 +20338,31 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
20290
20338
  }
20291
20339
  }
20292
20340
  };
20341
+ PasteCleanup.prototype.fireFoxImageUpload = function () {
20342
+ var _this = this;
20343
+ // Timeout 500 is added to capture after default paste image from file manager is completed.
20344
+ setTimeout(function () {
20345
+ if (Browser.userAgent.indexOf('Firefox') !== -1) {
20346
+ var currentFocusNode = _this.nodeSelectionObj.getRange(_this.contentRenderer.getDocument()).startContainer;
20347
+ if (currentFocusNode.nodeName !== '#text') {
20348
+ currentFocusNode = currentFocusNode.childNodes[_this.nodeSelectionObj.getRange(_this.contentRenderer.getDocument()).startOffset];
20349
+ }
20350
+ if (currentFocusNode.previousSibling.nodeName === 'IMG') {
20351
+ currentFocusNode.previousSibling.classList.add('pasteContent_Img');
20352
+ currentFocusNode.previousSibling.classList.add(CLS_RTE_IMAGE);
20353
+ if (_this.parent.insertImageSettings.display === 'inline') {
20354
+ currentFocusNode.previousSibling.classList.add(CLS_IMGINLINE);
20355
+ }
20356
+ else {
20357
+ currentFocusNode.previousSibling.classList.add(CLS_IMGBREAK);
20358
+ }
20359
+ currentFocusNode.previousSibling.classList.add();
20360
+ _this.setImageProperties(currentFocusNode.previousSibling);
20361
+ }
20362
+ }
20363
+ _this.imgUploading(_this.parent.inputElement);
20364
+ }, 500);
20365
+ };
20293
20366
  PasteCleanup.prototype.splitBreakLine = function (value) {
20294
20367
  var enterSplitText = value.split('\n');
20295
20368
  var contentInnerElem = '';
@@ -20773,24 +20846,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
20773
20846
  var allImg = clipBoardElem.querySelectorAll('img');
20774
20847
  for (var i = 0; i < allImg.length; i++) {
20775
20848
  allImg[i].classList.add('pasteContent_Img');
20776
- if (this.parent.insertImageSettings.width !== 'auto') {
20777
- allImg[i].setAttribute('width', this.parent.insertImageSettings.width);
20778
- }
20779
- if (this.parent.insertImageSettings.minWidth !== '0' && this.parent.insertImageSettings.minWidth !== 0) {
20780
- allImg[i].style.minWidth = this.parent.insertImageSettings.minWidth.toString();
20781
- }
20782
- if (this.parent.insertImageSettings.maxWidth !== null) {
20783
- allImg[i].style.maxWidth = this.parent.getInsertImgMaxWidth().toString();
20784
- }
20785
- if (this.parent.insertImageSettings.height !== 'auto') {
20786
- allImg[i].setAttribute('height', this.parent.insertImageSettings.height);
20787
- }
20788
- if (this.parent.insertImageSettings.minHeight !== '0' && this.parent.insertImageSettings.minHeight !== 0) {
20789
- allImg[i].style.minHeight = this.parent.insertImageSettings.minHeight.toString();
20790
- }
20791
- if (this.parent.insertImageSettings.maxHeight !== null) {
20792
- allImg[i].style.maxHeight = this.parent.insertImageSettings.maxHeight.toString();
20793
- }
20849
+ this.setImageProperties(allImg[i]);
20794
20850
  }
20795
20851
  this.addTempClass(clipBoardElem);
20796
20852
  if (clipBoardElem.textContent !== '' || !isNullOrUndefined(clipBoardElem.querySelector('img')) ||
@@ -20807,6 +20863,26 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
20807
20863
  }
20808
20864
  }
20809
20865
  };
20866
+ PasteCleanup.prototype.setImageProperties = function (allImg) {
20867
+ if (this.parent.insertImageSettings.width !== 'auto') {
20868
+ allImg.setAttribute('width', this.parent.insertImageSettings.width);
20869
+ }
20870
+ if (this.parent.insertImageSettings.minWidth !== '0' && this.parent.insertImageSettings.minWidth !== 0) {
20871
+ allImg.style.minWidth = this.parent.insertImageSettings.minWidth.toString();
20872
+ }
20873
+ if (this.parent.insertImageSettings.maxWidth !== null) {
20874
+ allImg.style.maxWidth = this.parent.getInsertImgMaxWidth().toString();
20875
+ }
20876
+ if (this.parent.insertImageSettings.height !== 'auto') {
20877
+ allImg.setAttribute('height', this.parent.insertImageSettings.height);
20878
+ }
20879
+ if (this.parent.insertImageSettings.minHeight !== '0' && this.parent.insertImageSettings.minHeight !== 0) {
20880
+ allImg.style.minHeight = this.parent.insertImageSettings.minHeight.toString();
20881
+ }
20882
+ if (this.parent.insertImageSettings.maxHeight !== null) {
20883
+ allImg.style.maxHeight = this.parent.insertImageSettings.maxHeight.toString();
20884
+ }
20885
+ };
20810
20886
  PasteCleanup.prototype.addTempClass = function (clipBoardElem) {
20811
20887
  var allChild = clipBoardElem.children;
20812
20888
  for (var i = 0; i < allChild.length; i++) {
@@ -26786,7 +26862,7 @@ var Video = /** @__PURE__ @class */ (function () {
26786
26862
  videoUrl.appendChild(urlContent);
26787
26863
  this.embedInputUrl = this.parent.createElement('textarea', {
26788
26864
  className: 'e-input e-embed-video-url',
26789
- attrs: { placeholder: 'Paste Embed URL here', type: 'text', tabindex: '-1', 'aria-label': this.i10n.getConstant('embedVideoLinkHeader') }
26865
+ attrs: { placeholder: 'Paste Embedded Code here', type: 'text', tabindex: '-1', 'aria-label': this.i10n.getConstant('embedVideoLinkHeader') }
26790
26866
  });
26791
26867
  this.embedInputUrl.addEventListener('keyup', function () {
26792
26868
  if (!isNullOrUndefined(_this.embedInputUrl)) {
@@ -26813,7 +26889,7 @@ var Video = /** @__PURE__ @class */ (function () {
26813
26889
  }
26814
26890
  });
26815
26891
  var embedUrlBtn = new RadioButton({
26816
- label: 'Embed URL',
26892
+ label: 'Embedded Code',
26817
26893
  checked: true,
26818
26894
  name: 'URL',
26819
26895
  created: function () {
@@ -30736,6 +30812,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
30736
30812
  var currentEndContainer = range.endContainer;
30737
30813
  var currentStartOffset = range.startOffset;
30738
30814
  var isSameContainer = currentStartContainer === currentEndContainer ? true : false;
30815
+ var currentEndOffset = currentEndContainer.textContent.length;
30739
30816
  var endNode = range.endContainer.nodeName === '#text' ? range.endContainer.parentElement :
30740
30817
  range.endContainer;
30741
30818
  var closestLI = closest(endNode, 'LI');
@@ -30848,6 +30925,9 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
30848
30925
  if ((!isNullOrUndefined(this.placeHolderWrapper)) && (this.inputElement.textContent.length !== 1)) {
30849
30926
  this.placeHolderWrapper.style.display = 'none';
30850
30927
  }
30928
+ else if (this.iframeSettings.enable && this.inputElement.classList.contains("e-rte-placeholder")) {
30929
+ removeClass([this.inputElement], "e-rte-placeholder");
30930
+ }
30851
30931
  else {
30852
30932
  this.setPlaceHolder();
30853
30933
  }
@@ -31551,6 +31631,17 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
31551
31631
  this.inputElement.setAttribute('placeholder', this.placeholder);
31552
31632
  }
31553
31633
  }
31634
+ if (this.placeholder && this.iframeSettings.enable) {
31635
+ if (this.inputElement.textContent.length === 0 && this.inputElement.childNodes.length < 2 && !isNullOrUndefined(this.inputElement.firstChild) && (this.inputElement.firstChild.nodeName === 'BR' ||
31636
+ ((this.inputElement.firstChild.nodeName === 'P' || this.inputElement.firstChild.nodeName === 'DIV') && !isNullOrUndefined(this.inputElement.firstChild.firstChild) &&
31637
+ this.inputElement.firstChild.firstChild.nodeName === 'BR'))) {
31638
+ addClass([this.inputElement], "e-rte-placeholder");
31639
+ this.inputElement.setAttribute('placeholder', this.placeholder);
31640
+ }
31641
+ else {
31642
+ removeClass([this.inputElement], "e-rte-placeholder");
31643
+ }
31644
+ }
31554
31645
  };
31555
31646
  RichTextEditor.prototype.setWidth = function (width) {
31556
31647
  if (width !== 'auto') {
@@ -32276,6 +32367,9 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
32276
32367
  clearInterval(this.timeInterval);
32277
32368
  this.timeInterval = null;
32278
32369
  }
32370
+ if (!isNullOrUndefined(this.placeHolderWrapper) && this.element.querySelector('[title = Preview]')) {
32371
+ this.placeHolderWrapper.style.display = "none";
32372
+ }
32279
32373
  EventHandler.remove(document, 'mousedown', this.onDocumentClick);
32280
32374
  }
32281
32375
  else {