@syncfusion/ej2-richtexteditor 27.1.58 → 27.2.2
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 +2 -2
- package/dist/ej2-richtexteditor.umd.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +180 -74
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +170 -51
- 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 +13 -13
- package/src/common/config.d.ts +0 -7
- package/src/common/config.js +0 -12
- package/src/common/editor-styles.js +1 -1
- package/src/common/interface.d.ts +2 -0
- package/src/common/util.js +2 -1
- package/src/editor-manager/base/constant.d.ts +4 -0
- package/src/editor-manager/base/constant.js +4 -0
- package/src/editor-manager/plugin/formats.d.ts +1 -0
- package/src/editor-manager/plugin/formats.js +25 -0
- package/src/editor-manager/plugin/image.js +8 -2
- package/src/editor-manager/plugin/inserthtml.d.ts +2 -0
- package/src/editor-manager/plugin/inserthtml.js +96 -17
- package/src/rich-text-editor/actions/html-editor.js +5 -1
- package/src/rich-text-editor/actions/paste-clean-up.js +3 -0
- package/src/rich-text-editor/renderer/image-module.js +1 -4
- package/src/rich-text-editor/renderer/slash-menu.js +9 -0
- package/src/rich-text-editor/renderer/table-module.js +1 -1
- package/src/selection/selection.d.ts +2 -1
- package/src/selection/selection.js +15 -12
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 27.
|
|
3
|
+
* version : 27.2.2
|
|
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.58",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-Mh3t2LCFc+U9cNHK+RW1CSAMAdEXR1MtXB6bm0CzjWQUvz5Rw96pX4GLVIiNEnodxod34bycX8mXnV1Blrr1Hg==",
|
|
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.58.tgz",
|
|
29
|
+
"_shasum": "a8af7e987df55ace85a6b6f36e76e57aebab28fd",
|
|
30
30
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
31
31
|
"_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included",
|
|
32
32
|
"author": {
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
},
|
|
38
38
|
"bundleDependencies": false,
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@syncfusion/ej2-base": "~27.
|
|
41
|
-
"@syncfusion/ej2-buttons": "~27.
|
|
42
|
-
"@syncfusion/ej2-dropdowns": "~27.
|
|
43
|
-
"@syncfusion/ej2-filemanager": "~27.
|
|
44
|
-
"@syncfusion/ej2-inputs": "~27.
|
|
45
|
-
"@syncfusion/ej2-navigations": "~27.
|
|
46
|
-
"@syncfusion/ej2-popups": "~27.
|
|
47
|
-
"@syncfusion/ej2-splitbuttons": "~27.
|
|
40
|
+
"@syncfusion/ej2-base": "~27.2.2",
|
|
41
|
+
"@syncfusion/ej2-buttons": "~27.2.2",
|
|
42
|
+
"@syncfusion/ej2-dropdowns": "~27.2.2",
|
|
43
|
+
"@syncfusion/ej2-filemanager": "~27.2.2",
|
|
44
|
+
"@syncfusion/ej2-inputs": "~27.2.2",
|
|
45
|
+
"@syncfusion/ej2-navigations": "~27.2.2",
|
|
46
|
+
"@syncfusion/ej2-popups": "~27.2.2",
|
|
47
|
+
"@syncfusion/ej2-splitbuttons": "~27.2.2"
|
|
48
48
|
},
|
|
49
49
|
"deprecated": false,
|
|
50
50
|
"description": "Essential JS 2 RichTextEditor component",
|
|
@@ -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.
|
|
83
|
+
"version": "27.2.2",
|
|
84
84
|
"sideEffects": false
|
|
85
85
|
}
|
package/src/common/config.d.ts
CHANGED
|
@@ -54,13 +54,6 @@ export declare const selfClosingTags: string[];
|
|
|
54
54
|
*
|
|
55
55
|
*/
|
|
56
56
|
export declare const imageResizeFactor: IImageResizeFactor;
|
|
57
|
-
/**
|
|
58
|
-
* Resize factor for image in iframe editor.
|
|
59
|
-
*
|
|
60
|
-
*@hidden
|
|
61
|
-
*
|
|
62
|
-
*/
|
|
63
|
-
export declare const iframeResizeFactor: IImageResizeFactor;
|
|
64
57
|
/**
|
|
65
58
|
* Mention restrict key configuration.
|
|
66
59
|
*
|
package/src/common/config.js
CHANGED
|
@@ -142,18 +142,6 @@ export var imageResizeFactor = {
|
|
|
142
142
|
botRight: [1, 1],
|
|
143
143
|
botLeft: [-1, 1]
|
|
144
144
|
};
|
|
145
|
-
/**
|
|
146
|
-
* Resize factor for image in iframe editor.
|
|
147
|
-
*
|
|
148
|
-
*@hidden
|
|
149
|
-
*
|
|
150
|
-
*/
|
|
151
|
-
export var iframeResizeFactor = {
|
|
152
|
-
topLeft: [-1.2, -1.2],
|
|
153
|
-
topRight: [1.2, -1.2],
|
|
154
|
-
botRight: [1.2, 1.2],
|
|
155
|
-
botLeft: [-1.2, 1.2]
|
|
156
|
-
};
|
|
157
145
|
/**
|
|
158
146
|
* Mention restrict key configuration.
|
|
159
147
|
*
|
|
@@ -1 +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";
|
|
1
|
+
export var IFRAME_EDITOR_STYLES = "\n@charset \"UTF-8\";\n\n* {\n box-sizing: border-box;\n}\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 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-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}\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-image,\n.e-rte-audio,\n.e-rte-video {\n border: 0;\n cursor: pointer;\n display: block;\n float: none;\n margin: 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 margin-left: 5px;\n margin-right: 5px;\n display: inline-block;\n float: none;\n max-width: 100%;\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-rte-img-caption {\n display: inline-block;\n margin: 5px auto;\n max-width: 100%;\n position: relative;\n}\n\n.e-rte-img-caption.e-caption-inline {\n display: inline-block;\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-rte-img-caption .e-img-inner {\n display: block;\n font-size: 16px;\n font-weight: initial;\n margin: auto;\n opacity: .9;\n position: relative;\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 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";
|
|
@@ -104,6 +104,8 @@ export interface ImageOrTableCursor {
|
|
|
104
104
|
startName: string;
|
|
105
105
|
end: boolean;
|
|
106
106
|
endName: string;
|
|
107
|
+
startNode?: HTMLElement;
|
|
108
|
+
endNode?: HTMLElement;
|
|
107
109
|
}
|
|
108
110
|
/**
|
|
109
111
|
* The `ImageDimension` is used to specify the width and height of the editor image.
|
package/src/common/util.js
CHANGED
|
@@ -82,7 +82,8 @@ export function updateTextNode(value, enterAction) {
|
|
|
82
82
|
}
|
|
83
83
|
var tableElm = resultElm.querySelectorAll('table');
|
|
84
84
|
for (var i = 0; i < tableElm.length; i++) {
|
|
85
|
-
if (tableElm[i].classList.length > 0 && !tableElm[i].classList.contains('e-rte-table')
|
|
85
|
+
if (tableElm[i].classList.length > 0 && !tableElm[i].classList.contains('e-rte-table') &&
|
|
86
|
+
!tableElm[i].classList.contains('e-rte-custom-table')) {
|
|
86
87
|
tableElm[i].classList.add('e-rte-paste-table');
|
|
87
88
|
if (tableElm[i].classList.contains('e-rte-paste-word-table')) {
|
|
88
89
|
tableElm[i].classList.remove('e-rte-paste-word-table');
|
|
@@ -93,3 +93,7 @@ export var SELF_CLOSING_TAGS = ['area', 'base', 'br', 'embed', 'hr', 'img', 'inp
|
|
|
93
93
|
* @hidden
|
|
94
94
|
*/
|
|
95
95
|
export var PASTE_SOURCE = ['word', 'excel', 'onenote'];
|
|
96
|
+
/**
|
|
97
|
+
* @hidden
|
|
98
|
+
*/
|
|
99
|
+
export var ALLOWED_TABLE_BLOCK_TAGS = ['article', 'aside', 'blockquote', 'body', 'canvas', 'details', 'div', 'fieldset', 'figure', 'footer', 'form', 'header', 'li', 'main', 'nav', 'noscript', 'section'];
|
|
@@ -261,6 +261,14 @@ var Formats = /** @class */ (function () {
|
|
|
261
261
|
};
|
|
262
262
|
Formats.prototype.applyFormats = function (e) {
|
|
263
263
|
var range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
|
|
264
|
+
var tableCursor = this.parent.nodeSelection.processedTableImageCursor(range);
|
|
265
|
+
if (tableCursor.start || tableCursor.end) {
|
|
266
|
+
if (tableCursor.startName === 'TABLE' || tableCursor.endName === 'TABLE') {
|
|
267
|
+
var tableNode = tableCursor.start ? tableCursor.startNode : tableCursor.endNode;
|
|
268
|
+
this.applyTableSidesFormat(e, tableCursor.start, tableNode);
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
264
272
|
var isSelectAll = false;
|
|
265
273
|
if (this.parent.editableElement === range.endContainer &&
|
|
266
274
|
!isNOU(this.parent.editableElement.children[range.endOffset - 1]) &&
|
|
@@ -509,6 +517,23 @@ var Formats = /** @class */ (function () {
|
|
|
509
517
|
element.style.removeProperty(ignoreAttr[i]);
|
|
510
518
|
}
|
|
511
519
|
};
|
|
520
|
+
Formats.prototype.applyTableSidesFormat = function (e, start, table) {
|
|
521
|
+
var formatNode = createElement(e.subCommand);
|
|
522
|
+
if (!(e.enterAction === 'BR')) {
|
|
523
|
+
formatNode.appendChild(createElement('br'));
|
|
524
|
+
}
|
|
525
|
+
table.insertAdjacentElement(start ? 'beforebegin' : 'afterend', formatNode);
|
|
526
|
+
this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument, formatNode, 0);
|
|
527
|
+
if (e.callBack) {
|
|
528
|
+
e.callBack({
|
|
529
|
+
requestType: e.subCommand,
|
|
530
|
+
editorMode: 'HTML',
|
|
531
|
+
event: e.event,
|
|
532
|
+
range: this.parent.nodeSelection.getRange(this.parent.currentDocument),
|
|
533
|
+
elements: this.parent.domNode.blockNodes()
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
};
|
|
512
537
|
Formats.prototype.destroy = function () {
|
|
513
538
|
this.removeEventListener();
|
|
514
539
|
};
|
|
@@ -119,8 +119,14 @@ 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.
|
|
123
|
-
imgElm_1.
|
|
122
|
+
var imgWidth = imgElm_1.getAttribute('width');
|
|
123
|
+
var imgHeight = imgElm_1.getAttribute('height');
|
|
124
|
+
if (isNOU(imgWidth) || imgWidth === 'auto') {
|
|
125
|
+
imgElm_1.setAttribute('width', imgElm_1.offsetWidth.toString());
|
|
126
|
+
}
|
|
127
|
+
if (isNOU(imgHeight) || imgHeight === 'auto') {
|
|
128
|
+
imgElm_1.setAttribute('height', imgElm_1.offsetHeight.toString());
|
|
129
|
+
}
|
|
124
130
|
e.callBack({
|
|
125
131
|
requestType: (e.value === 'Replace') ? (e.item.subCommand = 'Replace', 'Replace') : 'Images',
|
|
126
132
|
editorMode: 'HTML',
|
|
@@ -17,6 +17,8 @@ export declare class InsertHtml {
|
|
|
17
17
|
private static findFirstTextNode;
|
|
18
18
|
private static pasteInsertHTML;
|
|
19
19
|
private static listCleanUp;
|
|
20
|
+
private static cleanUpListItems;
|
|
21
|
+
private static cleanUpListContainer;
|
|
20
22
|
private static placeCursorEnd;
|
|
21
23
|
private static getNodeCollection;
|
|
22
24
|
private static insertTempNode;
|
|
@@ -107,7 +107,12 @@ var InsertHtml = /** @class */ (function () {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
if (!isNOU(sibNode) && !isNOU(sibNode.parentNode)) {
|
|
110
|
-
|
|
110
|
+
if (docElement.contains(sibNode)) {
|
|
111
|
+
InsertMethods.AppendBefore(node, sibNode, true);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
range.insertNode(node);
|
|
115
|
+
}
|
|
111
116
|
}
|
|
112
117
|
else {
|
|
113
118
|
var previousNode = null;
|
|
@@ -395,26 +400,99 @@ var InsertHtml = /** @class */ (function () {
|
|
|
395
400
|
this.cursorPos(lastSelectionNode, node, nodeSelection, docElement, editNode, enterAction);
|
|
396
401
|
}
|
|
397
402
|
this.alignCheck(editNode);
|
|
398
|
-
|
|
399
|
-
this.listCleanUp(currentRange);
|
|
403
|
+
this.listCleanUp(nodeSelection, docElement);
|
|
400
404
|
};
|
|
401
|
-
InsertHtml.listCleanUp = function (
|
|
405
|
+
InsertHtml.listCleanUp = function (nodeSelection, docElement) {
|
|
406
|
+
var range = nodeSelection.getRange(docElement);
|
|
407
|
+
var startContainer = range.startContainer;
|
|
408
|
+
var startOffset = range.startOffset;
|
|
402
409
|
if (range.startContainer.parentElement.closest('ol,ul') !== null && range.endContainer.parentElement.closest('ol,ul') !== null) {
|
|
403
|
-
var
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
410
|
+
var haslistCleanUp = this.cleanUpListItems(range.startContainer.parentElement.closest('ol,ul'));
|
|
411
|
+
var haslistContainerCleanUp = this.cleanUpListContainer(range.startContainer.parentElement.closest('ol,ul'));
|
|
412
|
+
if (haslistCleanUp || haslistContainerCleanUp) {
|
|
413
|
+
range.setStart(startContainer, startOffset);
|
|
414
|
+
range.setEnd(startContainer, startOffset);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
};
|
|
418
|
+
InsertHtml.cleanUpListItems = function (parentContainer) {
|
|
419
|
+
var _this = this;
|
|
420
|
+
var hasListCleanUp = false;
|
|
421
|
+
var listItems = parentContainer.closest('ol, ul').querySelectorAll('li');
|
|
422
|
+
if (listItems.length === 0) {
|
|
423
|
+
return false;
|
|
424
|
+
}
|
|
425
|
+
var nearestListItem = null;
|
|
426
|
+
listItems.forEach(function (listItem) {
|
|
427
|
+
if (!isNOU(listItem.firstChild) && (listItem.firstChild.nodeName === 'OL' || listItem.firstChild.nodeName === 'UL')) {
|
|
428
|
+
listItem.style.listStyleType = 'none';
|
|
429
|
+
}
|
|
430
|
+
var parentElement = listItem.parentElement;
|
|
431
|
+
if (!isNOU(parentElement) && parentElement.nodeName !== 'OL' && parentElement.nodeName !== 'UL') {
|
|
432
|
+
if (isNOU(nearestListItem)) {
|
|
433
|
+
nearestListItem = parentElement.closest('li');
|
|
434
|
+
}
|
|
435
|
+
if (!isNOU(nearestListItem)) {
|
|
436
|
+
var nextSibling = listItem.nextSibling;
|
|
437
|
+
if (!isNOU(nextSibling) && nextSibling.nodeName !== 'LI') {
|
|
438
|
+
var startIndex = Array.prototype.indexOf.call(parentElement.childNodes, nextSibling);
|
|
439
|
+
var clonedParent = parentElement.cloneNode(false);
|
|
440
|
+
var totalChildren = parentElement.childNodes.length;
|
|
441
|
+
for (var i = startIndex; i < totalChildren; i++) {
|
|
442
|
+
clonedParent.appendChild(parentElement.childNodes[startIndex]);
|
|
443
|
+
}
|
|
444
|
+
if (clonedParent.childNodes.length > 0) {
|
|
445
|
+
var newListItem = document.createElement('li');
|
|
446
|
+
newListItem.appendChild(clonedParent);
|
|
447
|
+
nearestListItem.insertAdjacentElement('afterend', newListItem);
|
|
448
|
+
}
|
|
449
|
+
else {
|
|
450
|
+
clonedParent.remove();
|
|
451
|
+
}
|
|
414
452
|
}
|
|
415
|
-
|
|
453
|
+
var closestList = parentElement.closest('ol, ul');
|
|
454
|
+
nearestListItem.insertAdjacentElement('afterend', listItem);
|
|
455
|
+
nearestListItem = nearestListItem.nextSibling;
|
|
456
|
+
_this.removeEmptyElements(closestList);
|
|
457
|
+
hasListCleanUp = true;
|
|
458
|
+
}
|
|
416
459
|
}
|
|
460
|
+
var nestedLi = Array.from(listItem.children).find(function (child) {
|
|
461
|
+
return child.tagName === 'LI' && (child.parentElement && child.parentElement.tagName !== 'OL' && child.parentElement.tagName !== 'UL');
|
|
462
|
+
});
|
|
463
|
+
if (nestedLi && listItem.parentNode) {
|
|
464
|
+
listItem.parentNode.replaceChild(nestedLi, listItem);
|
|
465
|
+
hasListCleanUp = true;
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
return hasListCleanUp;
|
|
469
|
+
};
|
|
470
|
+
InsertHtml.cleanUpListContainer = function (parentList) {
|
|
471
|
+
var hasListContainerCleanUp = false;
|
|
472
|
+
var nonLiElementCollection = [];
|
|
473
|
+
var replacements = [];
|
|
474
|
+
if (!isNOU(parentList)) {
|
|
475
|
+
parentList.childNodes.forEach(function (childNode) {
|
|
476
|
+
if (childNode.nodeName.toLocaleUpperCase() !== 'LI') {
|
|
477
|
+
nonLiElementCollection.push(childNode);
|
|
478
|
+
}
|
|
479
|
+
if ((childNode.nodeName.toLocaleUpperCase() === 'LI' || parentList.lastChild === childNode) && nonLiElementCollection.length > 0) {
|
|
480
|
+
replacements.push({ elements: nonLiElementCollection.slice() });
|
|
481
|
+
nonLiElementCollection = [];
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
replacements.forEach(function (_a) {
|
|
485
|
+
var elements = _a.elements;
|
|
486
|
+
var newListItem = document.createElement('li');
|
|
487
|
+
elements[0].parentNode.replaceChild(newListItem, elements[0]);
|
|
488
|
+
elements.forEach(function (child) { return newListItem.appendChild(child); });
|
|
489
|
+
if (newListItem.textContent && newListItem.textContent.trim() === '') {
|
|
490
|
+
parentList.removeChild(newListItem);
|
|
491
|
+
}
|
|
492
|
+
hasListContainerCleanUp = true;
|
|
493
|
+
});
|
|
417
494
|
}
|
|
495
|
+
return hasListContainerCleanUp;
|
|
418
496
|
};
|
|
419
497
|
InsertHtml.placeCursorEnd = function (lastSelectionNode, node, nodeSelection, docElement, editNode) {
|
|
420
498
|
lastSelectionNode = lastSelectionNode.nodeName === 'BR' ? (isNOU(lastSelectionNode.previousSibling) ? lastSelectionNode.parentNode
|
|
@@ -630,7 +708,8 @@ var InsertHtml = /** @class */ (function () {
|
|
|
630
708
|
while (el && el.nodeType === 1) {
|
|
631
709
|
if (el.parentNode === editNode ||
|
|
632
710
|
(!isNOU(el.parentNode.tagName) &&
|
|
633
|
-
CONSTANT.IGNORE_BLOCK_TAGS.indexOf(el.parentNode.tagName.toLocaleLowerCase()) !== -1
|
|
711
|
+
(CONSTANT.IGNORE_BLOCK_TAGS.indexOf(el.parentNode.tagName.toLocaleLowerCase()) !== -1
|
|
712
|
+
|| CONSTANT.ALLOWED_TABLE_BLOCK_TAGS.indexOf(el.parentNode.tagName.toLocaleLowerCase()) !== -1))) {
|
|
634
713
|
return el;
|
|
635
714
|
}
|
|
636
715
|
el = el.parentNode;
|
|
@@ -131,7 +131,11 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
131
131
|
HtmlEditor.prototype.isTableClassAdded = function () {
|
|
132
132
|
var tableElement = this.parent.inputElement.querySelectorAll('table');
|
|
133
133
|
for (var i = 0; i < tableElement.length; i++) {
|
|
134
|
-
|
|
134
|
+
// e-rte-table class is added to the table element for styling.
|
|
135
|
+
// e-rte-paste-table class is added for pasted table element from MS Word and other sources such as Web will not have any styles.
|
|
136
|
+
// e-rte-custom-table class is added for custom table element will not have any styles.
|
|
137
|
+
if (!tableElement[i].classList.contains('e-rte-table') && !tableElement[i].classList.contains('e-rte-paste-table')
|
|
138
|
+
&& !tableElement[i].classList.contains('e-rte-custom-table')) {
|
|
135
139
|
tableElement[i].classList.add('e-rte-table');
|
|
136
140
|
}
|
|
137
141
|
}
|
|
@@ -846,6 +846,9 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
846
846
|
var tableElement = element.querySelectorAll('table');
|
|
847
847
|
for (var i = 0; i < tableElement.length; i++) {
|
|
848
848
|
var isMSTeamsTable = tableElement[i].parentElement.nodeName === 'FIGURE';
|
|
849
|
+
if (tableElement[i].classList.length > 0 && tableElement[i].classList.contains('e-rte-custom-table')) {
|
|
850
|
+
continue; // Skip the custom table class
|
|
851
|
+
}
|
|
849
852
|
if (this.parent.pasteCleanupSettings.keepFormat && source && !isMSTeamsTable) {
|
|
850
853
|
tableElement[i].classList.add('e-rte-paste-' + source + '-table');
|
|
851
854
|
}
|
|
@@ -8,7 +8,7 @@ import { Button, CheckBox } from '@syncfusion/ej2-buttons';
|
|
|
8
8
|
import { RenderType, ImageInputSource } from '../base/enum';
|
|
9
9
|
import { dispatchEvent, parseHtml, hasClass, convertToBlob } from '../base/util';
|
|
10
10
|
import { isIDevice } from '../../common/util';
|
|
11
|
-
import {
|
|
11
|
+
import { imageResizeFactor } from '../../common/config';
|
|
12
12
|
/**
|
|
13
13
|
* `Image` module is used to handle image actions.
|
|
14
14
|
*/
|
|
@@ -521,9 +521,6 @@ var Image = /** @class */ (function () {
|
|
|
521
521
|
return dimensions;
|
|
522
522
|
};
|
|
523
523
|
Image.prototype.getResizeFactor = function (value) {
|
|
524
|
-
if (this.parent.iframeSettings.enable) {
|
|
525
|
-
return iframeResizeFactor[value];
|
|
526
|
-
}
|
|
527
524
|
return imageResizeFactor[value];
|
|
528
525
|
};
|
|
529
526
|
Image.prototype.findAspectRatio = function (image) {
|
|
@@ -150,6 +150,15 @@ var SlashMenu = /** @class */ (function () {
|
|
|
150
150
|
break;
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
+
else {
|
|
154
|
+
if (_this.parent.inputElement.classList.contains('e-mention')) {
|
|
155
|
+
var slashMenuPopup = _this.parent.inputElement.ownerDocument.getElementById(_this.parent.inputElement.id + '_slash_menu_popup');
|
|
156
|
+
var isSlashMenuPopupOpen = slashMenuPopup && slashMenuPopup.classList.contains('e-popup-open');
|
|
157
|
+
if (isSlashMenuPopupOpen) {
|
|
158
|
+
_this.mention.hidePopup();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
153
162
|
}
|
|
154
163
|
});
|
|
155
164
|
};
|
|
@@ -1068,7 +1068,7 @@ var Table = /** @class */ (function () {
|
|
|
1068
1068
|
return;
|
|
1069
1069
|
}
|
|
1070
1070
|
var target = e.target || e.targetTouches[0].target;
|
|
1071
|
-
var closestTable = closest(target, 'table.e-rte-table, table.e-rte-paste-table');
|
|
1071
|
+
var closestTable = closest(target, 'table.e-rte-table, table.e-rte-paste-table, table.e-rte-custom-table');
|
|
1072
1072
|
var isResizing = this.parent.contentModule.getEditPanel().querySelectorAll('.e-table-box.e-rbox-select, .e-table-rhelper.e-column-helper, .e-table-rhelper.e-row-helper').length > 0;
|
|
1073
1073
|
if (!isResizing && !isNOU(this.curTable) && !isNOU(closestTable) && closestTable !== this.curTable &&
|
|
1074
1074
|
this.parent.contentModule.getEditPanel().contains(closestTable)) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ImageOrTableCursor } from '../common';
|
|
1
2
|
/**
|
|
2
3
|
* `Selection` module is used to handle RTE Selections.
|
|
3
4
|
*/
|
|
@@ -235,5 +236,5 @@ export declare class NodeSelection {
|
|
|
235
236
|
setCursorPoint(docElement: Document, element: Element, point: number): void;
|
|
236
237
|
private isTableOrImageStart;
|
|
237
238
|
private isTableOrImageEnd;
|
|
238
|
-
|
|
239
|
+
processedTableImageCursor(range: Range): ImageOrTableCursor;
|
|
239
240
|
}
|
|
@@ -126,7 +126,8 @@ var NodeSelection = /** @class */ (function () {
|
|
|
126
126
|
var tableCursor = this.processedTableImageCursor(range);
|
|
127
127
|
if (tableCursor.start || tableCursor.end) {
|
|
128
128
|
if (tableCursor.startName === 'TABLE' || tableCursor.endName === 'TABLE') {
|
|
129
|
-
|
|
129
|
+
var tableNode = tableCursor.start ? tableCursor.startNode : tableCursor.endNode;
|
|
130
|
+
return [tableNode];
|
|
130
131
|
}
|
|
131
132
|
}
|
|
132
133
|
if ((startNode === endNode || (startNode.nodeName === 'BR' && startNode === range.endContainer.childNodes[range.endOffset])) &&
|
|
@@ -452,34 +453,36 @@ var NodeSelection = /** @class */ (function () {
|
|
|
452
453
|
var customHandlerElements = ['TABLE'];
|
|
453
454
|
var startContainer = range.startContainer;
|
|
454
455
|
var startOffset = range.startOffset;
|
|
456
|
+
var startNode = startContainer.childNodes[startOffset];
|
|
455
457
|
var isCursorAtStart = range.collapsed && (startContainer.nodeType === 1) &&
|
|
456
|
-
startContainer.isContentEditable &&
|
|
457
|
-
(customHandlerElements.indexOf(
|
|
458
|
+
startContainer.isContentEditable && startNode &&
|
|
459
|
+
(customHandlerElements.indexOf(startNode.nodeName) > -1);
|
|
458
460
|
if (isCursorAtStart) {
|
|
459
|
-
return { start: isCursorAtStart, startNodeName:
|
|
461
|
+
return { start: isCursorAtStart, startNodeName: startNode.nodeName, startNode: startNode };
|
|
460
462
|
}
|
|
461
463
|
else {
|
|
462
|
-
return { start: false, startNodeName: '' };
|
|
464
|
+
return { start: false, startNodeName: '', startNode: undefined };
|
|
463
465
|
}
|
|
464
466
|
};
|
|
465
467
|
NodeSelection.prototype.isTableOrImageEnd = function (range) {
|
|
466
468
|
var customHandlerElements = ['TABLE'];
|
|
467
469
|
var startContainer = range.startContainer;
|
|
468
470
|
var startOffset = range.startOffset;
|
|
471
|
+
var endNode = startContainer.childNodes[startOffset - 1];
|
|
469
472
|
var isCursorAtEnd = range.collapsed && (startContainer.nodeType === 1) &&
|
|
470
|
-
startContainer.isContentEditable &&
|
|
471
|
-
(customHandlerElements.indexOf(
|
|
473
|
+
startContainer.isContentEditable && endNode &&
|
|
474
|
+
(customHandlerElements.indexOf(endNode.nodeName) > -1);
|
|
472
475
|
if (isCursorAtEnd) {
|
|
473
|
-
return { end: isCursorAtEnd, endNodeName:
|
|
476
|
+
return { end: isCursorAtEnd, endNodeName: endNode.nodeName, endNode: endNode };
|
|
474
477
|
}
|
|
475
478
|
else {
|
|
476
|
-
return { end: false, endNodeName: '' };
|
|
479
|
+
return { end: false, endNodeName: '', endNode: undefined };
|
|
477
480
|
}
|
|
478
481
|
};
|
|
479
482
|
NodeSelection.prototype.processedTableImageCursor = function (range) {
|
|
480
|
-
var _a = this.isTableOrImageStart(range), start = _a.start, startNodeName = _a.startNodeName;
|
|
481
|
-
var _b = this.isTableOrImageEnd(range), end = _b.end, endNodeName = _b.endNodeName;
|
|
482
|
-
return { start: start, startName: startNodeName, end: end, endName: endNodeName };
|
|
483
|
+
var _a = this.isTableOrImageStart(range), start = _a.start, startNodeName = _a.startNodeName, startNode = _a.startNode;
|
|
484
|
+
var _b = this.isTableOrImageEnd(range), end = _b.end, endNodeName = _b.endNodeName, endNode = _b.endNode;
|
|
485
|
+
return { start: start, startName: startNodeName, end: end, endName: endNodeName, startNode: startNode, endNode: endNode };
|
|
483
486
|
};
|
|
484
487
|
return NodeSelection;
|
|
485
488
|
}());
|