@37signals/lexxy 0.9.11-beta → 0.9.12-beta

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.
@@ -3,6 +3,7 @@
3
3
  :where(lexxy-editor) {
4
4
  --lexxy-editor-padding: 1ch;
5
5
  --lexxy-editor-rows: 8lh;
6
+ /* eslint-disable-next-line css/no-invalid-properties */
6
7
  @supports (min-block-size: attr(rows lh)) {
7
8
  --lexxy-editor-rows: attr(rows lh, 8lh);
8
9
  }
@@ -12,6 +13,7 @@
12
13
  border: 1px solid var(--lexxy-color-ink-lighter);
13
14
  border-radius: calc(var(--lexxy-radius) + var(--lexxy-toolbar-gap));
14
15
  background-color: var(--lexxy-color-canvas);
16
+ container-type: inline-size;
15
17
  display: block;
16
18
  overflow: visible;
17
19
  position: relative;
@@ -400,6 +402,7 @@
400
402
  }
401
403
 
402
404
  :where(.lexxy-editor__content) {
405
+ /* eslint-disable-next-line css/no-invalid-properties */
403
406
  min-block-size: var(--lexxy-editor-rows);
404
407
  outline: 0;
405
408
  padding: var(--lexxy-editor-padding);
@@ -447,6 +450,10 @@
447
450
  padding: 2px;
448
451
  position: relative;
449
452
 
453
+ @container (width < 300px) {
454
+ font-size: 0.8em;
455
+ }
456
+
450
457
  &[data-attachments="false"] button[name="image"],
451
458
  &[data-attachments="false"] button[name="file"] {
452
459
  display: none;
@@ -512,8 +519,8 @@
512
519
  }
513
520
  }
514
521
 
515
- .lexxy-editor__toolbar-spacer {
516
- flex: 1;
522
+ .lexxy-editor__toolbar-button--push-right {
523
+ margin-inline-start: auto;
517
524
  }
518
525
  }
519
526
 
@@ -524,17 +531,24 @@
524
531
  user-select: none;
525
532
  -webkit-user-select: none;
526
533
 
