@thangph2146/lexical-editor 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/editor-x/editor.cjs +724 -435
  2. package/dist/editor-x/editor.cjs.map +1 -1
  3. package/dist/editor-x/editor.css +1391 -1091
  4. package/dist/editor-x/editor.css.map +1 -1
  5. package/dist/editor-x/editor.js +728 -439
  6. package/dist/editor-x/editor.js.map +1 -1
  7. package/dist/index.cjs +760 -472
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.css +1391 -1091
  10. package/dist/index.css.map +1 -1
  11. package/dist/index.js +763 -475
  12. package/dist/index.js.map +1 -1
  13. package/package.json +1 -1
  14. package/src/components/lexical-editor.tsx +138 -123
  15. package/src/editor-ui/content-editable.tsx +3 -3
  16. package/src/editor-x/editor.tsx +16 -3
  17. package/src/editor-x/plugins.tsx +385 -380
  18. package/src/nodes/list-with-color-node.tsx +160 -160
  19. package/src/plugins/autocomplete-plugin.tsx +2574 -2574
  20. package/src/plugins/context-menu-plugin.tsx +239 -9
  21. package/src/plugins/floating-text-format-plugin.tsx +84 -92
  22. package/src/plugins/images-plugin.tsx +4 -4
  23. package/src/plugins/list-color-plugin.tsx +178 -178
  24. package/src/plugins/tab-focus-plugin.tsx +66 -66
  25. package/src/plugins/table-column-resizer-plugin.tsx +329 -190
  26. package/src/plugins/toolbar/block-format/block-format-data.tsx +4 -0
  27. package/src/plugins/toolbar/block-format/format-bulleted-list.tsx +40 -40
  28. package/src/plugins/toolbar/block-format/format-list-with-marker.tsx +74 -74
  29. package/src/plugins/toolbar/block-format/format-numbered-list.tsx +40 -40
  30. package/src/plugins/toolbar/block-format-toolbar-plugin.tsx +118 -117
  31. package/src/plugins/toolbar/element-format-toolbar-plugin.tsx +37 -53
  32. package/src/plugins/toolbar/font-format-toolbar-plugin.tsx +8 -15
  33. package/src/plugins/toolbar/font-size-toolbar-plugin.tsx +2 -3
  34. package/src/plugins/toolbar/history-toolbar-plugin.tsx +2 -5
  35. package/src/plugins/toolbar/subsuper-toolbar-plugin.tsx +15 -23
  36. package/src/themes/_mixins.scss +158 -10
  37. package/src/themes/_variables.scss +168 -0
  38. package/src/themes/core/_code.scss +59 -0
  39. package/src/themes/core/_images.scss +80 -0
  40. package/src/themes/core/_lists.scss +214 -0
  41. package/src/themes/core/_misc.scss +46 -0
  42. package/src/themes/core/_reset.scss +119 -0
  43. package/src/themes/core/_tables.scss +145 -0
  44. package/src/themes/core/_text.scss +35 -0
  45. package/src/themes/core/_typography.scss +73 -0
  46. package/src/themes/editor-theme copy.scss +763 -0
  47. package/src/themes/editor-theme.scss +9 -621
  48. package/src/themes/editor-theme.ts +118 -118
  49. package/src/themes/plugins/_auto-embed.scss +11 -0
  50. package/src/themes/plugins/_color-picker.scss +103 -0
  51. package/src/themes/plugins/_draggable-block.scss +32 -0
  52. package/src/themes/plugins/_floating-link-editor.scss +47 -0
  53. package/src/themes/plugins/_floating-toolbars.scss +61 -0
  54. package/src/themes/plugins/_image-resizer.scss +38 -0
  55. package/src/themes/plugins/_image.scss +57 -0
  56. package/src/themes/plugins/_layout.scss +39 -0
  57. package/src/themes/plugins/_list-color.scss +23 -0
  58. package/src/themes/plugins/_mentions.scss +21 -0
  59. package/src/themes/plugins/_menus-and-pickers.scss +153 -0
  60. package/src/themes/plugins/_table.scss +20 -0
  61. package/src/themes/plugins/_toolbar.scss +36 -0
  62. package/src/themes/plugins/_tree-view.scss +11 -0
  63. package/src/themes/plugins copy.scss +656 -0
  64. package/src/themes/plugins.scss +20 -1165
  65. package/src/themes/ui-components/_animations.scss +31 -0
  66. package/src/themes/ui-components/_backgrounds.scss +27 -0
  67. package/src/themes/ui-components/_borders.scss +20 -0
  68. package/src/themes/ui-components/_button.scss +176 -0
  69. package/src/themes/ui-components/_checkbox.scss +14 -0
  70. package/src/themes/ui-components/_cursors.scss +31 -0
  71. package/src/themes/ui-components/_dialog.scss +86 -0
  72. package/src/themes/ui-components/_display-sizing.scss +100 -0
  73. package/src/themes/ui-components/_flex.scss +124 -0
  74. package/src/themes/ui-components/_form-layout.scss +15 -0
  75. package/src/themes/ui-components/_icons.scss +23 -0
  76. package/src/themes/ui-components/_input.scss +86 -0
  77. package/src/themes/ui-components/_label.scss +19 -0
  78. package/src/themes/ui-components/_loader.scss +9 -0
  79. package/src/themes/ui-components/_margins-paddings.scss +45 -0
  80. package/src/themes/ui-components/_popover.scss +16 -0
  81. package/src/themes/ui-components/_positioning.scss +73 -0
  82. package/src/themes/ui-components/_rounded.scss +19 -0
  83. package/src/themes/ui-components/_scroll-area.scss +11 -0
  84. package/src/themes/ui-components/_select.scss +110 -0
  85. package/src/themes/ui-components/_separator.scss +19 -0
  86. package/src/themes/ui-components/_shadow.scss +15 -0
  87. package/src/themes/ui-components/_tabs.scss +46 -0
  88. package/src/themes/ui-components/_text-utilities.scss +48 -0
  89. package/src/themes/ui-components/_toggle-toolbar.scss +128 -0
  90. package/src/themes/ui-components/_toggle.scss +80 -0
  91. package/src/themes/ui-components/_typography.scss +22 -0
  92. package/src/themes/ui-components copy.scss +1335 -0
  93. package/src/themes/ui-components.scss +27 -937
  94. package/src/transformers/markdown-list-transformer.ts +51 -51
  95. package/src/ui/button.tsx +11 -2
  96. package/src/ui/collapsible.tsx +1 -1
  97. package/src/ui/dialog.tsx +2 -2
  98. package/src/ui/flex.tsx +4 -4
  99. package/src/ui/popover.tsx +1 -1
  100. package/src/ui/tooltip.tsx +2 -2
