@editorcn/editor 0.1.2 → 0.3.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/README.md +2 -0
- package/dist/index.cjs +1686 -1162
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +112 -93
- package/dist/index.d.ts +112 -93
- package/dist/index.js +1675 -1160
- package/dist/index.js.map +1 -1
- package/dist/style.css +298 -52
- package/package.json +64 -58
package/dist/style.css
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
border: 1px solid var(--border);
|
|
6
6
|
background-color: var(--background);
|
|
7
7
|
transition:
|
|
8
|
-
border-color
|
|
9
|
-
box-shadow
|
|
8
|
+
border-color 150ms ease-out,
|
|
9
|
+
box-shadow 150ms ease-out;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.rte-editor-icon {
|
|
@@ -23,13 +23,13 @@ button.rte-control-button {
|
|
|
23
23
|
width: 2rem;
|
|
24
24
|
padding: 0;
|
|
25
25
|
transition:
|
|
26
|
-
background-color
|
|
27
|
-
color
|
|
28
|
-
transform
|
|
26
|
+
background-color 150ms ease-out,
|
|
27
|
+
color 150ms ease-out,
|
|
28
|
+
transform 100ms ease-out;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
button.rte-control-button:active {
|
|
32
|
-
transform: scale(0.
|
|
32
|
+
transform: scale(0.96);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/* ── Editor Content ── */
|
|
@@ -50,7 +50,7 @@ button.rte-control-button:active {
|
|
|
50
50
|
float: left;
|
|
51
51
|
height: 0;
|
|
52
52
|
color: var(--muted-foreground);
|
|
53
|
-
transition: opacity
|
|
53
|
+
transition: opacity 150ms ease-out;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
.rte-content .ProseMirror p {
|
|
@@ -165,14 +165,11 @@ button.rte-control-button:active {
|
|
|
165
165
|
font-style: italic;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
.rte-content .ProseMirror code {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
font-family: var(--font-mono);
|
|
174
|
-
font-size: 0.875em;
|
|
175
|
-
border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
|
|
168
|
+
.rte-content .ProseMirror pre code {
|
|
169
|
+
color: inherit;
|
|
170
|
+
background: none;
|
|
171
|
+
padding: 0;
|
|
172
|
+
font-weight: 400;
|
|
176
173
|
}
|
|
177
174
|
|
|
178
175
|
.rte-content .ProseMirror pre {
|
|
@@ -209,8 +206,8 @@ button.rte-control-button:active {
|
|
|
209
206
|
text-underline-offset: 4px;
|
|
210
207
|
cursor: pointer;
|
|
211
208
|
transition:
|
|
212
|
-
color
|
|
213
|
-
text-decoration-color
|
|
209
|
+
color 150ms ease-out,
|
|
210
|
+
text-decoration-color 150ms ease-out;
|
|
214
211
|
text-decoration-color: color-mix(in srgb, var(--primary) 40%, transparent);
|
|
215
212
|
}
|
|
216
213
|
|
|
@@ -226,7 +223,7 @@ button.rte-control-button:active {
|
|
|
226
223
|
/* Syntax Highlighting */
|
|
227
224
|
.rte-content .ProseMirror pre .hljs-comment,
|
|
228
225
|
.rte-content .ProseMirror pre .hljs-quote {
|
|
229
|
-
color:
|
|
226
|
+
color: #6c7086;
|
|
230
227
|
}
|
|
231
228
|
|
|
232
229
|
.rte-content .ProseMirror pre .hljs-variable,
|
|
@@ -238,7 +235,7 @@ button.rte-control-button:active {
|
|
|
238
235
|
.rte-content .ProseMirror pre .hljs-name,
|
|
239
236
|
.rte-content .ProseMirror pre .hljs-selector-id,
|
|
240
237
|
.rte-content .ProseMirror pre .hljs-selector-class {
|
|
241
|
-
color:
|
|
238
|
+
color: #89b4fa;
|
|
242
239
|
}
|
|
243
240
|
|
|
244
241
|
.rte-content .ProseMirror pre .hljs-number,
|
|
@@ -248,23 +245,57 @@ button.rte-control-button:active {
|
|
|
248
245
|
.rte-content .ProseMirror pre .hljs-literal,
|
|
249
246
|
.rte-content .ProseMirror pre .hljs-type,
|
|
250
247
|
.rte-content .ProseMirror pre .hljs-params {
|
|
251
|
-
color:
|
|
248
|
+
color: #fab387;
|
|
252
249
|
}
|
|
253
250
|
|
|
254
251
|
.rte-content .ProseMirror pre .hljs-string,
|
|
255
252
|
.rte-content .ProseMirror pre .hljs-symbol,
|
|
256
253
|
.rte-content .ProseMirror pre .hljs-bullet {
|
|
257
|
-
color:
|
|
254
|
+
color: #a6e3a1;
|
|
258
255
|
}
|
|
259
256
|
|
|
260
257
|
.rte-content .ProseMirror pre .hljs-title,
|
|
261
258
|
.rte-content .ProseMirror pre .hljs-section {
|
|
262
|
-
color:
|
|
259
|
+
color: #f9e2af;
|
|
263
260
|
}
|
|
264
261
|
|
|
265
262
|
.rte-content .ProseMirror pre .hljs-keyword,
|
|
266
263
|
.rte-content .ProseMirror pre .hljs-selector-tag {
|
|
267
|
-
color:
|
|
264
|
+
color: #cba6f7;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/* Object/JSON keys & HTML/XML attribute names (previously missing) */
|
|
268
|
+
.rte-content .ProseMirror pre .hljs-attr {
|
|
269
|
+
color: #89b4fa;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/* JSDoc-style tags, e.g. @param, @returns */
|
|
273
|
+
.rte-content .ProseMirror pre .hljs-doctag {
|
|
274
|
+
color: #f38ba8;
|
|
275
|
+
font-weight: 600;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/* Operators & punctuation (finer-grained grammars) */
|
|
279
|
+
.rte-content .ProseMirror pre .hljs-operator,
|
|
280
|
+
.rte-content .ProseMirror pre .hljs-punctuation {
|
|
281
|
+
color: #9399b2;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/* CSS selector attributes/pseudo-classes, e.g. [type="text"], :hover */
|
|
285
|
+
.rte-content .ProseMirror pre .hljs-selector-attr,
|
|
286
|
+
.rte-content .ProseMirror pre .hljs-selector-pseudo {
|
|
287
|
+
color: #94e2d5;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/* Language-level variables, e.g. this, super */
|
|
291
|
+
.rte-content .ProseMirror pre .hljs-variable.language_ {
|
|
292
|
+
color: #cba6f7;
|
|
293
|
+
font-style: italic;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/* Template literal substitutions, e.g. ${...} */
|
|
297
|
+
.rte-content .ProseMirror pre .hljs-subst {
|
|
298
|
+
color: #cdd6f4;
|
|
268
299
|
}
|
|
269
300
|
|
|
270
301
|
.rte-content .ProseMirror pre .hljs-emphasis {
|
|
@@ -274,6 +305,25 @@ button.rte-control-button:active {
|
|
|
274
305
|
font-weight: 700;
|
|
275
306
|
}
|
|
276
307
|
|
|
308
|
+
.rte-content .ProseMirror pre .hljs-addition {
|
|
309
|
+
color: #a6e3a1;
|
|
310
|
+
background-color: color-mix(in srgb, #a6e3a1 10%, transparent);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.rte-content .ProseMirror pre .hljs-deletion {
|
|
314
|
+
color: #f38ba8;
|
|
315
|
+
background-color: color-mix(in srgb, #f38ba8 10%, transparent);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.rte-content .ProseMirror code {
|
|
319
|
+
font-size: 0.875em;
|
|
320
|
+
font-weight: 500;
|
|
321
|
+
background: color-mix(in srgb, var(--muted) 70%, transparent);
|
|
322
|
+
padding: 0.125rem 0.375rem;
|
|
323
|
+
border-radius: calc(var(--radius) - 4px);
|
|
324
|
+
transition: background-color 150ms ease-out;
|
|
325
|
+
}
|
|
326
|
+
|
|
277
327
|
/* ── Toolbars and Footer ── */
|
|
278
328
|
.rte-toolbar {
|
|
279
329
|
display: flex;
|
|
@@ -289,15 +339,25 @@ button.rte-control-button:active {
|
|
|
289
339
|
border-bottom: 1px solid var(--border);
|
|
290
340
|
padding: 0.5rem 0.75rem;
|
|
291
341
|
transition:
|
|
292
|
-
box-shadow
|
|
293
|
-
background-color
|
|
342
|
+
box-shadow 150ms ease-out,
|
|
343
|
+
background-color 150ms ease-out;
|
|
294
344
|
}
|
|
295
345
|
|
|
296
346
|
.rte-toolbar[data-sticky] {
|
|
297
347
|
position: sticky;
|
|
298
348
|
background-color: color-mix(in srgb, var(--background) 85%, transparent);
|
|
299
349
|
backdrop-filter: blur(8px);
|
|
300
|
-
box-shadow:
|
|
350
|
+
box-shadow:
|
|
351
|
+
0px 0px 0px 1px oklch(0 0 0 / 0.04),
|
|
352
|
+
0px 4px 12px 0px oklch(0 0 0 / 0.05);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
@media (prefers-color-scheme: dark) {
|
|
356
|
+
.rte-toolbar[data-sticky] {
|
|
357
|
+
box-shadow:
|
|
358
|
+
0px 0px 0px 1px oklch(1 0 0 / 0.06),
|
|
359
|
+
0px 4px 12px 0px oklch(0 0 0 / 0.3);
|
|
360
|
+
}
|
|
301
361
|
}
|
|
302
362
|
|
|
303
363
|
.rte-footer {
|
|
@@ -321,7 +381,17 @@ button.rte-control-button:active {
|
|
|
321
381
|
bottom: 0;
|
|
322
382
|
background-color: color-mix(in srgb, var(--background) 85%, transparent);
|
|
323
383
|
backdrop-filter: blur(8px);
|
|
324
|
-
box-shadow:
|
|
384
|
+
box-shadow:
|
|
385
|
+
0px 0px 0px 1px oklch(0 0 0 / 0.04),
|
|
386
|
+
0px -4px 12px 0px oklch(0 0 0 / 0.05);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
@media (prefers-color-scheme: dark) {
|
|
390
|
+
.rte-footer[data-sticky] {
|
|
391
|
+
box-shadow:
|
|
392
|
+
0px 0px 0px 1px oklch(1 0 0 / 0.06),
|
|
393
|
+
0px -4px 12px 0px oklch(0 0 0 / 0.3);
|
|
394
|
+
}
|
|
325
395
|
}
|
|
326
396
|
|
|
327
397
|
.rte-footer-word-count {
|
|
@@ -361,7 +431,10 @@ button.rte-control-button:active {
|
|
|
361
431
|
min-width: 1.625rem;
|
|
362
432
|
height: 1.625rem;
|
|
363
433
|
background-color: var(--background);
|
|
364
|
-
transition:
|
|
434
|
+
transition:
|
|
435
|
+
background-color 150ms ease-out,
|
|
436
|
+
color 150ms ease-out,
|
|
437
|
+
box-shadow 150ms ease-out;
|
|
365
438
|
}
|
|
366
439
|
.rte-root[data-variant="default"]
|
|
367
440
|
.rte-controls-group
|
|
@@ -396,11 +469,6 @@ button.rte-control-button:active {
|
|
|
396
469
|
0 1px 3px rgba(0, 0, 0, 0.06),
|
|
397
470
|
0 1px 2px rgba(0, 0, 0, 0.04);
|
|
398
471
|
}
|
|
399
|
-
.rte-root[data-variant="subtle"]:focus-within {
|
|
400
|
-
box-shadow:
|
|
401
|
-
0 4px 12px rgba(0, 0, 0, 0.08),
|
|
402
|
-
0 0 0 1px var(--primary);
|
|
403
|
-
}
|
|
404
472
|
.rte-toolbar--subtle {
|
|
405
473
|
border-bottom: 1px solid var(--border);
|
|
406
474
|
padding: 0.25rem 0.375rem;
|
|
@@ -420,7 +488,9 @@ button.rte-control-button:active {
|
|
|
420
488
|
min-width: 2rem;
|
|
421
489
|
height: 2rem;
|
|
422
490
|
background-color: transparent;
|
|
423
|
-
transition:
|
|
491
|
+
transition:
|
|
492
|
+
background-color 150ms ease-out,
|
|
493
|
+
color 150ms ease-out;
|
|
424
494
|
}
|
|
425
495
|
.rte-root[data-variant="subtle"] .rte-controls-group > button:hover {
|
|
426
496
|
background-color: var(--accent);
|
|
@@ -458,7 +528,9 @@ button.rte-control-button:active {
|
|
|
458
528
|
min-width: 1.5rem;
|
|
459
529
|
height: 1.5rem;
|
|
460
530
|
background-color: transparent;
|
|
461
|
-
transition:
|
|
531
|
+
transition:
|
|
532
|
+
background-color 150ms ease-out,
|
|
533
|
+
color 150ms ease-out;
|
|
462
534
|
}
|
|
463
535
|
.rte-root[data-variant="compact"] .rte-controls-group > button:hover {
|
|
464
536
|
background-color: var(--accent);
|
|
@@ -511,7 +583,7 @@ button.rte-control-button:active {
|
|
|
511
583
|
display: flex;
|
|
512
584
|
align-items: flex-start;
|
|
513
585
|
gap: 0.5rem;
|
|
514
|
-
transition: opacity
|
|
586
|
+
transition: opacity 150ms ease-out;
|
|
515
587
|
}
|
|
516
588
|
|
|
517
589
|
.rte-task-list li[data-checked] {
|
|
@@ -550,13 +622,13 @@ button.rte-control-button:active {
|
|
|
550
622
|
position: relative;
|
|
551
623
|
flex-shrink: 0;
|
|
552
624
|
transition:
|
|
553
|
-
background-color
|
|
554
|
-
border-color
|
|
555
|
-
transform
|
|
625
|
+
background-color 150ms ease-out,
|
|
626
|
+
border-color 150ms ease-out,
|
|
627
|
+
transform 100ms ease-out;
|
|
556
628
|
}
|
|
557
629
|
|
|
558
630
|
.rte-task-list input[type="checkbox"]:active {
|
|
559
|
-
transform: scale(0.
|
|
631
|
+
transform: scale(0.96);
|
|
560
632
|
}
|
|
561
633
|
|
|
562
634
|
.rte-task-list input[type="checkbox"]:checked {
|
|
@@ -564,7 +636,6 @@ button.rte-control-button:active {
|
|
|
564
636
|
border-color: var(--primary);
|
|
565
637
|
}
|
|
566
638
|
|
|
567
|
-
/* Pop animation for the checkmark */
|
|
568
639
|
@keyframes checkmark-in {
|
|
569
640
|
0% {
|
|
570
641
|
transform: scale(0.5) rotate(-15deg);
|
|
@@ -591,8 +662,8 @@ button.rte-control-button:active {
|
|
|
591
662
|
.rte-embed-wrapper {
|
|
592
663
|
margin: 1rem 0;
|
|
593
664
|
transition:
|
|
594
|
-
opacity
|
|
595
|
-
transform
|
|
665
|
+
opacity 150ms ease-out,
|
|
666
|
+
transform 150ms ease-out;
|
|
596
667
|
}
|
|
597
668
|
|
|
598
669
|
.rte-embed-wrapper[data-align="left"] {
|
|
@@ -619,8 +690,8 @@ button.rte-control-button:active {
|
|
|
619
690
|
background: var(--muted);
|
|
620
691
|
display: inline-block;
|
|
621
692
|
transition:
|
|
622
|
-
outline-color
|
|
623
|
-
box-shadow
|
|
693
|
+
outline-color 150ms ease-out,
|
|
694
|
+
box-shadow 150ms ease-out;
|
|
624
695
|
}
|
|
625
696
|
|
|
626
697
|
.rte-embed-iframe {
|
|
@@ -654,8 +725,8 @@ button.rte-control-button:active {
|
|
|
654
725
|
z-index: 10;
|
|
655
726
|
opacity: 0;
|
|
656
727
|
transition:
|
|
657
|
-
opacity
|
|
658
|
-
background-color
|
|
728
|
+
opacity 150ms ease-out,
|
|
729
|
+
background-color 150ms ease-out;
|
|
659
730
|
}
|
|
660
731
|
|
|
661
732
|
.rte-embed-wrapper[data-selected] .rte-resize-handle {
|
|
@@ -679,8 +750,8 @@ button.rte-control-button:active {
|
|
|
679
750
|
background: var(--primary);
|
|
680
751
|
border-radius: 1px;
|
|
681
752
|
transition:
|
|
682
|
-
width
|
|
683
|
-
inset
|
|
753
|
+
width 150ms ease-out,
|
|
754
|
+
inset 150ms ease-out;
|
|
684
755
|
}
|
|
685
756
|
|
|
686
757
|
.rte-resize-handle--right:hover::after {
|
|
@@ -707,8 +778,8 @@ button.rte-control-button:active {
|
|
|
707
778
|
border-radius: 1px;
|
|
708
779
|
bottom: 1px;
|
|
709
780
|
transition:
|
|
710
|
-
height
|
|
711
|
-
bottom
|
|
781
|
+
height 150ms ease-out,
|
|
782
|
+
bottom 150ms ease-out;
|
|
712
783
|
}
|
|
713
784
|
|
|
714
785
|
.rte-resize-handle--bottom:hover::after {
|
|
@@ -725,9 +796,184 @@ button.rte-control-button:active {
|
|
|
725
796
|
background: var(--primary);
|
|
726
797
|
border: 2px solid var(--background);
|
|
727
798
|
border-radius: 2px;
|
|
728
|
-
transition: transform
|
|
799
|
+
transition: transform 150ms ease-out;
|
|
729
800
|
}
|
|
730
801
|
|
|
731
802
|
.rte-resize-handle--corner:hover {
|
|
732
803
|
transform: scale(1.15);
|
|
733
804
|
}
|
|
805
|
+
|
|
806
|
+
/* ── Bubble Menu ── */
|
|
807
|
+
@keyframes rte-bubble-pop-in {
|
|
808
|
+
0% {
|
|
809
|
+
opacity: 0;
|
|
810
|
+
transform: scale(0.96) translateY(4px);
|
|
811
|
+
}
|
|
812
|
+
100% {
|
|
813
|
+
opacity: 1;
|
|
814
|
+
transform: scale(1) translateY(0);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
.rte-bubble-menu {
|
|
819
|
+
display: flex;
|
|
820
|
+
align-items: center;
|
|
821
|
+
height: 2.25rem;
|
|
822
|
+
background: var(--popover);
|
|
823
|
+
border: 1px solid var(--border);
|
|
824
|
+
border-radius: var(--radius);
|
|
825
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
826
|
+
padding: 0 0.25rem;
|
|
827
|
+
animation: rte-bubble-pop-in 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
.rte-bubble-group {
|
|
831
|
+
display: flex;
|
|
832
|
+
align-items: center;
|
|
833
|
+
gap: 1px;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
.rte-bubble-separator {
|
|
837
|
+
width: 1px;
|
|
838
|
+
height: 1.25rem;
|
|
839
|
+
background: var(--border);
|
|
840
|
+
margin: 0 0.125rem;
|
|
841
|
+
flex-shrink: 0;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
.rte-bubble-btn {
|
|
845
|
+
display: flex;
|
|
846
|
+
align-items: center;
|
|
847
|
+
gap: 0.25rem;
|
|
848
|
+
height: 1.75rem;
|
|
849
|
+
padding: 0 0.375rem;
|
|
850
|
+
border: none;
|
|
851
|
+
border-radius: calc(var(--radius) - 4px);
|
|
852
|
+
background: transparent;
|
|
853
|
+
color: var(--popover-foreground);
|
|
854
|
+
cursor: pointer;
|
|
855
|
+
font-size: 0.8125rem;
|
|
856
|
+
white-space: nowrap;
|
|
857
|
+
transition:
|
|
858
|
+
background-color 150ms ease-out,
|
|
859
|
+
color 150ms ease-out,
|
|
860
|
+
transform 100ms ease-out;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
.rte-bubble-btn:hover {
|
|
864
|
+
background: var(--accent);
|
|
865
|
+
color: var(--accent-foreground);
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
.rte-bubble-btn:active {
|
|
869
|
+
transform: scale(0.96);
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
.rte-bubble-btn--active {
|
|
873
|
+
color: var(--primary);
|
|
874
|
+
background: var(--accent);
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
.rte-bubble-btn-icon {
|
|
878
|
+
display: flex;
|
|
879
|
+
align-items: center;
|
|
880
|
+
justify-content: center;
|
|
881
|
+
flex-shrink: 0;
|
|
882
|
+
width: 1rem;
|
|
883
|
+
height: 1rem;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
.rte-bubble-btn-icon svg {
|
|
887
|
+
width: 100%;
|
|
888
|
+
height: 100%;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
.rte-bubble-btn-text {
|
|
892
|
+
max-width: 5rem;
|
|
893
|
+
overflow: hidden;
|
|
894
|
+
text-overflow: ellipsis;
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
.rte-bubble-overlay {
|
|
898
|
+
position: fixed;
|
|
899
|
+
inset: 0;
|
|
900
|
+
z-index: 999;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
.rte-bubble-dropdown {
|
|
904
|
+
position: absolute;
|
|
905
|
+
top: 100%;
|
|
906
|
+
left: 0;
|
|
907
|
+
z-index: 1000;
|
|
908
|
+
min-width: 150px;
|
|
909
|
+
background: var(--popover);
|
|
910
|
+
border: 1px solid var(--border);
|
|
911
|
+
border-radius: var(--radius);
|
|
912
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
|
|
913
|
+
padding: 0.25rem;
|
|
914
|
+
margin-top: 4px;
|
|
915
|
+
transform-origin: top left;
|
|
916
|
+
animation: rte-bubble-pop-in 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
.rte-bubble-dropdown--language {
|
|
920
|
+
min-width: 160px;
|
|
921
|
+
max-height: 320px;
|
|
922
|
+
overflow-y: auto;
|
|
923
|
+
scrollbar-width: thin;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
.rte-bubble-dropdown-item {
|
|
927
|
+
display: flex;
|
|
928
|
+
align-items: center;
|
|
929
|
+
justify-content: flex-start;
|
|
930
|
+
gap: 0.5rem;
|
|
931
|
+
width: 100%;
|
|
932
|
+
padding: 0.375rem 0.5rem;
|
|
933
|
+
font-size: 0.8125rem;
|
|
934
|
+
color: var(--popover-foreground);
|
|
935
|
+
background: transparent;
|
|
936
|
+
border: none;
|
|
937
|
+
border-radius: calc(var(--radius) - 4px);
|
|
938
|
+
cursor: pointer;
|
|
939
|
+
text-align: left;
|
|
940
|
+
transition:
|
|
941
|
+
background-color 100ms ease-out,
|
|
942
|
+
color 100ms ease-out;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
.rte-bubble-dropdown-item:hover {
|
|
946
|
+
background: var(--accent);
|
|
947
|
+
color: var(--accent-foreground);
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
.rte-bubble-dropdown-item--active {
|
|
951
|
+
color: var(--primary);
|
|
952
|
+
background-color: color-mix(in srgb, var(--primary) 10%, transparent);
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
.rte-bubble-dropdown-icon {
|
|
956
|
+
display: flex;
|
|
957
|
+
align-items: center;
|
|
958
|
+
justify-content: center;
|
|
959
|
+
flex-shrink: 0;
|
|
960
|
+
color: var(--muted-foreground);
|
|
961
|
+
width: 1rem;
|
|
962
|
+
height: 1rem;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
.rte-bubble-dropdown-icon svg {
|
|
966
|
+
width: 100%;
|
|
967
|
+
height: 100%;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
.rte-bubble-dropdown-item--active .rte-bubble-dropdown-icon {
|
|
971
|
+
color: var(--primary);
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
/* ── Suppress transitions on theme switch ── */
|
|
975
|
+
.rte-theme-transitioning *,
|
|
976
|
+
.rte-theme-transitioning *::before,
|
|
977
|
+
.rte-theme-transitioning *::after {
|
|
978
|
+
transition: none !important;
|
|
979
|
+
}
|
package/package.json
CHANGED
|
@@ -1,58 +1,64 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@editorcn/editor",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
},
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"@
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"react": "^
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"@tiptap/extension-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"@tiptap/
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
},
|
|
53
|
-
"
|
|
54
|
-
"@
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@editorcn/editor",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"files": [
|
|
5
|
+
"dist"
|
|
6
|
+
],
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./dist/index.cjs",
|
|
9
|
+
"module": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"require": "./dist/index.cjs"
|
|
16
|
+
},
|
|
17
|
+
"./style.css": "./dist/style.css"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsup && node -e \"require('fs').copyFileSync('src/style.css','dist/style.css')\"",
|
|
24
|
+
"dev": "tsup --watch",
|
|
25
|
+
"typecheck": "tsc --noEmit",
|
|
26
|
+
"prepublishOnly": "pnpm build"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"clsx": "^2.1.1",
|
|
30
|
+
"tailwind-merge": "^3.0.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/react": "^19",
|
|
34
|
+
"tsup": "^8.4.0",
|
|
35
|
+
"typescript": "^5"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"@base-ui/react": "^1.0.0",
|
|
39
|
+
"@floating-ui/dom": "^1.6.0",
|
|
40
|
+
"@tiptap/core": ">=3.0.0 <4",
|
|
41
|
+
"@tiptap/extension-code-block-lowlight": ">=3.0.0 <4",
|
|
42
|
+
"@tiptap/extension-link": ">=3.0.0 <4",
|
|
43
|
+
"@tiptap/extension-placeholder": ">=3.0.0 <4",
|
|
44
|
+
"@tiptap/extension-underline": ">=3.0.0 <4",
|
|
45
|
+
"@tiptap/pm": ">=3.0.0 <4",
|
|
46
|
+
"@tiptap/react": ">=3.0.0 <4",
|
|
47
|
+
"@tiptap/starter-kit": ">=3.0.0 <4",
|
|
48
|
+
"class-variance-authority": "^0.7.1",
|
|
49
|
+
"lowlight": ">=3.0.0 <4",
|
|
50
|
+
"react": "^18 || ^19",
|
|
51
|
+
"react-dom": "^18 || ^19"
|
|
52
|
+
},
|
|
53
|
+
"peerDependenciesMeta": {
|
|
54
|
+
"@tiptap/extension-code-block-lowlight": {
|
|
55
|
+
"optional": true
|
|
56
|
+
},
|
|
57
|
+
"lowlight": {
|
|
58
|
+
"optional": true
|
|
59
|
+
},
|
|
60
|
+
"@tiptap/extension-placeholder": {
|
|
61
|
+
"optional": true
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|