@crystallize/design-system 1.11.0 → 1.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @crystallize/design-system
2
2
 
3
+ ## 1.11.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 3cfc9ede: Upgrade tailwindcss to version 3.3.0
8
+
9
+ ## 1.11.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 05f9beba: Add a new Info icon to design system.
14
+
3
15
  ## 1.11.0
4
16
 
5
17
  ### Minor Changes
package/dist/index.css CHANGED
@@ -539,43 +539,34 @@ button {
539
539
  .relative {
540
540
  position: relative;
541
541
  }
542
- .top-2 {
543
- top: 0.5rem;
544
- }
545
542
  .left-2 {
546
543
  left: 0.5rem;
547
544
  }
545
+ .left-6 {
546
+ left: 1.5rem;
547
+ }
548
+ .right-10 {
549
+ right: 2.5rem;
550
+ }
548
551
  .right-2 {
549
552
  right: 0.5rem;
550
553
  }
551
554
  .top-0 {
552
555
  top: 0px;
553
556
  }
554
- .left-6 {
555
- left: 1.5rem;
556
- }
557
- .right-10 {
558
- right: 2.5rem;
557
+ .top-2 {
558
+ top: 0.5rem;
559
559
  }
560
560
  .z-50 {
561
561
  z-index: 50;
562
562
  }
563
- .my-6 {
564
- margin-top: 1.5rem;
565
- margin-bottom: 1.5rem;
566
- }
567
563
  .mx-auto {
568
564
  margin-left: auto;
569
565
  margin-right: auto;
570
566
  }
571
- .mt-8 {
572
- margin-top: 2rem;
573
- }
574
- .mt-4 {
575
- margin-top: 1rem;
576
- }
577
- .mt-2 {
578
- margin-top: 0.5rem;
567
+ .my-6 {
568
+ margin-top: 1.5rem;
569
+ margin-bottom: 1.5rem;
579
570
  }
580
571
  .mb-4 {
581
572
  margin-bottom: 1rem;
@@ -586,9 +577,18 @@ button {
586
577
  .mt-1 {
587
578
  margin-top: 0.25rem;
588
579
  }
580
+ .mt-2 {
581
+ margin-top: 0.5rem;
582
+ }
589
583
  .mt-3 {
590
584
  margin-top: 0.75rem;
591
585
  }
586
+ .mt-4 {
587
+ margin-top: 1rem;
588
+ }
589
+ .mt-8 {
590
+ margin-top: 2rem;
591
+ }
592
592
  .block {
593
593
  display: block;
594
594
  }
@@ -598,12 +598,12 @@ button {
598
598
  .inline {
599
599
  display: inline;
600
600
  }
601
- .flex {
602
- display: flex;
603
- }
604
601
  .\!flex {
605
602
  display: flex !important;
606
603
  }
604
+ .flex {
605
+ display: flex;
606
+ }
607
607
  .table {
608
608
  display: table;
609
609
  }
@@ -625,48 +625,48 @@ button {
625
625
  .h-24 {
626
626
  height: 6rem;
627
627
  }
628
- .h-\[8px\] {
629
- height: 8px;
628
+ .h-5 {
629
+ height: 1.25rem;
630
+ }
631
+ .h-6 {
632
+ height: 1.5rem;
630
633
  }
631
634
  .h-\[44px\] {
632
635
  height: 44px;
633
636
  }
637
+ .h-\[8px\] {
638
+ height: 8px;
639
+ }
634
640
  .h-full {
635
641
  height: 100%;
636
642
  }
637
- .h-6 {
638
- height: 1.5rem;
643
+ .w-4 {
644
+ width: 1rem;
639
645
  }
640
- .h-5 {
641
- height: 1.25rem;
646
+ .w-5 {
647
+ width: 1.25rem;
642
648
  }
643
- .w-\[8px\] {
644
- width: 8px;
649
+ .w-6 {
650
+ width: 1.5rem;
645
651
  }
646
652
  .w-\[44px\] {
647
653
  width: 44px;
648
654
  }
655
+ .w-\[8px\] {
656
+ width: 8px;
657
+ }
649
658
  .w-full {
650
659
  width: 100%;
651
660
  }
652
- .w-6 {
653
- width: 1.5rem;
654
- }
655
- .w-4 {
656
- width: 1rem;
657
- }
658
- .w-5 {
659
- width: 1.25rem;
660
- }
661
- .min-w-\[44px\] {
662
- min-width: 44px;
663
- }
664
661
  .min-w-\[150px\] {
665
662
  min-width: 150px;
666
663
  }
667
664
  .min-w-\[200px\] {
668
665
  min-width: 200px;
669
666
  }
667
+ .min-w-\[44px\] {
668
+ min-width: 44px;
669
+ }
670
670
  .max-w-\[1100px\] {
671
671
  max-width: 1100px;
672
672
  }
@@ -688,15 +688,15 @@ button {
688
688
  .resize {
689
689
  resize: both;
690
690
  }
691
- .grid-cols-6 {
692
- grid-template-columns: repeat(6, minmax(0, 1fr));
693
- }
694
691
  .grid-cols-10 {
695
692
  grid-template-columns: repeat(10, minmax(0, 1fr));
696
693
  }
697
694
  .grid-cols-5 {
698
695
  grid-template-columns: repeat(5, minmax(0, 1fr));
699
696
  }
697
+ .grid-cols-6 {
698
+ grid-template-columns: repeat(6, minmax(0, 1fr));
699
+ }
700
700
  .grid-cols-\[1fr_1px_1fr\] {
701
701
  grid-template-columns: 1fr 1px 1fr;
702
702
  }
@@ -724,31 +724,26 @@ button {
724
724
  .justify-items-center {
725
725
  justify-items: center;
726
726
  }
727
- .gap-6 {
728
- gap: 1.5rem;
727
+ .gap-0 {
728
+ gap: 0px;
729
729
  }
730
- .gap-4 {
731
- gap: 1rem;
730
+ .gap-0\.5 {
731
+ gap: 0.125rem;
732
732
  }
733
733
  .gap-1 {
734
734
  gap: 0.25rem;
735
735
  }
736
- .gap-0\.5 {
737
- gap: 0.125rem;
736
+ .gap-4 {
737
+ gap: 1rem;
738
738
  }
739
- .gap-0 {
740
- gap: 0px;
739
+ .gap-6 {
740
+ gap: 1.5rem;
741
741
  }
742
742
  .space-x-2 > :not([hidden]) ~ :not([hidden]) {
743
743
  --tw-space-x-reverse: 0;
744
744
  margin-right: calc(0.5rem * var(--tw-space-x-reverse));
745
745
  margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
746
746
  }
747
- .space-y-4 > :not([hidden]) ~ :not([hidden]) {
748
- --tw-space-y-reverse: 0;
749
- margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));
750
- margin-bottom: calc(1rem * var(--tw-space-y-reverse));
751
- }
752
747
  .space-x-6 > :not([hidden]) ~ :not([hidden]) {
753
748
  --tw-space-x-reverse: 0;
754
749
  margin-right: calc(1.5rem * var(--tw-space-x-reverse));
@@ -759,6 +754,11 @@ button {
759
754
  margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));
760
755
  margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));
761
756
  }
757
+ .space-y-4 > :not([hidden]) ~ :not([hidden]) {
758
+ --tw-space-y-reverse: 0;
759
+ margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));
760
+ margin-bottom: calc(1rem * var(--tw-space-y-reverse));
761
+ }
762
762
  .space-y-6 > :not([hidden]) ~ :not([hidden]) {
763
763
  --tw-space-y-reverse: 0;
764
764
  margin-top: calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));
@@ -788,12 +788,12 @@ button {
788
788
  .rounded-sm {
789
789
  border-radius: 0.125rem;
790
790
  }
791
- .border-0 {
792
- border-width: 0px;
793
- }
794
791
  .border {
795
792
  border-width: 1px;
796
793
  }
794
+ .border-0 {
795
+ border-width: 0px;
796
+ }
797
797
  .border-b {
798
798
  border-bottom-width: 1px;
799
799
  }
@@ -804,37 +804,37 @@ button {
804
804
  --tw-border-opacity: 1;
805
805
  border-color: rgb(var(--c-color-gray-100-800) / var(--tw-border-opacity));
806
806
  }
807
+ .\!bg-purple-50-900 {
808
+ --tw-bg-opacity: 1 !important;
809
+ background-color: rgb(var(--c-color-purple-50-900) / var(--tw-bg-opacity)) !important;
810
+ }
807
811
  .bg-gray {
808
812
  background-color: rgb(var(--c-color-gray));
809
813
  }
810
- .bg-gray-50-900 {
814
+ .bg-gray-100-800 {
811
815
  --tw-bg-opacity: 1;
812
- background-color: rgb(var(--c-color-gray-50-900) / var(--tw-bg-opacity));
816
+ background-color: rgb(var(--c-color-gray-100-800) / var(--tw-bg-opacity));
813
817
  }
814
- .bg-white {
818
+ .bg-gray-50-900 {
815
819
  --tw-bg-opacity: 1;
816
- background-color: rgb(255 255 255 / var(--tw-bg-opacity));
820
+ background-color: rgb(var(--c-color-gray-50-900) / var(--tw-bg-opacity));
817
821
  }
818
822
  .bg-purple-50-900 {
819
823
  --tw-bg-opacity: 1;
820
824
  background-color: rgb(var(--c-color-purple-50-900) / var(--tw-bg-opacity));
821
825
  }
822
- .\!bg-purple-50-900 {
823
- --tw-bg-opacity: 1 !important;
824
- background-color: rgb(var(--c-color-purple-50-900) / var(--tw-bg-opacity)) !important;
825
- }
826
- .bg-gray-100-800 {
826
+ .bg-white {
827
827
  --tw-bg-opacity: 1;
828
- background-color: rgb(var(--c-color-gray-100-800) / var(--tw-bg-opacity));
828
+ background-color: rgb(255 255 255 / var(--tw-bg-opacity));
829
829
  }
830
- .bg-\[length\:18px_18px\] {
831
- background-size: 18px 18px;
830
+ .bg-\[length\:16px_16px\] {
831
+ background-size: 16px 16px;
832
832
  }
833
833
  .bg-\[length\:17px_17px\] {
834
834
  background-size: 17px 17px;
835
835
  }
836
- .bg-\[length\:16px_16px\] {
837
- background-size: 16px 16px;
836
+ .bg-\[length\:18px_18px\] {
837
+ background-size: 18px 18px;
838
838
  }
839
839
  .bg-\[length\:20px_20px\] {
840
840
  background-size: 20px 20px;
@@ -845,14 +845,18 @@ button {
845
845
  .bg-no-repeat {
846
846
  background-repeat: no-repeat;
847
847
  }
848
+ .p-10 {
849
+ padding: 2.5rem;
850
+ }
848
851
  .p-4 {
849
852
  padding: 1rem;
850
853
  }
851
854
  .p-\[5px\] {
852
855
  padding: 5px;
853
856
  }
854
- .p-10 {
855
- padding: 2.5rem;
857
+ .px-1 {
858
+ padding-left: 0.25rem;
859
+ padding-right: 0.25rem;
856
860
  }
857
861
  .px-3 {
858
862
  padding-left: 0.75rem;
@@ -862,21 +866,17 @@ button {
862
866
  padding-left: 1.5rem;
863
867
  padding-right: 1.5rem;
864
868
  }
865
- .py-2 {
866
- padding-top: 0.5rem;
867
- padding-bottom: 0.5rem;
868
- }
869
- .px-1 {
870
- padding-left: 0.25rem;
871
- padding-right: 0.25rem;
869
+ .py-0 {
870
+ padding-top: 0px;
871
+ padding-bottom: 0px;
872
872
  }
873
873
  .py-0\.5 {
874
874
  padding-top: 0.125rem;
875
875
  padding-bottom: 0.125rem;
876
876
  }
877
- .py-0 {
878
- padding-top: 0px;
879
- padding-bottom: 0px;
877
+ .py-2 {
878
+ padding-top: 0.5rem;
879
+ padding-bottom: 0.5rem;
880
880
  }
881
881
  .text-center {
882
882
  text-align: center;
@@ -899,6 +899,12 @@ button {
899
899
  "Segoe UI Symbol",
900
900
  "Noto Color Emoji";
901
901
  }
902
+ .text-\[10px\] {
903
+ font-size: 10px;
904
+ }
905
+ .text-\[14px\] {
906
+ font-size: 14px;
907
+ }
902
908
  .text-sm {
903
909
  font-size: 0.875rem;
904
910
  line-height: 1.25rem;
@@ -907,21 +913,15 @@ button {
907
913
  font-size: 0.75rem;
908
914
  line-height: 1rem;
909
915
  }
910
- .text-\[14px\] {
911
- font-size: 14px;
912
- }
913
- .text-\[10px\] {
914
- font-size: 10px;
915
- }
916
- .font-normal {
917
- font-weight: 400;
918
- }
919
916
  .font-bold {
920
917
  font-weight: 700;
921
918
  }
922
919
  .font-medium {
923
920
  font-weight: 500;
924
921
  }
922
+ .font-normal {
923
+ font-weight: 400;
924
+ }
925
925
  .italic {
926
926
  font-style: italic;
927
927
  }
@@ -931,10 +931,6 @@ button {
931
931
  .text-gray {
932
932
  color: rgb(var(--c-color-gray));
933
933
  }
934
- .text-gray-700-200 {
935
- --tw-text-opacity: 1;
936
- color: rgb(var(--c-color-gray-700-200) / var(--tw-text-opacity));
937
- }
938
934
  .text-gray-300-600 {
939
935
  --tw-text-opacity: 1;
940
936
  color: rgb(var(--c-color-gray-300-600) / var(--tw-text-opacity));
@@ -943,6 +939,10 @@ button {
943
939
  --tw-text-opacity: 1;
944
940
  color: rgb(var(--c-color-gray-600-300) / var(--tw-text-opacity));
945
941
  }
942
+ .text-gray-700-200 {
943
+ --tw-text-opacity: 1;
944
+ color: rgb(var(--c-color-gray-700-200) / var(--tw-text-opacity));
945
+ }
946
946
  .text-pink-600-300 {
947
947
  --tw-text-opacity: 1;
948
948
  color: rgb(var(--c-color-pink-600-300) / var(--tw-text-opacity));
@@ -953,12 +953,12 @@ button {
953
953
  .opacity-100 {
954
954
  opacity: 1;
955
955
  }
956
- .opacity-60 {
957
- opacity: 0.6;
958
- }
959
956
  .opacity-30 {
960
957
  opacity: 0.3;
961
958
  }
959
+ .opacity-60 {
960
+ opacity: 0.6;
961
+ }
962
962
  .opacity-80 {
963
963
  opacity: 0.8;
964
964
  }
@@ -1532,10 +1532,7 @@ button {
1532
1532
  }
1533
1533
  .c-dialog-overlay {
1534
1534
  position: fixed;
1535
- top: 0px;
1536
- right: 0px;
1537
- bottom: 0px;
1538
- left: 0px;
1535
+ inset: 0px;
1539
1536
  z-index: 10;
1540
1537
  background-color: rgb(var(--c-color-overlay) / 0.3);
1541
1538
  }
package/dist/index.js CHANGED
@@ -1563,7 +1563,7 @@ var Info = (0, import_react28.forwardRef)((delegated, ref) => {
1563
1563
  }),
1564
1564
  /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("path", {
1565
1565
  fillRule: "evenodd",
1566
- "clip-rule": "evenodd",
1566
+ clipRule: "evenodd",
1567
1567
  d: "M18.253 3.85212C18.253 5.04383 17.2869 6.00991 16.0952 6.00991C14.9035 6.00991 13.9374 5.04383 13.9374 3.85212C13.9374 2.66041 14.9035 1.69434 16.0952 1.69434C17.2869 1.69434 18.253 2.66041 18.253 3.85212ZM16.0952 5.34999C16.9224 5.34999 17.5931 4.67937 17.5931 3.85212C17.5931 3.02487 16.9224 2.35425 16.0952 2.35425C15.2679 2.35425 14.5973 3.02487 14.5973 3.85212C14.5973 4.67937 15.2679 5.34999 16.0952 5.34999Z",
1568
1568
  fill: "#528693"
1569
1569
  }),
@@ -1573,7 +1573,7 @@ var Info = (0, import_react28.forwardRef)((delegated, ref) => {
1573
1573
  }),
1574
1574
  /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("path", {
1575
1575
  fillRule: "evenodd",
1576
- "clip-rule": "evenodd",
1576
+ clipRule: "evenodd",
1577
1577
  d: "M11.2842 18.976L11.3049 18.9785C11.5112 19.0031 11.7201 18.9658 11.9049 18.8714C12.0891 18.7772 12.2409 18.6306 12.3411 18.4504C12.3471 18.4394 12.352 18.4277 12.3558 18.4158C12.3317 18.4124 12.3048 18.4091 12.2731 18.4053C12.0384 18.3881 11.8084 18.33 11.5936 18.2335C11.2334 18.0797 10.9456 17.7933 10.7906 17.433C10.6341 17.0694 10.6252 16.6594 10.7658 16.2894C10.9266 15.8663 11.1487 15.4689 11.4246 15.1101L11.6291 14.8181C11.6293 14.8178 11.629 14.8184 11.6291 14.8181C12.0038 14.2802 12.4092 13.763 12.8423 13.2707L12.9418 13.1535C12.9894 13.097 13.0361 13.0418 13.0821 12.9874C13.2314 12.8108 13.3734 12.6428 13.5141 12.4665L13.5237 12.4544L13.5339 12.4428C14.107 11.7899 14.5194 11.0128 14.7386 10.1733C14.8642 9.60674 14.7724 9.1134 14.5125 8.69961C14.2452 8.27422 13.7678 7.88337 13.0466 7.60647L13.0376 7.60304C12.2034 7.26882 11.3198 7.07373 10.4221 7.02572C10.2586 7.02444 10.0952 7.03841 9.93422 7.06745L9.91342 7.0712L9.89242 7.07362C9.77981 7.08656 9.67209 7.12639 9.57839 7.18964C9.48729 7.25113 9.41209 7.33296 9.35867 7.42842C9.35249 7.44171 9.33941 7.47402 9.32659 7.52286C9.31959 7.54951 9.31383 7.57671 9.30949 7.60325C9.36308 7.61115 9.41754 7.61364 9.47206 7.61055L9.51828 7.60793L9.63538 7.61773C9.79024 7.6263 9.94419 7.64682 10.0959 7.67913L10.1211 7.68451L10.1459 7.69185C10.6213 7.83272 11.1176 8.10198 11.3044 8.65041L11.3058 8.6547C11.4603 9.11879 11.309 9.5616 11.1547 9.87197C10.9947 10.194 10.7584 10.5161 10.546 10.7961C10.1932 11.2626 9.79323 11.726 9.4222 12.1559L9.4167 12.1622L9.30686 12.2896L9.29607 12.301C8.50411 13.1358 7.82119 14.0671 7.26353 15.0728C6.95101 15.7053 6.92585 16.2828 7.10297 16.7755C7.28379 17.2785 7.70442 17.772 8.42421 18.1631L8.42623 18.1642C9.29923 18.6426 10.2687 18.9197 11.2633 18.9749L11.2842 18.976ZM6.67909 14.7659C7.26511 13.7065 7.9836 12.7256 8.81732 11.8468L8.91693 11.7313C9.29243 11.2963 9.68044 10.8467 10.0199 10.3976C10.4486 9.83253 10.8215 9.28929 10.6797 8.86312C10.5968 8.6196 10.3605 8.44373 9.9584 8.32457C9.83715 8.29874 9.71404 8.28256 9.59022 8.27617L9.50938 8.26941C9.26232 8.2834 9.01575 8.23452 8.79281 8.12735C8.54248 7.93066 8.64731 7.36817 8.77404 7.12204C8.87835 6.92966 9.02762 6.76522 9.2092 6.64266C9.39077 6.5201 9.59929 6.44304 9.81707 6.41802C10.0235 6.38077 10.2331 6.36335 10.4429 6.36598C11.4176 6.41652 12.3773 6.6275 13.2831 6.9904C14.9259 7.62106 15.7097 8.86885 15.3801 10.3284C15.1357 11.2718 14.6733 12.1451 14.0299 12.8781C13.8828 13.0625 13.7326 13.2401 13.582 13.4182C13.5366 13.4719 13.4912 13.5256 13.4458 13.5795L13.3415 13.7024C12.9232 14.1775 12.5323 14.6759 12.1707 15.1952L11.9564 15.5012C11.7156 15.8119 11.5223 16.1565 11.3827 16.5237C11.303 16.7335 11.308 16.966 11.3968 17.1721C11.4855 17.3783 11.651 17.5421 11.8583 17.6289C12.0086 17.6973 12.1701 17.7377 12.335 17.748C12.5957 17.7793 12.8648 17.8126 12.9712 18.0603C13.0139 18.1752 13.0313 18.298 13.0223 18.4203C13.0133 18.5425 12.9781 18.6615 12.9191 18.769C12.7552 19.0647 12.5066 19.305 12.2052 19.459C11.9037 19.6131 11.563 19.6739 11.2267 19.6338C10.1339 19.5731 9.0685 19.2687 8.1091 18.743C6.45171 17.8422 5.90412 16.3181 6.67909 14.7659Z",
1578
1578
  fill: "#528693"
1579
1579
  })
@@ -3634,30 +3634,81 @@ var useSharedHistoryContext = () => {
3634
3634
 
3635
3635
  // src/rich-text-editor/i18n/index.tsx
3636
3636
  var import_react63 = require("react");
3637
+
3638
+ // src/rich-text-editor/i18n/translations/en.ts
3639
+ var translations = {
3640
+ actionClearTextFormatting: "Clear text formatting",
3641
+ actionTextFormattingOptions: "Formatting options for additional text styles",
3642
+ actionFormatAsStrongLabel: "Format text as bold",
3643
+ actionFormatAsStrongTitle: "Bold (Ctrl+B)",
3644
+ actionFormatAsStrongTitleApple: "Bold (\u2318B)",
3645
+ actionFormatAsEmphasizedLabel: "Format text as italics",
3646
+ actionFormatAsEmphasizedTitle: "Italic (Ctrl+I)",
3647
+ actionFormatAsEmphasizedTitleApple: "Italic (\u2318I)",
3648
+ actionFormatAsUnderlinedLabel: "Underline text",
3649
+ actionFormatAsUnderlinedTitle: "Underlined (Ctrl+U)",
3650
+ actionFormatAsUnderlinedTitleApple: "Underlined (\u2318U)",
3651
+ actionFormatWithStrikethroughLabel: "Format text with a strikethrough",
3652
+ actionFormatWithStrikethroughTitle: "Strikethrough",
3653
+ actionFormatWithSubscriptLabel: "Format text as subscript",
3654
+ actionFormatWithSubscriptTitle: "Subscript",
3655
+ actionFormatWithSuperscriptLabel: "Format text as superscript",
3656
+ actionFormatWithSuperscriptTitle: "Superscript",
3657
+ actionInsertCodeBlock: "Insert code block",
3658
+ actionInsertlink: "Insert link",
3659
+ actionCopyJSON: "Copy JSON",
3660
+ actionCopyCode: "Copy code",
3661
+ actionClear: "Clear editor",
3662
+ actionFormatCode: "Format code with Prettier",
3663
+ actionTableInsertRowsAbove: "Insert row above",
3664
+ actionTableInsertRowsAbove_plural: "Insert {{rows}} rows above",
3665
+ actionTableInsertRowsBelow: "Insert row above",
3666
+ actionTableInsertRowsBelow_plural: "Insert {{rows}} rows above",
3667
+ actionTableInsertColumnsBefore: "Insert column left",
3668
+ actionTableInsertColumnsBefore_plural: "Insert {{columns}} columns left",
3669
+ actionTableInsertColumnsAfter: "Insert column right",
3670
+ actionTableInsertColumnsAfter_plural: "Insert {{columns}} columns right",
3671
+ actionTableAddRowHeader: "Add row header",
3672
+ actionTableRemoveRowHeader: "Remove row header",
3673
+ actionTableAddColumnHeader: "Add column header",
3674
+ actionTableRemoveColumnHeader: "Remove column header",
3675
+ actionTableDeleteColumn: "Delete column",
3676
+ actionTableDeleteRow: "Delete row",
3677
+ actionTableDeleteTable: "Delete table",
3678
+ actionTableOpenOptions: "Open table options",
3679
+ actionUndoLabel: "Undo",
3680
+ actionUndoTitle: "Undo (Ctrl+Z)",
3681
+ actionUndoTitleApple: "Undo (\u2318Z)",
3682
+ actionRedoLabel: "Undo",
3683
+ actionRedoTitle: "Undo (Ctrl+Y)",
3684
+ actionRedoTitleApple: "Redo (\u2318Y)",
3685
+ codeSelectLanguage: "Select language",
3686
+ linkEditorLink: "Link",
3687
+ linkEditorRel: "Rel",
3688
+ linkEditorTarget: "Target",
3689
+ linkEditorCommit: "Done",
3690
+ linkEditorEdit: "Edit",
3691
+ linkPreviewReplaceTextWithTitle: "Replace link text with its title",
3692
+ horizontalRule: "Horizontal rule",
3693
+ table: "Table",
3694
+ insertTableTitle: "Insert table",
3695
+ insertTableDescription: "Define your starting point of a table, you can add and remove columns and rows after creation.",
3696
+ insertTableRows: "Rows",
3697
+ insertTableColumns: "Columns",
3698
+ insertTableCommit: "Insert table"
3699
+ };
3700
+ var en_default = translations;
3701
+
3702
+ // src/rich-text-editor/i18n/index.tsx
3637
3703
  var import_jsx_runtime77 = require("react/jsx-runtime");
3638
3704
  var I18nContext = (0, import_react63.createContext)(null);
3639
3705
  function I18nProvider({
3640
- language,
3641
3706
  labelTranslations,
3642
3707
  children
3643
3708
  }) {
3644
- const [translations, setTranslations] = (0, import_react63.useState)(labelTranslations || null);
3645
- (0, import_react63.useEffect)(() => {
3646
- let unmounted = false;
3647
- (async function load() {
3648
- if (!labelTranslations) {
3649
- const resource = await import(`./translations/${language}.ts`);
3650
- if (!unmounted) {
3651
- setTranslations(resource.default);
3652
- }
3653
- }
3654
- })();
3655
- return () => {
3656
- unmounted = true;
3657
- };
3658
- }, [language, labelTranslations]);
3709
+ const translations2 = labelTranslations || en_default;
3659
3710
  return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(I18nContext.Provider, {
3660
- value: translations,
3711
+ value: translations2,
3661
3712
  children
3662
3713
  });
3663
3714
  }
package/dist/index.mjs CHANGED
@@ -1503,7 +1503,7 @@ var Info = forwardRef28((delegated, ref) => {
1503
1503
  }),
1504
1504
  /* @__PURE__ */ jsx35("path", {
1505
1505
  fillRule: "evenodd",
1506
- "clip-rule": "evenodd",
1506
+ clipRule: "evenodd",
1507
1507
  d: "M18.253 3.85212C18.253 5.04383 17.2869 6.00991 16.0952 6.00991C14.9035 6.00991 13.9374 5.04383 13.9374 3.85212C13.9374 2.66041 14.9035 1.69434 16.0952 1.69434C17.2869 1.69434 18.253 2.66041 18.253 3.85212ZM16.0952 5.34999C16.9224 5.34999 17.5931 4.67937 17.5931 3.85212C17.5931 3.02487 16.9224 2.35425 16.0952 2.35425C15.2679 2.35425 14.5973 3.02487 14.5973 3.85212C14.5973 4.67937 15.2679 5.34999 16.0952 5.34999Z",
1508
1508
  fill: "#528693"
1509
1509
  }),
@@ -1513,7 +1513,7 @@ var Info = forwardRef28((delegated, ref) => {
1513
1513
  }),
1514
1514
  /* @__PURE__ */ jsx35("path", {
1515
1515
  fillRule: "evenodd",
1516
- "clip-rule": "evenodd",
1516
+ clipRule: "evenodd",
1517
1517
  d: "M11.2842 18.976L11.3049 18.9785C11.5112 19.0031 11.7201 18.9658 11.9049 18.8714C12.0891 18.7772 12.2409 18.6306 12.3411 18.4504C12.3471 18.4394 12.352 18.4277 12.3558 18.4158C12.3317 18.4124 12.3048 18.4091 12.2731 18.4053C12.0384 18.3881 11.8084 18.33 11.5936 18.2335C11.2334 18.0797 10.9456 17.7933 10.7906 17.433C10.6341 17.0694 10.6252 16.6594 10.7658 16.2894C10.9266 15.8663 11.1487 15.4689 11.4246 15.1101L11.6291 14.8181C11.6293 14.8178 11.629 14.8184 11.6291 14.8181C12.0038 14.2802 12.4092 13.763 12.8423 13.2707L12.9418 13.1535C12.9894 13.097 13.0361 13.0418 13.0821 12.9874C13.2314 12.8108 13.3734 12.6428 13.5141 12.4665L13.5237 12.4544L13.5339 12.4428C14.107 11.7899 14.5194 11.0128 14.7386 10.1733C14.8642 9.60674 14.7724 9.1134 14.5125 8.69961C14.2452 8.27422 13.7678 7.88337 13.0466 7.60647L13.0376 7.60304C12.2034 7.26882 11.3198 7.07373 10.4221 7.02572C10.2586 7.02444 10.0952 7.03841 9.93422 7.06745L9.91342 7.0712L9.89242 7.07362C9.77981 7.08656 9.67209 7.12639 9.57839 7.18964C9.48729 7.25113 9.41209 7.33296 9.35867 7.42842C9.35249 7.44171 9.33941 7.47402 9.32659 7.52286C9.31959 7.54951 9.31383 7.57671 9.30949 7.60325C9.36308 7.61115 9.41754 7.61364 9.47206 7.61055L9.51828 7.60793L9.63538 7.61773C9.79024 7.6263 9.94419 7.64682 10.0959 7.67913L10.1211 7.68451L10.1459 7.69185C10.6213 7.83272 11.1176 8.10198 11.3044 8.65041L11.3058 8.6547C11.4603 9.11879 11.309 9.5616 11.1547 9.87197C10.9947 10.194 10.7584 10.5161 10.546 10.7961C10.1932 11.2626 9.79323 11.726 9.4222 12.1559L9.4167 12.1622L9.30686 12.2896L9.29607 12.301C8.50411 13.1358 7.82119 14.0671 7.26353 15.0728C6.95101 15.7053 6.92585 16.2828 7.10297 16.7755C7.28379 17.2785 7.70442 17.772 8.42421 18.1631L8.42623 18.1642C9.29923 18.6426 10.2687 18.9197 11.2633 18.9749L11.2842 18.976ZM6.67909 14.7659C7.26511 13.7065 7.9836 12.7256 8.81732 11.8468L8.91693 11.7313C9.29243 11.2963 9.68044 10.8467 10.0199 10.3976C10.4486 9.83253 10.8215 9.28929 10.6797 8.86312C10.5968 8.6196 10.3605 8.44373 9.9584 8.32457C9.83715 8.29874 9.71404 8.28256 9.59022 8.27617L9.50938 8.26941C9.26232 8.2834 9.01575 8.23452 8.79281 8.12735C8.54248 7.93066 8.64731 7.36817 8.77404 7.12204C8.87835 6.92966 9.02762 6.76522 9.2092 6.64266C9.39077 6.5201 9.59929 6.44304 9.81707 6.41802C10.0235 6.38077 10.2331 6.36335 10.4429 6.36598C11.4176 6.41652 12.3773 6.6275 13.2831 6.9904C14.9259 7.62106 15.7097 8.86885 15.3801 10.3284C15.1357 11.2718 14.6733 12.1451 14.0299 12.8781C13.8828 13.0625 13.7326 13.2401 13.582 13.4182C13.5366 13.4719 13.4912 13.5256 13.4458 13.5795L13.3415 13.7024C12.9232 14.1775 12.5323 14.6759 12.1707 15.1952L11.9564 15.5012C11.7156 15.8119 11.5223 16.1565 11.3827 16.5237C11.303 16.7335 11.308 16.966 11.3968 17.1721C11.4855 17.3783 11.651 17.5421 11.8583 17.6289C12.0086 17.6973 12.1701 17.7377 12.335 17.748C12.5957 17.7793 12.8648 17.8126 12.9712 18.0603C13.0139 18.1752 13.0313 18.298 13.0223 18.4203C13.0133 18.5425 12.9781 18.6615 12.9191 18.769C12.7552 19.0647 12.5066 19.305 12.2052 19.459C11.9037 19.6131 11.563 19.6739 11.2267 19.6338C10.1339 19.5731 9.0685 19.2687 8.1091 18.743C6.45171 17.8422 5.90412 16.3181 6.67909 14.7659Z",
1518
1518
  fill: "#528693"
1519
1519
  })
@@ -3541,7 +3541,7 @@ function Tag({ children, className, variant, ...delegated }) {
3541
3541
  }
3542
3542
 
3543
3543
  // src/rich-text-editor/rich-text-editor.tsx
3544
- import { useEffect as useEffect12, useRef as useRef5, useState as useState11 } from "react";
3544
+ import { useEffect as useEffect11, useRef as useRef5, useState as useState10 } from "react";
3545
3545
  import { AutoFocusPlugin } from "@lexical/react/LexicalAutoFocusPlugin";
3546
3546
  import { ClearEditorPlugin } from "@lexical/react/LexicalClearEditorPlugin";
3547
3547
  import { LexicalComposer } from "@lexical/react/LexicalComposer";
@@ -3573,31 +3573,82 @@ var useSharedHistoryContext = () => {
3573
3573
  };
3574
3574
 
3575
3575
  // src/rich-text-editor/i18n/index.tsx
3576
- import { createContext as createContext2, useContext as useContext2, useEffect, useState } from "react";
3576
+ import { createContext as createContext2, useContext as useContext2 } from "react";
3577
+
3578
+ // src/rich-text-editor/i18n/translations/en.ts
3579
+ var translations = {
3580
+ actionClearTextFormatting: "Clear text formatting",
3581
+ actionTextFormattingOptions: "Formatting options for additional text styles",
3582
+ actionFormatAsStrongLabel: "Format text as bold",
3583
+ actionFormatAsStrongTitle: "Bold (Ctrl+B)",
3584
+ actionFormatAsStrongTitleApple: "Bold (\u2318B)",
3585
+ actionFormatAsEmphasizedLabel: "Format text as italics",
3586
+ actionFormatAsEmphasizedTitle: "Italic (Ctrl+I)",
3587
+ actionFormatAsEmphasizedTitleApple: "Italic (\u2318I)",
3588
+ actionFormatAsUnderlinedLabel: "Underline text",
3589
+ actionFormatAsUnderlinedTitle: "Underlined (Ctrl+U)",
3590
+ actionFormatAsUnderlinedTitleApple: "Underlined (\u2318U)",
3591
+ actionFormatWithStrikethroughLabel: "Format text with a strikethrough",
3592
+ actionFormatWithStrikethroughTitle: "Strikethrough",
3593
+ actionFormatWithSubscriptLabel: "Format text as subscript",
3594
+ actionFormatWithSubscriptTitle: "Subscript",
3595
+ actionFormatWithSuperscriptLabel: "Format text as superscript",
3596
+ actionFormatWithSuperscriptTitle: "Superscript",
3597
+ actionInsertCodeBlock: "Insert code block",
3598
+ actionInsertlink: "Insert link",
3599
+ actionCopyJSON: "Copy JSON",
3600
+ actionCopyCode: "Copy code",
3601
+ actionClear: "Clear editor",
3602
+ actionFormatCode: "Format code with Prettier",
3603
+ actionTableInsertRowsAbove: "Insert row above",
3604
+ actionTableInsertRowsAbove_plural: "Insert {{rows}} rows above",
3605
+ actionTableInsertRowsBelow: "Insert row above",
3606
+ actionTableInsertRowsBelow_plural: "Insert {{rows}} rows above",
3607
+ actionTableInsertColumnsBefore: "Insert column left",
3608
+ actionTableInsertColumnsBefore_plural: "Insert {{columns}} columns left",
3609
+ actionTableInsertColumnsAfter: "Insert column right",
3610
+ actionTableInsertColumnsAfter_plural: "Insert {{columns}} columns right",
3611
+ actionTableAddRowHeader: "Add row header",
3612
+ actionTableRemoveRowHeader: "Remove row header",
3613
+ actionTableAddColumnHeader: "Add column header",
3614
+ actionTableRemoveColumnHeader: "Remove column header",
3615
+ actionTableDeleteColumn: "Delete column",
3616
+ actionTableDeleteRow: "Delete row",
3617
+ actionTableDeleteTable: "Delete table",
3618
+ actionTableOpenOptions: "Open table options",
3619
+ actionUndoLabel: "Undo",
3620
+ actionUndoTitle: "Undo (Ctrl+Z)",
3621
+ actionUndoTitleApple: "Undo (\u2318Z)",
3622
+ actionRedoLabel: "Undo",
3623
+ actionRedoTitle: "Undo (Ctrl+Y)",
3624
+ actionRedoTitleApple: "Redo (\u2318Y)",
3625
+ codeSelectLanguage: "Select language",
3626
+ linkEditorLink: "Link",
3627
+ linkEditorRel: "Rel",
3628
+ linkEditorTarget: "Target",
3629
+ linkEditorCommit: "Done",
3630
+ linkEditorEdit: "Edit",
3631
+ linkPreviewReplaceTextWithTitle: "Replace link text with its title",
3632
+ horizontalRule: "Horizontal rule",
3633
+ table: "Table",
3634
+ insertTableTitle: "Insert table",
3635
+ insertTableDescription: "Define your starting point of a table, you can add and remove columns and rows after creation.",
3636
+ insertTableRows: "Rows",
3637
+ insertTableColumns: "Columns",
3638
+ insertTableCommit: "Insert table"
3639
+ };
3640
+ var en_default = translations;
3641
+
3642
+ // src/rich-text-editor/i18n/index.tsx
3577
3643
  import { jsx as jsx77 } from "react/jsx-runtime";
3578
3644
  var I18nContext = createContext2(null);
3579
3645
  function I18nProvider({
3580
- language,
3581
3646
  labelTranslations,
3582
3647
  children
3583
3648
  }) {
3584
- const [translations, setTranslations] = useState(labelTranslations || null);
3585
- useEffect(() => {
3586
- let unmounted = false;
3587
- (async function load() {
3588
- if (!labelTranslations) {
3589
- const resource = await import(`./translations/${language}.ts`);
3590
- if (!unmounted) {
3591
- setTranslations(resource.default);
3592
- }
3593
- }
3594
- })();
3595
- return () => {
3596
- unmounted = true;
3597
- };
3598
- }, [language, labelTranslations]);
3649
+ const translations2 = labelTranslations || en_default;
3599
3650
  return /* @__PURE__ */ jsx77(I18nContext.Provider, {
3600
- value: translations,
3651
+ value: translations2,
3601
3652
  children
3602
3653
  });
3603
3654
  }
@@ -4067,7 +4118,7 @@ function LexicalAutoLinkPlugin() {
4067
4118
  }
4068
4119
 
4069
4120
  // src/rich-text-editor/plugins/CodeActionMenuPlugin/index.tsx
4070
- import { useEffect as useEffect2, useRef, useState as useState4 } from "react";
4121
+ import { useEffect, useRef, useState as useState3 } from "react";
4071
4122
  import { $getNearestNodeFromDOMNode as $getNearestNodeFromDOMNode3 } from "lexical";
4072
4123
  import { createPortal } from "react-dom";
4073
4124
  import { useDebouncedCallback as useDebouncedCallback2 } from "use-debounce";
@@ -4076,13 +4127,13 @@ import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext
4076
4127
 
4077
4128
  // src/rich-text-editor/plugins/CodeActionMenuPlugin/components/CopyButton/index.tsx
4078
4129
  import "react";
4079
- import { useState as useState2 } from "react";
4130
+ import { useState } from "react";
4080
4131
  import { $getNearestNodeFromDOMNode, $getSelection, $setSelection } from "lexical";
4081
4132
  import { useDebouncedCallback } from "use-debounce";
4082
4133
  import { $isCodeNode as $isCodeNode2 } from "@lexical/code";
4083
4134
  import { jsx as jsx79 } from "react/jsx-runtime";
4084
4135
  function CopyButton({ editor, getCodeDOMNode }) {
4085
- const [isCopyCompleted, setCopyCompleted] = useState2(false);
4136
+ const [isCopyCompleted, setCopyCompleted] = useState(false);
4086
4137
  const tr = useTr();
4087
4138
  const removeSuccessIcon = useDebouncedCallback(() => {
4088
4139
  setCopyCompleted(false);
@@ -4123,7 +4174,7 @@ function CopyButton({ editor, getCodeDOMNode }) {
4123
4174
 
4124
4175
  // src/rich-text-editor/plugins/CodeActionMenuPlugin/components/PrettierButton/index.tsx
4125
4176
  import "react";
4126
- import { useState as useState3 } from "react";
4177
+ import { useState as useState2 } from "react";
4127
4178
  import { $getNearestNodeFromDOMNode as $getNearestNodeFromDOMNode2 } from "lexical";
4128
4179
  import { $isCodeNode as $isCodeNode3 } from "@lexical/code";
4129
4180
  import { jsx as jsx80, jsxs as jsxs58 } from "react/jsx-runtime";
@@ -4166,8 +4217,8 @@ function getPrettierOptions(lang) {
4166
4217
  return options;
4167
4218
  }
4168
4219
  function PrettierButton({ lang, editor, getCodeDOMNode }) {
4169
- const [syntaxError, setSyntaxError] = useState3("");
4170
- const [tipsVisible, setTipsVisible] = useState3(false);
4220
+ const [syntaxError, setSyntaxError] = useState2("");
4221
+ const [tipsVisible, setTipsVisible] = useState2(false);
4171
4222
  const tr = useTr();
4172
4223
  async function handleClick() {
4173
4224
  const codeDOMNode = getCodeDOMNode();
@@ -4240,10 +4291,10 @@ import { Fragment as Fragment2, jsx as jsx81, jsxs as jsxs59 } from "react/jsx-r
4240
4291
  var CODE_PADDING = 8;
4241
4292
  function CodeActionMenuContainer({ anchorElem }) {
4242
4293
  const [editor] = useLexicalComposerContext();
4243
- const [lang, setLang] = useState4("");
4244
- const [isShown, setShown] = useState4(false);
4245
- const [shouldListenMouseMove, setShouldListenMouseMove] = useState4(true);
4246
- const [position, setPosition] = useState4({
4294
+ const [lang, setLang] = useState3("");
4295
+ const [isShown, setShown] = useState3(false);
4296
+ const [shouldListenMouseMove, setShouldListenMouseMove] = useState3(true);
4297
+ const [position, setPosition] = useState3({
4247
4298
  right: "0",
4248
4299
  top: "0"
4249
4300
  });
@@ -4282,7 +4333,7 @@ function CodeActionMenuContainer({ anchorElem }) {
4282
4333
  });
4283
4334
  }
4284
4335
  }, 50);
4285
- useEffect2(() => {
4336
+ useEffect(() => {
4286
4337
  if (!shouldListenMouseMove) {
4287
4338
  return;
4288
4339
  }
@@ -4354,19 +4405,19 @@ function CodeActionMenuPlugin({
4354
4405
  }
4355
4406
 
4356
4407
  // src/rich-text-editor/plugins/CodeHighlightPlugin/index.ts
4357
- import { useEffect as useEffect3 } from "react";
4408
+ import { useEffect as useEffect2 } from "react";
4358
4409
  import { registerCodeHighlighting } from "@lexical/code";
4359
4410
  import { useLexicalComposerContext as useLexicalComposerContext2 } from "@lexical/react/LexicalComposerContext";
4360
4411
  function CodeHighlightPlugin() {
4361
4412
  const [editor] = useLexicalComposerContext2();
4362
- useEffect3(() => {
4413
+ useEffect2(() => {
4363
4414
  return registerCodeHighlighting(editor);
4364
4415
  }, [editor]);
4365
4416
  return null;
4366
4417
  }
4367
4418
 
4368
4419
  // src/rich-text-editor/plugins/FloatingLinkEditorPlugin/index.tsx
4369
- import { useCallback, useEffect as useEffect5, useRef as useRef2, useState as useState6 } from "react";
4420
+ import { useCallback, useEffect as useEffect4, useRef as useRef2, useState as useState5 } from "react";
4370
4421
  import "react";
4371
4422
  import {
4372
4423
  $getSelection as $getSelection3,
@@ -4383,7 +4434,7 @@ import { useLexicalComposerContext as useLexicalComposerContext4 } from "@lexica
4383
4434
  import { $findMatchingParent, mergeRegister } from "@lexical/utils";
4384
4435
 
4385
4436
  // src/rich-text-editor/ui/LinkPreview.tsx
4386
- import { Suspense, useEffect as useEffect4, useState as useState5 } from "react";
4437
+ import { Suspense, useEffect as useEffect3, useState as useState4 } from "react";
4387
4438
  import { $getSelection as $getSelection2, $isTextNode as $isTextNode3 } from "lexical";
4388
4439
  import { useLexicalComposerContext as useLexicalComposerContext3 } from "@lexical/react/LexicalComposerContext";
4389
4440
  import { Fragment as Fragment3, jsx as jsx82, jsxs as jsxs60 } from "react/jsx-runtime";
@@ -4410,12 +4461,12 @@ function useSuspenseRequest(url) {
4410
4461
  function LinkPreviewContent({
4411
4462
  url
4412
4463
  }) {
4413
- const [textContent, setTextContent] = useState5("");
4464
+ const [textContent, setTextContent] = useState4("");
4414
4465
  const { preview } = useSuspenseRequest(url);
4415
4466
  const [editor] = useLexicalComposerContext3();
4416
4467
  const tr = useTr();
4417
4468
  const hasPreview = preview !== null && preview.google?.title;
4418
- useEffect4(() => {
4469
+ useEffect3(() => {
4419
4470
  editor.update(() => {
4420
4471
  const sel = $getSelection2();
4421
4472
  const nodes = sel?.getNodes();
@@ -4578,11 +4629,11 @@ function FloatingLinkEditor({
4578
4629
  }) {
4579
4630
  const editorRef = useRef2(null);
4580
4631
  const inputRef = useRef2(null);
4581
- const [linkUrl, setLinkUrl] = useState6("");
4582
- const [rel, setRel] = useState6(null);
4583
- const [target, setTarget] = useState6(null);
4584
- const [isEditMode, setEditMode] = useState6(false);
4585
- const [lastSelection, setLastSelection] = useState6(null);
4632
+ const [linkUrl, setLinkUrl] = useState5("");
4633
+ const [rel, setRel] = useState5(null);
4634
+ const [target, setTarget] = useState5(null);
4635
+ const [isEditMode, setEditMode] = useState5(false);
4636
+ const [lastSelection, setLastSelection] = useState5(null);
4586
4637
  const tr = useTr();
4587
4638
  const updateLinkEditor = useCallback(() => {
4588
4639
  const selection = $getSelection3();
@@ -4634,7 +4685,7 @@ function FloatingLinkEditor({
4634
4685
  }
4635
4686
  return true;
4636
4687
  }, [anchorElem, editor]);
4637
- useEffect5(() => {
4688
+ useEffect4(() => {
4638
4689
  const scrollerElem = anchorElem.parentElement;
4639
4690
  const update = () => {
4640
4691
  editor.getEditorState().read(() => {
@@ -4652,7 +4703,7 @@ function FloatingLinkEditor({
4652
4703
  }
4653
4704
  };
4654
4705
  }, [anchorElem.parentElement, editor, updateLinkEditor]);
4655
- useEffect5(() => {
4706
+ useEffect4(() => {
4656
4707
  return mergeRegister(
4657
4708
  editor.registerUpdateListener(({ editorState }) => {
4658
4709
  editorState.read(() => {
@@ -4680,12 +4731,12 @@ function FloatingLinkEditor({
4680
4731
  )
4681
4732
  );
4682
4733
  }, [editor, updateLinkEditor, setIsLink, isLink]);
4683
- useEffect5(() => {
4734
+ useEffect4(() => {
4684
4735
  editor.getEditorState().read(() => {
4685
4736
  updateLinkEditor();
4686
4737
  });
4687
4738
  }, [editor, updateLinkEditor]);
4688
- useEffect5(() => {
4739
+ useEffect4(() => {
4689
4740
  if (isEditMode && inputRef.current) {
4690
4741
  inputRef.current.focus();
4691
4742
  }
@@ -4792,8 +4843,8 @@ function FloatingLinkEditor({
4792
4843
  });
4793
4844
  }
4794
4845
  function useFloatingLinkEditorToolbar(editor, anchorElem) {
4795
- const [activeEditor, setActiveEditor] = useState6(editor);
4796
- const [isLink, setIsLink] = useState6(false);
4846
+ const [activeEditor, setActiveEditor] = useState5(editor);
4847
+ const [isLink, setIsLink] = useState5(false);
4797
4848
  const updateToolbar = useCallback(() => {
4798
4849
  const selection = $getSelection3();
4799
4850
  if ($isRangeSelection(selection)) {
@@ -4807,7 +4858,7 @@ function useFloatingLinkEditorToolbar(editor, anchorElem) {
4807
4858
  }
4808
4859
  }
4809
4860
  }, []);
4810
- useEffect5(() => {
4861
+ useEffect4(() => {
4811
4862
  return editor.registerCommand(
4812
4863
  SELECTION_CHANGE_COMMAND,
4813
4864
  (_payload, newEditor) => {
@@ -4836,7 +4887,7 @@ function FloatingLinkEditorPlugin({
4836
4887
  }
4837
4888
 
4838
4889
  // src/rich-text-editor/plugins/FloatingTextFormatToolbarPlugin/index.tsx
4839
- import { useCallback as useCallback2, useEffect as useEffect6, useRef as useRef3, useState as useState7 } from "react";
4890
+ import { useCallback as useCallback2, useEffect as useEffect5, useRef as useRef3, useState as useState6 } from "react";
4840
4891
  import "react";
4841
4892
  import {
4842
4893
  $getSelection as $getSelection4,
@@ -4920,7 +4971,7 @@ function TextFormatFloatingToolbar({
4920
4971
  setFloatingElemPosition(rangeRect, popupCharStylesEditorElem, anchorElem);
4921
4972
  }
4922
4973
  }, [editor, anchorElem]);
4923
- useEffect6(() => {
4974
+ useEffect5(() => {
4924
4975
  const scrollerElem = anchorElem.parentElement;
4925
4976
  const update = () => {
4926
4977
  editor.getEditorState().read(() => {
@@ -4938,7 +4989,7 @@ function TextFormatFloatingToolbar({
4938
4989
  }
4939
4990
  };
4940
4991
  }, [editor, updateTextFormatFloatingToolbar, anchorElem]);
4941
- useEffect6(() => {
4992
+ useEffect5(() => {
4942
4993
  editor.getEditorState().read(() => {
4943
4994
  updateTextFormatFloatingToolbar();
4944
4995
  });
@@ -5052,15 +5103,15 @@ function TextFormatFloatingToolbar({
5052
5103
  });
5053
5104
  }
5054
5105
  function useFloatingTextFormatToolbar(editor, anchorElem) {
5055
- const [isText, setIsText] = useState7(false);
5056
- const [isLink, setIsLink] = useState7(false);
5057
- const [isBold, setIsBold] = useState7(false);
5058
- const [isItalic, setIsItalic] = useState7(false);
5059
- const [isUnderline, setIsUnderline] = useState7(false);
5060
- const [isStrikethrough, setIsStrikethrough] = useState7(false);
5061
- const [isSubscript, setIsSubscript] = useState7(false);
5062
- const [isSuperscript, setIsSuperscript] = useState7(false);
5063
- const [isCode, setIsCode] = useState7(false);
5106
+ const [isText, setIsText] = useState6(false);
5107
+ const [isLink, setIsLink] = useState6(false);
5108
+ const [isBold, setIsBold] = useState6(false);
5109
+ const [isItalic, setIsItalic] = useState6(false);
5110
+ const [isUnderline, setIsUnderline] = useState6(false);
5111
+ const [isStrikethrough, setIsStrikethrough] = useState6(false);
5112
+ const [isSubscript, setIsSubscript] = useState6(false);
5113
+ const [isSuperscript, setIsSuperscript] = useState6(false);
5114
+ const [isCode, setIsCode] = useState6(false);
5064
5115
  const updatePopup = useCallback2(() => {
5065
5116
  editor.getEditorState().read(() => {
5066
5117
  if (editor.isComposing()) {
@@ -5097,13 +5148,13 @@ function useFloatingTextFormatToolbar(editor, anchorElem) {
5097
5148
  }
5098
5149
  });
5099
5150
  }, [editor]);
5100
- useEffect6(() => {
5151
+ useEffect5(() => {
5101
5152
  document.addEventListener("selectionchange", updatePopup);
5102
5153
  return () => {
5103
5154
  document.removeEventListener("selectionchange", updatePopup);
5104
5155
  };
5105
5156
  }, [updatePopup]);
5106
- useEffect6(() => {
5157
+ useEffect5(() => {
5107
5158
  return mergeRegister2(
5108
5159
  editor.registerUpdateListener(() => {
5109
5160
  updatePopup();
@@ -5161,7 +5212,7 @@ import {
5161
5212
  COMMAND_PRIORITY_CRITICAL as COMMAND_PRIORITY_CRITICAL2,
5162
5213
  INDENT_CONTENT_COMMAND
5163
5214
  } from "lexical";
5164
- import { useEffect as useEffect7 } from "react";
5215
+ import { useEffect as useEffect6 } from "react";
5165
5216
  function getElementNodesInSelection(selection) {
5166
5217
  const nodesInSelection = selection.getNodes();
5167
5218
  if (nodesInSelection.length === 0) {
@@ -5198,7 +5249,7 @@ function isIndentPermitted(maxDepth) {
5198
5249
  }
5199
5250
  function ListMaxIndentLevelPlugin({ maxDepth }) {
5200
5251
  const [editor] = useLexicalComposerContext6();
5201
- useEffect7(() => {
5252
+ useEffect6(() => {
5202
5253
  return editor.registerCommand(
5203
5254
  INDENT_CONTENT_COMMAND,
5204
5255
  () => !isIndentPermitted(maxDepth ?? 7),
@@ -5209,7 +5260,7 @@ function ListMaxIndentLevelPlugin({ maxDepth }) {
5209
5260
  }
5210
5261
 
5211
5262
  // src/rich-text-editor/plugins/MaxLengthPlugin/index.tsx
5212
- import { useEffect as useEffect8 } from "react";
5263
+ import { useEffect as useEffect7 } from "react";
5213
5264
  import { $getSelection as $getSelection6, $isRangeSelection as $isRangeSelection4 } from "lexical";
5214
5265
  import { useLexicalComposerContext as useLexicalComposerContext7 } from "@lexical/react/LexicalComposerContext";
5215
5266
  import { trimTextContentFromAnchor } from "@lexical/selection";
@@ -5251,7 +5302,7 @@ ${content}
5251
5302
  // src/rich-text-editor/plugins/MaxLengthPlugin/index.tsx
5252
5303
  function MaxLengthPlugin({ maxLength }) {
5253
5304
  const [editor] = useLexicalComposerContext7();
5254
- useEffect8(() => {
5305
+ useEffect7(() => {
5255
5306
  let lastRestoredEditorState = null;
5256
5307
  return editor.registerUpdateListener(({ editorState, prevEditorState }) => {
5257
5308
  editor.update(() => {
@@ -5281,7 +5332,7 @@ function MaxLengthPlugin({ maxLength }) {
5281
5332
  }
5282
5333
 
5283
5334
  // src/rich-text-editor/plugins/TabFocusPlugin/index.tsx
5284
- import { useEffect as useEffect9 } from "react";
5335
+ import { useEffect as useEffect8 } from "react";
5285
5336
  import { $getSelection as $getSelection7, $isRangeSelection as $isRangeSelection5, $setSelection as $setSelection2, FOCUS_COMMAND } from "lexical";
5286
5337
  import { useLexicalComposerContext as useLexicalComposerContext8 } from "@lexical/react/LexicalComposerContext";
5287
5338
  var COMMAND_PRIORITY_LOW3 = 1;
@@ -5301,7 +5352,7 @@ function registerKeyTimeStampTracker() {
5301
5352
  }
5302
5353
  function TabFocusPlugin() {
5303
5354
  const [editor] = useLexicalComposerContext8();
5304
- useEffect9(() => {
5355
+ useEffect8(() => {
5305
5356
  if (!hasRegisteredKeyDownListener) {
5306
5357
  registerKeyTimeStampTracker();
5307
5358
  hasRegisteredKeyDownListener = true;
@@ -5324,7 +5375,7 @@ function TabFocusPlugin() {
5324
5375
  }
5325
5376
 
5326
5377
  // src/rich-text-editor/plugins/TableActionMenuPlugin/index.tsx
5327
- import { useCallback as useCallback3, useEffect as useEffect10, useRef as useRef4, useState as useState8 } from "react";
5378
+ import { useCallback as useCallback3, useEffect as useEffect9, useRef as useRef4, useState as useState7 } from "react";
5328
5379
  import { $getRoot as $getRoot3, $getSelection as $getSelection8, $isRangeSelection as $isRangeSelection6, DEPRECATED_$isGridSelection } from "lexical";
5329
5380
  import { createPortal as createPortal4 } from "react-dom";
5330
5381
  import { useLexicalComposerContext as useLexicalComposerContext9 } from "@lexical/react/LexicalComposerContext";
@@ -5349,13 +5400,13 @@ import {
5349
5400
  import { Fragment as Fragment6, jsx as jsx86, jsxs as jsxs63 } from "react/jsx-runtime";
5350
5401
  function TableActionMenu({ tableCellNode: _tableCellNode, tableStats }) {
5351
5402
  const [editor] = useLexicalComposerContext9();
5352
- const [tableCellNode, updateTableCellNode] = useState8(_tableCellNode);
5353
- const [selectionCounts, updateSelectionCounts] = useState8({
5403
+ const [tableCellNode, updateTableCellNode] = useState7(_tableCellNode);
5404
+ const [selectionCounts, updateSelectionCounts] = useState7({
5354
5405
  columns: 1,
5355
5406
  rows: 1
5356
5407
  });
5357
5408
  const tr = useTr();
5358
- useEffect10(() => {
5409
+ useEffect9(() => {
5359
5410
  return editor.registerMutationListener(TableCellNode2, (nodeMutations) => {
5360
5411
  const nodeUpdated = nodeMutations.get(tableCellNode.getKey()) === "updated";
5361
5412
  if (nodeUpdated) {
@@ -5365,7 +5416,7 @@ function TableActionMenu({ tableCellNode: _tableCellNode, tableStats }) {
5365
5416
  }
5366
5417
  });
5367
5418
  }, [editor, tableCellNode]);
5368
- useEffect10(() => {
5419
+ useEffect9(() => {
5369
5420
  editor.getEditorState().read(() => {
5370
5421
  const selection = $getSelection8();
5371
5422
  if (DEPRECATED_$isGridSelection(selection)) {
@@ -5551,9 +5602,9 @@ function TableCellActionMenuContainer({ anchorElem }) {
5551
5602
  const [editor] = useLexicalComposerContext9();
5552
5603
  const tr = useTr();
5553
5604
  const menuButtonRef = useRef4(null);
5554
- const [isMenuOpen, setIsMenuOpen] = useState8(false);
5555
- const [tableCellNode, setTableMenuCellNode] = useState8(null);
5556
- const [tableStats, setTablestats] = useState8({ rows: 1, columns: 1 });
5605
+ const [isMenuOpen, setIsMenuOpen] = useState7(false);
5606
+ const [tableCellNode, setTableMenuCellNode] = useState7(null);
5607
+ const [tableStats, setTablestats] = useState7({ rows: 1, columns: 1 });
5557
5608
  const moveMenu = useCallback3(() => {
5558
5609
  if (isMenuOpen) {
5559
5610
  return;
@@ -5597,14 +5648,14 @@ function TableCellActionMenuContainer({ anchorElem }) {
5597
5648
  setTableMenuCellNode(null);
5598
5649
  }
5599
5650
  }, [editor, isMenuOpen]);
5600
- useEffect10(() => {
5651
+ useEffect9(() => {
5601
5652
  return editor.registerUpdateListener(() => {
5602
5653
  editor.getEditorState().read(() => {
5603
5654
  moveMenu();
5604
5655
  });
5605
5656
  });
5606
5657
  });
5607
- useEffect10(() => {
5658
+ useEffect9(() => {
5608
5659
  const menuButtonDOM = menuButtonRef.current;
5609
5660
  if (menuButtonDOM != null && tableCellNode != null) {
5610
5661
  const tableCellNodeDOM = editor.getElementByKey(tableCellNode.getKey());
@@ -5650,7 +5701,7 @@ function TableActionMenuPlugin({
5650
5701
  }
5651
5702
 
5652
5703
  // src/rich-text-editor/plugins/ToolbarPlugin/index.tsx
5653
- import { useCallback as useCallback4, useEffect as useEffect11, useState as useState10 } from "react";
5704
+ import { useCallback as useCallback4, useEffect as useEffect10, useState as useState9 } from "react";
5654
5705
  import {
5655
5706
  $createParagraphNode as $createParagraphNode2,
5656
5707
  $getNodeByKey,
@@ -5748,12 +5799,12 @@ function ActionsPlugin({
5748
5799
  }
5749
5800
 
5750
5801
  // src/rich-text-editor/plugins/ToolbarPlugin/insert-table.tsx
5751
- import { useState as useState9 } from "react";
5802
+ import { useState as useState8 } from "react";
5752
5803
  import { INSERT_TABLE_COMMAND } from "@lexical/table";
5753
5804
  import { Fragment as Fragment7, jsx as jsx88, jsxs as jsxs65 } from "react/jsx-runtime";
5754
5805
  function InsertTableDialog({ activeEditor }) {
5755
- const [rows, setRows] = useState9("5");
5756
- const [columns, setColumns] = useState9("5");
5806
+ const [rows, setRows] = useState8("5");
5807
+ const [columns, setColumns] = useState8("5");
5757
5808
  const tr = useTr();
5758
5809
  const onClick = () => {
5759
5810
  if (parseInt(rows) < 1 || parseInt(columns) < 1) {
@@ -6021,22 +6072,22 @@ function ToolbarPlugin({
6021
6072
  actionsMenuAppend
6022
6073
  }) {
6023
6074
  const [editor] = useLexicalComposerContext11();
6024
- const [activeEditor, setActiveEditor] = useState10(editor);
6025
- const [blockType, setBlockType] = useState10("paragraph");
6026
- const [selectedElementKey, setSelectedElementKey] = useState10(null);
6027
- const [isLink, setIsLink] = useState10(false);
6028
- const [isBold, setIsBold] = useState10(false);
6029
- const [isItalic, setIsItalic] = useState10(false);
6030
- const [isUnderline, setIsUnderline] = useState10(false);
6031
- const [isStrikethrough, setIsStrikethrough] = useState10(false);
6032
- const [isSubscript, setIsSubscript] = useState10(false);
6033
- const [isSuperscript, setIsSuperscript] = useState10(false);
6034
- const [isCode, setIsCode] = useState10(false);
6035
- const [canUndo, setCanUndo] = useState10(false);
6036
- const [canRedo, setCanRedo] = useState10(false);
6075
+ const [activeEditor, setActiveEditor] = useState9(editor);
6076
+ const [blockType, setBlockType] = useState9("paragraph");
6077
+ const [selectedElementKey, setSelectedElementKey] = useState9(null);
6078
+ const [isLink, setIsLink] = useState9(false);
6079
+ const [isBold, setIsBold] = useState9(false);
6080
+ const [isItalic, setIsItalic] = useState9(false);
6081
+ const [isUnderline, setIsUnderline] = useState9(false);
6082
+ const [isStrikethrough, setIsStrikethrough] = useState9(false);
6083
+ const [isSubscript, setIsSubscript] = useState9(false);
6084
+ const [isSuperscript, setIsSuperscript] = useState9(false);
6085
+ const [isCode, setIsCode] = useState9(false);
6086
+ const [canUndo, setCanUndo] = useState9(false);
6087
+ const [canRedo, setCanRedo] = useState9(false);
6037
6088
  const tr = useTr();
6038
- const [codeLanguage, setCodeLanguage] = useState10("");
6039
- const [isEditable, setIsEditable] = useState10(() => editor.isEditable());
6089
+ const [codeLanguage, setCodeLanguage] = useState9("");
6090
+ const [isEditable, setIsEditable] = useState9(() => editor.isEditable());
6040
6091
  const updateToolbar = useCallback4(() => {
6041
6092
  const selection = $getSelection9();
6042
6093
  if ($isRangeSelection7(selection)) {
@@ -6084,7 +6135,7 @@ function ToolbarPlugin({
6084
6135
  }
6085
6136
  }
6086
6137
  }, [activeEditor]);
6087
- useEffect11(() => {
6138
+ useEffect10(() => {
6088
6139
  return editor.registerCommand(
6089
6140
  SELECTION_CHANGE_COMMAND3,
6090
6141
  (_payload, newEditor) => {
@@ -6095,7 +6146,7 @@ function ToolbarPlugin({
6095
6146
  COMMAND_PRIORITY_CRITICAL3
6096
6147
  );
6097
6148
  }, [editor, updateToolbar]);
6098
- useEffect11(() => {
6149
+ useEffect10(() => {
6099
6150
  return mergeRegister3(
6100
6151
  editor.registerEditableListener((editable) => {
6101
6152
  setIsEditable(editable);
@@ -6612,18 +6663,18 @@ function RichTextEditorWithoutContext({
6612
6663
  children: placeholderText ?? ""
6613
6664
  });
6614
6665
  const [editor] = useLexicalComposerContext12();
6615
- const [floatingAnchorElem, setFloatingAnchorElem] = useState11(null);
6616
- const [isSmallWidthViewport, setIsSmallWidthViewport] = useState11(false);
6666
+ const [floatingAnchorElem, setFloatingAnchorElem] = useState10(null);
6667
+ const [isSmallWidthViewport, setIsSmallWidthViewport] = useState10(false);
6617
6668
  const firstOnChangeTriggeredRef = useRef5(!autoFocus);
6618
6669
  const onRef = (_floatingAnchorElem) => {
6619
6670
  if (_floatingAnchorElem !== null) {
6620
6671
  setFloatingAnchorElem(_floatingAnchorElem);
6621
6672
  }
6622
6673
  };
6623
- useEffect12(() => {
6674
+ useEffect11(() => {
6624
6675
  editor.setEditable(editable || false);
6625
6676
  }, [editable, editor]);
6626
- useEffect12(() => {
6677
+ useEffect11(() => {
6627
6678
  const updateViewPortWidth = () => {
6628
6679
  const isNextSmallWidthViewport = window.matchMedia("(max-width: 1025px)").matches;
6629
6680
  if (isNextSmallWidthViewport !== isSmallWidthViewport) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystallize/design-system",
3
- "version": "1.11.0",
3
+ "version": "1.11.2",
4
4
  "types": "./dist/index.d.ts",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -85,12 +85,12 @@
85
85
  "storybook": "7.0.0-beta.14",
86
86
  "storybook-addon-designs": "^6.3.1",
87
87
  "storybook-dark-mode": "^2.0.5",
88
- "tailwindcss": "^3.2.4",
89
- "tsconfig": "0.0.0",
88
+ "tailwindcss": "^3.3.0",
90
89
  "tsup": "^6.5.0",
91
90
  "typescript": "^4.9.4",
92
91
  "vite": "^4.1.1",
93
- "vitest": "^0.29.1"
92
+ "vitest": "^0.29.1",
93
+ "tsconfig": "0.0.0"
94
94
  },
95
95
  "keywords": [
96
96
  "react",
@@ -20,7 +20,7 @@ export const Info = forwardRef<InfoRef, InfoProps>((delegated, ref) => {
20
20
  />
21
21
  <path
22
22
  fillRule="evenodd"
23
- clip-rule="evenodd"
23
+ clipRule="evenodd"
24
24
  d="M18.253 3.85212C18.253 5.04383 17.2869 6.00991 16.0952 6.00991C14.9035 6.00991 13.9374 5.04383 13.9374 3.85212C13.9374 2.66041 14.9035 1.69434 16.0952 1.69434C17.2869 1.69434 18.253 2.66041 18.253 3.85212ZM16.0952 5.34999C16.9224 5.34999 17.5931 4.67937 17.5931 3.85212C17.5931 3.02487 16.9224 2.35425 16.0952 2.35425C15.2679 2.35425 14.5973 3.02487 14.5973 3.85212C14.5973 4.67937 15.2679 5.34999 16.0952 5.34999Z"
25
25
  fill="#528693"
26
26
  />
@@ -30,7 +30,7 @@ export const Info = forwardRef<InfoRef, InfoProps>((delegated, ref) => {
30
30
  />
31
31
  <path
32
32
  fillRule="evenodd"
33
- clip-rule="evenodd"
33
+ clipRule="evenodd"
34
34
  d="M11.2842 18.976L11.3049 18.9785C11.5112 19.0031 11.7201 18.9658 11.9049 18.8714C12.0891 18.7772 12.2409 18.6306 12.3411 18.4504C12.3471 18.4394 12.352 18.4277 12.3558 18.4158C12.3317 18.4124 12.3048 18.4091 12.2731 18.4053C12.0384 18.3881 11.8084 18.33 11.5936 18.2335C11.2334 18.0797 10.9456 17.7933 10.7906 17.433C10.6341 17.0694 10.6252 16.6594 10.7658 16.2894C10.9266 15.8663 11.1487 15.4689 11.4246 15.1101L11.6291 14.8181C11.6293 14.8178 11.629 14.8184 11.6291 14.8181C12.0038 14.2802 12.4092 13.763 12.8423 13.2707L12.9418 13.1535C12.9894 13.097 13.0361 13.0418 13.0821 12.9874C13.2314 12.8108 13.3734 12.6428 13.5141 12.4665L13.5237 12.4544L13.5339 12.4428C14.107 11.7899 14.5194 11.0128 14.7386 10.1733C14.8642 9.60674 14.7724 9.1134 14.5125 8.69961C14.2452 8.27422 13.7678 7.88337 13.0466 7.60647L13.0376 7.60304C12.2034 7.26882 11.3198 7.07373 10.4221 7.02572C10.2586 7.02444 10.0952 7.03841 9.93422 7.06745L9.91342 7.0712L9.89242 7.07362C9.77981 7.08656 9.67209 7.12639 9.57839 7.18964C9.48729 7.25113 9.41209 7.33296 9.35867 7.42842C9.35249 7.44171 9.33941 7.47402 9.32659 7.52286C9.31959 7.54951 9.31383 7.57671 9.30949 7.60325C9.36308 7.61115 9.41754 7.61364 9.47206 7.61055L9.51828 7.60793L9.63538 7.61773C9.79024 7.6263 9.94419 7.64682 10.0959 7.67913L10.1211 7.68451L10.1459 7.69185C10.6213 7.83272 11.1176 8.10198 11.3044 8.65041L11.3058 8.6547C11.4603 9.11879 11.309 9.5616 11.1547 9.87197C10.9947 10.194 10.7584 10.5161 10.546 10.7961C10.1932 11.2626 9.79323 11.726 9.4222 12.1559L9.4167 12.1622L9.30686 12.2896L9.29607 12.301C8.50411 13.1358 7.82119 14.0671 7.26353 15.0728C6.95101 15.7053 6.92585 16.2828 7.10297 16.7755C7.28379 17.2785 7.70442 17.772 8.42421 18.1631L8.42623 18.1642C9.29923 18.6426 10.2687 18.9197 11.2633 18.9749L11.2842 18.976ZM6.67909 14.7659C7.26511 13.7065 7.9836 12.7256 8.81732 11.8468L8.91693 11.7313C9.29243 11.2963 9.68044 10.8467 10.0199 10.3976C10.4486 9.83253 10.8215 9.28929 10.6797 8.86312C10.5968 8.6196 10.3605 8.44373 9.9584 8.32457C9.83715 8.29874 9.71404 8.28256 9.59022 8.27617L9.50938 8.26941C9.26232 8.2834 9.01575 8.23452 8.79281 8.12735C8.54248 7.93066 8.64731 7.36817 8.77404 7.12204C8.87835 6.92966 9.02762 6.76522 9.2092 6.64266C9.39077 6.5201 9.59929 6.44304 9.81707 6.41802C10.0235 6.38077 10.2331 6.36335 10.4429 6.36598C11.4176 6.41652 12.3773 6.6275 13.2831 6.9904C14.9259 7.62106 15.7097 8.86885 15.3801 10.3284C15.1357 11.2718 14.6733 12.1451 14.0299 12.8781C13.8828 13.0625 13.7326 13.2401 13.582 13.4182C13.5366 13.4719 13.4912 13.5256 13.4458 13.5795L13.3415 13.7024C12.9232 14.1775 12.5323 14.6759 12.1707 15.1952L11.9564 15.5012C11.7156 15.8119 11.5223 16.1565 11.3827 16.5237C11.303 16.7335 11.308 16.966 11.3968 17.1721C11.4855 17.3783 11.651 17.5421 11.8583 17.6289C12.0086 17.6973 12.1701 17.7377 12.335 17.748C12.5957 17.7793 12.8648 17.8126 12.9712 18.0603C13.0139 18.1752 13.0313 18.298 13.0223 18.4203C13.0133 18.5425 12.9781 18.6615 12.9191 18.769C12.7552 19.0647 12.5066 19.305 12.2052 19.459C11.9037 19.6131 11.563 19.6739 11.2267 19.6338C10.1339 19.5731 9.0685 19.2687 8.1091 18.743C6.45171 17.8422 5.90412 16.3181 6.67909 14.7659Z"
35
35
  fill="#528693"
36
36
  />
@@ -1,5 +1,6 @@
1
- import { createContext, ReactNode, useContext, useEffect, useState } from 'react';
1
+ import { createContext, ReactNode, useContext } from 'react';
2
2
 
3
+ import labelTranslationEn from './translations/en';
3
4
  import type { I18N } from './types';
4
5
 
5
6
  const I18nContext = createContext<I18N | null>(null);
@@ -9,7 +10,6 @@ export type SupportedLanguages = 'en';
9
10
  export { default as labelTranslationEn } from './translations/en';
10
11
 
11
12
  export function I18nProvider({
12
- language,
13
13
  labelTranslations,
14
14
  children,
15
15
  }: {
@@ -17,23 +17,24 @@ export function I18nProvider({
17
17
  labelTranslations?: I18N;
18
18
  children: ReactNode;
19
19
  }) {
20
- const [translations, setTranslations] = useState<I18N | null>(labelTranslations || null);
20
+ const translations = labelTranslations || labelTranslationEn;
21
+ // const [translations, setTranslations] = useState<I18N>(labelTranslations || labelTranslationEn);
21
22
 
22
- useEffect(() => {
23
- let unmounted = false;
24
- (async function load() {
25
- if (!labelTranslations) {
26
- const resource = await import(`./translations/${language}.ts`);
27
- if (!unmounted) {
28
- setTranslations(resource.default);
29
- }
30
- }
31
- })();
23
+ // useEffect(() => {
24
+ // let unmounted = false;
25
+ // (async function load() {
26
+ // if (language !== 'en') {
27
+ // const resource = await import(`./translations/${language}.ts`);
28
+ // if (!unmounted) {
29
+ // setTranslations(resource.default);
30
+ // }
31
+ // }
32
+ // })();
32
33
 
33
- return () => {
34
- unmounted = true;
35
- };
36
- }, [language, labelTranslations]);
34
+ // return () => {
35
+ // unmounted = true;
36
+ // };
37
+ // }, [language, labelTranslations]);
37
38
 
38
39
  return <I18nContext.Provider value={translations}>{children}</I18nContext.Provider>;
39
40
  }