@syncfusion/ej2-richtexteditor 27.1.51 → 27.1.55

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.
Files changed (49) hide show
  1. package/dist/ej2-richtexteditor.min.js +10 -0
  2. package/dist/ej2-richtexteditor.umd.min.js +2 -2
  3. package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-richtexteditor.es2015.js +874 -238
  5. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  6. package/dist/es6/ej2-richtexteditor.es5.js +267 -120
  7. package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
  8. package/dist/global/ej2-richtexteditor.min.js +2 -2
  9. package/dist/global/ej2-richtexteditor.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +12 -12
  12. package/src/common/editor-styles.d.ts +1 -0
  13. package/src/common/editor-styles.js +1 -0
  14. package/src/common/interface.d.ts +10 -0
  15. package/src/editor-manager/base/editor-manager.js +1 -1
  16. package/src/editor-manager/base/interface.d.ts +2 -2
  17. package/src/editor-manager/plugin/alignments.js +1 -1
  18. package/src/editor-manager/plugin/clearformat.js +1 -1
  19. package/src/editor-manager/plugin/dom-node.js +1 -1
  20. package/src/editor-manager/plugin/image.js +2 -0
  21. package/src/editor-manager/plugin/indents.js +1 -1
  22. package/src/editor-manager/plugin/inserthtml.d.ts +1 -0
  23. package/src/editor-manager/plugin/inserthtml.js +49 -18
  24. package/src/editor-manager/plugin/link.js +2 -2
  25. package/src/editor-manager/plugin/lists.js +5 -4
  26. package/src/editor-manager/plugin/ms-word-clean-up.js +5 -0
  27. package/src/editor-manager/plugin/selection-commands.js +2 -2
  28. package/src/editor-manager/plugin/toolbar-status.js +1 -1
  29. package/src/editor-manager/plugin/undo.js +3 -3
  30. package/src/rich-text-editor/actions/base-toolbar.js +1 -1
  31. package/src/rich-text-editor/actions/dropdown-buttons.js +0 -6
  32. package/src/rich-text-editor/actions/enter-key.js +11 -5
  33. package/src/rich-text-editor/actions/html-editor.js +2 -2
  34. package/src/rich-text-editor/actions/import-export.js +1 -1
  35. package/src/rich-text-editor/actions/paste-clean-up.js +1 -1
  36. package/src/rich-text-editor/actions/resize.d.ts +3 -0
  37. package/src/rich-text-editor/actions/resize.js +13 -0
  38. package/src/rich-text-editor/base/interface.d.ts +13 -1
  39. package/src/rich-text-editor/base/rich-text-editor.js +19 -4
  40. package/src/rich-text-editor/renderer/content-renderer.d.ts +1 -1
  41. package/src/rich-text-editor/renderer/content-renderer.js +9 -2
  42. package/src/rich-text-editor/renderer/iframe-content-renderer.js +21 -8
  43. package/src/rich-text-editor/renderer/image-module.d.ts +2 -0
  44. package/src/rich-text-editor/renderer/image-module.js +26 -13
  45. package/src/rich-text-editor/renderer/link-module.js +6 -2
  46. package/src/rich-text-editor/renderer/slash-menu.js +1 -1
  47. package/src/rich-text-editor/renderer/video-module.js +1 -1
  48. package/src/selection/selection.d.ts +5 -0
  49. package/src/selection/selection.js +44 -1
@@ -1,4 +1,4 @@
1
- import { isNullOrUndefined, Browser, addClass, removeClass, selectAll as selectAll$1, createElement, detach, SanitizeHtmlHelper, extend, EventHandler, closest, getInstance, formatUnit, select, Ajax, Property, Event, NotifyPropertyChanges, Base, ChildProperty, KeyboardEvents as KeyboardEvents$1, setStyleAttribute, getUniqueID, append, debounce, Observer, prepend, attributes, getComponent, getEnumValue, Complex, print, L10n, compile, Touch, Component } from '@syncfusion/ej2-base';
1
+ import { isNullOrUndefined, Browser, addClass, removeClass, selectAll as selectAll$1, createElement, detach, SanitizeHtmlHelper, extend, EventHandler, closest, getInstance, formatUnit, select, Ajax, Property, Event as Event$1, NotifyPropertyChanges, Base, ChildProperty, KeyboardEvents as KeyboardEvents$1, setStyleAttribute, getUniqueID, append, debounce, Observer, prepend, attributes, getComponent, getEnumValue, Complex, print, L10n, compile, Touch, Component } from '@syncfusion/ej2-base';
2
2
  import { Toolbar as Toolbar$1 } from '@syncfusion/ej2-navigations';
3
3
  import { DropDownButton } from '@syncfusion/ej2-splitbuttons';
4
4
  import { Tooltip, Popup, Dialog, isCollide, getScrollableParent } from '@syncfusion/ej2-popups';
@@ -3715,9 +3715,15 @@ var ContentRender = /** @__PURE__ @class */ (function () {
3715
3715
  id: this.parent.getID() + '_rte-edit-view',
3716
3716
  attrs: {
3717
3717
  'contenteditable': 'true'
3718
- },
3719
- innerHTML: rteContent
3718
+ }
3720
3719
  });
3720
+ if (!isNullOrUndefined(this.parent.fontFamily.default)) {
3721
+ this.editableElement.style.fontFamily = this.parent.fontFamily.default;
3722
+ }
3723
+ if (!isNullOrUndefined(this.parent.fontSize.default)) {
3724
+ this.editableElement.style.fontSize = this.parent.fontSize.default;
3725
+ }
3726
+ this.editableElement.innerHTML = rteContent;
3721
3727
  div.appendChild(this.editableElement);
3722
3728
  this.setPanel(div);
3723
3729
  rteObj.rootContainer.appendChild(div);
@@ -4246,9 +4252,10 @@ var PASTE_SOURCE = ['word', 'excel', 'onenote'];
4246
4252
  * `Selection` module is used to handle RTE Selections.
4247
4253
  */
