@ebl-vue/editor-full 1.0.12 → 1.1.1
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/index.d.ts +6 -0
- package/dist/index.mjs +860 -445
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
- package/src/components/Editor/Editor.vue +47 -12
- package/src/i18n/zh-cn.ts +6 -1
- package/src/icons/index.ts +15 -0
- package/src/installer.ts +4 -3
- package/src/plugins/alert/index.ts +19 -27
- package/src/plugins/block-alignment/index.ts +4 -3
- package/src/plugins/code/index.ts +3 -2
- package/src/plugins/color-picker/index.ts +3 -11
- package/src/plugins/delimiter/index.ts +5 -6
- package/src/plugins/header/H1.ts +1 -1
- package/src/plugins/header/H2.ts +1 -1
- package/src/plugins/header/H3.ts +1 -1
- package/src/plugins/header/H4.ts +1 -2
- package/src/plugins/header/H5.ts +1 -3
- package/src/plugins/header/H6.ts +1 -3
- package/src/plugins/imageResizeCrop/ImageTune.ts +900 -0
- package/src/plugins/imageResizeCrop/index.css +234 -0
- package/src/plugins/imageResizeCrop/index.ts +5 -0
- package/src/plugins/imageResizeCrop/types.d.ts +23 -0
- package/src/plugins/imageTool/index.css +145 -0
- package/src/plugins/imageTool/index.ts +538 -0
- package/src/plugins/imageTool/types/codexteam__ajax.d.ts +89 -0
- package/src/plugins/imageTool/types/types.ts +236 -0
- package/src/plugins/imageTool/ui.ts +313 -0
- package/src/plugins/imageTool/uploader.ts +268 -0
- package/src/plugins/imageTool/utils/dom.ts +24 -0
- package/src/plugins/imageTool/utils/index.ts +73 -0
- package/src/plugins/imageTool/utils/isPromise.ts +10 -0
- package/src/plugins/indent/index.ts +5 -7
- package/src/plugins/inline-code/index.ts +2 -5
- package/src/plugins/list/ListRenderer/ChecklistRenderer.ts +1 -4
- package/src/plugins/list/index.ts +20 -37
- package/src/plugins/list/types/OlCounterType.ts +1 -1
- package/src/plugins/marker/index.ts +28 -16
- package/src/plugins/paragraph/index.ts +3 -2
- package/src/plugins/quote/index.ts +1 -4
- package/src/plugins/table/plugin.ts +1 -1
- package/src/plugins/table/table.ts +40 -38
- package/src/plugins/table/toolbox.ts +5 -4
- package/src/plugins/table/utils/dom.ts +15 -14
- package/src/plugins/table/utils/popover.ts +28 -15
- package/src/plugins/underline/index.ts +2 -4
- package/src/plugins/undo/index.ts +48 -33
- package/src/plugins/undo/observer.ts +3 -3
- package/src/utils/AxiosService.ts +87 -0
- package/types/index.d.ts +6 -0
- package/vite.config.ts +3 -1
- package/src/plugins/list/styles/icons/index.ts +0 -10
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
.cdx-image-tool-tune--floatLeft .cdx-block,
|
|
2
|
+
.cdx-image-tool-tune--center .cdx-block,
|
|
3
|
+
.cdx-image-tool-tune--floatRight .cdx-block,
|
|
4
|
+
.cdx-image-tool-tune--floatLeft .image-tool__image,
|
|
5
|
+
.cdx-image-tool-tune--center .image-tool__image,
|
|
6
|
+
.cdx-image-tool-tune--floatRight .image-tool__image,
|
|
7
|
+
.cdx-image-tool-tune--floatLeft .cdx-block,
|
|
8
|
+
.cdx-image-tool-tune--center .cdx-block,
|
|
9
|
+
.cdx-image-tool-tune--floatRight .cdx-block {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
align-items: center;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:root {
|
|
16
|
+
--primary: #2492F5;
|
|
17
|
+
--primary-content: #E9F4FE;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.cdx-settings-button--active {
|
|
21
|
+
background: var(--primary-content);
|
|
22
|
+
color: var(--primary);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.cdx-settings-button:hover {
|
|
26
|
+
background: var(--primary-content);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.cdx-image-tool-tune--center {
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@media all and (min-width: 470px) {
|
|
35
|
+
.codex-editor:not(.read-only)
|
|
36
|
+
.cdx-image-tool-tune--floatLeft.ce-block__content,
|
|
37
|
+
.codex-editor:not(.read-only)
|
|
38
|
+
.cdx-image-tool-tune--floatRight.ce-block__content {
|
|
39
|
+
min-height: 20px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.cdx-image-tool-tune--floatLeft.ce-block__content .image-tool__image,
|
|
43
|
+
.cdx-image-tool-tune--floatRight.ce-block__content .image-tool__image {
|
|
44
|
+
margin-top: 40px;
|
|
45
|
+
}
|
|
46
|
+
.cdx-image-tool-tune--floatLeft.ce-block__content .image-tool__image {
|
|
47
|
+
margin-left: 20px;
|
|
48
|
+
}
|
|
49
|
+
.cdx-image-tool-tune--floatRight.ce-block__content .image-tool__image {
|
|
50
|
+
margin-right: 20px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.cdx-image-tool-tune--floatLeft.ce-block__content .cdx-input,
|
|
54
|
+
.cdx-image-tool-tune--floatRight.ce-block__content .cdx-input {
|
|
55
|
+
width: calc(100% - 20px);
|
|
56
|
+
}
|
|
57
|
+
.cdx-image-tool-tune--floatLeft.ce-block__content .cdx-input {
|
|
58
|
+
margin-left: 20px;
|
|
59
|
+
}
|
|
60
|
+
.cdx-image-tool-tune--floatRight.ce-block__content .cdx-input {
|
|
61
|
+
margin-right: 20px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.cdx-image-tool-tune--floatLeft .cdx-block {
|
|
65
|
+
float: left;
|
|
66
|
+
margin-right: 10px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.cdx-image-tool-tune--floatRight .cdx-block {
|
|
70
|
+
float: right;
|
|
71
|
+
margin-left: 10px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.cdx-image-tool-tune--sizeSmall .cdx-block {
|
|
75
|
+
max-width: 25% !important;
|
|
76
|
+
}
|
|
77
|
+
.cdx-image-tool-tune--sizeMiddle .cdx-block {
|
|
78
|
+
max-width: 50% !important;
|
|
79
|
+
}
|
|
80
|
+
.cdx-image-tool-tune--sizeLarge .cdx-block {
|
|
81
|
+
max-width: 75% !important;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.cdx-image-tool-tune--sizeLarge img {
|
|
86
|
+
object-fit: cover;
|
|
87
|
+
max-width: 100%;
|
|
88
|
+
}
|
|
89
|
+
.cdx-image-tool-tune--sizeSmall img {
|
|
90
|
+
object-fit: cover;
|
|
91
|
+
max-width: 100%;
|
|
92
|
+
}
|
|
93
|
+
.cdx-image-tool-tune--sizeMiddle img {
|
|
94
|
+
object-fit: cover;
|
|
95
|
+
max-width: 100%;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.codex-editor.read-only .cdx-input.image-tool__caption:empty,
|
|
99
|
+
.read-only > .codex-editor .cdx-input.image-tool__caption:empty {
|
|
100
|
+
display: none;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.cdx-image-tool-tune--resize .cdx-block {
|
|
104
|
+
position: relative;
|
|
105
|
+
overflow: visible;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.cdx-image-tool-tune--resize .cdx-block .resizable {
|
|
109
|
+
display: none;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.cdx-image-tool-tune--resize .image-tool__image-picture {
|
|
113
|
+
width: 100% !important;
|
|
114
|
+
}
|
|
115
|
+
.cdx-image-tool-tune--resize .cdx-block:hover .resizable {
|
|
116
|
+
display: block;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.cdx-image-tool-tune--resize .cdx-block .resizable .resizers .resizer {
|
|
120
|
+
width: 12px;
|
|
121
|
+
height: 12px;
|
|
122
|
+
border-radius: 50%;
|
|
123
|
+
background: var(--primary-content);
|
|
124
|
+
border: 3px solid var(--primary);
|
|
125
|
+
position: absolute;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.cdx-image-tool-tune--resize .cdx-block .resizable .resizers .resizer.top-left {
|
|
129
|
+
left: -5px;
|
|
130
|
+
top: -5px;
|
|
131
|
+
cursor: nwse-resize;
|
|
132
|
+
/*resizer cursor*/
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.cdx-image-tool-tune--resize
|
|
136
|
+
.cdx-block
|
|
137
|
+
.resizable
|
|
138
|
+
.resizers
|
|
139
|
+
.resizer.top-right {
|
|
140
|
+
right: -5px;
|
|
141
|
+
top: -5px;
|
|
142
|
+
cursor: nesw-resize;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.cdx-image-tool-tune--resize
|
|
146
|
+
.cdx-block
|
|
147
|
+
.resizable
|
|
148
|
+
.resizers
|
|
149
|
+
.resizer.bottom-left {
|
|
150
|
+
left: -5px;
|
|
151
|
+
bottom: -5px;
|
|
152
|
+
cursor: nesw-resize;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.cdx-image-tool-tune--resize
|
|
156
|
+
.cdx-block
|
|
157
|
+
.resizable
|
|
158
|
+
.resizers
|
|
159
|
+
.resizer.bottom-right {
|
|
160
|
+
right: -5px;
|
|
161
|
+
bottom: -5px;
|
|
162
|
+
cursor: nwse-resize;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.cdx-image-tool-tune--crop:hover,
|
|
166
|
+
.cdx-image-tool-tune--crop.isCropping,
|
|
167
|
+
.cdx-image-tool-tune--resize:hover {
|
|
168
|
+
z-index: 2;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.cdx-image-tool-tune--crop .image-tool__image {
|
|
172
|
+
position: relative;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.cdx-image-tool-tune--crop .isCropping .image-tool__image {
|
|
176
|
+
min-height: 600px;
|
|
177
|
+
min-width: 100%;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.cdx-image-tool-tune--crop .image-tool__image .crop-btn,
|
|
181
|
+
.cdx-image-tool-tune--crop .image-tool__image .crop-save {
|
|
182
|
+
position: absolute;
|
|
183
|
+
top: 0;
|
|
184
|
+
left: 0;
|
|
185
|
+
padding: 7px;
|
|
186
|
+
background: var(--primary);
|
|
187
|
+
color: var(--primary-content);
|
|
188
|
+
text-align: center;
|
|
189
|
+
line-height: 20px;
|
|
190
|
+
cursor: pointer;
|
|
191
|
+
display: none;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.cdx-image-tool-tune--crop .image-tool__image:hover .crop-btn,
|
|
195
|
+
.cdx-image-tool-tune--crop .image-tool__image:hover .crop-save {
|
|
196
|
+
display: block;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.cdx-image-tool-tune--crop .image-tool__image img.isCropped {
|
|
200
|
+
position: absolute;
|
|
201
|
+
min-width: unset;
|
|
202
|
+
max-width: unset;
|
|
203
|
+
min-height: unset;
|
|
204
|
+
max-height: unset;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.cdx-image-tool-tune--crop .cdx-block.image-tool.isCropping {
|
|
208
|
+
min-width: unset !important;
|
|
209
|
+
max-width: unset !important;
|
|
210
|
+
min-height: unset !important;
|
|
211
|
+
max-height: unset !important;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.ce-block {
|
|
215
|
+
margin: 0.8em 0;
|
|
216
|
+
}
|
|
217
|
+
.ce-toolbar {
|
|
218
|
+
z-index: 3;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.image-tool__caption {
|
|
222
|
+
background-color: white;
|
|
223
|
+
}
|
|
224
|
+
.image-tool {
|
|
225
|
+
position: relative;
|
|
226
|
+
z-index: 1;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.cdx-image-tool-tune {
|
|
230
|
+
display: flex;
|
|
231
|
+
justify-content: flex-start;
|
|
232
|
+
gap: 4px;
|
|
233
|
+
width: 100%;
|
|
234
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare module '*.css' {
|
|
2
|
+
const content: unknown;
|
|
3
|
+
export default content;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
declare module '@editorjs/editorjs' {
|
|
7
|
+
export interface API {
|
|
8
|
+
i18n: {
|
|
9
|
+
t(key: string): string;
|
|
10
|
+
};
|
|
11
|
+
tooltip: {
|
|
12
|
+
onHover(element: HTMLElement, text: string): void;
|
|
13
|
+
};
|
|
14
|
+
readOnly: {
|
|
15
|
+
isEnabled: boolean;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface BlockAPI {
|
|
20
|
+
holder: HTMLElement;
|
|
21
|
+
dispatchChange(): void;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
.image-tool {
|
|
2
|
+
--bg-color: #cdd1e0;
|
|
3
|
+
--front-color: #388ae5;
|
|
4
|
+
--border-color: #e8e8eb
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
.image-tool__image {
|
|
9
|
+
border-radius: 3px;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
margin-bottom: 10px;
|
|
12
|
+
padding-bottom: 0
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.image-tool__image-picture {
|
|
16
|
+
max-width: 100%;
|
|
17
|
+
vertical-align: bottom;
|
|
18
|
+
display: inline-block
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.image-tool__image-preloader {
|
|
22
|
+
width: 50px;
|
|
23
|
+
height: 50px;
|
|
24
|
+
border-radius: 50%;
|
|
25
|
+
background-size: cover;
|
|
26
|
+
margin: auto;
|
|
27
|
+
position: relative;
|
|
28
|
+
background-color: var(--bg-color);
|
|
29
|
+
background-position: center center
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.image-tool__image-preloader:after {
|
|
33
|
+
content: "";
|
|
34
|
+
position: absolute;
|
|
35
|
+
z-index: 3;
|
|
36
|
+
width: 60px;
|
|
37
|
+
height: 60px;
|
|
38
|
+
border-radius: 50%;
|
|
39
|
+
border: 2px solid var(--bg-color);
|
|
40
|
+
border-top-color: var(--front-color);
|
|
41
|
+
left: 50%;
|
|
42
|
+
top: 50%;
|
|
43
|
+
margin-top: -30px;
|
|
44
|
+
margin-left: -30px;
|
|
45
|
+
animation: image-preloader-spin 2s infinite linear;
|
|
46
|
+
box-sizing: border-box
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.image-tool__caption {
|
|
50
|
+
visibility: hidden;
|
|
51
|
+
position: absolute;
|
|
52
|
+
bottom: 0;
|
|
53
|
+
left: 0;
|
|
54
|
+
margin-bottom: 10px
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.image-tool__caption[contentEditable=true][data-placeholder]:before {
|
|
58
|
+
position: absolute !important;
|
|
59
|
+
content: attr(data-placeholder);
|
|
60
|
+
color: #707684;
|
|
61
|
+
font-weight: 400;
|
|
62
|
+
display: none
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.image-tool__caption[contentEditable=true][data-placeholder]:empty:before {
|
|
66
|
+
display: block
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.image-tool__caption[contentEditable=true][data-placeholder]:empty:focus:before {
|
|
70
|
+
display: none
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.image-tool--empty .image-tool__image,
|
|
74
|
+
.image-tool--empty .image-tool__image-preloader {
|
|
75
|
+
display: none
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.image-tool--empty .image-tool__caption,
|
|
79
|
+
.image-tool--uploading .image-tool__caption {
|
|
80
|
+
visibility: hidden !important
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.image-tool .cdx-button {
|
|
84
|
+
display: none;
|
|
85
|
+
align-items: center;
|
|
86
|
+
justify-content: center
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.image-tool .cdx-button svg {
|
|
90
|
+
height: auto;
|
|
91
|
+
margin: 0 6px 0 0
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.image-tool--filled .cdx-button,
|
|
95
|
+
.image-tool--filled .image-tool__image-preloader {
|
|
96
|
+
display: none
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.image-tool--uploading .image-tool__image {
|
|
100
|
+
min-height: 200px;
|
|
101
|
+
display: flex;
|
|
102
|
+
border: 1px solid var(--border-color);
|
|
103
|
+
background-color: #fff
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.image-tool--uploading .image-tool__image-picture,
|
|
107
|
+
.image-tool--uploading .cdx-button {
|
|
108
|
+
display: none
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.image-tool--withBorder .image-tool__image {
|
|
112
|
+
border: 1px solid var(--border-color)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.image-tool--withBackground .image-tool__image {
|
|
116
|
+
padding: 15px;
|
|
117
|
+
background: var(--bg-color)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.image-tool--withBackground .image-tool__image-picture {
|
|
121
|
+
max-width: 60%;
|
|
122
|
+
margin: 0 auto
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.image-tool--stretched .image-tool__image-picture {
|
|
126
|
+
width: 100%
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.image-tool--caption .image-tool__caption {
|
|
130
|
+
visibility: visible
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.image-tool--caption {
|
|
134
|
+
padding-bottom: 50px
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@keyframes image-preloader-spin {
|
|
138
|
+
0% {
|
|
139
|
+
transform: rotate(0)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
to {
|
|
143
|
+
transform: rotate(360deg)
|
|
144
|
+
}
|
|
145
|
+
}
|