@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.
- package/dist/ej2-richtexteditor.min.js +10 -0
- package/dist/ej2-richtexteditor.umd.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +874 -238
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +267 -120
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/dist/global/ej2-richtexteditor.min.js +2 -2
- package/dist/global/ej2-richtexteditor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +12 -12
- package/src/common/editor-styles.d.ts +1 -0
- package/src/common/editor-styles.js +1 -0
- package/src/common/interface.d.ts +10 -0
- package/src/editor-manager/base/editor-manager.js +1 -1
- package/src/editor-manager/base/interface.d.ts +2 -2
- package/src/editor-manager/plugin/alignments.js +1 -1
- package/src/editor-manager/plugin/clearformat.js +1 -1
- package/src/editor-manager/plugin/dom-node.js +1 -1
- package/src/editor-manager/plugin/image.js +2 -0
- package/src/editor-manager/plugin/indents.js +1 -1
- package/src/editor-manager/plugin/inserthtml.d.ts +1 -0
- package/src/editor-manager/plugin/inserthtml.js +49 -18
- package/src/editor-manager/plugin/link.js +2 -2
- package/src/editor-manager/plugin/lists.js +5 -4
- package/src/editor-manager/plugin/ms-word-clean-up.js +5 -0
- package/src/editor-manager/plugin/selection-commands.js +2 -2
- package/src/editor-manager/plugin/toolbar-status.js +1 -1
- package/src/editor-manager/plugin/undo.js +3 -3
- package/src/rich-text-editor/actions/base-toolbar.js +1 -1
- package/src/rich-text-editor/actions/dropdown-buttons.js +0 -6
- package/src/rich-text-editor/actions/enter-key.js +11 -5
- package/src/rich-text-editor/actions/html-editor.js +2 -2
- package/src/rich-text-editor/actions/import-export.js +1 -1
- package/src/rich-text-editor/actions/paste-clean-up.js +1 -1
- package/src/rich-text-editor/actions/resize.d.ts +3 -0
- package/src/rich-text-editor/actions/resize.js +13 -0
- package/src/rich-text-editor/base/interface.d.ts +13 -1
- package/src/rich-text-editor/base/rich-text-editor.js +19 -4
- package/src/rich-text-editor/renderer/content-renderer.d.ts +1 -1
- package/src/rich-text-editor/renderer/content-renderer.js +9 -2
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +21 -8
- package/src/rich-text-editor/renderer/image-module.d.ts +2 -0
- package/src/rich-text-editor/renderer/image-module.js +26 -13
- package/src/rich-text-editor/renderer/link-module.js +6 -2
- package/src/rich-text-editor/renderer/slash-menu.js +1 -1
- package/src/rich-text-editor/renderer/video-module.js +1 -1
- package/src/selection/selection.d.ts +5 -0
- package/src/selection/selection.js +44 -1
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 27.1.
|
|
3
|
+
* version : 27.1.55
|
|
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.
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@27.1.52",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-XR/x+b75MIK0pvux0i7pKXCiE3wHiKBruu+8envZ4mRykDST1Gga87CiBMHuz9R1cuFm6lAmulHlCXqv+xjabw==",
|
|
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.
|
|
29
|
-
"_shasum": "
|
|
28
|
+
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-27.1.52.tgz",
|
|
29
|
+
"_shasum": "990c5dad0331d0dc7e2947c6fc5577bbe886f01b",
|
|
30
30
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
31
31
|
"_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included",
|
|
32
32
|
"author": {
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
},
|
|
38
38
|
"bundleDependencies": false,
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@syncfusion/ej2-base": "~27.1.
|
|
41
|
-
"@syncfusion/ej2-buttons": "~27.1.
|
|
42
|
-
"@syncfusion/ej2-dropdowns": "~27.1.
|
|
43
|
-
"@syncfusion/ej2-filemanager": "~27.1.
|
|
44
|
-
"@syncfusion/ej2-inputs": "~27.1.
|
|
45
|
-
"@syncfusion/ej2-navigations": "~27.1.
|
|
46
|
-
"@syncfusion/ej2-popups": "~27.1.
|
|
40
|
+
"@syncfusion/ej2-base": "~27.1.55",
|
|
41
|
+
"@syncfusion/ej2-buttons": "~27.1.53",
|
|
42
|
+
"@syncfusion/ej2-dropdowns": "~27.1.55",
|
|
43
|
+
"@syncfusion/ej2-filemanager": "~27.1.55",
|
|
44
|
+
"@syncfusion/ej2-inputs": "~27.1.55",
|
|
45
|
+
"@syncfusion/ej2-navigations": "~27.1.55",
|
|
46
|
+
"@syncfusion/ej2-popups": "~27.1.55",
|
|
47
47
|
"@syncfusion/ej2-splitbuttons": "~27.1.50"
|
|
48
48
|
},
|
|
49
49
|
"deprecated": false,
|
|
@@ -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.
|
|
83
|
+
"version": "27.1.55",
|
|
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
|
+
}
|
|
@@ -39,7 +39,7 @@ var EditorManager = /** @class */ (function () {
|
|
|
39
39
|
function EditorManager(options) {
|
|
40
40
|
this.currentDocument = options.document;
|
|
41
41
|
this.editableElement = options.editableElement;
|
|
42
|
-
this.nodeSelection = new NodeSelection();
|
|
42
|
+
this.nodeSelection = new NodeSelection(this.editableElement);
|
|
43
43
|
this.nodeCutter = new NodeCutter();
|
|
44
44
|
this.domNode = new DOMNode(this.editableElement, this.currentDocument);
|
|
45
45
|
this.observer = new Observer(this);
|
|
@@ -10,11 +10,11 @@ import { IFormatPainterActionValue, IFormatPainterContext } from './enum';
|
|
|
10
10
|
*/
|
|
11
11
|
export interface ICommandModel {
|
|
12
12
|
/**
|
|
13
|
-
* Specifies the current document.
|
|
13
|
+
* Specifies the editor element's current document.
|
|
14
14
|
*/
|
|
15
15
|
document: HTMLDocument;
|
|
16
16
|
/**
|
|
17
|
-
* Specifies the
|
|
17
|
+
* Specifies the editable element.
|
|
18
18
|
*/
|
|
19
19
|
editableElement: Element;
|
|
20
20
|
options?: {
|
|
@@ -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);
|
|
@@ -26,7 +26,7 @@ var ClearFormat = /** @class */ (function () {
|
|
|
26
26
|
ClearFormat.clear = function (docElement, endNode, enterAction, selector, command) {
|
|
27
27
|
this.domNode = new DOMNode(endNode, docElement);
|
|
28
28
|
this.defaultTag = enterAction === 'P' ? this.defaultTag : 'div';
|
|
29
|
-
var nodeSelection = new NodeSelection();
|
|
29
|
+
var nodeSelection = new NodeSelection(endNode);
|
|
30
30
|
var nodeCutter = new NodeCutter();
|
|
31
31
|
var range = nodeSelection.getRange(docElement);
|
|
32
32
|
var nodes = range.collapsed ? nodeSelection.getSelectionNodeCollection(range) :
|
|
@@ -25,7 +25,7 @@ var DOMNode = /** @class */ (function () {
|
|
|
25
25
|
*/
|
|
26
26
|
function DOMNode(parent, currentDocument) {
|
|
27
27
|
this.parent = parent;
|
|
28
|
-
this.nodeSelection = new NodeSelection();
|
|
28
|
+
this.nodeSelection = new NodeSelection(parent);
|
|
29
29
|
this.currentDocument = currentDocument;
|
|
30
30
|
this.tableSelection = new TableSelection(parent, currentDocument);
|
|
31
31
|
}
|
|
@@ -119,6 +119,8 @@ var ImageCommand = /** @class */ (function () {
|
|
|
119
119
|
(Browser.isIE ? selectedNode.previousSibling : selectedNode.previousElementSibling);
|
|
120
120
|
var onImageLoadEvent_1 = function () {
|
|
121
121
|
if (!isNOU(_this.parent.currentDocument)) {
|
|
122
|
+
imgElm_1.setAttribute('width', _this.calculateStyleValue(imgElm_1.offsetWidth));
|
|
123
|
+
imgElm_1.setAttribute('height', _this.calculateStyleValue(imgElm_1.offsetHeight));
|
|
122
124
|
e.callBack({
|
|
123
125
|
requestType: (e.value === 'Replace') ? (e.item.subCommand = 'Replace', 'Replace') : 'Images',
|
|
124
126
|
editorMode: 'HTML',
|
|
@@ -16,6 +16,7 @@ export declare class InsertHtml {
|
|
|
16
16
|
static Insert(docElement: Document, insertNode: Node | string, editNode?: Element, isExternal?: boolean, enterAction?: string): void;
|
|
17
17
|
private static findFirstTextNode;
|
|
18
18
|
private static pasteInsertHTML;
|
|
19
|
+
private static listCleanUp;
|
|
19
20
|
private static placeCursorEnd;
|
|
20
21
|
private static getNodeCollection;
|
|
21
22
|
private static insertTempNode;
|
|
@@ -31,7 +31,7 @@ var InsertHtml = /** @class */ (function () {
|
|
|
31
31
|
node = insertNode;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
var nodeSelection = new NodeSelection();
|
|
34
|
+
var nodeSelection = new NodeSelection(editNode);
|
|
35
35
|
var nodeCutter = new NodeCutter();
|
|
36
36
|
var range = nodeSelection.getRange(docElement);
|
|
37
37
|
if (range.startContainer === editNode && range.startContainer === range.endContainer && range.startOffset === 0 &&
|
|
@@ -254,7 +254,9 @@ var InsertHtml = /** @class */ (function () {
|
|
|
254
254
|
fragment.appendChild(node.firstChild);
|
|
255
255
|
}
|
|
256
256
|
if (isSingleNode) {
|
|
257
|
-
|
|
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);
|
|
@@ -392,6 +395,26 @@ var InsertHtml = /** @class */ (function () {
|
|
|
392
395
|
this.cursorPos(lastSelectionNode, node, nodeSelection, docElement, editNode, enterAction);
|
|
393
396
|
}
|
|
394
397
|
this.alignCheck(editNode);
|
|
398
|
+
var currentRange = nodeSelection.getRange(docElement);
|
|
399
|
+
this.listCleanUp(currentRange);
|
|
400
|
+
};
|
|
401
|
+
InsertHtml.listCleanUp = function (range) {
|
|
402
|
+
if (range.startContainer.parentElement.closest('ol,ul') !== null && range.endContainer.parentElement.closest('ol,ul') !== null) {
|
|
403
|
+
var liElems = range.startContainer.parentElement.closest('ol,ul').querySelectorAll('li');
|
|
404
|
+
if (liElems.length > 0) {
|
|
405
|
+
liElems.forEach(function (item) {
|
|
406
|
+
if (!isNOU(item.firstChild) && (item.firstChild.nodeName === 'OL' || item.firstChild.nodeName === 'UL')) {
|
|
407
|
+
item.style.listStyleType = 'none';
|
|
408
|
+
}
|
|
409
|
+
var nestedLi = Array.from(item.children).find(function (child) {
|
|
410
|
+
return child.tagName === 'LI' && (child.parentElement && child.parentElement.tagName !== 'OL' && child.parentElement.tagName !== 'UL');
|
|
411
|
+
});
|
|
412
|
+
if (nestedLi) {
|
|
413
|
+
item.parentNode.replaceChild(nestedLi, item);
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
}
|
|
395
418
|
};
|
|
396
419
|
InsertHtml.placeCursorEnd = function (lastSelectionNode, node, nodeSelection, docElement, editNode) {
|
|
397
420
|
lastSelectionNode = lastSelectionNode.nodeName === 'BR' ? (isNOU(lastSelectionNode.previousSibling) ? lastSelectionNode.parentNode
|
|
@@ -456,10 +479,10 @@ var InsertHtml = /** @class */ (function () {
|
|
|
456
479
|
blockNode = range.endContainer;
|
|
457
480
|
range.setEnd(blockNode, range.endContainer.textContent.length);
|
|
458
481
|
}
|
|
459
|
-
if (blockNode.nodeName === 'BODY' && range.startContainer === range.endContainer && range.startContainer.nodeType === 1) {
|
|
482
|
+
if (blockNode && blockNode.nodeName === 'BODY' || blockNode.nodeName === 'DIV' && range.startContainer === range.endContainer && range.startContainer.nodeType === 1) {
|
|
460
483
|
blockNode = range.startContainer;
|
|
461
484
|
}
|
|
462
|
-
if (blockNode.closest('LI') && editNode.contains(blockNode.closest('LI')) && blockNode.nodeName !== 'TD' && blockNode.nodeName !== 'TH' && blockNode.nodeName !== 'TR' && node && node.firstElementChild &&
|
|
485
|
+
if (blockNode && blockNode.closest('LI') && editNode.contains(blockNode.closest('LI')) && blockNode.nodeName !== 'TD' && blockNode.nodeName !== 'TH' && blockNode.nodeName !== 'TR' && node && node.firstElementChild &&
|
|
463
486
|
((node).firstElementChild.tagName === 'OL' || node.firstElementChild.tagName === 'UL')) {
|
|
464
487
|
var liNode = void 0;
|
|
465
488
|
while (node.firstElementChild.lastElementChild && node.firstElementChild.lastElementChild.tagName === 'LI') {
|
|
@@ -470,18 +493,18 @@ var InsertHtml = /** @class */ (function () {
|
|
|
470
493
|
node.firstElementChild.insertAdjacentElement('afterend', liNode);
|
|
471
494
|
}
|
|
472
495
|
}
|
|
473
|
-
if (blockNode.nodeName === 'TD' || blockNode.nodeName === 'TH' || blockNode.nodeName === 'TR') {
|
|
496
|
+
if (blockNode && blockNode.nodeName === 'TD' || blockNode.nodeName === 'TH' || blockNode.nodeName === 'TR') {
|
|
474
497
|
var tempSpan = createElement('span', { className: 'tempSpan' });
|
|
475
498
|
range.insertNode(tempSpan);
|
|
476
499
|
tempSpan.parentNode.replaceChild(node, tempSpan);
|
|
477
500
|
}
|
|
478
501
|
else {
|
|
479
|
-
var nodeSelection = new NodeSelection();
|
|
502
|
+
var nodeSelection = new NodeSelection(editNode);
|
|
480
503
|
var currentNode = this.getNodeCollection(range, nodeSelection, node)[this.getNodeCollection(range, nodeSelection, node).length - 1];
|
|
481
504
|
var splitedElm = void 0;
|
|
482
|
-
if ((currentNode.nodeName === 'BR' || currentNode.nodeName === 'HR' ||
|
|
505
|
+
if (currentNode && ((currentNode.nodeName === 'BR' || currentNode.nodeName === 'HR' ||
|
|
483
506
|
(currentNode.nodeName === '#text' && !isNOU(currentNode.parentElement) && currentNode.parentElement.nodeName === 'LI')) &&
|
|
484
|
-
(!isNOU(currentNode.parentElement) && currentNode.parentElement.textContent.trim().length === 0)) {
|
|
507
|
+
(!isNOU(currentNode.parentElement) && currentNode.parentElement.textContent.trim().length === 0))) {
|
|
485
508
|
splitedElm = currentNode;
|
|
486
509
|
if (currentNode.parentElement.nodeName === 'LI' && !isNOU(currentNode.nextSibling) &&
|
|
487
510
|
currentNode.nextSibling.nodeName === 'BR') {
|
|
@@ -494,16 +517,20 @@ var InsertHtml = /** @class */ (function () {
|
|
|
494
517
|
return;
|
|
495
518
|
}
|
|
496
519
|
}
|
|
497
|
-
else if ((currentNode.nodeName === '#text' || currentNode.nodeName === 'BR') && !isNOU(currentNode.parentElement) &&
|
|
520
|
+
else if (currentNode && ((currentNode.nodeName === '#text' || currentNode.nodeName === 'BR') && !isNOU(currentNode.parentElement) &&
|
|
498
521
|
(currentNode.parentElement.nodeName === 'LI' || currentNode.parentElement.closest('LI') || (blockNode === editNode && currentNode.parentElement === blockNode)) &&
|
|
499
|
-
currentNode.parentElement.textContent.trim().length > 0) {
|
|
522
|
+
currentNode.parentElement.textContent.trim().length > 0)) {
|
|
500
523
|
splitedElm = currentNode;
|
|
501
524
|
if (currentNode.parentElement.nodeName === 'LI' && !isNOU(currentNode.nextSibling) &&
|
|
502
525
|
currentNode.nextSibling.nodeName === 'BR') {
|
|
503
526
|
detach(currentNode.nextSibling);
|
|
504
527
|
}
|
|
505
528
|
if (!range.collapsed) {
|
|
529
|
+
var startContainer = range.startContainer;
|
|
530
|
+
var startOffset = range.startOffset;
|
|
506
531
|
this.removeListfromPaste(range);
|
|
532
|
+
range.setStart(startContainer, startOffset);
|
|
533
|
+
range.setEnd(startContainer, startOffset);
|
|
507
534
|
}
|
|
508
535
|
range.insertNode(node);
|
|
509
536
|
this.contentsDeleted = true;
|
|
@@ -543,9 +570,9 @@ var InsertHtml = /** @class */ (function () {
|
|
|
543
570
|
};
|
|
544
571
|
// eslint-disable-next-line
|
|
545
572
|
InsertHtml.getImmediateBlockNode = function (node, editNode) {
|
|
546
|
-
|
|
573
|
+
while (node && CONSTANT.BLOCK_TAGS.indexOf(node.nodeName.toLocaleLowerCase()) < 0) {
|
|
547
574
|
node = node.parentNode;
|
|
548
|
-
}
|
|
575
|
+
}
|
|
549
576
|
return node;
|
|
550
577
|
};
|
|
551
578
|
InsertHtml.removingComments = function (elm) {
|
|
@@ -553,17 +580,20 @@ var InsertHtml = /** @class */ (function () {
|
|
|
553
580
|
innerElement = innerElement.replace(/<!--[\s\S]*?-->/g, '');
|
|
554
581
|
elm.innerHTML = innerElement;
|
|
555
582
|
};
|
|
556
|
-
InsertHtml.findDetachEmptyElem = function (element) {
|
|
583
|
+
InsertHtml.findDetachEmptyElem = function (element, ignoreBlockNodes) {
|
|
584
|
+
if (ignoreBlockNodes === void 0) { ignoreBlockNodes = false; }
|
|
557
585
|
var removableElement;
|
|
558
586
|
if (!isNOU(element.parentElement)) {
|
|
559
587
|
var hasNbsp = element.parentElement.textContent.length > 0 && element.parentElement.textContent.match(/\u00a0/g)
|
|
560
588
|
&& element.parentElement.textContent.match(/\u00a0/g).length > 0;
|
|
561
589
|
if (!hasNbsp && element.parentElement.textContent.trim() === '' && element.parentElement.contentEditable !== 'true' &&
|
|
562
590
|
isNOU(element.parentElement.querySelector('img')) && element.parentElement.nodeName !== 'TD' && element.parentElement.nodeName !== 'TH') {
|
|
563
|
-
removableElement =
|
|
591
|
+
removableElement = ignoreBlockNodes && CONSTANT.BLOCK_TAGS.indexOf(element.parentElement.tagName.toLowerCase()) !== -1 ?
|
|
592
|
+
element : this.findDetachEmptyElem(element.parentElement, ignoreBlockNodes);
|
|
564
593
|
}
|
|
565
594
|
else {
|
|
566
|
-
removableElement = element
|
|
595
|
+
removableElement = ignoreBlockNodes && CONSTANT.BLOCK_TAGS.indexOf(element.tagName.toLowerCase()) !== -1 ? null :
|
|
596
|
+
element;
|
|
567
597
|
}
|
|
568
598
|
}
|
|
569
599
|
else {
|
|
@@ -571,7 +601,8 @@ var InsertHtml = /** @class */ (function () {
|
|
|
571
601
|
}
|
|
572
602
|
return removableElement;
|
|
573
603
|
};
|
|
574
|
-
InsertHtml.removeEmptyElements = function (element) {
|
|
604
|
+
InsertHtml.removeEmptyElements = function (element, ignoreBlockNodes) {
|
|
605
|
+
if (ignoreBlockNodes === void 0) { ignoreBlockNodes = false; }
|
|
575
606
|
var emptyElements = element.querySelectorAll(':empty');
|
|
576
607
|
var nonSvgEmptyElements = Array.from(emptyElements).filter(function (element) {
|
|
577
608
|
// Check if the element is an SVG element or an ancestor of an SVG element
|
|
@@ -584,7 +615,7 @@ var InsertHtml = /** @class */ (function () {
|
|
|
584
615
|
nonSvgEmptyElements[i].style.borderBottom === '' ? true : false;
|
|
585
616
|
}
|
|
586
617
|
if (CONSTANT.SELF_CLOSING_TAGS.indexOf(nonSvgEmptyElements[i].tagName.toLowerCase()) < 0 && lineWithDiv) {
|
|
587
|
-
var detachableElement = this.findDetachEmptyElem(nonSvgEmptyElements[i]);
|
|
618
|
+
var detachableElement = this.findDetachEmptyElem(nonSvgEmptyElements[i], ignoreBlockNodes);
|
|
588
619
|
if (!isNOU(detachableElement)) {
|
|
589
620
|
detach(detachableElement);
|
|
590
621
|
}
|
|
@@ -657,7 +688,7 @@ var InsertHtml = /** @class */ (function () {
|
|
|
657
688
|
var value = range.startContainer;
|
|
658
689
|
if (!isNOU(value) && value.nodeName === 'LI' && !isNOU(value.parentElement) && (value.parentElement.nodeName === 'OL' || value.parentElement.nodeName === 'UL') && value.textContent.trim() === '') {
|
|
659
690
|
value.parentElement.querySelectorAll('li').forEach(function (item) {
|
|
660
|
-
if (item.textContent.trim() === '') {
|
|
691
|
+
if (item.textContent.trim() === '' && item !== value) {
|
|
661
692
|
item.remove();
|
|
662
693
|
}
|
|
663
694
|
});
|
|
@@ -86,7 +86,7 @@ var LinkCommand = /** @class */ (function () {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
else {
|
|
89
|
-
var domSelection = new NodeSelection();
|
|
89
|
+
var domSelection = new NodeSelection(this.parent.editableElement);
|
|
90
90
|
var range = domSelection.getRange(this.parent.currentDocument);
|
|
91
91
|
if (range.endContainer.nodeName === '#text' && range.startContainer.textContent.length === (range.endOffset + 1) &&
|
|
92
92
|
range.endContainer.textContent.charAt(range.endOffset) === ' ' && (!isNOU(range.endContainer.nextSibling) && range.endContainer.nextSibling.nodeName === 'A')) {
|
|
@@ -132,7 +132,7 @@ var LinkCommand = /** @class */ (function () {
|
|
|
132
132
|
}
|
|
133
133
|
};
|
|
134
134
|
LinkCommand.prototype.createLinkNode = function (e) {
|
|
135
|
-
var domSelection = new NodeSelection();
|
|
135
|
+
var domSelection = new NodeSelection(this.parent.editableElement);
|
|
136
136
|
var nodeCutter = new NodeCutter();
|
|
137
137
|
var range = domSelection.getRange(this.parent.currentDocument);
|
|
138
138
|
var nodes = this.getSelectionNodes(domSelection.getNodeCollection(range));
|
|
@@ -312,7 +312,7 @@ var Lists = /** @class */ (function () {
|
|
|
312
312
|
if (e.event.which === 8) {
|
|
313
313
|
this.backspaceList(e);
|
|
314
314
|
}
|
|
315
|
-
if ((e.event.which === 46 && e.event.action === 'delete')
|
|
315
|
+
if ((e.event.which === 46 && e.event.action === 'delete')) {
|
|
316
316
|
var range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
|
|
317
317
|
var commonAncestor = range.commonAncestorContainer;
|
|
318
318
|
var startEle = range.startContainer;
|
|
@@ -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
|
|
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
|
}
|
|
@@ -34,7 +34,7 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
34
34
|
if (format === 'backgroundcolor' && value === '') {
|
|
35
35
|
value = 'transparent';
|
|
36
36
|
}
|
|
37
|
-
var domSelection = new NodeSelection();
|
|
37
|
+
var domSelection = new NodeSelection(endNode);
|
|
38
38
|
var domNode = new DOMNode(endNode, docElement);
|
|
39
39
|
var nodeCutter = new NodeCutter();
|
|
40
40
|
var isFormatted = new IsFormatted();
|
|
@@ -243,7 +243,7 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
243
243
|
if (cursorNodes.length === 1 && range.startOffset === 0 && (cursorNodes[0].nodeName === 'BR' || (isNOU(cursorNodes[0].nextSibling) ? false : cursorNodes[0].nextSibling.nodeName === 'BR'))) {
|
|
244
244
|
detach(cursorNodes[0].nodeName === '#text' ? cursorNodes[0].nextSibling : cursorNodes[0]);
|
|
245
245
|
}
|
|
246
|
-
if (!isNOU(cursorNodes[0].parentElement) && IsFormatted.inlineTags.
|
|
246
|
+
if (!isNOU(cursorNodes[0] && cursorNodes[0].parentElement) && IsFormatted.inlineTags.
|
|
247
247
|
indexOf((cursorNodes[0].parentElement).tagName.toLowerCase()) !== -1 && cursorNodes[0].textContent.includes('\u200B')) {
|
|
248
248
|
var element = this.GetFormatNode(format, value);
|
|
249
249
|
var tempNode = cursorNodes[0];
|
|
@@ -29,7 +29,7 @@ var ToolbarStatus = /** @class */ (function () {
|
|
|
29
29
|
ToolbarStatus.get = function (docElement, rootNode, formatNode, fontSize, fontName, documentNode) {
|
|
30
30
|
var formatCollection = JSON.parse(JSON.stringify(statusCollection));
|
|
31
31
|
var nodeCollection = JSON.parse(JSON.stringify(statusCollection));
|
|
32
|
-
var nodeSelection = new NodeSelection();
|
|
32
|
+
var nodeSelection = new NodeSelection(rootNode);
|
|
33
33
|
var range = nodeSelection.getRange(docElement);
|
|
34
34
|
var nodes = documentNode ? [documentNode] : range.collapsed ? nodeSelection.getNodeCollection(range) :
|
|
35
35
|
nodeSelection.getSelectionNodeCollectionBr(range);
|
|
@@ -139,7 +139,7 @@ var UndoRedoManager = /** @class */ (function () {
|
|
|
139
139
|
if (!this.parent.currentDocument) {
|
|
140
140
|
return;
|
|
141
141
|
}
|
|
142
|
-
var range = new NodeSelection().getRange(this.parent.currentDocument);
|
|
142
|
+
var range = new NodeSelection(this.parent.editableElement).getRange(this.parent.currentDocument);
|
|
143
143
|
var currentContainer = this.parent.editableElement === range.startContainer.parentElement ?
|
|
144
144
|
range.startContainer.parentElement : range.startContainer;
|
|
145
145
|
for (var i = currentContainer.childNodes.length - 1; i >= 0; i--) {
|
|
@@ -149,8 +149,8 @@ var UndoRedoManager = /** @class */ (function () {
|
|
|
149
149
|
detach(currentContainer.childNodes[i]);
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
-
range = new NodeSelection().getRange(this.parent.currentDocument);
|
|
153
|
-
var save = new NodeSelection().save(range, this.parent.currentDocument);
|
|
152
|
+
range = new NodeSelection(this.parent.editableElement).getRange(this.parent.currentDocument);
|
|
153
|
+
var save = new NodeSelection(this.parent.editableElement).save(range, this.parent.currentDocument);
|
|
154
154
|
var clonedElement = this.parent.editableElement.cloneNode(true);
|
|
155
155
|
var fragment = document.createDocumentFragment();
|
|
156
156
|
while (clonedElement.firstChild) {
|
|
@@ -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':
|
|
@@ -427,11 +427,16 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
427
427
|
else if (!isNOU(currentParent) && currentParent !== _this.parent.inputElement && currentParent.nodeName !== 'BR') {
|
|
428
428
|
if (currentParent.textContent.trim().length === 0 || (currentParent.textContent.trim().length === 1 &&
|
|
429
429
|
currentParent.textContent.charCodeAt(0) === 8203)) {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
430
|
+
if (currentParent.childElementCount > 1 && currentParent.lastElementChild.nodeName === 'IMG') {
|
|
431
|
+
_this.insertBRElement();
|
|
432
|
+
}
|
|
433
|
+
else {
|
|
434
|
+
var newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, currentParent, true).cloneNode(true);
|
|
435
|
+
_this.parent.formatter.editorManager.domNode.insertAfter(newElem, currentParent);
|
|
436
|
+
var outerBRElem = _this.parent.createElement('br');
|
|
437
|
+
newElem.parentElement.insertBefore(outerBRElem, newElem);
|
|
438
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), newElem, 0);
|
|
439
|
+
}
|
|
435
440
|
}
|
|
436
441
|
else {
|
|
437
442
|
var newElem = void 0;
|
|
@@ -468,6 +473,7 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
468
473
|
e.args.preventDefault();
|
|
469
474
|
}
|
|
470
475
|
_this.triggerActionComplete(e, shiftKey_1);
|
|
476
|
+
_this.parent.inputElement.dispatchEvent(new Event('input'));
|
|
471
477
|
}
|
|
472
478
|
});
|
|
473
479
|
}
|
|
@@ -89,7 +89,7 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
89
89
|
if (this.parent.isDestroyed) {
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
|
-
this.nodeSelectionObj = new NodeSelection();
|
|
92
|
+
this.nodeSelectionObj = new NodeSelection(this.parent.inputElement);
|
|
93
93
|
this.parent.on(events.initialLoad, this.instantiateRenderer, this);
|
|
94
94
|
this.parent.on(events.htmlToolbarClick, this.onToolbarClick, this);
|
|
95
95
|
this.parent.on(events.keyDown, this.onKeyDown, this);
|
|
@@ -803,7 +803,7 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
803
803
|
urlText = urlText.slice(0, urlTextRange);
|
|
804
804
|
// eslint-disable-next-line
|
|
805
805
|
var regex = new RegExp(/([^\S]|^)(((https?\:\/\/)|(www\.))(\S+))/gi);
|
|
806
|
-
if (selectNodeEle[0].nodeName !== 'A' && urlText.match(regex)) {
|
|
806
|
+
if (selectNodeEle[0] && selectNodeEle[0].nodeName !== 'A' && urlText.match(regex)) {
|
|
807
807
|
var selection = this.nodeSelectionObj.save(range, this.parent.contentModule.getDocument());
|
|
808
808
|
var url = urlText.indexOf('http') > -1 ? urlText : 'http://' + urlText;
|
|
809
809
|
var selectParent = this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
|
|
@@ -21,7 +21,7 @@ var ImportExport = /** @class */ (function () {
|
|
|
21
21
|
saveUrl: this.parent.importWord.serviceUrl
|
|
22
22
|
},
|
|
23
23
|
success: function (args) {
|
|
24
|
-
_this.parent.executeCommand('
|
|
24
|
+
_this.parent.executeCommand('importWord', args.e.currentTarget.response, { undo: true });
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
this.parent.setProperties({ enableXhtml: true }, true);
|
|
@@ -40,7 +40,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
40
40
|
this.isDestroyed = false;
|
|
41
41
|
}
|
|
42
42
|
PasteCleanup.prototype.addEventListener = function () {
|
|
43
|
-
this.nodeSelectionObj = new NodeSelection();
|
|
43
|
+
this.nodeSelectionObj = new NodeSelection(this.parent.inputElement);
|
|
44
44
|
if (this.parent.isDestroyed) {
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
@@ -9,6 +9,8 @@ export declare class Resize {
|
|
|
9
9
|
protected touchMoveEvent: string;
|
|
10
10
|
protected touchEndEvent: string;
|
|
11
11
|
private isDestroyed;
|
|
12
|
+
private isResizing;
|
|
13
|
+
private iframeMouseUpBoundFn;
|
|
12
14
|
private constructor();
|
|
13
15
|
private addEventListener;
|
|
14
16
|
private renderResizable;
|
|
@@ -21,6 +23,7 @@ export declare class Resize {
|
|
|
21
23
|
private unwireResizeEvents;
|
|
22
24
|
private destroy;
|
|
23
25
|
private removeEventListener;
|
|
26
|
+
private iframeMouseUp;
|
|
24
27
|
/**
|
|
25
28
|
* For internal use only - Get the module name.
|
|
26
29
|
*
|