@dxpos/markdown 0.0.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.
Files changed (93) hide show
  1. package/README.md +77 -0
  2. package/dist/editor/ColorMenu.d.ts +18 -0
  3. package/dist/editor/ColorMenu.d.ts.map +1 -0
  4. package/dist/editor/ColorMenu.js +90 -0
  5. package/dist/editor/SlashMenu.d.ts +24 -0
  6. package/dist/editor/SlashMenu.d.ts.map +1 -0
  7. package/dist/editor/SlashMenu.js +179 -0
  8. package/dist/editor/TextStyleMenu.d.ts +45 -0
  9. package/dist/editor/TextStyleMenu.d.ts.map +1 -0
  10. package/dist/editor/TextStyleMenu.js +65 -0
  11. package/dist/editor/VideoEmbed.d.ts +15 -0
  12. package/dist/editor/VideoEmbed.d.ts.map +1 -0
  13. package/dist/editor/VideoEmbed.js +95 -0
  14. package/dist/editor/VideoMenu.d.ts +12 -0
  15. package/dist/editor/VideoMenu.d.ts.map +1 -0
  16. package/dist/editor/VideoMenu.js +35 -0
  17. package/dist/editor/color-menu/index.d.ts +19 -0
  18. package/dist/editor/color-menu/index.d.ts.map +1 -0
  19. package/dist/editor/color-menu/index.js +90 -0
  20. package/dist/editor/color-menu/text-color-presets.d.ts +9 -0
  21. package/dist/editor/color-menu/text-color-presets.d.ts.map +1 -0
  22. package/dist/editor/color-menu/text-color-presets.js +46 -0
  23. package/dist/editor/index.d.ts +12 -0
  24. package/dist/editor/index.d.ts.map +1 -0
  25. package/dist/editor/index.js +314 -0
  26. package/dist/editor/letter-spacing/index.d.ts +17 -0
  27. package/dist/editor/letter-spacing/index.d.ts.map +1 -0
  28. package/dist/editor/letter-spacing/index.js +35 -0
  29. package/dist/editor/letter-spacing.d.ts +17 -0
  30. package/dist/editor/letter-spacing.d.ts.map +1 -0
  31. package/dist/editor/letter-spacing.js +35 -0
  32. package/dist/editor/slash-menu/index.d.ts +25 -0
  33. package/dist/editor/slash-menu/index.d.ts.map +1 -0
  34. package/dist/editor/slash-menu/index.js +179 -0
  35. package/dist/editor/text-color-presets.d.ts +9 -0
  36. package/dist/editor/text-color-presets.d.ts.map +1 -0
  37. package/dist/editor/text-color-presets.js +46 -0
  38. package/dist/editor/text-style-menu/index.d.ts +46 -0
  39. package/dist/editor/text-style-menu/index.d.ts.map +1 -0
  40. package/dist/editor/text-style-menu/index.js +65 -0
  41. package/dist/editor/theme.d.ts +8 -0
  42. package/dist/editor/theme.d.ts.map +1 -0
  43. package/dist/editor/theme.js +18 -0
  44. package/dist/editor/toolbar/index.d.ts +17 -0
  45. package/dist/editor/toolbar/index.d.ts.map +1 -0
  46. package/dist/editor/toolbar/index.js +206 -0
  47. package/dist/editor/toolbar/items.d.ts +10 -0
  48. package/dist/editor/toolbar/items.d.ts.map +1 -0
  49. package/dist/editor/toolbar/items.js +34 -0
  50. package/dist/editor/toolbar/theme.d.ts +8 -0
  51. package/dist/editor/toolbar/theme.d.ts.map +1 -0
  52. package/dist/editor/toolbar/theme.js +18 -0
  53. package/dist/editor/toolbar-items.d.ts +10 -0
  54. package/dist/editor/toolbar-items.d.ts.map +1 -0
  55. package/dist/editor/toolbar-items.js +34 -0
  56. package/dist/editor/toolbar.d.ts +16 -0
  57. package/dist/editor/toolbar.d.ts.map +1 -0
  58. package/dist/editor/toolbar.js +206 -0
  59. package/dist/editor/use-dom-id.d.ts +3 -0
  60. package/dist/editor/use-dom-id.d.ts.map +1 -0
  61. package/dist/editor/use-dom-id.js +11 -0
  62. package/dist/editor/video-embed/index.d.ts +15 -0
  63. package/dist/editor/video-embed/index.d.ts.map +1 -0
  64. package/dist/editor/video-embed/index.js +95 -0
  65. package/dist/editor/video-embed/video-url.d.ts +8 -0
  66. package/dist/editor/video-embed/video-url.d.ts.map +1 -0
  67. package/dist/editor/video-embed/video-url.js +102 -0
  68. package/dist/editor/video-menu/index.d.ts +13 -0
  69. package/dist/editor/video-menu/index.d.ts.map +1 -0
  70. package/dist/editor/video-menu/index.js +35 -0
  71. package/dist/editor/video-url.d.ts +8 -0
  72. package/dist/editor/video-url.d.ts.map +1 -0
  73. package/dist/editor/video-url.js +102 -0
  74. package/dist/index.d.ts +5 -0
  75. package/dist/index.d.ts.map +1 -0
  76. package/dist/index.js +4 -0
  77. package/dist/plugin.d.ts +6 -0
  78. package/dist/plugin.d.ts.map +1 -0
  79. package/dist/plugin.js +1 -0
  80. package/dist/plugins/gfm/index.d.ts +3 -0
  81. package/dist/plugins/gfm/index.d.ts.map +1 -0
  82. package/dist/plugins/gfm/index.js +2 -0
  83. package/dist/plugins/highlight/index.d.ts +3 -0
  84. package/dist/plugins/highlight/index.d.ts.map +1 -0
  85. package/dist/plugins/highlight/index.js +2 -0
  86. package/dist/plugins/raw/index.d.ts +3 -0
  87. package/dist/plugins/raw/index.d.ts.map +1 -0
  88. package/dist/plugins/raw/index.js +2 -0
  89. package/dist/view/index.d.ts +9 -0
  90. package/dist/view/index.d.ts.map +1 -0
  91. package/dist/view/index.js +18 -0
  92. package/package.json +61 -0
  93. package/styles.css +760 -0
