@innoviatech/lexical-text-editor 1.0.5 → 2.0.0

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 (44) hide show
  1. package/README.md +105 -35
  2. package/dist/components/ContentPreview.d.ts +1 -1
  3. package/dist/components/HeadingSelectionList.d.ts +1 -1
  4. package/dist/components/LexicalTextEditor.d.ts +1 -1
  5. package/dist/components/common/Dialog.d.ts +9 -0
  6. package/dist/components/common/Popover.d.ts +21 -0
  7. package/dist/components/common/Tooltip.d.ts +10 -0
  8. package/dist/components/ui/button.d.ts +1 -1
  9. package/dist/index.d.ts +1 -1
  10. package/dist/index.esm.js +1 -1
  11. package/dist/index.esm.js.map +1 -1
  12. package/dist/index.js +1 -1
  13. package/dist/index.js.map +1 -1
  14. package/dist/lexical-editor.css +1 -0
  15. package/dist/nodes/ExtendedTextNode.d.ts +11 -0
  16. package/dist/nodes/ImageNode.d.ts +1 -1
  17. package/dist/plugins/YoutubePlugin.d.ts +1 -0
  18. package/package.json +20 -16
  19. package/rollup.config.js +3 -4
  20. package/src/components/AlignmentSelectionList.tsx +41 -24
  21. package/src/components/ColorPicker.tsx +7 -21
  22. package/src/components/ContentPreview.tsx +27 -20
  23. package/src/components/DropdownList.tsx +39 -24
  24. package/src/components/HeadingSelectionList.tsx +48 -32
  25. package/src/components/ImageComponent.tsx +52 -19
  26. package/src/components/InsertDropdownList.tsx +1 -1
  27. package/src/components/LexicalTextEditor.tsx +33 -28
  28. package/src/components/LinkModal.tsx +42 -45
  29. package/src/components/common/Dialog.tsx +47 -0
  30. package/src/components/common/Popover.tsx +87 -0
  31. package/src/components/common/Tooltip.tsx +43 -0
  32. package/src/components/ui/command.tsx +0 -1
  33. package/src/nodes/ExtendedTextNode.tsx +174 -0
  34. package/src/nodes/ImageNode.tsx +48 -9
  35. package/src/plugins/ColorPlugin.tsx +19 -14
  36. package/src/plugins/ImagePlugin.tsx +79 -84
  37. package/src/plugins/ListPlugin.tsx +20 -38
  38. package/src/plugins/ToolbarPlugin.tsx +76 -78
  39. package/src/plugins/VideoPlugin.tsx +46 -55
  40. package/src/plugins/YoutubePlugin.tsx +83 -0
  41. package/src/styles/lexical-editor.css +962 -3
  42. package/dist/style.css +0 -3
  43. package/postcss.config.js +0 -6
  44. package/src/assets/react.svg +0 -1
@@ -1,6 +1,24 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
1
+
2
+ /* Minimal Reset */
3
+
4
+ *{
5
+ box-sizing: border-box;
6
+ margin: 0;
7
+ padding: 0;
8
+ }
9
+ .lexical-text-editor * {
10
+ box-sizing: border-box;
11
+ font-family: inherit;
12
+ }
13
+
14
+
15
+ .lexical-text-editor button {
16
+ background: transparent;
17
+ border: 1px solid transparent;
18
+ cursor: pointer;
19
+ }
20
+
21
+
4
22
 
