@editorcn/editor 0.2.0 → 0.3.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/style.css CHANGED
@@ -1,961 +1,1079 @@
1
- /* ── Main Editor Wrapper ── */
2
- .rte-root {
3
- position: relative;
4
- border-radius: var(--radius);
5
- border: 1px solid var(--border);
6
- background-color: var(--background);
7
- transition:
8
- border-color 150ms ease-out,
9
- box-shadow 150ms ease-out;
10
- }
11
-
12
- .rte-editor-icon {
13
- width: 1rem;
14
- height: 1rem;
15
- flex-shrink: 0;
16
- }
17
-
18
- button.rte-control-button {
19
- display: inline-flex;
20
- align-items: center;
21
- justify-content: center;
22
- height: 2rem;
23
- width: 2rem;
24
- padding: 0;
25
- transition:
26
- background-color 150ms ease-out,
27
- color 150ms ease-out,
28
- transform 100ms ease-out;
29
- }
30
-
31
- button.rte-control-button:active {
32
- transform: scale(0.96);
33
- }
34
-
35
- /* ── Editor Content ── */
36
- .rte-content .ProseMirror {
37
- outline: 0;
38
- padding: var(--spacing, 0.75rem);
39
- min-height: 140px;
40
- }
41
-
42
- .rte-content .ProseMirror > *:last-child {
43
- margin-bottom: 0;
44
- }
45
-
46
- .rte-content .ProseMirror p.is-editor-empty:first-of-type::before {
47
- content: attr(data-placeholder);
48
- pointer-events: none;
49
- user-select: none;
50
- float: left;
51
- height: 0;
52
- color: var(--muted-foreground);
53
- transition: opacity 150ms ease-out;
54
- }
55
-
56
- .rte-content .ProseMirror p {
57
- margin-top: 0;
58
- margin-bottom: 0.75rem;
59
- line-height: 1.75;
60
- }
61
-
62
- .rte-content .ProseMirror h1,
63
- .rte-content .ProseMirror h2,
64
- .rte-content .ProseMirror h3,
65
- .rte-content .ProseMirror h4,
66
- .rte-content .ProseMirror h5,
67
- .rte-content .ProseMirror h6,
68
- .rte-content .ProseMirror p {
69
- margin-top: 0;
70
- }
71
-
72
- .rte-content .ProseMirror h1 {
73
- font-size: 1.5rem;
74
- font-weight: 700;
75
- letter-spacing: -0.025em;
76
- margin-bottom: 1rem;
77
- margin-top: 1.5rem;
78
- }
79
- .rte-content .ProseMirror h1:first-child {
80
- margin-top: 0;
81
- }
82
-
83
- .rte-content .ProseMirror h2 {
84
- font-size: 1.25rem;
85
- font-weight: 600;
86
- letter-spacing: -0.025em;
87
- margin-bottom: 0.75rem;
88
- margin-top: 1.25rem;
89
- }
90
- .rte-content .ProseMirror h2:first-child {
91
- margin-top: 0;
92
- }
93
-
94
- .rte-content .ProseMirror h3 {
95
- font-size: 1.125rem;
96
- font-weight: 600;
97
- margin-bottom: 0.5rem;
98
- margin-top: 1rem;
99
- }
100
- .rte-content .ProseMirror h3:first-child {
101
- margin-top: 0;
102
- }
103
-
104
- .rte-content .ProseMirror h4 {
105
- font-size: 1rem;
106
- font-weight: 600;
107
- margin-bottom: 0.5rem;
108
- margin-top: 0.75rem;
109
- }
110
- .rte-content .ProseMirror h4:first-child {
111
- margin-top: 0;
112
- }
113
-
114
- .rte-content .ProseMirror h5 {
115
- font-size: 0.875rem;
116
- font-weight: 600;
117
- margin-bottom: 0.5rem;
118
- margin-top: 0.75rem;
119
- }
120
- .rte-content .ProseMirror h5:first-child {
121
- margin-top: 0;
122
- }
123
-
124
- .rte-content .ProseMirror h6 {
125
- font-size: 0.875rem;
126
- font-weight: 500;
127
- margin-bottom: 0.5rem;
128
- margin-top: 0.75rem;
129
- }
130
- .rte-content .ProseMirror h6:first-child {
131
- margin-top: 0;
132
- }
133
-
134
- .rte-content .ProseMirror ul {
135
- list-style-type: disc;
136
- padding-left: 1.5rem;
137
- margin-bottom: 0.75rem;
138
- }
139
-
140
- .rte-content .ProseMirror ol {
141
- list-style-type: decimal;
142
- padding-left: 1.5rem;
143
- margin-bottom: 0.75rem;
144
- }
145
-
146
- .rte-content .ProseMirror li {
147
- line-height: 1.75;
148
- }
149
-
150
- .rte-content .ProseMirror li > p {
151
- margin-bottom: 0;
152
- }
153
-
154
- .rte-content .ProseMirror ul li,
155
- .rte-content .ProseMirror ol li {
156
- margin-top: 2px;
157
- }
158
-
159
- .rte-content .ProseMirror blockquote {
160
- border-left: 3px solid var(--border);
161
- padding-left: 1rem;
162
- margin-top: 1rem;
163
- margin-bottom: 1rem;
164
- color: var(--muted-foreground);
165
- font-style: italic;
166
- }
167
-
168
- .rte-content .ProseMirror pre code {
169
- color: inherit;
170
- background: none;
171
- padding: 0;
172
- font-weight: 400;
173
- }
174
-
175
- .rte-content .ProseMirror pre {
176
- background-color: var(--muted);
177
- color: var(--foreground);
178
- border-radius: var(--radius);
179
- border: 1px solid var(--border);
180
- padding: 1rem;
181
- margin-top: 1rem;
182
- margin-bottom: 1rem;
183
- overflow-x: auto;
184
- font-family: var(--font-mono);
185
- font-size: 0.875rem;
186
- }
187
-
188
- .rte-content .ProseMirror pre code {
189
- background: none;
190
- color: inherit;
191
- border: none;
192
- font-size: 0.875rem;
193
- padding: 0;
194
- }
195
-
196
- .rte-content .ProseMirror hr {
197
- border: none;
198
- border-top: 1px solid var(--border);
199
- margin-top: 1.5rem;
200
- margin-bottom: 1.5rem;
201
- }
202
-
203
- .rte-content .ProseMirror a {
204
- color: var(--primary);
205
- text-decoration: underline;
206
- text-underline-offset: 4px;
207
- cursor: pointer;
208
- transition:
209
- color 150ms ease-out,
210
- text-decoration-color 150ms ease-out;
211
- text-decoration-color: color-mix(in srgb, var(--primary) 40%, transparent);
212
- }
213
-
214
- .rte-content .ProseMirror a:hover {
215
- color: color-mix(in srgb, var(--primary) 80%, transparent);
216
- text-decoration-color: color-mix(in srgb, var(--primary) 80%, transparent);
217
- }
218
-
219
- .rte-content .ProseMirror ::selection {
220
- background-color: color-mix(in srgb, var(--primary) 15%, transparent);
221
- }
222
-
223
- /* Syntax Highlighting */
224
- .rte-content .ProseMirror pre .hljs-comment,
225
- .rte-content .ProseMirror pre .hljs-quote {
226
- color: #6c7086;
227
- }
228
-
229
- .rte-content .ProseMirror pre .hljs-variable,
230
- .rte-content .ProseMirror pre .hljs-template-variable,
231
- .rte-content .ProseMirror pre .hljs-attribute,
232
- .rte-content .ProseMirror pre .hljs-tag,
233
- .rte-content .ProseMirror pre .hljs-regexp,
234
- .rte-content .ProseMirror pre .hljs-link,
235
- .rte-content .ProseMirror pre .hljs-name,
236
- .rte-content .ProseMirror pre .hljs-selector-id,
237
- .rte-content .ProseMirror pre .hljs-selector-class {
238
- color: #89b4fa;
239
- }
240
-
241
- .rte-content .ProseMirror pre .hljs-number,
242
- .rte-content .ProseMirror pre .hljs-meta,
243
- .rte-content .ProseMirror pre .hljs-built_in,
244
- .rte-content .ProseMirror pre .hljs-builtin-name,
245
- .rte-content .ProseMirror pre .hljs-literal,
246
- .rte-content .ProseMirror pre .hljs-type,
247
- .rte-content .ProseMirror pre .hljs-params {
248
- color: #fab387;
249
- }
250
-
251
- .rte-content .ProseMirror pre .hljs-string,
252
- .rte-content .ProseMirror pre .hljs-symbol,
253
- .rte-content .ProseMirror pre .hljs-bullet {
254
- color: #a6e3a1;
255
- }
256
-
257
- .rte-content .ProseMirror pre .hljs-title,
258
- .rte-content .ProseMirror pre .hljs-section {
259
- color: #f9e2af;
260
- }
261
-
262
- .rte-content .ProseMirror pre .hljs-keyword,
263
- .rte-content .ProseMirror pre .hljs-selector-tag {
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;
299
- }
300
-
301
- .rte-content .ProseMirror pre .hljs-emphasis {
302
- font-style: italic;
303
- }
304
- .rte-content .ProseMirror pre .hljs-strong {
305
- font-weight: 700;
306
- }
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
-
327
- /* ── Toolbars and Footer ── */
328
- .rte-toolbar {
329
- display: flex;
330
- align-items: center;
331
- justify-content: center;
332
- flex-wrap: wrap;
333
- gap: 0.25rem;
334
- top: var(--rte-sticky-offset, 0px);
335
- background-color: var(--background);
336
- z-index: 1;
337
- border-start-end-radius: var(--radius);
338
- border-start-start-radius: var(--radius);
339
- border-bottom: 1px solid var(--border);
340
- padding: 0.5rem 0.75rem;
341
- transition:
342
- box-shadow 150ms ease-out,
343
- background-color 150ms ease-out;
344
- }
345
-
346
- .rte-toolbar[data-sticky] {
347
- position: sticky;
348
- background-color: color-mix(in srgb, var(--background) 85%, transparent);
349
- backdrop-filter: blur(8px);
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
- }
361
- }
362
-
363
- .rte-footer {
364
- display: flex;
365
- align-items: center;
366
- justify-content: space-between;
367
- flex-wrap: wrap;
368
- gap: 0.5rem;
369
- background-color: var(--background);
370
- z-index: 1;
371
- border-end-end-radius: var(--radius);
372
- border-end-start-radius: var(--radius);
373
- border-top: 1px solid var(--border);
374
- padding: 0.5rem 0.75rem;
375
- font-size: 0.75rem;
376
- color: var(--muted-foreground);
377
- }
378
-
379
- .rte-footer[data-sticky] {
380
- position: sticky;
381
- bottom: 0;
382
- background-color: color-mix(in srgb, var(--background) 85%, transparent);
383
- backdrop-filter: blur(8px);
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
- }
395
- }
396
-
397
- .rte-footer-word-count {
398
- white-space: nowrap;
399
- }
400
-
401
- .rte-toolbar--subtle + .rte-content + .rte-footer {
402
- background-color: var(--muted);
403
- }
404
- .rte-toolbar--compact + .rte-content + .rte-footer {
405
- background-color: var(--muted);
406
- }
407
-
408
- @media (max-width: 640px) {
409
- .rte-toolbar {
410
- flex-wrap: nowrap;
411
- overflow-x: auto;
412
- justify-content: flex-start;
413
- scrollbar-width: none;
414
- -ms-overflow-style: none;
415
- -webkit-overflow-scrolling: touch;
416
- mask-image: linear-gradient(to right, black 95%, transparent 100%);
417
- }
418
- .rte-toolbar::-webkit-scrollbar {
419
- display: none;
420
- }
421
- }
422
-
423
- /* ── Default variant: classic bordered toolbar ── */
424
- .rte-root[data-variant="default"] .rte-controls-group {
425
- display: flex;
426
- align-items: center;
427
- }
428
- .rte-root[data-variant="default"] .rte-controls-group > button {
429
- border: 1px solid var(--border);
430
- border-radius: 0;
431
- min-width: 1.625rem;
432
- height: 1.625rem;
433
- background-color: var(--background);
434
- transition: background-color 150ms ease-out, color 150ms ease-out, box-shadow 150ms ease-out;
435
- }
436
- .rte-root[data-variant="default"]
437
- .rte-controls-group
438
- > button:not(:last-of-type) {
439
- border-inline-end-width: 0;
440
- }
441
- .rte-root[data-variant="default"] .rte-controls-group > button:first-of-type {
442
- border-start-start-radius: calc(var(--radius) - 1px);
443
- border-end-start-radius: calc(var(--radius) - 1px);
444
- }
445
- .rte-root[data-variant="default"] .rte-controls-group > button:last-of-type {
446
- border-start-end-radius: calc(var(--radius) - 1px);
447
- border-end-end-radius: calc(var(--radius) - 1px);
448
- }
449
- .rte-root[data-variant="default"] .rte-controls-group > button:hover {
450
- background-color: var(--accent);
451
- color: var(--accent-foreground);
452
- }
453
- .rte-root[data-variant="default"] .rte-controls-group > button[data-state="on"],
454
- .rte-root[data-variant="default"]
455
- .rte-controls-group
456
- > button[aria-pressed="true"] {
457
- background-color: var(--accent);
458
- color: var(--accent-foreground);
459
- box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
460
- }
461
-
462
- /* ── Subtle variant: elevated card with soft toolbar ── */
463
- .rte-root[data-variant="subtle"] {
464
- border-color: transparent;
465
- box-shadow:
466
- 0 1px 3px rgba(0, 0, 0, 0.06),
467
- 0 1px 2px rgba(0, 0, 0, 0.04);
468
- }
469
- .rte-toolbar--subtle {
470
- border-bottom: 1px solid var(--border);
471
- padding: 0.25rem 0.375rem;
472
- gap: 0.25rem;
473
- background-color: var(--muted);
474
- }
475
- .rte-root[data-variant="subtle"] .rte-content .ProseMirror {
476
- padding: 0.875rem;
477
- }
478
- .rte-root[data-variant="subtle"] .rte-controls-group {
479
- display: flex;
480
- align-items: center;
481
- }
482
- .rte-root[data-variant="subtle"] .rte-controls-group > button {
483
- border: none;
484
- border-radius: calc(var(--radius) - 2px);
485
- min-width: 2rem;
486
- height: 2rem;
487
- background-color: transparent;
488
- transition: background-color 150ms ease-out, color 150ms ease-out;
489
- }
490
- .rte-root[data-variant="subtle"] .rte-controls-group > button:hover {
491
- background-color: var(--accent);
492
- color: var(--accent-foreground);
493
- }
494
- .rte-root[data-variant="subtle"] .rte-controls-group > button[data-state="on"],
495
- .rte-root[data-variant="subtle"]
496
- .rte-controls-group
497
- > button[aria-pressed="true"] {
498
- background-color: color-mix(in srgb, var(--accent) 90%, black 5%);
499
- color: var(--accent-foreground);
500
- }
501
-
502
- /* ── Compact variant: inline fused toolbar-content ── */
503
- .rte-root[data-variant="compact"] {
504
- border-radius: var(--radius);
505
- }
506
- .rte-toolbar--compact {
507
- padding: 0.25rem 0.375rem;
508
- gap: 0.125rem;
509
- border-bottom: none;
510
- background-color: var(--muted);
511
- }
512
- .rte-root[data-variant="compact"] .rte-content .ProseMirror {
513
- padding: 0.5rem 0.625rem;
514
- min-height: 100px;
515
- }
516
- .rte-root[data-variant="compact"] .rte-controls-group {
517
- display: flex;
518
- align-items: center;
519
- }
520
- .rte-root[data-variant="compact"] .rte-controls-group > button {
521
- border: none;
522
- border-radius: calc(var(--radius) - 3px);
523
- min-width: 1.5rem;
524
- height: 1.5rem;
525
- background-color: transparent;
526
- transition: background-color 150ms ease-out, color 150ms ease-out;
527
- }
528
- .rte-root[data-variant="compact"] .rte-controls-group > button:hover {
529
- background-color: var(--accent);
530
- color: var(--accent-foreground);
531
- }
532
- .rte-root[data-variant="compact"] .rte-controls-group > button[data-state="on"],
533
- .rte-root[data-variant="compact"]
534
- .rte-controls-group
535
- > button[aria-pressed="true"] {
536
- background-color: var(--accent);
537
- color: var(--accent-foreground);
538
- }
539
- .rte-root[data-variant="compact"] .rte-editor-icon {
540
- height: 0.75rem;
541
- width: 0.75rem;
542
- }
543
-
544
- /* ── Controls group base (no separators) ── */
545
- .rte-controls-group {
546
- display: flex;
547
- align-items: center;
548
- }
549
-
550
- .rte-link-editor {
551
- display: flex;
552
- align-items: center;
553
- gap: 0.25rem;
554
- }
555
-
556
- .rte-link-editor-input {
557
- flex: 1;
558
- min-width: 200px;
559
- }
560
-
561
- .rte-link-editor-save {
562
- border-start-start-radius: 0;
563
- border-end-start-radius: 0;
564
- }
565
-
566
- /* ── Task Lists ── */
567
- .rte-task-list {
568
- list-style-type: none;
569
- padding: 0;
570
- padding-inline-start: 0;
571
- }
572
-
573
- .rte-task-list li {
574
- margin: 0;
575
- padding: 0;
576
- display: flex;
577
- align-items: flex-start;
578
- gap: 0.5rem;
579
- transition: opacity 150ms ease-out;
580
- }
581
-
582
- .rte-task-list li[data-checked] {
583
- opacity: 0.6;
584
- }
585
-
586
- .rte-task-list li[data-checked] > div {
587
- flex: 1;
588
- min-width: 0;
589
- }
590
-
591
- .rte-task-list ul {
592
- margin-top: 5px;
593
- }
594
-
595
- .rte-task-list p {
596
- margin: 0;
597
- padding: 0;
598
- }
599
-
600
- .rte-task-list label {
601
- display: inline-flex;
602
- align-items: center;
603
- cursor: pointer;
604
- }
605
-
606
- .rte-task-list input[type="checkbox"] {
607
- cursor: pointer;
608
- appearance: none;
609
- width: 18px;
610
- height: 18px;
611
- border: 1px solid var(--border);
612
- border-radius: calc(var(--radius) - 2px);
613
- background-color: var(--background);
614
- vertical-align: middle;
615
- position: relative;
616
- flex-shrink: 0;
617
- transition:
618
- background-color 150ms ease-out,
619
- border-color 150ms ease-out,
620
- transform 100ms ease-out;
621
- }
622
-
623
- .rte-task-list input[type="checkbox"]:active {
624
- transform: scale(0.96);
625
- }
626
-
627
- .rte-task-list input[type="checkbox"]:checked {
628
- background-color: var(--primary);
629
- border-color: var(--primary);
630
- }
631
-
632
- @keyframes checkmark-in {
633
- 0% {
634
- transform: scale(0.5) rotate(-15deg);
635
- opacity: 0;
636
- }
637
- 100% {
638
- transform: scale(1) rotate(0);
639
- opacity: 1;
640
- }
641
- }
642
-
643
- .rte-task-list input[type="checkbox"]:checked::before {
644
- position: absolute;
645
- content: "";
646
- inset: 0;
647
- background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAxMCA3Ij48cGF0aCBmaWxsPSIjZmZmIiBkPSJNNCA0LjU4NkwxLjcwNyAyLjI5M0ExIDEgMCAxMC4yOTMgMy43MDdsMyAzYS45OTcuOTk3IDAgMDAxLjQxNCAwbDUtNUExIDEgMCAxMDguMjkzLjI5M0w0IDQuNTg2eiIvPjwvc3ZnPg==");
648
- background-repeat: no-repeat;
649
- background-size: 10px;
650
- background-position: center;
651
- animation: checkmark-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
652
- }
653
-
654
- /* ── Embed nodes ── */
655
- .rte-embed-wrapper {
656
- margin: 1rem 0;
657
- transition:
658
- opacity 150ms ease-out,
659
- transform 150ms ease-out;
660
- }
661
-
662
- .rte-embed-wrapper[data-align="left"] {
663
- text-align: left;
664
- }
665
- .rte-embed-wrapper[data-align="center"] {
666
- text-align: center;
667
- }
668
- .rte-embed-wrapper[data-align="right"] {
669
- text-align: right;
670
- }
671
-
672
- .rte-embed-wrapper[data-selected] .rte-embed {
673
- outline: 2px solid var(--primary);
674
- outline-offset: 2px;
675
- border-radius: var(--radius);
676
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
677
- }
678
-
679
- .rte-embed {
680
- position: relative;
681
- overflow: hidden;
682
- border-radius: var(--radius);
683
- background: var(--muted);
684
- display: inline-block;
685
- transition:
686
- outline-color 150ms ease-out,
687
- box-shadow 150ms ease-out;
688
- }
689
-
690
- .rte-embed-iframe {
691
- width: 100%;
692
- height: 100%;
693
- aspect-ratio: 16 / 9;
694
- border: 0;
695
- display: block;
696
- }
697
-
698
- .rte-embed-loading {
699
- padding: 2rem;
700
- text-align: center;
701
- color: var(--muted-foreground);
702
- animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
703
- }
704
-
705
- @keyframes pulse {
706
- 0%,
707
- 100% {
708
- opacity: 1;
709
- }
710
- 50% {
711
- opacity: 0.5;
712
- }
713
- }
714
-
715
- /* ── Resize handles for embeds ── */
716
- .rte-resize-handle {
717
- position: absolute;
718
- z-index: 10;
719
- opacity: 0;
720
- transition:
721
- opacity 150ms ease-out,
722
- background-color 150ms ease-out;
723
- }
724
-
725
- .rte-embed-wrapper[data-selected] .rte-resize-handle {
726
- opacity: 1;
727
- }
728
-
729
- .rte-resize-handle--right {
730
- top: 0;
731
- bottom: 0;
732
- right: -3px;
733
- width: 6px;
734
- cursor: ew-resize;
735
- background: transparent;
736
- }
737
-
738
- .rte-resize-handle--right::after {
739
- content: "";
740
- position: absolute;
741
- inset: 4px 1px;
742
- width: 2px;
743
- background: var(--primary);
744
- border-radius: 1px;
745
- transition:
746
- width 150ms ease-out,
747
- inset 150ms ease-out;
748
- }
749
-
750
- .rte-resize-handle--right:hover::after {
751
- width: 4px;
752
- inset: 4px 0;
753
- }
754
-
755
- .rte-resize-handle--bottom {
756
- left: 0;
757
- right: 0;
758
- bottom: -3px;
759
- height: 6px;
760
- cursor: ns-resize;
761
- background: transparent;
762
- }
763
-
764
- .rte-resize-handle--bottom::after {
765
- content: "";
766
- position: absolute;
767
- left: 4px;
768
- right: 4px;
769
- height: 2px;
770
- background: var(--primary);
771
- border-radius: 1px;
772
- bottom: 1px;
773
- transition:
774
- height 150ms ease-out,
775
- bottom 150ms ease-out;
776
- }
777
-
778
- .rte-resize-handle--bottom:hover::after {
779
- height: 4px;
780
- bottom: 0;
781
- }
782
-
783
- .rte-resize-handle--corner {
784
- bottom: -5px;
785
- right: -5px;
786
- width: 12px;
787
- height: 12px;
788
- cursor: nwse-resize;
789
- background: var(--primary);
790
- border: 2px solid var(--background);
791
- border-radius: 2px;
792
- transition: transform 150ms ease-out;
793
- }
794
-
795
- .rte-resize-handle--corner:hover {
796
- transform: scale(1.15);
797
- }
798
-
799
- /* ── Bubble Menu ── */
800
- @keyframes rte-bubble-pop-in {
801
- 0% { opacity: 0; transform: scale(0.96) translateY(4px); }
802
- 100% { opacity: 1; transform: scale(1) translateY(0); }
803
- }
804
-
805
- .rte-bubble-menu {
806
- display: flex;
807
- align-items: center;
808
- height: 2.25rem;
809
- background: var(--popover);
810
- border: 1px solid var(--border);
811
- border-radius: var(--radius);
812
- box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
813
- padding: 0 0.25rem;
814
- animation: rte-bubble-pop-in 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
815
- }
816
-
817
- .rte-bubble-group {
818
- display: flex;
819
- align-items: center;
820
- gap: 1px;
821
- }
822
-
823
- .rte-bubble-separator {
824
- width: 1px;
825
- height: 1.25rem;
826
- background: var(--border);
827
- margin: 0 0.125rem;
828
- flex-shrink: 0;
829
- }
830
-
831
- .rte-bubble-btn {
832
- display: flex;
833
- align-items: center;
834
- gap: 0.25rem;
835
- height: 1.75rem;
836
- padding: 0 0.375rem;
837
- border: none;
838
- border-radius: calc(var(--radius) - 4px);
839
- background: transparent;
840
- color: var(--popover-foreground);
841
- cursor: pointer;
842
- font-size: 0.8125rem;
843
- white-space: nowrap;
844
- transition: background-color 150ms ease-out, color 150ms ease-out, transform 100ms ease-out;
845
- }
846
-
847
- .rte-bubble-btn:hover {
848
- background: var(--accent);
849
- color: var(--accent-foreground);
850
- }
851
-
852
- .rte-bubble-btn:active {
853
- transform: scale(0.96);
854
- }
855
-
856
- .rte-bubble-btn--active {
857
- color: var(--primary);
858
- background: var(--accent);
859
- }
860
-
861
- .rte-bubble-btn-icon {
862
- display: flex;
863
- align-items: center;
864
- justify-content: center;
865
- flex-shrink: 0;
866
- width: 1rem;
867
- height: 1rem;
868
- }
869
-
870
- .rte-bubble-btn-icon svg {
871
- width: 100%;
872
- height: 100%;
873
- }
874
-
875
- .rte-bubble-btn-text {
876
- max-width: 5rem;
877
- overflow: hidden;
878
- text-overflow: ellipsis;
879
- }
880
-
881
- .rte-bubble-overlay {
882
- position: fixed;
883
- inset: 0;
884
- z-index: 999;
885
- }
886
-
887
- .rte-bubble-dropdown {
888
- position: absolute;
889
- top: 100%;
890
- left: 0;
891
- z-index: 1000;
892
- min-width: 150px;
893
- background: var(--popover);
894
- border: 1px solid var(--border);
895
- border-radius: var(--radius);
896
- box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
897
- padding: 0.25rem;
898
- margin-top: 4px;
899
- transform-origin: top left;
900
- animation: rte-bubble-pop-in 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
901
- }
902
-
903
- .rte-bubble-dropdown--language {
904
- min-width: 160px;
905
- max-height: 320px;
906
- overflow-y: auto;
907
- scrollbar-width: thin;
908
- }
909
-
910
- .rte-bubble-dropdown-item {
911
- display: flex;
912
- align-items: center;
913
- justify-content:flex-start;
914
- gap: 0.5rem;
915
- width: 100%;
916
- padding: 0.375rem 0.5rem;
917
- font-size: 0.8125rem;
918
- color: var(--popover-foreground);
919
- background: transparent;
920
- border: none;
921
- border-radius: calc(var(--radius) - 4px);
922
- cursor: pointer;
923
- text-align: left;
924
- transition: background-color 100ms ease-out, color 100ms ease-out;
925
- }
926
-
927
- .rte-bubble-dropdown-item:hover {
928
- background: var(--accent);
929
- color: var(--accent-foreground);
930
- }
931
-
932
- .rte-bubble-dropdown-item--active {
933
- color: var(--primary);
934
- background-color: color-mix(in srgb, var(--primary) 10%, transparent);
935
- }
936
-
937
- .rte-bubble-dropdown-icon {
938
- display: flex;
939
- align-items: center;
940
- justify-content: center;
941
- flex-shrink: 0;
942
- color: var(--muted-foreground);
943
- width: 1rem;
944
- height: 1rem;
945
- }
946
-
947
- .rte-bubble-dropdown-icon svg {
948
- width: 100%;
949
- height: 100%;
950
- }
951
-
952
- .rte-bubble-dropdown-item--active .rte-bubble-dropdown-icon {
953
- color: var(--primary);
954
- }
955
-
956
- /* ── Suppress transitions on theme switch ── */
957
- .rte-theme-transitioning *,
958
- .rte-theme-transitioning *::before,
959
- .rte-theme-transitioning *::after {
960
- transition: none !important;
961
- }
1
+ /* ── Main Editor Wrapper ── */
2
+ .rte-root {
3
+ position: relative;
4
+ border-radius: var(--radius);
5
+ border: 1px solid var(--border);
6
+ background-color: var(--background);
7
+ transition:
8
+ border-color 150ms ease-out,
9
+ box-shadow 150ms ease-out;
10
+ }
11
+
12
+ .rte-editor-icon {
13
+ width: 1rem;
14
+ height: 1rem;
15
+ flex-shrink: 0;
16
+ }
17
+
18
+ button.rte-control-button {
19
+ display: inline-flex;
20
+ align-items: center;
21
+ justify-content: center;
22
+ height: 2rem;
23
+ min-width: 2rem;
24
+ padding: 0;
25
+ transition:
26
+ background-color 150ms ease-out,
27
+ color 150ms ease-out,
28
+ transform 100ms ease-out;
29
+ }
30
+
31
+ button.rte-control-button:active {
32
+ transform: scale(0.96);
33
+ }
34
+
35
+ /* ── Editor Content ── */
36
+ .rte-content .ProseMirror {
37
+ outline: 0;
38
+ padding: var(--spacing, 0.75rem);
39
+ min-height: 140px;
40
+ }
41
+
42
+ .rte-content .ProseMirror > *:last-child {
43
+ margin-bottom: 0;
44
+ }
45
+
46
+ .rte-content .ProseMirror p.is-editor-empty:first-of-type::before {
47
+ content: attr(data-placeholder);
48
+ pointer-events: none;
49
+ user-select: none;
50
+ float: left;
51
+ height: 0;
52
+ color: var(--muted-foreground);
53
+ transition: opacity 150ms ease-out;
54
+ }
55
+
56
+ .rte-content .ProseMirror p {
57
+ margin-top: 0;
58
+ margin-bottom: 0.75rem;
59
+ line-height: 1.75;
60
+ }
61
+
62
+ .rte-content .ProseMirror h1,
63
+ .rte-content .ProseMirror h2,
64
+ .rte-content .ProseMirror h3,
65
+ .rte-content .ProseMirror h4,
66
+ .rte-content .ProseMirror h5,
67
+ .rte-content .ProseMirror h6,
68
+ .rte-content .ProseMirror p {
69
+ margin-top: 0;
70
+ }
71
+
72
+ .rte-content .ProseMirror h1 {
73
+ font-size: 1.5rem;
74
+ font-weight: 700;
75
+ letter-spacing: -0.025em;
76
+ margin-bottom: 1rem;
77
+ margin-top: 1.5rem;
78
+ }
79
+ .rte-content .ProseMirror h1:first-child {
80
+ margin-top: 0;
81
+ }
82
+
83
+ .rte-content .ProseMirror h2 {
84
+ font-size: 1.25rem;
85
+ font-weight: 600;
86
+ letter-spacing: -0.025em;
87
+ margin-bottom: 0.75rem;
88
+ margin-top: 1.25rem;
89
+ }
90
+ .rte-content .ProseMirror h2:first-child {
91
+ margin-top: 0;
92
+ }
93
+
94
+ .rte-content .ProseMirror h3 {
95
+ font-size: 1.125rem;
96
+ font-weight: 600;
97
+ margin-bottom: 0.5rem;
98
+ margin-top: 1rem;
99
+ }
100
+ .rte-content .ProseMirror h3:first-child {
101
+ margin-top: 0;
102
+ }
103
+
104
+ .rte-content .ProseMirror h4 {
105
+ font-size: 1rem;
106
+ font-weight: 600;
107
+ margin-bottom: 0.5rem;
108
+ margin-top: 0.75rem;
109
+ }
110
+ .rte-content .ProseMirror h4:first-child {
111
+ margin-top: 0;
112
+ }
113
+
114
+ .rte-content .ProseMirror h5 {
115
+ font-size: 0.875rem;
116
+ font-weight: 600;
117
+ margin-bottom: 0.5rem;
118
+ margin-top: 0.75rem;
119
+ }
120
+ .rte-content .ProseMirror h5:first-child {
121
+ margin-top: 0;
122
+ }
123
+
124
+ .rte-content .ProseMirror h6 {
125
+ font-size: 0.875rem;
126
+ font-weight: 500;
127
+ margin-bottom: 0.5rem;
128
+ margin-top: 0.75rem;
129
+ }
130
+ .rte-content .ProseMirror h6:first-child {
131
+ margin-top: 0;
132
+ }
133
+
134
+ .rte-content .ProseMirror ul {
135
+ list-style-type: disc;
136
+ padding-left: 1.5rem;
137
+ margin-bottom: 0.75rem;
138
+ }
139
+
140
+ .rte-content .ProseMirror ol {
141
+ list-style-type: decimal;
142
+ padding-left: 1.5rem;
143
+ margin-bottom: 0.75rem;
144
+ }
145
+
146
+ .rte-content .ProseMirror li {
147
+ line-height: 1.75;
148
+ }
149
+
150
+ .rte-content .ProseMirror li > p {
151
+ margin-bottom: 0;
152
+ }
153
+
154
+ .rte-content .ProseMirror ul li,
155
+ .rte-content .ProseMirror ol li {
156
+ margin-top: 2px;
157
+ }
158
+
159
+ .rte-content .ProseMirror blockquote {
160
+ border-left: 3px solid var(--border);
161
+ padding-left: 1rem;
162
+ margin-top: 1rem;
163
+ margin-bottom: 1rem;
164
+ color: var(--muted-foreground);
165
+ font-style: italic;
166
+ }
167
+
168
+ .rte-content .ProseMirror pre code {
169
+ color: inherit;
170
+ background: none;
171
+ padding: 0;
172
+ font-weight: 400;
173
+ }
174
+
175
+ .rte-content .ProseMirror pre {
176
+ background-color: var(--muted);
177
+ color: var(--foreground);
178
+ border-radius: var(--radius);
179
+ border: 1px solid var(--border);
180
+ padding: 1rem;
181
+ margin-top: 1rem;
182
+ margin-bottom: 1rem;
183
+ overflow-x: auto;
184
+ font-family: var(--font-mono);
185
+ font-size: 0.875rem;
186
+ }
187
+
188
+ .rte-content .ProseMirror pre code {
189
+ background: none;
190
+ color: inherit;
191
+ border: none;
192
+ font-size: 0.875rem;
193
+ padding: 0;
194
+ }
195
+
196
+ .rte-content .ProseMirror hr {
197
+ border: none;
198
+ border-top: 1px solid var(--border);
199
+ margin-top: 1.5rem;
200
+ margin-bottom: 1.5rem;
201
+ }
202
+
203
+ .rte-content .ProseMirror a {
204
+ color: var(--primary);
205
+ text-decoration: underline;
206
+ text-underline-offset: 4px;
207
+ cursor: pointer;
208
+ transition:
209
+ color 150ms ease-out,
210
+ text-decoration-color 150ms ease-out;
211
+ text-decoration-color: color-mix(in srgb, var(--primary) 40%, transparent);
212
+ }
213
+
214
+ .rte-content .ProseMirror a:hover {
215
+ color: color-mix(in srgb, var(--primary) 80%, transparent);
216
+ text-decoration-color: color-mix(in srgb, var(--primary) 80%, transparent);
217
+ }
218
+
219
+ .rte-content .ProseMirror ::selection {
220
+ background-color: color-mix(in srgb, var(--primary) 15%, transparent);
221
+ }
222
+
223
+ /* Syntax Highlighting */
224
+ .rte-content .ProseMirror pre .hljs-comment,
225
+ .rte-content .ProseMirror pre .hljs-quote {
226
+ color: #6c7086;
227
+ }
228
+
229
+ .rte-content .ProseMirror pre .hljs-variable,
230
+ .rte-content .ProseMirror pre .hljs-template-variable,
231
+ .rte-content .ProseMirror pre .hljs-attribute,
232
+ .rte-content .ProseMirror pre .hljs-tag,
233
+ .rte-content .ProseMirror pre .hljs-regexp,
234
+ .rte-content .ProseMirror pre .hljs-link,
235
+ .rte-content .ProseMirror pre .hljs-name,
236
+ .rte-content .ProseMirror pre .hljs-selector-id,
237
+ .rte-content .ProseMirror pre .hljs-selector-class {
238
+ color: #89b4fa;
239
+ }
240
+
241
+ .rte-content .ProseMirror pre .hljs-number,
242
+ .rte-content .ProseMirror pre .hljs-meta,
243
+ .rte-content .ProseMirror pre .hljs-built_in,
244
+ .rte-content .ProseMirror pre .hljs-builtin-name,
245
+ .rte-content .ProseMirror pre .hljs-literal,
246
+ .rte-content .ProseMirror pre .hljs-type,
247
+ .rte-content .ProseMirror pre .hljs-params {
248
+ color: #fab387;
249
+ }
250
+
251
+ .rte-content .ProseMirror pre .hljs-string,
252
+ .rte-content .ProseMirror pre .hljs-symbol,
253
+ .rte-content .ProseMirror pre .hljs-bullet {
254
+ color: #a6e3a1;
255
+ }
256
+
257
+ .rte-content .ProseMirror pre .hljs-title,
258
+ .rte-content .ProseMirror pre .hljs-section {
259
+ color: #f9e2af;
260
+ }
261
+
262
+ .rte-content .ProseMirror pre .hljs-keyword,
263
+ .rte-content .ProseMirror pre .hljs-selector-tag {
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;
299
+ }
300
+
301
+ .rte-content .ProseMirror pre .hljs-emphasis {
302
+ font-style: italic;
303
+ }
304
+ .rte-content .ProseMirror pre .hljs-strong {
305
+ font-weight: 700;
306
+ }
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
+
327
+ /* ── Toolbars and Footer ── */
328
+ .rte-toolbar {
329
+ display: flex;
330
+ align-items: center;
331
+ justify-content: center;
332
+ flex-wrap: wrap;
333
+ gap: 0.5rem;
334
+ top: var(--rte-sticky-offset, 0px);
335
+ background-color: color-mix(in srgb, var(--muted) 35%, var(--background));
336
+ z-index: 1;
337
+ border-start-end-radius: var(--radius);
338
+ border-start-start-radius: var(--radius);
339
+ border-bottom: 1px solid var(--border);
340
+ padding: 0.5rem 0.75rem;
341
+ transition:
342
+ box-shadow 150ms ease-out,
343
+ background-color 150ms ease-out;
344
+ }
345
+
346
+ .rte-toolbar[data-sticky] {
347
+ position: sticky;
348
+ background-color: color-mix(in srgb, var(--background) 85%, transparent);
349
+ backdrop-filter: blur(8px);
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
+ }
361
+ }
362
+
363
+ .rte-footer {
364
+ display: flex;
365
+ align-items: center;
366
+ justify-content: space-between;
367
+ flex-wrap: wrap;
368
+ gap: 0.5rem;
369
+ background-color: var(--background);
370
+ z-index: 1;
371
+ border-end-end-radius: var(--radius);
372
+ border-end-start-radius: var(--radius);
373
+ border-top: 1px solid var(--border);
374
+ padding: 0.5rem 0.75rem;
375
+ font-size: 0.75rem;
376
+ color: var(--muted-foreground);
377
+ }
378
+
379
+ .rte-footer[data-sticky] {
380
+ position: sticky;
381
+ bottom: 0;
382
+ background-color: color-mix(in srgb, var(--background) 85%, transparent);
383
+ backdrop-filter: blur(8px);
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
+ }
395
+ }
396
+
397
+ .rte-footer-word-count {
398
+ display: inline-flex;
399
+ align-items: center;
400
+ gap: 0.375rem;
401
+ white-space: nowrap;
402
+ font-size: 0.75rem;
403
+ letter-spacing: 0.01em;
404
+ }
405
+
406
+ .rte-footer-word-count-stat {
407
+ display: inline-flex;
408
+ align-items: baseline;
409
+ gap: 0.25rem;
410
+ }
411
+
412
+ .rte-footer-word-count-number {
413
+ font-weight: 600;
414
+ font-variant-numeric: tabular-nums;
415
+ color: var(--foreground);
416
+ }
417
+
418
+ .rte-footer-word-count-unit {
419
+ color: var(--muted-foreground);
420
+ }
421
+
422
+ .rte-footer-word-count-separator {
423
+ width: 3px;
424
+ height: 3px;
425
+ flex-shrink: 0;
426
+ border-radius: 9999px;
427
+ background-color: color-mix(
428
+ in srgb,
429
+ var(--muted-foreground) 45%,
430
+ transparent
431
+ );
432
+ }
433
+
434
+ .rte-toolbar--subtle + .rte-content + .rte-footer {
435
+ background-color: var(--muted);
436
+ }
437
+ .rte-toolbar--compact + .rte-content + .rte-footer {
438
+ background-color: var(--muted);
439
+ }
440
+
441
+ @media (max-width: 640px) {
442
+ .rte-toolbar {
443
+ flex-wrap: nowrap;
444
+ overflow-x: auto;
445
+ justify-content: flex-start;
446
+ scrollbar-width: none;
447
+ -ms-overflow-style: none;
448
+ -webkit-overflow-scrolling: touch;
449
+ mask-image: linear-gradient(to right, black 95%, transparent 100%);
450
+ }
451
+ .rte-toolbar::-webkit-scrollbar {
452
+ display: none;
453
+ }
454
+ }
455
+
456
+ /* ── Default variant: classic bordered toolbar ── */
457
+ .rte-root[data-variant="default"] .rte-controls-group {
458
+ display: flex;
459
+ align-items: center;
460
+ }
461
+ .rte-root[data-variant="default"] .rte-controls-group > button {
462
+ border: 1px solid var(--border);
463
+ border-radius: 0;
464
+ min-width: 1.75rem;
465
+ height: 1.75rem;
466
+ background-color: var(--background);
467
+ color: var(--muted-foreground);
468
+ transition:
469
+ background-color 150ms ease-out,
470
+ color 150ms ease-out,
471
+ box-shadow 150ms ease-out;
472
+ }
473
+ .rte-root[data-variant="default"]
474
+ .rte-controls-group
475
+ > button:not(:last-of-type) {
476
+ border-inline-end-width: 0;
477
+ }
478
+ .rte-root[data-variant="default"] .rte-controls-group > button:first-of-type {
479
+ border-start-start-radius: calc(var(--radius) - 2px);
480
+ border-end-start-radius: calc(var(--radius) - 2px);
481
+ }
482
+ .rte-root[data-variant="default"] .rte-controls-group > button:last-of-type {
483
+ border-start-end-radius: calc(var(--radius) - 2px);
484
+ border-end-end-radius: calc(var(--radius) - 2px);
485
+ }
486
+ .rte-root[data-variant="default"] .rte-controls-group > button:hover {
487
+ background-color: var(--accent);
488
+ color: var(--accent-foreground);
489
+ }
490
+ .rte-root[data-variant="default"] .rte-controls-group > button:focus-visible {
491
+ outline: 2px solid color-mix(in srgb, var(--primary) 40%, transparent);
492
+ outline-offset: -2px;
493
+ background-color: color-mix(in srgb, var(--primary) 8%, transparent);
494
+ }
495
+ .rte-root[data-variant="default"] .rte-controls-group > button[data-state="on"],
496
+ .rte-root[data-variant="default"]
497
+ .rte-controls-group
498
+ > button[aria-pressed="true"] {
499
+ background-color: var(--accent);
500
+ color: var(--accent-foreground);
501
+ box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
502
+ }
503
+
504
+ /* ── Subtle variant: elevated card with soft toolbar ── */
505
+ .rte-root[data-variant="subtle"] {
506
+ border-color: transparent;
507
+ box-shadow:
508
+ 0 1px 3px rgba(0, 0, 0, 0.06),
509
+ 0 1px 2px rgba(0, 0, 0, 0.04);
510
+ }
511
+ .rte-toolbar--subtle {
512
+ border-bottom: 1px solid var(--border);
513
+ padding: 0.375rem 0.5rem;
514
+ gap: 0.375rem;
515
+ background-color: var(--muted);
516
+ }
517
+ .rte-root[data-variant="subtle"] .rte-content .ProseMirror {
518
+ padding: 0.875rem;
519
+ }
520
+ .rte-root[data-variant="subtle"] .rte-controls-group {
521
+ display: flex;
522
+ align-items: center;
523
+ }
524
+ .rte-root[data-variant="subtle"]
525
+ .rte-controls-group
526
+ + .rte-controls-group::before {
527
+ content: "";
528
+ width: 1px;
529
+ height: 1rem;
530
+ margin-inline: 0.25rem;
531
+ background-color: var(--border);
532
+ flex-shrink: 0;
533
+ }
534
+ .rte-root[data-variant="subtle"] .rte-controls-group > button {
535
+ border: none;
536
+ border-radius: calc(var(--radius) - 2px);
537
+ min-width: 2rem;
538
+ height: 2rem;
539
+ background-color: transparent;
540
+ color: var(--muted-foreground);
541
+ transition:
542
+ background-color 150ms ease-out,
543
+ color 150ms ease-out;
544
+ }
545
+ .rte-root[data-variant="subtle"] .rte-controls-group > button:hover {
546
+ background-color: var(--accent);
547
+ color: var(--accent-foreground);
548
+ }
549
+ .rte-root[data-variant="subtle"] .rte-controls-group > button:focus-visible {
550
+ outline: 2px solid color-mix(in srgb, var(--primary) 40%, transparent);
551
+ outline-offset: 1px;
552
+ background-color: var(--accent);
553
+ color: var(--accent-foreground);
554
+ }
555
+ .rte-root[data-variant="subtle"] .rte-controls-group > button[data-state="on"],
556
+ .rte-root[data-variant="subtle"]
557
+ .rte-controls-group
558
+ > button[aria-pressed="true"] {
559
+ background-color: color-mix(in srgb, var(--primary) 12%, transparent);
560
+ color: var(--primary);
561
+ box-shadow: inset 0 0 0 1px
562
+ color-mix(in srgb, var(--primary) 25%, transparent);
563
+ }
564
+
565
+ /* ── Compact variant: inline fused toolbar-content ── */
566
+ .rte-root[data-variant="compact"] {
567
+ border-radius: var(--radius);
568
+ }
569
+ .rte-toolbar--compact {
570
+ padding: 0.25rem 0.375rem;
571
+ gap: 0.25rem;
572
+ border-bottom: none;
573
+ background-color: var(--muted);
574
+ }
575
+ .rte-root[data-variant="compact"] .rte-content .ProseMirror {
576
+ padding: 0.5rem 0.625rem;
577
+ min-height: 100px;
578
+ }
579
+ .rte-root[data-variant="compact"] .rte-controls-group {
580
+ display: flex;
581
+ align-items: center;
582
+ }
583
+ .rte-root[data-variant="compact"]
584
+ .rte-controls-group
585
+ + .rte-controls-group::before {
586
+ content: "";
587
+ width: 1px;
588
+ height: 0.875rem;
589
+ margin-inline: 0.125rem;
590
+ background-color: var(--border);
591
+ flex-shrink: 0;
592
+ }
593
+ .rte-root[data-variant="compact"] .rte-controls-group > button {
594
+ border: none;
595
+ border-radius: calc(var(--radius) - 3px);
596
+ min-width: 1.5rem;
597
+ height: 1.5rem;
598
+ background-color: transparent;
599
+ color: var(--muted-foreground);
600
+ transition:
601
+ background-color 150ms ease-out,
602
+ color 150ms ease-out;
603
+ }
604
+ .rte-root[data-variant="compact"] .rte-controls-group > button:hover {
605
+ background-color: var(--accent);
606
+ color: var(--accent-foreground);
607
+ }
608
+ .rte-root[data-variant="compact"] .rte-controls-group > button:focus-visible {
609
+ outline: 2px solid color-mix(in srgb, var(--primary) 40%, transparent);
610
+ outline-offset: 1px;
611
+ background-color: var(--accent);
612
+ color: var(--accent-foreground);
613
+ }
614
+ .rte-root[data-variant="compact"] .rte-controls-group > button[data-state="on"],
615
+ .rte-root[data-variant="compact"]
616
+ .rte-controls-group
617
+ > button[aria-pressed="true"] {
618
+ background-color: color-mix(in srgb, var(--primary) 10%, transparent);
619
+ color: var(--primary);
620
+ box-shadow: inset 0 0 0 1px
621
+ color-mix(in srgb, var(--primary) 25%, transparent);
622
+ }
623
+ .rte-root[data-variant="compact"] .rte-editor-icon {
624
+ height: 0.875rem;
625
+ width: 0.875rem;
626
+ }
627
+
628
+ /* ── Controls group base (no separators) ── */
629
+ .rte-controls-group {
630
+ display: flex;
631
+ align-items: center;
632
+ }
633
+
634
+ .rte-link-editor {
635
+ display: flex;
636
+ align-items: center;
637
+ gap: 0.25rem;
638
+ }
639
+
640
+ .rte-link-editor-input {
641
+ flex: 1;
642
+ min-width: 200px;
643
+ }
644
+
645
+ .rte-link-editor-save {
646
+ border-start-start-radius: 0;
647
+ border-end-start-radius: 0;
648
+ }
649
+
650
+ /* ── Task Lists ── */
651
+ .rte-task-list {
652
+ list-style-type: none;
653
+ padding: 0;
654
+ padding-inline-start: 0;
655
+ }
656
+
657
+ .rte-task-list li {
658
+ margin: 0;
659
+ padding: 0;
660
+ display: flex;
661
+ align-items: flex-start;
662
+ gap: 0.5rem;
663
+ transition: opacity 150ms ease-out;
664
+ }
665
+
666
+ .rte-task-list li[data-checked] {
667
+ opacity: 0.6;
668
+ }
669
+
670
+ .rte-task-list li[data-checked] > div {
671
+ flex: 1;
672
+ min-width: 0;
673
+ }
674
+
675
+ .rte-task-list ul {
676
+ margin-top: 5px;
677
+ }
678
+
679
+ .rte-task-list p {
680
+ margin: 0;
681
+ padding: 0;
682
+ }
683
+
684
+ .rte-task-list label {
685
+ display: inline-flex;
686
+ align-items: center;
687
+ cursor: pointer;
688
+ }
689
+
690
+ .rte-task-list input[type="checkbox"] {
691
+ cursor: pointer;
692
+ appearance: none;
693
+ width: 18px;
694
+ height: 18px;
695
+ border: 1px solid var(--border);
696
+ border-radius: calc(var(--radius) - 2px);
697
+ background-color: var(--background);
698
+ vertical-align: middle;
699
+ position: relative;
700
+ flex-shrink: 0;
701
+ transition:
702
+ background-color 150ms ease-out,
703
+ border-color 150ms ease-out,
704
+ transform 100ms ease-out;
705
+ }
706
+
707
+ .rte-task-list input[type="checkbox"]:active {
708
+ transform: scale(0.96);
709
+ }
710
+
711
+ .rte-task-list input[type="checkbox"]:checked {
712
+ background-color: var(--primary);
713
+ border-color: var(--primary);
714
+ }
715
+
716
+ @keyframes checkmark-in {
717
+ 0% {
718
+ transform: scale(0.5) rotate(-15deg);
719
+ opacity: 0;
720
+ }
721
+ 100% {
722
+ transform: scale(1) rotate(0);
723
+ opacity: 1;
724
+ }
725
+ }
726
+
727
+ .rte-task-list input[type="checkbox"]:checked::before {
728
+ position: absolute;
729
+ content: "";
730
+ inset: 0;
731
+ background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAxMCA3Ij48cGF0aCBmaWxsPSIjZmZmIiBkPSJNNCA0LjU4NkwxLjcwNyAyLjI5M0ExIDEgMCAxMC4yOTMgMy43MDdsMyAzYS45OTcuOTk3IDAgMDAxLjQxNCAwbDUtNUExIDEgMCAxMDguMjkzLjI5M0w0IDQuNTg2eiIvPjwvc3ZnPg==");
732
+ background-repeat: no-repeat;
733
+ background-size: 10px;
734
+ background-position: center;
735
+ animation: checkmark-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
736
+ }
737
+
738
+ /* ── Embed nodes ── */
739
+ .rte-embed-wrapper {
740
+ margin: 1rem 0;
741
+ transition:
742
+ opacity 150ms ease-out,
743
+ transform 150ms ease-out;
744
+ }
745
+
746
+ .rte-embed-wrapper[data-align="left"] {
747
+ text-align: left;
748
+ }
749
+ .rte-embed-wrapper[data-align="center"] {
750
+ text-align: center;
751
+ }
752
+ .rte-embed-wrapper[data-align="right"] {
753
+ text-align: right;
754
+ }
755
+
756
+ .rte-embed-wrapper[data-selected] .rte-embed {
757
+ outline: 2px solid var(--primary);
758
+ outline-offset: 2px;
759
+ border-radius: var(--radius);
760
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
761
+ }
762
+
763
+ .rte-embed {
764
+ position: relative;
765
+ overflow: hidden;
766
+ border-radius: var(--radius);
767
+ background: var(--muted);
768
+ display: inline-block;
769
+ transition:
770
+ outline-color 150ms ease-out,
771
+ box-shadow 150ms ease-out;
772
+ }
773
+
774
+ .rte-embed-iframe {
775
+ width: 100%;
776
+ height: 100%;
777
+ aspect-ratio: 16 / 9;
778
+ border: 0;
779
+ display: block;
780
+ }
781
+
782
+ .rte-embed-loading {
783
+ padding: 2rem;
784
+ text-align: center;
785
+ color: var(--muted-foreground);
786
+ animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
787
+ }
788
+
789
+ @keyframes pulse {
790
+ 0%,
791
+ 100% {
792
+ opacity: 1;
793
+ }
794
+ 50% {
795
+ opacity: 0.5;
796
+ }
797
+ }
798
+
799
+ /* ── Resize handles for embeds ── */
800
+ .rte-resize-handle {
801
+ position: absolute;
802
+ z-index: 10;
803
+ opacity: 0;
804
+ transition:
805
+ opacity 150ms ease-out,
806
+ background-color 150ms ease-out;
807
+ }
808
+
809
+ .rte-embed-wrapper[data-selected] .rte-resize-handle {
810
+ opacity: 1;
811
+ }
812
+
813
+ .rte-resize-handle--right {
814
+ top: 0;
815
+ bottom: 0;
816
+ right: -3px;
817
+ width: 6px;
818
+ cursor: ew-resize;
819
+ background: transparent;
820
+ }
821
+
822
+ .rte-resize-handle--right::after {
823
+ content: "";
824
+ position: absolute;
825
+ inset: 4px 1px;
826
+ width: 2px;
827
+ background: var(--primary);
828
+ border-radius: 1px;
829
+ transition:
830
+ width 150ms ease-out,
831
+ inset 150ms ease-out;
832
+ }
833
+
834
+ .rte-resize-handle--right:hover::after {
835
+ width: 4px;
836
+ inset: 4px 0;
837
+ }
838
+
839
+ .rte-resize-handle--bottom {
840
+ left: 0;
841
+ right: 0;
842
+ bottom: -3px;
843
+ height: 6px;
844
+ cursor: ns-resize;
845
+ background: transparent;
846
+ }
847
+
848
+ .rte-resize-handle--bottom::after {
849
+ content: "";
850
+ position: absolute;
851
+ left: 4px;
852
+ right: 4px;
853
+ height: 2px;
854
+ background: var(--primary);
855
+ border-radius: 1px;
856
+ bottom: 1px;
857
+ transition:
858
+ height 150ms ease-out,
859
+ bottom 150ms ease-out;
860
+ }
861
+
862
+ .rte-resize-handle--bottom:hover::after {
863
+ height: 4px;
864
+ bottom: 0;
865
+ }
866
+
867
+ .rte-resize-handle--corner {
868
+ bottom: -5px;
869
+ right: -5px;
870
+ width: 12px;
871
+ height: 12px;
872
+ cursor: nwse-resize;
873
+ background: var(--primary);
874
+ border: 2px solid var(--background);
875
+ border-radius: 2px;
876
+ transition: transform 150ms ease-out;
877
+ }
878
+
879
+ .rte-resize-handle--corner:hover {
880
+ transform: scale(1.15);
881
+ }
882
+
883
+ /* ── Bubble Menu ── */
884
+ @keyframes rte-bubble-pop-in {
885
+ 0% {
886
+ opacity: 0;
887
+ transform: scale(0.98) translateY(6px);
888
+ }
889
+ 100% {
890
+ opacity: 1;
891
+ transform: scale(1) translateY(0);
892
+ }
893
+ }
894
+
895
+ .rte-bubble-menu {
896
+ display: flex;
897
+ align-items: center;
898
+ height: 2.25rem;
899
+ background: var(--popover);
900
+ border: 1px solid var(--border);
901
+ border-radius: var(--radius);
902
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
903
+ padding: 0 0.25rem;
904
+ animation: rte-bubble-pop-in 0.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
905
+ }
906
+
907
+ .rte-bubble-group {
908
+ display: flex;
909
+ align-items: center;
910
+ gap: 1px;
911
+ }
912
+
913
+ .rte-bubble-separator {
914
+ width: 1px;
915
+ height: 1.25rem;
916
+ background: var(--border);
917
+ margin: 0 0.125rem;
918
+ flex-shrink: 0;
919
+ }
920
+
921
+ .rte-bubble-btn {
922
+ display: flex;
923
+ align-items: center;
924
+ gap: 0.25rem;
925
+ height: 1.75rem;
926
+ padding: 0 0.375rem;
927
+ border: none;
928
+ border-radius: calc(var(--radius) - 4px);
929
+ background: transparent;
930
+ color: var(--popover-foreground);
931
+ cursor: pointer;
932
+ font-size: 0.8125rem;
933
+ white-space: nowrap;
934
+ transition:
935
+ background-color 150ms ease-out,
936
+ color 150ms ease-out,
937
+ transform 100ms ease-out;
938
+ }
939
+
940
+ .rte-bubble-btn:hover {
941
+ background: var(--accent);
942
+ color: var(--accent-foreground);
943
+ }
944
+
945
+ .rte-bubble-btn:active {
946
+ transform: scale(0.96);
947
+ }
948
+
949
+ .rte-bubble-btn--active {
950
+ color: var(--primary);
951
+ background: var(--accent);
952
+ }
953
+
954
+ .rte-bubble-btn-icon {
955
+ display: flex;
956
+ align-items: center;
957
+ justify-content: center;
958
+ flex-shrink: 0;
959
+ width: 1rem;
960
+ height: 1rem;
961
+ }
962
+
963
+ .rte-bubble-btn-icon svg {
964
+ width: 100%;
965
+ height: 100%;
966
+ }
967
+
968
+ .rte-bubble-btn-text {
969
+ max-width: 5rem;
970
+ overflow: hidden;
971
+ text-overflow: ellipsis;
972
+ }
973
+
974
+ .rte-bubble-overlay {
975
+ position: fixed;
976
+ inset: 0;
977
+ z-index: 999;
978
+ }
979
+
980
+ .rte-bubble-dropdown {
981
+ position: absolute;
982
+ top: 100%;
983
+ left: 0;
984
+ z-index: 1000;
985
+ min-width: 150px;
986
+ background: var(--popover);
987
+ border: 1px solid var(--border);
988
+ border-radius: var(--radius);
989
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
990
+ padding: 0.25rem;
991
+ margin-top: 4px;
992
+ transform-origin: top left;
993
+ animation: rte-bubble-pop-in 0.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
994
+ }
995
+
996
+ .rte-bubble-dropdown--language {
997
+ min-width: 160px;
998
+ max-height: 320px;
999
+ overflow-y: auto;
1000
+ scrollbar-width: thin;
1001
+ }
1002
+
1003
+ .rte-bubble-dropdown-item {
1004
+ display: flex;
1005
+ align-items: center;
1006
+ justify-content: flex-start;
1007
+ gap: 0.5rem;
1008
+ position: relative;
1009
+ z-index: 1;
1010
+ width: 100%;
1011
+ padding: 0.375rem 0.5rem;
1012
+ font-size: 0.8125rem;
1013
+ color: var(--muted-foreground);
1014
+ background: transparent;
1015
+ border: none;
1016
+ border-radius: calc(var(--radius) - 4px);
1017
+ cursor: pointer;
1018
+ text-align: left;
1019
+ transition:
1020
+ background-color 100ms ease-out,
1021
+ color 100ms ease-out;
1022
+ }
1023
+
1024
+ .rte-bubble-dropdown-item:hover,
1025
+ .rte-bubble-dropdown-item:focus-visible {
1026
+ color: var(--foreground);
1027
+ }
1028
+
1029
+ .rte-bubble-dropdown-pill {
1030
+ position: absolute;
1031
+ top: 0;
1032
+ left: 0;
1033
+ z-index: 0;
1034
+ pointer-events: none;
1035
+ border-radius: calc(var(--radius) - 4px);
1036
+ background: color-mix(in srgb, var(--primary) 6%, transparent);
1037
+ opacity: 0;
1038
+ transition:
1039
+ top 220ms cubic-bezier(0.22, 1, 0.36, 1),
1040
+ left 220ms cubic-bezier(0.22, 1, 0.36, 1),
1041
+ width 220ms cubic-bezier(0.22, 1, 0.36, 1),
1042
+ height 220ms cubic-bezier(0.22, 1, 0.36, 1),
1043
+ opacity 150ms ease-out;
1044
+ }
1045
+
1046
+ .rte-bubble-dropdown-pill--visible {
1047
+ opacity: 1;
1048
+ }
1049
+
1050
+ .rte-bubble-dropdown-item--active {
1051
+ color: var(--primary);
1052
+ background-color: color-mix(in srgb, var(--primary) 10%, transparent);
1053
+ }
1054
+
1055
+ .rte-bubble-dropdown-icon {
1056
+ display: flex;
1057
+ align-items: center;
1058
+ justify-content: center;
1059
+ flex-shrink: 0;
1060
+ color: var(--muted-foreground);
1061
+ width: 1rem;
1062
+ height: 1rem;
1063
+ }
1064
+
1065
+ .rte-bubble-dropdown-icon svg {
1066
+ width: 100%;
1067
+ height: 100%;
1068
+ }
1069
+
1070
+ .rte-bubble-dropdown-item--active .rte-bubble-dropdown-icon {
1071
+ color: var(--primary);
1072
+ }
1073
+
1074
+ /* ── Suppress transitions on theme switch ── */
1075
+ .rte-theme-transitioning *,
1076
+ .rte-theme-transitioning *::before,
1077
+ .rte-theme-transitioning *::after {
1078
+ transition: none !important;
1079
+ }