@syncfusion/ej2-richtexteditor 27.1.51 → 27.1.52

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 (28) hide show
  1. package/dist/ej2-richtexteditor.umd.min.js +2 -2
  2. package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
  3. package/dist/es6/ej2-richtexteditor.es2015.js +734 -202
  4. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  5. package/dist/es6/ej2-richtexteditor.es5.js +125 -84
  6. package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
  7. package/dist/global/ej2-richtexteditor.min.js +2 -2
  8. package/dist/global/ej2-richtexteditor.min.js.map +1 -1
  9. package/dist/global/index.d.ts +1 -1
  10. package/package.json +9 -9
  11. package/src/common/editor-styles.d.ts +1 -0
  12. package/src/common/editor-styles.js +1 -0
  13. package/src/common/interface.d.ts +10 -0
  14. package/src/editor-manager/plugin/alignments.js +1 -1
  15. package/src/editor-manager/plugin/indents.js +1 -1
  16. package/src/editor-manager/plugin/inserthtml.js +16 -9
  17. package/src/editor-manager/plugin/lists.js +4 -3
  18. package/src/editor-manager/plugin/ms-word-clean-up.js +5 -0
  19. package/src/rich-text-editor/actions/base-toolbar.js +1 -1
  20. package/src/rich-text-editor/actions/dropdown-buttons.js +0 -6
  21. package/src/rich-text-editor/actions/enter-key.js +1 -0
  22. package/src/rich-text-editor/base/rich-text-editor.js +8 -4
  23. package/src/rich-text-editor/renderer/content-renderer.d.ts +1 -1
  24. package/src/rich-text-editor/renderer/content-renderer.js +9 -2
  25. package/src/rich-text-editor/renderer/iframe-content-renderer.js +21 -8
  26. package/src/rich-text-editor/renderer/image-module.d.ts +2 -0
  27. package/src/rich-text-editor/renderer/image-module.js +20 -11
  28. package/src/rich-text-editor/renderer/link-module.js +1 -1
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 27.1.51
3
+ * version : 27.1.52
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-richtexteditor@*",
3
- "_id": "@syncfusion/ej2-richtexteditor@27.1.50",
3
+ "_id": "@syncfusion/ej2-richtexteditor@27.1.51",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-orGMpNrcyPfYUwByIaO2zdQ0eDKJ07gaPEx01fLUObZHWZgqiBM6EpG6FRyCw0eybBJrgbr9+d4tmadweUZn+A==",
5
+ "_integrity": "sha512-inlHC5480ej5x2prpYyHklgio/xK2ySwJ9fde81c7VZodSANYCWTzGEM4zpNXwqGq883rUcsceZWyx77wbfPJQ==",
6
6
  "_location": "/@syncfusion/ej2-richtexteditor",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -25,8 +25,8 @@
25
25
  "/@syncfusion/ej2-react-richtexteditor",
26
26
  "/@syncfusion/ej2-vue-richtexteditor"
27
27
  ],
28
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-27.1.50.tgz",
29
- "_shasum": "b41d99da06db0fe513c5e6427603da956a09107c",
28
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-27.1.51.tgz",
29
+ "_shasum": "485be34e965c6976c8a1d3509ea9c399b6ab3612",
30
30
  "_spec": "@syncfusion/ej2-richtexteditor@*",
31
31
  "_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included",
32
32
  "author": {
@@ -37,12 +37,12 @@
37
37
  },
38
38
  "bundleDependencies": false,
39
39
  "dependencies": {
40
- "@syncfusion/ej2-base": "~27.1.50",
40
+ "@syncfusion/ej2-base": "~27.1.52",
41
41
  "@syncfusion/ej2-buttons": "~27.1.51",
42
- "@syncfusion/ej2-dropdowns": "~27.1.51",
43
- "@syncfusion/ej2-filemanager": "~27.1.51",
42
+ "@syncfusion/ej2-dropdowns": "~27.1.52",
43
+ "@syncfusion/ej2-filemanager": "~27.1.52",
44
44
  "@syncfusion/ej2-inputs": "~27.1.50",
45
- "@syncfusion/ej2-navigations": "~27.1.51",
45
+ "@syncfusion/ej2-navigations": "~27.1.52",
46
46
  "@syncfusion/ej2-popups": "~27.1.50",
47
47
  "@syncfusion/ej2-splitbuttons": "~27.1.50"
48
48
  },
