@squiz/formatted-text-editor 1.12.0-alpha.43 → 1.12.0-alpha.45
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/lib/EditorToolbar/EditorToolbar.js +1 -1
- package/lib/EditorToolbar/Tools/Link/Form/LinkForm.js +5 -5
- package/lib/FormattedTextEditor.js +3 -2
- package/lib/index.css +141 -137
- package/lib/ui/Inputs/Select/Select.js +1 -1
- package/lib/ui/Inputs/Text/TextInput.js +2 -2
- package/lib/ui/Modal/Modal.js +7 -7
- package/lib/ui/ToolbarButton/ToolbarButton.js +1 -1
- package/package.json +5 -4
- package/postcss.config.js +9 -1
- package/src/EditorToolbar/EditorToolbar.tsx +1 -1
- package/src/EditorToolbar/Tools/Bold/BoldButton.spec.tsx +1 -1
- package/src/EditorToolbar/Tools/Italic/ItalicButton.spec.tsx +1 -1
- package/src/EditorToolbar/Tools/Link/Form/LinkForm.spec.tsx +1 -1
- package/src/EditorToolbar/Tools/Link/Form/LinkForm.tsx +5 -5
- package/src/EditorToolbar/Tools/Underline/Underline.spec.tsx +1 -1
- package/src/EditorToolbar/_editor-toolbar.scss +4 -2
- package/src/FormattedTextEditor.tsx +4 -2
- package/src/index.scss +1 -1
- package/src/ui/Inputs/Select/Select.tsx +1 -1
- package/src/ui/Inputs/Text/TextInput.tsx +2 -2
- package/src/ui/Modal/Modal.tsx +7 -7
- package/src/ui/Modal/_modal.scss +2 -2
- package/src/ui/ToolbarButton/ToolbarButton.tsx +1 -1
- package/src/ui/ToolbarDropdown/_toolbar-dropdown.scss +2 -1
- package/src/ui/_buttons.scss +1 -1
- package/src/ui/_forms.scss +1 -1
- package/tailwind.config.cjs +1 -3
@@ -24,7 +24,7 @@ export const EditorToolbar = ({ manager, isPopover }) => {
|
|
24
24
|
extensionNames.italic && React.createElement(ItalicButton, null),
|
25
25
|
extensionNames.underline && React.createElement(UnderlineButton, null),
|
26
26
|
extensionNames.nodeFormatting && React.createElement(TextAlignButtons, null),
|
27
|
-
React.createElement(TriggerLinkModal, null))) : (React.createElement(FloatingToolbar, { className: "
|
27
|
+
React.createElement(TriggerLinkModal, null))) : (React.createElement(FloatingToolbar, { className: "squiz-fte-scope squiz-fte-scope__floating-popover" },
|
28
28
|
extensionNames.bold && React.createElement(BoldButton, null),
|
29
29
|
extensionNames.italic && React.createElement(ItalicButton, null),
|
30
30
|
extensionNames.underline && React.createElement(UnderlineButton, null)))));
|
@@ -16,14 +16,14 @@ const LinkForm = () => {
|
|
16
16
|
const { name, value } = event.target;
|
17
17
|
setFormValues({ ...formValues, [name]: value });
|
18
18
|
};
|
19
|
-
return (React.createElement("form", { action: "", method: "post", className: "
|
20
|
-
React.createElement("div", { className: "
|
19
|
+
return (React.createElement("form", { action: "", method: "post", className: "squiz-fte-form" },
|
20
|
+
React.createElement("div", { className: "squiz-fte-form-group mb-2" },
|
21
21
|
React.createElement(TextInput, { id: "href", label: "URL", value: formValues.href, onChange: handleChange })),
|
22
|
-
React.createElement("div", { className: "
|
22
|
+
React.createElement("div", { className: "squiz-fte-form-group mb-2" },
|
23
23
|
React.createElement(TextInput, { id: "text", label: "Text", value: formValues.text, onChange: handleChange })),
|
24
|
-
React.createElement("div", { className: "
|
24
|
+
React.createElement("div", { className: "squiz-fte-form-group mb-2" },
|
25
25
|
React.createElement(TextInput, { id: "title", label: "Title", value: formValues.title, onChange: handleChange })),
|
26
|
-
React.createElement("div", { className: "
|
26
|
+
React.createElement("div", { className: "squiz-fte-form-group mb-0" },
|
27
27
|
React.createElement(Select, { id: "target", label: "Target", value: formValues.target, options: selectOptions }))));
|
28
28
|
};
|
29
29
|
export default LinkForm;
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import Editor from './Editor/Editor';
|
3
3
|
const FormattedTextEditor = () => {
|
4
|
-
return (React.createElement("div", { className: "
|
5
|
-
React.createElement(
|
4
|
+
return (React.createElement("div", { className: "squiz-fte-scope" },
|
5
|
+
React.createElement("div", { className: "remirror-theme formatted-text-editor editor-wrapper" },
|
6
|
+
React.createElement(Editor, null))));
|
6
7
|
};
|
7
8
|
export default FormattedTextEditor;
|
package/lib/index.css
CHANGED
@@ -611,258 +611,258 @@ input[type=range]::-ms-fill-lower {
|
|
611
611
|
--tw-backdrop-sepia: ;
|
612
612
|
}
|
613
613
|
.sr-only {
|
614
|
-
position: absolute;
|
615
|
-
width: 1px;
|
616
|
-
height: 1px;
|
617
|
-
padding: 0;
|
618
|
-
margin: -1px;
|
619
|
-
overflow: hidden;
|
620
|
-
clip: rect(0, 0, 0, 0);
|
621
|
-
white-space: nowrap;
|
622
|
-
border-width: 0;
|
614
|
+
position: absolute !important;
|
615
|
+
width: 1px !important;
|
616
|
+
height: 1px !important;
|
617
|
+
padding: 0 !important;
|
618
|
+
margin: -1px !important;
|
619
|
+
overflow: hidden !important;
|
620
|
+
clip: rect(0, 0, 0, 0) !important;
|
621
|
+
white-space: nowrap !important;
|
622
|
+
border-width: 0 !important;
|
623
623
|
}
|
624
624
|
.pointer-events-none {
|
625
|
-
pointer-events: none;
|
625
|
+
pointer-events: none !important;
|
626
626
|
}
|
627
627
|
.fixed {
|
628
|
-
position: fixed;
|
628
|
+
position: fixed !important;
|
629
629
|
}
|
630
630
|
.absolute {
|
631
|
-
position: absolute;
|
631
|
+
position: absolute !important;
|
632
632
|
}
|
633
633
|
.relative {
|
634
|
-
position: relative;
|
634
|
+
position: relative !important;
|
635
635
|
}
|
636
636
|
.inset-0 {
|
637
|
-
top: 0px;
|
638
|
-
right: 0px;
|
639
|
-
bottom: 0px;
|
640
|
-
left: 0px;
|
637
|
+
top: 0px !important;
|
638
|
+
right: 0px !important;
|
639
|
+
bottom: 0px !important;
|
640
|
+
left: 0px !important;
|
641
641
|
}
|
642
642
|
.inset-y-0 {
|
643
|
-
top: 0px;
|
644
|
-
bottom: 0px;
|
643
|
+
top: 0px !important;
|
644
|
+
bottom: 0px !important;
|
645
645
|
}
|
646
646
|
.right-0 {
|
647
|
-
right: 0px;
|
647
|
+
right: 0px !important;
|
648
648
|
}
|
649
649
|
.z-10 {
|
650
|
-
z-index: 10;
|
650
|
+
z-index: 10 !important;
|
651
651
|
}
|
652
652
|
.z-40 {
|
653
|
-
z-index: 40;
|
653
|
+
z-index: 40 !important;
|
654
654
|
}
|
655
655
|
.mx-auto {
|
656
|
-
margin-left: auto;
|
657
|
-
margin-right: auto;
|
656
|
+
margin-left: auto !important;
|
657
|
+
margin-right: auto !important;
|
658
658
|
}
|
659
659
|
.my-6 {
|
660
|
-
margin-top: 1.5rem;
|
661
|
-
margin-bottom: 1.5rem;
|
660
|
+
margin-top: 1.5rem !important;
|
661
|
+
margin-bottom: 1.5rem !important;
|
662
662
|
}
|
663
663
|
.-mr-3 {
|
664
|
-
margin-right: -0.75rem;
|
664
|
+
margin-right: -0.75rem !important;
|
665
665
|
}
|
666
666
|
.-mt-3 {
|
667
|
-
margin-top: -0.75rem;
|
667
|
+
margin-top: -0.75rem !important;
|
668
668
|
}
|
669
669
|
.mb-0 {
|
670
|
-
margin-bottom: 0px;
|
670
|
+
margin-bottom: 0px !important;
|
671
671
|
}
|
672
672
|
.mb-2 {
|
673
|
-
margin-bottom: 0.5rem;
|
673
|
+
margin-bottom: 0.5rem !important;
|
674
674
|
}
|
675
675
|
.ml-3 {
|
676
|
-
margin-left: 0.75rem;
|
676
|
+
margin-left: 0.75rem !important;
|
677
677
|
}
|
678
678
|
.ml-auto {
|
679
|
-
margin-left: auto;
|
679
|
+
margin-left: auto !important;
|
680
680
|
}
|
681
681
|
.mr-2 {
|
682
|
-
margin-right: 0.5rem;
|
682
|
+
margin-right: 0.5rem !important;
|
683
683
|
}
|
684
684
|
.mt-1 {
|
685
|
-
margin-top: 0.25rem;
|
685
|
+
margin-top: 0.25rem !important;
|
686
686
|
}
|
687
687
|
.block {
|
688
|
-
display: block;
|
688
|
+
display: block !important;
|
689
689
|
}
|
690
690
|
.inline {
|
691
|
-
display: inline;
|
691
|
+
display: inline !important;
|
692
692
|
}
|
693
693
|
.flex {
|
694
|
-
display: flex;
|
694
|
+
display: flex !important;
|
695
695
|
}
|
696
696
|
.hidden {
|
697
|
-
display: none;
|
697
|
+
display: none !important;
|
698
698
|
}
|
699
699
|
.w-169 {
|
700
|
-
width: 169px;
|
700
|
+
width: 169px !important;
|
701
701
|
}
|
702
702
|
.w-full {
|
703
|
-
width: 100
|
703
|
+
width: 100% !important;
|
704
704
|
}
|
705
705
|
.w-modal-sm {
|
706
|
-
width: 25rem;
|
706
|
+
width: 25rem !important;
|
707
707
|
}
|
708
708
|
.cursor-default {
|
709
|
-
cursor: default;
|
709
|
+
cursor: default !important;
|
710
710
|
}
|
711
711
|
.select-none {
|
712
|
-
user-select: none;
|
712
|
+
user-select: none !important;
|
713
713
|
}
|
714
714
|
.items-center {
|
715
|
-
align-items: center;
|
715
|
+
align-items: center !important;
|
716
716
|
}
|
717
717
|
.divide-y > :not([hidden]) ~ :not([hidden]) {
|
718
|
-
--tw-divide-y-reverse: 0;
|
719
|
-
border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));
|
720
|
-
border-bottom-width: calc(1px * var(--tw-divide-y-reverse));
|
718
|
+
--tw-divide-y-reverse: 0 !important;
|
719
|
+
border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse))) !important;
|
720
|
+
border-bottom-width: calc(1px * var(--tw-divide-y-reverse)) !important;
|
721
721
|
}
|
722
722
|
.divide-gray-100 > :not([hidden]) ~ :not([hidden]) {
|
723
|
-
--tw-divide-opacity: 1;
|
724
|
-
border-color: rgb(245 245 245 / var(--tw-divide-opacity));
|
723
|
+
--tw-divide-opacity: 1 !important;
|
724
|
+
border-color: rgb(245 245 245 / var(--tw-divide-opacity)) !important;
|
725
725
|
}
|
726
726
|
.overflow-auto {
|
727
|
-
overflow: auto;
|
727
|
+
overflow: auto !important;
|
728
728
|
}
|
729
729
|
.truncate {
|
730
|
-
overflow: hidden;
|
731
|
-
text-overflow: ellipsis;
|
732
|
-
white-space: nowrap;
|
730
|
+
overflow: hidden !important;
|
731
|
+
text-overflow: ellipsis !important;
|
732
|
+
white-space: nowrap !important;
|
733
733
|
}
|
734
734
|
.rounded {
|
735
|
-
border-radius: 4px;
|
735
|
+
border-radius: 4px !important;
|
736
736
|
}
|
737
737
|
.rounded-lg {
|
738
|
-
border-radius: 0.5rem;
|
738
|
+
border-radius: 0.5rem !important;
|
739
739
|
}
|
740
740
|
.border-0 {
|
741
|
-
border-width: 0px;
|
741
|
+
border-width: 0px !important;
|
742
742
|
}
|
743
743
|
.border-2 {
|
744
|
-
border-width: 2px;
|
744
|
+
border-width: 2px !important;
|
745
745
|
}
|
746
746
|
.border-gray-300 {
|
747
|
-
--tw-border-opacity: 1;
|
748
|
-
border-color: rgb(224 224 224 / var(--tw-border-opacity));
|
747
|
+
--tw-border-opacity: 1 !important;
|
748
|
+
border-color: rgb(224 224 224 / var(--tw-border-opacity)) !important;
|
749
749
|
}
|
750
750
|
.bg-black {
|
751
|
-
--tw-bg-opacity: 1;
|
752
|
-
background-color: rgb(0 0 0 / var(--tw-bg-opacity));
|
751
|
+
--tw-bg-opacity: 1 !important;
|
752
|
+
background-color: rgb(0 0 0 / var(--tw-bg-opacity)) !important;
|
753
753
|
}
|
754
754
|
.bg-blue-300 {
|
755
|
-
--tw-bg-opacity: 1;
|
756
|
-
background-color: rgb(7 116 210 / var(--tw-bg-opacity));
|
755
|
+
--tw-bg-opacity: 1 !important;
|
756
|
+
background-color: rgb(7 116 210 / var(--tw-bg-opacity)) !important;
|
757
757
|
}
|
758
758
|
.bg-gray-100 {
|
759
|
-
--tw-bg-opacity: 1;
|
760
|
-
background-color: rgb(245 245 245 / var(--tw-bg-opacity));
|
759
|
+
--tw-bg-opacity: 1 !important;
|
760
|
+
background-color: rgb(245 245 245 / var(--tw-bg-opacity)) !important;
|
761
761
|
}
|
762
762
|
.bg-gray-200 {
|
763
|
-
--tw-bg-opacity: 1;
|
764
|
-
background-color: rgb(237 237 237 / var(--tw-bg-opacity));
|
763
|
+
--tw-bg-opacity: 1 !important;
|
764
|
+
background-color: rgb(237 237 237 / var(--tw-bg-opacity)) !important;
|
765
765
|
}
|
766
766
|
.bg-transparent {
|
767
|
-
background-color: transparent;
|
767
|
+
background-color: transparent !important;
|
768
768
|
}
|
769
769
|
.bg-white {
|
770
|
-
--tw-bg-opacity: 1;
|
771
|
-
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
770
|
+
--tw-bg-opacity: 1 !important;
|
771
|
+
background-color: rgb(255 255 255 / var(--tw-bg-opacity)) !important;
|
772
772
|
}
|
773
773
|
.p-6 {
|
774
|
-
padding: 1.5rem;
|
774
|
+
padding: 1.5rem !important;
|
775
775
|
}
|
776
776
|
.px-3 {
|
777
|
-
padding-left: 0.75rem;
|
778
|
-
padding-right: 0.75rem;
|
777
|
+
padding-left: 0.75rem !important;
|
778
|
+
padding-right: 0.75rem !important;
|
779
779
|
}
|
780
780
|
.py-2 {
|
781
|
-
padding-top: 0.5rem;
|
782
|
-
padding-bottom: 0.5rem;
|
781
|
+
padding-top: 0.5rem !important;
|
782
|
+
padding-bottom: 0.5rem !important;
|
783
783
|
}
|
784
784
|
.pb-2 {
|
785
|
-
padding-bottom: 0.5rem;
|
785
|
+
padding-bottom: 0.5rem !important;
|
786
786
|
}
|
787
787
|
.pl-3 {
|
788
|
-
padding-left: 0.75rem;
|
788
|
+
padding-left: 0.75rem !important;
|
789
789
|
}
|
790
790
|
.pr-10 {
|
791
|
-
padding-right: 2.5rem;
|
791
|
+
padding-right: 2.5rem !important;
|
792
792
|
}
|
793
793
|
.pr-2 {
|
794
|
-
padding-right: 0.5rem;
|
794
|
+
padding-right: 0.5rem !important;
|
795
795
|
}
|
796
796
|
.pt-3 {
|
797
|
-
padding-top: 0.75rem;
|
797
|
+
padding-top: 0.75rem !important;
|
798
798
|
}
|
799
799
|
.text-heading-2 {
|
800
|
-
font-size: 1.25rem;
|
801
|
-
line-height: 1.5rem;
|
800
|
+
font-size: 1.25rem !important;
|
801
|
+
line-height: 1.5rem !important;
|
802
802
|
}
|
803
803
|
.text-md {
|
804
|
-
font-size: 0.875rem;
|
804
|
+
font-size: 0.875rem !important;
|
805
805
|
}
|
806
806
|
.font-semibold {
|
807
|
-
font-weight: 600;
|
807
|
+
font-weight: 600 !important;
|
808
808
|
}
|
809
809
|
.italic {
|
810
|
-
font-style: italic;
|
810
|
+
font-style: italic !important;
|
811
811
|
}
|
812
812
|
.text-gray-500 {
|
813
|
-
--tw-text-opacity: 1;
|
814
|
-
color: rgb(148 148 148 / var(--tw-text-opacity));
|
813
|
+
--tw-text-opacity: 1 !important;
|
814
|
+
color: rgb(148 148 148 / var(--tw-text-opacity)) !important;
|
815
815
|
}
|
816
816
|
.text-gray-600 {
|
817
|
-
--tw-text-opacity: 1;
|
818
|
-
color: rgb(112 112 112 / var(--tw-text-opacity));
|
817
|
+
--tw-text-opacity: 1 !important;
|
818
|
+
color: rgb(112 112 112 / var(--tw-text-opacity)) !important;
|
819
819
|
}
|
820
820
|
.text-gray-700 {
|
821
|
-
--tw-text-opacity: 1;
|
822
|
-
color: rgb(79 79 79 / var(--tw-text-opacity));
|
821
|
+
--tw-text-opacity: 1 !important;
|
822
|
+
color: rgb(79 79 79 / var(--tw-text-opacity)) !important;
|
823
823
|
}
|
824
824
|
.text-gray-800 {
|
825
|
-
--tw-text-opacity: 1;
|
826
|
-
color: rgb(61 61 61 / var(--tw-text-opacity));
|
825
|
+
--tw-text-opacity: 1 !important;
|
826
|
+
color: rgb(61 61 61 / var(--tw-text-opacity)) !important;
|
827
827
|
}
|
828
828
|
.text-gray-900 {
|
829
|
-
--tw-text-opacity: 1;
|
830
|
-
color: rgb(43 43 43 / var(--tw-text-opacity));
|
829
|
+
--tw-text-opacity: 1 !important;
|
830
|
+
color: rgb(43 43 43 / var(--tw-text-opacity)) !important;
|
831
831
|
}
|
832
832
|
.text-white {
|
833
|
-
--tw-text-opacity: 1;
|
834
|
-
color: rgb(255 255 255 / var(--tw-text-opacity));
|
833
|
+
--tw-text-opacity: 1 !important;
|
834
|
+
color: rgb(255 255 255 / var(--tw-text-opacity)) !important;
|
835
835
|
}
|
836
836
|
.underline {
|
837
|
-
text-decoration-line: underline;
|
837
|
+
text-decoration-line: underline !important;
|
838
838
|
}
|
839
839
|
.opacity-25 {
|
840
|
-
opacity: 0.25;
|
840
|
+
opacity: 0.25 !important;
|
841
841
|
}
|
842
842
|
.shadow {
|
843
|
-
--tw-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 1px 12px 4px rgba(0,0,0,0.12);
|
844
|
-
--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color), 0 1px 12px 4px var(--tw-shadow-color);
|
843
|
+
--tw-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 1px 12px 4px rgba(0,0,0,0.12) !important;
|
844
|
+
--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color), 0 1px 12px 4px var(--tw-shadow-color) !important;
|
845
845
|
box-shadow:
|
846
846
|
var(--tw-ring-offset-shadow, 0 0 #0000),
|
847
847
|
var(--tw-ring-shadow, 0 0 #0000),
|
848
|
-
var(--tw-shadow);
|
848
|
+
var(--tw-shadow) !important;
|
849
849
|
}
|
850
850
|
.outline-none {
|
851
|
-
outline: 2px solid transparent;
|
852
|
-
outline-offset: 2px;
|
851
|
+
outline: 2px solid transparent !important;
|
852
|
+
outline-offset: 2px !important;
|
853
853
|
}
|
854
|
-
.
|
854
|
+
.squiz-fte-form-group {
|
855
855
|
display: flex;
|
856
856
|
flex-direction: column;
|
857
857
|
}
|
858
|
-
.
|
858
|
+
.squiz-fte-form-label {
|
859
859
|
margin-bottom: 0.25rem;
|
860
860
|
font-size: 0.875rem;
|
861
861
|
font-weight: 600;
|
862
862
|
--tw-text-opacity: 1;
|
863
863
|
color: rgb(112 112 112 / var(--tw-text-opacity));
|
864
864
|
}
|
865
|
-
.
|
865
|
+
.squiz-fte-form-control {
|
866
866
|
padding: 6px 12px;
|
867
867
|
position: relative;
|
868
868
|
width: 100%;
|
@@ -876,23 +876,23 @@ input[type=range]::-ms-fill-lower {
|
|
876
876
|
--tw-text-opacity: 1;
|
877
877
|
color: rgb(61 61 61 / var(--tw-text-opacity));
|
878
878
|
}
|
879
|
-
.
|
879
|
+
.squiz-fte-form-control::placeholder {
|
880
880
|
--tw-placeholder-opacity: 1;
|
881
881
|
color: rgb(203 213 225 / var(--tw-placeholder-opacity));
|
882
882
|
}
|
883
|
-
.
|
883
|
+
.squiz-fte-form-control {
|
884
884
|
outline-width: 0px;
|
885
885
|
}
|
886
|
-
.
|
886
|
+
.squiz-fte-form-control:focus {
|
887
887
|
--tw-border-opacity: 1;
|
888
888
|
border-color: rgb(7 116 210 / var(--tw-border-opacity));
|
889
889
|
outline-width: 0px;
|
890
890
|
}
|
891
|
-
.
|
892
|
-
.
|
891
|
+
.squiz-fte-form-control:focus,
|
892
|
+
.squiz-fte-form-control:active {
|
893
893
|
box-shadow: none;
|
894
894
|
}
|
895
|
-
.
|
895
|
+
.squiz-fte-btn {
|
896
896
|
border-radius: 4px;
|
897
897
|
font-weight: 400;
|
898
898
|
transition-property: all;
|
@@ -910,8 +910,8 @@ input[type=range]::-ms-fill-lower {
|
|
910
910
|
border: 1px solid transparent;
|
911
911
|
padding: 6px 12px;
|
912
912
|
}
|
913
|
-
.
|
914
|
-
.
|
913
|
+
.squiz-fte-btn.disabled,
|
914
|
+
.squiz-fte-btn[disabled] {
|
915
915
|
cursor: not-allowed;
|
916
916
|
opacity: 0.5;
|
917
917
|
}
|
@@ -1024,8 +1024,10 @@ a {
|
|
1024
1024
|
margin-right: 0.25rem;
|
1025
1025
|
border-width: 1px;
|
1026
1026
|
margin-right: 2px;
|
1027
|
+
height: auto;
|
1027
1028
|
}
|
1028
|
-
.
|
1029
|
+
.squiz-fte-scope__floating-popover {
|
1030
|
+
display: flex;
|
1029
1031
|
border-radius: 6px;
|
1030
1032
|
border-width: 1px;
|
1031
1033
|
--tw-border-opacity: 1;
|
@@ -1062,6 +1064,7 @@ a {
|
|
1062
1064
|
color: rgb(7 116 210 / var(--tw-text-opacity));
|
1063
1065
|
}
|
1064
1066
|
.toolbar-dropdown__button {
|
1067
|
+
display: flex;
|
1065
1068
|
font-family:
|
1066
1069
|
Open Sans,
|
1067
1070
|
Arial,
|
@@ -1071,6 +1074,7 @@ a {
|
|
1071
1074
|
--tw-text-opacity: 1;
|
1072
1075
|
color: rgb(112 112 112 / var(--tw-text-opacity));
|
1073
1076
|
align-self: center;
|
1077
|
+
align-items: center;
|
1074
1078
|
height: 2rem;
|
1075
1079
|
padding-left: 0.5rem;
|
1076
1080
|
}
|
@@ -1103,7 +1107,7 @@ a {
|
|
1103
1107
|
--tw-text-opacity: 1;
|
1104
1108
|
color: rgb(112 112 112 / var(--tw-text-opacity));
|
1105
1109
|
}
|
1106
|
-
.
|
1110
|
+
.squiz-fte-modal {
|
1107
1111
|
display: flex;
|
1108
1112
|
width: 100%;
|
1109
1113
|
flex-direction: column;
|
@@ -1122,7 +1126,7 @@ a {
|
|
1122
1126
|
var(--tw-shadow);
|
1123
1127
|
border-radius: 8px;
|
1124
1128
|
}
|
1125
|
-
.
|
1129
|
+
.squiz-fte-modal-wrapper {
|
1126
1130
|
position: fixed;
|
1127
1131
|
top: 0px;
|
1128
1132
|
right: 0px;
|
@@ -1137,29 +1141,29 @@ a {
|
|
1137
1141
|
outline: 2px solid transparent;
|
1138
1142
|
outline-offset: 2px;
|
1139
1143
|
}
|
1140
|
-
.
|
1144
|
+
.squiz-fte-modal-wrapper:focus {
|
1141
1145
|
outline: 2px solid transparent;
|
1142
1146
|
outline-offset: 2px;
|
1143
1147
|
}
|
1144
|
-
.
|
1148
|
+
.squiz-fte-modal-header {
|
1145
1149
|
display: flex;
|
1146
1150
|
align-items: flex-start;
|
1147
1151
|
justify-content: space-between;
|
1148
1152
|
}
|
1149
|
-
.
|
1153
|
+
.squiz-fte-modal-content {
|
1150
1154
|
position: relative;
|
1151
1155
|
flex: 1 1 auto;
|
1152
1156
|
padding-left: 1.5rem;
|
1153
1157
|
padding-right: 1.5rem;
|
1154
1158
|
}
|
1155
|
-
.
|
1159
|
+
.squiz-fte-modal-footer {
|
1156
1160
|
display: flex;
|
1157
1161
|
align-items: center;
|
1158
1162
|
justify-content: flex-end;
|
1159
1163
|
border-bottom-right-radius: 4px;
|
1160
1164
|
border-bottom-left-radius: 4px;
|
1161
1165
|
}
|
1162
|
-
.
|
1166
|
+
.squiz-fte-modal-footer__button {
|
1163
1167
|
font-size: 0.875rem;
|
1164
1168
|
border-radius: 4px;
|
1165
1169
|
font-weight: 400;
|
@@ -1178,32 +1182,32 @@ a {
|
|
1178
1182
|
border: 1px solid transparent;
|
1179
1183
|
padding: 6px 12px;
|
1180
1184
|
}
|
1181
|
-
.
|
1182
|
-
.
|
1185
|
+
.squiz-fte-modal-footer__button.disabled,
|
1186
|
+
.squiz-fte-modal-footer__button[disabled] {
|
1183
1187
|
cursor: not-allowed;
|
1184
1188
|
opacity: 0.5;
|
1185
1189
|
}
|
1186
1190
|
.hover\:bg-blue-400:hover {
|
1187
|
-
--tw-bg-opacity: 1;
|
1188
|
-
background-color: rgb(4 73 133 / var(--tw-bg-opacity));
|
1191
|
+
--tw-bg-opacity: 1 !important;
|
1192
|
+
background-color: rgb(4 73 133 / var(--tw-bg-opacity)) !important;
|
1189
1193
|
}
|
1190
1194
|
.hover\:bg-gray-100:hover {
|
1191
|
-
--tw-bg-opacity: 1;
|
1192
|
-
background-color: rgb(245 245 245 / var(--tw-bg-opacity));
|
1195
|
+
--tw-bg-opacity: 1 !important;
|
1196
|
+
background-color: rgb(245 245 245 / var(--tw-bg-opacity)) !important;
|
1193
1197
|
}
|
1194
1198
|
.hover\:bg-gray-300:hover {
|
1195
|
-
--tw-bg-opacity: 1;
|
1196
|
-
background-color: rgb(224 224 224 / var(--tw-bg-opacity));
|
1199
|
+
--tw-bg-opacity: 1 !important;
|
1200
|
+
background-color: rgb(224 224 224 / var(--tw-bg-opacity)) !important;
|
1197
1201
|
}
|
1198
1202
|
.focus\:border-blue-300:focus {
|
1199
|
-
--tw-border-opacity: 1;
|
1200
|
-
border-color: rgb(7 116 210 / var(--tw-border-opacity));
|
1203
|
+
--tw-border-opacity: 1 !important;
|
1204
|
+
border-color: rgb(7 116 210 / var(--tw-border-opacity)) !important;
|
1201
1205
|
}
|
1202
1206
|
.focus\:outline-none:focus {
|
1203
|
-
outline: 2px solid transparent;
|
1204
|
-
outline-offset: 2px;
|
1207
|
+
outline: 2px solid transparent !important;
|
1208
|
+
outline-offset: 2px !important;
|
1205
1209
|
}
|
1206
1210
|
.dark .dark\:bg-gray-700 {
|
1207
|
-
--tw-bg-opacity: 1;
|
1208
|
-
background-color: rgb(79 79 79 / var(--tw-bg-opacity));
|
1211
|
+
--tw-bg-opacity: 1 !important;
|
1212
|
+
background-color: rgb(79 79 79 / var(--tw-bg-opacity)) !important;
|
1209
1213
|
}
|
@@ -6,7 +6,7 @@ import clsx from 'clsx';
|
|
6
6
|
export const Select = ({ id, label, value, options }) => {
|
7
7
|
const [selectedOption, setSelectedOption] = useState(value);
|
8
8
|
return (React.createElement(React.Fragment, null,
|
9
|
-
label && (React.createElement("label", { htmlFor: id, className: "
|
9
|
+
label && (React.createElement("label", { htmlFor: id, className: "squiz-fte-form-label" }, label)),
|
10
10
|
React.createElement("div", { className: "relative text-md text-gray-800" },
|
11
11
|
React.createElement(Listbox, { value: selectedOption, onChange: setSelectedOption, name: id, "aria-labelledby": id }, ({ open }) => (React.createElement(React.Fragment, null,
|
12
12
|
React.createElement(Listbox.Label, { className: "sr-only" }, label),
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
export const TextInput = ({ id, label, value, ...rest }) => {
|
3
3
|
return (React.createElement(React.Fragment, null,
|
4
|
-
label && (React.createElement("label", { htmlFor: id, className: "
|
5
|
-
React.createElement("input", { name: id, id: id, type: "text", className: "
|
4
|
+
label && (React.createElement("label", { htmlFor: id, className: "squiz-fte-form-label" }, label)),
|
5
|
+
React.createElement("input", { name: id, id: id, type: "text", className: "squiz-fte-form-control", defaultValue: value, ...rest })));
|
6
6
|
};
|
package/lib/ui/Modal/Modal.js
CHANGED
@@ -14,17 +14,17 @@ const Modal = ({ children, onCancel, onSubmit, className }) => {
|
|
14
14
|
return () => window.removeEventListener('keydown', keydown);
|
15
15
|
}, []);
|
16
16
|
return (React.createElement(React.Fragment, null,
|
17
|
-
React.createElement("div", { className: `
|
17
|
+
React.createElement("div", { className: `squiz-fte-modal-wrapper ${className ? className : ''}` },
|
18
18
|
React.createElement("div", { className: "w-modal-sm my-6 mx-auto" },
|
19
|
-
React.createElement("div", { className: "
|
20
|
-
React.createElement("div", { className: "
|
19
|
+
React.createElement("div", { className: "squiz-fte-modal" },
|
20
|
+
React.createElement("div", { className: "squiz-fte-modal-header p-6 pb-2" },
|
21
21
|
React.createElement("h2", { className: "font-semibold text-gray-900 text-heading-2" }, "Link"),
|
22
22
|
React.createElement("button", { className: "ml-auto -mr-3 -mt-3 bg-transparent border-0 text-gray-600 font-semibold outline-none focus:outline-none hover:text-color-gray-800", onClick: onCancel, "aria-label": "Close" },
|
23
23
|
React.createElement(CloseRoundedIcon, null))),
|
24
|
-
React.createElement("div", { className: "
|
25
|
-
React.createElement("div", { className: "
|
26
|
-
React.createElement("button", { className: "
|
27
|
-
onSubmit && (React.createElement("button", { className: "
|
24
|
+
React.createElement("div", { className: "squiz-fte-modal-content" }, children),
|
25
|
+
React.createElement("div", { className: "squiz-fte-modal-footer p-6 pt-3" },
|
26
|
+
React.createElement("button", { className: "squiz-fte-modal-footer__button bg-gray-200 text-gray-700 mr-2 hover:bg-gray-300", type: "button", onClick: onCancel, "aria-label": "Cancel" }, "Cancel"),
|
27
|
+
onSubmit && (React.createElement("button", { className: "squiz-fte-modal-footer__button bg-blue-300 text-white hover:bg-blue-400", type: "button", onClick: onSubmit, "aria-label": "Apply" }, "Apply")))))),
|
28
28
|
React.createElement("div", { className: "opacity-25 fixed inset-0 z-40 bg-black" })));
|
29
29
|
};
|
30
30
|
export default Modal;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
const ToolbarButton = ({ handleOnClick, isDisabled, isActive, icon, label }) => {
|
3
|
-
return (React.createElement("button", { "aria-label": label, title: label, type: "button", onClick: handleOnClick, disabled: isDisabled, className: `
|
3
|
+
return (React.createElement("button", { "aria-label": label, title: label, type: "button", onClick: handleOnClick, disabled: isDisabled, className: `squiz-fte-btn toolbar-button ${isActive ? 'is-active' : ''}` }, icon));
|
4
4
|
};
|
5
5
|
export default ToolbarButton;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@squiz/formatted-text-editor",
|
3
|
-
"version": "1.12.0-alpha.
|
3
|
+
"version": "1.12.0-alpha.45",
|
4
4
|
"main": "lib/index.js",
|
5
5
|
"types": "lib/index.d.ts",
|
6
6
|
"scripts": {
|
@@ -19,8 +19,9 @@
|
|
19
19
|
"@headlessui/react": "1.7.11",
|
20
20
|
"@mui/icons-material": "5.11.0",
|
21
21
|
"@remirror/react": "2.0.25",
|
22
|
-
"clsx": "
|
23
|
-
"flowbite": "^1.6.3"
|
22
|
+
"clsx": "1.2.1",
|
23
|
+
"flowbite": "^1.6.3",
|
24
|
+
"postcss-prefix-selector": "1.16.0"
|
24
25
|
},
|
25
26
|
"devDependencies": {
|
26
27
|
"@testing-library/cypress": "9.0.0",
|
@@ -64,5 +65,5 @@
|
|
64
65
|
"volta": {
|
65
66
|
"node": "16.19.0"
|
66
67
|
},
|
67
|
-
"gitHead": "
|
68
|
+
"gitHead": "d89e680e3a4435dc0befaa442ffb1a4eb8a1e4b1"
|
68
69
|
}
|
package/postcss.config.js
CHANGED
@@ -1,3 +1,11 @@
|
|
1
1
|
module.exports = {
|
2
|
-
plugins: [
|
2
|
+
plugins: [
|
3
|
+
require('tailwindcss'),
|
4
|
+
require('autoprefixer'),
|
5
|
+
require('postcss-nested'),
|
6
|
+
require('postcss-prefix-selector')({
|
7
|
+
prefix: '.squiz-fte-scope',
|
8
|
+
exclude: ['.squiz-fte-scope__floating-popover'],
|
9
|
+
}),
|
10
|
+
],
|
3
11
|
};
|
@@ -42,7 +42,7 @@ export const EditorToolbar = ({ manager, isPopover }: EditorToolbarProps) => {
|
|
42
42
|
<TriggerLinkModal />
|
43
43
|
</Toolbar>
|
44
44
|
) : (
|
45
|
-
<FloatingToolbar className="
|
45
|
+
<FloatingToolbar className="squiz-fte-scope squiz-fte-scope__floating-popover">
|
46
46
|
{extensionNames.bold && <BoldButton />}
|
47
47
|
{extensionNames.italic && <ItalicButton />}
|
48
48
|
{extensionNames.underline && <UnderlineButton />}
|
@@ -11,7 +11,7 @@ describe('Bold button', () => {
|
|
11
11
|
|
12
12
|
it('Activates the button if clicked', () => {
|
13
13
|
render(<Editor />);
|
14
|
-
expect(screen.getByRole('button', { name: 'Bold (cmd+B)' }).classList.contains('
|
14
|
+
expect(screen.getByRole('button', { name: 'Bold (cmd+B)' }).classList.contains('squiz-fte-btn')).toBeTruthy();
|
15
15
|
const bold = screen.getByRole('button', { name: 'Bold (cmd+B)' });
|
16
16
|
fireEvent.click(bold);
|
17
17
|
expect(bold.classList.contains('is-active')).toBeTruthy();
|
@@ -11,7 +11,7 @@ describe('Italic button', () => {
|
|
11
11
|
|
12
12
|
it('Activates the button if clicked', () => {
|
13
13
|
render(<Editor />);
|
14
|
-
expect(screen.getByRole('button', { name: 'Italic (cmd+I)' }).classList.contains('
|
14
|
+
expect(screen.getByRole('button', { name: 'Italic (cmd+I)' }).classList.contains('squiz-fte-btn')).toBeTruthy();
|
15
15
|
const italic = screen.getByRole('button', { name: 'Italic (cmd+I)' });
|
16
16
|
fireEvent.click(italic);
|
17
17
|
expect(italic.classList.contains('is-active')).toBeTruthy();
|
@@ -15,7 +15,7 @@ describe('Link Form', () => {
|
|
15
15
|
it('Renders the form with the specified class', () => {
|
16
16
|
render(<LinkForm />);
|
17
17
|
|
18
|
-
const formClass = document.querySelector('.
|
18
|
+
const formClass = document.querySelector('.squiz-fte-form');
|
19
19
|
expect(formClass).toBeInTheDocument();
|
20
20
|
});
|
21
21
|
});
|
@@ -21,17 +21,17 @@ const LinkForm = (): ReactElement => {
|
|
21
21
|
};
|
22
22
|
|
23
23
|
return (
|
24
|
-
<form action="" method="post" className="
|
25
|
-
<div className="
|
24
|
+
<form action="" method="post" className="squiz-fte-form">
|
25
|
+
<div className="squiz-fte-form-group mb-2">
|
26
26
|
<TextInput id="href" label="URL" value={formValues.href} onChange={handleChange} />
|
27
27
|
</div>
|
28
|
-
<div className="
|
28
|
+
<div className="squiz-fte-form-group mb-2">
|
29
29
|
<TextInput id="text" label="Text" value={formValues.text} onChange={handleChange} />
|
30
30
|
</div>
|
31
|
-
<div className="
|
31
|
+
<div className="squiz-fte-form-group mb-2">
|
32
32
|
<TextInput id="title" label="Title" value={formValues.title} onChange={handleChange} />
|
33
33
|
</div>
|
34
|
-
<div className="
|
34
|
+
<div className="squiz-fte-form-group mb-0">
|
35
35
|
<Select id="target" label="Target" value={formValues.target} options={selectOptions} />
|
36
36
|
</div>
|
37
37
|
</form>
|
@@ -11,7 +11,7 @@ describe('Underline button', () => {
|
|
11
11
|
|
12
12
|
it('Activates the button if clicked', () => {
|
13
13
|
render(<Editor />);
|
14
|
-
expect(screen.getByRole('button', { name: 'Underline (cmd+U)' }).classList.contains('
|
14
|
+
expect(screen.getByRole('button', { name: 'Underline (cmd+U)' }).classList.contains('squiz-fte-btn')).toBeTruthy();
|
15
15
|
const underline = screen.getByRole('button', { name: 'Underline (cmd+U)' });
|
16
16
|
fireEvent.click(underline);
|
17
17
|
expect(underline.classList.contains('is-active')).toBeTruthy();
|
@@ -11,9 +11,11 @@
|
|
11
11
|
.editor-divider {
|
12
12
|
@apply -my-1 mx-1 border;
|
13
13
|
margin-right: 2px;
|
14
|
+
height: auto;
|
14
15
|
}
|
15
16
|
}
|
16
17
|
|
17
|
-
|
18
|
-
|
18
|
+
/// This class is excluded from the scope of squiz-fte-scope as it is outside of the scoped element
|
19
|
+
.squiz-fte-scope__floating-popover {
|
20
|
+
@apply bg-white border-gray-200 p-1 shadow rounded-md border flex;
|
19
21
|
}
|
@@ -3,8 +3,10 @@ import Editor from './Editor/Editor';
|
|
3
3
|
|
4
4
|
const FormattedTextEditor = () => {
|
5
5
|
return (
|
6
|
-
<div className="
|
7
|
-
<
|
6
|
+
<div className="squiz-fte-scope">
|
7
|
+
<div className="remirror-theme formatted-text-editor editor-wrapper">
|
8
|
+
<Editor />
|
9
|
+
</div>
|
8
10
|
</div>
|
9
11
|
);
|
10
12
|
};
|
package/src/index.scss
CHANGED
@@ -10,11 +10,11 @@ export const TextInput = ({ id, label, value, ...rest }: TextInputProps) => {
|
|
10
10
|
return (
|
11
11
|
<>
|
12
12
|
{label && (
|
13
|
-
<label htmlFor={id} className="
|
13
|
+
<label htmlFor={id} className="squiz-fte-form-label">
|
14
14
|
{label}
|
15
15
|
</label>
|
16
16
|
)}
|
17
|
-
<input name={id} id={id} type="text" className="
|
17
|
+
<input name={id} id={id} type="text" className="squiz-fte-form-control" defaultValue={value} {...rest} />
|
18
18
|
</>
|
19
19
|
);
|
20
20
|
};
|
package/src/ui/Modal/Modal.tsx
CHANGED
@@ -25,10 +25,10 @@ const Modal = ({ children, onCancel, onSubmit, className }: ModalProps): ReactEl
|
|
25
25
|
|
26
26
|
return (
|
27
27
|
<>
|
28
|
-
<div className={`
|
28
|
+
<div className={`squiz-fte-modal-wrapper ${className ? className : ''}`}>
|
29
29
|
<div className="w-modal-sm my-6 mx-auto">
|
30
|
-
<div className="
|
31
|
-
<div className="
|
30
|
+
<div className="squiz-fte-modal">
|
31
|
+
<div className="squiz-fte-modal-header p-6 pb-2">
|
32
32
|
<h2 className="font-semibold text-gray-900 text-heading-2">Link</h2>
|
33
33
|
<button
|
34
34
|
className="ml-auto -mr-3 -mt-3 bg-transparent border-0 text-gray-600 font-semibold outline-none focus:outline-none hover:text-color-gray-800"
|
@@ -38,10 +38,10 @@ const Modal = ({ children, onCancel, onSubmit, className }: ModalProps): ReactEl
|
|
38
38
|
<CloseRoundedIcon />
|
39
39
|
</button>
|
40
40
|
</div>
|
41
|
-
<div className="
|
42
|
-
<div className="
|
41
|
+
<div className="squiz-fte-modal-content">{children}</div>
|
42
|
+
<div className="squiz-fte-modal-footer p-6 pt-3">
|
43
43
|
<button
|
44
|
-
className="
|
44
|
+
className="squiz-fte-modal-footer__button bg-gray-200 text-gray-700 mr-2 hover:bg-gray-300"
|
45
45
|
type="button"
|
46
46
|
onClick={onCancel}
|
47
47
|
aria-label="Cancel"
|
@@ -50,7 +50,7 @@ const Modal = ({ children, onCancel, onSubmit, className }: ModalProps): ReactEl
|
|
50
50
|
</button>
|
51
51
|
{onSubmit && (
|
52
52
|
<button
|
53
|
-
className="
|
53
|
+
className="squiz-fte-modal-footer__button bg-blue-300 text-white hover:bg-blue-400"
|
54
54
|
type="button"
|
55
55
|
onClick={onSubmit}
|
56
56
|
aria-label="Apply"
|
package/src/ui/Modal/_modal.scss
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
.
|
1
|
+
.squiz-fte-modal {
|
2
2
|
@apply border-0 rounded shadow-lg flex flex-col w-full bg-white font-base;
|
3
3
|
border-radius: 8px;
|
4
4
|
|
@@ -18,7 +18,7 @@
|
|
18
18
|
@apply flex items-center justify-end rounded-b;
|
19
19
|
|
20
20
|
&__button {
|
21
|
-
@apply
|
21
|
+
@apply squiz-fte-btn text-md font-bold;
|
22
22
|
}
|
23
23
|
}
|
24
24
|
}
|
@@ -16,7 +16,7 @@ const ToolbarButton = ({ handleOnClick, isDisabled, isActive, icon, label }: Too
|
|
16
16
|
type="button"
|
17
17
|
onClick={handleOnClick}
|
18
18
|
disabled={isDisabled}
|
19
|
-
className={`
|
19
|
+
className={`squiz-fte-btn toolbar-button ${isActive ? 'is-active' : ''}`}
|
20
20
|
>
|
21
21
|
{icon}
|
22
22
|
</button>
|
package/src/ui/_buttons.scss
CHANGED
package/src/ui/_forms.scss
CHANGED