@thangph2146/lexical-editor 0.0.5 → 0.0.7

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 (40) hide show
  1. package/README.md +47 -0
  2. package/dist/editor-x/editor.cjs +610 -493
  3. package/dist/editor-x/editor.cjs.map +1 -1
  4. package/dist/editor-x/editor.css +157 -69
  5. package/dist/editor-x/editor.css.map +1 -1
  6. package/dist/editor-x/editor.d.cts +2 -1
  7. package/dist/editor-x/editor.d.ts +2 -1
  8. package/dist/editor-x/editor.js +350 -233
  9. package/dist/editor-x/editor.js.map +1 -1
  10. package/dist/index.cjs +620 -501
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.css +157 -69
  13. package/dist/index.css.map +1 -1
  14. package/dist/index.d.cts +1 -1
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.js +354 -235
  17. package/dist/index.js.map +1 -1
  18. package/package.json +3 -1
  19. package/src/components/lexical-editor.tsx +2 -0
  20. package/src/editor-x/editor.tsx +4 -2
  21. package/src/editor-x/plugins.tsx +7 -6
  22. package/src/plugins/images-plugin.tsx +3 -2
  23. package/src/plugins/layout-plugin.tsx +96 -61
  24. package/src/themes/_mixins.scss +12 -7
  25. package/src/themes/_variables.scss +2 -1
  26. package/src/themes/core/_reset.scss +10 -6
  27. package/src/themes/plugins/_color-picker.scss +1 -0
  28. package/src/themes/plugins/_layout.scss +3 -7
  29. package/src/themes/plugins/_list-color.scss +2 -0
  30. package/src/themes/plugins/_toolbar.scss +7 -7
  31. package/src/themes/ui-components/_button.scss +3 -3
  32. package/src/themes/ui-components/_flex.scss +2 -0
  33. package/src/themes/ui-components/_number-input.scss +81 -0
  34. package/src/themes/ui-components/_text-utilities.scss +1 -1
  35. package/src/themes/ui-components.scss +1 -0
  36. package/src/ui/flex.tsx +9 -2
  37. package/src/ui/number-input.tsx +104 -0
  38. package/src/themes/editor-theme copy.scss +0 -763
  39. package/src/themes/plugins copy.scss +0 -656
  40. package/src/themes/ui-components copy.scss +0 -1335
