suneditor 3.0.0-beta.1 → 3.0.0-beta.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/CONTRIBUTING.md +166 -29
- package/README.md +13 -1
- package/dist/suneditor.min.css +1 -1
- package/dist/suneditor.min.js +1 -1
- package/package.json +13 -5
- package/src/assets/{variables.css → design/color.css} +45 -59
- package/src/assets/design/index.css +3 -0
- package/src/assets/design/size.css +35 -0
- package/src/assets/design/typography.css +37 -0
- package/src/assets/suneditor-contents.css +1 -1
- package/src/assets/suneditor.css +40 -28
- package/src/core/base/eventHandlers/handler_ww_dragDrop.js +4 -2
- package/src/core/base/eventHandlers/handler_ww_key_input.js +16 -16
- package/src/core/base/eventHandlers/handler_ww_mouse.js +1 -1
- package/src/core/base/eventManager.js +75 -32
- package/src/core/class/char.js +3 -2
- package/src/core/class/component.js +38 -14
- package/src/core/class/format.js +13 -2
- package/src/core/class/html.js +58 -26
- package/src/core/class/menu.js +19 -0
- package/src/core/class/selection.js +1 -8
- package/src/core/class/toolbar.js +2 -1
- package/src/core/class/ui.js +3 -1
- package/src/core/editor.js +125 -59
- package/src/core/section/actives.js +73 -10
- package/src/core/section/constructor.js +144 -55
- package/src/core/section/documentType.js +2 -2
- package/src/events.js +25 -1
- package/src/helper/converter.js +23 -1
- package/src/helper/dom/domCheck.js +12 -2
- package/src/modules/Controller.js +25 -5
- package/src/modules/Figure.js +6 -6
- package/src/modules/FileManager.js +1 -1
- package/src/plugins/command/fileUpload.js +3 -3
- package/src/plugins/dropdown/formatBlock.js +4 -13
- package/src/plugins/dropdown/table.js +51 -18
- package/src/plugins/modal/audio.js +2 -2
- package/src/plugins/modal/embed.js +2 -2
- package/src/plugins/modal/image.js +3 -3
- package/src/plugins/modal/math.js +2 -2
- package/src/plugins/modal/video.js +1 -1
- package/src/plugins/popup/anchor.js +1 -1
- package/src/suneditor.js +1 -1
- package/src/themes/dark.css +88 -45
- package/types/core/base/eventManager.d.ts +23 -0
- package/types/core/class/char.d.ts +2 -1
- package/types/core/class/component.d.ts +13 -3
- package/types/core/class/format.d.ts +8 -1
- package/types/core/class/html.d.ts +8 -0
- package/types/core/class/menu.d.ts +8 -0
- package/types/core/class/ui.d.ts +1 -1
- package/types/core/editor.d.ts +7 -2
- package/types/core/section/constructor.d.ts +167 -149
- package/types/events.d.ts +3 -0
- package/types/helper/converter.d.ts +9 -0
- package/types/helper/dom/domCheck.d.ts +7 -0
- package/types/helper/index.d.ts +2 -0
- package/types/index.d.ts +1 -1
- package/types/plugins/dropdown/formatBlock.d.ts +2 -2
- package/types/plugins/dropdown/table.d.ts +1 -0
- package/.eslintignore +0 -7
- package/.eslintrc.json +0 -81
- /package/src/assets/icons/{_default.js → defaultIcons.js} +0 -0
- /package/types/assets/icons/{_default.d.ts → defaultIcons.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "suneditor",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.3",
|
|
4
4
|
"description": "Vanilla javascript based WYSIWYG web editor",
|
|
5
5
|
"author": "Yi JiHong",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,10 +34,6 @@
|
|
|
34
34
|
"type": "git",
|
|
35
35
|
"url": "https://github.com/JiHong88/SunEditor.git"
|
|
36
36
|
},
|
|
37
|
-
"ignore": [
|
|
38
|
-
"**/.*",
|
|
39
|
-
"node_modules"
|
|
40
|
-
],
|
|
41
37
|
"devDependencies": {
|
|
42
38
|
"@babel/core": "^7.22.1",
|
|
43
39
|
"@codemirror/lang-html": "^6.4.3",
|
|
@@ -95,6 +91,18 @@
|
|
|
95
91
|
"not IE <= 11",
|
|
96
92
|
"not dead"
|
|
97
93
|
],
|
|
94
|
+
"ignore": [
|
|
95
|
+
"**/.*",
|
|
96
|
+
"node_modules"
|
|
97
|
+
],
|
|
98
|
+
"files": [
|
|
99
|
+
"src",
|
|
100
|
+
"types",
|
|
101
|
+
"dist",
|
|
102
|
+
"README.md",
|
|
103
|
+
"CONTRIBUTING.md",
|
|
104
|
+
"LICENSE"
|
|
105
|
+
],
|
|
98
106
|
"keywords": [
|
|
99
107
|
"wysiwyg",
|
|
100
108
|
"wysiwyg editor",
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
.sun-editor,
|
|
2
2
|
.sun-editor-editable {
|
|
3
|
-
/**
|
|
4
|
-
--se-
|
|
5
|
-
--se-
|
|
6
|
-
--se-edit-inner-padding-doc-type: 2.5rem 2.5rem;
|
|
7
|
-
--se-edit-line-height: 1.5em;
|
|
3
|
+
/** --------------------------- content - [colors] ----------- */
|
|
4
|
+
--se-caret-color: #333;
|
|
5
|
+
--se-placeholder-color: #bbb;
|
|
8
6
|
--se-edit-font-color: #333;
|
|
9
7
|
--se-edit-font-pre: #666;
|
|
10
8
|
--se-edit-font-quote: #999;
|
|
@@ -14,39 +12,43 @@
|
|
|
14
12
|
--se-edit-border-dark: #b1b1b1;
|
|
15
13
|
--se-edit-border-dark-n1: #c1c1c1;
|
|
16
14
|
--se-edit-border-dark-n2: #d1d1d1;
|
|
17
|
-
--se-edit-anchor: #
|
|
15
|
+
--se-edit-anchor: #0056b3;
|
|
18
16
|
--se-edit-anchor-on-back: #e8f7ff;
|
|
19
17
|
--se-edit-anchor-on-font: #0093ff;
|
|
20
18
|
--se-edit-hr-color: #333;
|
|
21
19
|
--se-edit-hr-on-back: #c7deff;
|
|
22
20
|
--se-edit-active: #4592ff;
|
|
23
|
-
--se-edit-hover: #
|
|
21
|
+
--se-edit-hover: #e0f4ff;
|
|
24
22
|
--se-edit-outline: #9e9e9e;
|
|
25
23
|
|
|
26
|
-
/**
|
|
24
|
+
/** --------------------------- layout - [colors] ----------- */
|
|
27
25
|
/** main, common */
|
|
28
|
-
--se-min-height: 65px;
|
|
29
26
|
--se-main-out-color: #dadada;
|
|
30
|
-
--se-main-font-family: Helvetica Neue;
|
|
31
27
|
--se-main-color: #000;
|
|
32
28
|
--se-main-color-lighter: #4c4c4d;
|
|
33
29
|
--se-main-background-color: #fff;
|
|
34
|
-
--se-
|
|
35
|
-
--se-main-background-color3: #f9f9f9;
|
|
30
|
+
--se-code-view-color: #f5f5f5;
|
|
36
31
|
--se-main-font-color: #333;
|
|
37
|
-
--se-
|
|
38
|
-
--se-main-font-size: 13px;
|
|
32
|
+
--se-code-view-background-color: #222;
|
|
39
33
|
--se-main-divider-color: #e1e1e1;
|
|
40
34
|
--se-main-border-color: #d1d1d1;
|
|
41
35
|
--se-main-outline-color: #b1b1b1;
|
|
42
36
|
--se-main-shadow-color: #ececec;
|
|
43
|
-
--se-border-radius: 2px;
|
|
44
|
-
--se-btn-font-size: 12px;
|
|
45
|
-
--se-statusbar-font-size: 10px;
|
|
46
37
|
--se-statusbar-font-color: #666;
|
|
47
38
|
--se-overlay-background-color: #222;
|
|
48
|
-
|
|
49
|
-
|
|
39
|
+
|
|
40
|
+
/* hover */
|
|
41
|
+
--se-hover-color: #000;
|
|
42
|
+
--se-hover-dark-color: #cccccc;
|
|
43
|
+
--se-hover-dark2-color: #bfbfbf;
|
|
44
|
+
--se-hover-dark3-color: #b0b0b0;
|
|
45
|
+
--se-hover-light-color: #e1e1e1;
|
|
46
|
+
--se-hover-light2-color: #e6e6e6;
|
|
47
|
+
--se-hover-light3-color: #d9d9d9;
|
|
48
|
+
|
|
49
|
+
/* active */
|
|
50
|
+
--se-active-color: #5cd2e6;
|
|
51
|
+
--se-active-hover-color: #2964b7;
|
|
50
52
|
--se-active-dark-color: #80bdff;
|
|
51
53
|
--se-active-dark2-color: #407dd1;
|
|
52
54
|
--se-active-dark3-color: #4592ff;
|
|
@@ -58,34 +60,37 @@
|
|
|
58
60
|
--se-active-light4-color: #dbeaff;
|
|
59
61
|
--se-active-light5-color: #c4ddff;
|
|
60
62
|
--se-active-light6-color: #b7ccf2;
|
|
61
|
-
|
|
62
|
-
/*
|
|
63
|
-
--se-shadow-layer-color: rgba(0, 0, 0, 0.
|
|
64
|
-
|
|
65
|
-
--se-shadow-controller-color: rgba(0, 0, 0, 0.2);
|
|
63
|
+
|
|
64
|
+
/* [toolbar, menu, modal] layer - shadow */
|
|
65
|
+
--se-shadow-layer-color: rgba(0, 0, 0, 0.25);
|
|
66
|
+
|
|
66
67
|
/* drag */
|
|
67
68
|
--se-drag-over-color: #f0c20a;
|
|
69
|
+
|
|
68
70
|
/* modal, browser, dropdown */
|
|
69
|
-
--se-modal-
|
|
70
|
-
--se-modal-
|
|
71
|
-
--se-modal-input-width: 70px;
|
|
71
|
+
--se-modal-background-color: #f9f9f9;
|
|
72
|
+
--se-modal-color: #333;
|
|
72
73
|
--se-modal-border-color: #e5e5e5;
|
|
73
74
|
--se-modal-anchor-color: #004cff;
|
|
74
75
|
--se-modal-preview-color: #666;
|
|
76
|
+
--se-modal-file-input-background-color: #f9f9f9;
|
|
75
77
|
--se-modal-input-disabled-color: #999;
|
|
76
78
|
--se-modal-input-disabled-background-color: #f3f3f3;
|
|
77
|
-
|
|
78
|
-
--se-browser-title-font-size: 16px;
|
|
79
|
+
|
|
79
80
|
/* dropdown, selectMenu */
|
|
80
81
|
--se-dropdown-font-color: #555;
|
|
82
|
+
|
|
81
83
|
/* controller */
|
|
82
|
-
--se-controller-font-size: 14px;
|
|
83
84
|
--se-controller-border-color: #999;
|
|
84
|
-
|
|
85
|
-
--se-
|
|
85
|
+
--se-controller-background-color: #f9f9f9;
|
|
86
|
+
--se-controller-color: #333;
|
|
87
|
+
--se-shadow-controller-color: rgba(0, 0, 0, 0.2);
|
|
88
|
+
|
|
89
|
+
/* button : input-side */
|
|
86
90
|
--se-input-btn-border-color: #ccc;
|
|
87
91
|
--se-input-btn-disabled-color: #bdbdbd;
|
|
88
|
-
|
|
92
|
+
|
|
93
|
+
/* success */
|
|
89
94
|
--se-success-color: #008000;
|
|
90
95
|
--se-success-dark-color: #628562;
|
|
91
96
|
--se-success-dark2-color: #419c41;
|
|
@@ -95,6 +100,7 @@
|
|
|
95
100
|
--se-success-light3-color: #c1f4d3;
|
|
96
101
|
--se-success-light4-color: #769c76;
|
|
97
102
|
--se-success-light5-color: #89b589;
|
|
103
|
+
|
|
98
104
|
/* error */
|
|
99
105
|
--se-error-color: #b94a48;
|
|
100
106
|
--se-error-dark-color: #e1a6a2;
|
|
@@ -105,41 +111,21 @@
|
|
|
105
111
|
--se-error-light3-color: #f2dede;
|
|
106
112
|
--se-error-light4-color: #f7deda;
|
|
107
113
|
--se-error-light5-color: #f8e3e1;
|
|
114
|
+
|
|
108
115
|
/* document type */
|
|
109
|
-
--se-doc-
|
|
110
|
-
--se-doc-max-padding: 1.5rem;
|
|
111
|
-
--se-doc-padding-factor: 0.5;
|
|
112
|
-
--se-doc-background: #d2d8e1d1;
|
|
113
|
-
--se-doc-info-font-size: 14px;
|
|
114
|
-
--se-doc-info-width: 18%;
|
|
115
|
-
--se-doc-info-min-width: 16ch;
|
|
116
|
-
--se-doc-info-inner-padding: 2ch;
|
|
117
|
-
--se-doc-info-inner-line-padding: 0.5ch;
|
|
118
|
-
--se-doc-info-page-width: 16px;
|
|
116
|
+
--se-doc-background: #f2f5fa;
|
|
119
117
|
--se-doc-info-page-font-color: #f5f5f5;
|
|
120
118
|
--se-doc-info-page-background-color: #b1b1b1;
|
|
121
119
|
/* document type - font, active */
|
|
122
|
-
--se-doc-info-font-color: #
|
|
120
|
+
--se-doc-info-font-color: #4c4c4c;
|
|
123
121
|
--se-doc-info-active-color: #4a32ff;
|
|
124
|
-
|
|
125
|
-
--se-doc-info-inner-line-indent-h1: 0em;
|
|
126
|
-
--se-doc-info-inner-line-indent-h2: 0.4em;
|
|
127
|
-
--se-doc-info-inner-line-indent-h3: 0.8em;
|
|
128
|
-
--se-doc-info-inner-line-indent-h4: 1.2em;
|
|
129
|
-
--se-doc-info-inner-line-indent-h5: 1.6em;
|
|
130
|
-
--se-doc-info-inner-line-indent-h6: 2em;
|
|
131
|
-
/* document type indent - weight */
|
|
132
|
-
--se-doc-info-inner-line-weight-h1: 700;
|
|
133
|
-
--se-doc-info-inner-line-weight-h2: 500;
|
|
134
|
-
--se-doc-info-inner-line-weight-h3: 400;
|
|
135
|
-
--se-doc-info-inner-line-weight-h4: 300;
|
|
136
|
-
--se-doc-info-inner-line-weight-h5: 300;
|
|
137
|
-
--se-doc-info-inner-line-weight-h6: 300;
|
|
122
|
+
|
|
138
123
|
/* loading */
|
|
139
124
|
--se-loading-color: #07d;
|
|
125
|
+
|
|
140
126
|
/* show blocks */
|
|
141
127
|
--se-show-blocks-color: #3f9dff;
|
|
142
128
|
--se-show-blocks-li-color: #d539ff;
|
|
143
|
-
--se-show-blocks-pre-color: #
|
|
129
|
+
--se-show-blocks-pre-color: #34c38f;
|
|
144
130
|
--se-show-blocks-component-color: #f4b124;
|
|
145
131
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.sun-editor,
|
|
2
|
+
.sun-editor-editable {
|
|
3
|
+
/** --------------------------- content - [size] ----------- */
|
|
4
|
+
/* main */
|
|
5
|
+
--se-edit-inner-padding: 1.5em 1.5em;
|
|
6
|
+
--se-edit-inner-padding-doc-type: 2.5rem 2.5rem;
|
|
7
|
+
|
|
8
|
+
/** --------------------------- layout - [size] ----------- */
|
|
9
|
+
/** main, common */
|
|
10
|
+
--se-border-radius: 2px;
|
|
11
|
+
--se-min-height: 65px;
|
|
12
|
+
|
|
13
|
+
/* modal */
|
|
14
|
+
--se-modal-input-width: 70px;
|
|
15
|
+
|
|
16
|
+
/* input:btn */
|
|
17
|
+
--se-input-btn-size: 32px;
|
|
18
|
+
|
|
19
|
+
/* document type */
|
|
20
|
+
--se-doc-min-padding: 1rem;
|
|
21
|
+
--se-doc-max-padding: 1.5rem;
|
|
22
|
+
--se-doc-padding-factor: 0.5;
|
|
23
|
+
--se-doc-info-width: 18%;
|
|
24
|
+
--se-doc-info-min-width: 16ch;
|
|
25
|
+
--se-doc-info-inner-padding: 2ch;
|
|
26
|
+
--se-doc-info-inner-line-padding: 0.5ch;
|
|
27
|
+
--se-doc-info-page-width: 16px;
|
|
28
|
+
/* document type indent - padding */
|
|
29
|
+
--se-doc-info-inner-line-indent-h1: 0em;
|
|
30
|
+
--se-doc-info-inner-line-indent-h2: 0.4em;
|
|
31
|
+
--se-doc-info-inner-line-indent-h3: 0.8em;
|
|
32
|
+
--se-doc-info-inner-line-indent-h4: 1.2em;
|
|
33
|
+
--se-doc-info-inner-line-indent-h5: 1.6em;
|
|
34
|
+
--se-doc-info-inner-line-indent-h6: 2em;
|
|
35
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.sun-editor,
|
|
2
|
+
.sun-editor-editable {
|
|
3
|
+
/** --------------------------- content - [typography] ----------- */
|
|
4
|
+
--se-edit-font-size: 13px;
|
|
5
|
+
--se-edit-line-height: 1.5em;
|
|
6
|
+
|
|
7
|
+
/** --------------------------- layout - [typography] ----------- */
|
|
8
|
+
/* main */
|
|
9
|
+
--se-main-font-family: Helvetica Neue;
|
|
10
|
+
--se-main-font-size: 13px;
|
|
11
|
+
|
|
12
|
+
/* button */
|
|
13
|
+
--se-btn-font-size: 12px;
|
|
14
|
+
|
|
15
|
+
/* status */
|
|
16
|
+
--se-statusbar-font-size: 10px;
|
|
17
|
+
|
|
18
|
+
/* modal */
|
|
19
|
+
--se-modal-title-font-size: 15px;
|
|
20
|
+
--se-modal-input-font-size: 14px;
|
|
21
|
+
|
|
22
|
+
/* browser */
|
|
23
|
+
--se-browser-title-font-size: 16px;
|
|
24
|
+
|
|
25
|
+
/* controller */
|
|
26
|
+
--se-controller-font-size: 14px;
|
|
27
|
+
|
|
28
|
+
/* document type */
|
|
29
|
+
--se-doc-info-font-size: 14px;
|
|
30
|
+
/* document type indent - weight */
|
|
31
|
+
--se-doc-info-inner-line-weight-h1: 700;
|
|
32
|
+
--se-doc-info-inner-line-weight-h2: 500;
|
|
33
|
+
--se-doc-info-inner-line-weight-h3: 400;
|
|
34
|
+
--se-doc-info-inner-line-weight-h4: 300;
|
|
35
|
+
--se-doc-info-inner-line-weight-h5: 300;
|
|
36
|
+
--se-doc-info-inner-line-weight-h6: 300;
|
|
37
|
+
}
|
package/src/assets/suneditor.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import url('
|
|
1
|
+
@import url('design/index.css');
|
|
2
2
|
|
|
3
3
|
/** --- suneditor main */
|
|
4
4
|
.sun-editor {
|
|
@@ -197,6 +197,18 @@
|
|
|
197
197
|
top: 0px;
|
|
198
198
|
right: 100%;
|
|
199
199
|
}
|
|
200
|
+
|
|
201
|
+
/* se-type-document - placeholder position set */
|
|
202
|
+
.sun-editor .se-wrapper.se-type-document .se-placeholder {
|
|
203
|
+
top: clamp(var(--se-doc-min-padding));
|
|
204
|
+
left: clamp(var(--se-doc-min-padding));
|
|
205
|
+
right: clamp(var(--se-doc-min-padding));
|
|
206
|
+
padding: var(--se-edit-inner-padding-doc-type);
|
|
207
|
+
}
|
|
208
|
+
.sun-editor .se-wrapper.se-type-document.se-type-document-header .se-placeholder {
|
|
209
|
+
left: var(--se-doc-info-width);
|
|
210
|
+
right: var(--se-doc-info-width);
|
|
211
|
+
}
|
|
200
212
|
/** --- se-type-document end ---------------------------------------------------------- */
|
|
201
213
|
|
|
202
214
|
.sun-editor .se-wrapper .se-code-viewer-mirror,
|
|
@@ -245,16 +257,17 @@
|
|
|
245
257
|
|
|
246
258
|
.sun-editor .se-btn:not(.on):not(.active):enabled:hover,
|
|
247
259
|
.sun-editor .se-btn:not(.on):not(.active):enabled:focus {
|
|
248
|
-
|
|
249
|
-
|
|
260
|
+
color: var(--se-hover-color);
|
|
261
|
+
background-color: var(--se-hover-light-color);
|
|
262
|
+
border-color: var(--se-hover-dark-color);
|
|
250
263
|
}
|
|
251
264
|
|
|
252
265
|
.sun-editor .se-btn:not(.on):not(.active):enabled:active,
|
|
253
266
|
.sun-editor .se-btn:not(.on):not(.active):enabled.__se__active {
|
|
254
|
-
background-color: var(--se-
|
|
255
|
-
border-color: var(--se-
|
|
256
|
-
outline: 1px solid var(--se-
|
|
257
|
-
box-shadow: 0 0 0 0.3rem var(--se-
|
|
267
|
+
background-color: var(--se-hover-light2-color);
|
|
268
|
+
border-color: var(--se-hover-dark2-color) !important;
|
|
269
|
+
outline: 1px solid var(--se-hover-dark3-color) !important;
|
|
270
|
+
box-shadow: 0 0 0 0.3rem var(--se-hover-light2-color);
|
|
258
271
|
transition: box-shadow 0.1s ease-in-out;
|
|
259
272
|
}
|
|
260
273
|
|
|
@@ -266,7 +279,7 @@
|
|
|
266
279
|
.sun-editor .se-menu-list li:hover .se-btn-input input:enabled {
|
|
267
280
|
border-width: 1px;
|
|
268
281
|
border-style: solid;
|
|
269
|
-
border-color: var(--se-
|
|
282
|
+
border-color: var(--se-hover-light3-color);
|
|
270
283
|
}
|
|
271
284
|
|
|
272
285
|
/* after, before button - on, active */
|
|
@@ -316,7 +329,7 @@
|
|
|
316
329
|
.sun-editor .se-btn:enabled.on:hover,
|
|
317
330
|
.sun-editor .se-btn:enabled.on:focus {
|
|
318
331
|
background-color: var(--se-active-light3-color);
|
|
319
|
-
color: var(--se-active-
|
|
332
|
+
color: var(--se-active-hover-color);
|
|
320
333
|
border-color: var(--se-active-light5-color);
|
|
321
334
|
}
|
|
322
335
|
|
|
@@ -341,14 +354,14 @@
|
|
|
341
354
|
.sun-editor .se-btn:enabled.active:hover,
|
|
342
355
|
.sun-editor .se-btn:enabled.active:focus {
|
|
343
356
|
background-color: var(--se-active-light5-color);
|
|
344
|
-
color: var(--se-active-
|
|
357
|
+
color: var(--se-active-hover-color);
|
|
345
358
|
border-color: var(--se-active-dark4-color);
|
|
346
359
|
}
|
|
347
360
|
|
|
348
361
|
.sun-editor .se-btn:enabled.active:active,
|
|
349
362
|
.sun-editor .se-btn:enabled.active.__se__active {
|
|
350
363
|
background-color: var(--se-active-light5-color);
|
|
351
|
-
color: var(--se-active-
|
|
364
|
+
color: var(--se-active-hover-color);
|
|
352
365
|
border-color: var(--se-active-dark5-color) !important;
|
|
353
366
|
outline: 1px solid var(--se-active-dark5-color) !important;
|
|
354
367
|
box-shadow: 0 0 0 0.3rem var(--se-active-light5-color);
|
|
@@ -1642,8 +1655,8 @@
|
|
|
1642
1655
|
width: 100%;
|
|
1643
1656
|
}
|
|
1644
1657
|
.sun-editor .se-wrapper .se-code-wrapper .se-code-view-line {
|
|
1645
|
-
background-color: var(--se-
|
|
1646
|
-
color: var(--se-
|
|
1658
|
+
background-color: var(--se-code-view-color);
|
|
1659
|
+
color: var(--se-code-view-background-color);
|
|
1647
1660
|
text-align: right;
|
|
1648
1661
|
width: 50px;
|
|
1649
1662
|
font-size: var(--se-main-font-size);
|
|
@@ -1652,8 +1665,8 @@
|
|
|
1652
1665
|
}
|
|
1653
1666
|
|
|
1654
1667
|
.sun-editor .se-wrapper .se-code-viewer {
|
|
1655
|
-
background-color: var(--se-
|
|
1656
|
-
color: var(--se-
|
|
1668
|
+
background-color: var(--se-code-view-background-color);
|
|
1669
|
+
color: var(--se-code-view-color);
|
|
1657
1670
|
font-size: var(--se-main-font-size);
|
|
1658
1671
|
word-break: break-all;
|
|
1659
1672
|
padding: 4px;
|
|
@@ -1664,6 +1677,7 @@
|
|
|
1664
1677
|
.sun-editor .se-wrapper .se-wrapper-wysiwyg {
|
|
1665
1678
|
display: block;
|
|
1666
1679
|
position: relative;
|
|
1680
|
+
caret-color: var(--se-caret-color);
|
|
1667
1681
|
}
|
|
1668
1682
|
|
|
1669
1683
|
.sun-editor-editable[contenteditable='true'] .se-disable-pointer *,
|
|
@@ -1686,12 +1700,8 @@
|
|
|
1686
1700
|
left: 0;
|
|
1687
1701
|
right: 0;
|
|
1688
1702
|
overflow: hidden;
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
padding-left: 16px;
|
|
1692
|
-
margin-left: 0px;
|
|
1693
|
-
padding-right: 16px;
|
|
1694
|
-
margin-right: 0px;
|
|
1703
|
+
padding: var(--se-edit-inner-padding);
|
|
1704
|
+
margin: 0;
|
|
1695
1705
|
pointer-events: none;
|
|
1696
1706
|
backface-visibility: hidden;
|
|
1697
1707
|
-webkit-backface-visibility: hidden;
|
|
@@ -1818,7 +1828,8 @@
|
|
|
1818
1828
|
width: auto;
|
|
1819
1829
|
max-width: 500px;
|
|
1820
1830
|
margin: 1.75rem auto;
|
|
1821
|
-
background-color: var(--se-
|
|
1831
|
+
background-color: var(--se-modal-background-color);
|
|
1832
|
+
color: var(--se-modal-color);
|
|
1822
1833
|
-webkit-background-clip: padding-box;
|
|
1823
1834
|
background-clip: padding-box;
|
|
1824
1835
|
border: 1px solid rgba(0, 0, 0, 0.2);
|
|
@@ -2150,7 +2161,7 @@
|
|
|
2150
2161
|
height: 100%;
|
|
2151
2162
|
padding: 0;
|
|
2152
2163
|
margin: 0;
|
|
2153
|
-
background-color: var(--se-
|
|
2164
|
+
background-color: var(--se-modal-file-input-background-color);
|
|
2154
2165
|
border: 2px dashed var(--se-input-btn-border-color);
|
|
2155
2166
|
pointer-events: none;
|
|
2156
2167
|
}
|
|
@@ -2374,7 +2385,8 @@
|
|
|
2374
2385
|
word-spacing: normal;
|
|
2375
2386
|
word-wrap: normal;
|
|
2376
2387
|
white-space: normal;
|
|
2377
|
-
background-color: var(--se-
|
|
2388
|
+
background-color: var(--se-controller-background-color);
|
|
2389
|
+
color: var(--se-controller-color);
|
|
2378
2390
|
-webkit-background-clip: padding-box;
|
|
2379
2391
|
background-clip: padding-box;
|
|
2380
2392
|
line-break: auto;
|
|
@@ -2579,8 +2591,8 @@
|
|
|
2579
2591
|
display: none;
|
|
2580
2592
|
pointer-events: auto;
|
|
2581
2593
|
cursor: move;
|
|
2582
|
-
width:
|
|
2583
|
-
height:
|
|
2594
|
+
width: 20px;
|
|
2595
|
+
height: 20px;
|
|
2584
2596
|
background-color: var(--se-active-dark-color);
|
|
2585
2597
|
border: 0;
|
|
2586
2598
|
padding: 1px;
|
|
@@ -2838,7 +2850,7 @@
|
|
|
2838
2850
|
background-color: var(--se-active-light4-color);
|
|
2839
2851
|
border-color: var(--se-active-light4-color) !important;
|
|
2840
2852
|
outline: 1px solid var(--se-active-color) !important;
|
|
2841
|
-
box-shadow:
|
|
2853
|
+
box-shadow: none;
|
|
2842
2854
|
transition: background-color 0.1s ease-in-out, box-shadow 0.1s ease-in-out;
|
|
2843
2855
|
}
|
|
2844
2856
|
|
|
@@ -3028,7 +3040,7 @@
|
|
|
3028
3040
|
|
|
3029
3041
|
.sun-editor .se-browser .se-browser-tags a {
|
|
3030
3042
|
display: inline-block;
|
|
3031
|
-
background-color: var(--se-
|
|
3043
|
+
background-color: var(--se-code-view-color);
|
|
3032
3044
|
padding: 6px 12px;
|
|
3033
3045
|
margin: 8px 0 8px 8px;
|
|
3034
3046
|
color: var(--se-main-font-color);
|
|
@@ -15,9 +15,10 @@ import { _DragHandle } from '../../../modules';
|
|
|
15
15
|
* @param {DragEvent} e - Event object
|
|
16
16
|
*/
|
|
17
17
|
export function OnDragOver_wysiwyg(fc, dragCursor, _iframeTopArea, _innerToolbar, e) {
|
|
18
|
-
e.preventDefault();
|
|
19
|
-
|
|
20
18
|
const { sc, so, ec, eo } = this.selection.getDragEventLocationRange(e);
|
|
19
|
+
if (!sc) return;
|
|
20
|
+
|
|
21
|
+
e.preventDefault();
|
|
21
22
|
|
|
22
23
|
const cursorRange = fc.get('_wd').createRange();
|
|
23
24
|
cursorRange.setStart(sc, so);
|
|
@@ -77,6 +78,7 @@ export function OnDrop_wysiwyg(fc, dragCursor, e) {
|
|
|
77
78
|
if (!dataTransfer) return true;
|
|
78
79
|
|
|
79
80
|
const { sc, so, ec, eo } = this.selection.getDragEventLocationRange(e);
|
|
81
|
+
if (!sc) return;
|
|
80
82
|
|
|
81
83
|
if (dom.query.getParentElement(sc, '.se-disable-pointer')) {
|
|
82
84
|
e.preventDefault();
|
|
@@ -289,7 +289,7 @@ export async function OnKeyDown_wysiwyg(fc, e) {
|
|
|
289
289
|
if (fileComponentInfo) {
|
|
290
290
|
e.preventDefault();
|
|
291
291
|
e.stopPropagation();
|
|
292
|
-
if (this.component.select(fileComponentInfo.target, fileComponentInfo.pluginName
|
|
292
|
+
if (this.component.select(fileComponentInfo.target, fileComponentInfo.pluginName) === false) this.editor.blur();
|
|
293
293
|
break;
|
|
294
294
|
}
|
|
295
295
|
}
|
|
@@ -404,7 +404,7 @@ export async function OnKeyDown_wysiwyg(fc, e) {
|
|
|
404
404
|
e.preventDefault();
|
|
405
405
|
e.stopPropagation();
|
|
406
406
|
if (formatEl.textContent.length === 0) dom.utils.removeItem(formatEl);
|
|
407
|
-
if (this.component.select(fileComponentInfo.target, fileComponentInfo.pluginName
|
|
407
|
+
if (this.component.select(fileComponentInfo.target, fileComponentInfo.pluginName) === false) this.editor.blur();
|
|
408
408
|
} else if (this.component.is(prev)) {
|
|
409
409
|
e.preventDefault();
|
|
410
410
|
e.stopPropagation();
|
|
@@ -474,7 +474,7 @@ export async function OnKeyDown_wysiwyg(fc, e) {
|
|
|
474
474
|
e.preventDefault();
|
|
475
475
|
e.stopPropagation();
|
|
476
476
|
if (dom.check.isZeroWidth(formatEl.textContent)) dom.utils.removeItem(formatEl);
|
|
477
|
-
if (this.component.select(fileComponentInfo.target, fileComponentInfo.pluginName
|
|
477
|
+
if (this.component.select(fileComponentInfo.target, fileComponentInfo.pluginName) === false) this.editor.blur();
|
|
478
478
|
break;
|
|
479
479
|
}
|
|
480
480
|
}
|
|
@@ -512,7 +512,7 @@ export async function OnKeyDown_wysiwyg(fc, e) {
|
|
|
512
512
|
const fileComponentInfo = this.component.get(nextEl);
|
|
513
513
|
if (fileComponentInfo) {
|
|
514
514
|
e.stopPropagation();
|
|
515
|
-
if (this.component.select(fileComponentInfo.target, fileComponentInfo.pluginName
|
|
515
|
+
if (this.component.select(fileComponentInfo.target, fileComponentInfo.pluginName) === false) this.editor.blur();
|
|
516
516
|
} else if (this.component.is(nextEl)) {
|
|
517
517
|
e.stopPropagation();
|
|
518
518
|
dom.utils.removeItem(nextEl);
|
|
@@ -632,7 +632,7 @@ export async function OnKeyDown_wysiwyg(fc, e) {
|
|
|
632
632
|
const baseIndex = dom.query.findTextIndexOnLine(formatEl, range.startContainer, range.startOffset, this.component.is.bind(this.component));
|
|
633
633
|
const prevTabEndIndex = this.format.isLine(formatEl.previousElementSibling) ? dom.query.findTabEndIndex(formatEl.previousElementSibling, baseIndex, 2) : 0;
|
|
634
634
|
if (prevTabEndIndex > baseIndex) {
|
|
635
|
-
tabSize = prevTabEndIndex - baseIndex
|
|
635
|
+
tabSize = prevTabEndIndex - baseIndex;
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
638
|
|
|
@@ -744,7 +744,7 @@ export async function OnKeyDown_wysiwyg(fc, e) {
|
|
|
744
744
|
}
|
|
745
745
|
|
|
746
746
|
// enter scroll
|
|
747
|
-
this.
|
|
747
|
+
this.__enterScrollTo(range);
|
|
748
748
|
break;
|
|
749
749
|
} else if (rangeEl && formatEl && !dom.check.isTableCell(rangeEl) && !/^FIGCAPTION$/i.test(rangeEl.nodeName)) {
|
|
750
750
|
const rangeEnt = this.selection.getRange();
|
|
@@ -759,7 +759,7 @@ export async function OnKeyDown_wysiwyg(fc, e) {
|
|
|
759
759
|
this.selection.setRange(br, 1, br, 1);
|
|
760
760
|
|
|
761
761
|
// enter scroll
|
|
762
|
-
this.
|
|
762
|
+
this.__enterScrollTo(range);
|
|
763
763
|
break;
|
|
764
764
|
}
|
|
765
765
|
|
|
@@ -827,7 +827,7 @@ export async function OnKeyDown_wysiwyg(fc, e) {
|
|
|
827
827
|
(!selectionFormat &&
|
|
828
828
|
dom.check.isZeroWidth(selectionNode.textContent) &&
|
|
829
829
|
dom.check.isBreak(prev) &&
|
|
830
|
-
(dom.check.isBreak(prev.previousSibling) || !dom.check.isZeroWidth(prev.previousSibling
|
|
830
|
+
(dom.check.isBreak(prev.previousSibling) || !dom.check.isZeroWidth(prev.previousSibling?.textContent)) &&
|
|
831
831
|
(!next || (!dom.check.isBreak(next) && dom.check.isZeroWidth(next.textContent)))))
|
|
832
832
|
) {
|
|
833
833
|
if (selectionFormat) dom.utils.removeItem(children[offset - 1]);
|
|
@@ -838,7 +838,7 @@ export async function OnKeyDown_wysiwyg(fc, e) {
|
|
|
838
838
|
this.selection.setRange(newEl, 1, newEl, 1);
|
|
839
839
|
|
|
840
840
|
// enter scroll
|
|
841
|
-
this.
|
|
841
|
+
this.__enterScrollTo(range);
|
|
842
842
|
break;
|
|
843
843
|
}
|
|
844
844
|
|
|
@@ -870,7 +870,7 @@ export async function OnKeyDown_wysiwyg(fc, e) {
|
|
|
870
870
|
this._onShortcutKey = true;
|
|
871
871
|
|
|
872
872
|
// enter scroll
|
|
873
|
-
this.
|
|
873
|
+
this.__enterScrollTo(range);
|
|
874
874
|
break;
|
|
875
875
|
}
|
|
876
876
|
|
|
@@ -902,7 +902,7 @@ export async function OnKeyDown_wysiwyg(fc, e) {
|
|
|
902
902
|
}
|
|
903
903
|
|
|
904
904
|
// enter scroll
|
|
905
|
-
this.
|
|
905
|
+
this.__enterScrollTo(range);
|
|
906
906
|
break;
|
|
907
907
|
}
|
|
908
908
|
|
|
@@ -932,7 +932,7 @@ export async function OnKeyDown_wysiwyg(fc, e) {
|
|
|
932
932
|
}
|
|
933
933
|
|
|
934
934
|
// enter scroll
|
|
935
|
-
this.
|
|
935
|
+
this.__enterScrollTo(range);
|
|
936
936
|
break;
|
|
937
937
|
}
|
|
938
938
|
|
|
@@ -979,14 +979,14 @@ export async function OnKeyDown_wysiwyg(fc, e) {
|
|
|
979
979
|
this.selection.setRange(newEl, offset, newEl, offset);
|
|
980
980
|
|
|
981
981
|
// enter scroll
|
|
982
|
-
this.
|
|
982
|
+
this.__enterScrollTo(range);
|
|
983
983
|
break;
|
|
984
984
|
}
|
|
985
985
|
}
|
|
986
986
|
|
|
987
987
|
if (selectRange) {
|
|
988
988
|
// enter scroll
|
|
989
|
-
this.
|
|
989
|
+
this.__enterScrollTo(range);
|
|
990
990
|
break;
|
|
991
991
|
}
|
|
992
992
|
|
|
@@ -996,7 +996,7 @@ export async function OnKeyDown_wysiwyg(fc, e) {
|
|
|
996
996
|
this.selection.setRange(formatEl, 0, formatEl, 0);
|
|
997
997
|
|
|
998
998
|
// enter scroll
|
|
999
|
-
this.
|
|
999
|
+
this.__enterScrollTo(range);
|
|
1000
1000
|
}
|
|
1001
1001
|
|
|
1002
1002
|
break;
|
|
@@ -1064,7 +1064,7 @@ export async function OnKeyDown_wysiwyg(fc, e) {
|
|
|
1064
1064
|
|
|
1065
1065
|
if (cmponentInfo && !cmponentInfo.options?.isInputComponent) {
|
|
1066
1066
|
e.preventDefault();
|
|
1067
|
-
if (this.component.select(cmponentInfo.target, cmponentInfo.pluginName
|
|
1067
|
+
if (this.component.select(cmponentInfo.target, cmponentInfo.pluginName) === false) this.editor.blur();
|
|
1068
1068
|
}
|
|
1069
1069
|
}
|
|
1070
1070
|
|
|
@@ -92,7 +92,7 @@ export async function OnClick_wysiwyg(fc, e) {
|
|
|
92
92
|
const componentInfo = this.component.get(eventTarget);
|
|
93
93
|
if (componentInfo) {
|
|
94
94
|
e.preventDefault();
|
|
95
|
-
this.component.select(componentInfo.target, componentInfo.pluginName
|
|
95
|
+
this.component.select(componentInfo.target, componentInfo.pluginName);
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
98
|
|