suneditor 3.0.0-beta.1 → 3.0.0-beta.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/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} +34 -58
- 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 +24 -17
- package/src/core/base/eventHandlers/handler_ww_key_input.js +15 -15
- package/src/core/base/eventHandlers/handler_ww_mouse.js +1 -1
- package/src/core/base/eventManager.js +21 -9
- package/src/core/class/component.js +21 -11
- package/src/core/class/menu.js +19 -0
- package/src/core/editor.js +3 -3
- package/src/core/section/actives.js +42 -4
- package/src/core/section/constructor.js +116 -41
- package/src/core/section/documentType.js +2 -2
- package/src/events.js +13 -1
- package/src/helper/dom/domCheck.js +10 -0
- 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/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 +78 -45
- package/types/core/base/eventManager.d.ts +7 -0
- package/types/core/class/component.d.ts +12 -3
- package/types/core/class/menu.d.ts +8 -0
- package/types/core/section/constructor.d.ts +160 -149
- package/types/events.d.ts +1 -0
- package/types/helper/dom/domCheck.d.ts +7 -0
- package/types/helper/index.d.ts +1 -0
- package/types/index.d.ts +1 -1
- 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.2",
|
|
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,33 @@
|
|
|
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;
|
|
39
|
+
|
|
48
40
|
/* hover, active */
|
|
49
|
-
--se-active-color: #
|
|
41
|
+
--se-active-color: #5cd2e6;
|
|
50
42
|
--se-active-dark-color: #80bdff;
|
|
51
43
|
--se-active-dark2-color: #407dd1;
|
|
52
44
|
--se-active-dark3-color: #4592ff;
|
|
@@ -58,34 +50,37 @@
|
|
|
58
50
|
--se-active-light4-color: #dbeaff;
|
|
59
51
|
--se-active-light5-color: #c4ddff;
|
|
60
52
|
--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);
|
|
53
|
+
|
|
54
|
+
/* [toolbar, menu, modal] layer - shadow */
|
|
55
|
+
--se-shadow-layer-color: rgba(0, 0, 0, 0.25);
|
|
56
|
+
|
|
66
57
|
/* drag */
|
|
67
58
|
--se-drag-over-color: #f0c20a;
|
|
59
|
+
|
|
68
60
|
/* modal, browser, dropdown */
|
|
69
|
-
--se-modal-
|
|
70
|
-
--se-modal-
|
|
71
|
-
--se-modal-input-width: 70px;
|
|
61
|
+
--se-modal-background-color: #f9f9f9;
|
|
62
|
+
--se-modal-color: #333;
|
|
72
63
|
--se-modal-border-color: #e5e5e5;
|
|
73
64
|
--se-modal-anchor-color: #004cff;
|
|
74
65
|
--se-modal-preview-color: #666;
|
|
66
|
+
--se-modal-file-input-background-color: #f9f9f9;
|
|
75
67
|
--se-modal-input-disabled-color: #999;
|
|
76
68
|
--se-modal-input-disabled-background-color: #f3f3f3;
|
|
77
|
-
|
|
78
|
-
--se-browser-title-font-size: 16px;
|
|
69
|
+
|
|
79
70
|
/* dropdown, selectMenu */
|
|
80
71
|
--se-dropdown-font-color: #555;
|
|
72
|
+
|
|
81
73
|
/* controller */
|
|
82
|
-
--se-controller-font-size: 14px;
|
|
83
74
|
--se-controller-border-color: #999;
|
|
84
|
-
|
|
85
|
-
--se-
|
|
75
|
+
--se-controller-background-color: #f9f9f9;
|
|
76
|
+
--se-controller-color: #333;
|
|
77
|
+
--se-shadow-controller-color: rgba(0, 0, 0, 0.2);
|
|
78
|
+
|
|
79
|
+
/* button : input-side */
|
|
86
80
|
--se-input-btn-border-color: #ccc;
|
|
87
81
|
--se-input-btn-disabled-color: #bdbdbd;
|
|
88
|
-
|
|
82
|
+
|
|
83
|
+
/* success */
|
|
89
84
|
--se-success-color: #008000;
|
|
90
85
|
--se-success-dark-color: #628562;
|
|
91
86
|
--se-success-dark2-color: #419c41;
|
|
@@ -95,6 +90,7 @@
|
|
|
95
90
|
--se-success-light3-color: #c1f4d3;
|
|
96
91
|
--se-success-light4-color: #769c76;
|
|
97
92
|
--se-success-light5-color: #89b589;
|
|
93
|
+
|
|
98
94
|
/* error */
|
|
99
95
|
--se-error-color: #b94a48;
|
|
100
96
|
--se-error-dark-color: #e1a6a2;
|
|
@@ -105,41 +101,21 @@
|
|
|
105
101
|
--se-error-light3-color: #f2dede;
|
|
106
102
|
--se-error-light4-color: #f7deda;
|
|
107
103
|
--se-error-light5-color: #f8e3e1;
|
|
104
|
+
|
|
108
105
|
/* 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;
|
|
106
|
+
--se-doc-background: #f2f5fa;
|
|
119
107
|
--se-doc-info-page-font-color: #f5f5f5;
|
|
120
108
|
--se-doc-info-page-background-color: #b1b1b1;
|
|
121
109
|
/* document type - font, active */
|
|
122
|
-
--se-doc-info-font-color: #
|
|
110
|
+
--se-doc-info-font-color: #4c4c4c;
|
|
123
111
|
--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;
|
|
112
|
+
|
|
138
113
|
/* loading */
|
|
139
114
|
--se-loading-color: #07d;
|
|
115
|
+
|
|
140
116
|
/* show blocks */
|
|
141
117
|
--se-show-blocks-color: #3f9dff;
|
|
142
118
|
--se-show-blocks-li-color: #d539ff;
|
|
143
|
-
--se-show-blocks-pre-color: #
|
|
119
|
+
--se-show-blocks-pre-color: #34c38f;
|
|
144
120
|
--se-show-blocks-component-color: #f4b124;
|
|
145
121
|
}
|
|
@@ -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,14 @@
|
|
|
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: var(--se-doc-info-width);
|
|
205
|
+
right: var(--se-doc-info-width);
|
|
206
|
+
padding: var(--se-edit-inner-padding-doc-type);
|
|
207
|
+
}
|
|
200
208
|
/** --- se-type-document end ---------------------------------------------------------- */
|
|
201
209
|
|
|
202
210
|
.sun-editor .se-wrapper .se-code-viewer-mirror,
|
|
@@ -1642,8 +1650,8 @@
|
|
|
1642
1650
|
width: 100%;
|
|
1643
1651
|
}
|
|
1644
1652
|
.sun-editor .se-wrapper .se-code-wrapper .se-code-view-line {
|
|
1645
|
-
background-color: var(--se-
|
|
1646
|
-
color: var(--se-
|
|
1653
|
+
background-color: var(--se-code-view-color);
|
|
1654
|
+
color: var(--se-code-view-background-color);
|
|
1647
1655
|
text-align: right;
|
|
1648
1656
|
width: 50px;
|
|
1649
1657
|
font-size: var(--se-main-font-size);
|
|
@@ -1652,8 +1660,8 @@
|
|
|
1652
1660
|
}
|
|
1653
1661
|
|
|
1654
1662
|
.sun-editor .se-wrapper .se-code-viewer {
|
|
1655
|
-
background-color: var(--se-
|
|
1656
|
-
color: var(--se-
|
|
1663
|
+
background-color: var(--se-code-view-background-color);
|
|
1664
|
+
color: var(--se-code-view-color);
|
|
1657
1665
|
font-size: var(--se-main-font-size);
|
|
1658
1666
|
word-break: break-all;
|
|
1659
1667
|
padding: 4px;
|
|
@@ -1664,6 +1672,7 @@
|
|
|
1664
1672
|
.sun-editor .se-wrapper .se-wrapper-wysiwyg {
|
|
1665
1673
|
display: block;
|
|
1666
1674
|
position: relative;
|
|
1675
|
+
caret-color: var(--se-caret-color);
|
|
1667
1676
|
}
|
|
1668
1677
|
|
|
1669
1678
|
.sun-editor-editable[contenteditable='true'] .se-disable-pointer *,
|
|
@@ -1686,12 +1695,8 @@
|
|
|
1686
1695
|
left: 0;
|
|
1687
1696
|
right: 0;
|
|
1688
1697
|
overflow: hidden;
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
padding-left: 16px;
|
|
1692
|
-
margin-left: 0px;
|
|
1693
|
-
padding-right: 16px;
|
|
1694
|
-
margin-right: 0px;
|
|
1698
|
+
padding: var(--se-edit-inner-padding);
|
|
1699
|
+
margin: 0;
|
|
1695
1700
|
pointer-events: none;
|
|
1696
1701
|
backface-visibility: hidden;
|
|
1697
1702
|
-webkit-backface-visibility: hidden;
|
|
@@ -1818,7 +1823,8 @@
|
|
|
1818
1823
|
width: auto;
|
|
1819
1824
|
max-width: 500px;
|
|
1820
1825
|
margin: 1.75rem auto;
|
|
1821
|
-
background-color: var(--se-
|
|
1826
|
+
background-color: var(--se-modal-background-color);
|
|
1827
|
+
color: var(--se-modal-color);
|
|
1822
1828
|
-webkit-background-clip: padding-box;
|
|
1823
1829
|
background-clip: padding-box;
|
|
1824
1830
|
border: 1px solid rgba(0, 0, 0, 0.2);
|
|
@@ -2150,7 +2156,7 @@
|
|
|
2150
2156
|
height: 100%;
|
|
2151
2157
|
padding: 0;
|
|
2152
2158
|
margin: 0;
|
|
2153
|
-
background-color: var(--se-
|
|
2159
|
+
background-color: var(--se-modal-file-input-background-color);
|
|
2154
2160
|
border: 2px dashed var(--se-input-btn-border-color);
|
|
2155
2161
|
pointer-events: none;
|
|
2156
2162
|
}
|
|
@@ -2374,7 +2380,8 @@
|
|
|
2374
2380
|
word-spacing: normal;
|
|
2375
2381
|
word-wrap: normal;
|
|
2376
2382
|
white-space: normal;
|
|
2377
|
-
background-color: var(--se-
|
|
2383
|
+
background-color: var(--se-controller-background-color);
|
|
2384
|
+
color: var(--se-controller-color);
|
|
2378
2385
|
-webkit-background-clip: padding-box;
|
|
2379
2386
|
background-clip: padding-box;
|
|
2380
2387
|
line-break: auto;
|
|
@@ -2579,8 +2586,8 @@
|
|
|
2579
2586
|
display: none;
|
|
2580
2587
|
pointer-events: auto;
|
|
2581
2588
|
cursor: move;
|
|
2582
|
-
width:
|
|
2583
|
-
height:
|
|
2589
|
+
width: 20px;
|
|
2590
|
+
height: 20px;
|
|
2584
2591
|
background-color: var(--se-active-dark-color);
|
|
2585
2592
|
border: 0;
|
|
2586
2593
|
padding: 1px;
|
|
@@ -3028,7 +3035,7 @@
|
|
|
3028
3035
|
|
|
3029
3036
|
.sun-editor .se-browser .se-browser-tags a {
|
|
3030
3037
|
display: inline-block;
|
|
3031
|
-
background-color: var(--se-
|
|
3038
|
+
background-color: var(--se-code-view-color);
|
|
3032
3039
|
padding: 6px 12px;
|
|
3033
3040
|
margin: 8px 0 8px 8px;
|
|
3034
3041
|
color: var(--se-main-font-color);
|
|
@@ -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);
|
|
@@ -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
|
|
|
@@ -223,7 +223,7 @@ EventManager.prototype = {
|
|
|
223
223
|
if (this.component.is(selectionNode) && !this.component.__selectionSelected) {
|
|
224
224
|
const component = this.component.get(selectionNode);
|
|
225
225
|
if (!component) return;
|
|
226
|
-
this.component.select(component.target, component.pluginName
|
|
226
|
+
this.component.select(component.target, component.pluginName);
|
|
227
227
|
return;
|
|
228
228
|
}
|
|
229
229
|
|
|
@@ -499,14 +499,14 @@ EventManager.prototype = {
|
|
|
499
499
|
const eCell = this.format.getBlock(ec);
|
|
500
500
|
const sIsCell = dom.check.isTableCell(sCell);
|
|
501
501
|
const eIsCell = dom.check.isTableCell(eCell);
|
|
502
|
-
const ancestor = range.commonAncestorContainer;
|
|
503
502
|
if (((sIsCell && !sCell.previousElementSibling && !sCell.parentElement.previousElementSibling) || (eIsCell && !eCell.nextElementSibling && !eCell.parentElement.nextElementSibling)) && sCell !== eCell) {
|
|
503
|
+
const ancestor = dom.query.getParentElement(range.commonAncestorContainer, dom.check.isFigure) || range.commonAncestorContainer;
|
|
504
504
|
if (!sIsCell) {
|
|
505
|
-
dom.utils.removeItem(dom.query.getParentElement(eCell, (current) => ancestor === current
|
|
505
|
+
dom.utils.removeItem(dom.query.getParentElement(eCell, (current) => ancestor === current));
|
|
506
506
|
} else if (!eIsCell) {
|
|
507
|
-
dom.utils.removeItem(dom.query.getParentElement(sCell, (current) => ancestor === current
|
|
507
|
+
dom.utils.removeItem(dom.query.getParentElement(sCell, (current) => ancestor === current));
|
|
508
508
|
} else {
|
|
509
|
-
dom.utils.removeItem(dom.query.getParentElement(sCell, (current) => ancestor === current
|
|
509
|
+
dom.utils.removeItem(dom.query.getParentElement(sCell, (current) => ancestor === current));
|
|
510
510
|
this.editor._nativeFocus();
|
|
511
511
|
return true;
|
|
512
512
|
}
|
|
@@ -571,7 +571,7 @@ EventManager.prototype = {
|
|
|
571
571
|
return;
|
|
572
572
|
}
|
|
573
573
|
|
|
574
|
-
this.component.select(compInfo.target, compInfo.pluginName
|
|
574
|
+
this.component.select(compInfo.target, compInfo.pluginName);
|
|
575
575
|
return null;
|
|
576
576
|
} else if (commonCon.nodeType === 1 && commonCon.getAttribute('data-se-embed') === 'true') {
|
|
577
577
|
let el = commonCon.nextElementSibling;
|
|
@@ -822,7 +822,8 @@ EventManager.prototype = {
|
|
|
822
822
|
this.addEvent(_w, 'resize', OnResize_window.bind(this), false);
|
|
823
823
|
this.addEvent(_w, 'scroll', OnScroll_window.bind(this), false);
|
|
824
824
|
if (env.isMobile) {
|
|
825
|
-
this.addEvent(_w.visualViewport, '
|
|
825
|
+
this.addEvent(_w.visualViewport, 'resize', OnChange_viewport.bind(this), false);
|
|
826
|
+
this.addEvent(_w.visualViewport, 'scroll', OnChange_viewport.bind(this), false);
|
|
826
827
|
}
|
|
827
828
|
},
|
|
828
829
|
|
|
@@ -1177,7 +1178,7 @@ EventManager.prototype = {
|
|
|
1177
1178
|
if (info && !dom.utils.hasClass(info.container, 'se-component-selected')) {
|
|
1178
1179
|
this.ui._offCurrentController();
|
|
1179
1180
|
_DragHandle.set('__overInfo', ON_OVER_COMPONENT);
|
|
1180
|
-
this.component.select(info.target, info.pluginName
|
|
1181
|
+
this.component.select(info.target, info.pluginName);
|
|
1181
1182
|
}
|
|
1182
1183
|
} else if (_DragHandle.get('__overInfo') !== null && !dom.utils.hasClass(target, 'se-drag-handle')) {
|
|
1183
1184
|
this.component.__deselect();
|
|
@@ -1211,6 +1212,16 @@ EventManager.prototype = {
|
|
|
1211
1212
|
this.editor.frameContext.get('wysiwyg').focus();
|
|
1212
1213
|
},
|
|
1213
1214
|
|
|
1215
|
+
/**
|
|
1216
|
+
* @private
|
|
1217
|
+
* @description Scrolls the editor view to the caret position after pressing Enter. (Ignored on mobile devices)
|
|
1218
|
+
* @this {EventManagerThis}
|
|
1219
|
+
* @param {*} range Range object
|
|
1220
|
+
*/
|
|
1221
|
+
__enterScrollTo(range) {
|
|
1222
|
+
if (!env.isMobile) this.editor.selection.scrollTo(range);
|
|
1223
|
+
},
|
|
1224
|
+
|
|
1214
1225
|
constructor: EventManager
|
|
1215
1226
|
};
|
|
1216
1227
|
|
|
@@ -1419,9 +1430,10 @@ function OnScroll_window() {
|
|
|
1419
1430
|
/**
|
|
1420
1431
|
* @this {EventManagerThis}
|
|
1421
1432
|
*/
|
|
1422
|
-
function
|
|
1433
|
+
function OnChange_viewport() {
|
|
1423
1434
|
if (this.options.get('toolbar_sticky') > -1) {
|
|
1424
1435
|
this.toolbar._resetSticky();
|
|
1436
|
+
this.editor.menu._restoreMenuPosition();
|
|
1425
1437
|
}
|
|
1426
1438
|
}
|
|
1427
1439
|
|