@@ -0,0 +1,1335 @@
1
+ @use "variables" as *;
2
+ @use "mixins" as *;
3
+
4
+ /* --- LOADER --- */
5
+ .editor-loader {
6
+ @include control-size($editor-icon-size-lg);
7
+ animation: spin 1s linear infinite;
8
+ color: var(--muted-foreground);
9
+ }
10
+
11
+ /* --- TABS --- */
12
+ .editor-tabs-trigger {
13
+ @include flex-center-justify;
14
+ white-space: nowrap;
15
+ @include rounded-sm;
16
+ padding: $editor-gap-1-5 $editor-gap-2;
17
+ @include text-sm;
18
+ font-weight: $editor-font-weight-medium;
19
+ transition: all $editor-transition-normal;
20
+ cursor: pointer;
21
+ border: none;
22
+ background: transparent;
23
+ color: var(--muted-foreground);
24
+ flex: 1;
25
+
26
+ @include focus-ring;
27
+
28
+ &:disabled {
29
+ pointer-events: none;
30
+ opacity: $editor-opacity-disabled;
31
+ }
32
+
33
+ &[data-state="active"] {
34
+ background-color: var(--background);
35
+ color: var(--foreground);
36
+ @include shadow-sm;
37
+ }
38
+ }
39
+
40
+ .editor-tabs-list {
41
+ @include flex-center-justify;
42
+ height: $editor-control-size-lg;
43
+ @include rounded-md;
44
+ background-color: var(--muted);
45
+ padding: $editor-gap-1;
46
+ color: var(--muted-foreground);
47
+ width: 100%;
48
+ }
49
+
50
+ .editor-tabs-content {
51
+ margin-top: $editor-gap-2;
52
+ @include focus-ring;
53
+ }
54
+
55
+ /* --- FORM LAYOUT --- */
56
+ .editor-form-grid {
57
+ display: grid;
58
+ gap: $editor-gap-4;
59
+ padding-top: $editor-gap-4;
60
+ padding-bottom: $editor-gap-4;
61
+ }
62
+
63
+ .editor-form-item {
64
+ display: grid;
65
+ gap: $editor-gap-2;
66
+ }
67
+
68
+ /* --- SCROLL AREA --- */
69
+ .editor-scroll-area {
70
+ max-height: $editor-scroll-area-max-height;
71
+ overflow-y: auto;
72
+ padding: $editor-gap-2;
73
+ border: $editor-border-width solid var(--border);
74
+ @include rounded-sm;
75
+ }
76
+
77
+ /* --- FLEX Component Utilities --- */
78
+ .editor-flex {
79
+ display: flex;
80
+ }
81
+
82
+ .editor-flex-1 {
83
+ flex: 1 1 0%;
84
+ }
85
+
86
+ .editor-shrink-0 {
87
+ flex-shrink: 0;
88
+ }
89
+
90
+ .editor-flex-grow {
91
+ flex-grow: 1;
92
+ }
93
+
94
+ .editor-items-start {
95
+ align-items: flex-start;
96
+ }
97
+
98
+ .editor-items-center {
99
+ align-items: center;
100
+ }
101
+
102
+ .editor-items-end {
103
+ align-items: flex-end;
104
+ }
105
+
106
+ .editor-items-baseline {
107
+ align-items: baseline;
108
+ }
109
+
110
+ .editor-items-stretch {
111
+ align-items: stretch;
112
+ }
113
+
114
+ .editor-justify-start {
115
+ justify-content: flex-start;
116
+ }
117
+
118
+ .editor-justify-center {
119
+ justify-content: center;
120
+ }
121
+
122
+ .editor-justify-end {
123
+ justify-content: flex-end;
124
+ }
125
+
126
+ .editor-justify-between {
127
+ justify-content: space-between;
128
+ }
129
+
130
+ .editor-justify-around {
131
+ justify-content: space-around;
132
+ }
133
+
134
+ .editor-justify-evenly {
135
+ justify-content: space-evenly;
136
+ }
137
+
138
+ .editor-flex-row {
139
+ flex-direction: row;
140
+ }
141
+
142
+ .editor-flex-col {
143
+ flex-direction: column;
144
+ }
145
+
146
+ .editor-flex-row-reverse {
147
+ flex-direction: row-reverse;
148
+ }
149
+
150
+ .editor-flex-col-reverse {
151
+ flex-direction: column-reverse;
152
+ }
153
+
154
+ .editor-flex-nowrap {
155
+ flex-wrap: nowrap;
156
+ }
157
+
158
+ .editor-flex-wrap {
159
+ flex-wrap: wrap;
160
+ }
161
+
162
+ .editor-flex-wrap-reverse {
163
+ flex-wrap: wrap-reverse;
164
+ }
165
+
166
+ .editor-flex-end {
167
+ @include flex-center;
168
+ justify-content: flex-end;
169
+ gap: $editor-gap-1;
170
+ flex-wrap: nowrap;
171
+ flex-shrink: 0;
172
+ }
173
+
174
+ .editor-flex-row-center {
175
+ @include flex-center;
176
+ gap: $editor-gap-2;
177
+
178
+ &--pointer {
179
+ cursor: pointer;
180
+ }
181
+ }
182
+
183
+ .editor-flex-col-gap-2 {
184
+ @include flex-col;
185
+ gap: $editor-gap-2;
186
+ }
187
+
188
+ .editor-flex-col-gap-4 {
189
+ @include flex-col;
190
+ gap: $editor-gap-4;
191
+ }
192
+
193
+ .editor-flex-center-justify-py-8 {
194
+ @include flex-center-justify;
195
+ padding-top: $editor-gap-5;
196
+ padding-bottom: $editor-gap-5;
197
+ }
198
+
199
+ /* --- POSITIONING --- */
200
+ .editor-fixed {
201
+ position: fixed;
202
+ }
203
+
204
+ .editor-absolute {
205
+ position: absolute;
206
+ }
207
+
208
+ .editor-absolute-full {
209
+ @include absolute-full;
210
+ }
211
+
212
+ .editor-relative {
213
+ position: relative;
214
+ }
215
+
216
+ .editor-relative-full {
217
+ position: relative;
218
+ width: 100%;
219
+ height: 100%;
220
+
221
+ &--padding {
222
+ padding: $editor-gap-2 $editor-gap-5;
223
+ }
224
+ }
225
+
226
+ .editor-inset-0 {
227
+ inset: 0;
228
+ }
229
+
230
+ .editor-top-0 {
231
+ top: 0;
232
+ }
233
+
234
+ .editor-left-0 {
235
+ left: 0;
236
+ }
237
+
238
+ .editor-top-1-2 {
239
+ top: 50%;
240
+ }
241
+
242
+ .editor-left-1-2 {
243
+ left: 50%;
244
+ }
245
+
246
+ .editor-translate-x-1-2 {
247
+ transform: translateX(-50%);
248
+ }
249
+
250
+ .editor-translate-y-1-2 {
251
+ transform: translateY(-50%);
252
+ }
253
+
254
+ .editor--top-2-5 {
255
+ top: -($editor-gap-2 + $editor-outline-width);
256
+ }
257
+
258
+ .editor--right-2-5 {
259
+ right: -($editor-gap-2 + $editor-outline-width);
260
+ }
261
+
262
+ .editor--bottom-2-5 {
263
+ bottom: -($editor-gap-2 + $editor-outline-width);
264
+ }
265
+
266
+ .editor--left-2-5 {
267
+ left: -($editor-gap-2 + $editor-outline-width);
268
+ }
269
+
270
+ /* --- DISPLAY & SIZING --- */
271
+ .editor-w-full {
272
+ width: 100%;
273
+ }
274
+
275
+ .editor-h-full {
276
+ height: 100%;
277
+ }
278
+
279
+ .editor-w-14 {
280
+ width: $editor-control-size-xl + $editor-gap-3;
281
+ }
282
+
283
+ .editor-w-48 {
284
+ width: $editor-popover-width * 0.67; // approx 12rem
285
+ }
286
+
287
+ .editor-w-\[200px\] {
288
+ width: $editor-image-broken-size;
289
+ }
290
+
291
+ .editor-h-4 {
292
+ height: $editor-gap-4;
293
+ }
294
+
295
+ .editor-h-2 {
296
+ height: $editor-gap-2;
297
+ }
298
+
299
+ .editor-w-2 {
300
+ width: $editor-gap-2;
301
+ }
302
+
303
+ .editor-min-h-5 {
304
+ min-height: $editor-gap-5;
305
+ }
306
+
307
+ .editor-inline-block {
308
+ display: inline-block;
309
+ }
310
+
311
+ .editor-block {
312
+ display: block;
313
+ }
314
+
315
+ .editor-inline {
316
+ display: inline;
317
+ }
318
+
319
+ .editor-overflow-hidden {
320
+ overflow: hidden;
321
+ }
322
+
323
+ .editor-pointer-events-none {
324
+ pointer-events: none;
325
+ }
326
+
327
+ .editor-select-none {
328
+ user-select: none;
329
+ }
330
+
331
+ .editor-user-select-text,
332
+ .editor-select-text {
333
+ user-select: text;
334
+ }
335
+
336
+ .editor-z-10 {
337
+ z-index: $editor-z-index-layer-10;
338
+ }
339
+
340
+ .editor-box-border {
341
+ box-sizing: border-box;
342
+ }
343
+
344
+ .editor-opacity-30 {
345
+ opacity: $editor-opacity-soft;
346
+ }
347
+
348
+ .editor-truncate {
349
+ @include truncate;
350
+ }
351
+
352
+ .editor-object-cover {
353
+ object-fit: cover;
354
+ }
355
+
356
+ .editor-sr-only {
357
+ @include absolute-full;
358
+ width: $editor-border-width;
359
+ height: $editor-border-width;
360
+ padding: 0;
361
+ margin: -$editor-border-width;
362
+ @include overflow-hidden;
363
+ clip: rect(0, 0, 0, 0);
364
+ white-space: nowrap;
365
+ border-width: 0;
366
+ }
367
+
368
+ /* --- ROUNDED --- */
369
+ .editor-rounded-sm {
370
+ @include rounded-sm;
371
+ }
372
+
373
+ .editor-rounded-md {
374
+ @include rounded-md;
375
+ }
376
+
377
+ .editor-rounded-lg {
378
+ @include rounded-lg;
379
+ }
380
+
381
+ .editor-rounded-full {
382
+ @include rounded-full;
383
+ }
384
+
385
+ /* --- SHADOW --- */
386
+ .editor-shadow-sm {
387
+ @include shadow-sm;
388
+ }
389
+
390
+ .editor-shadow-md {
391
+ @include shadow-md;
392
+ }
393
+
394
+ .editor-shadow-lg {
395
+ @include shadow-lg;
396
+ }
397
+
398
+ /* --- BACKGROUNDS --- */
399
+ .editor-bg-background {
400
+ background-color: var(--background);
401
+ }
402
+
403
+ .editor-bg-primary {
404
+ background-color: $editor-primary-color;
405
+ }
406
+
407
+ .editor-bg-muted {
408
+ background-color: var(--muted);
409
+ }
410
+
411
+ .editor-bg-accent {
412
+ background-color: $editor-accent-color;
413
+ }
414
+
415
+ .editor-bg-transparent {
416
+ background-color: transparent;
417
+ }
418
+
419
+ .editor-bg-none {
420
+ background: none;
421
+ }
422
+
423
+ /* --- MARGINS & PADDINGS (Optimized) --- */
424
+ $gaps: (
425
+ "0": 0,
426
+ "1": $editor-gap-1,
427
+ "1-5": $editor-gap-1-5,
428
+ "2": $editor-gap-2,
429
+ "3": $editor-gap-3,
430
+ "4": $editor-gap-4,
431
+ "5": $editor-gap-5,
432
+ );
433
+
434
+ @each $key, $val in $gaps {
435
+ .editor-m-#{$key} { margin: $val; }
436
+ .editor-mt-#{$key} { margin-top: $val; }
437
+ .editor-mb-#{$key} { margin-bottom: $val; }
438
+ .editor-ml-#{$key} { margin-left: $val; }
439
+ .editor-mr-#{$key} { margin-right: $val; }
440
+
441
+ .editor-p-#{$key} { padding: $val; }
442
+ .editor-pt-#{$key} { padding-top: $val; }
443
+ .editor-pb-#{$key} { padding-bottom: $val; }
444
+ .editor-pl-#{$key} { padding-left: $val; }
445
+ .editor-pr-#{$key} { padding-right: $val; }
446
+
447
+ .editor-px-#{$key} { padding-left: $val; padding-right: $val; }
448
+ .editor-py-#{$key} { padding-top: $val; padding-bottom: $val; }
449
+
450
+ .editor-gap-#{$key} { gap: $val; }
451
+ }
452
+
453
+ .editor-ml-auto { margin-left: auto; }
454
+ .editor-mr-auto { margin-right: auto; }
455
+
456
+ .editor-px-2\.5 {
457
+ padding-left: $editor-gap-2 + $editor-outline-width;
458
+ padding-right: $editor-gap-2 + $editor-outline-width;
459
+ }
460
+
461
+ .editor-py-18 {
462
+ padding-top: $editor-placeholder-padding-y;
463
+ padding-bottom: $editor-placeholder-padding-y;
464
+ }
465
+
466
+ /* --- CURSORS --- */
467
+ .editor-cursor-default {
468
+ cursor: default;
469
+ }
470
+
471
+ .editor-cursor-pointer {
472
+ cursor: pointer;
473
+ }
474
+
475
+ .editor-cursor-text {
476
+ cursor: text;
477
+ }
478
+
479
+ .editor-cursor-ns-resize {
480
+ cursor: ns-resize;
481
+ }
482
+
483
+ .editor-cursor-ew-resize {
484
+ cursor: ew-resize;
485
+ }
486
+
487
+ .editor-cursor-nesw-resize {
488
+ cursor: nesw-resize;
489
+ }
490
+
491
+ .editor-cursor-nwse-resize {
492
+ cursor: nwse-resize;
493
+ }
494
+
495
+ /* --- TEXT UTILITIES --- */
496
+ .editor-text-muted-xs {
497
+ font-size: $editor-font-size-xs;
498
+ color: $editor-muted-foreground-color;
499
+ }
500
+
501
+ .editor-text-sm {
502
+ @include text-sm;
503
+ }
504
+
505
+ .editor-font-medium {
506
+ font-weight: $editor-font-weight-medium;
507
+ }
508
+
509
+ .editor-font-mono {
510
+ font-family: $editor-font-family-mono;
511
+ }
512
+
513
+ .editor-text-muted-foreground {
514
+ color: $editor-muted-foreground-color;
515
+ }
516
+
517
+ .editor-text-foreground-50 {
518
+ color: color-mix(in srgb, var(--foreground), transparent 50%);
519
+ }
520
+
521
+ .editor-uppercase {
522
+ text-transform: uppercase;
523
+ }
524
+
525
+ .editor-whitespace-nowrap {
526
+ white-space: nowrap;
527
+ }
528
+
529
+ .editor-whitespace-pre-wrap {
530
+ white-space: pre-wrap;
531
+ }
532
+
533
+ .editor-word-break-break-word {
534
+ word-break: break-word;
535
+ }
536
+
537
+ .editor-caret-primary {
538
+ caret-color: var(--primary);
539
+ }
540
+
541
+ /* --- BORDERS --- */
542
+ .editor-border {
543
+ border: $editor-border-width solid var(--border);
544
+ }
545
+
546
+ .editor-border-0 {
547
+ border-width: 0;
548
+ }
549
+
550
+ .editor-border-transparent {
551
+ border-color: transparent;
552
+ }
553
+
554
+ .editor-outline-none {
555
+ outline: $editor-outline-width solid transparent;
556
+ outline-offset: $editor-outline-offset;
557
+ }
558
+
559
+ /* --- ANIMATIONS & TRANSITIONS --- */
560
+ .editor-transition-colors {
561
+ transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
562
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
563
+ transition-duration: $editor-transition-fast;
564
+ }
565
+
566
+ .editor-transition-transform {
567
+ transition-property: transform;
568
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
569
+ transition-duration: $editor-transition-fast;
570
+ }
571
+
572
+ .editor-animate-pulse {
573
+ animation: pulse $editor-animation-pulse cubic-bezier(0.4, 0, 0.6, 1) infinite;
574
+ }
575
+
576
+ .editor-animate-spin {
577
+ animation: spin $editor-animation-spin linear infinite;
578
+ }
579
+
580
+ .editor-rotate-90 {
581
+ transform: rotate(90deg);
582
+ }
583
+
584
+ .editor-resize-none {
585
+ resize: none;
586
+ }
587
+
588
+ /* --- ICONS --- */
589
+ .editor-icon-xs {
590
+ @include icon-size($editor-icon-size-xs);
591
+ }
592
+
593
+ .editor-icon-sm {
594
+ @include icon-size($editor-icon-size-sm);
595
+ }
596
+
597
+ .editor-icon-md {
598
+ @include icon-size($editor-icon-size-md);
599
+ }
600
+
601
+ .editor-icon-lg {
602
+ @include icon-size($editor-icon-size-lg);
603
+ }
604
+
605
+ .editor-icon-xl {
606
+ @include icon-size($editor-icon-size-xl);
607
+ }
608
+
609
+ /* --- TYPOGRAPHY --- */
610
+ .editor-typography-p {
611
+ line-height: $editor-line-height-base;
612
+
613
+ &:not(:first-child) {
614
+ margin-top: $editor-paragraph-margin-vertical * 2;
615
+ }
616
+ }
617
+
618
+ .editor-typography-p-small {
619
+ @include text-sm;
620
+ font-weight: $editor-font-weight-medium;
621
+ line-height: 1;
622
+ }
623
+
624
+ .editor-typography-span-small-muted {
625
+ @include text-sm;
626
+ color: var(--muted-foreground);
627
+ }
628
+
629
+ /* --- TOGGLE GROUP & TOOLBAR ITEMS --- */
630
+ .editor-toggle-group {
631
+ @include flex-center-justify;
632
+ flex-wrap: wrap;
633
+ gap: $editor-gap-1;
634
+ }
635
+
636
+ .editor-toolbar-item,
637
+ .editor-toggle-group-item {
638
+ @include flex-center-justify;
639
+ @include rounded-md;
640
+ @include text-sm;
641
+ font-weight: $editor-font-weight-medium;
642
+ color: var(--foreground);
643
+ transition: all $editor-transition-normal;
644
+ cursor: pointer;
645
+ line-height: 1;
646
+ padding: $editor-gap-2;
647
+ @include editor-button-interactive;
648
+
649
+ &--size-sm {
650
+ padding: $editor-gap-1;
651
+ font-size: $editor-font-size-xs;
652
+ }
653
+
654
+ &--size-lg {
655
+ padding: $editor-gap-3;
656
+ font-size: $editor-font-size-md;
657
+ }
658
+
659
+ &--outline {
660
+ border-color: var(--border);
661
+
662
+ &:hover {
663
+ background-color: $editor-accent-color;
664
+ border-color: $editor-accent-color;
665
+ color: $editor-accent-foreground-color !important;
666
+ }
667
+ }
668
+
669
+ &:hover {
670
+ background-color: var(--muted);
671
+ color: var(--muted-foreground);
672
+ }
673
+
674
+ &[data-state="on"],
675
+ &[data-state="active"] {
676
+ background-color: $editor-accent-color;
677
+ color: $editor-accent-foreground-color !important;
678
+ border-color: $editor-accent-color;
679
+
680
+ &:hover {
681
+ @include editor-hover-base;
682
+ background-color: color-mix(in srgb, $editor-accent-color, black 10%);
683
+ border-color: $editor-accent-color;
684
+ }
685
+ }
686
+
687
+ &:disabled {
688
+ pointer-events: none;
689
+ opacity: $editor-opacity-disabled;
690
+ }
691
+ }
692
+
693
+ .editor-toolbar-item {
694
+ @include control-size($editor-control-size-md);
695
+ padding: 0;
696
+ background-color: var(--background);
697
+ border: $editor-border-width solid var(--border);
698
+
699
+ &--lg {
700
+ @include control-size($editor-control-size-lg);
701
+ min-height: $editor-control-size-lg;
702
+ }
703
+
704
+ &--w-fit { width: fit-content; }
705
+ &--w-auto {
706
+ width: auto;
707
+ padding-left: $editor-gap-2;
708
+ padding-right: $editor-gap-2;
709
+ }
710
+ &--gap-sm { gap: $editor-gap-1; }
711
+ &--text-center { text-align: center; }
712
+ }
713
+
714
+ .editor-toolbar-select-trigger {
715
+ height: auto;
716
+ min-height: $editor-control-size-md;
717
+ width: auto;
718
+ gap: $editor-gap-2;
719
+ padding: calc($editor-gap-1 + 2px) $editor-gap-2;
720
+ @include text-sm;
721
+ font-weight: $editor-font-weight-medium;
722
+ border: $editor-border-width solid var(--border);
723
+ @include rounded-md;
724
+ transition: all $editor-transition-normal;
725
+
726
+ @include editor-button-interactive;
727
+
728
+ &:focus {
729
+ @include focus-ring;
730
+ }
731
+
732
+ &--w-md {
733
+ width: $editor-toolbar-select-width;
734
+ min-width: $editor-toolbar-select-width;
735
+ }
736
+ }
737
+
738
+ .editor-toolbar-select-icon {
739
+ @include icon-size($editor-icon-size-sm);
740
+ @include flex-center-justify;
741
+ margin-right: $editor-gap-2;
742
+ }
743
+
744
+ .editor-format-select-trigger {
745
+ width: $editor-format-select-width !important;
746
+ min-width: $editor-format-select-width !important;
747
+ flex-shrink: 0;
748
+ }
749
+
750
+ /* --- BUTTON --- */
751
+ .editor-btn {
752
+ @include flex-center-justify;
753
+ gap: $editor-gap-2;
754
+ white-space: nowrap;
755
+ @include rounded-md;
756
+ font-weight: $editor-font-weight-medium;
757
+ transition: all $editor-transition-normal;
758
+ @include text-sm;
759
+ @include focus-ring;
760
+ border: $editor-border-width solid transparent;
761
+ cursor: pointer;
762
+ user-select: none;
763
+ position: relative;
764
+ padding: $editor-gap-2 $editor-gap-4;
765
+ box-sizing: border-box; // Ensure consistent sizing
766
+ @include editor-button-interactive;
767
+
768
+ &:disabled {
769
+ pointer-events: none;
770
+ opacity: $editor-opacity-disabled;
771
+ cursor: not-allowed;
772
+ }
773
+
774
+ &--loading {
775
+ cursor: wait;
776
+ }
777
+
778
+ &__loader {
779
+ @include absolute-full;
780
+ left: 50%;
781
+ top: 50%;
782
+ transform: translate(-50%, -50%);
783
+ }
784
+
785
+ &__content {
786
+ @include flex-center;
787
+ gap: $editor-gap-2;
788
+ transition: opacity $editor-transition-normal;
789
+ }
790
+
791
+ &[data-state="on"],
792
+ &[data-state="active"] {
793
+ background-color: $editor-accent-color;
794
+ color: $editor-accent-foreground-color !important;
795
+ border-color: $editor-accent-color;
796
+ }
797
+
798
+ &--default {
799
+ background-color: var(--primary);
800
+ color: var(--primary-foreground);
801
+ border-color: var(--primary);
802
+ @include shadow-sm;
803
+
804
+ &:hover {
805
+ background-color: color-mix(in srgb, var(--primary), black 10%);
806
+ @include shadow-md;
807
+ }
808
+ }
809
+
810
+ &--destructive {
811
+ background-color: var(--destructive);
812
+ color: var(--destructive-foreground);
813
+ border-color: var(--destructive);
814
+ @include shadow-sm;
815
+
816
+ &:hover {
817
+ background-color: color-mix(in srgb, var(--destructive), black 10%);
818
+ @include shadow-md;
819
+ }
820
+ }
821
+
822
+ &--outline {
823
+ border-color: var(--input);
824
+ background-color: var(--background);
825
+ color: var(--foreground);
826
+
827
+ &:hover {
828
+ background-color: var(--accent);
829
+ color: var(--accent-foreground);
830
+ border-color: var(--accent);
831
+ }
832
+ }
833
+
834
+ &--secondary {
835
+ background-color: var(--secondary);
836
+ color: var(--secondary-foreground);
837
+ border-color: transparent;
838
+
839
+ &:hover {
840
+ background-color: color-mix(in srgb, var(--secondary), black 10%);
841
+ }
842
+ }
843
+
844
+ &--ghost {
845
+ background-color: transparent;
846
+ border-color: transparent;
847
+ color: var(--foreground);
848
+
849
+ &:hover {
850
+ background-color: var(--accent);
851
+ color: var(--accent-foreground);
852
+ }
853
+ }
854
+
855
+ &--link {
856
+ color: var(--primary);
857
+ text-decoration-line: underline;
858
+ text-underline-offset: $editor-gap-1;
859
+ background-color: transparent;
860
+ border: none;
861
+ padding: 0;
862
+ height: auto;
863
+
864
+ &:hover {
865
+ text-decoration-line: underline;
866
+ transform: none;
867
+ box-shadow: none;
868
+ }
869
+ }
870
+
871
+ /* Sizes */
872
+ &--size-default {
873
+ height: $editor-control-size-md;
874
+ padding: 0 $editor-gap-4;
875
+ }
876
+
877
+ &--size-sm {
878
+ height: $editor-control-size-sm;
879
+ @include rounded-sm;
880
+ padding: 0 $editor-gap-3;
881
+ font-size: $editor-font-size-xs;
882
+ }
883
+
884
+ &--size-md {
885
+ height: $editor-control-size-md;
886
+ padding: 0 $editor-gap-4;
887
+ }
888
+
889
+ &--size-lg {
890
+ height: $editor-control-size-lg;
891
+ @include rounded-md;
892
+ padding: 0 $editor-gap-4 + $editor-gap-2;
893
+ }
894
+
895
+ &--size-icon,
896
+ &.editor-btn--size-icon,
897
+ button.editor-btn--size-icon {
898
+ width: $editor-control-size-md !important;
899
+ height: $editor-control-size-md !important;
900
+ min-width: $editor-control-size-md !important;
901
+ min-height: $editor-control-size-md !important;
902
+ flex-shrink: 0;
903
+ padding: 0 !important;
904
+ }
905
+ }
906
+
907
+ /* --- BUTTON GROUP --- */
908
+ .editor-button-group {
909
+ @include flex-center;
910
+ flex-wrap: wrap;
911
+ gap: $editor-gap-1;
912
+ }
913
+
914
+ /* --- SEPARATOR --- */
915
+ .editor-separator {
916
+ background-color: var(--border);
917
+ flex-shrink: 0;
918
+
919
+ &--horizontal {
920
+ height: $editor-border-width;
921
+ width: 100%;
922
+ }
923
+
924
+ &--vertical {
925
+ width: $editor-border-width;
926
+ height: 100%;
927
+ min-height: $editor-separator-min-height-vertical;
928
+ }
929
+ }
930
+
931
+ /* --- INPUT --- */
932
+ .editor-input {
933
+ @include flex-center;
934
+ height: $editor-control-size-md;
935
+ width: 100%;
936
+ @include rounded-md;
937
+ border: $editor-border-width solid var(--input);
938
+ background-color: var(--background);
939
+ padding: $editor-gap-2 $editor-gap-3;
940
+ @include text-sm;
941
+
942
+ &::file-selector-button {
943
+ border: 0;
944
+ background-color: transparent;
945
+ @include text-sm;
946
+ font-weight: $editor-font-weight-medium;
947
+ }
948
+
949
+ &::placeholder {
950
+ color: var(--muted-foreground);
951
+ }
952
+
953
+ @include editor-input-interactive;
954
+
955
+ &:focus-visible {
956
+ outline: none;
957
+ box-shadow: 0 0 0 $editor-outline-width var(--ring), 0 0 0 $editor-outline-width * 2 var(--background);
958
+ }
959
+
960
+ &:disabled {
961
+ cursor: not-allowed;
962
+ opacity: $editor-opacity-disabled;
963
+ }
964
+
965
+ &::-webkit-outer-spin-button,
966
+ &::-webkit-inner-spin-button {
967
+ -webkit-appearance: none;
968
+ margin: 0;
969
+ }
970
+
971
+ &[type=number] {
972
+ -moz-appearance: textfield;
973
+ }
974
+ }
975
+
976
+ .editor-input-lg {
977
+ height: $editor-control-size-xl;
978
+ width: 100%;
979
+ }
980
+
981
+ .editor-input-wrapper {
982
+ @include flex-center;
983
+ }
984
+
985
+ /* --- INPUT GROUP ITEM --- */
986
+ .editor-input-group-item {
987
+ height: $editor-control-size-sm;
988
+ -moz-appearance: textfield;
989
+
990
+ &::-webkit-inner-spin-button,
991
+ &::-webkit-outer-spin-button {
992
+ -webkit-appearance: none;
993
+ margin: 0;
994
+ }
995
+
996
+ &--first {
997
+ border-top-right-radius: 0;
998
+ border-bottom-right-radius: 0;
999
+ }
1000
+
1001
+ &--middle {
1002
+ border-radius: 0;
1003
+ border-left-width: 0;
1004
+ margin-inline-start: -1px;
1005
+ }
1006
+
1007
+ &--last {
1008
+ border-top-left-radius: 0;
1009
+ border-bottom-left-radius: 0;
1010
+ border-left-width: 0;
1011
+ margin-inline-start: -1px;
1012
+ }
1013
+ }
1014
+
1015
+ /* --- LABEL --- */
1016
+ .editor-label {
1017
+ @include text-sm;
1018
+ font-weight: $editor-font-weight-medium;
1019
+ line-height: 1;
1020
+
1021
+ &--disabled {
1022
+ cursor: not-allowed;
1023
+ opacity: $editor-opacity-muted;
1024
+ }
1025
+
1026
+ &--normal {
1027
+ font-weight: $editor-font-weight-normal;
1028
+ cursor: pointer;
1029
+ }
1030
+ }
1031
+
1032
+ .editor-checkbox {
1033
+ @include control-size($editor-icon-size-sm);
1034
+ @include rounded-sm;
1035
+ border: $editor-border-width solid var(--input);
1036
+ cursor: pointer;
1037
+
1038
+ &:checked {
1039
+ background-color: var(--primary);
1040
+ border-color: var(--primary);
1041
+ }
1042
+ }
1043
+
1044
+ .editor-btn-icon-lg {
1045
+ @include control-size($editor-control-size-lg);
1046
+ min-height: $editor-control-size-lg;
1047
+ }
1048
+
1049
+ .editor-btn-icon-md {
1050
+ @include control-size($editor-control-size-md);
1051
+ }
1052
+
1053
+ /* --- DIALOG --- */
1054
+ .editor-dialog-overlay {
1055
+ position: fixed;
1056
+ inset: 0;
1057
+ z-index: $editor-z-index-dialog-overlay;
1058
+ @include backdrop-blur($editor-dialog-overlay-blur, $editor-dialog-overlay-bg);
1059
+ animation: editor-fade-in $editor-transition-normal ease-out;
1060
+ }
1061
+
1062
+ .editor-dialog-content {
1063
+ position: fixed;
1064
+ left: 50%;
1065
+ top: 50%;
1066
+ z-index: $editor-z-index-dialog;
1067
+ display: grid;
1068
+ width: 100%;
1069
+ max-width: $editor-dialog-max-width-default;
1070
+ transform: translate(-50%, -50%);
1071
+ gap: $editor-gap-5;
1072
+ border: $editor-border-width solid var(--border);
1073
+ background-color: var(--background);
1074
+ padding: $editor-gap-5;
1075
+ @include shadow-lg;
1076
+ @include rounded-lg;
1077
+ outline: none;
1078
+ animation: editor-dialog-zoom-in $editor-transition-normal cubic-bezier(0.16, 1, 0.3, 1);
1079
+
1080
+ &--lg {
1081
+ max-width: $editor-dialog-max-width-lg;
1082
+ }
1083
+
1084
+ &__close {
1085
+ position: absolute;
1086
+ right: $editor-gap-4;
1087
+ top: $editor-gap-4;
1088
+ @include rounded-md;
1089
+ opacity: $editor-opacity-muted;
1090
+ background: transparent;
1091
+ border: none;
1092
+ cursor: pointer;
1093
+ transition: opacity $editor-transition-normal;
1094
+
1095
+ &:hover {
1096
+ opacity: 1;
1097
+ }
1098
+
1099
+ @include focus-ring;
1100
+ }
1101
+ }
1102
+
1103
+ .editor-dialog-header {
1104
+ @include flex-col;
1105
+ gap: $editor-gap-1;
1106
+ text-align: center;
1107
+
1108
+ @media (min-width: 640px) {
1109
+ text-align: left;
1110
+ }
1111
+
1112
+ &__title {
1113
+ font-size: $editor-font-size-lg;
1114
+ font-weight: $editor-font-weight-semibold;
1115
+ line-height: $editor-line-height-tight;
1116
+ margin: 0;
1117
+ }
1118
+
1119
+ &__description {
1120
+ @include text-sm;
1121
+ color: var(--muted-foreground);
1122
+ margin: 0;
1123
+ }
1124
+ }
1125
+
1126
+ .editor-dialog-footer {
1127
+ @include flex-col;
1128
+ flex-direction: column-reverse;
1129
+ gap: $editor-gap-2;
1130
+
1131
+ @media (min-width: 640px) {
1132
+ flex-direction: row;
1133
+ justify-content: flex-end;
1134
+ }
1135
+ }
1136
+
1137
+ /* --- POPOVER --- */
1138
+ .editor-popover-content {
1139
+ z-index: $editor-z-index-floating;
1140
+ width: $editor-popover-width;
1141
+ @include rounded-md;
1142
+ border: $editor-border-width solid var(--border);
1143
+ background-color: var(--popover);
1144
+ color: var(--popover-foreground);
1145
+ @include shadow-md;
1146
+ padding: $editor-gap-4;
1147
+ outline: none;
1148
+ animation: editor-popover-zoom-in $editor-transition-fast;
1149
+ }
1150
+
1151
+ /* --- SELECT (Native styling wrapper) --- */
1152
+ .editor-select {
1153
+ @include flex-center;
1154
+ height: $editor-control-size-md;
1155
+ width: 100%;
1156
+ justify-content: space-between;
1157
+ @include rounded-md;
1158
+ border: $editor-border-width solid var(--input);
1159
+ background-color: var(--background);
1160
+ padding: 0 $editor-gap-3;
1161
+ @include text-sm;
1162
+
1163
+ &:focus {
1164
+ outline: none;
1165
+ box-shadow: 0 0 0 $editor-outline-width var(--ring), 0 0 0 $editor-outline-width * 2 var(--background);
1166
+ }
1167
+
1168
+ &:disabled {
1169
+ cursor: not-allowed;
1170
+ opacity: $editor-opacity-disabled;
1171
+ }
1172
+
1173
+ /* Sizes */
1174
+ &--size-default {
1175
+ height: $editor-control-size-md;
1176
+ padding: 0 $editor-gap-3;
1177
+ }
1178
+
1179
+ &--size-sm {
1180
+ height: $editor-control-size-sm;
1181
+ padding: 0 $editor-gap-2;
1182
+ font-size: $editor-font-size-xs;
1183
+ }
1184
+
1185
+ &--size-lg {
1186
+ height: $editor-control-size-lg;
1187
+ padding: 0 $editor-gap-4;
1188
+ }
1189
+
1190
+ &--size-icon {
1191
+ @include control-size($editor-control-size-md);
1192
+ padding: 0;
1193
+ justify-content: center;
1194
+
1195
+ .editor-select-icon {
1196
+ display: none;
1197
+ }
1198
+ }
1199
+
1200
+ &--w-auto {
1201
+ width: auto;
1202
+ padding: 0 $editor-gap-3;
1203
+ min-width: $editor-select-min-width-auto;
1204
+ justify-content: space-between;
1205
+ }
1206
+
1207
+ &--gap-sm {
1208
+ gap: $editor-gap-2;
1209
+ }
1210
+ }
1211
+
1212
+ .editor-select-item {
1213
+ position: relative;
1214
+ @include flex-center;
1215
+ width: 100%;
1216
+ cursor: pointer;
1217
+ user-select: none;
1218
+ gap: $editor-gap-2;
1219
+ @include rounded-sm;
1220
+ padding: $editor-select-item-padding-vertical $editor-gap-2 $editor-select-item-padding-vertical $editor-gap-5;
1221
+ @include text-sm;
1222
+ outline: none;
1223
+
1224
+ &:hover {
1225
+ background-color: $editor-accent-color;
1226
+ color: $editor-accent-foreground-color;
1227
+ }
1228
+
1229
+ &[data-selected="true"] {
1230
+ background-color: $editor-accent-color;
1231
+ color: $editor-accent-foreground-color;
1232
+ }
1233
+
1234
+ &__check {
1235
+ position: absolute;
1236
+ left: $editor-gap-2;
1237
+ display: flex;
1238
+ @include icon-size($editor-icon-size-sm);
1239
+ align-items: center;
1240
+ justify-content: center;
1241
+ }
1242
+ }
1243
+
1244
+ .editor-select-label {
1245
+ padding: $editor-select-item-padding-vertical $editor-gap-2 $editor-select-item-padding-vertical $editor-gap-5;
1246
+ font-size: $editor-font-size-sm;
1247
+ font-weight: $editor-font-weight-semibold;
1248
+ }
1249
+
1250
+ .editor-block-format-label {
1251
+ flex: 1 1 auto;
1252
+ min-width: 0;
1253
+ max-width: none;
1254
+ @include truncate;
1255
+ line-height: 1.25;
1256
+ text-align: left;
1257
+ }
1258
+
1259
+ /* --- TOGGLE --- */
1260
+ .editor-toggle {
1261
+ display: inline-flex;
1262
+ align-items: center;
1263
+ justify-content: center;
1264
+ @include rounded-md;
1265
+ font-size: $editor-font-size-sm;
1266
+ font-weight: $editor-font-weight-medium;
1267
+ transition-property: color, background-color, border-color;
1268
+ transition-duration: $editor-transition-fast;
1269
+ background-color: transparent;
1270
+ border: $editor-border-width solid transparent;
1271
+ cursor: pointer;
1272
+ @include editor-button-interactive;
1273
+
1274
+ &:hover {
1275
+ background-color: $editor-accent-color;
1276
+ color: $editor-accent-foreground-color;
1277
+ }
1278
+
1279
+ &:focus-visible {
1280
+ outline: none;
1281
+ box-shadow: 0 0 0 $editor-outline-width var(--ring), 0 0 0 $editor-outline-width * 2 var(--background);
1282
+ }
1283
+
1284
+ &:disabled {
1285
+ pointer-events: none;
1286
+ opacity: $editor-opacity-disabled;
1287
+ }
1288
+
1289
+ &[data-state="on"] {
1290
+ background-color: $editor-accent-color;
1291
+ color: $editor-accent-foreground-color !important;
1292
+
1293
+ &:hover {
1294
+ @include editor-hover-base;
1295
+ background-color: color-mix(in srgb, $editor-accent-color, black 10%);
1296
+ border-color: $editor-accent-color;
1297
+ }
1298
+ }
1299
+
1300
+ &--outline {
1301
+ border-color: var(--input);
1302
+ @include shadow-sm;
1303
+
1304
+ &:hover {
1305
+ background-color: color-mix(in srgb, $editor-accent-color, black 5%);
1306
+ color: $editor-accent-foreground-color;
1307
+ }
1308
+ }
1309
+
1310
+ &--ghost {
1311
+ &:hover {
1312
+ background-color: color-mix(in srgb, $editor-accent-color, black 5%);
1313
+ color: $editor-accent-foreground-color;
1314
+ }
1315
+ }
1316
+
1317
+ &--size-default {
1318
+ height: $editor-control-size-md;
1319
+ padding-left: $editor-gap-3;
1320
+ padding-right: $editor-gap-3;
1321
+ }
1322
+
1323
+ &--size-sm {
1324
+ height: $editor-control-size-sm;
1325
+ padding-left: $editor-gap-2;
1326
+ padding-right: $editor-gap-2;
1327
+ font-size: $editor-font-size-xs;
1328
+ }
1329
+
1330
+ &--size-lg {
1331
+ height: $editor-control-size-lg;
1332
+ padding-left: $editor-gap-3;
1333
+ padding-right: $editor-gap-3;
1334
+ }
1335
+ }