@@ -291,7 +291,7 @@ const appStateSlice = createSlice({
291
291
// },
292
292
// state.components = components;
293
293
// state.rootComponents = rootComponents;
294
- // state.nextComponentId = nextComponentId
294
+ state . nextComponentId = nextComponentId
295
295
296
296
297
297
} ,
@@ -412,14 +412,19 @@ const appStateSlice = createSlice({
412
412
state . tailwind ,
413
413
action . payload . contextParam
414
414
) ;
415
- console . log ( 'entered the addchild2' )
415
+
416
416
// return {
417
417
// ...state,
418
418
// components,
419
419
// nextChildId,
420
420
// canvasFocus,
421
421
// nextTopSeparatorId
422
422
// };
423
+ state . components = components ;
424
+ state . nextChildId = nextChildId ;
425
+ state . canvasFocus = canvasFocus ;
426
+ state . nextTopSeparatorId = nextTopSeparatorId ;
427
+
423
428
} ,
424
429
changeTailwind : ( state , action ) => {
425
430
return { ...state , tailwind : action . payload }
@@ -471,7 +476,8 @@ const appStateSlice = createSlice({
471
476
[ ...state . rootComponents ] ,
472
477
state . projectType ,
473
478
state . HTMLTypes ,
474
- state . tailwind
479
+ state . tailwind ,
480
+ action . payload . contextParam
475
481
) ;
476
482
return { ...state , components } ;
477
483
} ,
@@ -527,7 +533,8 @@ const appStateSlice = createSlice({
527
533
[ ...state . rootComponents ] ,
528
534
state . projectType ,
529
535
state . HTMLTypes ,
530
- state . tailwind
536
+ state . tailwind ,
537
+ action . payload . contextParam
531
538
) ;
532
539
return { ...state , components, nextTopSeparatorId } ;
533
540
} ,
@@ -542,7 +549,8 @@ const appStateSlice = createSlice({
542
549
[ ...state . rootComponents ] ,
543
550
state . projectType ,
544
551
state . HTMLTypes ,
545
- state . tailwind
552
+ state . tailwind ,
553
+ action . payload . contextParam
546
554
) ;
547
555
return { ...state , components } ;
548
556
} ,
@@ -565,7 +573,8 @@ const appStateSlice = createSlice({
565
573
[ ...state . rootComponents ] ,
566
574
state . projectType ,
567
575
state . HTMLTypes ,
568
- state . tailwind
576
+ state . tailwind ,
577
+ action . payload . contextParam
569
578
) ;
570
579
return { ...state , components } ;
571
580
} ,
@@ -590,7 +599,8 @@ const appStateSlice = createSlice({
590
599
[ ...state . rootComponents ] ,
591
600
state . projectType ,
592
601
state . HTMLTypes ,
593
- state . tailwind
602
+ state . tailwind ,
603
+ action . payload . contextParam
594
604
) ;
595
605
return { ...state , components } ;
596
606
} ,
@@ -611,7 +621,8 @@ const appStateSlice = createSlice({
611
621
[ ...state . rootComponents ] ,
612
622
state . projectType ,
613
623
state . HTMLTypes ,
614
- state . tailwind
624
+ state . tailwind ,
625
+ action . payload . contextParam
615
626
) ;
616
627
return { ...state , components } ;
617
628
} ,
@@ -664,7 +675,8 @@ const appStateSlice = createSlice({
664
675
rootComponents ,
665
676
state . projectType ,
666
677
state . HTMLTypes ,
667
- state . tailwind
678
+ state . tailwind ,
679
+ action . payload . contextParam
668
680
) ;
669
681
}
670
682
const canvasFocus = { componentId : 1 , childId : null } ;
@@ -698,7 +710,8 @@ const appStateSlice = createSlice({
698
710
[ ...state . rootComponents ] ,
699
711
projectType ,
700
712
state . HTMLTypes ,
701
- state . tailwind
713
+ state . tailwind ,
714
+ action . payload . contextParam
702
715
) ;
703
716
} ) ;
704
717
return { ...state , components, projectType } ;
@@ -756,7 +769,8 @@ const appStateSlice = createSlice({
756
769
rootComponents ,
757
770
state . projectType ,
758
771
state . HTMLTypes ,
759
- state . tailwind
772
+ state . tailwind ,
773
+ action . payload . contextParam
760
774
) ;
761
775
} ) ;
762
776
return {
@@ -808,7 +822,8 @@ const appStateSlice = createSlice({
808
822
[ ...state . rootComponents ] ,
809
823
state . projectType ,
810
824
state . HTMLTypes ,
811
- state . tailwind
825
+ state . tailwind ,
826
+ action . payload . contextParam
812
827
) ;
813
828
return { ...state , components, canvasFocus, nextTopSeparatorId } ;
814
829
} ,
@@ -857,7 +872,8 @@ const appStateSlice = createSlice({
857
872
state . rootComponents ,
858
873
state . projectType ,
859
874
state . HTMLTypes ,
860
- state . tailwind
875
+ state . tailwind ,
876
+ action . payload . contextParam
861
877
) ;
862
878
} ) ;
863
879
return {
@@ -885,7 +901,8 @@ const appStateSlice = createSlice({
885
901
state . rootComponents ,
886
902
state . projectType ,
887
903
state . HTMLTypes ,
888
- state . tailwind
904
+ state . tailwind ,
905
+ action . payload . contextParam
889
906
890
907
) ;
891
908
} ) ;
@@ -910,7 +927,8 @@ const appStateSlice = createSlice({
910
927
[ ...state . rootComponents ] ,
911
928
state . projectType ,
912
929
state . HTMLTypes ,
913
- state . tailwind
930
+ state . tailwind ,
931
+ action . payload . contextParam
914
932
) ;
915
933
return { ...state , components } ;
916
934
} ,
@@ -962,7 +980,8 @@ const appStateSlice = createSlice({
962
980
[ ...state . rootComponents ] ,
963
981
state . projectType ,
964
982
state . HTMLTypes ,
965
- state . tailwind
983
+ state . tailwind ,
984
+ action . payload . contextParam
966
985
) ;
967
986
//update code preview for parent component (since we have added it to the children array)
968
987
parent . code = generateCode (
@@ -971,7 +990,8 @@ const appStateSlice = createSlice({
971
990
[ ...state . rootComponents ] ,
972
991
state . projectType ,
973
992
state . HTMLTypes ,
974
- state . tailwind
993
+ state . tailwind ,
994
+ action . payload . contextParam
975
995
) ;
976
996
977
997
return { ...state , components } ;
@@ -1025,7 +1045,8 @@ const appStateSlice = createSlice({
1025
1045
[ ...state . rootComponents ] ,
1026
1046
state . projectType ,
1027
1047
state . HTMLTypes ,
1028
- state . tailwind
1048
+ state . tailwind ,
1049
+ action . payload . contextParam
1029
1050
) ;
1030
1051
} ;
1031
1052
//delete from the components passedInProps array
@@ -1048,7 +1069,8 @@ const appStateSlice = createSlice({
1048
1069
[ ...state . rootComponents ] ,
1049
1070
state . projectType ,
1050
1071
state . HTMLTypes ,
1051
- state . tailwind
1072
+ state . tailwind ,
1073
+ action . payload . contextParam
1052
1074
) ;
1053
1075
return ;
1054
1076
}
@@ -1070,7 +1092,8 @@ const appStateSlice = createSlice({
1070
1092
[ ...state . rootComponents ] ,
1071
1093
state . projectType ,
1072
1094
state . HTMLTypes ,
1073
- state . tailwind
1095
+ state . tailwind ,
1096
+ action . payload . contextParam
1074
1097
) ;
1075
1098
} ;
1076
1099
@@ -1083,7 +1106,8 @@ const appStateSlice = createSlice({
1083
1106
[ ...state . rootComponents ] ,
1084
1107
state . projectType ,
1085
1108
state . HTMLTypes ,
1086
- state . tailwind
1109
+ state . tailwind ,
1110
+ action . payload . contextParam
1087
1111
) ;
1088
1112
return { ...state , components } ;
1089
1113
} ,
@@ -1186,7 +1210,8 @@ const appStateSlice = createSlice({
1186
1210
[ ...state . rootComponents ] ,
1187
1211
state . projectType ,
1188
1212
state . HTMLTypes ,
1189
- state . tailwind
1213
+ state . tailwind ,
1214
+ action . payload . contextParam
1190
1215
) ;
1191
1216
}
1192
1217
@@ -1197,7 +1222,8 @@ const appStateSlice = createSlice({
1197
1222
[ ...state . rootComponents ] ,
1198
1223
state . projectType ,
1199
1224
state . HTMLTypes ,
1200
- state . tailwind
1225
+ state . tailwind ,
1226
+ action . payload . contextParam
1201
1227
) ;
1202
1228
} ) ;
1203
1229
return { ...state , components } ;
0 commit comments