527
- &.lexxy-editor__toolbar-dropdown--chevron {
528
- summary {
534
+ .lexxy-editor__toolbar-button {
535
+ color: currentColor;
536
+
537
+ &:hover {
538
+ opacity: 0.8;
539
+ }
540
+
541
+ &.lexxy-editor__toolbar-button--chevron {
529
542
  aspect-ratio: unset;
530
543
  gap: 0.5ch;
531
544
  grid-template-columns: 2fr 1fr;
545
+ min-inline-size: calc(var(--lexxy-toolbar-button-size) + 1.2ch);
532
546
  padding-inline: 0.75ch;
533
547
 
534
548
  &:after {
535
549
  block-size: 0.3ch;
536
- border-block-end: 2px solid currentcolor;
537
- border-inline-end: 2px solid currentcolor;
550
+ border-block-end: 2px solid currentColor;
551
+ border-inline-end: 2px solid currentColor;
538
552
  content: "";
539
553
  display: inline-block;
540
554
  inline-size: 0.3ch;
@@ -543,36 +557,33 @@
543
557
  }
544
558
  }
545
559
 
546
- summary ~ * {
560
+ > .lexxy-editor__toolbar-button[aria-expanded="true"] {
561
+ background-color: var(--lexxy-color-selected-hover);
562
+ border-end-end-radius: 0;
563
+ border-end-start-radius: 0;
564
+
565
+ &:hover {
566
+ background-color: var(--lexxy-color-selected-hover);
567
+ }
568
+ }
569
+
570
+ [data-dropdown-panel] {
547
571
  background-color: var(--lexxy-color-canvas);
548
572
  border: 2px solid var(--lexxy-color-selected-hover);
549
573
  border-radius: calc(var(--lexxy-radius) + var(--lexxy-toolbar-gap));
550
574
  box-sizing: border-box;
551
575
  box-shadow: var(--lexxy-shadow);
552
- color: var(--lexxy-color-ink);
576
+ color: var(--lexxy-color-text);
553
577
  display: flex;
554
578
  gap: var(--lexxy-toolbar-gap);
555
579
  margin: 0;
556
580
  padding: var(--lexxy-toolbar-spacing);
557
581
  position: absolute;
558
582
  z-index: 3;
559
- }
560
-
561
- &:is([open]) > .lexxy-editor__toolbar-button {
562
- background-color: var(--lexxy-color-selected-hover);
563
- border-end-end-radius: 0;
564
- border-end-start-radius: 0;
565
583
 
566
- &:hover {
567
- background-color: var(--lexxy-color-selected-hover);
568
- }
569
- }
570
-
571
- button {
572
- color: var(--lexxy-color-text);
573
-
574
- &:hover {
575
- opacity: 0.8;
584
+ &[hidden],
585
+ [overflowing] &[hidden] {
586
+ display: none;
576
587
  }
577
588
  }
578
589
 
@@ -583,6 +594,7 @@
583
594
 
584
595
  button {
585
596
  align-items: center;
597
+ color: var(--lexxy-color-text);
586
598
  display: flex;
587
599
  flex-direction: row;
588
600
  gap: 1ch;
@@ -603,6 +615,7 @@
603
615
 
604
616
  svg {
605
617
  block-size: 1lh;
618
+ fill: currentColor;
606
619
  inline-size: 1lh;
607
620
  }
608
621
  }
@@ -634,7 +647,7 @@
634
647
  justify-self: flex-end;
635
648
  z-index: 1;
636
649
 
637
- summary ~ * {
650
+ [data-dropdown-panel] {
638
651
  border-start-end-radius: 0;
639
652
  display: grid;
640
653
  grid-template-columns: repeat(4, 1fr);
@@ -646,127 +659,125 @@
646
659
  /* --------------------------------------------------------------------------
647
660
  /* Link dropdown */
648
661
 
649
- lexxy-link-dropdown {
650
- font-size: var(--lexxy-text-small);
651
- gap: var(--lexxy-toolbar-spacing);
652
- inset-inline-start: var(--lexxy-toolbar-spacing);
653
- inset-inline-end: var(--lexxy-toolbar-spacing);
662
+ &.lexxy-editor__toolbar-dropdown--link {
663
+ [data-dropdown-panel] {
664
+ font-size: var(--lexxy-text-small);
665
+ gap: var(--lexxy-toolbar-spacing);
666
+ inset-inline-start: var(--lexxy-toolbar-spacing);
667
+ inset-inline-end: var(--lexxy-toolbar-spacing);
654
668
 
655
- [overflowing] [open] & {
656
- display: block;
669
+ [overflowing] & {
670
+ flex-wrap: wrap;
671
+ }
657
672
 
658
673
  .lexxy-editor__toolbar-dropdown-actions {
659
- margin-block-start: var(--lexxy-toolbar-spacing);
674
+ display: flex;
675
+ flex: 1;
676
+ gap: var(--lexxy-toolbar-spacing);
660
677
  }
661
- }
662
-
663
678
 
664
- .lexxy-editor__toolbar-dropdown-actions {
665
- display: flex;
666
- flex: 1;
667
- gap: var(--lexxy-toolbar-spacing);
668
- }
679
+ input[type="url"] {
680
+ background-color: var(--lexxy-color-canvas);
681
+ border: 1px solid var(--lexxy-color-ink-lighter);
682
+ border-radius: var(--lexxy-radius);
683
+ color: var(--lexxy-color-text);
684
+ block-size: var(--lexxy-toolbar-button-size);
685
+ box-sizing: border-box;
686
+ font-size: var(--lexxy-text-small);
687
+ flex: 2;
688
+ inline-size: 100%;
689
+ line-height: inherit;
690
+ padding-block: 0;
691
+ padding-inline: 1ch;
669
692
 
670
- input[type="url"] {
671
- background-color: var(--lexxy-color-canvas);
672
- border: 1px solid var(--lexxy-color-ink-lighter);
673
- border-radius: var(--lexxy-radius);
674
- color: var(--lexxy-color-text);
675
- block-size: var(--lexxy-toolbar-button-size);
676
- box-sizing: border-box;
677
- font-size: var(--lexxy-text-small);
678
- flex: 2;
679
- inline-size: 100%;
680
- line-height: normal;
681
- padding-block: 0;
682
- padding-inline: 1ch;
683
- }
693
+ [overflowing] & {
694
+ min-inline-size: 100%;
695
+ }
696
+ }
684
697
 
685
- button {
686
- background-color: var(--lexxy-color-ink-lightest);
687
- inline-size: 100%;
688
- padding-inline: 2ch;
689
- }
698
+ button {
699
+ background-color: var(--lexxy-color-ink-lightest);
700
+ inline-size: 100%;
701
+ padding-inline: 2ch;
702
+ }
690
703
 
691
- button[value="link"] {
692
- background-color: var(--lexxy-color-accent-dark);
693
- color: var(--lexxy-color-ink-inverted);
704
+ button[value="link"] {
705
+ background-color: var(--lexxy-color-accent-dark);
706
+ color: var(--lexxy-color-ink-inverted);
694
707
 
695
- &:hover {
696
- background-color: var(--lexxy-color-accent-medium);
708
+ &:hover {
709
+ background-color: var(--lexxy-color-accent-medium);
710
+ }
697
711
  }
698
712
  }
699
713
  }
700
714
 
701
-
702
715
  /* --------------------------------------------------------------------------
703
716
  /* Color dropdown */
704
717
 
705
- &:has(lexxy-highlight-dropdown) {
718
+ &.lexxy-editor__toolbar-dropdown--highlight {
706
719
  position: relative;
707
720
 
708
721
  [overflowing] & {
709
722
  position: static;
710
723
  }
711
- }
712
-
713
- lexxy-highlight-dropdown {
714
- --max-inline-size: calc(var(--max-colors) * (var(--lexxy-toolbar-button-size) + var(--lexxy-toolbar-spacing)));
715
- border-start-start-radius: 0;
716
- display: flex;
717
- gap: var(--lexxy-toolbar-spacing);
718
- flex-direction: column;
719
- font-size: var(--lexxy-text-small);
720
- inset-inline-start: 0;
721
- max-inline-size: var(--max-inline-size);
722
-
723
- [overflowing] & {
724
- inset-inline-end: var(--lexxy-toolbar-spacing);
725
- inset-inline-start: var(--lexxy-toolbar-spacing);
726
- }
727
724
 
728
- button {
729
- position: relative;
730
- }
731
-
732
- .lexxy-highlight-colors {
733
- display: grid;
734
- gap: var(--lexxy-toolbar-gap);
735
- grid-template-columns: repeat(auto-fill, minmax(var(--lexxy-toolbar-button-size), 1fr));
725
+ [data-dropdown-panel] {
726
+ --max-inline-size: calc(var(--max-colors) * (var(--lexxy-toolbar-button-size) + var(--lexxy-toolbar-spacing)));
727
+ border-start-start-radius: 0;
728
+ gap: var(--lexxy-toolbar-spacing);
729
+ flex-direction: column;
730
+ font-size: var(--lexxy-text-small);
731
+ inset-inline-start: 0;
736
732
  max-inline-size: var(--max-inline-size);
737
733
 
734
+ [overflowing] & {
735
+ border-start-start-radius: calc(var(--lexxy-radius) + var(--lexxy-toolbar-gap));
736
+ inset-inline-end: var(--lexxy-toolbar-spacing);
737
+ inset-inline-start: var(--lexxy-toolbar-spacing);
738
+ }
739
+
738
740
  button {
739
- block-size: unset;
740
- inline-size: 100%;
741
+ position: relative;
742
+ }
741
743
 
742
- &:after {
743
- align-self: center;
744
- content: "Aa";
745
- display: inline-block;
746
- font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
747
- position: absolute;
748
- inset-block-start: 0;
749
- inset-block-end: 0;
750
- inset-inline-end: 0;
751
- inset-inline-start: 0;
752
- }
744
+ .lexxy-highlight-colors {
745
+ display: grid;
746
+ gap: var(--lexxy-toolbar-gap);
747
+ grid-template-columns: repeat(auto-fill, minmax(var(--lexxy-toolbar-button-size), 1fr));
748
+ max-inline-size: var(--max-inline-size);
753
749
 
754
- &[aria-pressed="true"] {
755
- background-color: transparent;
756
- box-shadow: 0 0 0 2px currentColor inset;
750
+ button {
751
+ block-size: unset;
752
+ inline-size: 100%;
757
753
 
758
754
  &:after {
759
- content: "✓";
755
+ align-items: center;
756
+ content: "Aa";
757
+ display: flex;
758
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
759
+ inset: 0;
760
+ justify-content: center;
761
+ position: absolute;
762
+ }
763
+
764
+ &[aria-pressed="true"] {
765
+ background-color: transparent;
766
+ box-shadow: 0 0 0 2px currentColor inset;
767
+
768
+ &:after {
769
+ content: "✓";
770
+ }
760
771
  }
761
772
  }
762
773
  }
763
- }
764
774
 
765
- .lexxy-editor__toolbar-dropdown-reset {
766
- background-color: var(--lexxy-color-ink-lightest);
775
+ .lexxy-editor__toolbar-dropdown-reset {
776
+ background-color: var(--lexxy-color-ink-lightest);
767
777
 
768
- &:is([disabled]) {
769
- display: none;
778
+ &:is([disabled]) {
779
+ display: none;
780
+ }
770
781
  }
771
782
  }
772
783
  }
@@ -1102,4 +1113,4 @@ action-text-attachment[content-type^="application/vnd.actiontext"] {
1102
1113
  }
1103
1114
  }
1104
1115
  }
1105
- }
1116
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@37signals/lexxy",
3
- "version": "0.9.11-beta",
3
+ "version": "0.9.12-beta",
4
4
  "description": "Lexxy - A modern rich text editor for Rails.",
5
5
  "module": "dist/lexxy.esm.js",
6
6
  "type": "module",
@@ -14,15 +14,22 @@
14
14
  "repository": "https://github.com/basecamp/lexxy.git",
15
15
  "author": "Jorge Manrubia <jorge@37signals.com>",
16
16
  "license": "MIT",
17
+ "browserslist": [
18
+ "baseline 2023",
19
+ "not dead"
20
+ ],
17
21
  "devDependencies": {
18
- "@eslint/js": "^9.15.0",
22
+ "@eslint/css": "^1.2.0",
23
+ "@eslint/js": "^10.0.1",
19
24
  "@playwright/test": "^1.52.0",
20
25
  "@rails/activestorage": "^8.1.200",
21
26
  "@rollup/plugin-commonjs": "^29.0.0",
22
27
  "@rollup/plugin-inject": "^5.0.5",
23
28
  "@rollup/plugin-node-resolve": "^16.0.1",
24
29
  "@rollup/plugin-terser": "^0.4.4",
25
- "eslint": "^9.15.0",
30
+ "eslint": "^10.3.0",
31
+ "globals": "^17.6.0",
32
+ "eslint-plugin-compat": "^7.0.2",
26
33
  "jsdom": "^27.3.0",
27
34
  "rollup": "^4.44.1",
28
35
  "rollup-plugin-copy": "^3.5.0",
@@ -48,21 +55,21 @@
48
55
  "release": "yarn build:npm && yarn publish"
49
56
  },
50
57
  "dependencies": {
51
- "@lexical/clipboard": "^0.43.0",
52
- "@lexical/code": "^0.43.0",
53
- "@lexical/extension": "^0.43.0",
54
- "@lexical/history": "^0.43.0",
55
- "@lexical/html": "^0.43.0",
56
- "@lexical/link": "^0.43.0",
57
- "@lexical/list": "^0.43.0",
58
- "@lexical/markdown": "^0.43.0",
59
- "@lexical/plain-text": "^0.43.0",
60
- "@lexical/rich-text": "^0.43.0",
61
- "@lexical/selection": "^0.43.0",
62
- "@lexical/table": "^0.43.0",
63
- "@lexical/utils": "^0.43.0",
58
+ "@lexical/clipboard": "^0.44.0",
59
+ "@lexical/code": "^0.44.0",
60
+ "@lexical/extension": "^0.44.0",
61
+ "@lexical/history": "^0.44.0",
62
+ "@lexical/html": "^0.44.0",
63
+ "@lexical/link": "^0.44.0",
64
+ "@lexical/list": "^0.44.0",
65
+ "@lexical/markdown": "^0.44.0",
66
+ "@lexical/plain-text": "^0.44.0",
67
+ "@lexical/rich-text": "^0.44.0",
68
+ "@lexical/selection": "^0.44.0",
69
+ "@lexical/table": "^0.44.0",
70
+ "@lexical/utils": "^0.44.0",
64
71
  "dompurify": "^3.3.0",
65
- "lexical": "^0.43.0",
72
+ "lexical": "^0.44.0",
66
73
  "marked": "^16.4.1",
67
74
  "prismjs": "^1.30.0"
68
75
  },