@syncfusion/ej2-richtexteditor 27.1.58 → 27.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +224 -87
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +214 -64
- 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/editor-manager/plugin/nodecutter.js +2 -2
- package/src/rich-text-editor/actions/enter-key.js +10 -2
- package/src/rich-text-editor/actions/html-editor.js +14 -2
- package/src/rich-text-editor/actions/paste-clean-up.js +3 -0
- package/src/rich-text-editor/actions/toolbar.js +7 -0
- package/src/rich-text-editor/models/default-locale.js +5 -5
- package/src/rich-text-editor/renderer/image-module.js +12 -7
- 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.3
|
|
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.
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@27.2.2",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-XhxuV4pqamHtam7yooDj+UAn8UorGonjtxLr2pDoVeiz3r/YodlN5r+UV8Ta6jk4p0hvmwyTa/wJGliZjPBuzQ==",
|
|
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.
|
|
29
|
-
"_shasum": "
|
|
28
|
+
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-27.2.2.tgz",
|
|
29
|
+
"_shasum": "0b7cb82941dbccb875cbea81919374a9245339a9",
|
|
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.3",
|
|
43
|
+
"@syncfusion/ej2-filemanager": "~27.2.3",
|
|
44
|
+
"@syncfusion/ej2-inputs": "~27.2.2",
|
|
45
|
+
"@syncfusion/ej2-navigations": "~27.2.3",
|
|
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.3",
|
|
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;
|
|
@@ -50,7 +50,7 @@ var NodeCutter = /** @class */ (function () {
|
|
|
50
50
|
fragment = this.spliceEmptyNode(fragment, false);
|
|
51
51
|
if (fragment && fragment.childNodes.length > 0) {
|
|
52
52
|
var isEmpty = (fragment.childNodes.length === 1 && fragment.childNodes[0].nodeName !== 'IMG' && !(fragment.querySelectorAll('img').length > 0)
|
|
53
|
-
&& this.isRteElm(fragment) && fragment.textContent.trim() === '' && fragment.textContent !==
|
|
53
|
+
&& this.isRteElm(fragment) && fragment.textContent.trim() === '' && fragment.textContent.charCodeAt(0) !== 32 && fragment.textContent.charCodeAt(0) !== 160) ? true : false;
|
|
54
54
|
if (!isEmpty) {
|
|
55
55
|
if (node) {
|
|
56
56
|
InsertMethods.AppendBefore(fragment, node);
|
|
@@ -71,7 +71,7 @@ var NodeCutter = /** @class */ (function () {
|
|
|
71
71
|
fragment = this.spliceEmptyNode(fragment, true);
|
|
72
72
|
if (fragment && fragment.childNodes.length > 0) {
|
|
73
73
|
var isEmpty = (fragment.childNodes.length === 1 && fragment.childNodes[0].nodeName !== 'IMG'
|
|
74
|
-
&& this.isRteElm(fragment) && fragment.textContent.trim() === '' && fragment.textContent !==
|
|
74
|
+
&& this.isRteElm(fragment) && fragment.textContent.trim() === '' && fragment.textContent.charCodeAt(0) !== 32 && fragment.textContent.charCodeAt(0) !== 160) ? true : false;
|
|
75
75
|
if (!isEmpty) {
|
|
76
76
|
if (node) {
|
|
77
77
|
InsertMethods.AppendBefore(fragment, node, true);
|
|
@@ -172,13 +172,21 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
172
172
|
}
|
|
173
173
|
var isMediaNode = false; // To check the image audio and video node cases
|
|
174
174
|
var isFocusedFirst = false;
|
|
175
|
+
var parentElement = _this.range.startContainer.parentElement;
|
|
176
|
+
var isPreWrapApplied = parentElement ? _this.parent.contentModule.getDocument().defaultView.getComputedStyle(_this.range.startContainer.parentElement, null).getPropertyValue('white-space') === 'pre-wrap' : false;
|
|
175
177
|
if (_this.range.startOffset !== 0 && _this.range.endOffset !== 0 &&
|
|
176
178
|
_this.range.startContainer === _this.range.endContainer && !(!isNOU(nearBlockNode.childNodes[0])
|
|
177
179
|
&& (nearBlockNode.childNodes[0].nodeName === 'IMG' || nearBlockNode.querySelectorAll('img, audio, video').length > 0))) {
|
|
178
180
|
var startNodeText = _this.range.startContainer.textContent;
|
|
179
181
|
var splitFirstText = startNodeText.substring(0, _this.range.startOffset);
|
|
180
|
-
|
|
181
|
-
|
|
182
|
+
var lastCharBeforeCursor = splitFirstText.charCodeAt(_this.range.startOffset - 1);
|
|
183
|
+
var isSplitTextEmpty = splitFirstText.trim().length === 0;
|
|
184
|
+
var hasContentAfterCursor = startNodeText.slice(_this.range.startOffset).trim().length !== 0;
|
|
185
|
+
var isCursorAtStartNonPreWrap = lastCharBeforeCursor !== 160
|
|
186
|
+
&& isSplitTextEmpty && !isPreWrapApplied;
|
|
187
|
+
var isCursorAtStartPreWrapWithContent = lastCharBeforeCursor === 32
|
|
188
|
+
&& isPreWrapApplied && isSplitTextEmpty && hasContentAfterCursor;
|
|
189
|
+
if (isCursorAtStartNonPreWrap || isCursorAtStartPreWrapWithContent) {
|
|
182
190
|
isFocusedFirst = true;
|
|
183
191
|
}
|
|
184
192
|
}
|
|
@@ -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
|
}
|
|
@@ -417,7 +421,10 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
417
421
|
var editorValue = currentRange_1.startContainer.textContent.slice(0, currentRange_1.startOffset);
|
|
418
422
|
var orderedList_1 = this.isOrderedList(editorValue);
|
|
419
423
|
var unOrderedList = this.isUnOrderedList(editorValue);
|
|
420
|
-
var hasSplitedText =
|
|
424
|
+
var hasSplitedText = false;
|
|
425
|
+
if (orderedList_1 || unOrderedList) {
|
|
426
|
+
hasSplitedText = this.hasMultipleTextNode(currentRange_1);
|
|
427
|
+
}
|
|
421
428
|
if (!hasSplitedText && (orderedList_1 && !unOrderedList || unOrderedList && !orderedList_1)) {
|
|
422
429
|
var eventArgs_1 = {
|
|
423
430
|
callBack: null,
|
|
@@ -487,6 +494,11 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
487
494
|
HtmlEditor.prototype.hasMultipleTextNode = function (range) {
|
|
488
495
|
if (range && range.startContainer && range.startContainer.parentNode) {
|
|
489
496
|
var parentNode = range.startContainer.parentNode;
|
|
497
|
+
if (range.startContainer.previousElementSibling &&
|
|
498
|
+
range.startContainer.previousElementSibling.classList.contains('e-mention-chip')
|
|
499
|
+
&& !range.startContainer.previousElementSibling.isContentEditable) {
|
|
500
|
+
return true;
|
|
501
|
+
}
|
|
490
502
|
if (this.parent.enterKey === 'BR' || closest(parentNode, 'table')) {
|
|
491
503
|
return false;
|
|
492
504
|
}
|
|
@@ -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
|
}
|
|
@@ -169,6 +169,13 @@ var Toolbar = /** @class */ (function () {
|
|
|
169
169
|
target: this.tbElement,
|
|
170
170
|
cssClass: this.parent.getCssClass()
|
|
171
171
|
});
|
|
172
|
+
if (this.parent.element.classList.contains('e-rte-full-screen')) {
|
|
173
|
+
this.updateItem({
|
|
174
|
+
targetItem: 'Maximize',
|
|
175
|
+
updateItem: 'Minimize',
|
|
176
|
+
baseToolbar: this.parent.getBaseToolbarObject()
|
|
177
|
+
});
|
|
178
|
+
}
|
|
172
179
|
if (!this.parent.inlineMode.enable) {
|
|
173
180
|
if (this.parent.toolbarSettings.enableFloating) {
|
|
174
181
|
this.checkIsTransformChild();
|
|
@@ -360,11 +360,11 @@ export var formatsLocale = [
|
|
|
360
360
|
export var numberFormatListLocale = [
|
|
361
361
|
{ locale: 'numberFormatListNone', value: 'none' },
|
|
362
362
|
{ locale: 'numberFormatListNumber', value: 'decimal' },
|
|
363
|
-
{ locale: 'numberFormatListLowerAlpha', value: '
|
|
364
|
-
{ locale: 'numberFormatListUpperAlpha', value: '
|
|
365
|
-
{ locale: 'numberFormatListLowerRoman', value: '
|
|
366
|
-
{ locale: 'numberFormatListUpperRoman', value: '
|
|
367
|
-
{ locale: 'numberFormatListLowerGreek', value: '
|
|
363
|
+
{ locale: 'numberFormatListLowerAlpha', value: 'lowerAlpha' },
|
|
364
|
+
{ locale: 'numberFormatListUpperAlpha', value: 'upperAlpha' },
|
|
365
|
+
{ locale: 'numberFormatListLowerRoman', value: 'lowerRoman' },
|
|
366
|
+
{ locale: 'numberFormatListUpperRoman', value: 'upperRoman' },
|
|
367
|
+
{ locale: 'numberFormatListLowerGreek', value: 'lowerGreek' }
|
|
368
368
|
];
|
|
369
369
|
export var bulletFormatListLocale = [
|
|
370
370
|
{ locale: 'bulletFormatListNone', value: 'none' },
|
|
@@ -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) {
|
|
@@ -1832,9 +1829,17 @@ var Image = /** @class */ (function () {
|
|
|
1832
1829
|
}
|
|
1833
1830
|
};
|
|
1834
1831
|
proxy.inputUrl.setAttribute('disabled', 'true');
|
|
1835
|
-
if (isNOU(
|
|
1836
|
-
|
|
1837
|
-
|
|
1832
|
+
if (!isNOU(_this.dialogObj)) {
|
|
1833
|
+
var button = _this.dialogObj.getButtons(0);
|
|
1834
|
+
if (!isNOU(button)) {
|
|
1835
|
+
if (isNOU(proxy.parent.insertImageSettings.saveUrl) && _this.isAllowedTypes
|
|
1836
|
+
&& selectArgs.filesData[0].size <= _this.uploadObj.maxFileSize) {
|
|
1837
|
+
button.element.removeAttribute('disabled');
|
|
1838
|
+
}
|
|
1839
|
+
else {
|
|
1840
|
+
button.element.setAttribute('disabled', 'true');
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1838
1843
|
}
|
|
1839
1844
|
});
|
|
1840
1845
|
reader_1.readAsDataURL(selectArgs.filesData[0].rawFile);
|
|
@@ -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
|
}
|