@@ -1,763 +0,0 @@
1
- /**
2
- * Editor Theme - Independent SCSS Structure
3
- * Built for Lexical + Next.js Monorepo
4
- */
5
-
6
- @use "variables" as *;
7
- @use "mixins" as *;
8
- @use "ui-components";
9
- @use "plugins";
10
-
11
- // 2. Scoped Editor Styles
12
- .editor-root-container {
13
- // Editor Container Border (matches input style)
14
- // border: 1px solid transparent; // Removed default border to avoid layout issues
15
- border-radius: $editor-border-radius;
16
- transition: all $editor-transition-normal;
17
-
18
- &.editor-root-container--shadow:focus-within {
19
- // Use box-shadow to simulate border and ring without layout shift
20
- // 1px border simulation + 2px ring
21
- box-shadow: 0 0 0 $editor-border-width $editor-border-color, 0 0 0 $editor-border-width + $editor-outline-width var(--ring, rgba(59, 130, 246, 0.5));
22
- }
23
- }
24
-
25
- .lexical-editor-root {
26
- font-family: $editor-font-family !important;
27
- font-size: $editor-font-size-base; // Set base font size for consistency
28
- color: $editor-text-color !important;
29
- background-color: $editor-bg-color !important;
30
- position: relative !important;
31
- width: 100% !important;
32
- margin: 0 !important;
33
- padding: 0 !important;
34
- text-align: left !important; // Ensure consistent text alignment
35
- box-sizing: border-box !important;
36
-
37
-
38
- // 2.1 CSS Reset & Style Isolation
39
- // Reset common elements to prevent host app styles from leaking in.
40
- // Using specific selectors to maintain performance while ensuring isolation.
41
- *, *::before, *::after {
42
- box-sizing: border-box;
43
- }
44
-
45
- // Reset base typography and layout tags
46
- p, ul, ol, li, span, strong, em, b, i, blockquote, h1, h2, h3, h4, h5, h6 {
47
- margin: 0 !important;
48
- padding: 0;
49
- border: 0 !important;
50
- font-size: 100%; // Removed !important to allow overrides
51
- // font: inherit !important; // Removed aggressive font reset to allow inline styles
52
- vertical-align: baseline !important;
53
- -webkit-font-smoothing: antialiased !important;
54
- -moz-osx-font-smoothing: grayscale !important;
55
- letter-spacing: normal !important; // Reset letter spacing
56
- word-spacing: normal !important; // Reset word spacing
57
- text-indent: 0 !important; // Reset text indentation
58
- text-transform: none !important; // Reset text transformation
59
- text-decoration: none !important; // Reset text decoration
60
- line-height: inherit; // Removed !important to allow overrides
61
- text-align: inherit; // Removed !important to allow overrides
62
- white-space: inherit !important;
63
- word-break: normal !important;
64
- word-wrap: normal !important;
65
- overflow-wrap: normal !important;
66
- margin-inline-start: 0 !important;
67
- margin-inline-end: 0 !important;
68
- padding-inline-start: 0;
69
- padding-inline-end: 0;
70
- margin-block-start: 0 !important;
71
- margin-block-end: 0 !important;
72
- -webkit-tap-highlight-color: transparent !important;
73
- }
74
-
75
- // Ensure consistent list behavior
76
- ul, ol {
77
- list-style-position: outside !important;
78
- list-style-type: none !important; // Default to none, will be overridden by .editor-ul/ol
79
- }
80
-
81
- li {
82
- margin: 0;
83
- padding: 0;
84
- }
85
-
86
- // Ensure span (Lexical text nodes) don't inherit unexpected layout properties
87
- span[data-lexical-text="true"] {
88
- display: inline !important;
89
- white-space: pre-wrap !important;
90
- word-break: break-word !important;
91
- margin: 0 !important;
92
- padding: 0 !important;
93
- }
94
-
95
- // Core Typography
96
- .editor-paragraph {
97
- font-size: $editor-font-size-base !important;
98
- line-height: $editor-line-height-base !important;
99
- margin-top: $editor-paragraph-margin-vertical !important;
100
- margin-bottom: $editor-paragraph-margin-vertical !important;
101
-
102
- &:first-child { margin-top: 0 !important; }
103
- }
104
-
105
- // Headings - Improved sizes and spacing
106
- .editor-h1 {
107
- font-size: $editor-h1-size;
108
- line-height: $editor-heading-line-height !important;
109
- font-weight: $editor-font-weight-bold !important;
110
- letter-spacing: $editor-heading-letter-spacing-tight;
111
- margin-top: $editor-heading-margin-top * 1.5 !important;
112
- margin-bottom: $editor-heading-margin-bottom * 1.5 !important;
113
- }
114
- .editor-h2 {
115
- font-size: $editor-h2-size;
116
- line-height: $editor-heading-line-height !important;
117
- font-weight: $editor-font-weight-semibold !important;
118
- margin-top: $editor-heading-margin-top * 1.25 !important;
119
- margin-bottom: $editor-heading-margin-bottom * 1.25 !important;
120
- border-bottom: $editor-border-width solid var(--border);
121
- padding-bottom: $editor-gap-1;
122
- }
123
- .editor-h3 {
124
- font-size: $editor-h3-size;
125
- line-height: $editor-heading-line-height !important;
126
- font-weight: $editor-font-weight-semibold !important;
127
- margin-top: $editor-heading-margin-top !important;
128
- margin-bottom: $editor-heading-margin-bottom !important;
129
- }
130
- .editor-h4 {
131
- font-size: $editor-h4-size;
132
- line-height: $editor-heading-line-height !important;
133
- font-weight: $editor-font-weight-semibold !important;
134
- margin-top: $editor-heading-margin-top * 0.75 !important;
135
- margin-bottom: $editor-heading-margin-bottom * 0.75 !important;
136
- }
137
- .editor-h5 {
138
- font-size: $editor-h5-size;
139
- line-height: $editor-heading-line-height !important;
140
- font-weight: $editor-font-weight-semibold !important;
141
- margin-top: $editor-heading-margin-top * 0.5 !important;
142
- margin-bottom: $editor-heading-margin-bottom * 0.5 !important;
143
- }
144
- .editor-h6 {
145
- font-size: $editor-h6-size;
146
- line-height: $editor-heading-line-height !important;
147
- font-weight: $editor-font-weight-semibold !important;
148
- margin-top: $editor-heading-margin-top * 0.5 !important;
149
- margin-bottom: $editor-heading-margin-bottom * 0.5 !important;
150
- }
151
-
152
- .editor-quote {
153
- margin: $editor-code-margin 0 !important;
154
- padding: $editor-quote-padding $editor-quote-padding $editor-quote-padding ($editor-quote-padding + $editor-gap-2);
155
- border-left: $editor-quote-border-width solid var(--border);
156
- font-size: $editor-quote-font-size;
157
- color: var(--muted-foreground);
158
- font-style: italic;
159
- background-color: var(--muted);
160
- @include rounded-r-md;
161
- }
162
-
163
- // Lists
164
- .editor-ol {
165
- list-style-type: decimal !important;
166
- padding-left: $editor-list-padding-left !important;
167
- margin-top: $editor-list-margin-vertical !important;
168
- margin-bottom: $editor-list-margin-vertical !important;
169
-
170
- &[data-list-marker="alpha"] {
171
- list-style-type: lower-alpha !important;
172
- }
173
-
174
- // Handle custom marker string (e.g., "4.1.", "a)", etc.)
175
- &[data-list-marker]:not([data-list-marker="alpha"]):not([data-list-marker="multi-level"]) {
176
- list-style-type: none !important;
177
- > li:not(.editor-nested-listitem)::marker {
178
- content: attr(data-list-marker) !important;
179
- }
180
- }
181
-
182
- &[data-list-marker="multi-level"] {
183
- list-style-type: none !important;
184
- counter-reset: item;
185
- }
186
-
187
- &[data-list-marker="multi-level"] > li {
188
- counter-increment: item;
189
- }
190
-
191
- &[data-list-marker="multi-level"] > li.editor-nested-listitem {
192
- counter-increment: none !important;
193
- }
194
-
195
- &[data-list-marker="multi-level"] > li:not(.editor-nested-listitem)::marker {
196
- content: counters(item, ".") ". " !important;
197
- }
198
-
199
- &[data-list-marker="multi-level"] .editor-ol {
200
- list-style-type: none !important;
201
- counter-reset: item;
202
- }
203
-
204
- &[data-list-marker="multi-level"] .editor-ol > li {
205
- counter-increment: item;
206
- }
207
-
208
- &[data-list-marker="multi-level"] .editor-ol > li.editor-nested-listitem {
209
- counter-increment: none !important;
210
- }
211
-
212
- &[data-list-marker="multi-level"] .editor-ol > li:not(.editor-nested-listitem)::marker {
213
- content: counters(item, ".") ". " !important;
214
- }
215
-
216
- &[data-list-color] {
217
- li::marker { color: var(--list-marker-color, currentColor) !important; }
218
- }
219
- }
220
-
221
- .editor-ul:not(.editor-checklist) {
222
- padding-left: $editor-list-padding-left !important;
223
- margin-top: $editor-list-margin-vertical !important;
224
- margin-bottom: $editor-list-margin-vertical !important;
225
-
226
- &:not([data-list-marker]) {
227
- list-style-type: disc !important;
228
- }
229
-
230
- &[data-list-marker="-"] {
231
- list-style-type: none !important;
232
- > li:not(.editor-nested-listitem)::marker { content: "- " !important; }
233
- }
234
- &[data-list-marker="+"] {
235
- list-style-type: none !important;
236
- > li:not(.editor-nested-listitem)::marker { content: "+ " !important; }
237
- }
238
-
239
- // Handle custom marker string (e.g., "•", "—", etc.)
240
- &[data-list-marker]:not([data-list-marker="-"]):not([data-list-marker="+"]) {
241
- list-style-type: none !important;
242
- > li:not(.editor-nested-listitem)::marker {
243
- content: attr(data-list-marker) !important;
244
- }
245
- }
246
-
247
- &[data-list-color] {
248
- li::marker { color: var(--list-marker-color, currentColor) !important; }
249
- }
250
- }
251
-
252
- .editor-listitem {
253
- margin-bottom: $editor-list-item-margin-bottom !important;
254
- line-height: $editor-line-height-relaxed !important;
255
- }
256
-
257
- .editor-checklist {
258
- list-style: none !important;
259
- padding: 0 !important;
260
- margin-top: $editor-list-margin-vertical !important;
261
- margin-bottom: $editor-list-margin-vertical !important;
262
- margin-left: 0 !important;
263
- margin-right: 0 !important;
264
- outline: none !important; // Prevent focus outline
265
- box-shadow: none !important; // Prevent focus ring
266
-
267
- .editor-listitem-checked,
268
- .editor-listitem-unchecked {
269
- @include flex-center;
270
- align-items: flex-start; // Align icon with the first line of text
271
- margin-left: 0;
272
- padding: $editor-checklist-item-padding-vertical 0; // Vertical padding only
273
- list-style: none;
274
- outline: none;
275
- gap: $editor-checklist-gap; // Space between icon and text
276
-
277
- // Checkbox Icon (using ::before as the visual container)
278
- &::before {
279
- content: "";
280
- @include control-size($editor-checklist-icon-size);
281
- flex-shrink: 0; // Prevent icon from shrinking
282
- margin-top: $editor-checklist-icon-margin-top; // Optical alignment with text cap-height (approx)
283
- cursor: pointer;
284
- display: block;
285
- border: $editor-border-width-thick solid var(--list-marker-color, #{$editor-link-color}) !important;
286
- border-radius: $editor-checklist-icon-border-radius;
287
- box-sizing: border-box;
288
- transition: all $editor-transition-fast;
289
- background-position: center;
290
- background-repeat: no-repeat;
291
- background-size: $editor-checklist-icon-checkmark-size; // Size of the checkmark
292
- }
293
- }
294
-
295
- .editor-listitem-checked {
296
- text-decoration: line-through;
297
- color: $editor-muted-foreground-color;
298
-
299
- &::before {
300
- background-color: var(--list-marker-color, #{$editor-link-color}) !important;
301
- border-color: var(--list-marker-color, #{$editor-link-color}) !important;
302
- // SVG Checkmark
303
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M3 7.5L5.5 10L11 4.5'/%3E%3C/svg%3E");
304
- }
305
-
306
- // Remove old ::after tick mark
307
- &::after {
308
- display: none;
309
- }
310
- }
311
- }
312
-
313
- // Remove the standalone .editor-listitem-checked/unchecked blocks if they exist elsewhere
314
- // But wait, are they used outside .editor-checklist?
315
- // Checklist items are only in checklists.
316
-
317
-
318
- .editor-nested-listitem {
319
- list-style: none;
320
-
321
- &::before, &::after { display: none; }
322
- }
323
-
324
- // List Depths
325
- $list-styles: (
326
- 1: decimal,
327
- 2: upper-roman,
328
- 3: lower-roman,
329
- 4: upper-alpha,
330
- 5: lower-alpha
331
- );
332
-
333
- @each $depth, $style in $list-styles {
334
- .editor-ol-depth-#{$depth} {
335
- list-style-type: $style !important;
336
-
337
- // Handle custom marker string (e.g., "4.1.", "a)", etc.)
338
- &[data-list-marker]:not([data-list-marker="alpha"]):not([data-list-marker="multi-level"]) {
339
- list-style-type: none !important;
340
- > li:not(.editor-nested-listitem)::marker {
341
- content: attr(data-list-marker) !important;
342
- }
343
- }
344
-
345
- &[data-list-marker="multi-level"] {
346
- list-style-type: none !important;
347
- counter-reset: item;
348
- }
349
-
350
- &[data-list-marker="multi-level"] > li {
351
- counter-increment: item;
352
- }
353
-
354
- &[data-list-marker="multi-level"] > li.editor-nested-listitem {
355
- counter-increment: none !important;
356
- }
357
-
358
- &[data-list-marker="multi-level"] > li:not(.editor-nested-listitem)::marker {
359
- content: counters(item, ".") ". " !important;
360
- }
361
- }
362
- .editor-ul-depth-#{$depth}:not(.editor-checklist) {
363
- &[data-list-marker="-"] {
364
- list-style-type: none !important;
365
- > li:not(.editor-nested-listitem)::marker { content: "- " !important; }
366
- }
367
- &[data-list-marker="+"] {
368
- list-style-type: none !important;
369
- > li:not(.editor-nested-listitem)::marker { content: "+ " !important; }
370
- }
371
- // Handle custom marker string (e.g., "•", "—", etc.)
372
- &[data-list-marker]:not([data-list-marker="-"]):not([data-list-marker="+"]) {
373
- list-style-type: none !important;
374
- > li:not(.editor-nested-listitem)::marker {
375
- content: attr(data-list-marker) !important;
376
- }
377
- }
378
- &:not([data-list-marker]) {
379
- list-style-type: disc !important;
380
- }
381
- }
382
- }
383
-
384
- // Code
385
- .editor-code {
386
- background-color: $editor-code-bg;
387
- color: $editor-code-color;
388
- font-family: $editor-font-family-mono;
389
- display: block;
390
- padding: $editor-code-padding $editor-code-padding $editor-code-padding ($editor-code-padding * 4);
391
- line-height: $editor-line-height-base;
392
- font-size: $editor-code-font-size;
393
- margin: $editor-code-margin 0 !important;
394
- overflow-x: auto;
395
- border: $editor-border-width solid var(--border);
396
- position: relative;
397
- @include rounded-md;
398
- tab-size: 2;
399
- @include shadow-sm;
400
-
401
- &::before {
402
- content: attr(data-gutter);
403
- position: absolute;
404
- background-color: var(--muted);
405
- left: 0;
406
- top: 0;
407
- bottom: 0;
408
- padding: $editor-code-padding;
409
- border-right: $editor-border-width solid var(--border);
410
- color: var(--muted-foreground);
411
- white-space: pre-wrap;
412
- text-align: right;
413
- min-width: ($editor-code-padding * 3);
414
- font-size: calc($editor-code-font-size - $editor-outline-width);
415
- user-select: none;
416
- }
417
- }
418
-
419
- // Hashtag
420
- .editor-hashtag {
421
- background-color: rgba($editor-primary-color, $editor-hashtag-opacity);
422
- color: $editor-primary-color;
423
- border-bottom: $editor-border-width solid $editor-primary-color;
424
- padding: 0 calc($editor-gap-1 / 2);
425
- }
426
-
427
- // Table Styles - Clean borders
428
- .editor-table {
429
- border-collapse: collapse;
430
- border-spacing: 0;
431
- width: 100%;
432
- table-layout: fixed;
433
- margin: $editor-table-margin-vertical 0;
434
- border-radius: $editor-border-radius;
435
- border: $editor-border-width solid $editor-border-color;
436
-
437
- .editor-table-cell {
438
- min-width: 0 !important;
439
- border: $editor-border-width solid $editor-table-border-color;
440
- padding: $editor-table-cell-padding-y $editor-table-cell-padding-x;
441
- position: relative;
442
- text-align: left;
443
- vertical-align: top;
444
- }
445
-
446
- .editor-table-cell-header {
447
- @extend .editor-table-cell;
448
- background-color: $editor-table-header-bg;
449
- font-weight: $editor-font-weight-semibold;
450
- color: $editor-text-color;
451
- }
452
-
453
- .editor-table-cell-selected {
454
- background-color: rgba($editor-primary-color, $editor-table-cell-selection-opacity) !important;
455
- outline: 2px solid $editor-primary-color !important;
456
- outline-offset: -2px;
457
-
458
- &::after {
459
- content: "";
460
- position: absolute;
461
- top: 0;
462
- left: 0;
463
- right: 0;
464
- bottom: 0;
465
- background-color: rgba($editor-primary-color, $editor-table-cell-selection-opacity);
466
- pointer-events: none;
467
- z-index: 2; // Increased z-index
468
- }
469
- }
470
-
471
- .editor-table-cell-action-button-container {
472
- display: block;
473
- right: $editor-table-action-button-right;
474
- top: $editor-table-action-button-top;
475
- position: absolute;
476
- z-index: $editor-z-index-layer-10;
477
- width: $editor-table-action-button-size;
478
- height: $editor-table-action-button-size;
479
- }
480
-
481
- .editor-table-cell-action-button {
482
- background-color: $editor-muted-color;
483
- display: block;
484
- border: 0;
485
- @include rounded-full;
486
- @include control-size($editor-table-action-button-size);
487
- color: $editor-text-color;
488
- cursor: pointer;
489
- transition: all $editor-transition-fast;
490
-
491
- @include editor-button-interactive;
492
- }
493
-
494
- .editor-table-cell-editing {
495
- box-shadow: 0 0 $editor-shadow-blur-sm $editor-table-cell-editing-shadow;
496
- border-radius: calc($editor-gap-1 / 2);
497
- }
498
-
499
- .editor-table-cell-primary-selected {
500
- border: $editor-outline-width solid $editor-primary-color;
501
- display: block;
502
- height: calc(100% - #{$editor-outline-width});
503
- width: calc(100% - #{$editor-outline-width});
504
- position: absolute;
505
- left: -#{$editor-border-width};
506
- top: -#{$editor-border-width};
507
- z-index: $editor-z-index-layer-10;
508
- }
509
-
510
- .editor-table-cell-sorted-indicator {
511
- display: block;
512
- opacity: 0.5;
513
- position: absolute;
514
- bottom: 0;
515
- left: 0;
516
- width: 100%;
517
- height: $editor-table-sorted-indicator-height;
518
- background-color: $editor-muted-color;
519
- }
520
-
521
- .editor-table-row-striping {
522
- margin: 0;
523
- border-top: $editor-border-width solid $editor-border-color;
524
- padding: 0;
525
-
526
- &:nth-child(even) {
527
- background-color: $editor-muted-color;
528
- }
529
- }
530
-
531
- .editor-table-selected {
532
- outline: $editor-outline-width solid $editor-primary-color;
533
- }
534
-
535
- .editor-table-selection {
536
- background-color: rgba($editor-primary-color, $editor-table-cell-selection-opacity * 0.5) !important;
537
- }
538
- }
539
-
540
- // Text Formatting
541
- .editor-link { color: $editor-link-color; text-decoration: none; &:hover { text-decoration: underline; cursor: pointer; } }
542
- .editor-text-bold { font-weight: $editor-font-weight-bold !important; }
543
- .editor-text-italic { font-style: italic !important; }
544
- .editor-text-underline { text-decoration: underline !important; }
545
- .editor-text-strikethrough { text-decoration: line-through !important; }
546
- .editor-text-underline-strikethrough { text-decoration: underline line-through !important; }
547
- .editor-text-subscript { vertical-align: sub !important; font-size: $editor-script-font-size !important; }
548
- .editor-text-superscript { vertical-align: super !important; font-size: $editor-script-font-size !important; }
549
- .editor-text-code {
550
- background-color: $editor-muted-color;
551
- color: $editor-text-color;
552
- padding: $editor-inline-code-padding-y $editor-inline-code-padding-x;
553
- font-family: $editor-font-family-mono;
554
- font-size: $editor-code-font-size;
555
- @include rounded-md;
556
- border: $editor-border-width solid $editor-border-color;
557
- font-weight: $editor-font-weight-medium;
558
- }
559
-
560
- // Text Alignment
561
- .editor-text-align-left {
562
- text-align: left !important;
563
- }
564
-
565
- .editor-text-align-center {
566
- text-align: center !important;
567
- }
568
-
569
- .editor-text-align-right {
570
- text-align: right !important;
571
- }
572
-
573
- .editor-text-align-justify {
574
- text-align: justify !important;
575
- }
576
-
577
- // Images
578
- .editor-image {
579
- display: inline-block;
580
- position: relative;
581
- cursor: default;
582
- user-select: none;
583
-
584
- img {
585
- max-width: 100%;
586
- height: auto;
587
- }
588
- }
589
-
590
- .editor-inline-image {
591
- display: inline-block;
592
- position: relative;
593
- z-index: $editor-z-index-layer-1;
594
-
595
- img {
596
- max-width: 100%;
597
- height: auto;
598
- }
599
- }
600
-
601
- .editor-image-focused {
602
- outline: $editor-outline-width solid $editor-primary-color;
603
- outline-offset: calc($editor-gap-1 / 2);
604
- }
605
-
606
- .editor-image-draggable {
607
- cursor: grab;
608
-
609
- &:active {
610
- cursor: grabbing;
611
- }
612
- }
613
-
614
- .editor-image-caption {
615
- display: block;
616
- min-width: $editor-image-caption-min-width;
617
- overflow: hidden;
618
- padding: 0;
619
- margin-top: $editor-gap-2;
620
-
621
- &.editable {
622
- border: $editor-border-width solid $editor-border-color;
623
- border-radius: $editor-border-radius;
624
- background-color: $editor-image-caption-bg;
625
- }
626
-
627
- &.readonly {
628
- border: 0;
629
- background-color: transparent;
630
- }
631
- }
632
-
633
- .editor-lazy-image-wrapper {
634
- display: inline-block;
635
-
636
- &.full-width {
637
- width: 100%;
638
- }
639
- }
640
-
641
- // Broken Image
642
- .editor-broken-image-container {
643
- display: inline-block;
644
- width: $editor-image-broken-size;
645
- height: $editor-image-broken-size;
646
-
647
- img {
648
- opacity: 0.2;
649
- object-fit: contain;
650
- }
651
- }
652
-
653
- // Tweet
654
- .editor-tweet-container {
655
- display: block;
656
- width: 100%;
657
- max-width: $editor-tweet-max-width;
658
- }
659
-
660
- // Horizontal Rule
661
- .editor-hr {
662
- padding: calc($editor-gap-1 / 2);
663
- border: none;
664
- margin: $editor-hr-margin-vertical 0;
665
- cursor: pointer;
666
-
667
- &:after {
668
- content: "";
669
- display: block;
670
- height: $editor-hr-height;
671
- background-color: $editor-border-color;
672
- line-height: $editor-hr-height;
673
- }
674
-
675
- &.selected {
676
- outline: $editor-outline-width solid $editor-primary-color;
677
- user-select: none;
678
- }
679
- }
680
-
681
- // Embed Block
682
- .editor-embed-block {
683
- user-select: none;
684
- }
685
-
686
- .editor-embed-block-focused {
687
- outline: $editor-outline-width solid $editor-primary-color;
688
- }
689
-
690
- // Autocomplete
691
- .editor-autocomplete {
692
- color: $editor-muted-foreground-color;
693
- }
694
-
695
-
696
- }
697
-
698
- .editor-content-editable {
699
- position: relative !important;
700
- display: block !important;
701
- outline: none !important;
702
-
703
- &:not(&--readonly):not(&--review) {
704
- min-height: $editor-content-min-height !important; // min-h-72
705
- padding: $editor-content-padding-y $editor-content-padding-x !important; // py-4 px-8
706
- }
707
-
708
- &:focus {
709
- outline: none !important;
710
- }
711
-
712
- &--readonly,
713
- &--review {
714
- cursor: default !important;
715
- user-select: text !important;
716
- min-height: unset !important;
717
- padding: 0 !important;
718
- }
719
- }
720
-
721
- .editor-placeholder {
722
- color: var(--muted-foreground) !important;
723
- pointer-events: none !important;
724
- position: absolute !important;
725
- top: 0 !important;
726
- left: 0 !important;
727
- overflow: hidden !important;
728
- padding: $editor-placeholder-padding-y $editor-content-padding-x !important; // py-[18px] px-8
729
- text-overflow: ellipsis !important;
730
- user-select: none !important;
731
-
732
- .editor-content-editable--readonly + &,
733
- .editor-content-editable--review + & {
734
- display: none !important;
735
- }
736
- }
737
-
738
- .editor-table-cell-resizer {
739
- position: absolute;
740
- height: 100%;
741
- width: 16px;
742
- cursor: col-resize;
743
- z-index: $editor-z-index-floating;
744
- top: 0;
745
- pointer-events: auto !important;
746
- user-select: none;
747
- background-color: transparent;
748
-
749
- &:hover {
750
- background-color: rgba($editor-primary-color, 0.1);
751
- }
752
- }
753
-
754
- .editor-table-cell-resize-ruler {
755
- display: block;
756
- position: absolute;
757
- width: 1px;
758
- height: 100%;
759
- background-color: $editor-primary-color;
760
- top: 0;
761
- left: 8px;
762
- pointer-events: none;
763
- }