@@ -80,6 +80,6 @@
80
80
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
81
81
  },
82
82
  "typings": "index.d.ts",
83
- "version": "27.1.51",
83
+ "version": "27.1.52",
84
84
  "sideEffects": false
85
85
  }
@@ -0,0 +1 @@
1
+ export declare const IFRAME_EDITOR_STYLES: string;
@@ -0,0 +1 @@
1
+ export 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";
@@ -105,3 +105,13 @@ export interface ImageOrTableCursor {
105
105
  end: boolean;
106
106
  endName: string;
107
107
  }
108
+ /**
109
+ * The `ImageDimension` is used to specify the width and height of the editor image.
110
+ *
111
+ * @private
112
+ * @hidden
113
+ */
114
+ export interface ImageDimension {
115
+ width: number;
116
+ height: number;
117
+ }
@@ -91,7 +91,7 @@ var Alignments = /** @class */ (function () {
91
91
  selector: e.selector
92
92
  });
93
93
  }
94
- this.parent.editableElement.focus();
94
+ this.parent.editableElement.focus({ preventScroll: true });
95
95
  save = this.parent.domNode.saveMarker(save);
96
96
  if (isIDevice()) {
97
97
  setEditFrameFocus(this.parent.editableElement, e.selector);
@@ -94,7 +94,7 @@ var Indents = /** @class */ (function () {
94
94
  /* eslint-enable */
95
95
  }
96
96
  }
97
- editEle.focus();
97
+ editEle.focus({ preventScroll: true });
98
98
  if (isIDevice()) {
99
99
  setEditFrameFocus(editEle, e.selector);
100
100
  }
@@ -254,7 +254,9 @@ var InsertHtml = /** @class */ (function () {
254
254
  fragment.appendChild(node.firstChild);
255
255
  }
256
256
  if (isSingleNode) {
257
- preNode.parentNode.replaceChild(fragment, preNode);
257
+ range.deleteContents();
258
+ this.removeEmptyElements(editNode, true);
259
+ range.insertNode(fragment);
258
260
  }
259
261
  else {
260
262
  var startContainerParent = editNode === range.startContainer ?
@@ -266,6 +268,7 @@ var InsertHtml = /** @class */ (function () {
266
268
  range.setEnd(startContainerParent, startIndex);
267
269
  if (!isNOU(lasNode) && lasNode !== editNode) {
268
270
  detach(lasNode);
271
+ this.removeEmptyElements(editNode, true);
269
272
  }
270
273
  // eslint-disable-next-line
271
274
  !isNOU(sibNode) ? (sibNode.parentNode === editNode ? sibNode.appendChild(fragment) : sibNode.parentNode.appendChild(fragment)) : range.insertNode(fragment);
@@ -456,10 +459,10 @@ var InsertHtml = /** @class */ (function () {
456
459
  blockNode = range.endContainer;
457
460
  range.setEnd(blockNode, range.endContainer.textContent.length);
458
461
  }
459
- if (blockNode.nodeName === 'BODY' && range.startContainer === range.endContainer && range.startContainer.nodeType === 1) {
462
+ if (blockNode && blockNode.nodeName === 'BODY' && range.startContainer === range.endContainer && range.startContainer.nodeType === 1) {
460
463
  blockNode = range.startContainer;
461
464
  }
462
- if (blockNode.closest('LI') && editNode.contains(blockNode.closest('LI')) && blockNode.nodeName !== 'TD' && blockNode.nodeName !== 'TH' && blockNode.nodeName !== 'TR' && node && node.firstElementChild &&
465
+ if (blockNode && blockNode.closest('LI') && editNode.contains(blockNode.closest('LI')) && blockNode.nodeName !== 'TD' && blockNode.nodeName !== 'TH' && blockNode.nodeName !== 'TR' && node && node.firstElementChild &&
463
466
  ((node).firstElementChild.tagName === 'OL' || node.firstElementChild.tagName === 'UL')) {
464
467
  var liNode = void 0;
465
468
  while (node.firstElementChild.lastElementChild && node.firstElementChild.lastElementChild.tagName === 'LI') {
@@ -470,7 +473,7 @@ var InsertHtml = /** @class */ (function () {
470
473
  node.firstElementChild.insertAdjacentElement('afterend', liNode);
471
474
  }
472
475
  }
473
- if (blockNode.nodeName === 'TD' || blockNode.nodeName === 'TH' || blockNode.nodeName === 'TR') {
476
+ if (blockNode && blockNode.nodeName === 'TD' || blockNode.nodeName === 'TH' || blockNode.nodeName === 'TR') {
474
477
  var tempSpan = createElement('span', { className: 'tempSpan' });
475
478
  range.insertNode(tempSpan);
476
479
  tempSpan.parentNode.replaceChild(node, tempSpan);
@@ -553,17 +556,20 @@ var InsertHtml = /** @class */ (function () {
553
556
  innerElement = innerElement.replace(/<!--[\s\S]*?-->/g, '');
554
557
  elm.innerHTML = innerElement;
555
558
  };
556
- InsertHtml.findDetachEmptyElem = function (element) {
559
+ InsertHtml.findDetachEmptyElem = function (element, ignoreBlockNodes) {
560
+ if (ignoreBlockNodes === void 0) { ignoreBlockNodes = false; }
557
561
  var removableElement;
558
562
  if (!isNOU(element.parentElement)) {
559
563
  var hasNbsp = element.parentElement.textContent.length > 0 && element.parentElement.textContent.match(/\u00a0/g)
560
564
  && element.parentElement.textContent.match(/\u00a0/g).length > 0;
561
565
  if (!hasNbsp && element.parentElement.textContent.trim() === '' && element.parentElement.contentEditable !== 'true' &&
562
566
  isNOU(element.parentElement.querySelector('img')) && element.parentElement.nodeName !== 'TD' && element.parentElement.nodeName !== 'TH') {
563
- removableElement = this.findDetachEmptyElem(element.parentElement);
567
+ removableElement = ignoreBlockNodes && CONSTANT.BLOCK_TAGS.indexOf(element.parentElement.tagName.toLowerCase()) !== -1 ?
568
+ element : this.findDetachEmptyElem(element.parentElement, ignoreBlockNodes);
564
569
  }
565
570
  else {
566
- removableElement = element;
571
+ removableElement = ignoreBlockNodes && CONSTANT.BLOCK_TAGS.indexOf(element.tagName.toLowerCase()) !== -1 ? null :
572
+ element;
567
573
  }
568
574
  }
569
575
  else {
@@ -571,7 +577,8 @@ var InsertHtml = /** @class */ (function () {
571
577
  }
572
578
  return removableElement;
573
579
  };
574
- InsertHtml.removeEmptyElements = function (element) {
580
+ InsertHtml.removeEmptyElements = function (element, ignoreBlockNodes) {
581
+ if (ignoreBlockNodes === void 0) { ignoreBlockNodes = false; }
575
582
  var emptyElements = element.querySelectorAll(':empty');
576
583
  var nonSvgEmptyElements = Array.from(emptyElements).filter(function (element) {
577
584
  // Check if the element is an SVG element or an ancestor of an SVG element
@@ -584,7 +591,7 @@ var InsertHtml = /** @class */ (function () {
584
591
  nonSvgEmptyElements[i].style.borderBottom === '' ? true : false;
585
592
  }
586
593
  if (CONSTANT.SELF_CLOSING_TAGS.indexOf(nonSvgEmptyElements[i].tagName.toLowerCase()) < 0 && lineWithDiv) {
587
- var detachableElement = this.findDetachEmptyElem(nonSvgEmptyElements[i]);
594
+ var detachableElement = this.findDetachEmptyElem(nonSvgEmptyElements[i], ignoreBlockNodes);
588
595
  if (!isNOU(detachableElement)) {
589
596
  detach(detachableElement);
590
597
  }
@@ -374,7 +374,7 @@ var Lists = /** @class */ (function () {
374
374
  }
375
375
  if (isNested) {
376
376
  this.cleanNode();
377
- this.parent.editableElement.focus();
377
+ this.parent.editableElement.focus({ preventScroll: true });
378
378
  }
379
379
  if (!(e.event.action && e.event.action === 'indent')) {
380
380
  this.saveSelection = this.domNode.saveMarker(this.saveSelection);
@@ -688,7 +688,7 @@ var Lists = /** @class */ (function () {
688
688
  span.parentNode.replaceChild(fragment, span);
689
689
  });
690
690
  }
691
- this.parent.editableElement.focus();
691
+ this.parent.editableElement.focus({ preventScroll: true });
692
692
  if (isIDevice()) {
693
693
  setEditFrameFocus(this.parent.editableElement, selector);
694
694
  }
@@ -927,7 +927,8 @@ var Lists = /** @class */ (function () {
927
927
  parentNode.removeAttribute('style');
928
928
  }
929
929
  }
930
- var wrapper = '<' + e.enterAction + wrapperclass + this.domNode.attributes(element) + '></' + e.enterAction + '>';
930
+ var wrapperTag = isNullOrUndefined(e.enterAction) ? CONSTANT.DEFAULT_TAG : e.enterAction;
931
+ var wrapper = '<' + wrapperTag + wrapperclass + this.domNode.attributes(element) + '></' + wrapperTag + '>';
931
932
  if (e.enterAction !== 'BR') {
932
933
  this.domNode.wrapInner(element, this.domNode.parseHTMLFragment(wrapper));
933
934
  }
@@ -710,6 +710,11 @@ var MsWordPaste = /** @class */ (function () {
710
710
  startAttr = parseInt(startString, 10);
711
711
  }
712
712
  }
713
+ else if (listStyleType === 'decimal-leading-zero') {
714
+ if (!isNaN(parseInt(startString, 10))) {
715
+ startAttr = parseInt(startString, 10);
716
+ }
717
+ }
713
718
  else if (listStyleType === 'upper-alpha') {
714
719
  startAttr = (startString.split('.')[0].charCodeAt(0) - 64);
715
720
  }
@@ -176,7 +176,7 @@ var BaseToolbar = /** @class */ (function () {
176
176
  var tooltipText = items[num].tooltipText;
177
177
  var shortCutKey = void 0;
178
178
  var isMacDev = window.navigator.platform.toLocaleLowerCase().includes('mac');
179
- if (windowKeys["" + tooltipText]) {
179
+ if (windowKeys["" + tooltipText] && (!isNullOrUndefined(items[num].id) || !isNullOrUndefined(items[num].cssClass))) {
180
180
  shortCutKey = isMacDev ? windowKeys["" + tooltipText].replace('Ctrl+', '⌘').replace('Shift+', '⇧').replace('Alt+', '⌥') : windowKeys["" + tooltipText];
181
181
  }
182
182
  else {
@@ -121,9 +121,6 @@ var DropDownButtons = /** @class */ (function () {
121
121
  cssClass: classes.CLS_DROPDOWN_POPUP + ' ' + classes.CLS_DROPDOWN_ITEMS + ' ' + classes.CLS_FONT_NAME_TB_BTN,
122
122
  itemName: 'FontName', items: fontItem, element: targetElement
123
123
  });
124
- if (!isNullOrUndefined(_this.parent.fontFamily.default)) {
125
- _this.getEditNode().style.fontFamily = _this.parent.fontFamily.default;
126
- }
127
124
  break;
128
125
  }
129
126
  case 'fontsize': {
@@ -147,9 +144,6 @@ var DropDownButtons = /** @class */ (function () {
147
144
  cssClass: classes.CLS_DROPDOWN_POPUP + ' ' + classes.CLS_DROPDOWN_ITEMS + ' ' + classes.CLS_FONT_SIZE_TB_BTN,
148
145
  itemName: 'FontSize', items: fontsize, element: targetElement
149
146
  });
150
- if (!isNullOrUndefined(_this.parent.fontSize.default)) {
151
- _this.getEditNode().style.fontSize = _this.parent.fontSize.default;
152
- }
153
147
  break;
154
148
  }
155
149
  case 'alignments':
@@ -468,6 +468,7 @@ var EnterKeyAction = /** @class */ (function () {
468
468
  e.args.preventDefault();
469
469
  }
470
470
  _this.triggerActionComplete(e, shiftKey_1);
471
+ _this.parent.inputElement.dispatchEvent(new Event('input'));
471
472
  }
472
473
  });
473
474
  }
@@ -2428,7 +2428,6 @@ var RichTextEditor = /** @class */ (function (_super) {
2428
2428
  var iframeElement = this.element.querySelector('#' + this.getID() + '_rte-view');
2429
2429
  if (iframeElement) {
2430
2430
  this.setAutoHeight(iframeElement);
2431
- this.inputElement.style.overflow = 'hidden';
2432
2431
  }
2433
2432
  }
2434
2433
  }
@@ -2453,9 +2452,14 @@ var RichTextEditor = /** @class */ (function (_super) {
2453
2452
  };
2454
2453
  RichTextEditor.prototype.setAutoHeight = function (element) {
2455
2454
  if (!isNOU(element)) {
2456
- element.style.height = 'auto';
2457
- element.style.height = (this.inputElement.scrollHeight + 16) + 'px';
2458
- element.style.overflow = 'hidden';
2455
+ if (element.nodeName === 'TEXTAREA') {
2456
+ element.style.height = 'auto';
2457
+ element.style.height = (this.inputElement.scrollHeight + 16) + 'px';
2458
+ element.style.overflow = 'hidden';
2459
+ }
2460
+ else if (element.nodeName === 'IFRAME') {
2461
+ element.style.height = this.inputElement.parentElement.offsetHeight + 'px';
2462
+ }
2459
2463
  }
2460
2464
  };
2461
2465
  RichTextEditor.prototype.wireEvents = function () {
@@ -8,7 +8,7 @@ import { IRenderer, IRichTextEditor } from '../base/interface';
8
8
  export declare class ContentRender implements IRenderer {
9
9
  protected contentPanel: Element;
10
10
  protected parent: IRichTextEditor;
11
- protected editableElement: Element;
11
+ protected editableElement: HTMLElement;
12
12
  /**
13
13
  * Constructor for content renderer module
14
14
  *
@@ -1,4 +1,5 @@
1
1
  import { getEditValue } from '../base/util';
2
+ import { isNullOrUndefined as isNOU } from '@syncfusion/ej2-base';
2
3
  /**
3
4
  * Content module is used to render Rich Text Editor content
4
5
  *
@@ -30,9 +31,15 @@ var ContentRender = /** @class */ (function () {
30
31
  id: this.parent.getID() + '_rte-edit-view',
31
32
  attrs: {
32
33
  'contenteditable': 'true'
33
- },
34
- innerHTML: rteContent
34
+ }
35
35
  });
36
+ if (!isNOU(this.parent.fontFamily.default)) {
37
+ this.editableElement.style.fontFamily = this.parent.fontFamily.default;
38
+ }
39
+ if (!isNOU(this.parent.fontSize.default)) {
40
+ this.editableElement.style.fontSize = this.parent.fontSize.default;
41
+ }
42
+ this.editableElement.innerHTML = rteContent;
36
43
  div.appendChild(this.editableElement);
37
44
  this.setPanel(div);
38
45
  rteObj.rootContainer.appendChild(div);
@@ -12,9 +12,11 @@ var __extends = (this && this.__extends) || (function () {
12
12
  };
13
13
  })();
14
14
  import { ContentRender } from '../renderer/content-renderer';
15
- import { isNullOrUndefined } from '@syncfusion/ej2-base';
15
+ import { isNullOrUndefined as isNOU } from '@syncfusion/ej2-base';
16
16
  import { getEditValue } from '../base/util';
17
- 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>";
17
+ import { IFRAME_EDITOR_STYLES } from '../../common/editor-styles';
18
+ var IFRAMEHEADER = "\n <!DOCTYPE html> \n <html>\n <head>\n <meta charset='utf-8' /> \n <style>" +
19
+ IFRAME_EDITOR_STYLES.replace(/[\n\t]/g, '') + "\n </style>\n </head>\n";
18
20
  /**
19
21
  * Content module is used to render Rich Text Editor content
20
22
  *
@@ -35,7 +37,7 @@ var IframeContentRender = /** @class */ (function (_super) {
35
37
  IframeContentRender.prototype.renderPanel = function () {
36
38
  var rteObj = this.parent;
37
39
  var rteContent = getEditValue(rteObj.value, rteObj);
38
- var iFrameBodyContent = '<body spellcheck="false" autocorrect="off" contenteditable="true">' +
40
+ var iFrameBodyContent = '<body contenteditable="true">' +
39
41
  rteContent + '</body></html>';
40
42
  var iFrameContent = IFRAMEHEADER + iFrameBodyContent;
41
43
  var iframe = this.parent.createElement('iframe', {
@@ -45,7 +47,7 @@ var IframeContentRender = /** @class */ (function (_super) {
45
47
  });
46
48
  iframe.setAttribute('role', 'none');
47
49
  this.setPanel(iframe);
48
- if (!isNullOrUndefined(this.parent.iframeSettings.sandbox)) {
50
+ if (!isNOU(this.parent.iframeSettings.sandbox)) {
49
51
  var sandboxValues = this.parent.iframeSettings.sandbox
50
52
  .map(function (element) { return element.toLocaleLowerCase().trim(); })
51
53
  .join(' ');
@@ -55,22 +57,33 @@ var IframeContentRender = /** @class */ (function (_super) {
55
57
  iframe.setAttribute('sandbox', sandboxValues.trim());
56
58
  }
57
59
  rteObj.rootContainer.appendChild(iframe);
58
- iframe.contentDocument.body.id = this.parent.getID() + '_rte-edit-view';
59
60
  iframe.contentDocument.body.setAttribute('aria-owns', this.parent.getID());
60
61
  iframe.contentDocument.open();
61
62
  iFrameContent = this.setThemeColor(iFrameContent, { color: '#333' });
62
63
  iframe.contentDocument.write(iFrameContent);
63
64
  iframe.contentDocument.close();
65
+ var body = iframe.contentDocument.body;
66
+ body.className = 'e-content';
67
+ if (this.parent.height === 'auto') {
68
+ body.style.overflowY = 'hidden';
69
+ }
70
+ if (!isNOU(this.parent.fontFamily.default)) {
71
+ body.style.fontFamily = this.parent.fontFamily.default;
72
+ }
73
+ if (!isNOU(this.parent.fontSize.default)) {
74
+ body.style.fontSize = this.parent.fontSize.default;
75
+ }
76
+ body.id = this.parent.getID() + '_rte-edit-view';
64
77
  if (rteObj.enableRtl) {
65
78
  this.contentPanel.contentDocument.body.setAttribute('class', 'e-rtl');
66
79
  }
67
- if (!isNullOrUndefined(iframe.contentDocument.head) && this.parent.iframeSettings.metaTags.length > 0) {
80
+ if (!isNOU(iframe.contentDocument.head) && this.parent.iframeSettings.metaTags.length > 0) {
68
81
  var head_1 = iframe.contentDocument.head;
69
82
  var metaData = this.parent.iframeSettings.metaTags;
70
83
  metaData.forEach(function (tag) {
71
84
  var meta = document.createElement('meta');
72
85
  for (var key in tag) {
73
- if (!isNullOrUndefined(tag[key])) {
86
+ if (!isNOU(tag[key])) {
74
87
  meta.setAttribute((key === 'httpEquiv') ? 'http-equiv' : key, tag[key]);
75
88
  }
76
89
  }
@@ -91,7 +104,7 @@ var IframeContentRender = /** @class */ (function (_super) {
91
104
  */
92
105
  IframeContentRender.prototype.getEditPanel = function () {
93
106
  var editNode;
94
- if (!isNullOrUndefined(this.contentPanel.contentDocument)) {
107
+ if (!isNOU(this.contentPanel.contentDocument)) {
95
108
  editNode = this.contentPanel.contentDocument.body;
96
109
  }
97
110
  else {
@@ -73,9 +73,11 @@ export declare class Image {
73
73
  private setImageHeight;
74
74
  private removeImageHeight;
75
75
  private getImageDimension;
76
+ private adjustDimensionsByAspectRatio;
76
77
  private pixToPerc;
77
78
  private imgDupMouseMove;
78
79
  private resizing;
80
+ private adjustDimensions;
79
81
  private getResizeFactor;
80
82
  private findAspectRatio;
81
83
  private cancelResizeAction;
@@ -429,6 +429,17 @@ var Image = /** @class */ (function () {
429
429
  return value;
430
430
  }
431
431
  };
432
+ Image.prototype.adjustDimensionsByAspectRatio = function (width, height, aspectRatio, isWidthPrimary) {
433
+ if (isWidthPrimary) {
434
+ height = Math.round(width / aspectRatio);
435
+ width = Math.round(height * aspectRatio);
436
+ }
437
+ else {
438
+ width = Math.round(height * aspectRatio);
439
+ height = Math.round(width / aspectRatio);
440
+ }
441
+ return { width: width, height: height };
442
+ };
432
443
  Image.prototype.pixToPerc = function (expected, parentEle) {
433
444
  return expected / parseFloat(getComputedStyle(parentEle).width) * 100;
434
445
  };
@@ -472,21 +483,19 @@ var Image = /** @class */ (function () {
472
483
  var currentHeight = this.imgEle.clientHeight;
473
484
  var width = diffX * resizeFactor[0] + currentWidth;
474
485
  var height = diffY * resizeFactor[1] + currentHeight;
475
- width = (width < 16) ? 16 : width;
476
- height = (height < 16) ? 16 : height;
477
- if (Math.abs(diffX) > Math.abs(diffY)) {
478
- height = Math.round(width / this.aspectRatio);
479
- width = Math.round(height * this.aspectRatio);
480
- }
481
- else {
482
- width = Math.round(height * this.aspectRatio);
483
- height = Math.round(width / this.aspectRatio);
484
- }
486
+ var dimensions = this.adjustDimensions(width, height, diffX, diffY, this.aspectRatio);
485
487
  this.pageX = pageX;
486
488
  this.pageY = pageY;
487
- this.imgDupMouseMove(width + 'px', height + 'px', e);
489
+ this.imgDupMouseMove(dimensions.width + 'px', dimensions.height + 'px', e);
488
490
  }
489
491
  };
492
+ Image.prototype.adjustDimensions = function (width, height, diffX, diffY, aspectRatio) {
493
+ width = (width < 16) ? 16 : width;
494
+ height = (height < 16) ? 16 : height;
495
+ var isWidthPrimary = Math.abs(diffX) > Math.abs(diffY);
496
+ var dimensions = this.adjustDimensionsByAspectRatio(width, height, aspectRatio, isWidthPrimary);
497
+ return dimensions;
498
+ };
490
499
  Image.prototype.getResizeFactor = function (value) {
491
500
  return imageResizeFactor[value];
492
501
  };
@@ -375,7 +375,7 @@ var Link = /** @class */ (function () {
375
375
  // eslint-disable-next-line
376
376
  Link.prototype.insertlink = function (e) {
377
377
  var linkEle = this.selfLink.dialogObj.element;
378
- var linkUrl = linkEle.querySelector('.e-rte-linkurl').value;
378
+ var linkUrl = linkEle.querySelector('.e-rte-linkurl').value.trim();
379
379
  var linkText = linkEle.querySelector('.e-rte-linkText').value;
380
380
  var linkTitle;
381
381
  if (this.selfLink.parent.editorMode === 'HTML') {