4248
4254
  var NodeSelection = /** @__PURE__ @class */ (function () {
4249
- function NodeSelection() {
4255
+ function NodeSelection(editElement) {
4250
4256
  this.startNodeName = [];
4251
4257
  this.endNodeName = [];
4258
+ this.editableElement = editElement;
4252
4259
  }
4253
4260
  NodeSelection.prototype.saveInstance = function (range, body) {
4254
4261
  this.range = range.cloneRange();
@@ -4328,6 +4335,9 @@ var NodeSelection = /** @__PURE__ @class */ (function () {
4328
4335
  return false;
4329
4336
  };
4330
4337
  NodeSelection.prototype.getNode = function (startNode, endNode, nodeCollection) {
4338
+ if (this.editableElement && (!this.editableElement.contains(startNode) || this.editableElement === startNode)) {
4339
+ return null;
4340
+ }
4331
4341
  if (endNode === startNode &&
4332
4342
  (startNode.nodeType === 3 || !startNode.firstChild || nodeCollection.indexOf(startNode.firstChild) !== -1
4333
4343
  || this.isChildNode(nodeCollection, startNode))) {
@@ -4362,6 +4372,12 @@ var NodeSelection = /** @__PURE__ @class */ (function () {
4362
4372
  || range.startContainer;
4363
4373
  var endNode = range.endContainer.childNodes[(range.endOffset > 0) ? (range.endOffset - 1) : range.endOffset]
4364
4374
  || range.endContainer;
4375
+ var tableCursor = this.processedTableImageCursor(range);
4376
+ if (tableCursor.start || tableCursor.end) {
4377
+ if (tableCursor.startName === 'TABLE' || tableCursor.endName === 'TABLE') {
4378
+ return [];
4379
+ }
4380
+ }
4365
4381
  if ((startNode === endNode || (startNode.nodeName === 'BR' && startNode === range.endContainer.childNodes[range.endOffset])) &&
4366
4382
  startNode.childNodes.length === 0) {
4367
4383
  return [startNode];
@@ -4681,6 +4697,39 @@ var NodeSelection = /** @__PURE__ @class */ (function () {
4681
4697
  selection.removeAllRanges();
4682
4698
  selection.addRange(range);
4683
4699
  };
4700
+ NodeSelection.prototype.isTableOrImageStart = function (range) {
4701
+ var customHandlerElements = ['TABLE'];
4702
+ var startContainer = range.startContainer;
4703
+ var startOffset = range.startOffset;
4704
+ var isCursorAtStart = range.collapsed && (startContainer.nodeType === 1) &&
4705
+ startContainer.isContentEditable && startContainer.childNodes[startOffset] &&
4706
+ (customHandlerElements.indexOf(startContainer.childNodes[startOffset].nodeName) > -1);
4707
+ if (isCursorAtStart) {
4708
+ return { start: isCursorAtStart, startNodeName: startContainer.childNodes[startOffset].nodeName };
4709
+ }
4710
+ else {
4711
+ return { start: false, startNodeName: '' };
4712
+ }
4713
+ };
4714
+ NodeSelection.prototype.isTableOrImageEnd = function (range) {
4715
+ var customHandlerElements = ['TABLE'];
4716
+ var startContainer = range.startContainer;
4717
+ var startOffset = range.startOffset;
4718
+ var isCursorAtEnd = range.collapsed && (startContainer.nodeType === 1) &&
4719
+ startContainer.isContentEditable && startContainer.childNodes[startOffset - 1] &&
4720
+ (customHandlerElements.indexOf(startContainer.childNodes[startOffset - 1].nodeName) > -1);
4721
+ if (isCursorAtEnd) {
4722
+ return { end: isCursorAtEnd, endNodeName: startContainer.childNodes[startOffset - 1].nodeName };
4723
+ }
4724
+ else {
4725
+ return { end: false, endNodeName: '' };
4726
+ }
4727
+ };
4728
+ NodeSelection.prototype.processedTableImageCursor = function (range) {
4729
+ var _a = this.isTableOrImageStart(range), start = _a.start, startNodeName = _a.startNodeName;
4730
+ var _b = this.isTableOrImageEnd(range), end = _b.end, endNodeName = _b.endNodeName;
4731
+ return { start: start, startName: startNodeName, end: end, endName: endNodeName };
4732
+ };
4684
4733
  return NodeSelection;
4685
4734
  }());
4686
4735
 
@@ -5036,7 +5085,7 @@ var ToolbarStatus = /** @__PURE__ @class */ (function () {
5036
5085
  ToolbarStatus.get = function (docElement, rootNode, formatNode, fontSize, fontName, documentNode) {
5037
5086
  var formatCollection = JSON.parse(JSON.stringify(statusCollection));
5038
5087
  var nodeCollection = JSON.parse(JSON.stringify(statusCollection));
5039
- var nodeSelection = new NodeSelection();
5088
+ var nodeSelection = new NodeSelection(rootNode);
5040
5089
  var range = nodeSelection.getRange(docElement);
5041
5090
  var nodes = documentNode ? [documentNode] : range.collapsed ? nodeSelection.getNodeCollection(range) :
5042
5091
  nodeSelection.getSelectionNodeCollectionBr(range);
@@ -6527,7 +6576,7 @@ var Link = /** @__PURE__ @class */ (function () {
6527
6576
  // eslint-disable-next-line
6528
6577
  Link.prototype.insertlink = function (e) {
6529
6578
  var linkEle = this.selfLink.dialogObj.element;
6530
- var linkUrl = linkEle.querySelector('.e-rte-linkurl').value;
6579
+ var linkUrl = linkEle.querySelector('.e-rte-linkurl').value.trim();
6531
6580
  var linkText = linkEle.querySelector('.e-rte-linkText').value;
6532
6581
  var linkTitle;
6533
6582
  if (this.selfLink.parent.editorMode === 'HTML') {
@@ -6643,11 +6692,15 @@ var Link = /** @__PURE__ @class */ (function () {
6643
6692
  Link.prototype.openLink = function (e) {
6644
6693
  var selectParentEle = this.getAnchorNode(e.selectParent[0]);
6645
6694
  if (selectParentEle.classList.contains('e-rte-anchor') || selectParentEle.tagName === 'A') {
6695
+ var sanitizedHTML = this.parent.htmlEditorModule.sanitizeHelper(selectParentEle.outerHTML);
6696
+ var tempEle = document.createElement('div');
6697
+ tempEle.innerHTML = sanitizedHTML;
6646
6698
  this.parent.formatter.process(this.parent, e.args, e.args, {
6647
- url: selectParentEle.href, text: selectParentEle.innerText,
6699
+ url: tempEle.firstChild.href, text: selectParentEle.innerText,
6648
6700
  target: selectParentEle.target === '' ? '_self' : '_blank', selectNode: e.selectNode,
6649
6701
  subCommand: e.args.item.subCommand
6650
6702
  });
6703
+ tempEle.remove();
6651
6704
  }
6652
6705
  };
6653
6706
  Link.prototype.getAnchorNode = function (element) {
@@ -7306,6 +7359,17 @@ var Image$1 = /** @__PURE__ @class */ (function () {
7306
7359
  return value;
7307
7360
  }
7308
7361
  };
7362
+ Image.prototype.adjustDimensionsByAspectRatio = function (width, height, aspectRatio, isWidthPrimary) {
7363
+ if (isWidthPrimary) {
7364
+ height = Math.round(width / aspectRatio);
7365
+ width = Math.round(height * aspectRatio);
7366
+ }
7367
+ else {
7368
+ width = Math.round(height * aspectRatio);
7369
+ height = Math.round(width / aspectRatio);
7370
+ }
7371
+ return { width: width, height: height };
7372
+ };
7309
7373
  Image.prototype.pixToPerc = function (expected, parentEle) {
7310
7374
  return expected / parseFloat(getComputedStyle(parentEle).width) * 100;
7311
7375
  };
@@ -7349,21 +7413,19 @@ var Image$1 = /** @__PURE__ @class */ (function () {
7349
7413
  var currentHeight = this.imgEle.clientHeight;
7350
7414
  var width = diffX * resizeFactor[0] + currentWidth;
7351
7415
  var height = diffY * resizeFactor[1] + currentHeight;
7352
- width = (width < 16) ? 16 : width;
7353
- height = (height < 16) ? 16 : height;
7354
- if (Math.abs(diffX) > Math.abs(diffY)) {
7355
- height = Math.round(width / this.aspectRatio);
7356
- width = Math.round(height * this.aspectRatio);
7357
- }
7358
- else {
7359
- width = Math.round(height * this.aspectRatio);
7360
- height = Math.round(width / this.aspectRatio);
7361
- }
7416
+ var dimensions = this.adjustDimensions(width, height, diffX, diffY, this.aspectRatio);
7362
7417
  this.pageX = pageX;
7363
7418
  this.pageY = pageY;
7364
- this.imgDupMouseMove(width + 'px', height + 'px', e);
7419
+ this.imgDupMouseMove(dimensions.width + 'px', dimensions.height + 'px', e);
7365
7420
  }
7366
7421
  };
7422
+ Image.prototype.adjustDimensions = function (width, height, diffX, diffY, aspectRatio) {
7423
+ width = (width < 16) ? 16 : width;
7424
+ height = (height < 16) ? 16 : height;
7425
+ var isWidthPrimary = Math.abs(diffX) > Math.abs(diffY);
7426
+ var dimensions = this.adjustDimensionsByAspectRatio(width, height, aspectRatio, isWidthPrimary);
7427
+ return dimensions;
7428
+ };
7367
7429
  Image.prototype.getResizeFactor = function (value) {
7368
7430
  return imageResizeFactor[value];
7369
7431
  };
@@ -7436,11 +7498,15 @@ var Image$1 = /** @__PURE__ @class */ (function () {
7436
7498
  }
7437
7499
  };
7438
7500
  Image.prototype.openImgLink = function (e) {
7501
+ var sanitizedHTML = this.parent.htmlEditorModule.sanitizeHelper(e.selectParent[0].parentNode.outerHTML);
7502
+ var tempEle = document.createElement('div');
7503
+ tempEle.innerHTML = sanitizedHTML;
7439
7504
  var target = e.selectParent[0].parentNode.target === '' ? '_self' : '_blank';
7440
7505
  this.parent.formatter.process(this.parent, e.args, e.args, {
7441
- url: e.selectParent[0].parentNode.href, target: target, selectNode: e.selectNode,
7506
+ url: tempEle.firstChild.href, target: target, selectNode: e.selectNode,
7442
7507
  subCommand: e.args.item.subCommand
7443
7508
  });
7509
+ tempEle.remove();
7444
7510
  };
7445
7511
  Image.prototype.editImgLink = function (e) {
7446
7512
  var selectParentEle = e.selectParent[0].parentNode;
@@ -7527,7 +7593,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
7527
7593
  }
7528
7594
  }
7529
7595
  if (originalEvent.keyCode === 8 || originalEvent.keyCode === 46) {
7530
- if (selectNodeEle && selectNodeEle[0].nodeName === 'IMG' && selectNodeEle.length < 1) {
7596
+ if (selectNodeEle && selectNodeEle[0] && selectNodeEle[0].nodeName === 'IMG' && selectNodeEle.length < 1) {
7531
7597
  if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
7532
7598
  save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
7533
7599
  }
@@ -10863,7 +10929,7 @@ var Video = /** @__PURE__ @class */ (function () {
10863
10929
  this.undoStack({ subCommand: (originalEvent.keyCode === 90 ? 'undo' : 'redo') });
10864
10930
  }
10865
10931
  if (originalEvent.keyCode === 8 || originalEvent.keyCode === 46) {
10866
- if (selectNodeEle && (selectNodeEle[0].nodeName === 'VIDEO' || this.isEmbedVidElem(selectNodeEle[0])) && selectNodeEle.length < 1) {
10932
+ if (selectNodeEle && selectNodeEle[0] && (selectNodeEle[0].nodeName === 'VIDEO' || this.isEmbedVidElem(selectNodeEle[0])) && selectNodeEle.length < 1) {
10867
10933
  if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection)) {
10868
10934
  save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
10869
10935
  }
@@ -12040,7 +12106,7 @@ var KeyboardEvents = /** @__PURE__ @class */ (function (_super) {
12040
12106
  Property('keyup')
12041
12107
  ], KeyboardEvents.prototype, "eventName", void 0);
12042
12108
  __decorate([
12043
- Event()
12109
+ Event$1()
12044
12110
  ], KeyboardEvents.prototype, "keyAction", void 0);
12045
12111
  KeyboardEvents = KeyboardEvents_1 = __decorate([
12046
12112
  NotifyPropertyChanges
@@ -14604,6 +14670,8 @@ var DialogRenderer = /** @__PURE__ @class */ (function () {
14604
14670
  return DialogRenderer;
14605
14671
  }());
14606
14672
 
14673
+ var IFRAME_EDITOR_STYLES = "\n@charset \"UTF-8\";\n\nhtml {\n height: auto;\n}\n\nhtml, body {\n margin: 0;\n}\n\nbody {\n color: #333;\n word-wrap: break-word;\n}\n\n.e-content {\n background: unset;\n box-sizing: border-box;\n min-height: 100px;\n outline: 0 solid transparent;\n padding: 16px;\n position: relative;\n overflow-x: auto;\n font-weight: normal;\n line-height: 1.5;\n font-size: 14px;\n text-align: inherit;\n font-family: \"Roboto\", \"Segoe UI\", \"GeezaPro\", \"DejaVu Serif\", \"sans-serif\", \"-apple-system\", \"BlinkMacSystemFont\";\n}\n\n.e-content p {\n margin: 0 0 10px;\n margin-bottom: 10px;\n}\n\n.e-content h1 {\n font-size: 2.857em;\n font-weight: 600;\n line-height: 1.2;\n margin: 10px 0;\n}\n\n.e-content h2 {\n font-size: 2.285em;\n font-weight: 600;\n line-height: 1.2;\n margin: 10px 0;\n}\n\n.e-content h3 {\n font-size: 2em;\n font-weight: 600;\n line-height: 1.2;\n margin: 10px 0;\n}\n\n.e-content h4 {\n font-size: 1.714em;\n font-weight: 600;\n line-height: 1.2;\n margin: 10px 0;\n}\n\n.e-content h5 {\n font-size: 1.428em;\n font-weight: 600;\n line-height: 1.2;\n margin: 10px 0;\n}\n\n.e-content h6 {\n font-size: 1.142em;\n font-weight: 600;\n line-height: 1.5;\n margin: 10px 0;\n}\n\n.e-content blockquote {\n margin: 10px 0;\n padding-left: 12px;\n border-left: 2px solid #5c5c5c;\n}\n\n.e-rtl.e-content blockquote {\n padding-left: 0;\n padding-right: 12px;\n}\n\n.e-content pre {\n border: 0;\n border-radius: 0;\n color: #333;\n font-size: inherit;\n line-height: inherit;\n margin: 0 0 10px;\n overflow: visible;\n padding: 0;\n white-space: pre-wrap;\n word-break: inherit;\n word-wrap: break-word;\n}\n\n.e-content code {\n background: #9d9d9d26;\n color: #ed484c;\n}\n\n.e-content strong,\n.e-content b {\n font-weight: bold;\n}\n\n.e-content a {\n text-decoration: none;\n user-select: auto;\n}\n\n.e-content a:hover {\n text-decoration: underline;\n}\n\n.e-content li {\n margin-bottom: 10px;\n}\n\n.e-content li ol,\n.e-content li ul {\n margin-block-start: 10px;\n}\n\n.e-content ul {\n list-style-type: disc;\n}\n\n.e-content ul ul,\n.e-content ol ul {\n list-style-type: circle;\n}\n\n.e-content ul ul ul,\n.e-content ol ul ul,\n.e-content ul ol ul,\n.e-content ol ol ul {\n list-style-type: square;\n}\n\n.e-rte-image,\n.e-rte-video {\n border: 0;\n cursor: pointer;\n display: block;\n float: none;\n height: auto;\n margin: 5px auto;\n max-width: 100%;\n position: relative;\n}\n\n.e-content p:last-child,\n.e-content pre:last-child,\n.e-content blockquote:last-child {\n margin-bottom: 0;\n}\n\n.e-content h3 + h4,\n.e-content h4 + h5,\n.e-content h5 + h6 {\n margin-top: 0.6em;\n}\n\n.e-content ul:last-child {\n margin-bottom: 0;\n}\n\n.e-content table {\n margin-bottom: 10px;\n border-collapse: collapse;\n empty-cells: show;\n}\n\n.e-content table.e-cell-select {\n position: relative;\n}\n\n.e-content table.e-cell-select::after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid #4a90e2;\n pointer-events: none;\n}\n\ntable .e-cell-select {\n border: 1px double #4a90e2 !important;\n}\n\n.e-content table.e-rte-table th {\n background-color: #E0E0E0;\n}\n\n.e-rte-table td,\n.e-rte-table th {\n border: 1px solid #BDBDBD;\n height: 20px;\n min-width: 20px;\n padding: 2px 5px;\n box-sizing: border-box;\n}\n\n.e-rte-table td.e-cell-select.e-multi-cells-select,\n.e-rte-table th.e-cell-select.e-multi-cells-select {\n position: relative;\n}\n\n.e-rte-table td.e-cell-select.e-multi-cells-select::after,\n.e-rte-table th.e-cell-select.e-multi-cells-select::after {\n background-color: rgba(13, 110, 253, 0.08);\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n bottom: 0;\n pointer-events: none;\n right: 0;\n}\n\ntable td.e-multi-cells-select ::selection,\ntable th.e-multi-cells-select ::selection {\n background-color: transparent;\n}\n\ntd.e-multi-cells-select,\nth.e-multi-cells-select {\n user-select: none !important;\n}\n\n.e-rte-table.e-dashed-border td,\n.e-rte-table.e-dashed-border th {\n border-style: dashed;\n}\n\n.e-rte-table .e-alternate-border tbody tr:nth-child(2n) {\n background-color: #F5F5F5;\n}\n\n.e-rte-audio {\n border: 0;\n cursor: pointer;\n display: block;\n float: none;\n margin: 5px auto;\n max-width: 100%;\n position: relative;\n}\n\n.e-rte-image.e-imginline,\n.e-rte-audio.e-audio-inline,\n.e-rte-video.e-video-inline {\n display: inline-block;\n float: none;\n margin-left: 5px;\n margin-right: 5px;\n max-width: calc(100% - (2 * 5px));\n padding: 1px;\n vertical-align: bottom;\n}\n\n.e-rte-image.e-imgcenter,\n.e-rte-video.e-video-center {\n cursor: pointer;\n display: block;\n float: none;\n margin: 5px auto;\n max-width: 100%;\n position: relative;\n}\n\n.e-rte-image.e-imgright,\n.e-rte-video.e-video-right {\n float: right;\n margin: 0 auto;\n margin-left: 5px;\n text-align: right;\n}\n\n.e-rte-image.e-imgleft,\n.e-rte-video.e-video-left {\n float: left;\n margin: 0 auto;\n margin-right: 5px;\n text-align: left;\n}\n\n.e-img-caption {\n display: inline-block;\n float: none;\n margin: 5px auto;\n max-width: 100%;\n position: relative;\n}\n\n.e-img-caption.e-caption-inline {\n display: inline-block;\n float: none;\n margin: 5px auto;\n margin-left: 5px;\n margin-right: 5px;\n max-width: calc(100% - (2 * 5px));\n position: relative;\n text-align: center;\n vertical-align: bottom;\n}\n\n.e-rte-img-caption.e-imgcenter {\n display: contents;\n margin-left: auto;\n margin-right: auto;\n}\n\n.e-rte-img-caption.e-imgright {\n display: contents;\n margin-left: auto;\n margin-right: 0;\n}\n\n.e-rte-img-caption.e-imgleft {\n display: contents;\n margin-left: 0;\n margin-right: auto;\n}\n\n.e-img-caption.e-rte-img-caption.e-imgbreak {\n display: contents;\n}\n\n.e-img-inner {\n box-sizing: border-box;\n display: block;\n font-size: 16px;\n font-weight: initial;\n margin: auto;\n opacity: .9;\n text-align: center;\n width: 100%;\n}\n\n.e-img-wrap {\n display: inline-block;\n margin: auto;\n padding: 0;\n text-align: center;\n width: 100%;\n}\n\n.e-imgleft,\n.e-video-left {\n float: left;\n margin: 0 5px 0 0;\n text-align: left;\n}\n\n.e-imgright,\n.e-video-right {\n float: right;\n margin: 0 0 0 5px;\n text-align: right;\n}\n\n.e-imgcenter,\n.e-video-center {\n cursor: pointer;\n display: block;\n float: none;\n height: auto;\n margin: 5px auto;\n max-width: 100%;\n position: relative;\n}\n\n.e-control img:not(.e-resize) {\n border: 2px solid transparent;\n z-index: 1000\n}\n\n.e-imginline,\n.e-audio-inline,\n.e-video-inline {\n display: inline-block;\n float: none;\n margin-left: 5px;\n margin-right: 5px;\n max-width: calc(100% - (2 * 5px));\n vertical-align: bottom;\n}\n\n.e-imgbreak,\n.e-audio-break,\n.e-video-break {\n border: 0;\n cursor: pointer;\n display: block;\n float: none;\n height: auto;\n margin: 5px auto;\n max-width: 100%;\n position: relative;\n}\n\n.e-rte-image.e-img-focus:not(.e-resize),\n.e-audio-focus:not(.e-resize),\n.e-video-focus:not(.e-resize) {\n border: solid 2px #4a90e2;\n}\n\nimg.e-img-focus::selection,\naudio.e-audio-focus::selection,\n.e-video-focus::selection {\n background: transparent;\n color: transparent;\n}\n\nspan.e-rte-imageboxmark,\nspan.e-rte-videoboxmark {\n width: 10px;\n height: 10px;\n position: absolute;\n display: block;\n background: #4a90e2;\n border: 1px solid #fff;\n z-index: 1000;\n}\n\n.e-mob-rte.e-mob-span span.e-rte-imageboxmark,\n.e-mob-rte.e-mob-span span.e-rte-videoboxmark {\n background: #4a90e2;\n border: 1px solid #fff;\n}\n\n.e-mob-rte span.e-rte-imageboxmark,\n.e-mob-rte span.e-rte-videoboxmark {\n background: #fff;\n border: 1px solid #4a90e2;\n border-radius: 15px;\n height: 20px;\n width: 20px;\n}\n\n.e-mob-rte.e-mob-span span.e-rte-imageboxmark,\n.e-mob-rte.e-mob-span span.e-rte-videoboxmark {\n background: #4a90e2;\n border: 1px solid #fff;\n}\n\n.e-content img.e-resize,\n.e-content video.e-resize {\n z-index: 1000;\n}\n\n.e-img-caption .e-img-inner {\n outline: 0;\n}\n\n.e-rte-img-caption.e-imgleft .e-img-inner {\n float: left;\n text-align: left;\n}\n\n.e-rte-img-caption.e-imgright .e-img-inner {\n float: right;\n text-align: right;\n}\n\n.e-rte-img-caption.e-imgleft .e-img-wrap,\n.e-rte-img-caption.e-imgright .e-img-wrap {\n display: contents;\n}\n\n.e-img-caption a:focus-visible {\n outline: none;\n}\n\n.e-rte-img-caption .e-rte-image.e-imgright {\n margin-left: auto;\n margin-right: 0;\n}\n\n.e-rte-img-caption .e-rte-image.e-imgleft {\n margin: 0;\n}\n\nspan.e-table-box {\n cursor: nwse-resize;\n display: block;\n height: 10px;\n position: absolute;\n width: 10px;\n background-color: #ffffff;\n border: 1px solid #BDBDBD;\n}\n\nspan.e-table-box.e-rmob {\n height: 14px;\n width: 14px;\n background-color: #BDBDBD;\n border: 1px solid #BDBDBD;\n}\n\n.e-row-resize,\n.e-column-resize {\n background-color: transparent;\n background-repeat: repeat;\n bottom: 0;\n cursor: col-resize;\n height: 1px;\n overflow: visible;\n position: absolute;\n width: 1px;\n}\n\n.e-row-resize {\n cursor: row-resize;\n height: 1px;\n}\n\n.e-table-rhelper {\n cursor: col-resize;\n opacity: .87;\n position: absolute;\n}\n\n.e-table-rhelper.e-column-helper {\n width: 1px;\n}\n\n.e-table-rhelper.e-row-helper {\n height: 1px;\n}\n\n.e-reicon::before {\n border-bottom: 6px solid transparent;\n border-right: 6px solid;\n border-top: 6px solid transparent;\n content: '';\n display: block;\n height: 0;\n position: absolute;\n right: 4px;\n top: 4px;\n width: 20px;\n}\n\n.e-reicon::after {\n border-bottom: 6px solid transparent;\n border-left: 6px solid;\n border-top: 6px solid transparent;\n content: '';\n display: block;\n height: 0;\n left: 4px;\n position: absolute;\n top: 4px;\n width: 20px;\n z-index: 3;\n}\n\n.e-row-helper.e-reicon::after {\n top: 10px;\n transform: rotate(90deg);\n}\n\n.e-row-helper.e-reicon::before {\n left: 4px;\n top: -20px;\n transform: rotate(90deg);\n}\n\n\n.e-table-rhelper {\n background-color: #4a90e2;\n}\n\n.e-rtl {\n direction: rtl;\n}\n\n.e-rte-placeholder::before {\n content: attr(placeholder);\n opacity: 0.54;\n overflow: hidden;\n padding-top: 16px;\n position: absolute;\n text-align: start;\n top: 0;\n z-index: 1;\n}\n\n.e-resize-enabled,\n.e-count-enabled {\n padding-bottom: 0px;\n}\n";
14674
+
14607
14675
  var __extends$1 = (undefined && undefined.__extends) || (function () {
14608
14676
  var extendStatics = function (d, b) {
14609
14677
  extendStatics = Object.setPrototypeOf ||
@@ -14617,7 +14685,8 @@ var __extends$1 = (undefined && undefined.__extends) || (function () {
14617
14685
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14618
14686
  };
14619
14687
  })();
14620
- 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-video {border: 0;cursor: pointer;display:\n block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-audio {border: 0;cursor: pointer;display:\n block;float: none;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;\n margin-left: 5px;margin-right: 5px;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-rte-img-caption.e-imgcenter {display: contents; margin-left: auto; margin-right: auto;}\n .e-rte-img-caption.e-imgright {display: contents; margin-left: auto; margin-right: 0;}\n .e-rte-img-caption.e-imgleft {display: contents;margin-left: 0;margin-right: auto;}\n .e-img-caption.e-rte-img-caption.e-imgbreak {display: contents;}\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, span.e-rte-videoboxmark { 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, .e-mob-rte.e-mob-span span.e-rte-videoboxmark { background: #4a90e2; border: 1px solid #fff; }\n .e-mob-rte span.e-rte-imageboxmark, .e-mob-rte span.e-rte-videoboxmark { 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, .e-mob-rte.e-mob-span span.e-rte-videoboxmark { 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-rte-content { font-size: 14px; }\n .e-content { font-weight: normal; line-height: 1.5; font-size: 1em; }\n .e-img-caption .e-img-inner { outline: 0; }\n .e-rte-img-caption.e-imgleft .e-img-inner { float: left; text-align: left; }\n .e-rte-img-caption.e-imgright .e-img-inner { float: right; text-align: right; }\n .e-rte-img-caption.e-imgleft .e-img-wrap, .e-rte-img-caption.e-imgright .e-img-wrap { display: contents; }\n .e-img-caption a:focus-visible { outline: none; }\n .e-rte-img-caption .e-rte-image.e-imgright { margin-left: auto; margin-right: 0; }\n .e-rte-img-caption .e-rte-image.e-imgleft { 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 code{ background: #9d9d9d26; color: #ed484c;}\n li{margin-bottom: 10px;}\n table{margin-bottom: 10px;}\n h1{ font-size: 2.857em; font-weight: 600; line-height: 1.2; margin: 10px 0; }\n h2{ font-size: 2.285em; font-weight: 600; line-height: 1.2; margin: 10px 0; }\n h3{ font-size: 2em; font-weight: 600; line-height: 1.2; margin: 10px 0; }\n h4{ font-size: 1.714em; font-weight: 600; line-height: 1.2; margin: 10px 0; }\n h5{ font-size: 1.428em; font-weight: 600; line-height: 1.2; margin: 10px 0; }\n h6{ font-size: 1.142em; line-height: 600; line-height: 1.5; margin: 10px 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 table.e-cell-select {position: relative;}\n table.e-cell-select::after { content: \"\"; position: absolute; top: 0; left: 0; right: 0; bottom: 0; border: 2px solid #4a90e2; pointer-events: none;}\n table td.e-cell-select.e-multi-cells-select, table th.e-cell-select.e-multi-cells-select {border: 1px solid #dee2e6; position: relative; }\n table td.e-cell-select.e-multi-cells-select::after, table th.e-cell-select.e-multi-cells-select::after {background-color: rgba(13, 110, 253, 0.08); content: \"\";\n position: absolute; top: 0; left: 0; width: 100%; height: 100%; bottom: 0; pointer-events: none; right: 0;}\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; padding-top: 16px; position: absolute; text-align: start; top: 0; z-index: 1; }\n li ol, li ul { margin-block-start: 10px;}\n .e-resize-enabled, .e-count-enabled { padding-bottom: 0px; }\n td.e-multi-cells-select ::selection, th.e-multi-cells-select ::selection { background-color: transparent; }\n td.e-multi-cells-select, th.e-multi-cells-select { user-select: none !important; }\n </style>\n </head>";
14688
+ var IFRAMEHEADER = "\n <!DOCTYPE html> \n <html>\n <head>\n <meta charset='utf-8' /> \n <style>" +
14689
+ IFRAME_EDITOR_STYLES.replace(/[\n\t]/g, '') + "\n </style>\n </head>\n";
14621
14690
  /**
14622
14691
  * Content module is used to render Rich Text Editor content
14623
14692
  *
@@ -14638,7 +14707,7 @@ var IframeContentRender = /** @__PURE__ @class */ (function (_super) {
14638
14707
  IframeContentRender.prototype.renderPanel = function () {
14639
14708
  var rteObj = this.parent;
14640
14709
  var rteContent = getEditValue(rteObj.value, rteObj);
14641
- var iFrameBodyContent = '<body spellcheck="false" autocorrect="off" contenteditable="true">' +
14710
+ var iFrameBodyContent = '<body contenteditable="true">' +
14642
14711
  rteContent + '</body></html>';
14643
14712
  var iFrameContent = IFRAMEHEADER + iFrameBodyContent;
14644
14713
  var iframe = this.parent.createElement('iframe', {
@@ -14658,12 +14727,23 @@ var IframeContentRender = /** @__PURE__ @class */ (function (_super) {
14658
14727
  iframe.setAttribute('sandbox', sandboxValues.trim());
14659
14728
  }
14660
14729
  rteObj.rootContainer.appendChild(iframe);
14661
- iframe.contentDocument.body.id = this.parent.getID() + '_rte-edit-view';
14662
14730
  iframe.contentDocument.body.setAttribute('aria-owns', this.parent.getID());
14663
14731
  iframe.contentDocument.open();
14664
14732
  iFrameContent = this.setThemeColor(iFrameContent, { color: '#333' });
14665
14733
  iframe.contentDocument.write(iFrameContent);
14666
14734
  iframe.contentDocument.close();
14735
+ var body = iframe.contentDocument.body;
14736
+ body.className = 'e-content';
14737
+ if (this.parent.height === 'auto') {
14738
+ body.style.overflowY = 'hidden';
14739
+ }
14740
+ if (!isNullOrUndefined(this.parent.fontFamily.default)) {
14741
+ body.style.fontFamily = this.parent.fontFamily.default;
14742
+ }
14743
+ if (!isNullOrUndefined(this.parent.fontSize.default)) {
14744
+ body.style.fontSize = this.parent.fontSize.default;
14745
+ }
14746
+ body.id = this.parent.getID() + '_rte-edit-view';
14667
14747
  if (rteObj.enableRtl) {
14668
14748
  this.contentPanel.contentDocument.body.setAttribute('class', 'e-rtl');
14669
14749
  }
@@ -15020,7 +15100,7 @@ var SlashMenu = /** @__PURE__ @class */ (function () {
15020
15100
  this.parent = options;
15021
15101
  this.currentDocument = this.parent.element.ownerDocument;
15022
15102
  this.L10n = serviceLocator.getService('rteLocale');
15023
- this.savedSelection = new NodeSelection();
15103
+ this.savedSelection = new NodeSelection(this.parent.inputElement);
15024
15104
  this.defaultItems = defaultSlashMenuDataModel;
15025
15105
  this.injectibleItems = injectibleSlashMenuDataModel;
15026
15106
  this.parent.on(modelChanged, this.onPropertyChanged, this);
@@ -15384,7 +15464,7 @@ var BaseToolbar = /** @__PURE__ @class */ (function () {
15384
15464
  var tooltipText = items[num].tooltipText;
15385
15465
  var shortCutKey = void 0;
15386
15466
  var isMacDev = window.navigator.platform.toLocaleLowerCase().includes('mac');
15387
- if (windowKeys["" + tooltipText]) {
15467
+ if (windowKeys["" + tooltipText] && (!isNullOrUndefined(items[num].id) || !isNullOrUndefined(items[num].cssClass))) {
15388
15468
  shortCutKey = isMacDev ? windowKeys["" + tooltipText].replace('Ctrl+', '⌘').replace('Shift+', '⇧').replace('Alt+', '⌥') : windowKeys["" + tooltipText];
15389
15469
  }
15390
15470
  else {
@@ -15558,9 +15638,6 @@ var DropDownButtons = /** @__PURE__ @class */ (function () {
15558
15638
  cssClass: CLS_DROPDOWN_POPUP + ' ' + CLS_DROPDOWN_ITEMS + ' ' + CLS_FONT_NAME_TB_BTN,
15559
15639
  itemName: 'FontName', items: fontItem, element: targetElement
15560
15640
  });
15561
- if (!isNullOrUndefined(_this.parent.fontFamily.default)) {
15562
- _this.getEditNode().style.fontFamily = _this.parent.fontFamily.default;
15563
- }
15564
15641
  break;
15565
15642
  }
15566
15643
  case 'fontsize': {
@@ -15584,9 +15661,6 @@ var DropDownButtons = /** @__PURE__ @class */ (function () {
15584
15661
  cssClass: CLS_DROPDOWN_POPUP + ' ' + CLS_DROPDOWN_ITEMS + ' ' + CLS_FONT_SIZE_TB_BTN,
15585
15662
  itemName: 'FontSize', items: fontsize, element: targetElement
15586
15663
  });
15587
- if (!isNullOrUndefined(_this.parent.fontSize.default)) {
15588
- _this.getEditNode().style.fontSize = _this.parent.fontSize.default;
15589
- }
15590
15664
  break;
15591
15665
  }
15592
15666
  case 'alignments':
@@ -21183,7 +21257,7 @@ var DOMNode = /** @__PURE__ @class */ (function () {
21183
21257
  */
21184
21258
  function DOMNode(parent, currentDocument) {
21185
21259
  this.parent = parent;
21186
- this.nodeSelection = new NodeSelection();
21260
+ this.nodeSelection = new NodeSelection(parent);
21187
21261
  this.currentDocument = currentDocument;
21188
21262
  this.tableSelection = new TableSelection(parent, currentDocument);
21189
21263
  }
@@ -22499,7 +22573,7 @@ var Lists = /** @__PURE__ @class */ (function () {
22499
22573
  if (e.event.which === 8) {
22500
22574
  this.backspaceList(e);
22501
22575
  }
22502
- if ((e.event.which === 46 && e.event.action === 'delete') || (e.event.which === 88 && e.event.action === 'cut')) {
22576
+ if ((e.event.which === 46 && e.event.action === 'delete')) {
22503
22577
  var range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
22504
22578
  var commonAncestor = range.commonAncestorContainer;
22505
22579
  var startEle = range.startContainer;
@@ -22561,7 +22635,7 @@ var Lists = /** @__PURE__ @class */ (function () {
22561
22635
  }
22562
22636
  if (isNested) {
22563
22637
  this.cleanNode();
22564
- this.parent.editableElement.focus();
22638
+ this.parent.editableElement.focus({ preventScroll: true });
22565
22639
  }
22566
22640
  if (!(e.event.action && e.event.action === 'indent')) {
22567
22641
  this.saveSelection = this.domNode.saveMarker(this.saveSelection);
@@ -22870,7 +22944,7 @@ var Lists = /** @__PURE__ @class */ (function () {
22870
22944
  span.parentNode.replaceChild(fragment, span);
22871
22945
  });
22872
22946
  }
22873
- this.parent.editableElement.focus();
22947
+ this.parent.editableElement.focus({ preventScroll: true });
22874
22948
  if (isIDevice$1()) {
22875
22949
  setEditFrameFocus(this.parent.editableElement, selector);
22876
22950
  }
@@ -23104,7 +23178,8 @@ var Lists = /** @__PURE__ @class */ (function () {
23104
23178
  parentNode.removeAttribute('style');
23105
23179
  }
23106
23180
  }
23107
- var wrapper = '<' + e.enterAction + wrapperclass + this.domNode.attributes(element) + '></' + e.enterAction + '>';
23181
+ var wrapperTag = isNullOrUndefined(e.enterAction) ? DEFAULT_TAG : e.enterAction;
23182
+ var wrapper = '<' + wrapperTag + wrapperclass + this.domNode.attributes(element) + '></' + wrapperTag + '>';
23108
23183
  if (e.enterAction !== 'BR') {
23109
23184
  this.domNode.wrapInner(element, this.domNode.parseHTMLFragment(wrapper));
23110
23185
  }
@@ -24025,7 +24100,7 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
24025
24100
  node = insertNode;
24026
24101
  }
24027
24102
  }
24028
- var nodeSelection = new NodeSelection();
24103
+ var nodeSelection = new NodeSelection(editNode);
24029
24104
  var nodeCutter = new NodeCutter();
24030
24105
  var range = nodeSelection.getRange(docElement);
24031
24106
  if (range.startContainer === editNode && range.startContainer === range.endContainer && range.startOffset === 0 &&
@@ -24248,7 +24323,9 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
24248
24323
  fragment.appendChild(node.firstChild);
24249
24324
  }
24250
24325
  if (isSingleNode) {
24251
- preNode.parentNode.replaceChild(fragment, preNode);
24326
+ range.deleteContents();
24327
+ this.removeEmptyElements(editNode, true);
24328
+ range.insertNode(fragment);
24252
24329
  }
24253
24330
  else {
24254
24331
  var startContainerParent = editNode === range.startContainer ?
@@ -24260,6 +24337,7 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
24260
24337
  range.setEnd(startContainerParent, startIndex);
24261
24338
  if (!isNullOrUndefined(lasNode) && lasNode !== editNode) {
24262
24339
  detach(lasNode);
24340
+ this.removeEmptyElements(editNode, true);
24263
24341
  }
24264
24342
  // eslint-disable-next-line
24265
24343
  !isNullOrUndefined(sibNode) ? (sibNode.parentNode === editNode ? sibNode.appendChild(fragment) : sibNode.parentNode.appendChild(fragment)) : range.insertNode(fragment);
@@ -24386,6 +24464,26 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
24386
24464
  this.cursorPos(lastSelectionNode, node, nodeSelection, docElement, editNode, enterAction);
24387
24465
  }
24388
24466
  this.alignCheck(editNode);
24467
+ var currentRange = nodeSelection.getRange(docElement);
24468
+ this.listCleanUp(currentRange);
24469
+ };
24470
+ InsertHtml.listCleanUp = function (range) {
24471
+ if (range.startContainer.parentElement.closest('ol,ul') !== null && range.endContainer.parentElement.closest('ol,ul') !== null) {
24472
+ var liElems = range.startContainer.parentElement.closest('ol,ul').querySelectorAll('li');
24473
+ if (liElems.length > 0) {
24474
+ liElems.forEach(function (item) {
24475
+ if (!isNullOrUndefined(item.firstChild) && (item.firstChild.nodeName === 'OL' || item.firstChild.nodeName === 'UL')) {
24476
+ item.style.listStyleType = 'none';
24477
+ }
24478
+ var nestedLi = Array.from(item.children).find(function (child) {
24479
+ return child.tagName === 'LI' && (child.parentElement && child.parentElement.tagName !== 'OL' && child.parentElement.tagName !== 'UL');
24480
+ });
24481
+ if (nestedLi) {
24482
+ item.parentNode.replaceChild(nestedLi, item);
24483
+ }
24484
+ });
24485
+ }
24486
+ }
24389
24487
  };
24390
24488
  InsertHtml.placeCursorEnd = function (lastSelectionNode, node, nodeSelection, docElement, editNode) {
24391
24489
  lastSelectionNode = lastSelectionNode.nodeName === 'BR' ? (isNullOrUndefined(lastSelectionNode.previousSibling) ? lastSelectionNode.parentNode
@@ -24450,10 +24548,10 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
24450
24548
  blockNode = range.endContainer;
24451
24549
  range.setEnd(blockNode, range.endContainer.textContent.length);
24452
24550
  }
24453
- if (blockNode.nodeName === 'BODY' && range.startContainer === range.endContainer && range.startContainer.nodeType === 1) {
24551
+ if (blockNode && blockNode.nodeName === 'BODY' || blockNode.nodeName === 'DIV' && range.startContainer === range.endContainer && range.startContainer.nodeType === 1) {
24454
24552
  blockNode = range.startContainer;
24455
24553
  }
24456
- if (blockNode.closest('LI') && editNode.contains(blockNode.closest('LI')) && blockNode.nodeName !== 'TD' && blockNode.nodeName !== 'TH' && blockNode.nodeName !== 'TR' && node && node.firstElementChild &&
24554
+ if (blockNode && blockNode.closest('LI') && editNode.contains(blockNode.closest('LI')) && blockNode.nodeName !== 'TD' && blockNode.nodeName !== 'TH' && blockNode.nodeName !== 'TR' && node && node.firstElementChild &&
24457
24555
  ((node).firstElementChild.tagName === 'OL' || node.firstElementChild.tagName === 'UL')) {
24458
24556
  var liNode = void 0;
24459
24557
  while (node.firstElementChild.lastElementChild && node.firstElementChild.lastElementChild.tagName === 'LI') {
@@ -24464,18 +24562,18 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
24464
24562
  node.firstElementChild.insertAdjacentElement('afterend', liNode);
24465
24563
  }
24466
24564
  }
24467
- if (blockNode.nodeName === 'TD' || blockNode.nodeName === 'TH' || blockNode.nodeName === 'TR') {
24565
+ if (blockNode && blockNode.nodeName === 'TD' || blockNode.nodeName === 'TH' || blockNode.nodeName === 'TR') {
24468
24566
  var tempSpan = createElement('span', { className: 'tempSpan' });
24469
24567
  range.insertNode(tempSpan);
24470
24568
  tempSpan.parentNode.replaceChild(node, tempSpan);
24471
24569
  }
24472
24570
  else {
24473
- var nodeSelection = new NodeSelection();
24571
+ var nodeSelection = new NodeSelection(editNode);
24474
24572
  var currentNode = this.getNodeCollection(range, nodeSelection, node)[this.getNodeCollection(range, nodeSelection, node).length - 1];
24475
24573
  var splitedElm = void 0;
24476
- if ((currentNode.nodeName === 'BR' || currentNode.nodeName === 'HR' ||
24574
+ if (currentNode && ((currentNode.nodeName === 'BR' || currentNode.nodeName === 'HR' ||
24477
24575
  (currentNode.nodeName === '#text' && !isNullOrUndefined(currentNode.parentElement) && currentNode.parentElement.nodeName === 'LI')) &&
24478
- (!isNullOrUndefined(currentNode.parentElement) && currentNode.parentElement.textContent.trim().length === 0)) {
24576
+ (!isNullOrUndefined(currentNode.parentElement) && currentNode.parentElement.textContent.trim().length === 0))) {
24479
24577
  splitedElm = currentNode;
24480
24578
  if (currentNode.parentElement.nodeName === 'LI' && !isNullOrUndefined(currentNode.nextSibling) &&
24481
24579
  currentNode.nextSibling.nodeName === 'BR') {
@@ -24488,16 +24586,20 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
24488
24586
  return;
24489
24587
  }
24490
24588
  }
24491
- else if ((currentNode.nodeName === '#text' || currentNode.nodeName === 'BR') && !isNullOrUndefined(currentNode.parentElement) &&
24589
+ else if (currentNode && ((currentNode.nodeName === '#text' || currentNode.nodeName === 'BR') && !isNullOrUndefined(currentNode.parentElement) &&
24492
24590
  (currentNode.parentElement.nodeName === 'LI' || currentNode.parentElement.closest('LI') || (blockNode === editNode && currentNode.parentElement === blockNode)) &&
24493
- currentNode.parentElement.textContent.trim().length > 0) {
24591
+ currentNode.parentElement.textContent.trim().length > 0)) {
24494
24592
  splitedElm = currentNode;
24495
24593
  if (currentNode.parentElement.nodeName === 'LI' && !isNullOrUndefined(currentNode.nextSibling) &&
24496
24594
  currentNode.nextSibling.nodeName === 'BR') {
24497
24595
  detach(currentNode.nextSibling);
24498
24596
  }
24499
24597
  if (!range.collapsed) {
24598
+ var startContainer = range.startContainer;
24599
+ var startOffset = range.startOffset;
24500
24600
  this.removeListfromPaste(range);
24601
+ range.setStart(startContainer, startOffset);
24602
+ range.setEnd(startContainer, startOffset);
24501
24603
  }
24502
24604
  range.insertNode(node);
24503
24605
  this.contentsDeleted = true;
@@ -24537,9 +24639,9 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
24537
24639
  };
24538
24640
  // eslint-disable-next-line
24539
24641
  InsertHtml.getImmediateBlockNode = function (node, editNode) {
24540
- do {
24642
+ while (node && BLOCK_TAGS.indexOf(node.nodeName.toLocaleLowerCase()) < 0) {
24541
24643
  node = node.parentNode;
24542
- } while (node && BLOCK_TAGS.indexOf(node.nodeName.toLocaleLowerCase()) < 0);
24644
+ }
24543
24645
  return node;
24544
24646
  };
24545
24647
  InsertHtml.removingComments = function (elm) {
@@ -24547,17 +24649,20 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
24547
24649
  innerElement = innerElement.replace(/<!--[\s\S]*?-->/g, '');
24548
24650
  elm.innerHTML = innerElement;
24549
24651
  };
24550
- InsertHtml.findDetachEmptyElem = function (element) {
24652
+ InsertHtml.findDetachEmptyElem = function (element, ignoreBlockNodes) {
24653
+ if (ignoreBlockNodes === void 0) { ignoreBlockNodes = false; }
24551
24654
  var removableElement;
24552
24655
  if (!isNullOrUndefined(element.parentElement)) {
24553
24656
  var hasNbsp = element.parentElement.textContent.length > 0 && element.parentElement.textContent.match(/\u00a0/g)
24554
24657
  && element.parentElement.textContent.match(/\u00a0/g).length > 0;
24555
24658
  if (!hasNbsp && element.parentElement.textContent.trim() === '' && element.parentElement.contentEditable !== 'true' &&
24556
24659
  isNullOrUndefined(element.parentElement.querySelector('img')) && element.parentElement.nodeName !== 'TD' && element.parentElement.nodeName !== 'TH') {
24557
- removableElement = this.findDetachEmptyElem(element.parentElement);
24660
+ removableElement = ignoreBlockNodes && BLOCK_TAGS.indexOf(element.parentElement.tagName.toLowerCase()) !== -1 ?
24661
+ element : this.findDetachEmptyElem(element.parentElement, ignoreBlockNodes);
24558
24662
  }
24559
24663
  else {
24560
- removableElement = element;
24664
+ removableElement = ignoreBlockNodes && BLOCK_TAGS.indexOf(element.tagName.toLowerCase()) !== -1 ? null :
24665
+ element;
24561
24666
  }
24562
24667
  }
24563
24668
  else {
@@ -24565,7 +24670,8 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
24565
24670
  }
24566
24671
  return removableElement;
24567
24672
  };
24568
- InsertHtml.removeEmptyElements = function (element) {
24673
+ InsertHtml.removeEmptyElements = function (element, ignoreBlockNodes) {
24674
+ if (ignoreBlockNodes === void 0) { ignoreBlockNodes = false; }
24569
24675
  var emptyElements = element.querySelectorAll(':empty');
24570
24676
  var nonSvgEmptyElements = Array.from(emptyElements).filter(function (element) {
24571
24677
  // Check if the element is an SVG element or an ancestor of an SVG element
@@ -24578,7 +24684,7 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
24578
24684
  nonSvgEmptyElements[i].style.borderBottom === '' ? true : false;
24579
24685
  }
24580
24686
  if (SELF_CLOSING_TAGS.indexOf(nonSvgEmptyElements[i].tagName.toLowerCase()) < 0 && lineWithDiv) {
24581
- var detachableElement = this.findDetachEmptyElem(nonSvgEmptyElements[i]);
24687
+ var detachableElement = this.findDetachEmptyElem(nonSvgEmptyElements[i], ignoreBlockNodes);
24582
24688
  if (!isNullOrUndefined(detachableElement)) {
24583
24689
  detach(detachableElement);
24584
24690
  }
@@ -24651,7 +24757,7 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
24651
24757
  var value = range.startContainer;
24652
24758
  if (!isNullOrUndefined(value) && value.nodeName === 'LI' && !isNullOrUndefined(value.parentElement) && (value.parentElement.nodeName === 'OL' || value.parentElement.nodeName === 'UL') && value.textContent.trim() === '') {
24653
24759
  value.parentElement.querySelectorAll('li').forEach(function (item) {
24654
- if (item.textContent.trim() === '') {
24760
+ if (item.textContent.trim() === '' && item !== value) {
24655
24761
  item.remove();
24656
24762
  }
24657
24763
  });
@@ -24754,7 +24860,7 @@ var LinkCommand = /** @__PURE__ @class */ (function () {
24754
24860
  }
24755
24861
  }
24756
24862
  else {
24757
- var domSelection = new NodeSelection();
24863
+ var domSelection = new NodeSelection(this.parent.editableElement);
24758
24864
  var range = domSelection.getRange(this.parent.currentDocument);
24759
24865
  if (range.endContainer.nodeName === '#text' && range.startContainer.textContent.length === (range.endOffset + 1) &&
24760
24866
  range.endContainer.textContent.charAt(range.endOffset) === ' ' && (!isNullOrUndefined(range.endContainer.nextSibling) && range.endContainer.nextSibling.nodeName === 'A')) {
@@ -24800,7 +24906,7 @@ var LinkCommand = /** @__PURE__ @class */ (function () {
24800
24906
  }
24801
24907
  };
24802
24908
  LinkCommand.prototype.createLinkNode = function (e) {
24803
- var domSelection = new NodeSelection();
24909
+ var domSelection = new NodeSelection(this.parent.editableElement);
24804
24910
  var nodeCutter = new NodeCutter();
24805
24911
  var range = domSelection.getRange(this.parent.currentDocument);
24806
24912
  var nodes = this.getSelectionNodes(domSelection.getNodeCollection(range));
@@ -25086,7 +25192,7 @@ var Alignments = /** @__PURE__ @class */ (function () {
25086
25192
  selector: e.selector
25087
25193
  });
25088
25194
  }
25089
- this.parent.editableElement.focus();
25195
+ this.parent.editableElement.focus({ preventScroll: true });
25090
25196
  save = this.parent.domNode.saveMarker(save);
25091
25197
  if (isIDevice$1()) {
25092
25198
  setEditFrameFocus(this.parent.editableElement, e.selector);
@@ -25205,7 +25311,7 @@ var Indents = /** @__PURE__ @class */ (function () {
25205
25311
  /* eslint-enable */
25206
25312
  }
25207
25313
  }
25208
- editEle.focus();
25314
+ editEle.focus({ preventScroll: true });
25209
25315
  if (isIDevice$1()) {
25210
25316
  setEditFrameFocus(editEle, e.selector);
25211
25317
  }
@@ -25375,6 +25481,8 @@ var ImageCommand = /** @__PURE__ @class */ (function () {
25375
25481
  (Browser.isIE ? selectedNode.previousSibling : selectedNode.previousElementSibling);
25376
25482
  var onImageLoadEvent_1 = function () {
25377
25483
  if (!isNullOrUndefined(_this.parent.currentDocument)) {
25484
+ imgElm_1.setAttribute('width', _this.calculateStyleValue(imgElm_1.offsetWidth));
25485
+ imgElm_1.setAttribute('height', _this.calculateStyleValue(imgElm_1.offsetHeight));
25378
25486
  e.callBack({
25379
25487
  requestType: (e.value === 'Replace') ? (e.item.subCommand = 'Replace', 'Replace') : 'Images',
25380
25488
  editorMode: 'HTML',
@@ -27209,7 +27317,7 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
27209
27317
  if (format === 'backgroundcolor' && value === '') {
27210
27318
  value = 'transparent';
27211
27319
  }
27212
- var domSelection = new NodeSelection();
27320
+ var domSelection = new NodeSelection(endNode);
27213
27321
  var domNode = new DOMNode(endNode, docElement);
27214
27322
  var nodeCutter = new NodeCutter();
27215
27323
  var isFormatted = new IsFormatted();
@@ -27418,7 +27526,7 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
27418
27526
  if (cursorNodes.length === 1 && range.startOffset === 0 && (cursorNodes[0].nodeName === 'BR' || (isNullOrUndefined(cursorNodes[0].nextSibling) ? false : cursorNodes[0].nextSibling.nodeName === 'BR'))) {
27419
27527
  detach(cursorNodes[0].nodeName === '#text' ? cursorNodes[0].nextSibling : cursorNodes[0]);
27420
27528
  }
27421
- if (!isNullOrUndefined(cursorNodes[0].parentElement) && IsFormatted.inlineTags.
27529
+ if (!isNullOrUndefined(cursorNodes[0] && cursorNodes[0].parentElement) && IsFormatted.inlineTags.
27422
27530
  indexOf((cursorNodes[0].parentElement).tagName.toLowerCase()) !== -1 && cursorNodes[0].textContent.includes('\u200B')) {
27423
27531
  var element = this.GetFormatNode(format, value);
27424
27532
  var tempNode = cursorNodes[0];
@@ -28331,7 +28439,7 @@ var ClearFormat$1 = /** @__PURE__ @class */ (function () {
28331
28439
  ClearFormat.clear = function (docElement, endNode, enterAction, selector, command) {
28332
28440
  this.domNode = new DOMNode(endNode, docElement);
28333
28441
  this.defaultTag = enterAction === 'P' ? this.defaultTag : 'div';
28334
- var nodeSelection = new NodeSelection();
28442
+ var nodeSelection = new NodeSelection(endNode);
28335
28443
  var nodeCutter = new NodeCutter();
28336
28444
  var range = nodeSelection.getRange(docElement);
28337
28445
  var nodes = range.collapsed ? nodeSelection.getSelectionNodeCollection(range) :
@@ -28763,7 +28871,7 @@ var UndoRedoManager = /** @__PURE__ @class */ (function () {
28763
28871
  if (!this.parent.currentDocument) {
28764
28872
  return;
28765
28873
  }
28766
- var range = new NodeSelection().getRange(this.parent.currentDocument);
28874
+ var range = new NodeSelection(this.parent.editableElement).getRange(this.parent.currentDocument);
28767
28875
  var currentContainer = this.parent.editableElement === range.startContainer.parentElement ?
28768
28876
  range.startContainer.parentElement : range.startContainer;
28769
28877
  for (var i = currentContainer.childNodes.length - 1; i >= 0; i--) {
@@ -28773,8 +28881,8 @@ var UndoRedoManager = /** @__PURE__ @class */ (function () {
28773
28881
  detach(currentContainer.childNodes[i]);
28774
28882
  }
28775
28883
  }
28776
- range = new NodeSelection().getRange(this.parent.currentDocument);
28777
- var save = new NodeSelection().save(range, this.parent.currentDocument);
28884
+ range = new NodeSelection(this.parent.editableElement).getRange(this.parent.currentDocument);
28885
+ var save = new NodeSelection(this.parent.editableElement).save(range, this.parent.currentDocument);
28778
28886
  var clonedElement = this.parent.editableElement.cloneNode(true);
28779
28887
  var fragment = document.createDocumentFragment();
28780
28888
  while (clonedElement.firstChild) {
@@ -29598,6 +29706,11 @@ var MsWordPaste = /** @__PURE__ @class */ (function () {
29598
29706
  startAttr = parseInt(startString, 10);
29599
29707
  }
29600
29708
  }
29709
+ else if (listStyleType === 'decimal-leading-zero') {
29710
+ if (!isNaN(parseInt(startString, 10))) {
29711
+ startAttr = parseInt(startString, 10);
29712
+ }
29713
+ }
29601
29714
  else if (listStyleType === 'upper-alpha') {
29602
29715
  startAttr = (startString.split('.')[0].charCodeAt(0) - 64);
29603
29716
  }
@@ -30751,7 +30864,7 @@ var EditorManager = /** @__PURE__ @class */ (function () {
30751
30864
  function EditorManager(options) {
30752
30865
  this.currentDocument = options.document;
30753
30866
  this.editableElement = options.editableElement;
30754
- this.nodeSelection = new NodeSelection();
30867
+ this.nodeSelection = new NodeSelection(this.editableElement);
30755
30868
  this.nodeCutter = new NodeCutter();
30756
30869
  this.domNode = new DOMNode(this.editableElement, this.currentDocument);
30757
30870
  this.observer = new Observer(this);
@@ -31438,7 +31551,7 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
31438
31551
  if (this.parent.isDestroyed) {
31439
31552
  return;
31440
31553
  }
31441
- this.nodeSelectionObj = new NodeSelection();
31554
+ this.nodeSelectionObj = new NodeSelection(this.parent.inputElement);
31442
31555
  this.parent.on(initialLoad, this.instantiateRenderer, this);
31443
31556
  this.parent.on(htmlToolbarClick, this.onToolbarClick, this);
31444
31557
  this.parent.on(keyDown, this.onKeyDown, this);
@@ -32152,7 +32265,7 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
32152
32265
  urlText = urlText.slice(0, urlTextRange);
32153
32266
  // eslint-disable-next-line
32154
32267
  var regex = new RegExp(/([^\S]|^)(((https?\:\/\/)|(www\.))(\S+))/gi);
32155
- if (selectNodeEle[0].nodeName !== 'A' && urlText.match(regex)) {
32268
+ if (selectNodeEle[0] && selectNodeEle[0].nodeName !== 'A' && urlText.match(regex)) {
32156
32269
  var selection = this.nodeSelectionObj.save(range, this.parent.contentModule.getDocument());
32157
32270
  var url = urlText.indexOf('http') > -1 ? urlText : 'http://' + urlText;
32158
32271
  var selectParent = this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
@@ -32513,7 +32626,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
32513
32626
  this.isDestroyed = false;
32514
32627
  }
32515
32628
  PasteCleanup.prototype.addEventListener = function () {
32516
- this.nodeSelectionObj = new NodeSelection();
32629
+ this.nodeSelectionObj = new NodeSelection(this.parent.inputElement);
32517
32630
  if (this.parent.isDestroyed) {
32518
32631
  return;
32519
32632
  }
@@ -33678,6 +33791,8 @@ var Resize = /** @__PURE__ @class */ (function () {
33678
33791
  this.parent = parent;
33679
33792
  this.addEventListener();
33680
33793
  this.isDestroyed = false;
33794
+ this.isResizing = false;
33795
+ this.iframeMouseUpBoundFn = this.iframeMouseUp.bind(this);
33681
33796
  }
33682
33797
  Resize.prototype.addEventListener = function () {
33683
33798
  if (this.parent.isDestroyed) {
@@ -33697,6 +33812,7 @@ var Resize = /** @__PURE__ @class */ (function () {
33697
33812
  this.parent.rootContainer.classList.add('e-resize-enabled');
33698
33813
  if (this.parent.iframeSettings.enable) {
33699
33814
  this.parent.inputElement.classList.add('e-resize-enabled');
33815
+ this.parent.contentModule.getDocument().addEventListener('mouseup', this.iframeMouseUpBoundFn);
33700
33816
  }
33701
33817
  this.touchStartEvent = (Browser.info.name === 'msie') ? 'pointerdown' : 'touchstart';
33702
33818
  EventHandler.add(this.resizer, 'mousedown', this.resizeStart, this);
@@ -33704,6 +33820,7 @@ var Resize = /** @__PURE__ @class */ (function () {
33704
33820
  };
33705
33821
  Resize.prototype.resizeStart = function (e) {
33706
33822
  var _this = this;
33823
+ this.isResizing = false;
33707
33824
  if (e.cancelable) {
33708
33825
  e.preventDefault();
33709
33826
  }
@@ -33718,6 +33835,7 @@ var Resize = /** @__PURE__ @class */ (function () {
33718
33835
  };
33719
33836
  Resize.prototype.performResize = function (e) {
33720
33837
  var _this = this;
33838
+ this.isResizing = true;
33721
33839
  var args = { event: e, requestType: 'editor' };
33722
33840
  this.parent.trigger(onResize, args, function (resizingArgs) {
33723
33841
  if (resizingArgs.cancel) {
@@ -33747,6 +33865,7 @@ var Resize = /** @__PURE__ @class */ (function () {
33747
33865
  this.parent.refreshUI();
33748
33866
  };
33749
33867
  Resize.prototype.stopResize = function (e) {
33868
+ this.isResizing = false;
33750
33869
  this.parent.refreshUI();
33751
33870
  this.unwireResizeEvents();
33752
33871
  var args = { event: e, requestType: 'editor' };
@@ -33796,6 +33915,7 @@ var Resize = /** @__PURE__ @class */ (function () {
33796
33915
  }
33797
33916
  if (this.parent.iframeSettings.enable && !isNullOrUndefined(this.parent.inputElement)) {
33798
33917
  this.parent.inputElement.classList.remove('e-resize-enabled');
33918
+ this.parent.contentModule.getDocument().removeEventListener('mouseup', this.iframeMouseUpBoundFn);
33799
33919
  }
33800
33920
  if (this.resizer) {
33801
33921
  EventHandler.remove(this.resizer, 'mousedown', this.resizeStart);
@@ -33803,6 +33923,12 @@ var Resize = /** @__PURE__ @class */ (function () {
33803
33923
  detach(this.resizer);
33804
33924
  }
33805
33925
  this.parent.off(destroy, this.destroy);
33926
+ this.iframeMouseUpBoundFn = null;
33927
+ };
33928
+ Resize.prototype.iframeMouseUp = function (e) {
33929
+ if (this.isResizing) {
33930
+ this.stopResize(e);
33931
+ }
33806
33932
  };
33807
33933
  /**
33808
33934
  * For internal use only - Get the module name.
@@ -35318,7 +35444,7 @@ var ImportExport = /** @__PURE__ @class */ (function () {
35318
35444
  saveUrl: this.parent.importWord.serviceUrl
35319
35445
  },
35320
35446
  success: function (args) {
35321
- _this.parent.executeCommand('insertHTML', args.e.currentTarget.response, { undo: true });
35447
+ _this.parent.executeCommand('importWord', args.e.currentTarget.response, { undo: true });
35322
35448
  }
35323
35449
  });
35324
35450
  this.parent.setProperties({ enableXhtml: true }, true);
@@ -35937,7 +36063,7 @@ var FileManagerSettings = /** @__PURE__ @class */ (function (_super) {
35937
36063
  return _super !== null && _super.apply(this, arguments) || this;
35938
36064
  }
35939
36065
  __decorate$2([
35940
- Event()
36066
+ Event$1()
35941
36067
  ], FileManagerSettings.prototype, "beforeSend", void 0);
35942
36068
  __decorate$2([
35943
36069
  Complex({ getImageUrl: null, url: null, uploadUrl: null }, AjaxSettings)
@@ -36768,11 +36894,16 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
36768
36894
  else if (!isNullOrUndefined(currentParent) && currentParent !== _this.parent.inputElement && currentParent.nodeName !== 'BR') {
36769
36895
  if (currentParent.textContent.trim().length === 0 || (currentParent.textContent.trim().length === 1 &&
36770
36896
  currentParent.textContent.charCodeAt(0) === 8203)) {
36771
- var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, currentParent, true).cloneNode(true);
36772
- _this.parent.formatter.editorManager.domNode.insertAfter(newElem, currentParent);
36773
- var outerBRElem = _this.parent.createElement('br');
36774
- newElem.parentElement.insertBefore(outerBRElem, newElem);
36775
- _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), newElem, 0);
36897
+ if (currentParent.childElementCount > 1 && currentParent.lastElementChild.nodeName === 'IMG') {
36898
+ _this.insertBRElement();
36899
+ }
36900
+ else {
36901
+ var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, currentParent, true).cloneNode(true);
36902
+ _this.parent.formatter.editorManager.domNode.insertAfter(newElem, currentParent);
36903
+ var outerBRElem = _this.parent.createElement('br');
36904
+ newElem.parentElement.insertBefore(outerBRElem, newElem);
36905
+ _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), newElem, 0);
36906
+ }
36776
36907
  }
36777
36908
  else {
36778
36909
  var newElem = void 0;
@@ -36807,6 +36938,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
36807
36938
  e.args.preventDefault();
36808
36939
  }
36809
36940
  _this.triggerActionComplete(e, shiftKey_1);
36941
+ _this.parent.inputElement.dispatchEvent(new Event('input'));
36810
36942
  }
36811
36943
  });
36812
36944
  }
@@ -37343,6 +37475,17 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
37343
37475
  * @public
37344
37476
  */
37345
37477
  RichTextEditor.prototype.executeCommand = function (commandName, value, option) {
37478
+ if (commandName === 'importWord') {
37479
+ var importContainer = this.createElement('div');
37480
+ importContainer.innerHTML = value;
37481
+ var tableElement = importContainer.querySelectorAll('table:not(.e-rte-table):not(.e-rte-paste-table)');
37482
+ for (var i = 0; i < tableElement.length; i++) {
37483
+ tableElement[i].classList.add('e-rte-paste-table');
37484
+ }
37485
+ value = importContainer.innerHTML;
37486
+ importContainer.remove();
37487
+ commandName = 'insertHTML';
37488
+ }
37346
37489
  value = this.htmlPurifier(commandName, value);
37347
37490
  var internalValue;
37348
37491
  if (this.editorMode === 'HTML') {
@@ -39414,7 +39557,6 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
39414
39557
  var iframeElement = this.element.querySelector('#' + this.getID() + '_rte-view');
39415
39558
  if (iframeElement) {
39416
39559
  this.setAutoHeight(iframeElement);
39417
- this.inputElement.style.overflow = 'hidden';
39418
39560
  }
39419
39561
  }
39420
39562
  }
@@ -39439,9 +39581,14 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
39439
39581
  };
39440
39582
  RichTextEditor.prototype.setAutoHeight = function (element) {
39441
39583
  if (!isNullOrUndefined(element)) {
39442
- element.style.height = 'auto';
39443
- element.style.height = (this.inputElement.scrollHeight + 16) + 'px';
39444
- element.style.overflow = 'hidden';
39584
+ if (element.nodeName === 'TEXTAREA') {
39585
+ element.style.height = 'auto';
39586
+ element.style.height = (this.inputElement.scrollHeight + 16) + 'px';
39587
+ element.style.overflow = 'hidden';
39588
+ }
39589
+ else if (element.nodeName === 'IFRAME') {
39590
+ element.style.height = this.inputElement.parentElement.offsetHeight + 'px';
39591
+ }
39445
39592
  }
39446
39593
  };
39447
39594
  RichTextEditor.prototype.wireEvents = function () {
@@ -39826,124 +39973,124 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
39826
39973
  Property(10000)
39827
39974
  ], RichTextEditor.prototype, "saveInterval", void 0);
39828
39975
  __decorate$5([
39829
- Event()
39976
+ Event$1()
39830
39977
  ], RichTextEditor.prototype, "actionBegin", void 0);
39831
39978
  __decorate$5([
39832
- Event()
39979
+ Event$1()
39833
39980
  ], RichTextEditor.prototype, "actionComplete", void 0);
39834
39981
  __decorate$5([
39835
- Event()
39982
+ Event$1()
39836
39983
  ], RichTextEditor.prototype, "beforeDialogOpen", void 0);
39837
39984
  __decorate$5([
39838
- Event()
39985
+ Event$1()
39839
39986
  ], RichTextEditor.prototype, "dialogOpen", void 0);
39840
39987
  __decorate$5([
39841
- Event()
39988
+ Event$1()
39842
39989
  ], RichTextEditor.prototype, "beforeDialogClose", void 0);
39843
39990
  __decorate$5([
39844
- Event()
39991
+ Event$1()
39845
39992
  ], RichTextEditor.prototype, "dialogClose", void 0);
39846
39993
  __decorate$5([
39847
- Event()
39994
+ Event$1()
39848
39995
  ], RichTextEditor.prototype, "beforeQuickToolbarOpen", void 0);
39849
39996
  __decorate$5([
39850
- Event()
39997
+ Event$1()
39851
39998
  ], RichTextEditor.prototype, "quickToolbarOpen", void 0);
39852
39999
  __decorate$5([
39853
- Event()
40000
+ Event$1()
39854
40001
  ], RichTextEditor.prototype, "quickToolbarClose", void 0);
39855
40002
  __decorate$5([
39856
- Event()
40003
+ Event$1()
39857
40004
  ], RichTextEditor.prototype, "toolbarStatusUpdate", void 0);
39858
40005
  __decorate$5([
39859
- Event()
40006
+ Event$1()
39860
40007
  ], RichTextEditor.prototype, "updatedToolbarStatus", void 0);
39861
40008
  __decorate$5([
39862
- Event()
40009
+ Event$1()
39863
40010
  ], RichTextEditor.prototype, "imageSelected", void 0);
39864
40011
  __decorate$5([
39865
- Event()
40012
+ Event$1()
39866
40013
  ], RichTextEditor.prototype, "beforeImageUpload", void 0);
39867
40014
  __decorate$5([
39868
- Event()
40015
+ Event$1()
39869
40016
  ], RichTextEditor.prototype, "imageUploading", void 0);
39870
40017
  __decorate$5([
39871
- Event()
40018
+ Event$1()
39872
40019
  ], RichTextEditor.prototype, "imageUploadSuccess", void 0);
39873
40020
  __decorate$5([
39874
- Event()
40021
+ Event$1()
39875
40022
  ], RichTextEditor.prototype, "imageUploadFailed", void 0);
39876
40023
  __decorate$5([
39877
- Event()
40024
+ Event$1()
39878
40025
  ], RichTextEditor.prototype, "imageRemoving", void 0);
39879
40026
  __decorate$5([
39880
- Event()
40027
+ Event$1()
39881
40028
  ], RichTextEditor.prototype, "afterImageDelete", void 0);
39882
40029
  __decorate$5([
39883
- Event()
40030
+ Event$1()
39884
40031
  ], RichTextEditor.prototype, "fileSelected", void 0);
39885
40032
  __decorate$5([
39886
- Event()
40033
+ Event$1()
39887
40034
  ], RichTextEditor.prototype, "beforeFileUpload", void 0);
39888
40035
  __decorate$5([
39889
- Event()
40036
+ Event$1()
39890
40037
  ], RichTextEditor.prototype, "fileUploading", void 0);
39891
40038
  __decorate$5([
39892
- Event()
40039
+ Event$1()
39893
40040
  ], RichTextEditor.prototype, "fileUploadSuccess", void 0);
39894
40041
  __decorate$5([
39895
- Event()
40042
+ Event$1()
39896
40043
  ], RichTextEditor.prototype, "fileUploadFailed", void 0);
39897
40044
  __decorate$5([
39898
- Event()
40045
+ Event$1()
39899
40046
  ], RichTextEditor.prototype, "fileRemoving", void 0);
39900
40047
  __decorate$5([
39901
- Event()
40048
+ Event$1()
39902
40049
  ], RichTextEditor.prototype, "afterMediaDelete", void 0);
39903
40050
  __decorate$5([
39904
- Event()
40051
+ Event$1()
39905
40052
  ], RichTextEditor.prototype, "created", void 0);
39906
40053
  __decorate$5([
39907
- Event()
40054
+ Event$1()
39908
40055
  ], RichTextEditor.prototype, "destroyed", void 0);
39909
40056
  __decorate$5([
39910
- Event()
40057
+ Event$1()
39911
40058
  ], RichTextEditor.prototype, "beforeSanitizeHtml", void 0);
39912
40059
  __decorate$5([
39913
- Event()
40060
+ Event$1()
39914
40061
  ], RichTextEditor.prototype, "blur", void 0);
39915
40062
  __decorate$5([
39916
- Event()
40063
+ Event$1()
39917
40064
  ], RichTextEditor.prototype, "toolbarClick", void 0);
39918
40065
  __decorate$5([
39919
- Event()
40066
+ Event$1()
39920
40067
  ], RichTextEditor.prototype, "focus", void 0);
39921
40068
  __decorate$5([
39922
- Event()
40069
+ Event$1()
39923
40070
  ], RichTextEditor.prototype, "change", void 0);
39924
40071
  __decorate$5([
39925
- Event()
40072
+ Event$1()
39926
40073
  ], RichTextEditor.prototype, "resizing", void 0);
39927
40074
  __decorate$5([
39928
- Event()
40075
+ Event$1()
39929
40076
  ], RichTextEditor.prototype, "resizeStart", void 0);
39930
40077
  __decorate$5([
39931
- Event()
40078
+ Event$1()
39932
40079
  ], RichTextEditor.prototype, "resizeStop", void 0);
39933
40080
  __decorate$5([
39934
- Event()
40081
+ Event$1()
39935
40082
  ], RichTextEditor.prototype, "beforePasteCleanup", void 0);
39936
40083
  __decorate$5([
39937
- Event()
40084
+ Event$1()
39938
40085
  ], RichTextEditor.prototype, "afterPasteCleanup", void 0);
39939
40086
  __decorate$5([
39940
- Event()
40087
+ Event$1()
39941
40088
  ], RichTextEditor.prototype, "beforeImageDrop", void 0);
39942
40089
  __decorate$5([
39943
40090
  Property(null)
39944
40091
  ], RichTextEditor.prototype, "formatter", void 0);
39945
40092
  __decorate$5([
39946
- Event()
40093
+ Event$1()
39947
40094
  ], RichTextEditor.prototype, "slashMenuItemSelect", void 0);
39948
40095
  RichTextEditor = __decorate$5([
39949
40096
  NotifyPropertyChanges