5
23
  .lexical-text-editor a {
6
24
  font-weight: 500;
@@ -13,9 +31,50 @@
13
31
 
14
32
  .lexical-text-editor {
15
33
  scrollbar-width: thin;
34
+ font-size: 16px !important;
16
35
  scrollbar-color: rgb(156 163 175) transparent;
36
+ background-color: #fff;
37
+ border: 1px solid #e5e7eb;
38
+ border-radius: 0.5rem;
39
+ padding-bottom: 0.5rem;
40
+ color: black;
17
41
  }
18
42
 
43
+ .lexical-text-editor input{
44
+ background-color: #fff;
45
+ color: black;
46
+ outline: none;
47
+ }
48
+
49
+ .link-editor-buttons input{
50
+ background-color: #220909;
51
+ color: black;
52
+ stroke: black;
53
+ outline: none;
54
+ }
55
+
56
+ .lexical-text-editor input:focus{
57
+ border: 1px solid #676666;
58
+ }
59
+
60
+ /* display: 'flex', flexWrap: 'wrap',
61
+ gap: 6, justifyContent: 'start', alignItems: 'center', */
62
+
63
+ .lexical-toolbar-wrapper{
64
+ display: flex;
65
+ flex-wrap: wrap;
66
+ gap: 6px;
67
+ row-gap: 12px;
68
+ justify-content: center;
69
+ align-items: center;
70
+ }
71
+
72
+ .lexical-toolbar-wrapper.useScroll{
73
+ flex-wrap: nowrap;
74
+ }
75
+
76
+
77
+
19
78
  .lexical-text-editor::-webkit-scrollbar {
20
79
  width: 6px;
21
80
  }
@@ -91,3 +150,903 @@
91
150
  background-color: #a5acb6;
92
151
  border-radius: 9999px;
93
152
  }
