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/index.css CHANGED
@@ -2,8 +2,8 @@
2
2
  padding: 4px;
3
3
  display: block;
4
4
  min-width: 200px;
5
- background: #fff;
6
- border: 1px solid #e5e7eb;
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 #e8e8e8;
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: #91caff;
27
- background: #ddf4ff;
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: #999;
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: #666;
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
- html,
45
- body {
46
- margin: 0;
47
- padding: 0;
48
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
49
- 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
50
- sans-serif;
51
- -webkit-font-smoothing: antialiased;
52
- -moz-osx-font-smoothing: grayscale;
53
- }
54
-
55
- #markdown-editor {
56
- height: 100vh;
57
- width: 100vw;
58
- overflow: hidden;
59
- }
60
-
61
- /* ===== CSS 自定义属性(主题变量) ===== */
62
- /* 浅色主题(默认) */
63
- :root,
64
- [data-theme="light"] {
65
- --markdown-editor-color-bg-white: rgba(255, 255, 255, 0.6);
66
-
67
- /* ── 边框(毛玻璃) ── */
68
- --markdown-editor-color-border: rgba(255, 255, 255, 0.8);
69
- }
70
-
71
- /* ===== 深色主题 ===== */
72
- [data-theme="dark"] {
73
- --markdown-editor-color-bg-white: rgba(46, 51, 80, 0.8);
74
-
75
- --markdown-editor-color-border: rgba(255, 255, 255, 0.1);
76
- }
77
-
78
- .ant-anchor-link-title {
79
- white-space: inherit !important;
80
- }@font-face {
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/v40/k3kCo84MPvpLmixcA63oeAL7Iqp5IZJF9bmaG9_FnYw.ttf) format('truetype');
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/v40/k3kCo84MPvpLmixcA63oeAL7Iqp5IZJF9bmaG-3FnYw.ttf) format('truetype');
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/v40/k3kCo84MPvpLmixcA63oeAL7Iqp5IZJF9bmaGwHCnYw.ttf) format('truetype');
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/v40/k3kCo84MPvpLmixcA63oeAL7Iqp5IZJF9bmaGzjCnYw.ttf) format('truetype');
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: #fff;
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(--markdown-editor-color-bg-white);
159
- border-bottom: 1px solid #d0d7de;
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: #24292f;
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: #e1e4e8;
191
- color: #0969da;
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: #d0d7de;
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: #e1e4e8;
205
- color: #0969da;
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: #d0d7de;
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 #d0d7de;
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: #24292f;
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 #d0d7de;
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: #0969da;
278
- box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
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 type { ComponentSchema, DialogField, ToolbarButtonConfig, ImageUploadConfig, } from './types';
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';