@editorcn/editor 0.1.1 → 0.1.2

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,8 +1,12 @@
1
+ /* ── Main Editor Wrapper ── */
1
2
  .rte-root {
2
3
  position: relative;
3
4
  border-radius: var(--radius);
4
5
  border: 1px solid var(--border);
5
6
  background-color: var(--background);
7
+ transition:
8
+ border-color 0.2s ease,
9
+ box-shadow 0.2s ease;
6
10
  }
7
11
 
8
12
  .rte-editor-icon {
@@ -18,8 +22,17 @@ button.rte-control-button {
18
22
  height: 2rem;
19
23
  width: 2rem;
20
24
  padding: 0;
25
+ transition:
26
+ background-color 0.15s ease,
27
+ color 0.15s ease,
28
+ transform 0.1s ease;
21
29
  }
22
30
 
31
+ button.rte-control-button:active {
32
+ transform: scale(0.95);
33
+ }
34
+
35
+ /* ── Editor Content ── */
23
36
  .rte-content .ProseMirror {
24
37
  outline: 0;
25
38
  padding: var(--spacing, 0.75rem);
@@ -37,6 +50,7 @@ button.rte-control-button {
37
50
  float: left;
38
51
  height: 0;
39
52
  color: var(--muted-foreground);
53
+ transition: opacity 0.2s ease;
40
54
  }
41
55
 
42
56
  .rte-content .ProseMirror p {
@@ -62,7 +76,6 @@ button.rte-control-button {
62
76
  margin-bottom: 1rem;
63
77
  margin-top: 1.5rem;
64
78
  }
65
-
66
79
  .rte-content .ProseMirror h1:first-child {
67
80
  margin-top: 0;
68
81
  }
@@ -74,7 +87,6 @@ button.rte-control-button {
74
87
  margin-bottom: 0.75rem;
75
88
  margin-top: 1.25rem;
76
89
  }
77
-
78
90
  .rte-content .ProseMirror h2:first-child {
79
91
  margin-top: 0;
80
92
  }
@@ -85,7 +97,6 @@ button.rte-control-button {
85
97
  margin-bottom: 0.5rem;
86
98
  margin-top: 1rem;
87
99
  }
88
-
89
100
  .rte-content .ProseMirror h3:first-child {
90
101
  margin-top: 0;
91
102
  }
@@ -96,7 +107,6 @@ button.rte-control-button {
96
107
  margin-bottom: 0.5rem;
97
108
  margin-top: 0.75rem;
98
109
  }
99
-
100
110
  .rte-content .ProseMirror h4:first-child {
101
111
  margin-top: 0;
102
112
  }
@@ -107,7 +117,6 @@ button.rte-control-button {
107
117
  margin-bottom: 0.5rem;
108
118
  margin-top: 0.75rem;
109
119
  }
110
-
111
120
  .rte-content .ProseMirror h5:first-child {
112
121
  margin-top: 0;
113
122
  }
@@ -118,7 +127,6 @@ button.rte-control-button {
118
127
  margin-bottom: 0.5rem;
119
128
  margin-top: 0.75rem;
120
129
  }
121
-
122
130
  .rte-content .ProseMirror h6:first-child {
123
131
  margin-top: 0;
124
132
  }
@@ -200,16 +208,22 @@ button.rte-control-button {
200
208
  text-decoration: underline;
201
209
  text-underline-offset: 4px;
202
210
  cursor: pointer;
211
+ transition:
212
+ color 0.2s ease,
213
+ text-decoration-color 0.2s ease;
214
+ text-decoration-color: color-mix(in srgb, var(--primary) 40%, transparent);
203
215
  }
204
216
 
205
217
  .rte-content .ProseMirror a:hover {
206
218
  color: color-mix(in srgb, var(--primary) 80%, transparent);
219
+ text-decoration-color: color-mix(in srgb, var(--primary) 80%, transparent);
207
220
  }
208
221
 
209
222
  .rte-content .ProseMirror ::selection {
210
223
  background-color: color-mix(in srgb, var(--primary) 15%, transparent);
211
224
  }
212
225
 
226
+ /* Syntax Highlighting */
213
227
  .rte-content .ProseMirror pre .hljs-comment,
214
228
  .rte-content .ProseMirror pre .hljs-quote {
215
229
  color: var(--muted-foreground);
@@ -256,11 +270,11 @@ button.rte-control-button {
256
270
  .rte-content .ProseMirror pre .hljs-emphasis {
257
271
  font-style: italic;
258
272
  }
259
-
260
273
  .rte-content .ProseMirror pre .hljs-strong {
261
274
  font-weight: 700;
262
275
  }
263
276
 
277
+ /* ── Toolbars and Footer ── */
264
278
  .rte-toolbar {
265
279
  display: flex;
266
280
  align-items: center;
@@ -274,10 +288,16 @@ button.rte-control-button {
274
288
  border-start-start-radius: var(--radius);
275
289
  border-bottom: 1px solid var(--border);
276
290
  padding: 0.5rem 0.75rem;
291
+ transition:
292
+ box-shadow 0.2s ease,
293
+ background-color 0.2s ease;
277
294
  }
278
295
 
279
296
  .rte-toolbar[data-sticky] {
280
297
  position: sticky;
298
+ background-color: color-mix(in srgb, var(--background) 85%, transparent);
299
+ backdrop-filter: blur(8px);
300
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
281
301
  }
282
302
 
283
303
  .rte-footer {
@@ -298,6 +318,10 @@ button.rte-control-button {
298
318
 
299
319
  .rte-footer[data-sticky] {
300
320
  position: sticky;
321
+ bottom: 0;
322
+ background-color: color-mix(in srgb, var(--background) 85%, transparent);
323
+ backdrop-filter: blur(8px);
324
+ box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
301
325
  }
302
326
 
303
327
  .rte-footer-word-count {
@@ -307,7 +331,6 @@ button.rte-control-button {
307
331
  .rte-toolbar--subtle + .rte-content + .rte-footer {
308
332
  background-color: var(--muted);
309
333
  }
310
-
311
334
  .rte-toolbar--compact + .rte-content + .rte-footer {
312
335
  background-color: var(--muted);
313
336
  }
@@ -320,6 +343,7 @@ button.rte-control-button {
320
343
  scrollbar-width: none;
321
344
  -ms-overflow-style: none;
322
345
  -webkit-overflow-scrolling: touch;
346
+ mask-image: linear-gradient(to right, black 95%, transparent 100%);
323
347
  }
324
348
  .rte-toolbar::-webkit-scrollbar {
325
349
  display: none;
@@ -337,8 +361,11 @@ button.rte-control-button {
337
361
  min-width: 1.625rem;
338
362
  height: 1.625rem;
339
363
  background-color: var(--background);
364
+ transition: all 0.15s ease;
340
365
  }
341
- .rte-root[data-variant="default"] .rte-controls-group > button:not(:last-of-type) {
366
+ .rte-root[data-variant="default"]
367
+ .rte-controls-group
368
+ > button:not(:last-of-type) {
342
369
  border-inline-end-width: 0;
343
370
  }
344
371
  .rte-root[data-variant="default"] .rte-controls-group > button:first-of-type {
@@ -354,15 +381,25 @@ button.rte-control-button {
354
381
  color: var(--accent-foreground);
355
382
  }
356
383
  .rte-root[data-variant="default"] .rte-controls-group > button[data-state="on"],
357
- .rte-root[data-variant="default"] .rte-controls-group > button[aria-pressed="true"] {
384
+ .rte-root[data-variant="default"]
385
+ .rte-controls-group
386
+ > button[aria-pressed="true"] {
358
387
  background-color: var(--accent);
359
388
  color: var(--accent-foreground);
389
+ box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
360
390
  }
361
391
 
362
392
  /* ── Subtle variant: elevated card with soft toolbar ── */
363
393
  .rte-root[data-variant="subtle"] {
364
394
  border-color: transparent;
365
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
395
+ box-shadow:
396
+ 0 1px 3px rgba(0, 0, 0, 0.06),
397
+ 0 1px 2px rgba(0, 0, 0, 0.04);
398
+ }
399
+ .rte-root[data-variant="subtle"]:focus-within {
400
+ box-shadow:
401
+ 0 4px 12px rgba(0, 0, 0, 0.08),
402
+ 0 0 0 1px var(--primary);
366
403
  }
367
404
  .rte-toolbar--subtle {
368
405
  border-bottom: 1px solid var(--border);
@@ -383,14 +420,17 @@ button.rte-control-button {
383
420
  min-width: 2rem;
384
421
  height: 2rem;
385
422
  background-color: transparent;
423
+ transition: all 0.15s ease;
386
424
  }
387
425
  .rte-root[data-variant="subtle"] .rte-controls-group > button:hover {
388
426
  background-color: var(--accent);
389
427
  color: var(--accent-foreground);
390
428
  }
391
429
  .rte-root[data-variant="subtle"] .rte-controls-group > button[data-state="on"],
392
- .rte-root[data-variant="subtle"] .rte-controls-group > button[aria-pressed="true"] {
393
- background-color: var(--accent);
430
+ .rte-root[data-variant="subtle"]
431
+ .rte-controls-group
432
+ > button[aria-pressed="true"] {
433
+ background-color: color-mix(in srgb, var(--accent) 90%, black 5%);
394
434
  color: var(--accent-foreground);
395
435
  }
396
436
 
@@ -418,13 +458,16 @@ button.rte-control-button {
418
458
  min-width: 1.5rem;
419
459
  height: 1.5rem;
420
460
  background-color: transparent;
461
+ transition: all 0.15s ease;
421
462
  }
422
463
  .rte-root[data-variant="compact"] .rte-controls-group > button:hover {
423
464
  background-color: var(--accent);
424
465
  color: var(--accent-foreground);
425
466
  }
426
467
  .rte-root[data-variant="compact"] .rte-controls-group > button[data-state="on"],
427
- .rte-root[data-variant="compact"] .rte-controls-group > button[aria-pressed="true"] {
468
+ .rte-root[data-variant="compact"]
469
+ .rte-controls-group
470
+ > button[aria-pressed="true"] {
428
471
  background-color: var(--accent);
429
472
  color: var(--accent-foreground);
430
473
  }
@@ -455,6 +498,7 @@ button.rte-control-button {
455
498
  border-end-start-radius: 0;
456
499
  }
457
500
 
501
+ /* ── Task Lists ── */
458
502
  .rte-task-list {
459
503
  list-style-type: none;
460
504
  padding: 0;
@@ -467,6 +511,11 @@ button.rte-control-button {
467
511
  display: flex;
468
512
  align-items: flex-start;
469
513
  gap: 0.5rem;
514
+ transition: opacity 0.2s ease;
515
+ }
516
+
517
+ .rte-task-list li[data-checked] {
518
+ opacity: 0.6;
470
519
  }
471
520
 
472
521
  .rte-task-list li[data-checked] > div {
@@ -500,6 +549,14 @@ button.rte-control-button {
500
549
  vertical-align: middle;
501
550
  position: relative;
502
551
  flex-shrink: 0;
552
+ transition:
553
+ background-color 0.2s ease,
554
+ border-color 0.2s ease,
555
+ transform 0.1s ease;
556
+ }
557
+
558
+ .rte-task-list input[type="checkbox"]:active {
559
+ transform: scale(0.9);
503
560
  }
504
561
 
505
562
  .rte-task-list input[type="checkbox"]:checked {
@@ -507,20 +564,43 @@ button.rte-control-button {
507
564
  border-color: var(--primary);
508
565
  }
509
566
 
567
+ /* Pop animation for the checkmark */
568
+ @keyframes checkmark-in {
569
+ 0% {
570
+ transform: scale(0.5) rotate(-15deg);
571
+ opacity: 0;
572
+ }
573
+ 100% {
574
+ transform: scale(1) rotate(0);
575
+ opacity: 1;
576
+ }
577
+ }
578
+
579
+ .rte-task-list input[type="checkbox"]:checked::before {
580
+ position: absolute;
581
+ content: "";
582
+ inset: 0;
583
+ background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAxMCA3Ij48cGF0aCBmaWxsPSIjZmZmIiBkPSJNNCA0LjU4NkwxLjcwNyAyLjI5M0ExIDEgMCAxMC4yOTMgMy43MDdsMyAzYS45OTcuOTk3IDAgMDAxLjQxNCAwbDUtNUExIDEgMCAxMDguMjkzLjI5M0w0IDQuNTg2eiIvPjwvc3ZnPg==");
584
+ background-repeat: no-repeat;
585
+ background-size: 10px;
586
+ background-position: center;
587
+ animation: checkmark-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
588
+ }
589
+
510
590
  /* ── Embed nodes ── */
511
591
  .rte-embed-wrapper {
512
592
  margin: 1rem 0;
513
- transition: opacity 0.2s;
593
+ transition:
594
+ opacity 0.25s ease,
595
+ transform 0.25s ease;
514
596
  }
515
597
 
516
598
  .rte-embed-wrapper[data-align="left"] {
517
599
  text-align: left;
518
600
  }
519
-
520
601
  .rte-embed-wrapper[data-align="center"] {
521
602
  text-align: center;
522
603
  }
523
-
524
604
  .rte-embed-wrapper[data-align="right"] {
525
605
  text-align: right;
526
606
  }
@@ -529,6 +609,7 @@ button.rte-control-button {
529
609
  outline: 2px solid var(--primary);
530
610
  outline-offset: 2px;
531
611
  border-radius: var(--radius);
612
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
532
613
  }
533
614
 
534
615
  .rte-embed {
@@ -537,6 +618,9 @@ button.rte-control-button {
537
618
  border-radius: var(--radius);
538
619
  background: var(--muted);
539
620
  display: inline-block;
621
+ transition:
622
+ outline-color 0.2s ease,
623
+ box-shadow 0.2s ease;
540
624
  }
541
625
 
542
626
  .rte-embed-iframe {
@@ -551,6 +635,17 @@ button.rte-control-button {
551
635
  padding: 2rem;
552
636
  text-align: center;
553
637
  color: var(--muted-foreground);
638
+ animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
639
+ }
640
+
641
+ @keyframes pulse {
642
+ 0%,
643
+ 100% {
644
+ opacity: 1;
645
+ }
646
+ 50% {
647
+ opacity: 0.5;
648
+ }
554
649
  }
555
650
 
556
651
  /* ── Resize handles for embeds ── */
@@ -558,7 +653,9 @@ button.rte-control-button {
558
653
  position: absolute;
559
654
  z-index: 10;
560
655
  opacity: 0;
561
- transition: opacity 0.15s;
656
+ transition:
657
+ opacity 0.2s ease,
658
+ background-color 0.2s ease;
562
659
  }
563
660
 
564
661
  .rte-embed-wrapper[data-selected] .rte-resize-handle {
@@ -581,6 +678,14 @@ button.rte-control-button {
581
678
  width: 2px;
582
679
  background: var(--primary);
583
680
  border-radius: 1px;
681
+ transition:
682
+ width 0.2s ease,
683
+ inset 0.2s ease;
684
+ }
685
+
686
+ .rte-resize-handle--right:hover::after {
687
+ width: 4px;
688
+ inset: 4px 0;
584
689
  }
585
690
 
586
691
  .rte-resize-handle--bottom {
@@ -601,6 +706,14 @@ button.rte-control-button {
601
706
  background: var(--primary);
602
707
  border-radius: 1px;
603
708
  bottom: 1px;
709
+ transition:
710
+ height 0.2s ease,
711
+ bottom 0.2s ease;
712
+ }
713
+
714
+ .rte-resize-handle--bottom:hover::after {
715
+ height: 4px;
716
+ bottom: 0;
604
717
  }
605
718
 
606
719
  .rte-resize-handle--corner {
@@ -612,14 +725,9 @@ button.rte-control-button {
612
725
  background: var(--primary);
613
726
  border: 2px solid var(--background);
614
727
  border-radius: 2px;
728
+ transition: transform 0.15s ease;
615
729
  }
616
730
 
617
- .rte-task-list input[type="checkbox"]:checked::before {
618
- position: absolute;
619
- content: "";
620
- inset: 0;
621
- background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAxMCA3Ij48cGF0aCBmaWxsPSIjZmZmIiBkPSJNNCA0LjU4NkwxLjcwNyAyLjI5M0ExIDEgMCAxMC4yOTMgMy43MDdsMyAzYS45OTcuOTk3IDAgMDAxLjQxNCAwbDUtNUExIDEgMCAxMDguMjkzLjI5M0w0IDQuNTg2eiIvPjwvc3ZnPg==');
622
- background-repeat: no-repeat;
623
- background-size: 10px;
624
- background-position: center;
731
+ .rte-resize-handle--corner:hover {
732
+ transform: scale(1.15);
625
733
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@editorcn/editor",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",