remons-markdown-editor 1.0.0-beta.9 → 2.0.0-beta.0
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/MarkdownEditor.d.ts +24 -5
- package/dist/components/Dialog/EditDialog.d.ts +4 -3
- package/dist/components/Editor/codemirrorExtensions.d.ts +4 -4
- package/dist/components/Editor/containerWidget.d.ts +13 -8
- package/dist/components/Editor/index.d.ts +3 -2
- package/dist/components/Icon/config.d.ts +9 -0
- package/dist/components/Icon/index.d.ts +2 -0
- package/dist/components/Preview/index.d.ts +6 -5
- package/dist/components/Toolbar/buttons.d.ts +40 -3
- package/dist/components/Toolbar/config.d.ts +9 -2
- package/dist/components/Toolbar/hooks/useToolbar.d.ts +3 -1
- package/dist/components/Toolbar/index.d.ts +6 -3
- package/dist/components/Toolbar/renderers/TablePicker/TableDropdown.d.ts +1 -2
- package/dist/components/Toolbar/renderers/TablePicker/index.d.ts +1 -1
- package/dist/components/Toolbar/renderers/ToolbarItemRenderer.d.ts +1 -1
- package/dist/hooks/useRegisterToolbar.d.ts +3 -0
- package/dist/hooks/useScrollSync.d.ts +7 -3
- package/dist/index.cjs +2326 -438
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +86 -63
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2348 -441
- package/dist/index.js.map +1 -1
- package/dist/registry/componentRegistry.d.ts +17 -4
- package/dist/types/index.d.ts +18 -9
- package/dist/utils/parseContainer.d.ts +20 -6
- package/dist/utils/writeContainer.d.ts +10 -7
- package/package.json +12 -17
- package/readme.md +29 -26
- package/dist/App.d.ts +0 -2
- package/dist/main.d.ts +0 -0
package/dist/index.css
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
padding: 4px;
|
|
3
3
|
display: block;
|
|
4
4
|
min-width: 200px;
|
|
5
|
-
background:
|
|
6
|
-
border: 1px solid
|
|
5
|
+
background: var(--remons-md-editor-bg-picker);
|
|
6
|
+
border: 1px solid var(--remons-md-editor-color-border-light);
|
|
7
7
|
border-radius: 6px;
|
|
8
8
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
9
9
|
}
|
|
@@ -16,19 +16,19 @@
|
|
|
16
16
|
.index-module__grid___tCZ-r .index-module__cell___vTDQz {
|
|
17
17
|
width: 24px;
|
|
18
18
|
height: 24px;
|
|
19
|
-
border: 1px solid
|
|
19
|
+
border: 1px solid var(--remons-md-editor-color-border-light);
|
|
20
20
|
border-radius: 2px;
|
|
21
21
|
background: transparent;
|
|
22
22
|
cursor: pointer;
|
|
23
23
|
transition: all 0.1s ease;
|
|
24
24
|
}
|
|
25
25
|
.index-module__grid___tCZ-r .index-module__cell___vTDQz.index-module__cellActive___0EYvU {
|
|
26
|
-
border-color:
|
|
27
|
-
background:
|
|
26
|
+
border-color: var(--remons-md-editor-color-cell-active);
|
|
27
|
+
background: var(--remons-md-editor-bg-cell-active);
|
|
28
28
|
}
|
|
29
29
|
.index-module__hint___dTObk {
|
|
30
30
|
padding: 12px 16px;
|
|
31
|
-
color:
|
|
31
|
+
color: var(--remons-md-editor-color-hint);
|
|
32
32
|
font-size: 12px;
|
|
33
33
|
text-align: center;
|
|
34
34
|
cursor: pointer;
|
|
@@ -36,48 +36,62 @@
|
|
|
36
36
|
.index-module__label___2CmK1 {
|
|
37
37
|
margin-top: 8px;
|
|
38
38
|
font-size: 13px;
|
|
39
|
-
color:
|
|
39
|
+
color: var(--remons-md-editor-color-label);
|
|
40
40
|
font-weight: 500;
|
|
41
41
|
min-height: 20px;
|
|
42
42
|
text-align: center;
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
--
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
--
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
--
|
|
74
|
-
|
|
75
|
-
--
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
44
|
+
/* ===== CSS 自定义属性(主题变量) ===== */
|
|
45
|
+
/* 浅色主题(默认) */
|
|
46
|
+
:root,
|
|
47
|
+
[data-theme="light"] {
|
|
48
|
+
/* 背景色 */
|
|
49
|
+
--remons-md-editor-bg-primary: #f3f3f3;
|
|
50
|
+
--remons-md-editor-bg-white: rgba(255, 255, 255, 0.6);
|
|
51
|
+
--remons-md-editor-bg-hover: #e1e4e8;
|
|
52
|
+
--remons-md-editor-bg-active: #d0d7de;
|
|
53
|
+
--remons-md-editor-bg-fullscreen: #fff;
|
|
54
|
+
/* 文字颜色 */
|
|
55
|
+
--remons-md-editor-color-text: #24292f;
|
|
56
|
+
--remons-md-editor-color-text-hover: #0969da;
|
|
57
|
+
/* 边框 */
|
|
58
|
+
--remons-md-editor-color-border: rgba(255, 255, 255, 0.8);
|
|
59
|
+
--remons-md-editor-color-border-light: #d0d7de;
|
|
60
|
+
/* 焦点 */
|
|
61
|
+
--remons-md-editor-color-focus: #0969da;
|
|
62
|
+
--remons-md-editor-color-focus-shadow: rgba(9, 105, 218, 0.1);
|
|
63
|
+
/* 工具选择器 */
|
|
64
|
+
--remons-md-editor-bg-picker: #fff;
|
|
65
|
+
--remons-md-editor-bg-cell-active: #ddf4ff;
|
|
66
|
+
--remons-md-editor-color-cell-active: #91caff;
|
|
67
|
+
--remons-md-editor-color-hint: #999;
|
|
68
|
+
--remons-md-editor-color-label: #666;
|
|
69
|
+
}
|
|
70
|
+
/* ===== 深色主题 ===== */
|
|
71
|
+
[data-theme="dark"] {
|
|
72
|
+
/* 背景色 */
|
|
73
|
+
--remons-md-editor-bg-primary: #1a1d23;
|
|
74
|
+
--remons-md-editor-bg-white: rgba(46, 51, 80, 0.8);
|
|
75
|
+
--remons-md-editor-bg-hover: #4a5163;
|
|
76
|
+
--remons-md-editor-bg-active: #5a6278;
|
|
77
|
+
--remons-md-editor-bg-fullscreen: #1a1d23;
|
|
78
|
+
/* 文字颜色 */
|
|
79
|
+
--remons-md-editor-color-text: #c9d1d9;
|
|
80
|
+
--remons-md-editor-color-text-hover: #58a6ff;
|
|
81
|
+
/* 边框 */
|
|
82
|
+
--remons-md-editor-color-border: rgba(255, 255, 255, 0.1);
|
|
83
|
+
--remons-md-editor-color-border-light: #3a3f4b;
|
|
84
|
+
/* 焦点 */
|
|
85
|
+
--remons-md-editor-color-focus: #58a6ff;
|
|
86
|
+
--remons-md-editor-color-focus-shadow: rgba(88, 166, 255, 0.15);
|
|
87
|
+
/* 工具选择器 */
|
|
88
|
+
--remons-md-editor-bg-picker: #2e3350;
|
|
89
|
+
--remons-md-editor-bg-cell-active: #1a3a5c;
|
|
90
|
+
--remons-md-editor-color-cell-active: #58a6ff;
|
|
91
|
+
--remons-md-editor-color-hint: #8b949e;
|
|
92
|
+
--remons-md-editor-color-label: #8b949e;
|
|
93
|
+
}
|
|
94
|
+
@font-face {
|
|
81
95
|
font-family: 'Inter';
|
|
82
96
|
font-style: normal;
|
|
83
97
|
font-weight: 400;
|
|
@@ -110,34 +124,41 @@ body {
|
|
|
110
124
|
font-style: normal;
|
|
111
125
|
font-weight: 400;
|
|
112
126
|
font-display: swap;
|
|
113
|
-
src: url(https://fonts.gstatic.com/s/notosanssc/
|
|
127
|
+
src: url(https://fonts.gstatic.com/s/notosanssc/v41/k3kCo84MPvpLmixcA63oeAL7Iqp5IZJF9bmaG9_FnYw.ttf) format('truetype');
|
|
114
128
|
}
|
|
115
129
|
@font-face {
|
|
116
130
|
font-family: 'Noto Sans SC';
|
|
117
131
|
font-style: normal;
|
|
118
132
|
font-weight: 500;
|
|
119
133
|
font-display: swap;
|
|
120
|
-
src: url(https://fonts.gstatic.com/s/notosanssc/
|
|
134
|
+
src: url(https://fonts.gstatic.com/s/notosanssc/v41/k3kCo84MPvpLmixcA63oeAL7Iqp5IZJF9bmaG-3FnYw.ttf) format('truetype');
|
|
121
135
|
}
|
|
122
136
|
@font-face {
|
|
123
137
|
font-family: 'Noto Sans SC';
|
|
124
138
|
font-style: normal;
|
|
125
139
|
font-weight: 600;
|
|
126
140
|
font-display: swap;
|
|
127
|
-
src: url(https://fonts.gstatic.com/s/notosanssc/
|
|
141
|
+
src: url(https://fonts.gstatic.com/s/notosanssc/v41/k3kCo84MPvpLmixcA63oeAL7Iqp5IZJF9bmaGwHCnYw.ttf) format('truetype');
|
|
128
142
|
}
|
|
129
143
|
@font-face {
|
|
130
144
|
font-family: 'Noto Sans SC';
|
|
131
145
|
font-style: normal;
|
|
132
146
|
font-weight: 700;
|
|
133
147
|
font-display: swap;
|
|
134
|
-
src: url(https://fonts.gstatic.com/s/notosanssc/
|
|
148
|
+
src: url(https://fonts.gstatic.com/s/notosanssc/v41/k3kCo84MPvpLmixcA63oeAL7Iqp5IZJF9bmaGzjCnYw.ttf) format('truetype');
|
|
135
149
|
}
|
|
136
150
|
.markdown-editor-app {
|
|
137
151
|
height: 100%;
|
|
138
152
|
display: flex;
|
|
139
153
|
flex-direction: column;
|
|
140
154
|
border: 1px solid var(--markdown-editor-color-border);
|
|
155
|
+
border-radius: 12px;
|
|
156
|
+
background: var(--remons-md-editor-bg-primary);
|
|
157
|
+
}
|
|
158
|
+
.markdown-editor-app .ant-btn:hover {
|
|
159
|
+
border: none !important;
|
|
160
|
+
background-color: var(--remons-md-editor-bg-hover) !important;
|
|
161
|
+
color: var(--remons-md-editor-color-text-hover) !important;
|
|
141
162
|
}
|
|
142
163
|
.markdown-editor-app.fullscreen {
|
|
143
164
|
position: fixed;
|
|
@@ -146,7 +167,7 @@ body {
|
|
|
146
167
|
right: 0;
|
|
147
168
|
bottom: 0;
|
|
148
169
|
z-index: 9999;
|
|
149
|
-
background:
|
|
170
|
+
background: var(--remons-md-editor-bg-fullscreen);
|
|
150
171
|
width: 100vw;
|
|
151
172
|
height: 100vh;
|
|
152
173
|
}
|
|
@@ -155,8 +176,8 @@ body {
|
|
|
155
176
|
display: flex;
|
|
156
177
|
align-items: center;
|
|
157
178
|
padding: 4px 8px;
|
|
158
|
-
background: var(--
|
|
159
|
-
border-bottom: 1px solid
|
|
179
|
+
background: var(--remons-md-editor-bg-white);
|
|
180
|
+
border-bottom: 1px solid var(--remons-md-editor-color-border-light);
|
|
160
181
|
gap: 4px;
|
|
161
182
|
overflow-x: auto;
|
|
162
183
|
}
|
|
@@ -178,7 +199,7 @@ body {
|
|
|
178
199
|
cursor: pointer;
|
|
179
200
|
font-size: 16px;
|
|
180
201
|
font-weight: 500;
|
|
181
|
-
color:
|
|
202
|
+
color: var(--remons-md-editor-color-text);
|
|
182
203
|
transition: background-color 0.15s, color 0.15s;
|
|
183
204
|
white-space: nowrap;
|
|
184
205
|
}
|
|
@@ -187,11 +208,11 @@ body {
|
|
|
187
208
|
height: 16px;
|
|
188
209
|
}
|
|
189
210
|
.toolbar-button:hover {
|
|
190
|
-
background:
|
|
191
|
-
color:
|
|
211
|
+
background: var(--remons-md-editor-bg-hover);
|
|
212
|
+
color: var(--remons-md-editor-color-text-hover);
|
|
192
213
|
}
|
|
193
214
|
.toolbar-button:active {
|
|
194
|
-
background:
|
|
215
|
+
background: var(--remons-md-editor-bg-active);
|
|
195
216
|
}
|
|
196
217
|
.toolbar-button.ant-btn {
|
|
197
218
|
min-width: 32px;
|
|
@@ -201,8 +222,8 @@ body {
|
|
|
201
222
|
box-shadow: none !important;
|
|
202
223
|
}
|
|
203
224
|
.toolbar-button.ant-btn:hover {
|
|
204
|
-
background:
|
|
205
|
-
color:
|
|
225
|
+
background: var(--remons-md-editor-bg-hover);
|
|
226
|
+
color: var(--remons-md-editor-color-text-hover);
|
|
206
227
|
border-color: transparent !important;
|
|
207
228
|
box-shadow: none !important;
|
|
208
229
|
}
|
|
@@ -212,11 +233,13 @@ body {
|
|
|
212
233
|
}
|
|
213
234
|
:where(.css-dev-only-do-not-override-u6izyw).ant-btn:not(:disabled):not(.ant-btn-disabled):hover {
|
|
214
235
|
border: none !important;
|
|
236
|
+
background-color: var(--remons-md-editor-bg-hover) !important;
|
|
237
|
+
color: var(--remons-md-editor-color-text-hover) !important;
|
|
215
238
|
}
|
|
216
239
|
.toolbar-separator {
|
|
217
240
|
width: 1px;
|
|
218
241
|
height: 24px;
|
|
219
|
-
background:
|
|
242
|
+
background: var(--remons-md-editor-color-border-light);
|
|
220
243
|
margin: 0 4px;
|
|
221
244
|
}
|
|
222
245
|
.split-panels {
|
|
@@ -247,7 +270,7 @@ body {
|
|
|
247
270
|
.md-container {
|
|
248
271
|
margin: 16px 0;
|
|
249
272
|
border-radius: 6px;
|
|
250
|
-
border: 1px solid
|
|
273
|
+
border: 1px solid var(--remons-md-editor-color-border-light);
|
|
251
274
|
overflow: hidden;
|
|
252
275
|
}
|
|
253
276
|
/* 编辑弹窗样式 */
|
|
@@ -262,20 +285,20 @@ body {
|
|
|
262
285
|
margin-bottom: 6px;
|
|
263
286
|
font-size: 14px;
|
|
264
287
|
font-weight: 500;
|
|
265
|
-
color:
|
|
288
|
+
color: var(--remons-md-editor-color-text);
|
|
266
289
|
}
|
|
267
290
|
.edit-dialog-input {
|
|
268
291
|
width: 100%;
|
|
269
292
|
padding: 6px 10px;
|
|
270
293
|
font-size: 14px;
|
|
271
|
-
border: 1px solid
|
|
294
|
+
border: 1px solid var(--remons-md-editor-color-border-light);
|
|
272
295
|
border-radius: 6px;
|
|
273
296
|
outline: none;
|
|
274
297
|
transition: border-color 0.15s;
|
|
275
298
|
}
|
|
276
299
|
.edit-dialog-input:focus {
|
|
277
|
-
border-color:
|
|
278
|
-
box-shadow: 0 0 0 3px
|
|
300
|
+
border-color: var(--remons-md-editor-color-focus);
|
|
301
|
+
box-shadow: 0 0 0 3px var(--remons-md-editor-color-focus-shadow);
|
|
279
302
|
}
|
|
280
303
|
.edit-dialog-textarea {
|
|
281
304
|
resize: vertical;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { default as MarkdownEditor } from './MarkdownEditor';
|
|
2
2
|
export type { MarkdownEditorProps, MarkdownEditorRef } from './MarkdownEditor';
|
|
3
3
|
export { useRegisterToolbar } from './hooks/useRegisterToolbar';
|
|
4
|
-
export
|
|
4
|
+
export { setIconfontScriptUrl, getIconfontScriptUrl } from './components/Icon/config';
|
|
5
|
+
export type { ComponentSchema, DialogField, ToolbarButtonConfig, ImageUploadConfig, NotifyFn, } from './types';
|
|
5
6
|
export type { PreviewOptions } from './components/Preview';
|
|
7
|
+
export type { ContainerProps, ContainerBlock } from './utils/parseContainer';
|