@editorcn/editor 0.4.2 → 0.5.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,168 +1,115 @@
1
1
  @layer theme, base, components, utilities;
2
2
 
3
- /* ── Main Editor Wrapper ── */
4
- @layer components {
5
- .rte-root {
6
- --rte-hairline: color-mix(in srgb, var(--border) 60%, transparent);
7
- --rte-strip: color-mix(in srgb, var(--muted) 50%, var(--background));
8
- --rte-float-shadow: 0 8px 30px -12px rgb(0 0 0 / 0.15);
9
- position: relative;
10
- border-radius: calc(var(--radius) + 4px);
11
- border: 1px solid var(--rte-hairline);
12
- background-color: var(--background);
13
- transition: border-color 150ms ease-out;
14
- }
15
- }
16
-
17
- .rte-editor-icon {
18
- width: 1rem;
19
- height: 1rem;
20
- flex-shrink: 0;
21
- }
22
-
23
- button.rte-control-button {
24
- display: inline-flex;
25
- align-items: center;
26
- justify-content: center;
27
- height: 2rem;
28
- min-width: 2rem;
29
- padding: 0;
30
- border-radius: calc(var(--radius) - 2px);
31
- transition:
32
- background-color 150ms ease-out,
33
- color 150ms ease-out,
34
- transform 100ms ease-out;
35
- }
36
-
37
- button.rte-control-button:active {
38
- transform: scale(0.96);
39
- }
40
-
41
- /* ── Editor Content ── */
42
- .rte-content .ProseMirror {
43
- outline: 0;
44
- padding: var(--spacing, 0.75rem);
45
- min-height: 140px;
46
- }
47
-
48
- .rte-content .ProseMirror > *:last-child {
49
- margin-bottom: 0;
50
- }
51
-
52
- .rte-content .ProseMirror p.is-editor-empty:first-of-type::before {
53
- content: attr(data-placeholder);
54
- pointer-events: none;
55
- user-select: none;
56
- float: left;
57
- height: 0;
58
- color: var(--muted-foreground);
59
- transition: opacity 150ms ease-out;
60
- }
61
-
62
- .rte-content .ProseMirror p {
3
+ .editorcn-content[data-preset="document"] p {
63
4
  margin-top: 0;
64
5
  margin-bottom: 0.75rem;
65
6
  line-height: 1.75;
66
7
  }
67
8
 
68
- .rte-content .ProseMirror h1,
69
- .rte-content .ProseMirror h2,
70
- .rte-content .ProseMirror h3,
71
- .rte-content .ProseMirror h4,
72
- .rte-content .ProseMirror h5,
73
- .rte-content .ProseMirror h6,
74
- .rte-content .ProseMirror p {
9
+ .editorcn-content[data-preset="document"] h1,
10
+ .editorcn-content[data-preset="document"] h2,
11
+ .editorcn-content[data-preset="document"] h3,
12
+ .editorcn-content[data-preset="document"] h4,
13
+ .editorcn-content[data-preset="document"] h5,
14
+ .editorcn-content[data-preset="document"] h6,
15
+ .editorcn-content[data-preset="document"] p {
75
16
  margin-top: 0;
76
17
  }
77
18
 
78
- .rte-content .ProseMirror h1 {
19
+ .editorcn-content[data-preset="document"] h1 {
79
20
  font-size: 1.5rem;
80
21
  font-weight: 600;
81
22
  letter-spacing: -0.025em;
82
23
  margin-bottom: 1rem;
83
24
  margin-top: 1.5rem;
84
25
  }
85
- .rte-content .ProseMirror h1:first-child {
26
+
27
+ .editorcn-content[data-preset="document"] h1:first-child {
86
28
  margin-top: 0;
87
29
  }
88
30
 
89
- .rte-content .ProseMirror h2 {
31
+ .editorcn-content[data-preset="document"] h2 {
90
32
  font-size: 1.25rem;
91
33
  font-weight: 600;
92
34
  letter-spacing: -0.025em;
93
35
  margin-bottom: 0.75rem;
94
36
  margin-top: 1.25rem;
95
37
  }
96
- .rte-content .ProseMirror h2:first-child {
38
+
39
+ .editorcn-content[data-preset="document"] h2:first-child {
97
40
  margin-top: 0;
98
41
  }
99
42
 
100
- .rte-content .ProseMirror h3 {
43
+ .editorcn-content[data-preset="document"] h3 {
101
44
  font-size: 1.125rem;
102
45
  font-weight: 600;
103
46
  margin-bottom: 0.5rem;
104
47
  margin-top: 1rem;
105
48
  }
106
- .rte-content .ProseMirror h3:first-child {
49
+
50
+ .editorcn-content[data-preset="document"] h3:first-child {
107
51
  margin-top: 0;
108
52
  }
109
53
 
110
- .rte-content .ProseMirror h4 {
54
+ .editorcn-content[data-preset="document"] h4 {
111
55
  font-size: 1rem;
112
56
  font-weight: 600;
113
57
  margin-bottom: 0.5rem;
114
58
  margin-top: 0.75rem;
115
59
  }
116
- .rte-content .ProseMirror h4:first-child {
60
+
61
+ .editorcn-content[data-preset="document"] h4:first-child {
117
62
  margin-top: 0;
118
63
  }
119
64
 
120
- .rte-content .ProseMirror h5 {
65
+ .editorcn-content[data-preset="document"] h5 {
121
66
  font-size: 0.875rem;
122
67
  font-weight: 600;
123
68
  margin-bottom: 0.5rem;
124
69
  margin-top: 0.75rem;
125
70
  }
126
- .rte-content .ProseMirror h5:first-child {
71
+
72
+ .editorcn-content[data-preset="document"] h5:first-child {
127
73
  margin-top: 0;
128
74
  }
129
75
 
130
- .rte-content .ProseMirror h6 {
76
+ .editorcn-content[data-preset="document"] h6 {
131
77
  font-size: 0.875rem;
132
78
  font-weight: 500;
133
79
  margin-bottom: 0.5rem;
134
80
  margin-top: 0.75rem;
135
81
  }
136
- .rte-content .ProseMirror h6:first-child {
82
+
83
+ .editorcn-content[data-preset="document"] h6:first-child {
137
84
  margin-top: 0;
138
85
  }
139
86
 
140
- .rte-content .ProseMirror ul {
87
+ .editorcn-content[data-preset="document"] ul {
141
88
  list-style-type: disc;
142
89
  padding-left: 1.5rem;
143
90
  margin-bottom: 0.75rem;
144
91
  }
145
92
 
146
- .rte-content .ProseMirror ol {
93
+ .editorcn-content[data-preset="document"] ol {
147
94
  list-style-type: decimal;
148
95
  padding-left: 1.5rem;
149
96
  margin-bottom: 0.75rem;
150
97
  }
151
98
 
152
- .rte-content .ProseMirror li {
99
+ .editorcn-content[data-preset="document"] li {
153
100
  line-height: 1.75;
154
101
  }
155
102
 
156
- .rte-content .ProseMirror li > p {
103
+ .editorcn-content[data-preset="document"] li > p {
157
104
  margin-bottom: 0;
158
105
  }
159
106
 
160
- .rte-content .ProseMirror ul li,
161
- .rte-content .ProseMirror ol li {
107
+ .editorcn-content[data-preset="document"] ul li,
108
+ .editorcn-content[data-preset="document"] ol li {
162
109
  margin-top: 2px;
163
110
  }
164
111
 
165
- .rte-content .ProseMirror blockquote {
112
+ .editorcn-content[data-preset="document"] blockquote {
166
113
  border-left: 2px solid var(--border);
167
114
  padding-left: 1rem;
168
115
  margin-top: 1rem;
@@ -171,7 +118,7 @@ button.rte-control-button:active {
171
118
  font-style: italic;
172
119
  }
173
120
 
174
- .rte-content .ProseMirror :where(pre) {
121
+ .editorcn-content[data-preset="document"] :where(pre) {
175
122
  background: color-mix(in srgb, var(--muted) 50%, var(--background));
176
123
  color: var(--foreground);
177
124
  border-radius: var(--radius);
@@ -184,23 +131,14 @@ button.rte-control-button:active {
184
131
  font-size: 0.875rem;
185
132
  }
186
133
 
187
- .rte-content .ProseMirror :where(pre) code {
188
- background: none;
189
- color: inherit;
190
- border: none;
191
- font-size: 0.875rem;
192
- font-weight: 400;
193
- padding: 0;
194
- }
195
-
196
- .rte-content .ProseMirror hr {
134
+ .editorcn-content[data-preset="document"] hr {
197
135
  border: none;
198
136
  border-top: 1px solid var(--border);
199
137
  margin-top: 1.5rem;
200
138
  margin-bottom: 1.5rem;
201
139
  }
202
140
 
203
- .rte-content .ProseMirror a {
141
+ .editorcn-content[data-preset="document"] a {
204
142
  color: var(--primary);
205
143
  text-decoration: underline;
206
144
  text-underline-offset: 4px;
@@ -211,12 +149,12 @@ button.rte-control-button:active {
211
149
  text-decoration-color: color-mix(in srgb, var(--primary) 40%, transparent);
212
150
  }
213
151
 
214
- .rte-content .ProseMirror a:hover {
152
+ .editorcn-content[data-preset="document"] a:hover {
215
153
  color: color-mix(in srgb, var(--primary) 80%, transparent);
216
154
  text-decoration-color: color-mix(in srgb, var(--primary) 80%, transparent);
217
155
  }
218
156
 
219
- .rte-content .ProseMirror code {
157
+ .editorcn-content[data-preset="document"] code {
220
158
  font-size: 0.875em;
221
159
  font-weight: 500;
222
160
  background: color-mix(in srgb, var(--muted) 70%, transparent);
@@ -225,384 +163,22 @@ button.rte-control-button:active {
225
163
  transition: background-color 150ms ease-out;
226
164
  }
227
165
 
228
- /* ── Toolbars and Footer ── */
229
- .rte-toolbar {
230
- display: flex;
231
- align-items: center;
232
- justify-content: center;
233
- flex-wrap: wrap;
234
- gap: 0.25rem;
235
- top: var(--rte-sticky-offset, 0px);
236
- background-color: var(--rte-strip);
237
- z-index: 1;
238
- border-start-end-radius: calc(var(--radius) + 3px);
239
- border-start-start-radius: calc(var(--radius) + 3px);
240
- border-bottom: 1px solid var(--rte-hairline);
241
- padding: 0.375rem 0.5rem;
242
- transition: background-color 150ms ease-out;
243
- }
244
-
245
- .rte-toolbar[data-sticky] {
246
- position: sticky;
247
- background-color: color-mix(in srgb, var(--rte-strip) 80%, transparent);
248
- backdrop-filter: blur(16px);
249
- }
250
-
251
- .rte-footer {
252
- display: flex;
253
- align-items: center;
254
- justify-content: space-between;
255
- flex-wrap: wrap;
256
- gap: 0.5rem;
257
- min-height: 2.25rem;
258
- background-color: var(--rte-strip);
259
- z-index: 1;
260
- border-end-end-radius: calc(var(--radius) + 3px);
261
- border-end-start-radius: calc(var(--radius) + 3px);
262
- border-top: 1px solid var(--rte-hairline);
263
- padding: 0.375rem 0.75rem;
264
- font-size: 0.75rem;
265
- color: var(--muted-foreground);
266
- }
267
-
268
- .rte-footer[data-sticky] {
269
- position: sticky;
270
- bottom: 0;
271
- background-color: color-mix(in srgb, var(--rte-strip) 80%, transparent);
272
- backdrop-filter: blur(16px);
273
- }
274
-
275
- .rte-footer-word-count {
276
- display: inline-flex;
277
- align-items: center;
278
- gap: 0.375rem;
279
- white-space: nowrap;
280
- font-size: 0.75rem;
281
- }
282
-
283
- .rte-footer-word-count-stat {
284
- display: inline-flex;
285
- align-items: baseline;
286
- gap: 0.25rem;
287
- }
288
-
289
- .rte-footer-word-count-number {
290
- font-weight: 500;
291
- font-variant-numeric: tabular-nums;
292
- color: var(--foreground);
293
- }
294
-
295
- .rte-footer-word-count-unit {
296
- color: var(--muted-foreground);
297
- }
298
-
299
- .rte-footer-word-count-separator {
300
- width: 3px;
301
- height: 3px;
302
- flex-shrink: 0;
303
- border-radius: 9999px;
304
- background-color: color-mix(
305
- in srgb,
306
- var(--muted-foreground) 45%,
307
- transparent
308
- );
309
- }
310
-
311
- @media (max-width: 640px) {
312
- .rte-toolbar {
313
- flex-wrap: nowrap;
314
- overflow-x: auto;
315
- justify-content: flex-start;
316
- scrollbar-width: none;
317
- -ms-overflow-style: none;
318
- -webkit-overflow-scrolling: touch;
319
- --rte-toolbar-fade-end: 1.5rem;
320
- mask-image: linear-gradient(
321
- to right,
322
- transparent,
323
- black var(--rte-toolbar-fade-start),
324
- black calc(100% - var(--rte-toolbar-fade-end)),
325
- transparent
326
- );
327
- }
328
- .rte-toolbar::-webkit-scrollbar {
329
- display: none;
330
- }
331
- @supports (animation-timeline: scroll()) {
332
- .rte-toolbar {
333
- --rte-toolbar-fade-end: 0px;
334
- animation: rte-toolbar-fade linear both;
335
- animation-timeline: scroll(self inline);
336
- }
337
- }
338
- }
339
-
340
- @property --rte-toolbar-fade-start {
341
- syntax: "<length>";
342
- inherits: false;
343
- initial-value: 0px;
344
- }
345
-
346
- @property --rte-toolbar-fade-end {
347
- syntax: "<length>";
348
- inherits: false;
349
- initial-value: 0px;
350
- }
351
-
352
- @keyframes rte-toolbar-fade {
353
- from {
354
- --rte-toolbar-fade-start: 0px;
355
- --rte-toolbar-fade-end: 1.5rem;
356
- }
357
- 10%,
358
- 90% {
359
- --rte-toolbar-fade-start: 1.5rem;
360
- --rte-toolbar-fade-end: 1.5rem;
361
- }
362
- to {
363
- --rte-toolbar-fade-start: 1.5rem;
364
- --rte-toolbar-fade-end: 0px;
365
- }
366
- }
367
-
368
- @layer components {
369
- .rte-root[data-variant="default"] {
370
- padding: 0.25rem;
371
- background-color: var(--rte-strip);
372
- }
373
- }
374
- .rte-root[data-variant="default"] .rte-toolbar {
375
- gap: 0.25rem;
376
- padding: 0 0 0.25rem;
377
- border-bottom: none;
378
- border-radius: 0;
379
- background-color: transparent;
380
- }
381
- .rte-root[data-variant="default"] .rte-toolbar[data-sticky] {
382
- margin-inline: -0.25rem;
383
- margin-top: -0.25rem;
384
- padding: 0.25rem 0.25rem 0.25rem;
385
- border-start-start-radius: calc(var(--radius) + 3px);
386
- border-start-end-radius: calc(var(--radius) + 3px);
387
- background-color: color-mix(in srgb, var(--rte-strip) 85%, transparent);
388
- }
389
- .rte-root[data-variant="default"] .rte-content {
390
- border: 1px solid var(--rte-hairline);
391
- border-radius: var(--radius);
392
- background-color: var(--card, var(--background));
393
- }
394
- .rte-root[data-variant="default"] .rte-content .ProseMirror {
395
- padding: 1rem 1.25rem;
396
- }
397
- .rte-root[data-variant="default"] .rte-footer {
398
- min-height: 2rem;
399
- padding: 0.25rem 0.5rem 0;
400
- border-top: none;
401
- border-radius: 0;
402
- background-color: transparent;
403
- }
404
- .rte-root[data-variant="default"] .rte-controls-group {
405
- display: flex;
406
- align-items: center;
407
- gap: 0.125rem;
408
- }
409
- .rte-root[data-variant="default"]
410
- .rte-controls-group
411
- + .rte-controls-group::before {
412
- content: "";
413
- width: 1px;
414
- height: 1rem;
415
- margin-inline: 0.25rem;
416
- background-color: var(--border);
417
- flex-shrink: 0;
418
- }
419
- .rte-root[data-variant="default"] .rte-controls-group > button {
420
- border: none;
421
- border-radius: calc(var(--radius) - 2px);
422
- min-width: 2rem;
423
- height: 2rem;
424
- background-color: transparent;
425
- color: var(--foreground);
426
- transition:
427
- background-color 150ms ease-out,
428
- color 150ms ease-out;
429
- }
430
- .rte-root[data-variant="default"]
431
- .rte-controls-group
432
- > button:hover:not(:disabled) {
433
- background-color: color-mix(in srgb, var(--foreground) 5%, transparent);
434
- color: var(--foreground);
435
- }
436
- .rte-root[data-variant="default"] .rte-controls-group > button:disabled {
437
- opacity: 0.4;
438
- cursor: not-allowed;
439
- }
440
- .rte-root[data-variant="default"] .rte-controls-group > button:focus-visible {
441
- outline: 2px solid color-mix(in srgb, var(--ring) 50%, transparent);
442
- outline-offset: 1px;
443
- }
444
- .rte-root[data-variant="default"] .rte-controls-group > button[data-state="on"],
445
- .rte-root[data-variant="default"]
446
- .rte-controls-group
447
- > button[aria-pressed="true"] {
448
- background-color: color-mix(in srgb, var(--foreground) 8%, transparent);
449
- color: var(--foreground);
450
- }
451
-
452
- .rte-toolbar--subtle {
453
- padding: 0.25rem 0.375rem;
454
- gap: 0.25rem;
455
- }
456
- .rte-root[data-variant="subtle"] .rte-content .ProseMirror {
457
- padding: 0.875rem;
458
- }
459
- .rte-root[data-variant="subtle"] .rte-controls-group {
460
- display: flex;
461
- align-items: center;
462
- }
463
- .rte-root[data-variant="subtle"]
464
- .rte-controls-group
465
- + .rte-controls-group::before {
466
- content: "";
467
- width: 1px;
468
- height: 1rem;
469
- margin-inline: 0.25rem;
470
- background-color: var(--border);
471
- flex-shrink: 0;
472
- }
473
- .rte-root[data-variant="subtle"] .rte-controls-group > button {
474
- border: none;
475
- border-radius: calc(var(--radius) - 2px);
476
- min-width: 2rem;
477
- height: 2rem;
478
- background-color: transparent;
479
- color: var(--muted-foreground);
480
- transition:
481
- background-color 150ms ease-out,
482
- color 150ms ease-out;
483
- }
484
- .rte-root[data-variant="subtle"] .rte-controls-group > button:hover {
485
- background-color: var(--muted);
486
- color: var(--foreground);
487
- }
488
- .rte-root[data-variant="subtle"] .rte-controls-group > button:focus-visible {
489
- outline: 2px solid color-mix(in srgb, var(--ring) 50%, transparent);
490
- outline-offset: 1px;
491
- }
492
- .rte-root[data-variant="subtle"] .rte-controls-group > button[data-state="on"],
493
- .rte-root[data-variant="subtle"]
494
- .rte-controls-group
495
- > button[aria-pressed="true"] {
496
- background-color: var(--muted);
497
- color: var(--foreground);
498
- }
499
-
500
- /* ── Compact variant: inline fused toolbar-content ── */
501
- @layer components {
502
- .rte-root[data-variant="compact"] {
503
- border-radius: var(--radius);
504
- }
505
- }
506
- .rte-root[data-variant="compact"] .rte-toolbar,
507
- .rte-root[data-variant="compact"] .rte-footer {
508
- border-radius: 0;
509
- }
510
- .rte-root[data-variant="compact"] .rte-toolbar:first-child {
511
- border-start-start-radius: calc(var(--radius) - 1px);
512
- border-start-end-radius: calc(var(--radius) - 1px);
513
- }
514
- .rte-root[data-variant="compact"] .rte-footer:last-child {
515
- border-end-start-radius: calc(var(--radius) - 1px);
516
- border-end-end-radius: calc(var(--radius) - 1px);
517
- }
518
- .rte-toolbar--compact {
519
- padding: 0.25rem 0.375rem;
520
- gap: 0.125rem;
521
- }
522
- .rte-root[data-variant="compact"] .rte-content .ProseMirror {
523
- padding: 0.5rem 0.625rem;
524
- min-height: 100px;
525
- }
526
- .rte-root[data-variant="compact"] .rte-controls-group {
527
- display: flex;
528
- align-items: center;
529
- }
530
- .rte-root[data-variant="compact"]
531
- .rte-controls-group
532
- + .rte-controls-group::before {
533
- content: "";
534
- width: 1px;
535
- height: 0.875rem;
536
- margin-inline: 0.125rem;
537
- background-color: var(--border);
538
- flex-shrink: 0;
539
- }
540
- .rte-root[data-variant="compact"] .rte-controls-group > button {
166
+ .editorcn-content[data-preset="document"] :where(pre) code {
167
+ background: none;
168
+ color: inherit;
541
169
  border: none;
542
- border-radius: calc(var(--radius) - 4px);
543
- min-width: 1.75rem;
544
- height: 1.75rem;
545
- background-color: transparent;
546
- color: var(--muted-foreground);
547
- transition:
548
- background-color 150ms ease-out,
549
- color 150ms ease-out;
550
- }
551
- .rte-root[data-variant="compact"] .rte-controls-group > button:hover {
552
- background-color: var(--muted);
553
- color: var(--foreground);
554
- }
555
- .rte-root[data-variant="compact"] .rte-controls-group > button:focus-visible {
556
- outline: 2px solid color-mix(in srgb, var(--ring) 50%, transparent);
557
- outline-offset: 1px;
558
- }
559
- .rte-root[data-variant="compact"] .rte-controls-group > button[data-state="on"],
560
- .rte-root[data-variant="compact"]
561
- .rte-controls-group
562
- > button[aria-pressed="true"] {
563
- background-color: var(--muted);
564
- color: var(--foreground);
565
- }
566
- .rte-root[data-variant="compact"] .rte-editor-icon {
567
- height: 0.875rem;
568
- width: 0.875rem;
569
- }
570
-
571
- /* ── Controls group base (no separators) ── */
572
- .rte-controls-group {
573
- display: flex;
574
- align-items: center;
575
- }
576
-
577
- .rte-root .rte-controls-group:empty,
578
- .rte-root[data-variant] .rte-controls-group:empty {
579
- display: none;
580
- }
581
-
582
- .rte-link-editor {
583
- display: flex;
584
- align-items: center;
585
- gap: 0.25rem;
586
- }
587
-
588
- .rte-link-editor-input {
589
- flex: 1;
590
- min-width: 200px;
591
- }
592
-
593
- .rte-link-editor-save {
594
- border-start-start-radius: 0;
595
- border-end-start-radius: 0;
170
+ font-size: 0.875rem;
171
+ font-weight: 400;
172
+ padding: 0;
596
173
  }
597
174
 
598
- /* ── Task Lists ── */
599
- .rte-task-list {
175
+ :where(.editorcn-content[data-preset="document"]) .rte-task-list {
600
176
  list-style-type: none;
601
177
  padding: 0;
602
178
  padding-inline-start: 0;
603
179
  }
604
180
 
605
- .rte-task-list li {
181
+ :where(.editorcn-content[data-preset="document"]) .rte-task-list li {
606
182
  margin: 0;
607
183
  padding: 0;
608
184
  display: flex;
@@ -611,32 +187,36 @@ button.rte-control-button:active {
611
187
  transition: opacity 150ms ease-out;
612
188
  }
613
189
 
614
- .rte-task-list li[data-checked="true"] {
190
+ :where(.editorcn-content[data-preset="document"])
191
+ .rte-task-list
192
+ li[data-checked="true"] {
615
193
  opacity: 0.6;
616
194
  }
617
195
 
618
- .rte-task-list li > div {
196
+ :where(.editorcn-content[data-preset="document"]) .rte-task-list li > div {
619
197
  flex: 1;
620
198
  min-width: 0;
621
199
  }
622
200
 
623
- .rte-task-list ul {
201
+ :where(.editorcn-content[data-preset="document"]) .rte-task-list ul {
624
202
  margin-top: 5px;
625
203
  }
626
204
 
627
- .rte-task-list p {
205
+ :where(.editorcn-content[data-preset="document"]) .rte-task-list p {
628
206
  margin: 0;
629
207
  padding: 0;
630
208
  }
631
209
 
632
- .rte-task-list label {
210
+ :where(.editorcn-content[data-preset="document"]) .rte-task-list label {
633
211
  display: inline-flex;
634
212
  align-items: center;
635
213
  height: 1.75em;
636
214
  cursor: pointer;
637
215
  }
638
216
 
639
- .rte-task-list input[type="checkbox"] {
217
+ :where(.editorcn-content[data-preset="document"])
218
+ .rte-task-list
219
+ input[type="checkbox"] {
640
220
  cursor: pointer;
641
221
  appearance: none;
642
222
  width: 16px;
@@ -653,27 +233,22 @@ button.rte-control-button:active {
653
233
  transform 100ms ease-out;
654
234
  }
655
235
 
656
- .rte-task-list input[type="checkbox"]:active {
236
+ :where(.editorcn-content[data-preset="document"])
237
+ .rte-task-list
238
+ input[type="checkbox"]:active {
657
239
  transform: scale(0.96);
658
240
  }
659
241
 
660
- .rte-task-list input[type="checkbox"]:checked {
242
+ :where(.editorcn-content[data-preset="document"])
243
+ .rte-task-list
244
+ input[type="checkbox"]:checked {
661
245
  background-color: var(--primary);
662
246
  border-color: var(--primary);
663
247
  }
664
248
 
665
- @keyframes checkmark-in {
666
- 0% {
667
- transform: scale(0.8);
668
- opacity: 0;
669
- }
670
- 100% {
671
- transform: scale(1);
672
- opacity: 1;
673
- }
674
- }
675
-
676
- .rte-task-list input[type="checkbox"]:checked::before {
249
+ :where(.editorcn-content[data-preset="document"])
250
+ .rte-task-list
251
+ input[type="checkbox"]:checked::before {
677
252
  position: absolute;
678
253
  content: "";
679
254
  inset: 0;
@@ -685,7 +260,54 @@ button.rte-control-button:active {
685
260
  animation: checkmark-in 150ms ease-out forwards;
686
261
  }
687
262
 
263
+ /* ── Editor Content ── */
264
+
265
+ .rte-content .ProseMirror {
266
+ outline: 0;
267
+ padding: var(--spacing, 0.75rem);
268
+ min-height: 140px;
269
+ }
270
+
271
+ .rte-root[data-variant="default"] .rte-content .ProseMirror {
272
+ padding: 1rem 1.25rem;
273
+ }
274
+
275
+ .rte-root[data-variant="subtle"] .rte-content .ProseMirror {
276
+ padding: 0.875rem;
277
+ }
278
+
279
+ .rte-root[data-variant="compact"] .rte-content .ProseMirror {
280
+ padding: 0.5rem 0.625rem;
281
+ min-height: 100px;
282
+ }
283
+
284
+ .rte-content .ProseMirror > *:last-child {
285
+ margin-bottom: 0;
286
+ }
287
+
288
+ .rte-content .ProseMirror p.is-editor-empty:first-of-type::before {
289
+ content: attr(data-placeholder);
290
+ pointer-events: none;
291
+ user-select: none;
292
+ float: left;
293
+ height: 0;
294
+ color: var(--muted-foreground);
295
+ transition: opacity 150ms ease-out;
296
+ }
297
+
298
+ @keyframes checkmark-in {
299
+ 0% {
300
+ transform: scale(0.8);
301
+ opacity: 0;
302
+ }
303
+ 100% {
304
+ transform: scale(1);
305
+ opacity: 1;
306
+ }
307
+ }
308
+
688
309
  /* ── Embed nodes ── */
310
+
689
311
  .rte-embed-wrapper {
690
312
  display: flex;
691
313
  width: 100%;
@@ -700,10 +322,12 @@ button.rte-control-button:active {
700
322
  justify-content: flex-start;
701
323
  text-align: left;
702
324
  }
325
+
703
326
  .rte-embed-wrapper[data-align="center"] {
704
327
  justify-content: center;
705
328
  text-align: center;
706
329
  }
330
+
707
331
  .rte-embed-wrapper[data-align="right"] {
708
332
  justify-content: flex-end;
709
333
  text-align: right;
@@ -737,596 +361,10 @@ button.rte-control-button:active {
737
361
  padding: 2rem;
738
362
  text-align: center;
739
363
  color: var(--muted-foreground);
740
- animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
741
- }
742
-
743
- @keyframes pulse {
744
- 0%,
745
- 100% {
746
- opacity: 1;
747
- }
748
- 50% {
749
- opacity: 0.5;
750
- }
751
- }
752
-
753
- /* ── Floating Embed Selector Toolbar ── */
754
- .rte-embed-selector {
755
- position: absolute;
756
- top: -46px;
757
- left: 50%;
758
- transform: translateX(-50%);
759
- z-index: 50;
760
- display: flex;
761
- align-items: center;
762
- height: 2.5rem;
763
- background: var(--popover);
764
- border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
765
- border-radius: var(--radius);
766
- box-shadow: 0 8px 30px -12px rgb(0 0 0 / 0.15);
767
- padding: 0 0.25rem;
768
- gap: 0.25rem;
769
- white-space: nowrap;
770
- animation: rte-bubble-pop-in 180ms ease-out forwards;
771
- pointer-events: auto;
772
- }
773
-
774
- .rte-embed-selector-group {
775
- display: flex;
776
- align-items: center;
777
- gap: 2px;
778
- }
779
-
780
- .rte-embed-selector-divider {
781
- width: 1px;
782
- height: 1rem;
783
- background: var(--border);
784
- margin: 0 0.125rem;
785
- flex-shrink: 0;
786
- }
787
-
788
- .rte-embed-selector-btn {
789
- display: inline-flex;
790
- align-items: center;
791
- justify-content: center;
792
- height: 2rem;
793
- min-width: 2rem;
794
- padding: 0 0.5rem;
795
- border: none;
796
- border-radius: calc(var(--radius) - 4px);
797
- background: transparent;
798
- color: var(--popover-foreground);
799
- cursor: pointer;
800
- font-size: 0.75rem;
801
- font-weight: 500;
802
- transition:
803
- background-color 150ms ease-out,
804
- color 150ms ease-out,
805
- transform 100ms ease-out;
806
- }
807
-
808
- .rte-embed-selector-btn:hover {
809
- background: var(--muted);
810
- color: var(--foreground);
811
- }
812
-
813
- .rte-embed-selector-btn:focus-visible {
814
- outline: 2px solid color-mix(in srgb, var(--ring) 50%, transparent);
815
- outline-offset: -2px;
816
- }
817
-
818
- .rte-embed-selector-btn:active {
819
- transform: scale(0.96);
820
- }
821
-
822
- .rte-embed-selector-btn--active {
823
- color: var(--foreground);
824
- background: var(--muted);
825
- }
826
-
827
- .rte-embed-selector-btn--preset {
828
- font-weight: 500;
829
- font-size: 0.75rem;
830
- font-variant-numeric: tabular-nums;
831
- }
832
-
833
- .rte-embed-selector-btn--danger:hover {
834
- background: color-mix(in srgb, var(--destructive) 15%, transparent);
835
- color: var(--destructive);
836
- }
837
-
838
- .rte-embed-selector-btn--save {
839
- background: var(--primary);
840
- color: var(--primary-foreground);
841
- padding: 0 0.5rem;
842
- }
843
- .rte-embed-selector-btn--save:hover {
844
- background: color-mix(in srgb, var(--primary) 85%, transparent);
845
- color: var(--primary-foreground);
846
- }
847
-
848
- .rte-embed-selector-edit-form {
849
- display: flex;
850
- align-items: center;
851
- gap: 0.375rem;
852
- }
853
-
854
- .rte-embed-selector-input {
855
- height: 2rem;
856
- width: 220px;
857
- padding: 0 0.625rem;
858
- font-size: 0.8125rem;
859
- border-radius: calc(var(--radius) - 2px);
860
- border: 1px solid var(--input, var(--border));
861
- background: var(--background);
862
- color: var(--foreground);
863
- outline: none;
864
- transition:
865
- border-color 150ms ease-out,
866
- box-shadow 150ms ease-out;
867
- }
868
-
869
- .rte-embed-selector-input:focus {
870
- border-color: var(--ring);
871
- box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent);
872
- }
873
-
874
- .rte-embed-resize-badge {
875
- position: absolute;
876
- bottom: 8px;
877
- right: 8px;
878
- z-index: 40;
879
- background: color-mix(in srgb, var(--foreground) 85%, transparent);
880
- color: var(--background);
881
- font-size: 0.75rem;
882
- font-weight: 500;
883
- font-variant-numeric: tabular-nums;
884
- padding: 2px 6px;
885
- border-radius: calc(var(--radius) - 4px);
886
- pointer-events: none;
887
- backdrop-filter: blur(4px);
888
- font-family: var(--font-mono, monospace);
889
- }
890
-
891
- /* ── Resize handles for embeds ── */
892
- .rte-resize-handle {
893
- position: absolute;
894
- z-index: 10;
895
- opacity: 0;
896
- transition:
897
- opacity 150ms ease-out,
898
- background-color 150ms ease-out;
899
- }
900
-
901
- .rte-embed-wrapper[data-selected] .rte-resize-handle {
902
- opacity: 1;
903
- }
904
-
905
- .rte-resize-handle--left {
906
- top: 0;
907
- bottom: 0;
908
- left: -3px;
909
- width: 6px;
910
- cursor: ew-resize;
911
- background: transparent;
912
- }
913
-
914
- .rte-resize-handle--left::after {
915
- content: "";
916
- position: absolute;
917
- inset: 4px 1px;
918
- width: 2px;
919
- background: var(--primary);
920
- border-radius: 1px;
921
- transition:
922
- width 150ms ease-out,
923
- inset 150ms ease-out;
924
- }
925
-
926
- .rte-resize-handle--left:hover::after {
927
- width: 4px;
928
- inset: 4px 0;
929
- }
930
-
931
- .rte-resize-handle--right {
932
- top: 0;
933
- bottom: 0;
934
- right: -3px;
935
- width: 6px;
936
- cursor: ew-resize;
937
- background: transparent;
938
- }
939
-
940
- .rte-resize-handle--right::after {
941
- content: "";
942
- position: absolute;
943
- inset: 4px 1px;
944
- width: 2px;
945
- background: var(--primary);
946
- border-radius: 1px;
947
- transition:
948
- width 150ms ease-out,
949
- inset 150ms ease-out;
950
- }
951
-
952
- .rte-resize-handle--right:hover::after {
953
- width: 4px;
954
- inset: 4px 0;
955
- }
956
-
957
- .rte-resize-handle--bottom {
958
- left: 0;
959
- right: 0;
960
- bottom: -3px;
961
- height: 6px;
962
- cursor: ns-resize;
963
- background: transparent;
964
- }
965
-
966
- .rte-resize-handle--bottom::after {
967
- content: "";
968
- position: absolute;
969
- left: 4px;
970
- right: 4px;
971
- height: 2px;
972
- background: var(--primary);
973
- border-radius: 1px;
974
- bottom: 1px;
975
- transition:
976
- height 150ms ease-out,
977
- bottom 150ms ease-out;
978
- }
979
-
980
- .rte-resize-handle--bottom:hover::after {
981
- height: 4px;
982
- bottom: 0;
983
- }
984
-
985
- .rte-resize-handle--corner {
986
- width: 12px;
987
- height: 12px;
988
- background: var(--primary);
989
- border: 2px solid var(--background);
990
- border-radius: 3px;
991
- transition: transform 150ms ease-out;
992
- }
993
-
994
- .rte-resize-handle--corner-br {
995
- bottom: -5px;
996
- right: -5px;
997
- cursor: nwse-resize;
998
- }
999
-
1000
- .rte-resize-handle--corner-bl {
1001
- bottom: -5px;
1002
- left: -5px;
1003
- cursor: nesw-resize;
1004
- }
1005
-
1006
- .rte-resize-handle--corner:hover {
1007
- transform: scale(1.1);
1008
- }
1009
-
1010
- /* ── Bubble Menu ── */
1011
- @keyframes rte-bubble-pop-in {
1012
- 0% {
1013
- opacity: 0;
1014
- transform: scale(0.98) translateY(4px);
1015
- }
1016
- 100% {
1017
- opacity: 1;
1018
- transform: scale(1) translateY(0);
1019
- }
1020
- }
1021
-
1022
- .rte-bubble-menu {
1023
- display: flex;
1024
- align-items: center;
1025
- height: 2.5rem;
1026
- background: var(--popover);
1027
- color: var(--popover-foreground);
1028
- border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
1029
- border-radius: var(--radius);
1030
- box-shadow: 0 8px 30px -12px rgb(0 0 0 / 0.15);
1031
- padding: 0 0.25rem;
1032
- animation: rte-bubble-pop-in 180ms ease-out forwards;
1033
- }
1034
-
1035
- .rte-bubble-group {
1036
- display: flex;
1037
- align-items: center;
1038
- gap: 2px;
1039
- }
1040
-
1041
- .rte-bubble-separator {
1042
- width: 1px;
1043
- height: 1rem;
1044
- background: var(--border);
1045
- margin: 0 0.125rem;
1046
- flex-shrink: 0;
1047
- }
1048
-
1049
- .rte-bubble-btn {
1050
- display: flex;
1051
- align-items: center;
1052
- gap: 0.25rem;
1053
- height: 2rem;
1054
- min-width: 2rem;
1055
- justify-content: center;
1056
- padding: 0 0.5rem;
1057
- border: none;
1058
- border-radius: calc(var(--radius) - 2px);
1059
- background: transparent;
1060
- color: var(--popover-foreground);
1061
- cursor: pointer;
1062
- font-size: 0.8125rem;
1063
- font-weight: 500;
1064
- white-space: nowrap;
1065
- transition:
1066
- background-color 150ms ease-out,
1067
- color 150ms ease-out,
1068
- transform 100ms ease-out;
1069
- }
1070
-
1071
- .rte-bubble-btn:hover {
1072
- background: var(--muted);
1073
- color: var(--foreground);
1074
- }
1075
-
1076
- .rte-bubble-btn:focus-visible {
1077
- outline: 2px solid color-mix(in srgb, var(--ring) 50%, transparent);
1078
- outline-offset: -2px;
1079
- }
1080
-
1081
- .rte-bubble-btn:active {
1082
- transform: scale(0.96);
1083
- }
1084
-
1085
- .rte-bubble-btn--active {
1086
- color: var(--foreground);
1087
- background: var(--muted);
1088
- }
1089
-
1090
- .rte-bubble-btn-icon {
1091
- display: flex;
1092
- align-items: center;
1093
- justify-content: center;
1094
- flex-shrink: 0;
1095
- width: 1rem;
1096
- height: 1rem;
1097
- }
1098
-
1099
- .rte-bubble-btn-icon svg {
1100
- width: 100%;
1101
- height: 100%;
1102
- }
1103
-
1104
- .rte-bubble-btn-text {
1105
- max-width: 5rem;
1106
- overflow: hidden;
1107
- text-overflow: ellipsis;
1108
- }
1109
-
1110
- .rte-bubble-overlay {
1111
- position: fixed;
1112
- inset: 0;
1113
- z-index: 999;
1114
- }
1115
-
1116
- .rte-bubble-dropdown {
1117
- position: absolute;
1118
- top: 100%;
1119
- left: 0;
1120
- z-index: 1000;
1121
- min-width: 160px;
1122
- background: var(--popover);
1123
- color: var(--popover-foreground);
1124
- border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
1125
- border-radius: var(--radius);
1126
- box-shadow: 0 8px 30px -12px rgb(0 0 0 / 0.15);
1127
- padding: 0.25rem;
1128
- margin-top: 6px;
1129
- transform-origin: top left;
1130
- animation: rte-bubble-pop-in 180ms ease-out forwards;
1131
- }
1132
-
1133
- .rte-bubble-dropdown--language {
1134
- min-width: 160px;
1135
- max-height: 320px;
1136
- overflow-y: auto;
1137
- scrollbar-width: thin;
1138
- }
1139
-
1140
- .rte-bubble-dropdown-item {
1141
- display: flex;
1142
- align-items: center;
1143
- justify-content: flex-start;
1144
- gap: 0.5rem;
1145
- position: relative;
1146
- z-index: 1;
1147
- width: 100%;
1148
- height: 2rem;
1149
- padding: 0 0.5rem;
1150
- font-size: 0.8125rem;
1151
- color: var(--muted-foreground);
1152
- background: transparent;
1153
- border: none;
1154
- border-radius: calc(var(--radius) - 4px);
1155
- cursor: pointer;
1156
- text-align: left;
1157
- outline: none;
1158
- transition:
1159
- background-color 150ms ease-out,
1160
- color 150ms ease-out;
1161
- }
1162
-
1163
- .rte-bubble-dropdown-item:hover,
1164
- .rte-bubble-dropdown-item:focus-visible {
1165
- color: var(--foreground);
1166
- }
1167
-
1168
- .rte-bubble-dropdown-pill {
1169
- position: absolute;
1170
- top: 0;
1171
- left: 0;
1172
- z-index: 0;
1173
- pointer-events: none;
1174
- border-radius: calc(var(--radius) - 4px);
1175
- background: var(--muted);
1176
- opacity: 0;
1177
- transition:
1178
- top 180ms ease-out,
1179
- left 180ms ease-out,
1180
- width 180ms ease-out,
1181
- height 180ms ease-out,
1182
- opacity 150ms ease-out;
1183
- }
1184
-
1185
- .rte-bubble-dropdown-pill--visible {
1186
- opacity: 1;
1187
- }
1188
-
1189
- .rte-bubble-dropdown-item--active {
1190
- color: var(--foreground);
1191
- font-weight: 500;
1192
- background-color: var(--muted);
1193
- }
1194
-
1195
- .rte-bubble-dropdown-icon {
1196
- display: flex;
1197
- align-items: center;
1198
- justify-content: center;
1199
- flex-shrink: 0;
1200
- color: var(--muted-foreground);
1201
- width: 1rem;
1202
- height: 1rem;
1203
- }
1204
-
1205
- .rte-bubble-dropdown-icon svg {
1206
- width: 100%;
1207
- height: 100%;
1208
- }
1209
-
1210
- .rte-bubble-dropdown-item:hover .rte-bubble-dropdown-icon,
1211
- .rte-bubble-dropdown-item--active .rte-bubble-dropdown-icon {
1212
- color: var(--foreground);
1213
- }
1214
-
1215
- .rte-bubble-dropdown-divider {
1216
- height: 1px;
1217
- background: color-mix(in srgb, var(--border) 60%, transparent);
1218
- margin: 0.25rem -0.25rem;
1219
- }
1220
-
1221
- .rte-bubble-dropdown--color {
1222
- min-width: auto;
1223
- padding: 0.5rem;
1224
- }
1225
-
1226
- .rte-bubble-dropdown--color .rte-bubble-dropdown-divider {
1227
- margin: 0.625rem -0.5rem 0.5rem;
1228
- }
1229
-
1230
- .rte-bubble-color-section {
1231
- display: flex;
1232
- flex-direction: column;
1233
- gap: 0.5rem;
1234
- }
1235
-
1236
- .rte-bubble-color-label {
1237
- padding: 0 0.125rem;
1238
- color: var(--muted-foreground);
1239
- font-size: 0.75rem;
1240
- font-weight: 500;
1241
- line-height: 1;
1242
- }
1243
-
1244
- .rte-bubble-color-grid {
1245
- display: grid;
1246
- grid-template-columns: repeat(5, 1.5rem);
1247
- justify-content: center;
1248
- gap: 0.375rem;
1249
- }
1250
-
1251
- .rte-bubble-color-recent {
1252
- display: flex;
1253
- flex-wrap: wrap;
1254
- justify-content: center;
1255
- gap: 0.375rem;
1256
- }
1257
-
1258
- .rte-bubble-color-swatch {
1259
- display: inline-flex;
1260
- align-items: center;
1261
- justify-content: center;
1262
- width: 1.5rem;
1263
- height: 1.5rem;
1264
- padding: 0;
1265
- border-radius: calc(var(--radius) - 4px);
1266
- border: 1px solid transparent;
1267
- cursor: pointer;
1268
- transition:
1269
- transform 150ms ease-out,
1270
- opacity 150ms ease-out;
1271
- }
1272
-
1273
- .rte-bubble-color-swatch:hover {
1274
- opacity: 0.85;
1275
- }
1276
-
1277
- .rte-bubble-color-swatch:active {
1278
- transform: scale(0.96);
1279
- }
1280
-
1281
- .rte-bubble-color-swatch:focus-visible {
1282
- outline: 2px solid color-mix(in srgb, var(--ring) 50%, transparent);
1283
- outline-offset: 1px;
1284
- }
1285
-
1286
- .rte-bubble-color-swatch--text {
1287
- background: transparent;
1288
- border-color: var(--swatch-color);
1289
- color: var(--swatch-color);
1290
- }
1291
-
1292
- .rte-bubble-color-swatch--text.rte-bubble-color-swatch--active {
1293
- background: var(--swatch-color);
1294
- border-color: var(--swatch-color);
1295
- color: var(--swatch-check);
1296
- }
1297
-
1298
- .rte-bubble-color-swatch--highlight {
1299
- background: var(--swatch-color);
1300
- border-color: transparent;
1301
- color: var(--swatch-check);
1302
- }
1303
-
1304
- .rte-bubble-color-swatch--highlight.rte-bubble-color-swatch--active {
1305
- box-shadow: 0 0 0 2px
1306
- color-mix(in srgb, var(--swatch-color) 55%, var(--popover-foreground));
1307
- }
1308
-
1309
- .rte-bubble-color-glyph {
1310
- font-size: 0.6875rem;
1311
- font-weight: 600;
1312
- line-height: 1;
1313
- }
1314
-
1315
- .rte-bubble-color-check {
1316
- display: flex;
1317
- align-items: center;
1318
- justify-content: center;
1319
- width: 0.75rem;
1320
- height: 0.75rem;
1321
- color: var(--swatch-check);
1322
- }
1323
-
1324
- .rte-bubble-color-check svg {
1325
- width: 100%;
1326
- height: 100%;
1327
364
  }
1328
365
 
1329
366
  /* ── Suppress transitions on theme switch ── */
367
+
1330
368
  .rte-theme-transitioning *,
1331
369
  .rte-theme-transitioning *::before,
1332
370
  .rte-theme-transitioning *::after {