vzcode 2.4.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{index-DuUjtrt6.js → index-Bfp1zhR4.js} +64 -64
- package/dist/assets/{index-BoFeK4GL.css → index-Bjj9VRMn.css} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/src/client/VZCodeContext/types.ts +4 -1
- package/src/client/VZCodeContext/useVZCodeState.ts +91 -3
- package/src/client/VZSidebar/AIChat/index.tsx +3 -1
- package/src/client/VZSidebar/VisualEditor.tsx +367 -118
- package/src/client/VZSidebar/styles.scss +348 -0
- package/src/types.ts +14 -3
|
@@ -585,6 +585,354 @@
|
|
|
585
585
|
font-weight: 400;
|
|
586
586
|
}
|
|
587
587
|
|
|
588
|
+
// Visual Editor Checkbox Styles
|
|
589
|
+
.visual-editor-checkbox {
|
|
590
|
+
display: flex;
|
|
591
|
+
flex-direction: column;
|
|
592
|
+
gap: 8px;
|
|
593
|
+
padding: 12px 10px;
|
|
594
|
+
background: var(--vh-color-neutral-01);
|
|
595
|
+
border: 1px solid var(--vh-color-neutral-02);
|
|
596
|
+
border-radius: 8px;
|
|
597
|
+
transition: all 0.2s ease;
|
|
598
|
+
width: 100%;
|
|
599
|
+
box-sizing: border-box;
|
|
600
|
+
|
|
601
|
+
&:hover {
|
|
602
|
+
border-color: var(--vh-color-neutral-03);
|
|
603
|
+
background: rgba(255, 255, 255, 0.02);
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
.checkbox-header {
|
|
608
|
+
display: flex;
|
|
609
|
+
justify-content: space-between;
|
|
610
|
+
align-items: center;
|
|
611
|
+
margin-bottom: 4px;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
.checkbox-label {
|
|
615
|
+
font-family: var(--vzcode-font-family);
|
|
616
|
+
font-size: 13px;
|
|
617
|
+
font-weight: 500;
|
|
618
|
+
color: var(--vh-color-neutral-04);
|
|
619
|
+
margin: 0;
|
|
620
|
+
cursor: pointer;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
.checkbox-value {
|
|
624
|
+
font-family: var(--vzcode-font-family);
|
|
625
|
+
font-size: 13px;
|
|
626
|
+
font-weight: 600;
|
|
627
|
+
color: #66ecff; // SKY color from theme
|
|
628
|
+
background: rgba(102, 236, 255, 0.1);
|
|
629
|
+
padding: 2px 6px;
|
|
630
|
+
border-radius: 4px;
|
|
631
|
+
min-width: 30px;
|
|
632
|
+
text-align: center;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
.checkbox-container {
|
|
636
|
+
position: relative;
|
|
637
|
+
height: 20px;
|
|
638
|
+
display: flex;
|
|
639
|
+
align-items: center;
|
|
640
|
+
justify-content: center;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
.checkbox-input {
|
|
644
|
+
position: absolute;
|
|
645
|
+
opacity: 0;
|
|
646
|
+
cursor: pointer;
|
|
647
|
+
width: 100%;
|
|
648
|
+
height: 100%;
|
|
649
|
+
margin: 0;
|
|
650
|
+
z-index: 2;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
.checkbox-visual {
|
|
654
|
+
display: flex;
|
|
655
|
+
align-items: center;
|
|
656
|
+
justify-content: center;
|
|
657
|
+
width: 40px;
|
|
658
|
+
height: 20px;
|
|
659
|
+
background: var(--vh-color-neutral-02);
|
|
660
|
+
border-radius: 10px;
|
|
661
|
+
transition: all 0.2s ease;
|
|
662
|
+
cursor: pointer;
|
|
663
|
+
position: relative;
|
|
664
|
+
border: 1px solid var(--vh-color-neutral-03);
|
|
665
|
+
|
|
666
|
+
&:hover {
|
|
667
|
+
border-color: var(--vh-color-neutral-04);
|
|
668
|
+
background: var(--vh-color-neutral-03);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
.checkbox-indicator {
|
|
673
|
+
width: 16px;
|
|
674
|
+
height: 16px;
|
|
675
|
+
background: var(--vh-color-neutral-04);
|
|
676
|
+
border-radius: 50%;
|
|
677
|
+
transition: all 0.2s ease;
|
|
678
|
+
transform: translateX(-8px);
|
|
679
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
680
|
+
|
|
681
|
+
&.checked {
|
|
682
|
+
background: linear-gradient(135deg, #77fd8c, #66ecff);
|
|
683
|
+
transform: translateX(8px);
|
|
684
|
+
box-shadow: 0 2px 6px rgba(119, 253, 140, 0.3);
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
.checkbox-input:focus + .checkbox-visual {
|
|
689
|
+
outline: none;
|
|
690
|
+
box-shadow: 0 0 0 3px rgba(102, 236, 255, 0.3);
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
.checkbox-input:checked + .checkbox-visual {
|
|
694
|
+
background: rgba(119, 253, 140, 0.2);
|
|
695
|
+
border-color: #77fd8c;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
// Visual Editor Dropdown Styles
|
|
699
|
+
.visual-editor-dropdown {
|
|
700
|
+
display: flex;
|
|
701
|
+
flex-direction: column;
|
|
702
|
+
gap: 8px;
|
|
703
|
+
padding: 12px 10px;
|
|
704
|
+
background: var(--vh-color-neutral-01);
|
|
705
|
+
border: 1px solid var(--vh-color-neutral-02);
|
|
706
|
+
border-radius: 8px;
|
|
707
|
+
transition: all 0.2s ease;
|
|
708
|
+
width: 100%;
|
|
709
|
+
box-sizing: border-box;
|
|
710
|
+
|
|
711
|
+
&:hover {
|
|
712
|
+
border-color: var(--vh-color-neutral-03);
|
|
713
|
+
background: rgba(255, 255, 255, 0.02);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
.dropdown-header {
|
|
718
|
+
display: flex;
|
|
719
|
+
justify-content: space-between;
|
|
720
|
+
align-items: center;
|
|
721
|
+
margin-bottom: 4px;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
.dropdown-label {
|
|
725
|
+
font-family: var(--vzcode-font-family);
|
|
726
|
+
font-size: 13px;
|
|
727
|
+
font-weight: 500;
|
|
728
|
+
color: var(--vh-color-neutral-04);
|
|
729
|
+
margin: 0;
|
|
730
|
+
cursor: pointer;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
.dropdown-value {
|
|
734
|
+
font-family: var(--vzcode-font-family);
|
|
735
|
+
font-size: 13px;
|
|
736
|
+
font-weight: 600;
|
|
737
|
+
color: #66ecff; // SKY color from theme
|
|
738
|
+
background: rgba(102, 236, 255, 0.1);
|
|
739
|
+
padding: 2px 6px;
|
|
740
|
+
border-radius: 4px;
|
|
741
|
+
min-width: 60px;
|
|
742
|
+
text-align: center;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
.dropdown-container {
|
|
746
|
+
position: relative;
|
|
747
|
+
height: 36px;
|
|
748
|
+
display: flex;
|
|
749
|
+
align-items: center;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
.dropdown-button {
|
|
753
|
+
width: 100%;
|
|
754
|
+
height: 100%;
|
|
755
|
+
background: var(--vh-color-neutral-02);
|
|
756
|
+
border: 1px solid var(--vh-color-neutral-03);
|
|
757
|
+
border-radius: 6px;
|
|
758
|
+
color: var(--vh-color-neutral-04);
|
|
759
|
+
font-family: var(--vzcode-font-family);
|
|
760
|
+
font-size: 13px;
|
|
761
|
+
font-weight: 500;
|
|
762
|
+
padding: 8px 32px 8px 12px;
|
|
763
|
+
cursor: pointer;
|
|
764
|
+
outline: none;
|
|
765
|
+
transition: all 0.2s ease;
|
|
766
|
+
display: flex;
|
|
767
|
+
align-items: center;
|
|
768
|
+
justify-content: space-between;
|
|
769
|
+
text-align: left;
|
|
770
|
+
|
|
771
|
+
&:hover {
|
|
772
|
+
border-color: var(--vh-color-neutral-04);
|
|
773
|
+
background: var(--vh-color-neutral-03);
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
&:focus {
|
|
777
|
+
border-color: #66ecff;
|
|
778
|
+
background: var(--vh-color-neutral-03);
|
|
779
|
+
box-shadow: 0 0 0 3px rgba(102, 236, 255, 0.3);
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
&.open {
|
|
783
|
+
border-color: #66ecff;
|
|
784
|
+
background: var(--vh-color-neutral-03);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
.dropdown-button-text {
|
|
789
|
+
flex: 1;
|
|
790
|
+
text-overflow: ellipsis;
|
|
791
|
+
overflow: hidden;
|
|
792
|
+
white-space: nowrap;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
.dropdown-arrow {
|
|
796
|
+
color: var(--vh-color-neutral-04);
|
|
797
|
+
transition: all 0.2s ease;
|
|
798
|
+
margin-left: 8px;
|
|
799
|
+
flex-shrink: 0;
|
|
800
|
+
|
|
801
|
+
svg {
|
|
802
|
+
display: block;
|
|
803
|
+
transition: transform 0.2s ease;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
&.open {
|
|
807
|
+
color: #66ecff;
|
|
808
|
+
|
|
809
|
+
svg {
|
|
810
|
+
transform: rotate(180deg);
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
.dropdown-options {
|
|
816
|
+
position: absolute;
|
|
817
|
+
top: 100%;
|
|
818
|
+
left: 0;
|
|
819
|
+
right: 0;
|
|
820
|
+
background: var(--vh-color-neutral-02);
|
|
821
|
+
border: 1px solid var(--vh-color-neutral-03);
|
|
822
|
+
border-radius: 6px;
|
|
823
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
|
824
|
+
z-index: 1000;
|
|
825
|
+
max-height: 200px;
|
|
826
|
+
overflow-y: auto;
|
|
827
|
+
margin-top: 2px;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
.dropdown-option {
|
|
831
|
+
width: 100%;
|
|
832
|
+
padding: 8px 12px;
|
|
833
|
+
background: transparent;
|
|
834
|
+
border: none;
|
|
835
|
+
color: var(--vh-color-neutral-04);
|
|
836
|
+
font-family: var(--vzcode-font-family);
|
|
837
|
+
font-size: 13px;
|
|
838
|
+
font-weight: 500;
|
|
839
|
+
cursor: pointer;
|
|
840
|
+
text-align: left;
|
|
841
|
+
transition: all 0.2s ease;
|
|
842
|
+
display: block;
|
|
843
|
+
|
|
844
|
+
&:hover {
|
|
845
|
+
background: var(--vh-color-neutral-03);
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
&.selected {
|
|
849
|
+
background: linear-gradient(135deg, #77fd8c, #66ecff);
|
|
850
|
+
color: var(--vh-color-neutral-01);
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
&:first-child {
|
|
854
|
+
border-top-left-radius: 6px;
|
|
855
|
+
border-top-right-radius: 6px;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
&:last-child {
|
|
859
|
+
border-bottom-left-radius: 6px;
|
|
860
|
+
border-bottom-right-radius: 6px;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
// Text Input Styles (for consistency)
|
|
865
|
+
.visual-editor-text-input {
|
|
866
|
+
display: flex;
|
|
867
|
+
flex-direction: column;
|
|
868
|
+
gap: 8px;
|
|
869
|
+
padding: 12px 10px;
|
|
870
|
+
background: var(--vh-color-neutral-01);
|
|
871
|
+
border: 1px solid var(--vh-color-neutral-02);
|
|
872
|
+
border-radius: 8px;
|
|
873
|
+
transition: all 0.2s ease;
|
|
874
|
+
width: 100%;
|
|
875
|
+
box-sizing: border-box;
|
|
876
|
+
|
|
877
|
+
&:hover {
|
|
878
|
+
border-color: var(--vh-color-neutral-03);
|
|
879
|
+
background: rgba(255, 255, 255, 0.02);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
.text-input-header {
|
|
884
|
+
display: flex;
|
|
885
|
+
justify-content: space-between;
|
|
886
|
+
align-items: center;
|
|
887
|
+
margin-bottom: 4px;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
.text-input-label {
|
|
891
|
+
font-family: var(--vzcode-font-family);
|
|
892
|
+
font-size: 13px;
|
|
893
|
+
font-weight: 500;
|
|
894
|
+
color: var(--vh-color-neutral-04);
|
|
895
|
+
margin: 0;
|
|
896
|
+
cursor: pointer;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
.text-input-container {
|
|
900
|
+
position: relative;
|
|
901
|
+
height: 36px;
|
|
902
|
+
display: flex;
|
|
903
|
+
align-items: center;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
.text-input-field {
|
|
907
|
+
width: 100%;
|
|
908
|
+
height: 100%;
|
|
909
|
+
background: var(--vh-color-neutral-02);
|
|
910
|
+
border: 1px solid var(--vh-color-neutral-03);
|
|
911
|
+
border-radius: 6px;
|
|
912
|
+
color: var(--vh-color-neutral-04);
|
|
913
|
+
font-family: var(--vzcode-font-family);
|
|
914
|
+
font-size: 13px;
|
|
915
|
+
font-weight: 500;
|
|
916
|
+
padding: 8px 12px;
|
|
917
|
+
outline: none;
|
|
918
|
+
transition: all 0.2s ease;
|
|
919
|
+
|
|
920
|
+
&:hover {
|
|
921
|
+
border-color: var(--vh-color-neutral-04);
|
|
922
|
+
background: var(--vh-color-neutral-03);
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
&:focus {
|
|
926
|
+
border-color: #66ecff;
|
|
927
|
+
background: var(--vh-color-neutral-03);
|
|
928
|
+
box-shadow: 0 0 0 3px rgba(102, 236, 255, 0.3);
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
&::placeholder {
|
|
932
|
+
color: var(--vh-color-neutral-03);
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
|
|
588
936
|
// Empty State Component Styles
|
|
589
937
|
.empty-state {
|
|
590
938
|
display: flex;
|
package/src/types.ts
CHANGED
|
@@ -195,11 +195,22 @@ export type SubmitOperation = (
|
|
|
195
195
|
// A value that has the capacity to be changed in the visual editor
|
|
196
196
|
export type VisualEditorConfigEntry =
|
|
197
197
|
| {
|
|
198
|
-
type: '
|
|
198
|
+
type: 'slider';
|
|
199
199
|
property: string;
|
|
200
200
|
label: string;
|
|
201
201
|
min: number;
|
|
202
202
|
max: number;
|
|
203
|
-
|
|
203
|
+
step?: number;
|
|
204
204
|
}
|
|
205
|
-
| {
|
|
205
|
+
| {
|
|
206
|
+
type: 'checkbox';
|
|
207
|
+
property: string;
|
|
208
|
+
label: string;
|
|
209
|
+
}
|
|
210
|
+
| { type: 'textInput'; property: string; label: string }
|
|
211
|
+
| {
|
|
212
|
+
type: 'dropdown';
|
|
213
|
+
property: string;
|
|
214
|
+
label: string;
|
|
215
|
+
options: string[];
|
|
216
|
+
};
|