package/styles.css ADDED
@@ -0,0 +1,760 @@
1
+ .wsmd-icon-btn {
2
+ display: inline-flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ width: 28px;
6
+ height: 28px;
7
+ padding: 0;
8
+ flex-shrink: 0;
9
+ border-radius: 8px;
10
+ cursor: pointer;
11
+ }
12
+
13
+ .wsmd-icon-btn svg {
14
+ width: 16px;
15
+ height: 16px;
16
+ }
17
+
18
+ .wsmd-icon-btn--ghost {
19
+ border: none;
20
+ background: none;
21
+ color: var(--wsmd-muted);
22
+ }
23
+
24
+ .wsmd-icon-btn--ghost:hover:not(:disabled) {
25
+ color: var(--wsmd-foreground);
26
+ }
27
+
28
+ .wsmd-icon-btn:disabled {
29
+ cursor: not-allowed;
30
+ opacity: 0.6;
31
+ }
32
+
33
+ @keyframes icon-spin {
34
+ to {
35
+ transform: rotate(360deg);
36
+ }
37
+ }
38
+
39
+ .wsmd-icon-btn__spin {
40
+ animation: icon-spin 0.8s linear infinite;
41
+ }
42
+
43
+ .wsmd-markdown-body {
44
+ font-size: 14px;
45
+ line-height: 1.7;
46
+ word-break: break-word;
47
+ }
48
+
49
+ .wsmd-markdown-body> :first-child {
50
+ margin-top: 0;
51
+ }
52
+
53
+ .wsmd-markdown-body> :last-child {
54
+ margin-bottom: 0;
55
+ }
56
+
57
+ .wsmd-markdown-body h1,
58
+ .wsmd-markdown-body h2,
59
+ .wsmd-markdown-body h3,
60
+ .wsmd-markdown-body h4,
61
+ .wsmd-markdown-body h5,
62
+ .wsmd-markdown-body h6 {
63
+ font-weight: 650;
64
+ line-height: 1.3;
65
+ margin: 1.2em 0 0.5em;
66
+ }
67
+
68
+ .wsmd-markdown-body h1 {
69
+ font-size: 1.4em;
70
+ }
71
+
72
+ .wsmd-markdown-body h2 {
73
+ font-size: 1.25em;
74
+ }
75
+
76
+ .wsmd-markdown-body h3 {
77
+ font-size: 1.1em;
78
+ }
79
+
80
+ .wsmd-markdown-body h4 {
81
+ font-size: 1em;
82
+ }
83
+
84
+ .wsmd-markdown-body h5 {
85
+ font-size: 0.95em;
86
+ }
87
+
88
+ .wsmd-markdown-body h6 {
89
+ font-size: 0.9em;
90
+ }
91
+
92
+ .wsmd-markdown-body p,
93
+ .wsmd-markdown-body ul,
94
+ .wsmd-markdown-body ol,
95
+ .wsmd-markdown-body blockquote,
96
+ .wsmd-markdown-body pre,
97
+ .wsmd-markdown-body table {
98
+ margin: 0.7em 0;
99
+ }
100
+
101
+ .wsmd-markdown-body ul,
102
+ .wsmd-markdown-body ol {
103
+ padding-left: 1.4em;
104
+ }
105
+
106
+ /* 恢复列表项目符号/编号(被 Tailwind Preflight 重置为 none) */
107
+ .wsmd-markdown-body ul {
108
+ list-style: disc;
109
+ }
110
+
111
+ .wsmd-markdown-body ol {
112
+ list-style: decimal;
113
+ }
114
+
115
+ /* li 恢复默认展示与行间距 */
116
+ .wsmd-markdown-body li {
117
+ display: list-item;
118
+ margin: 0.25em 0;
119
+ }
120
+
121
+ /* 嵌套列表缩进与间距 */
122
+ .wsmd-markdown-body li ul,
123
+ .wsmd-markdown-body li ol {
124
+ margin: 0.25em 0;
125
+ }
126
+
127
+ /* hr 恢复默认分割线外观与边距 */
128
+ .wsmd-markdown-body hr {
129
+ height: auto;
130
+ margin: 1.2em 0;
131
+ border: 0;
132
+ border-top: 1px solid var(--wsmd-border);
133
+ }
134
+
135
+ /* 防御性:恢复粗体/斜体 */
136
+ .wsmd-markdown-body strong,
137
+ .wsmd-markdown-body b {
138
+ font-weight: 700;
139
+ }
140
+
141
+ .wsmd-markdown-body em,
142
+ .wsmd-markdown-body i {
143
+ font-style: italic;
144
+ }
145
+
146
+ .wsmd-markdown-body a {
147
+ color: inherit;
148
+ text-decoration: underline;
149
+ }
150
+
151
+ .wsmd-markdown-body pre {
152
+ overflow: auto;
153
+ padding: 12px 14px;
154
+ border-radius: 10px;
155
+ background: color-mix(in srgb, var(--wsmd-foreground) 6%, var(--wsmd-background));
156
+ font-family: var(--wsmd-font-mono), ui-monospace, monospace;
157
+ font-size: 13px;
158
+ }
159
+
160
+ .wsmd-markdown-body code {
161
+ font-family: var(--wsmd-font-mono), ui-monospace, monospace;
162
+ font-size: 0.92em;
163
+ }
164
+
165
+ .wsmd-markdown-body :not(pre)>code {
166
+ padding: 0.15em 0.4em;
167
+ border-radius: 6px;
168
+ background: color-mix(in srgb, var(--wsmd-foreground) 8%, var(--wsmd-surface));
169
+ }
170
+
171
+ .wsmd-markdown-body table {
172
+ border-collapse: collapse;
173
+ width: 100%;
174
+ }
175
+
176
+ .wsmd-markdown-body th,
177
+ .wsmd-markdown-body td {
178
+ border: 1px solid var(--wsmd-border);
179
+ padding: 6px 10px;
180
+ text-align: left;
181
+ }
182
+
183
+ .wsmd-markdown-body blockquote {
184
+ border-left: 3px solid var(--wsmd-border);
185
+ padding-left: 12px;
186
+ color: var(--wsmd-muted);
187
+ }
188
+
189
+ .wsmd-text-style-menu,
190
+ .wsmd-video-menu {
191
+ position: relative;
192
+ }
193
+
194
+ .wsmd-text-style-menu__panel,
195
+ .wsmd-video-menu__panel {
196
+ position: absolute;
197
+ top: calc(100% + 6px);
198
+ left: 0;
199
+ z-index: 12;
200
+ min-width: 220px;
201
+ padding: 10px;
202
+ border: 1px solid var(--wsmd-border);
203
+ border-radius: 10px;
204
+ background: var(--wsmd-surface);
205
+ box-shadow: 0 8px 24px color-mix(in srgb, var(--wsmd-foreground) 12%, transparent);
206
+ }
207
+
208
+ .wsmd-text-style-menu__row {
209
+ display: flex;
210
+ align-items: center;
211
+ justify-content: space-between;
212
+ gap: 12px;
213
+ margin-top: 8px;
214
+ font-size: 12px;
215
+ font-weight: 600;
216
+ color: var(--wsmd-foreground);
217
+ }
218
+
219
+ .wsmd-text-style-menu__row:first-child {
220
+ margin-top: 0;
221
+ }
222
+
223
+ .wsmd-text-style-menu__select,
224
+ .wsmd-video-menu__input {
225
+ min-width: 0;
226
+ border: 1px solid var(--wsmd-border);
227
+ border-radius: 6px;
228
+ background: var(--wsmd-background);
229
+ color: inherit;
230
+ font: inherit;
231
+ }
232
+
233
+ .wsmd-text-style-menu__select {
234
+ width: 132px;
235
+ height: 28px;
236
+ padding: 0 6px;
237
+ }
238
+
239
+ .wsmd-video-menu__upload,
240
+ .wsmd-video-menu__submit {
241
+ width: 100%;
242
+ height: 28px;
243
+ border: 1px solid var(--wsmd-border);
244
+ border-radius: 6px;
245
+ background: var(--wsmd-background);
246
+ color: inherit;
247
+ font: inherit;
248
+ font-size: 12px;
249
+ font-weight: 600;
250
+ cursor: pointer;
251
+ }
252
+
253
+ .wsmd-video-menu__form {
254
+ display: flex;
255
+ flex-direction: column;
256
+ gap: 6px;
257
+ margin-top: 10px;
258
+ }
259
+
260
+ .wsmd-video-menu__label {
261
+ font-size: 12px;
262
+ font-weight: 600;
263
+ color: var(--wsmd-foreground);
264
+ }
265
+
266
+ .wsmd-video-menu__input {
267
+ height: 28px;
268
+ padding: 0 8px;
269
+ }
270
+
271
+ .wsmd-video-menu__error {
272
+ margin: 0;
273
+ font-size: 12px;
274
+ color: var(--wsmd-danger);
275
+ }
276
+
277
+ .wsmd-markdown-body video,
278
+ .wsmd-tiptap video {
279
+ display: block;
280
+ width: 100%;
281
+ max-width: 100%;
282
+ border-radius: 8px;
283
+ }
284
+
285
+ .wsmd-markdown-body iframe[data-video-provider],
286
+ .wsmd-tiptap iframe[data-video-provider] {
287
+ display: block;
288
+ width: 100%;
289
+ aspect-ratio: 16 / 9;
290
+ border: 0;
291
+ border-radius: 8px;
292
+ }
293
+
294
+ .wsmd-tiptap .ProseMirror-selectednode {
295
+ outline: 2px solid var(--wsmd-foreground);
296
+ outline-offset: 2px;
297
+ }
298
+
299
+ .wsmd-markdown-body img,
300
+ .wsmd-tiptap img {
301
+ max-width: 100%;
302
+ height: auto;
303
+ border-radius: 8px;
304
+ }
305
+
306
+ .wsmd-markdown-editor__loading {
307
+ padding: 20px 24px;
308
+ color: var(--wsmd-muted);
309
+ font-size: 13px;
310
+ }
311
+
312
+ .wsmd-markdown-editor {
313
+ display: flex;
314
+ flex-direction: column;
315
+ flex: 1;
316
+ min-height: 0;
317
+ }
318
+
319
+ .wsmd-markdown-editor--dragging .wsmd-markdown-editor__canvas {
320
+ outline: 2px solid var(--wsmd-accent);
321
+ outline-offset: -2px;
322
+ background: color-mix(in srgb, var(--wsmd-accent) 6%, transparent);
323
+ }
324
+
325
+ .wsmd-markdown-editor__canvas {
326
+ position: relative;
327
+ flex: 1;
328
+ min-height: 0;
329
+ overflow: auto;
330
+ }
331
+
332
+ .wsmd-markdown-editor__content {
333
+ min-height: 100%;
334
+ padding: 20px 24px 32px 36px;
335
+ }
336
+
337
+ .wsmd-markdown-editor__file {
338
+ display: none;
339
+ }
340
+
341
+ .wsmd-toolbar {
342
+ display: flex;
343
+ flex-wrap: wrap;
344
+ align-items: center;
345
+ gap: 2px;
346
+ flex-shrink: 0;
347
+ padding: 8px 16px;
348
+ border-bottom: 1px solid var(--wsmd-border);
349
+ background: var(--wsmd-background);
350
+ }
351
+
352
+ .wsmd-toolbar__btn--active {
353
+ color: var(--wsmd-foreground);
354
+ background: color-mix(in srgb, var(--wsmd-foreground) 10%, transparent);
355
+ }
356
+
357
+ .wsmd-toolbar__divider {
358
+ width: 1px;
359
+ height: 16px;
360
+ margin: 0 4px;
361
+ background: var(--wsmd-border);
362
+ }
363
+
364
+ .wsmd-toolbar__spacer {
365
+ margin-left: auto;
366
+ }
367
+
368
+ .wsmd-color-menu {
369
+ position: relative;
370
+ }
371
+
372
+ .wsmd-color-menu__trigger {
373
+ flex-direction: column;
374
+ gap: 1px;
375
+ }
376
+
377
+ .wsmd-color-menu__bar {
378
+ width: 12px;
379
+ height: 2px;
380
+ border-radius: 1px;
381
+ background: currentColor;
382
+ }
383
+
384
+ .wsmd-color-menu__panel {
385
+ position: absolute;
386
+ top: calc(100% + 6px);
387
+ left: 0;
388
+ z-index: 12;
389
+ display: flex;
390
+ flex-direction: column;
391
+ gap: 10px;
392
+ width: max-content;
393
+ padding: 12px;
394
+ border: 1px solid var(--wsmd-border);
395
+ border-radius: 10px;
396
+ background: var(--wsmd-surface);
397
+ box-shadow: 0 8px 24px color-mix(in srgb, var(--wsmd-foreground) 12%, transparent);
398
+ }
399
+
400
+ .wsmd-color-menu__section {
401
+ display: flex;
402
+ flex-direction: column;
403
+ gap: 6px;
404
+ }
405
+
406
+ .wsmd-color-menu__caption {
407
+ margin: 0;
408
+ font-size: 12px;
409
+ line-height: 16px;
410
+ font-weight: 500;
411
+ color: var(--wsmd-muted);
412
+ }
413
+
414
+ .wsmd-color-menu__swatches {
415
+ display: grid;
416
+ grid-template-columns: repeat(5, 22px);
417
+ gap: 6px;
418
+ }
419
+
420
+ .wsmd-color-menu__custom-swatch {
421
+ position: relative;
422
+ width: 22px;
423
+ height: 22px;
424
+ }
425
+
426
+ .wsmd-color-menu__swatch-remove {
427
+ position: absolute;
428
+ top: -4px;
429
+ right: -4px;
430
+ display: inline-flex;
431
+ align-items: center;
432
+ justify-content: center;
433
+ width: 14px;
434
+ height: 14px;
435
+ padding: 0;
436
+ border: none;
437
+ border-radius: 999px;
438
+ background: var(--wsmd-foreground);
439
+ color: var(--wsmd-background);
440
+ cursor: pointer;
441
+ opacity: 0;
442
+ pointer-events: none;
443
+ }
444
+
445
+ .wsmd-color-menu__custom-swatch:hover .wsmd-color-menu__swatch-remove,
446
+ .wsmd-color-menu__custom-swatch:focus-within .wsmd-color-menu__swatch-remove {
447
+ opacity: 1;
448
+ pointer-events: auto;
449
+ }
450
+
451
+ .wsmd-color-menu__swatch-remove svg {
452
+ width: 8px;
453
+ height: 8px;
454
+ }
455
+
456
+ .wsmd-color-menu__swatch {
457
+ width: 22px;
458
+ height: 22px;
459
+ padding: 0;
460
+ border: 1px solid var(--wsmd-border);
461
+ border-radius: 6px;
462
+ cursor: pointer;
463
+ }
464
+
465
+ .wsmd-color-menu__swatch--active {
466
+ outline: 2px solid var(--wsmd-foreground);
467
+ outline-offset: 1px;
468
+ }
469
+
470
+ .wsmd-color-menu__swatch--clear {
471
+ display: inline-flex;
472
+ align-items: center;
473
+ justify-content: center;
474
+ background: var(--wsmd-background);
475
+ color: var(--wsmd-muted);
476
+ }
477
+
478
+ .wsmd-color-menu__swatch--clear svg {
479
+ width: 12px;
480
+ height: 12px;
481
+ }
482
+
483
+ .wsmd-color-menu__custom {
484
+ display: flex;
485
+ align-items: center;
486
+ justify-content: space-between;
487
+ gap: 12px;
488
+ margin: 0;
489
+ padding-top: 10px;
490
+ border-top: 1px solid var(--wsmd-border);
491
+ }
492
+
493
+ .wsmd-color-menu__picker {
494
+ width: 22px;
495
+ height: 22px;
496
+ padding: 0;
497
+ border: 1px solid var(--wsmd-border);
498
+ border-radius: 6px;
499
+ background: none;
500
+ cursor: pointer;
501
+ }
502
+
503
+ .wsmd-color-menu__picker::-webkit-color-swatch-wrapper {
504
+ padding: 0;
505
+ }
506
+
507
+ .wsmd-color-menu__picker::-webkit-color-swatch,
508
+ .wsmd-color-menu__picker::-moz-color-swatch {
509
+ border: none;
510
+ border-radius: 5px;
511
+ }
512
+
513
+ .wsmd-markdown-body mark,
514
+ .wsmd-tiptap mark {
515
+ background: #fde047;
516
+ color: inherit;
517
+ border-radius: 2px;
518
+ padding: 0 0.12em;
519
+ }
520
+
521
+ .wsmd-tiptap {
522
+ outline: none;
523
+ min-height: 240px;
524
+ }
525
+
526
+ .wsmd-tiptap p.is-editor-empty:first-child::before,
527
+ .wsmd-tiptap p.is-empty:first-child::before {
528
+ content: attr(data-placeholder);
529
+ float: left;
530
+ height: 0;
531
+ color: var(--wsmd-muted);
532
+ pointer-events: none;
533
+ }
534
+
535
+ .wsmd-tiptap ul[data-type="taskList"] {
536
+ list-style: none;
537
+ padding-left: 0;
538
+ }
539
+
540
+ .wsmd-tiptap ul[data-type="taskList"] li {
541
+ display: flex;
542
+ align-items: flex-start;
543
+ gap: 8px;
544
+ }
545
+
546
+ .wsmd-tiptap ul[data-type="taskList"] li>label {
547
+ margin-top: 0.35em;
548
+ }
549
+
550
+ .wsmd-slash-menu {
551
+ min-width: 200px;
552
+ padding: 6px;
553
+ border: 1px solid var(--wsmd-border);
554
+ border-radius: 10px;
555
+ background: var(--wsmd-surface);
556
+ box-shadow: 0 8px 24px color-mix(in srgb, var(--wsmd-foreground) 12%, transparent);
557
+ }
558
+
559
+ .wsmd-slash-menu__item {
560
+ display: flex;
561
+ align-items: center;
562
+ gap: 8px;
563
+ width: 100%;
564
+ padding: 6px 8px;
565
+ border: none;
566
+ border-radius: 8px;
567
+ background: none;
568
+ color: inherit;
569
+ font: inherit;
570
+ font-size: 13px;
571
+ text-align: left;
572
+ cursor: pointer;
573
+ }
574
+
575
+ .wsmd-slash-menu__item svg {
576
+ width: 14px;
577
+ height: 14px;
578
+ color: var(--wsmd-muted);
579
+ }
580
+
581
+ .wsmd-slash-menu__item--active,
582
+ .wsmd-slash-menu__item:hover {
583
+ background: color-mix(in srgb, var(--wsmd-foreground) 6%, transparent);
584
+ }
585
+
586
+ .wsmd-drag-handle {
587
+ position: absolute;
588
+ left: 8px;
589
+ z-index: 1;
590
+ display: flex;
591
+ align-items: center;
592
+ justify-content: center;
593
+ width: 20px;
594
+ height: 22px;
595
+ padding: 0;
596
+ border: none;
597
+ border-radius: 6px;
598
+ background: none;
599
+ color: var(--wsmd-muted);
600
+ opacity: 0;
601
+ pointer-events: none;
602
+ cursor: grab;
603
+ }
604
+
605
+ .wsmd-drag-handle svg {
606
+ width: 14px;
607
+ height: 14px;
608
+ }
609
+
610
+ .wsmd-drag-handle:hover {
611
+ background: color-mix(in srgb, var(--wsmd-foreground) 8%, transparent);
612
+ }
613
+
614
+ /* Skill 预览代码高亮 token 颜色:亮色(github) */
615
+ :root {
616
+ --wsmd-hl-base: #24292e;
617
+ --wsmd-hl-keyword: #d73a49;
618
+ --wsmd-hl-title: #6f42c1;
619
+ --wsmd-hl-constant: #005cc5;
620
+ --wsmd-hl-string: #032f62;
621
+ --wsmd-hl-built-in: #e36209;
622
+ --wsmd-hl-comment: #6a737d;
623
+ --wsmd-hl-tag: #22863a;
624
+ --wsmd-hl-section: #005cc5;
625
+ --wsmd-hl-bullet: #735c0f;
626
+ --wsmd-hl-add-fg: #22863a;
627
+ --wsmd-hl-add-bg: #f0fff4;
628
+ --wsmd-hl-del-fg: #b31d28;
629
+ --wsmd-hl-del-bg: #ffeef0;
630
+ }
631
+
632
+ :root[data-theme="dark"] {
633
+ --wsmd-hl-base: #c9d1d9;
634
+ --wsmd-hl-keyword: #ff7b72;
635
+ --wsmd-hl-title: #d2a8ff;
636
+ --wsmd-hl-constant: #79c0ff;
637
+ --wsmd-hl-string: #a5d6ff;
638
+ --wsmd-hl-built-in: #ffa657;
639
+ --wsmd-hl-comment: #8b949e;
640
+ --wsmd-hl-tag: #7ee787;
641
+ --wsmd-hl-section: #1f6feb;
642
+ --wsmd-hl-bullet: #f2cc60;
643
+ --wsmd-hl-add-fg: #aff5b4;
644
+ --wsmd-hl-add-bg: #033a16;
645
+ --wsmd-hl-del-fg: #ffdcd7;
646
+ --wsmd-hl-del-bg: #67060c;
647
+ }
648
+
649
+ @media (prefers-color-scheme: dark) {
650
+ :root:not([data-theme="light"]) {
651
+ --wsmd-hl-base: #c9d1d9;
652
+ --wsmd-hl-keyword: #ff7b72;
653
+ --wsmd-hl-title: #d2a8ff;
654
+ --wsmd-hl-constant: #79c0ff;
655
+ --wsmd-hl-string: #a5d6ff;
656
+ --wsmd-hl-built-in: #ffa657;
657
+ --wsmd-hl-comment: #8b949e;
658
+ --wsmd-hl-tag: #7ee787;
659
+ --wsmd-hl-section: #1f6feb;
660
+ --wsmd-hl-bullet: #f2cc60;
661
+ --wsmd-hl-add-fg: #aff5b4;
662
+ --wsmd-hl-add-bg: #033a16;
663
+ --wsmd-hl-del-fg: #ffdcd7;
664
+ --wsmd-hl-del-bg: #67060c;
665
+ }
666
+ }
667
+
668
+ .wsmd-markdown-body pre code.hljs {
669
+ display: block;
670
+ padding: 0;
671
+ background: transparent;
672
+ color: var(--wsmd-hl-base);
673
+ }
674
+
675
+ .wsmd-markdown-body pre .hljs-keyword,
676
+ .wsmd-markdown-body pre .hljs-doctag,
677
+ .wsmd-markdown-body pre .hljs-template-tag,
678
+ .wsmd-markdown-body pre .hljs-template-variable,
679
+ .wsmd-markdown-body pre .hljs-type,
680
+ .wsmd-markdown-body pre .hljs-variable.language_,
681
+ .wsmd-markdown-body pre .hljs-meta .hljs-keyword {
682
+ color: var(--wsmd-hl-keyword);
683
+ }
684
+
685
+ .wsmd-markdown-body pre .hljs-title,
686
+ .wsmd-markdown-body pre .hljs-title.class_,
687
+ .wsmd-markdown-body pre .hljs-title.class_.inherited__,
688
+ .wsmd-markdown-body pre .hljs-title.function_ {
689
+ color: var(--wsmd-hl-title);
690
+ }
691
+
692
+ .wsmd-markdown-body pre .hljs-attr,
693
+ .wsmd-markdown-body pre .hljs-attribute,
694
+ .wsmd-markdown-body pre .hljs-literal,
695
+ .wsmd-markdown-body pre .hljs-meta,
696
+ .wsmd-markdown-body pre .hljs-number,
697
+ .wsmd-markdown-body pre .hljs-operator,
698
+ .wsmd-markdown-body pre .hljs-variable,
699
+ .wsmd-markdown-body pre .hljs-selector-attr,
700
+ .wsmd-markdown-body pre .hljs-selector-class,
701
+ .wsmd-markdown-body pre .hljs-selector-id {
702
+ color: var(--wsmd-hl-constant);
703
+ }
704
+
705
+ .wsmd-markdown-body pre .hljs-regexp,
706
+ .wsmd-markdown-body pre .hljs-string,
707
+ .wsmd-markdown-body pre .hljs-meta .hljs-string {
708
+ color: var(--wsmd-hl-string);
709
+ }
710
+
711
+ .wsmd-markdown-body pre .hljs-built_in,
712
+ .wsmd-markdown-body pre .hljs-symbol {
713
+ color: var(--wsmd-hl-built-in);
714
+ }
715
+
716
+ .wsmd-markdown-body pre .hljs-comment,
717
+ .wsmd-markdown-body pre .hljs-code,
718
+ .wsmd-markdown-body pre .hljs-formula {
719
+ color: var(--wsmd-hl-comment);
720
+ }
721
+
722
+ .wsmd-markdown-body pre .hljs-name,
723
+ .wsmd-markdown-body pre .hljs-quote,
724
+ .wsmd-markdown-body pre .hljs-selector-tag,
725
+ .wsmd-markdown-body pre .hljs-selector-pseudo {
726
+ color: var(--wsmd-hl-tag);
727
+ }
728
+
729
+ .wsmd-markdown-body pre .hljs-subst {
730
+ color: var(--wsmd-hl-base);
731
+ }
732
+
733
+ .wsmd-markdown-body pre .hljs-section {
734
+ color: var(--wsmd-hl-section);
735
+ font-weight: bold;
736
+ }
737
+
738
+ .wsmd-markdown-body pre .hljs-bullet {
739
+ color: var(--wsmd-hl-bullet);
740
+ }
741
+
742
+ .wsmd-markdown-body pre .hljs-emphasis {
743
+ color: var(--wsmd-hl-base);
744
+ font-style: italic;
745
+ }
746
+
747
+ .wsmd-markdown-body pre .hljs-strong {
748
+ color: var(--wsmd-hl-base);
749
+ font-weight: bold;
750
+ }
751
+
752
+ .wsmd-markdown-body pre .hljs-addition {
753
+ color: var(--wsmd-hl-add-fg);
754
+ background-color: var(--wsmd-hl-add-bg);
755
+ }
756
+
757
+ .wsmd-markdown-body pre .hljs-deletion {
758
+ color: var(--wsmd-hl-del-fg);
759
+ background-color: var(--wsmd-hl-del-bg);
760
+ }