153
+
154
+
155
+
156
+ /* ---------------------------- */
157
+
158
+ .lexical-editor-container {
159
+ position: relative;
160
+ box-sizing: border-box;
161
+ }
162
+
163
+ .lexical-toolbar-container {
164
+ padding-left: 0.5rem;
165
+ padding-right: 0.5rem;
166
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
167
+ }
168
+
169
+ .lexical-editor-inner {
170
+ position: relative;
171
+ height: 100%;
172
+ }
173
+
174
+ .lexical-content-editable {
175
+ scrollbar-width: thin;
176
+ scrollbar-color: rgb(156 163 175) transparent;
177
+ text-align: start;
178
+ width: 100%;
179
+ height: 100%;
180
+ font-size: 14px;
181
+ padding: 8px;
182
+ overflow: auto;
183
+ outline: 0;
184
+ box-sizing: border-box;
185
+ background-color: white;
186
+ color: black;
187
+ }
188
+
189
+ .lexical-placeholder {
190
+ position: absolute;
191
+ color: #999;
192
+ top: 8px;
193
+ left: 10px;
194
+ font-size: 14px;
195
+ pointer-events: none;
196
+ user-select: none;
197
+ }
198
+
199
+ .lexical-content-editable::-webkit-scrollbar {
200
+ width: 8px;
201
+ height: 8px;
202
+ }
203
+
204
+ .lexical-content-editable::-webkit-scrollbar-track {
205
+ background: #f1f1f1;
206
+ border-radius: 4px;
207
+ }
208
+
209
+ .lexical-content-editable::-webkit-scrollbar-thumb {
210
+ background: #c1c1c1;
211
+ border-radius: 4px;
212
+ }
213
+
214
+ .lexical-content-editable::-webkit-scrollbar-thumb:hover {
215
+ background: #a8a8a8;
216
+ }
217
+
218
+ .lexical-bold {
219
+ font-weight: bold;
220
+ }
221
+
222
+ .lexical-underline {
223
+ text-decoration: underline;
224
+ }
225
+
226
+ .lexical-italic {
227
+ font-style: italic;
228
+ }
229
+
230
+ .lexical-strikethrough {
231
+ text-decoration: line-through;
232
+ }
233
+
234
+ .lexical-underline-strikethrough {
235
+ text-decoration: underline line-through;
236
+ }
237
+
238
+ .lexical-uppercase {
239
+ text-transform: uppercase;
240
+ }
241
+
242
+ .lexical-lowercase {
243
+ text-transform: lowercase;
244
+ }
245
+
246
+ .lexical-capitalize {
247
+ text-transform: capitalize;
248
+ }
249
+
250
+ .lexical-code {
251
+ background-color: #f3f4f6;
252
+ border: 1px solid #d1d5db;
253
+ padding: 0 0.25rem;
254
+ border-radius: 0.25rem;
255
+ font-size: 0.875rem;
256
+ font-family: monospace;
257
+ color: #000;
258
+ }
259
+
260
+ .lexical-paragraph {
261
+ margin-bottom: 0.5rem;
262
+ }
263
+
264
+ .lexical-list-ul {
265
+ list-style-type: disc;
266
+ list-style-position: inside;
267
+ padding-left: 1.5rem;
268
+ }
269
+
270
+ .lexical-list-ol {
271
+ list-style-type: decimal;
272
+ list-style-position: inside;
273
+ padding-left: 1.5rem;
274
+ }
275
+
276
+ .lexical-listitem {
277
+ margin-bottom: 0.25rem;
278
+ }
279
+
280
+ .lexical-quote {
281
+ border-left: 4px solid #9ca3af;
282
+ padding-left: 1rem;
283
+ font-style: italic;
284
+ color: #374151;
285
+ background-color: #f9fafb;
286
+ padding-top: 0.5rem;
287
+ padding-bottom: 0.5rem;
288
+ border-top-right-radius: 0.25rem;
289
+ border-bottom-right-radius: 0.25rem;
290
+ }
291
+
292
+ .lexical-link {
293
+ color: #2563eb;
294
+ text-decoration: underline;
295
+ }
296
+
297
+ .lexical-link:hover {
298
+ color: #1e40af;
299
+ }
300
+
301
+
302
+
303
+ /* --------------------------------------- HeadingSelectionList Start --------------------------------------------- */
304
+
305
+
306
+
307
+ /* --------------------------------------------- HeadingSelectionList End ------------------------------------------ */
308
+
309
+
310
+ /* ------------------------------------------- Button Component ------------------------------------------------ */
311
+
312
+
313
+ /* ===========================================
314
+ Base Button (matches shadcn/ui + Tailwind)
315
+ =========================================== */
316
+ .lexical-text-editor .lexical-btn {
317
+ cursor: pointer;
318
+ display: inline-flex;
319
+ align-items: center;
320
+ justify-content: flex-start;
321
+ width: 100%;
322
+
323
+ /* Sizing identical to Tailwind’s size-8 + px-3 py-2 */
324
+ padding: 8px 12px;
325
+ height: 32px; /* size-8 = 2rem = 32px */
326
+ border-radius: 6px;
327
+
328
+ /* Typography */
329
+ font-size: 14px;
330
+ font-weight: 500;
331
+ white-space: nowrap;
332
+
333
+ /* Colors from shadcn toolbar buttons */
334
+ background: white;
335
+ color: rgb(75 85 99); /* text-gray-600 */
336
+
337
+ /* Interaction */
338
+ transition: all 0.15s ease;
339
+ user-select: none;
340
+ border: none;
341
+
342
+ /* Ensures icon + label spacing matches previous */
343
+ gap: 8px;
344
+ outline: none;
345
+ }
346
+
347
+
348
+ /* ===========================================
349
+ Icon behavior (same as shadcn)
350
+ =========================================== */
351
+ .lexical-text-editor .lexical-btn svg {
352
+ pointer-events: none;
353
+ flex-shrink: 0;
354
+ width: 16px; /* shadcn default svg size */
355
+ height: 16px;
356
+ }
357
+
358
+ .lexical-text-editor .lexical-btn svg[class*="size-"] {
359
+ /* if custom sizes were applied, keep them */
360
+ width: auto;
361
+ height: auto;
362
+ }
363
+
364
+ /* ===========================================
365
+ Label spacing identical to Tailwind ml-2
366
+ =========================================== */
367
+ .lexical-text-editor .lexical-btn .label {
368
+ margin-left: 8px;
369
+ }
370
+
371
+ /* ===========================================
372
+ Toolbar (inactive)
373
+ =========================================== */
374
+ .lexical-text-editor .lexical-btn.toolbar {
375
+ background: white;
376
+ color: rgb(75 85 99); /* gray-600 */
377
+ }
378
+
379
+ .lexical-text-editor .lexical-btn.toolbar:hover {
380
+ background: rgba(241, 245, 249, 0.8); /* slate-100/80 */
381
+ }
382
+
383
+ /* ===========================================
384
+ Toolbar Active (matches shadcn toolbarActive)
385
+ =========================================== */
386
+ .lexical-text-editor .lexical-btn.toolbar-active {
387
+ background: rgb(241 245 249); /* slate-100 */
388
+ color: rgb(17 24 39); /* gray-900 */
389
+ }
390
+
391
+ /* ===========================================
392
+ Disabled (shadcn behavior)
393
+ =========================================== */
394
+ .lexical-text-editor .lexical-btn:disabled {
395
+ opacity: 0.5;
396
+ pointer-events: none;
397
+ }
398
+
399
+ /******************************
400
+ * SIZE
401
+ ******************************/
402
+ .lexical-text-editor .size-8 {
403
+ width: 32px !important;
404
+ height: 32px !important;
405
+ }
406
+
407
+
408
+ .lexical-text-editor .toolbar {
409
+ display: inline-flex;
410
+ justify-content: flex-start;
411
+ align-items: center;
412
+ border-radius: 8px;
413
+ background-color: #ffffff;
414
+ color: #374151;
415
+ transition: background 0.15s ease, border-color 0.15s ease;
416
+ cursor: pointer;
417
+ }
418
+
419
+ .lexical-text-editor .toolbar.icon {
420
+ display: inline-flex;
421
+ justify-content: center !important;
422
+ align-items: center;
423
+ }
424
+
425
+ .lexical-text-editor .toolbar:hover:not(:disabled) {
426
+ background-color: #f3f4f6;
427
+ }
428
+
429
+
430
+ .lexical-text-editor .toolbarActive {
431
+ display: inline-flex;
432
+ justify-content: center;
433
+ align-items: center;
434
+ border-radius: 0.5rem;
435
+ background-color: #eef2ff;
436
+ cursor: pointer;
437
+ padding: 0;
438
+ }
439
+
440
+
441
+ .lexical-text-editor button:disabled {
442
+ opacity: 0.5;
443
+ cursor: not-allowed;
444
+ background-color: #f9fafb;
445
+ }
446
+
447
+
448
+
449
+
450
+
451
+ /* ------------------------ Button Component ------------------------------- */
452
+
453
+
454
+
455
+
456
+
457
+ /* ----------------------------- Popover ------------------------------- */
458
+
459
+
460
+ /* ================================================
461
+ POPOVER WRAPPER
462
+ ================================================ */
463
+ .lexical-text-editor .popover-root {
464
+ position: relative;
465
+ display: inline-block;
466
+ }
467
+
468
+ /* Trigger element wrapper (no styling by default) */
469
+ .lexical-text-editor .popover-trigger {
470
+ display: inline-block;
471
+ }
472
+
473
+ /* ================================================
474
+ POPOVER CONTENT PANEL
475
+ ================================================ */
476
+ .lexical-text-editor .popover-content {
477
+ position: absolute;
478
+ top: calc(100% + 4px);
479
+
480
+ background: white;
481
+ border-radius: 6px;
482
+ padding: 8px;
483
+
484
+
485
+ box-shadow:
486
+ 0px 2px 6px rgba(0, 0, 0, 0.12),
487
+ 0px 0px 0px 1px rgba(0, 0, 0, 0.04);
488
+
489
+ z-index: 9999;
490
+ animation: popoverFadeIn 0.15s ease;
491
+ }
492
+
493
+ /* Alignment options */
494
+ .lexical-text-editor .popover-content.align-start { left: 0; }
495
+ .lexical-text-editor .popover-content.align-center { left: 50%; transform: translateX(-50%); }
496
+ .lexical-text-editor .popover-content.align-end { right: 0; }
497
+
498
+ /* Fade-in animation */
499
+ @keyframes popoverFadeIn {
500
+ from { opacity: 0; transform: translateY(-3px); }
501
+ to { opacity: 1; transform: translateY(0); }
502
+ }
503
+
504
+
505
+
506
+ /* ============================
507
+ WRAPPER
508
+ ============================ */
509
+ .lexical-text-editor .heading-select {
510
+ position: relative;
511
+ display: inline-block;
512
+ }
513
+
514
+ /* ============================
515
+ TRIGGER BUTTON (matches old style)
516
+ ============================ */
517
+ .lexical-text-editor .heading-trigger {
518
+ border: 1px solid #e5e7eb; /* gray-100 */
519
+ height: 32px; /* size-8 */
520
+ padding: 8px;
521
+ justify-content: space-between;
522
+ background-color: white;
523
+ }
524
+
525
+ /* Chevron rotation same as before */
526
+ .lexical-text-editor .heading-trigger .chevron {
527
+ transition: transform 0.15s ease;
528
+ }
529
+
530
+ .lexical-text-editor .heading-trigger .chevron.rotated {
531
+ transform: rotate(180deg);
532
+ }
533
+
534
+ /* ============================
535
+ DROPDOWN PANEL (PopoverContent)
536
+ ============================ */
537
+ .lexical-text-editor .heading-dropdown {
538
+ position: absolute;
539
+ top: calc(100% + 4px);
540
+ left: 0;
541
+
542
+ background: white;
543
+ border-radius: 6px;
544
+ padding: 8px;
545
+
546
+ display: flex;
547
+ flex-direction: column;
548
+ gap: 4px;
549
+
550
+ width: max-content;
551
+ box-shadow:
552
+ 0px 2px 6px rgba(0, 0, 0, 0.12),
553
+ 0px 0px 0px 1px rgba(0, 0, 0, 0.04);
554
+
555
+ z-index: 9999;
556
+ animation: dropdownFadeIn 0.15s ease;
557
+ }
558
+
559
+ @keyframes dropdownFadeIn {
560
+ from { opacity: 0; transform: translateY(-3px); }
561
+ to { opacity: 1; transform: translateY(0); }
562
+ }
563
+
564
+
565
+
566
+
567
+
568
+
569
+
570
+
571
+ /* ----------------------------- Popover ------------------------------- */
572
+
573
+
574
+
575
+
576
+ /* -------------------------------- Color Picker Wrapper ----------------------------- */
577
+
578
+
579
+
580
+
581
+
582
+ /* Wrapper */
583
+ .color-picker-wrapper {
584
+ position: relative;
585
+ display: inline-block;
586
+ }
587
+
588
+ .toolbar:hover:not(:disabled) {
589
+ background-color: #f3f4f6;
590
+ }
591
+
592
+ .lexical-color-popover {
593
+ z-index: 99;
594
+ border-radius: 0.5rem;
595
+ pointer-events: none;
596
+ opacity: 0;
597
+ margin-top: 10px;
598
+ transform: scale(0.95) translateY(-4px);
599
+ transform-origin: top left;
600
+ transition: opacity 0.15s ease, transform 0.15s ease;
601
+ }
602
+
603
+ .lexical-color-popover.open {
604
+ opacity: 1;
605
+ pointer-events: auto;
606
+ transform: scale(1) translateY(0);
607
+ }
608
+
609
+
610
+
611
+
612
+
613
+
614
+
615
+ /* -------------------------------- Color Picker Wrapper ----------------------------- */
616
+
617
+
618
+
619
+
620
+
621
+
622
+
623
+
624
+ /* ----------------------------- Image Node ------------------------------------------ */
625
+
626
+
627
+ .lexical-text-editor-dialog {
628
+
629
+ /* Buttons */
630
+ .lte-icon-btn {
631
+ background: none;
632
+ border: none;
633
+ padding: 6px;
634
+ border-radius: 4px;
635
+ cursor: pointer;
636
+ display: flex;
637
+ align-items: center;
638
+ }
639
+
640
+ .lte-icon-btn:hover {
641
+ background: #e5e5e5;
642
+ }
643
+
644
+ .lte-outline-btn {
645
+ background: #f8f8f8;
646
+ border: 1px solid #ccc;
647
+ padding: 8px 12px;
648
+ border-radius: 4px;
649
+ cursor: pointer;
650
+ color: black;
651
+ width: fit-content;
652
+ margin: 0 auto;
653
+ font-size: 14px;
654
+ }
655
+
656
+ .lte-outline-btn:hover {
657
+ background: #eee;
658
+ }
659
+
660
+ .lte-primary-btn {
661
+ background-color: #2563eb !important;
662
+ color: white;
663
+ padding: 8px 14px;
664
+ border-radius: 4px;
665
+ border: none;
666
+ cursor: pointer;
667
+ }
668
+
669
+ .lte-primary-btn:hover {
670
+ background: #1d4ed8;
671
+ }
672
+
673
+ .lte-primary-btn:disabled {
674
+ opacity: 0.5;
675
+ cursor: not-allowed;
676
+ }
677
+
678
+ /* Inputs */
679
+ .lte-input {
680
+ width: 100%;
681
+ padding: 8px 10px;
682
+ border-radius: 4px;
683
+ border: 1px solid #d0d0d0;
684
+ background-color: #fff;
685
+ }
686
+
687
+ /* Divider */
688
+ .lte-divider {
689
+ display: flex;
690
+ align-items: center;
691
+ margin: 12px 0;
692
+ color: #777;
693
+ font-size: 13px;
694
+ }
695
+
696
+ .lte-divider::before,
697
+ .lte-divider::after {
698
+ content: "";
699
+ height: 1px;
700
+ flex: 1;
701
+ background: #ccc;
702
+ }
703
+
704
+ .lte-divider span {
705
+ padding: 0 8px;
706
+ }
707
+
708
+ /* File name */
709
+ .lte-file-name {
710
+ font-size: 13px;
711
+ color: #666;
712
+ }
713
+
714
+ /* Dialog Overlay */
715
+ .lte-dialog-overlay {
716
+ position: fixed;
717
+ inset: 0;
718
+ background: rgba(0,0,0,0.5);
719
+ display: flex;
720
+ align-items: center;
721
+ justify-content: center;
722
+ z-index: 50;
723
+ }
724
+
725
+ /* Dialog */
726
+ .lte-dialog {
727
+ background: white;
728
+ width: 100%;
729
+ max-width: 420px;
730
+ padding: 20px;
731
+ margin: 10px;
732
+ border-radius: 8px;
733
+ position: relative;
734
+ }
735
+
736
+ .lte-dialog.preview{
737
+ max-width: 1024px;
738
+ width: 100%;
739
+ }
740
+
741
+
742
+ .lte-dialog-header {
743
+ font-size: 18px;
744
+ font-weight: 600;
745
+ margin-bottom: 10px;
746
+ color: #333;
747
+ }
748
+
749
+ .lte-dialog-body {
750
+ display: flex;
751
+ flex-direction: column;
752
+ gap: 12px;
753
+ padding: 10px 0;
754
+ }
755
+
756
+ .lte-dialog-footer {
757
+ margin-top: 12px;
758
+ display: flex;
759
+ justify-content: flex-end;
760
+ }
761
+
762
+ .lte-dialog-close {
763
+ position: absolute;
764
+ top: 10px;
765
+ right: 18px;
766
+ background: none;
767
+ color: #000;
768
+ border: none;
769
+ font-size: 26px;
770
+ cursor: pointer;
771
+ opacity: 0.7;
772
+ padding: 0;
773
+ outline: none;
774
+ }
775
+
776
+ .lte-dialog-close:hover {
777
+ opacity: 1;
778
+ }
779
+
780
+ .lte-hidden {
781
+ display: none;
782
+ }
783
+ }
784
+
785
+
786
+
787
+ /* ----------------------------- Image Node ------------------------------------------ */
788
+
789
+
790
+
791
+ /****************************
792
+ TOOLBAR BUTTON
793
+ ****************************/
794
+ .lexical-text-editor .lte-toolbar-btn {
795
+ display: flex;
796
+ align-items: center;
797
+ gap: 4px;
798
+
799
+ padding: 6px 10px;
800
+
801
+ border-radius: 6px;
802
+ border: 1px solid #e5e7eb;
803
+ background: #ffffff;
804
+
805
+ cursor: pointer;
806
+ user-select: none;
807
+ transition: 0.15s ease;
808
+ }
809
+
810
+ .lexical-text-editor .lte-toolbar-btn:hover {
811
+ background: #f3f4f6;
812
+ }
813
+
814
+ .lexical-text-editor .lte-toolbar-btn-active {
815
+ background: #e0e7ff;
816
+ border-color: #6366f1;
817
+ }
818
+
819
+ /****************************
820
+ PREVIEW SECTION
821
+ ****************************/
822
+ .lexical-text-editor .lte-preview-container {
823
+ width: 100%;
824
+ max-height: 80vh;
825
+ overflow-y: auto;
826
+
827
+ background: white;
828
+ border: 1px solid #e5e7eb;
829
+ border-radius: 8px;
830
+
831
+ padding: 2vw;
832
+ min-height: 400px;
833
+ }
834
+
835
+ .lexical-text-editor .lte-preview-title {
836
+ padding-bottom: 6px;
837
+ margin-bottom: 14px;
838
+ text-align: start;
839
+ border-bottom: 2px solid #e5e7eb;
840
+
841
+ font-weight: 600;
842
+ font-size: 15px;
843
+ }
844
+
845
+ /****************************
846
+ HTML PREVIEW CONTENT
847
+ ****************************/
848
+ .lexical-text-editor-html-preview {
849
+ max-width: none;
850
+ line-height: 1.6;
851
+ text-align: start;
852
+ }
853
+
854
+
855
+ /* ==================================== Link Modal ============================================ */
856
+
857
+
858
+
859
+
860
+
861
+ /* ✅ Everything is scoped under .lexical-text-editor */
862
+ .lexical-text-editor-link.link-editor-container {
863
+ position: absolute;
864
+ bottom: -50px;
865
+ right: 20px;
866
+ z-index: 99;
867
+ display: flex;
868
+ gap: 8px;
869
+ align-items: center;
870
+
871
+ background: white;
872
+ border: 1px solid #e5e7eb;
873
+ border-radius: 12px;
874
+
875
+ padding: 6px 10px;
876
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
877
+ }
878
+
879
+ @media (min-width: 640px) {
880
+ .lexical-text-editor-link.link-editor-container {
881
+ bottom: -60px;
882
+ padding: 8px 14px;
883
+ }
884
+ }
885
+
886
+ /* Input area */
887
+ .lexical-text-editor-link .link-editor-input-wrapper {
888
+ min-width: 200px;
889
+ flex: 1;
890
+ }
891
+
892
+ .lexical-text-editor-link .link-editor-input {
893
+ width: 100%;
894
+ height: 32px;
895
+ font-size: 14px;
896
+ padding: 4px 8px;
897
+
898
+ border: 1px solid #d1d5db;
899
+ border-radius: 6px;
900
+ background-color: white;
901
+ outline: none;
902
+ }
903
+
904
+ .lexical-text-editor-link .link-editor-input:focus {
905
+ border-color: #2563eb;
906
+ }
907
+
908
+ /* URL Preview (non-edit mode) */
909
+ .lexical-text-editor-link .link-editor-url {
910
+ display: block;
911
+ font-size: 14px;
912
+ color: #2563eb;
913
+ text-decoration: underline;
914
+ text-align: start;
915
+ max-width: 100%;
916
+ overflow: hidden;
917
+ white-space: nowrap;
918
+ text-overflow: ellipsis;
919
+ }
920
+
921
+ /* Buttons */
922
+ .lexical-text-editor-link .link-editor-buttons {
923
+ display: flex;
924
+ gap: 4px;
925
+ }
926
+
927
+ .lexical-text-editor-link .link-editor-btn {
928
+ height: 32px;
929
+ width: 32px;
930
+
931
+ display: flex;
932
+ align-items: center;
933
+ justify-content: center;
934
+
935
+ border: none;
936
+ border-radius: 6px;
937
+ background: transparent;
938
+
939
+ cursor: pointer;
940
+ transition: background 0.2s ease;
941
+ }
942
+
943
+
944
+ .lexical-text-editor-link .link-editor-btn:hover {
945
+ background: #f3f4f6;
946
+ }
947
+
948
+
949
+
950
+
951
+
952
+
953
+ /* ==================================== Link Modal ============================================ */
954
+
955
+
956
+ /* ========================== Tooltips ============================= */
957
+ .Lexical-Tooltip-Wrapper {
958
+ display: inline-block;
959
+ position: relative;
960
+ }
961
+
962
+ /* Absolute positioning */
963
+ .Lexical-Tooltip-Tip {
964
+ position: absolute;
965
+ border-radius: 4px;
966
+ left: 50%;
967
+ transform: translateX(-50%);
968
+ padding: 8px 12px;
969
+ color: white;
970
+ background: #5a5a5a;
971
+ font-size: 12px;
972
+ font-family: sans-serif;
973
+ line-height: 1;
974
+ z-index: 100;
975
+ white-space: nowrap;
976
+ transition: all 0.5s;
977
+ }
978
+
979
+
980
+
981
+ /* CSS border triangles */
982
+ .Lexical-Tooltip-Tip::before {
983
+ content: " ";
984
+ left: 50%;
985
+ border: solid transparent;
986
+ height: 0;
987
+ width: 0;
988
+ position: absolute;
989
+ pointer-events: none;
990
+ border-width: 6px;
991
+ margin-left: calc(6px * -1);
992
+ }
993
+
994
+ /* Absolute positioning */
995
+ .Lexical-Tooltip-Tip.top {
996
+ top: calc(35px * -1);
997
+ }
998
+ /* CSS border triangles */
999
+ .Lexical-Tooltip-Tip.top::before {
1000
+ top: 100%;
1001
+ border-top-color: #5a5a5a;
1002
+ }
1003
+
1004
+ /* Absolute positioning */
1005
+ .Lexical-Tooltip-Tip.right {
1006
+ left: calc(100% + 30px);
1007
+ top: 50%;
1008
+ transform: translateX(0) translateY(-50%);
1009
+ }
1010
+ /* CSS border triangles */
1011
+ .Lexical-Tooltip-Tip.right::before {
1012
+ left: calc(6px * -1);
1013
+ top: 50%;
1014
+ transform: translateX(0) translateY(-50%);
1015
+ border-right-color: #5a5a5a;
1016
+ }
1017
+
1018
+ /* Absolute positioning */
1019
+ .Lexical-Tooltip-Tip.bottom {
1020
+ bottom: calc(35px * -1);
1021
+ }
1022
+ /* CSS border triangles */
1023
+ .Lexical-Tooltip-Tip.bottom::before {
1024
+ bottom: 100%;
1025
+ border-bottom-color: #5a5a5a;
1026
+ }
1027
+
1028
+ /* Absolute positioning */
1029
+ .Lexical-Tooltip-Tip.left {
1030
+ left: auto;
1031
+ right: calc(100% + 30px);
1032
+ top: 50%;
1033
+ transform: translateX(0) translateY(-50%);
1034
+ }
1035
+ /* CSS border triangles */
1036
+ .Lexical-Tooltip-Tip.left::before {
1037
+ left: auto;
1038
+ right: calc(6px * -2);
1039
+ top: 50%;
1040
+ transform: translateX(0) translateY(-50%);
1041
+ border-left-color: #5a5a5a;
1042
+ }
1043
+
1044
+
1045
+
1046
+
1047
+
1048
+
1049
+
1050
+
1051
+
1052
+ /* ========================== Tooltips ============================= */