@almadar/std 14.47.2 → 14.48.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.
@@ -21,14 +21,18 @@
21
21
  "items": {
22
22
  "type": "object",
23
23
  "properties": {
24
- "id": {
25
- "name": "id",
26
- "type": "string"
27
- },
28
24
  "rating": {
29
25
  "name": "rating",
30
26
  "type": "number"
31
27
  },
28
+ "authorName": {
29
+ "name": "authorName",
30
+ "type": "string"
31
+ },
32
+ "avatarIcon": {
33
+ "name": "avatarIcon",
34
+ "type": "string"
35
+ },
32
36
  "comment": {
33
37
  "name": "comment",
34
38
  "type": "string"
@@ -41,12 +45,8 @@
41
45
  "name": "helpful",
42
46
  "type": "number"
43
47
  },
44
- "authorName": {
45
- "name": "authorName",
46
- "type": "string"
47
- },
48
- "avatarIcon": {
49
- "name": "avatarIcon",
48
+ "id": {
49
+ "name": "id",
50
50
  "type": "string"
51
51
  }
52
52
  }
@@ -59,33 +59,33 @@
59
59
  "items": {
60
60
  "type": "object",
61
61
  "properties": {
62
- "rating": {
63
- "name": "rating",
64
- "type": "number"
65
- },
66
62
  "helpful": {
67
63
  "name": "helpful",
68
64
  "type": "number"
69
65
  },
66
+ "rating": {
67
+ "name": "rating",
68
+ "type": "number"
69
+ },
70
70
  "authorName": {
71
71
  "name": "authorName",
72
72
  "type": "string"
73
73
  },
74
- "id": {
75
- "name": "id",
76
- "type": "string"
77
- },
78
74
  "avatarIcon": {
79
75
  "name": "avatarIcon",
80
76
  "type": "string"
81
77
  },
82
- "createdAt": {
83
- "name": "createdAt",
78
+ "id": {
79
+ "name": "id",
84
80
  "type": "string"
85
81
  },
86
82
  "comment": {
87
83
  "name": "comment",
88
84
  "type": "string"
85
+ },
86
+ "createdAt": {
87
+ "name": "createdAt",
88
+ "type": "string"
89
89
  }
90
90
  }
91
91
  }
@@ -416,18 +416,12 @@
416
416
  "authorName",
417
417
  "Guest"
418
418
  ],
419
- "createdAt": [
419
+ "comment": [
420
420
  "object/get",
421
421
  "@row",
422
- "createdAt",
422
+ "comment",
423
423
  ""
424
424
  ],
425
- "avatarIcon": [
426
- "object/get",
427
- "@row",
428
- "avatarIcon",
429
- "user"
430
- ],
431
425
  "helpful": [
432
426
  "object/get",
433
427
  "@row",
@@ -446,11 +440,17 @@
446
440
  "id",
447
441
  ""
448
442
  ],
449
- "comment": [
443
+ "createdAt": [
450
444
  "object/get",
451
445
  "@row",
452
- "comment",
446
+ "createdAt",
453
447
  ""
448
+ ],
449
+ "avatarIcon": [
450
+ "object/get",
451
+ "@row",
452
+ "avatarIcon",
453
+ "user"
454
454
  ]
455
455
  }
456
456
  ]
@@ -520,21 +520,18 @@
520
520
  "render-ui",
521
521
  "main",
522
522
  {
523
- "type": "stack",
524
- "gap": "lg",
525
523
  "direction": "vertical",
524
+ "gap": "lg",
526
525
  "children": [
527
526
  {
528
- "direction": "horizontal",
529
527
  "gap": "md",
530
- "type": "stack",
531
- "align": "center",
532
- "justify": "between",
533
528
  "children": [
534
529
  {
535
- "gap": "xs",
536
530
  "children": [
537
531
  {
532
+ "direction": "horizontal",
533
+ "align": "center",
534
+ "gap": "sm",
538
535
  "children": [
539
536
  {
540
537
  "name": "star",
@@ -551,62 +548,63 @@
551
548
  "type": "typography"
552
549
  },
553
550
  {
554
- "content": "@entity.averageRating",
551
+ "variant": "h3",
555
552
  "type": "typography",
556
- "variant": "h3"
553
+ "content": "@entity.averageRating"
557
554
  },
558
555
  {
559
- "color": "warning",
560
556
  "type": "icon",
557
+ "color": "warning",
561
558
  "name": "star"
562
559
  },
563
560
  {
564
561
  "type": "typography",
565
- "content": "·",
566
- "color": "muted"
562
+ "color": "muted",
563
+ "content": "·"
567
564
  },
568
565
  {
569
566
  "type": "typography",
570
- "variant": "h4",
571
567
  "content": "@entity.totalReviews",
568
+ "variant": "h4",
572
569
  "color": "muted"
573
570
  },
574
571
  {
572
+ "type": "typography",
575
573
  "color": "muted",
576
574
  "content": "reviews",
577
- "type": "typography",
578
575
  "variant": "h4"
579
576
  }
580
577
  ],
581
- "type": "stack",
582
- "align": "center",
583
- "direction": "horizontal",
584
- "gap": "sm"
578
+ "type": "stack"
585
579
  },
586
580
  {
587
- "color": "muted",
581
+ "variant": "caption",
588
582
  "content": "@config.subjectTitle",
589
- "type": "typography",
590
- "variant": "caption"
583
+ "color": "muted",
584
+ "type": "typography"
591
585
  }
592
586
  ],
587
+ "type": "stack",
593
588
  "direction": "vertical",
594
- "type": "stack"
589
+ "gap": "xs"
595
590
  },
596
591
  {
597
- "variant": "primary",
592
+ "label": "@config.writeLabel",
598
593
  "action": "WRITE_REVIEW",
599
- "icon": "edit",
600
594
  "type": "button",
601
- "label": "@config.writeLabel"
595
+ "icon": "edit",
596
+ "variant": "primary"
602
597
  }
603
- ]
598
+ ],
599
+ "direction": "horizontal",
600
+ "type": "stack",
601
+ "justify": "between",
602
+ "align": "center"
604
603
  },
605
604
  {
605
+ "type": "card",
606
606
  "children": [
607
607
  {
608
- "direction": "vertical",
609
- "type": "stack",
610
608
  "children": [
611
609
  {
612
610
  "type": "typography",
@@ -614,76 +612,80 @@
614
612
  "variant": "h4"
615
613
  },
616
614
  {
617
- "fields": [],
618
- "entity": "@entity.starDistribution",
619
- "type": "data-list",
620
- "gap": "sm",
621
615
  "renderItem": [
622
616
  "fn",
623
617
  "bar",
624
618
  {
619
+ "gap": "md",
620
+ "direction": "horizontal",
625
621
  "children": [
626
622
  {
627
- "variant": "caption",
628
623
  "content": "@bar.label",
624
+ "variant": "caption",
629
625
  "type": "typography"
630
626
  },
631
627
  {
632
- "value": "@bar.percentage",
633
628
  "max": 100.0,
634
- "type": "progress-bar",
635
- "variant": "primary"
629
+ "variant": "primary",
630
+ "value": "@bar.percentage",
631
+ "type": "progress-bar"
636
632
  },
637
633
  {
638
634
  "variant": "caption",
639
- "type": "typography",
635
+ "content": "@bar.percentage",
640
636
  "color": "muted",
641
- "content": "@bar.percentage"
637
+ "type": "typography"
642
638
  },
643
639
  {
644
- "variant": "caption",
645
- "type": "typography",
646
640
  "color": "muted",
647
- "content": "%"
641
+ "variant": "caption",
642
+ "content": "%",
643
+ "type": "typography"
648
644
  }
649
645
  ],
650
646
  "align": "center",
651
- "gap": "md",
652
- "type": "stack",
653
- "direction": "horizontal"
647
+ "type": "stack"
654
648
  }
655
- ]
649
+ ],
650
+ "gap": "sm",
651
+ "type": "data-list",
652
+ "entity": "@entity.starDistribution",
653
+ "fields": []
656
654
  }
657
655
  ],
658
- "gap": "sm"
656
+ "direction": "vertical",
657
+ "gap": "sm",
658
+ "type": "stack"
659
659
  }
660
- ],
661
- "type": "card"
660
+ ]
662
661
  },
663
662
  {
664
- "tabs": "@config.sortOptions",
665
- "type": "tabs",
666
663
  "tabChangeEvent": "CHANGE_SORT",
664
+ "type": "tabs",
665
+ "tabs": "@config.sortOptions",
667
666
  "activeTab": "@entity.currentSort"
668
667
  },
669
668
  {
670
669
  "fields": [],
670
+ "entity": "@entity.reviews",
671
+ "gap": "md",
672
+ "type": "data-list",
671
673
  "renderItem": [
672
674
  "fn",
673
675
  "review",
674
676
  {
675
677
  "children": [
676
678
  {
677
- "gap": "sm",
678
- "type": "stack",
679
679
  "direction": "vertical",
680
680
  "children": [
681
681
  {
682
+ "gap": "sm",
682
683
  "align": "center",
684
+ "type": "stack",
683
685
  "children": [
684
686
  {
685
- "type": "icon",
686
- "name": "@review.avatarIcon"
687
+ "name": "@review.avatarIcon",
688
+ "type": "icon"
687
689
  },
688
690
  {
689
691
  "type": "typography",
@@ -691,34 +693,32 @@
691
693
  "weight": "bold"
692
694
  },
693
695
  {
694
- "content": "·",
696
+ "type": "typography",
695
697
  "color": "muted",
696
- "type": "typography"
698
+ "content": "·"
697
699
  },
698
700
  {
699
- "color": "warning",
701
+ "name": "star",
700
702
  "type": "icon",
701
- "name": "star"
703
+ "color": "warning"
702
704
  },
703
705
  {
704
- "type": "typography",
705
706
  "content": "@review.rating",
706
- "weight": "bold"
707
+ "weight": "bold",
708
+ "type": "typography"
707
709
  },
708
710
  {
709
- "content": "·",
710
711
  "color": "muted",
711
- "type": "typography"
712
+ "type": "typography",
713
+ "content": "·"
712
714
  },
713
715
  {
714
716
  "variant": "caption",
715
717
  "type": "typography",
716
- "color": "muted",
717
- "content": "@review.createdAt"
718
+ "content": "@review.createdAt",
719
+ "color": "muted"
718
720
  }
719
721
  ],
720
- "gap": "sm",
721
- "type": "stack",
722
722
  "direction": "horizontal"
723
723
  },
724
724
  {
@@ -728,39 +728,39 @@
728
728
  },
729
729
  {
730
730
  "type": "stack",
731
- "align": "center",
732
731
  "gap": "sm",
733
732
  "children": [
734
733
  {
735
734
  "actionPayload": {
736
735
  "id": "@review.id"
737
736
  },
738
- "action": "MARK_HELPFUL",
739
737
  "type": "button",
740
- "icon": "thumbs-up",
738
+ "action": "MARK_HELPFUL",
741
739
  "variant": "ghost",
740
+ "icon": "thumbs-up",
742
741
  "label": "Helpful"
743
742
  },
744
743
  {
745
744
  "type": "typography",
746
745
  "content": "@review.helpful",
747
- "color": "muted",
748
- "variant": "caption"
746
+ "variant": "caption",
747
+ "color": "muted"
749
748
  }
750
749
  ],
751
- "direction": "horizontal"
750
+ "direction": "horizontal",
751
+ "align": "center"
752
752
  }
753
- ]
753
+ ],
754
+ "type": "stack",
755
+ "gap": "sm"
754
756
  }
755
757
  ],
756
758
  "type": "card"
757
759
  }
758
- ],
759
- "type": "data-list",
760
- "entity": "@entity.reviews",
761
- "gap": "md"
760
+ ]
762
761
  }
763
- ]
762
+ ],
763
+ "type": "stack"
764
764
  }
765
765
  ]
766
766
  ]
@@ -779,9 +779,9 @@
779
779
  "render-ui",
780
780
  "main",
781
781
  {
782
- "type": "error-state",
782
+ "message": "@entity.errorMessage",
783
783
  "title": "Failed to load reviews",
784
- "message": "@entity.errorMessage"
784
+ "type": "error-state"
785
785
  }
786
786
  ]
787
787
  ]
@@ -805,8 +805,8 @@
805
805
  "render-ui",
806
806
  "main",
807
807
  {
808
- "type": "loading-state",
809
- "title": "Refreshing reviews…"
808
+ "title": "Refreshing reviews…",
809
+ "type": "loading-state"
810
810
  }
811
811
  ]
812
812
  ]
@@ -825,9 +825,9 @@
825
825
  "render-ui",
826
826
  "main",
827
827
  {
828
+ "message": "@entity.errorMessage",
828
829
  "type": "error-state",
829
- "title": "Failed to submit",
830
- "message": "@entity.errorMessage"
830
+ "title": "Failed to submit"
831
831
  }
832
832
  ]
833
833
  ]
@@ -855,9 +855,9 @@
855
855
  {
856
856
  "children": [
857
857
  {
858
- "label": "Back",
859
858
  "icon": "arrow-left",
860
859
  "variant": "ghost",
860
+ "label": "Back",
861
861
  "type": "button",
862
862
  "action": "CANCEL_REVIEW"
863
863
  },
@@ -866,9 +866,9 @@
866
866
  "name": "edit"
867
867
  },
868
868
  {
869
- "content": "Write a review",
869
+ "variant": "h3",
870
870
  "type": "typography",
871
- "variant": "h3"
871
+ "content": "Write a review"
872
872
  }
873
873
  ],
874
874
  "direction": "horizontal",
@@ -880,48 +880,48 @@
880
880
  "type": "card",
881
881
  "children": [
882
882
  {
883
- "type": "stack",
884
883
  "direction": "vertical",
885
- "gap": "md",
886
884
  "children": [
887
885
  {
888
- "type": "typography",
886
+ "variant": "caption",
889
887
  "color": "muted",
890
- "content": "@config.subjectTitle",
891
- "variant": "caption"
888
+ "type": "typography",
889
+ "content": "@config.subjectTitle"
892
890
  },
893
891
  {
892
+ "content": "How would you rate it?",
894
893
  "variant": "h4",
895
- "type": "typography",
896
- "content": "How would you rate it?"
894
+ "type": "typography"
897
895
  },
898
896
  {
899
897
  "type": "star-rating",
898
+ "max": 5.0,
900
899
  "action": "RATE_DRAFT",
901
- "value": "@entity.draftRating",
902
- "max": 5.0
900
+ "value": "@entity.draftRating"
903
901
  },
904
902
  {
905
- "content": "Share more details (optional)",
906
903
  "type": "typography",
904
+ "content": "Share more details (optional)",
907
905
  "variant": "h4"
908
906
  },
909
907
  {
910
- "cancelEvent": "CANCEL_REVIEW",
911
908
  "fields": "@config.reviewFields",
912
- "entity": "@entity",
913
- "submitEvent": "SUBMIT_REVIEW",
909
+ "mode": "edit",
910
+ "cancelEvent": "CANCEL_REVIEW",
914
911
  "type": "form-section",
915
912
  "submitLabel": "@config.submitLabel",
916
- "mode": "edit"
913
+ "entity": "@entity",
914
+ "submitEvent": "SUBMIT_REVIEW"
917
915
  }
918
- ]
916
+ ],
917
+ "gap": "md",
918
+ "type": "stack"
919
919
  }
920
920
  ]
921
921
  }
922
922
  ],
923
- "type": "stack",
924
923
  "gap": "md",
924
+ "type": "stack",
925
925
  "direction": "vertical"
926
926
  }
927
927
  ]
@@ -956,41 +956,43 @@
956
956
  "render-ui",
957
957
  "main",
958
958
  {
959
- "direction": "vertical",
959
+ "type": "stack",
960
960
  "children": [
961
961
  {
962
- "direction": "horizontal",
963
- "justify": "between",
964
962
  "type": "stack",
965
- "align": "center",
966
963
  "gap": "md",
964
+ "align": "center",
965
+ "justify": "between",
966
+ "direction": "horizontal",
967
967
  "children": [
968
968
  {
969
+ "type": "stack",
970
+ "direction": "vertical",
971
+ "gap": "xs",
969
972
  "children": [
970
973
  {
971
- "type": "stack",
972
- "direction": "horizontal",
973
974
  "gap": "sm",
974
975
  "align": "center",
976
+ "type": "stack",
975
977
  "children": [
976
978
  {
977
979
  "name": "star",
978
980
  "type": "icon"
979
981
  },
980
982
  {
981
- "variant": "h3",
982
983
  "type": "typography",
983
- "content": "Reviews"
984
+ "content": "Reviews",
985
+ "variant": "h3"
984
986
  },
985
987
  {
986
- "type": "typography",
987
988
  "content": "·",
988
- "color": "muted"
989
+ "color": "muted",
990
+ "type": "typography"
989
991
  },
990
992
  {
991
- "variant": "h3",
993
+ "type": "typography",
992
994
  "content": "@entity.averageRating",
993
- "type": "typography"
995
+ "variant": "h3"
994
996
  },
995
997
  {
996
998
  "type": "icon",
@@ -998,41 +1000,39 @@
998
1000
  "name": "star"
999
1001
  },
1000
1002
  {
1001
- "color": "muted",
1002
1003
  "type": "typography",
1003
- "content": "·"
1004
+ "content": "·",
1005
+ "color": "muted"
1004
1006
  },
1005
1007
  {
1006
- "type": "typography",
1007
1008
  "color": "muted",
1009
+ "content": "@entity.totalReviews",
1008
1010
  "variant": "h4",
1009
- "content": "@entity.totalReviews"
1011
+ "type": "typography"
1010
1012
  },
1011
1013
  {
1012
1014
  "color": "muted",
1013
- "type": "typography",
1014
1015
  "content": "reviews",
1016
+ "type": "typography",
1015
1017
  "variant": "h4"
1016
1018
  }
1017
- ]
1019
+ ],
1020
+ "direction": "horizontal"
1018
1021
  },
1019
1022
  {
1020
1023
  "content": "@config.subjectTitle",
1024
+ "color": "muted",
1021
1025
  "variant": "caption",
1022
- "type": "typography",
1023
- "color": "muted"
1026
+ "type": "typography"
1024
1027
  }
1025
- ],
1026
- "gap": "xs",
1027
- "type": "stack",
1028
- "direction": "vertical"
1028
+ ]
1029
1029
  },
1030
1030
  {
1031
- "action": "WRITE_REVIEW",
1031
+ "type": "button",
1032
1032
  "variant": "primary",
1033
1033
  "label": "@config.writeLabel",
1034
- "icon": "edit",
1035
- "type": "button"
1034
+ "action": "WRITE_REVIEW",
1035
+ "icon": "edit"
1036
1036
  }
1037
1037
  ]
1038
1038
  },
@@ -1040,9 +1040,6 @@
1040
1040
  "type": "card",
1041
1041
  "children": [
1042
1042
  {
1043
- "type": "stack",
1044
- "direction": "vertical",
1045
- "gap": "sm",
1046
1043
  "children": [
1047
1044
  {
1048
1045
  "content": "Rating distribution",
@@ -1050,14 +1047,13 @@
1050
1047
  "type": "typography"
1051
1048
  },
1052
1049
  {
1053
- "entity": "@entity.starDistribution",
1054
1050
  "renderItem": [
1055
1051
  "fn",
1056
1052
  "bar",
1057
1053
  {
1058
- "gap": "md",
1059
- "direction": "horizontal",
1060
1054
  "type": "stack",
1055
+ "direction": "horizontal",
1056
+ "gap": "md",
1061
1057
  "align": "center",
1062
1058
  "children": [
1063
1059
  {
@@ -1066,44 +1062,46 @@
1066
1062
  "type": "typography"
1067
1063
  },
1068
1064
  {
1069
- "type": "progress-bar",
1070
- "value": "@bar.percentage",
1071
1065
  "variant": "primary",
1072
- "max": 100.0
1066
+ "value": "@bar.percentage",
1067
+ "max": 100.0,
1068
+ "type": "progress-bar"
1073
1069
  },
1074
1070
  {
1075
- "type": "typography",
1076
- "content": "@bar.percentage",
1071
+ "variant": "caption",
1077
1072
  "color": "muted",
1078
- "variant": "caption"
1073
+ "type": "typography",
1074
+ "content": "@bar.percentage"
1079
1075
  },
1080
1076
  {
1081
- "type": "typography",
1082
- "variant": "caption",
1083
1077
  "content": "%",
1078
+ "variant": "caption",
1079
+ "type": "typography",
1084
1080
  "color": "muted"
1085
1081
  }
1086
1082
  ]
1087
1083
  }
1088
1084
  ],
1085
+ "fields": [],
1089
1086
  "gap": "sm",
1090
1087
  "type": "data-list",
1091
- "fields": []
1088
+ "entity": "@entity.starDistribution"
1092
1089
  }
1093
- ]
1090
+ ],
1091
+ "direction": "vertical",
1092
+ "type": "stack",
1093
+ "gap": "sm"
1094
1094
  }
1095
1095
  ]
1096
1096
  },
1097
1097
  {
1098
1098
  "type": "tabs",
1099
+ "tabs": "@config.sortOptions",
1099
1100
  "activeTab": "@entity.currentSort",
1100
- "tabChangeEvent": "CHANGE_SORT",
1101
- "tabs": "@config.sortOptions"
1101
+ "tabChangeEvent": "CHANGE_SORT"
1102
1102
  },
1103
1103
  {
1104
1104
  "gap": "md",
1105
- "entity": "@entity.reviews",
1106
- "fields": [],
1107
1105
  "renderItem": [
1108
1106
  "fn",
1109
1107
  "review",
@@ -1116,6 +1114,8 @@
1116
1114
  "type": "stack",
1117
1115
  "children": [
1118
1116
  {
1117
+ "gap": "sm",
1118
+ "type": "stack",
1119
1119
  "align": "center",
1120
1120
  "children": [
1121
1121
  {
@@ -1123,13 +1123,13 @@
1123
1123
  "type": "icon"
1124
1124
  },
1125
1125
  {
1126
- "content": "@review.authorName",
1127
1126
  "weight": "bold",
1128
- "type": "typography"
1127
+ "type": "typography",
1128
+ "content": "@review.authorName"
1129
1129
  },
1130
1130
  {
1131
- "type": "typography",
1132
1131
  "color": "muted",
1132
+ "type": "typography",
1133
1133
  "content": "·"
1134
1134
  },
1135
1135
  {
@@ -1138,25 +1138,23 @@
1138
1138
  "name": "star"
1139
1139
  },
1140
1140
  {
1141
- "weight": "bold",
1141
+ "type": "typography",
1142
1142
  "content": "@review.rating",
1143
- "type": "typography"
1143
+ "weight": "bold"
1144
1144
  },
1145
1145
  {
1146
- "type": "typography",
1146
+ "color": "muted",
1147
1147
  "content": "·",
1148
- "color": "muted"
1148
+ "type": "typography"
1149
1149
  },
1150
1150
  {
1151
1151
  "content": "@review.createdAt",
1152
- "type": "typography",
1153
1152
  "color": "muted",
1153
+ "type": "typography",
1154
1154
  "variant": "caption"
1155
1155
  }
1156
1156
  ],
1157
- "direction": "horizontal",
1158
- "type": "stack",
1159
- "gap": "sm"
1157
+ "direction": "horizontal"
1160
1158
  },
1161
1159
  {
1162
1160
  "variant": "body",
@@ -1164,39 +1162,41 @@
1164
1162
  "content": "@review.comment"
1165
1163
  },
1166
1164
  {
1167
- "type": "stack",
1168
- "gap": "sm",
1169
1165
  "direction": "horizontal",
1166
+ "gap": "sm",
1167
+ "align": "center",
1168
+ "type": "stack",
1170
1169
  "children": [
1171
1170
  {
1172
1171
  "action": "MARK_HELPFUL",
1172
+ "variant": "ghost",
1173
+ "icon": "thumbs-up",
1173
1174
  "type": "button",
1174
1175
  "actionPayload": {
1175
1176
  "id": "@review.id"
1176
1177
  },
1177
- "label": "Helpful",
1178
- "variant": "ghost",
1179
- "icon": "thumbs-up"
1178
+ "label": "Helpful"
1180
1179
  },
1181
1180
  {
1182
- "variant": "caption",
1183
1181
  "type": "typography",
1184
1182
  "content": "@review.helpful",
1185
- "color": "muted"
1183
+ "color": "muted",
1184
+ "variant": "caption"
1186
1185
  }
1187
- ],
1188
- "align": "center"
1186
+ ]
1189
1187
  }
1190
1188
  ]
1191
1189
  }
1192
1190
  ]
1193
1191
  }
1194
1192
  ],
1195
- "type": "data-list"
1193
+ "fields": [],
1194
+ "type": "data-list",
1195
+ "entity": "@entity.reviews"
1196
1196
  }
1197
1197
  ],
1198
- "type": "stack",
1199
- "gap": "lg"
1198
+ "gap": "lg",
1199
+ "direction": "vertical"
1200
1200
  }
1201
1201
  ]
1202
1202
  ]
@@ -1230,23 +1230,21 @@
1230
1230
  "render-ui",
1231
1231
  "main",
1232
1232
  {
1233
- "direction": "vertical",
1234
1233
  "type": "stack",
1234
+ "direction": "vertical",
1235
1235
  "gap": "lg",
1236
1236
  "children": [
1237
1237
  {
1238
- "type": "stack",
1239
1238
  "align": "center",
1239
+ "direction": "horizontal",
1240
1240
  "children": [
1241
1241
  {
1242
1242
  "direction": "vertical",
1243
- "gap": "xs",
1244
1243
  "type": "stack",
1244
+ "gap": "xs",
1245
1245
  "children": [
1246
1246
  {
1247
- "direction": "horizontal",
1248
1247
  "type": "stack",
1249
- "gap": "sm",
1250
1248
  "align": "center",
1251
1249
  "children": [
1252
1250
  {
@@ -1255,18 +1253,18 @@
1255
1253
  },
1256
1254
  {
1257
1255
  "type": "typography",
1258
- "variant": "h3",
1259
- "content": "Reviews"
1256
+ "content": "Reviews",
1257
+ "variant": "h3"
1260
1258
  },
1261
1259
  {
1262
1260
  "color": "muted",
1263
- "type": "typography",
1264
- "content": "·"
1261
+ "content": "·",
1262
+ "type": "typography"
1265
1263
  },
1266
1264
  {
1267
- "variant": "h3",
1265
+ "type": "typography",
1268
1266
  "content": "@entity.averageRating",
1269
- "type": "typography"
1267
+ "variant": "h3"
1270
1268
  },
1271
1269
  {
1272
1270
  "name": "star",
@@ -1274,126 +1272,130 @@
1274
1272
  "color": "warning"
1275
1273
  },
1276
1274
  {
1275
+ "color": "muted",
1277
1276
  "type": "typography",
1278
- "content": "·",
1279
- "color": "muted"
1277
+ "content": "·"
1280
1278
  },
1281
1279
  {
1282
- "type": "typography",
1283
1280
  "content": "@entity.totalReviews",
1284
- "variant": "h4",
1285
- "color": "muted"
1281
+ "type": "typography",
1282
+ "color": "muted",
1283
+ "variant": "h4"
1286
1284
  },
1287
1285
  {
1288
1286
  "type": "typography",
1289
- "content": "reviews",
1287
+ "color": "muted",
1290
1288
  "variant": "h4",
1291
- "color": "muted"
1289
+ "content": "reviews"
1292
1290
  }
1293
- ]
1291
+ ],
1292
+ "direction": "horizontal",
1293
+ "gap": "sm"
1294
1294
  },
1295
1295
  {
1296
1296
  "color": "muted",
1297
+ "type": "typography",
1297
1298
  "variant": "caption",
1298
- "content": "@config.subjectTitle",
1299
- "type": "typography"
1299
+ "content": "@config.subjectTitle"
1300
1300
  }
1301
1301
  ]
1302
1302
  },
1303
1303
  {
1304
+ "action": "WRITE_REVIEW",
1304
1305
  "label": "@config.writeLabel",
1305
1306
  "type": "button",
1306
1307
  "icon": "edit",
1307
- "action": "WRITE_REVIEW",
1308
1308
  "variant": "primary"
1309
1309
  }
1310
1310
  ],
1311
- "gap": "md",
1312
1311
  "justify": "between",
1313
- "direction": "horizontal"
1312
+ "type": "stack",
1313
+ "gap": "md"
1314
1314
  },
1315
1315
  {
1316
+ "type": "card",
1316
1317
  "children": [
1317
1318
  {
1318
- "gap": "sm",
1319
- "type": "stack",
1320
- "direction": "vertical",
1321
1319
  "children": [
1322
1320
  {
1323
1321
  "type": "typography",
1324
- "content": "Rating distribution",
1325
- "variant": "h4"
1322
+ "variant": "h4",
1323
+ "content": "Rating distribution"
1326
1324
  },
1327
1325
  {
1326
+ "type": "data-list",
1328
1327
  "entity": "@entity.starDistribution",
1328
+ "gap": "sm",
1329
+ "fields": [],
1329
1330
  "renderItem": [
1330
1331
  "fn",
1331
1332
  "bar",
1332
1333
  {
1333
- "direction": "horizontal",
1334
+ "type": "stack",
1335
+ "align": "center",
1336
+ "gap": "md",
1334
1337
  "children": [
1335
1338
  {
1336
1339
  "type": "typography",
1337
- "variant": "caption",
1338
- "content": "@bar.label"
1340
+ "content": "@bar.label",
1341
+ "variant": "caption"
1339
1342
  },
1340
1343
  {
1341
- "variant": "primary",
1342
- "value": "@bar.percentage",
1343
1344
  "type": "progress-bar",
1344
- "max": 100.0
1345
+ "variant": "primary",
1346
+ "max": 100.0,
1347
+ "value": "@bar.percentage"
1345
1348
  },
1346
1349
  {
1347
- "color": "muted",
1348
1350
  "content": "@bar.percentage",
1349
1351
  "type": "typography",
1352
+ "color": "muted",
1350
1353
  "variant": "caption"
1351
1354
  },
1352
1355
  {
1353
- "content": "%",
1354
- "color": "muted",
1355
1356
  "type": "typography",
1356
- "variant": "caption"
1357
+ "content": "%",
1358
+ "variant": "caption",
1359
+ "color": "muted"
1357
1360
  }
1358
1361
  ],
1359
- "gap": "md",
1360
- "align": "center",
1361
- "type": "stack"
1362
+ "direction": "horizontal"
1362
1363
  }
1363
- ],
1364
- "fields": [],
1365
- "type": "data-list",
1366
- "gap": "sm"
1364
+ ]
1367
1365
  }
1368
- ]
1366
+ ],
1367
+ "type": "stack",
1368
+ "direction": "vertical",
1369
+ "gap": "sm"
1369
1370
  }
1370
- ],
1371
- "type": "card"
1371
+ ]
1372
1372
  },
1373
1373
  {
1374
1374
  "activeTab": "@entity.currentSort",
1375
- "type": "tabs",
1375
+ "tabChangeEvent": "CHANGE_SORT",
1376
1376
  "tabs": "@config.sortOptions",
1377
- "tabChangeEvent": "CHANGE_SORT"
1377
+ "type": "tabs"
1378
1378
  },
1379
1379
  {
1380
- "fields": [],
1381
- "entity": "@entity.reviews",
1382
1380
  "type": "data-list",
1381
+ "fields": [],
1383
1382
  "renderItem": [
1384
1383
  "fn",
1385
1384
  "review",
1386
1385
  {
1386
+ "type": "card",
1387
1387
  "children": [
1388
1388
  {
1389
- "type": "stack",
1389
+ "direction": "vertical",
1390
1390
  "gap": "sm",
1391
1391
  "children": [
1392
1392
  {
1393
+ "align": "center",
1394
+ "direction": "horizontal",
1393
1395
  "children": [
1394
1396
  {
1395
- "type": "icon",
1396
- "name": "@review.avatarIcon"
1397
+ "name": "@review.avatarIcon",
1398
+ "type": "icon"
1397
1399
  },
1398
1400
  {
1399
1401
  "content": "@review.authorName",
@@ -1406,14 +1408,14 @@
1406
1408
  "type": "typography"
1407
1409
  },
1408
1410
  {
1409
- "color": "warning",
1411
+ "name": "star",
1410
1412
  "type": "icon",
1411
- "name": "star"
1413
+ "color": "warning"
1412
1414
  },
1413
1415
  {
1416
+ "content": "@review.rating",
1414
1417
  "type": "typography",
1415
- "weight": "bold",
1416
- "content": "@review.rating"
1418
+ "weight": "bold"
1417
1419
  },
1418
1420
  {
1419
1421
  "type": "typography",
@@ -1427,48 +1429,46 @@
1427
1429
  "variant": "caption"
1428
1430
  }
1429
1431
  ],
1430
- "align": "center",
1431
- "direction": "horizontal",
1432
1432
  "type": "stack",
1433
1433
  "gap": "sm"
1434
1434
  },
1435
1435
  {
1436
- "content": "@review.comment",
1437
1436
  "type": "typography",
1437
+ "content": "@review.comment",
1438
1438
  "variant": "body"
1439
1439
  },
1440
1440
  {
1441
- "gap": "sm",
1442
- "align": "center",
1443
1441
  "type": "stack",
1444
1442
  "direction": "horizontal",
1443
+ "align": "center",
1445
1444
  "children": [
1446
1445
  {
1447
- "type": "button",
1448
- "label": "Helpful",
1449
1446
  "variant": "ghost",
1447
+ "type": "button",
1448
+ "icon": "thumbs-up",
1450
1449
  "action": "MARK_HELPFUL",
1450
+ "label": "Helpful",
1451
1451
  "actionPayload": {
1452
1452
  "id": "@review.id"
1453
- },
1454
- "icon": "thumbs-up"
1453
+ }
1455
1454
  },
1456
1455
  {
1456
+ "content": "@review.helpful",
1457
1457
  "variant": "caption",
1458
1458
  "color": "muted",
1459
- "type": "typography",
1460
- "content": "@review.helpful"
1459
+ "type": "typography"
1461
1460
  }
1462
- ]
1461
+ ],
1462
+ "gap": "sm"
1463
1463
  }
1464
1464
  ],
1465
- "direction": "vertical"
1465
+ "type": "stack"
1466
1466
  }
1467
- ],
1468
- "type": "card"
1467
+ ]
1469
1468
  }
1470
1469
  ],
1471
- "gap": "md"
1470
+ "gap": "md",
1471
+ "entity": "@entity.reviews"
1472
1472
  }
1473
1473
  ]
1474
1474
  }
@@ -1504,150 +1504,155 @@
1504
1504
  "render-ui",
1505
1505
  "main",
1506
1506
  {
1507
+ "gap": "lg",
1508
+ "direction": "vertical",
1507
1509
  "children": [
1508
1510
  {
1509
- "type": "stack",
1510
1511
  "direction": "horizontal",
1512
+ "justify": "between",
1513
+ "type": "stack",
1514
+ "align": "center",
1511
1515
  "children": [
1512
1516
  {
1513
1517
  "type": "stack",
1514
1518
  "direction": "vertical",
1515
- "gap": "xs",
1516
1519
  "children": [
1517
1520
  {
1518
- "align": "center",
1519
1521
  "direction": "horizontal",
1520
- "gap": "sm",
1521
1522
  "type": "stack",
1523
+ "gap": "sm",
1522
1524
  "children": [
1523
1525
  {
1524
- "type": "icon",
1525
- "name": "star"
1526
+ "name": "star",
1527
+ "type": "icon"
1526
1528
  },
1527
1529
  {
1528
- "type": "typography",
1529
1530
  "content": "Reviews",
1530
- "variant": "h3"
1531
+ "variant": "h3",
1532
+ "type": "typography"
1531
1533
  },
1532
1534
  {
1533
- "type": "typography",
1534
1535
  "content": "·",
1536
+ "type": "typography",
1535
1537
  "color": "muted"
1536
1538
  },
1537
1539
  {
1540
+ "type": "typography",
1538
1541
  "content": "@entity.averageRating",
1539
- "variant": "h3",
1540
- "type": "typography"
1542
+ "variant": "h3"
1541
1543
  },
1542
1544
  {
1543
- "type": "icon",
1544
1545
  "name": "star",
1545
- "color": "warning"
1546
+ "color": "warning",
1547
+ "type": "icon"
1546
1548
  },
1547
1549
  {
1548
- "type": "typography",
1549
1550
  "content": "·",
1550
- "color": "muted"
1551
+ "color": "muted",
1552
+ "type": "typography"
1551
1553
  },
1552
1554
  {
1553
- "color": "muted",
1554
- "content": "@entity.totalReviews",
1555
1555
  "type": "typography",
1556
- "variant": "h4"
1556
+ "variant": "h4",
1557
+ "content": "@entity.totalReviews",
1558
+ "color": "muted"
1557
1559
  },
1558
1560
  {
1559
- "content": "reviews",
1560
1561
  "variant": "h4",
1562
+ "content": "reviews",
1561
1563
  "type": "typography",
1562
1564
  "color": "muted"
1563
1565
  }
1564
- ]
1566
+ ],
1567
+ "align": "center"
1565
1568
  },
1566
1569
  {
1567
1570
  "variant": "caption",
1568
- "content": "@config.subjectTitle",
1569
1571
  "color": "muted",
1572
+ "content": "@config.subjectTitle",
1570
1573
  "type": "typography"
1571
1574
  }
1572
- ]
1575
+ ],
1576
+ "gap": "xs"
1573
1577
  },
1574
1578
  {
1579
+ "variant": "primary",
1575
1580
  "type": "button",
1576
1581
  "action": "WRITE_REVIEW",
1577
- "variant": "primary",
1578
- "icon": "edit",
1579
- "label": "@config.writeLabel"
1582
+ "label": "@config.writeLabel",
1583
+ "icon": "edit"
1580
1584
  }
1581
1585
  ],
1582
- "justify": "between",
1583
- "gap": "md",
1584
- "align": "center"
1586
+ "gap": "md"
1585
1587
  },
1586
1588
  {
1587
- "type": "card",
1588
1589
  "children": [
1589
1590
  {
1590
1591
  "direction": "vertical",
1591
1592
  "children": [
1592
1593
  {
1593
- "content": "Rating distribution",
1594
+ "type": "typography",
1594
1595
  "variant": "h4",
1595
- "type": "typography"
1596
+ "content": "Rating distribution"
1596
1597
  },
1597
1598
  {
1598
- "entity": "@entity.starDistribution",
1599
+ "gap": "sm",
1599
1600
  "fields": [],
1601
+ "type": "data-list",
1602
+ "entity": "@entity.starDistribution",
1600
1603
  "renderItem": [
1601
1604
  "fn",
1602
1605
  "bar",
1603
1606
  {
1604
1607
  "align": "center",
1605
1608
  "type": "stack",
1609
+ "gap": "md",
1606
1610
  "children": [
1607
1611
  {
1608
- "type": "typography",
1609
1612
  "content": "@bar.label",
1610
- "variant": "caption"
1613
+ "variant": "caption",
1614
+ "type": "typography"
1611
1615
  },
1612
1616
  {
1613
- "value": "@bar.percentage",
1614
- "variant": "primary",
1615
1617
  "type": "progress-bar",
1618
+ "variant": "primary",
1619
+ "value": "@bar.percentage",
1616
1620
  "max": 100.0
1617
1621
  },
1618
1622
  {
1623
+ "variant": "caption",
1619
1624
  "color": "muted",
1620
1625
  "type": "typography",
1621
- "variant": "caption",
1622
1626
  "content": "@bar.percentage"
1623
1627
  },
1624
1628
  {
1625
- "content": "%",
1626
- "variant": "caption",
1627
1629
  "type": "typography",
1628
- "color": "muted"
1630
+ "color": "muted",
1631
+ "content": "%",
1632
+ "variant": "caption"
1629
1633
  }
1630
1634
  ],
1631
- "direction": "horizontal",
1632
- "gap": "md"
1635
+ "direction": "horizontal"
1633
1636
  }
1634
- ],
1635
- "type": "data-list",
1636
- "gap": "sm"
1637
+ ]
1637
1638
  }
1638
1639
  ],
1639
1640
  "gap": "sm",
1640
1641
  "type": "stack"
1641
1642
  }
1642
- ]
1643
+ ],
1644
+ "type": "card"
1643
1645
  },
1644
1646
  {
1645
- "tabChangeEvent": "CHANGE_SORT",
1646
1647
  "type": "tabs",
1648
+ "tabs": "@config.sortOptions",
1647
1649
  "activeTab": "@entity.currentSort",
1648
- "tabs": "@config.sortOptions"
1650
+ "tabChangeEvent": "CHANGE_SORT"
1649
1651
  },
1650
1652
  {
1653
+ "entity": "@entity.reviews",
1654
+ "gap": "md",
1655
+ "type": "data-list",
1651
1656
  "renderItem": [
1652
1657
  "fn",
1653
1658
  "review",
@@ -1655,15 +1660,15 @@
1655
1660
  "type": "card",
1656
1661
  "children": [
1657
1662
  {
1658
- "gap": "sm",
1659
- "type": "stack",
1660
1663
  "children": [
1661
1664
  {
1662
1665
  "gap": "sm",
1666
+ "type": "stack",
1667
+ "align": "center",
1663
1668
  "children": [
1664
1669
  {
1665
- "type": "icon",
1666
- "name": "@review.avatarIcon"
1670
+ "name": "@review.avatarIcon",
1671
+ "type": "icon"
1667
1672
  },
1668
1673
  {
1669
1674
  "content": "@review.authorName",
@@ -1672,18 +1677,18 @@
1672
1677
  },
1673
1678
  {
1674
1679
  "type": "typography",
1675
- "content": "·",
1676
- "color": "muted"
1680
+ "color": "muted",
1681
+ "content": "·"
1677
1682
  },
1678
1683
  {
1684
+ "name": "star",
1679
1685
  "type": "icon",
1680
- "color": "warning",
1681
- "name": "star"
1686
+ "color": "warning"
1682
1687
  },
1683
1688
  {
1684
- "weight": "bold",
1685
1689
  "type": "typography",
1686
- "content": "@review.rating"
1690
+ "content": "@review.rating",
1691
+ "weight": "bold"
1687
1692
  },
1688
1693
  {
1689
1694
  "color": "muted",
@@ -1691,59 +1696,54 @@
1691
1696
  "type": "typography"
1692
1697
  },
1693
1698
  {
1694
- "color": "muted",
1695
1699
  "type": "typography",
1696
- "content": "@review.createdAt",
1697
- "variant": "caption"
1700
+ "color": "muted",
1701
+ "variant": "caption",
1702
+ "content": "@review.createdAt"
1698
1703
  }
1699
1704
  ],
1700
- "direction": "horizontal",
1701
- "align": "center",
1702
- "type": "stack"
1705
+ "direction": "horizontal"
1703
1706
  },
1704
1707
  {
1705
- "content": "@review.comment",
1708
+ "variant": "body",
1706
1709
  "type": "typography",
1707
- "variant": "body"
1710
+ "content": "@review.comment"
1708
1711
  },
1709
1712
  {
1710
- "align": "center",
1711
- "direction": "horizontal",
1712
- "gap": "sm",
1713
1713
  "children": [
1714
1714
  {
1715
- "type": "button",
1716
1715
  "action": "MARK_HELPFUL",
1717
- "variant": "ghost",
1718
- "icon": "thumbs-up",
1716
+ "type": "button",
1719
1717
  "label": "Helpful",
1718
+ "variant": "ghost",
1720
1719
  "actionPayload": {
1721
1720
  "id": "@review.id"
1722
- }
1721
+ },
1722
+ "icon": "thumbs-up"
1723
1723
  },
1724
1724
  {
1725
- "color": "muted",
1726
- "variant": "caption",
1727
1725
  "content": "@review.helpful",
1726
+ "variant": "caption",
1727
+ "color": "muted",
1728
1728
  "type": "typography"
1729
1729
  }
1730
1730
  ],
1731
- "type": "stack"
1731
+ "type": "stack",
1732
+ "gap": "sm",
1733
+ "direction": "horizontal",
1734
+ "align": "center"
1732
1735
  }
1733
1736
  ],
1737
+ "gap": "sm",
1738
+ "type": "stack",
1734
1739
  "direction": "vertical"
1735
1740
  }
1736
1741
  ]
1737
1742
  }
1738
1743
  ],
1739
- "gap": "md",
1740
- "type": "data-list",
1741
- "entity": "@entity.reviews",
1742
1744
  "fields": []
1743
1745
  }
1744
1746
  ],
1745
- "direction": "vertical",
1746
- "gap": "lg",
1747
1747
  "type": "stack"
1748
1748
  }
1749
1749
  ]
@@ -1778,78 +1778,78 @@
1778
1778
  "render-ui",
1779
1779
  "main",
1780
1780
  {
1781
- "direction": "vertical",
1782
- "type": "stack",
1783
1781
  "children": [
1784
1782
  {
1783
+ "direction": "horizontal",
1784
+ "gap": "sm",
1785
1785
  "type": "stack",
1786
+ "align": "center",
1786
1787
  "children": [
1787
1788
  {
1789
+ "type": "button",
1788
1790
  "action": "CANCEL_REVIEW",
1789
- "icon": "arrow-left",
1791
+ "label": "Back",
1790
1792
  "variant": "ghost",
1791
- "type": "button",
1792
- "label": "Back"
1793
+ "icon": "arrow-left"
1793
1794
  },
1794
1795
  {
1795
1796
  "type": "icon",
1796
1797
  "name": "edit"
1797
1798
  },
1798
1799
  {
1799
- "variant": "h3",
1800
1800
  "content": "Write a review",
1801
+ "variant": "h3",
1801
1802
  "type": "typography"
1802
1803
  }
1803
- ],
1804
- "direction": "horizontal",
1805
- "align": "center",
1806
- "gap": "sm"
1804
+ ]
1807
1805
  },
1808
1806
  {
1809
1807
  "type": "card",
1810
1808
  "children": [
1811
1809
  {
1810
+ "gap": "md",
1812
1811
  "children": [
1813
1812
  {
1813
+ "color": "muted",
1814
1814
  "variant": "caption",
1815
1815
  "content": "@config.subjectTitle",
1816
- "type": "typography",
1817
- "color": "muted"
1816
+ "type": "typography"
1818
1817
  },
1819
1818
  {
1819
+ "variant": "h4",
1820
1820
  "type": "typography",
1821
- "content": "How would you rate it?",
1822
- "variant": "h4"
1821
+ "content": "How would you rate it?"
1823
1822
  },
1824
1823
  {
1825
- "max": 5.0,
1826
- "type": "star-rating",
1827
1824
  "value": "@entity.draftRating",
1825
+ "type": "star-rating",
1826
+ "max": 5.0,
1828
1827
  "action": "RATE_DRAFT"
1829
1828
  },
1830
1829
  {
1831
- "variant": "h4",
1832
1830
  "content": "Share more details (optional)",
1833
- "type": "typography"
1831
+ "type": "typography",
1832
+ "variant": "h4"
1834
1833
  },
1835
1834
  {
1836
- "type": "form-section",
1837
1835
  "entity": "@entity",
1838
- "mode": "edit",
1839
- "submitLabel": "@config.submitLabel",
1840
1836
  "submitEvent": "SUBMIT_REVIEW",
1837
+ "type": "form-section",
1838
+ "fields": "@config.reviewFields",
1841
1839
  "cancelEvent": "CANCEL_REVIEW",
1842
- "fields": "@config.reviewFields"
1840
+ "submitLabel": "@config.submitLabel",
1841
+ "mode": "edit"
1843
1842
  }
1844
1843
  ],
1845
1844
  "direction": "vertical",
1846
- "gap": "md",
1847
1845
  "type": "stack"
1848
1846
  }
1849
1847
  ]
1850
1848
  }
1851
1849
  ],
1852
- "gap": "md"
1850
+ "type": "stack",
1851
+ "gap": "md",
1852
+ "direction": "vertical"
1853
1853
  }
1854
1854
  ]
1855
1855
  ]
@@ -1878,22 +1878,22 @@
1878
1878
  "render-ui",
1879
1879
  "main",
1880
1880
  {
1881
- "type": "stack",
1881
+ "gap": "md",
1882
+ "direction": "vertical",
1883
+ "align": "center",
1882
1884
  "children": [
1883
1885
  {
1884
- "type": "icon",
1886
+ "size": "lg",
1885
1887
  "name": "send",
1886
- "size": "lg"
1888
+ "type": "icon"
1887
1889
  },
1888
1890
  {
1891
+ "variant": "h3",
1889
1892
  "type": "typography",
1890
- "content": "Submitting your review…",
1891
- "variant": "h3"
1893
+ "content": "Submitting your review…"
1892
1894
  }
1893
1895
  ],
1894
- "direction": "vertical",
1895
- "gap": "md",
1896
- "align": "center"
1896
+ "type": "stack"
1897
1897
  }
1898
1898
  ]
1899
1899
  ]
@@ -1932,13 +1932,13 @@
1932
1932
  "render-ui",
1933
1933
  "main",
1934
1934
  {
1935
+ "align": "center",
1935
1936
  "gap": "lg",
1936
- "direction": "vertical",
1937
1937
  "children": [
1938
1938
  {
1939
- "size": "lg",
1939
+ "type": "icon",
1940
1940
  "name": "check-circle",
1941
- "type": "icon"
1941
+ "size": "lg"
1942
1942
  },
1943
1943
  {
1944
1944
  "type": "typography",
@@ -1947,22 +1947,22 @@
1947
1947
  "align": "center"
1948
1948
  },
1949
1949
  {
1950
+ "align": "center",
1950
1951
  "type": "typography",
1951
- "variant": "body",
1952
1952
  "content": "It will appear on the page shortly.",
1953
- "align": "center",
1953
+ "variant": "body",
1954
1954
  "color": "muted"
1955
1955
  },
1956
1956
  {
1957
- "variant": "primary",
1958
- "label": "Back to reviews",
1957
+ "type": "button",
1959
1958
  "icon": "arrow-left",
1960
1959
  "action": "RESTART",
1961
- "type": "button"
1960
+ "variant": "primary",
1961
+ "label": "Back to reviews"
1962
1962
  }
1963
1963
  ],
1964
1964
  "type": "stack",
1965
- "align": "center"
1965
+ "direction": "vertical"
1966
1966
  }
1967
1967
  ]
1968
1968
  ]
@@ -1982,8 +1982,8 @@
1982
1982
  "main",
1983
1983
  {
1984
1984
  "title": "Submit failed",
1985
- "message": "@entity.errorMessage",
1986
- "type": "error-state"
1985
+ "type": "error-state",
1986
+ "message": "@entity.errorMessage"
1987
1987
  }
1988
1988
  ]
1989
1989
  ]
@@ -1998,8 +1998,8 @@
1998
1998
  "ReviewView",
1999
1999
  {
2000
2000
  "emit": {
2001
- "success": "ReviewsLoaded",
2002
- "failure": "ReviewsLoadFailed"
2001
+ "failure": "ReviewsLoadFailed",
2002
+ "success": "ReviewsLoaded"
2003
2003
  }
2004
2004
  }
2005
2005
  ],
@@ -2007,8 +2007,8 @@
2007
2007
  "render-ui",
2008
2008
  "main",
2009
2009
  {
2010
- "type": "loading-state",
2011
- "title": "Refreshing reviews…"
2010
+ "title": "Refreshing reviews…",
2011
+ "type": "loading-state"
2012
2012
  }
2013
2013
  ]
2014
2014
  ]
@@ -2041,48 +2041,48 @@
2041
2041
  ]
2042
2042
  },
2043
2043
  "config": {
2044
- "submitLabel": {
2045
- "type": "string",
2046
- "default": "Submit review"
2047
- },
2048
2044
  "sortOptions": {
2049
2045
  "type": "[object]",
2050
2046
  "default": [
2051
2047
  {
2052
- "id": "recent",
2053
2048
  "label": "Most recent",
2049
+ "id": "recent",
2054
2050
  "icon": "clock"
2055
2051
  },
2056
2052
  {
2057
2053
  "icon": "star",
2058
- "id": "highest",
2059
- "label": "Top rated"
2054
+ "label": "Top rated",
2055
+ "id": "highest"
2060
2056
  },
2061
2057
  {
2062
- "label": "Lowest",
2063
2058
  "id": "lowest",
2059
+ "label": "Lowest",
2064
2060
  "icon": "trending-down"
2065
2061
  }
2066
2062
  ]
2067
2063
  },
2064
+ "cancelLabel": {
2065
+ "type": "string",
2066
+ "default": "Cancel"
2067
+ },
2068
2068
  "starDistribution": {
2069
2069
  "type": "[object]",
2070
2070
  "default": [
2071
2071
  {
2072
- "label": "5 stars",
2073
- "percentage": 74.0
2072
+ "percentage": 74.0,
2073
+ "label": "5 stars"
2074
2074
  },
2075
2075
  {
2076
2076
  "label": "4 stars",
2077
2077
  "percentage": 18.0
2078
2078
  },
2079
2079
  {
2080
- "percentage": 5.0,
2081
- "label": "3 stars"
2080
+ "label": "3 stars",
2081
+ "percentage": 5.0
2082
2082
  },
2083
2083
  {
2084
- "label": "2 stars",
2085
- "percentage": 2.0
2084
+ "percentage": 2.0,
2085
+ "label": "2 stars"
2086
2086
  },
2087
2087
  {
2088
2088
  "percentage": 1.0,
@@ -2090,10 +2090,6 @@
2090
2090
  }
2091
2091
  ]
2092
2092
  },
2093
- "cancelLabel": {
2094
- "type": "string",
2095
- "default": "Cancel"
2096
- },
2097
2093
  "subjectTitle": {
2098
2094
  "type": "string",
2099
2095
  "default": "Bali Sunset Villa · 3 nights"
@@ -2107,18 +2103,546 @@
2107
2103
  "writeLabel": {
2108
2104
  "type": "string",
2109
2105
  "default": "Write a review"
2106
+ },
2107
+ "submitLabel": {
2108
+ "type": "string",
2109
+ "default": "Submit review"
2110
2110
  }
2111
2111
  },
2112
2112
  "scope": "instance"
2113
- }
2114
- ],
2115
- "pages": [
2113
+ },
2116
2114
  {
2117
- "name": "RatingReviewPage",
2118
- "path": "/reviews",
2119
- "traits": [
2115
+ "name": "RatingReviewSubmit",
2116
+ "category": "interaction",
2117
+ "linkedEntity": "ReviewView",
2118
+ "emits": [
2120
2119
  {
2121
- "ref": "RatingReviewBoard"
2120
+ "event": "RATE_DRAFT",
2121
+ "payloadSchema": [
2122
+ {
2123
+ "name": "rating",
2124
+ "type": "number"
2125
+ }
2126
+ ]
2127
+ },
2128
+ {
2129
+ "event": "SUBMIT_REVIEW",
2130
+ "payloadSchema": [
2131
+ {
2132
+ "name": "data",
2133
+ "type": "object"
2134
+ }
2135
+ ]
2136
+ },
2137
+ {
2138
+ "event": "CANCEL_REVIEW"
2139
+ },
2140
+ {
2141
+ "event": "RESTART"
2142
+ },
2143
+ {
2144
+ "event": "ReviewSaved",
2145
+ "payloadSchema": [
2146
+ {
2147
+ "name": "row",
2148
+ "type": "object"
2149
+ }
2150
+ ]
2151
+ },
2152
+ {
2153
+ "event": "ReviewSaveFailed",
2154
+ "payloadSchema": [
2155
+ {
2156
+ "name": "error",
2157
+ "type": "string"
2158
+ },
2159
+ {
2160
+ "name": "code",
2161
+ "type": "string"
2162
+ }
2163
+ ]
2164
+ }
2165
+ ],
2166
+ "stateMachine": {
2167
+ "states": [
2168
+ {
2169
+ "name": "composing",
2170
+ "isInitial": true
2171
+ },
2172
+ {
2173
+ "name": "submitting"
2174
+ },
2175
+ {
2176
+ "name": "submitted"
2177
+ },
2178
+ {
2179
+ "name": "error"
2180
+ }
2181
+ ],
2182
+ "events": [
2183
+ {
2184
+ "key": "INIT",
2185
+ "name": "Initialize"
2186
+ },
2187
+ {
2188
+ "key": "RATE_DRAFT",
2189
+ "name": "Rate Draft",
2190
+ "payloadSchema": [
2191
+ {
2192
+ "name": "rating",
2193
+ "type": "number"
2194
+ }
2195
+ ]
2196
+ },
2197
+ {
2198
+ "key": "SUBMIT_REVIEW",
2199
+ "name": "Submit Review",
2200
+ "payloadSchema": [
2201
+ {
2202
+ "name": "data",
2203
+ "type": "object"
2204
+ }
2205
+ ]
2206
+ },
2207
+ {
2208
+ "key": "CANCEL_REVIEW",
2209
+ "name": "Cancel Review"
2210
+ },
2211
+ {
2212
+ "key": "ReviewSaved",
2213
+ "name": "Review saved",
2214
+ "payloadSchema": [
2215
+ {
2216
+ "name": "row",
2217
+ "type": "object"
2218
+ }
2219
+ ]
2220
+ },
2221
+ {
2222
+ "key": "ReviewSaveFailed",
2223
+ "name": "Review save failed",
2224
+ "payloadSchema": [
2225
+ {
2226
+ "name": "error",
2227
+ "type": "string"
2228
+ },
2229
+ {
2230
+ "name": "code",
2231
+ "type": "string"
2232
+ }
2233
+ ]
2234
+ },
2235
+ {
2236
+ "key": "RESTART",
2237
+ "name": "Restart"
2238
+ }
2239
+ ],
2240
+ "transitions": [
2241
+ {
2242
+ "from": "composing",
2243
+ "to": "composing",
2244
+ "event": "INIT",
2245
+ "effects": [
2246
+ [
2247
+ "set",
2248
+ "@entity.draftRating",
2249
+ 0.0
2250
+ ],
2251
+ [
2252
+ "set",
2253
+ "@entity.draftComment",
2254
+ ""
2255
+ ],
2256
+ [
2257
+ "render-ui",
2258
+ "main",
2259
+ {
2260
+ "type": "card",
2261
+ "children": [
2262
+ {
2263
+ "type": "stack",
2264
+ "children": [
2265
+ {
2266
+ "type": "typography",
2267
+ "content": "@config.title",
2268
+ "variant": "h3"
2269
+ },
2270
+ {
2271
+ "action": "RATE_DRAFT",
2272
+ "max": "@config.maxStars",
2273
+ "value": "@entity.draftRating",
2274
+ "type": "star-rating"
2275
+ },
2276
+ {
2277
+ "submitLabel": "@config.submitLabel",
2278
+ "submitEvent": "SUBMIT_REVIEW",
2279
+ "entity": "@entity",
2280
+ "mode": "edit",
2281
+ "fields": [
2282
+ "draftComment"
2283
+ ],
2284
+ "type": "form-section",
2285
+ "cancelEvent": "CANCEL_REVIEW"
2286
+ }
2287
+ ],
2288
+ "gap": "md",
2289
+ "direction": "vertical"
2290
+ }
2291
+ ]
2292
+ }
2293
+ ]
2294
+ ]
2295
+ },
2296
+ {
2297
+ "from": "composing",
2298
+ "to": "composing",
2299
+ "event": "RATE_DRAFT",
2300
+ "effects": [
2301
+ [
2302
+ "set",
2303
+ "@entity.draftRating",
2304
+ "@payload.rating"
2305
+ ],
2306
+ [
2307
+ "render-ui",
2308
+ "main",
2309
+ {
2310
+ "type": "card",
2311
+ "children": [
2312
+ {
2313
+ "direction": "vertical",
2314
+ "gap": "md",
2315
+ "children": [
2316
+ {
2317
+ "variant": "h3",
2318
+ "type": "typography",
2319
+ "content": "@config.title"
2320
+ },
2321
+ {
2322
+ "max": "@config.maxStars",
2323
+ "type": "star-rating",
2324
+ "value": "@entity.draftRating",
2325
+ "action": "RATE_DRAFT"
2326
+ },
2327
+ {
2328
+ "cancelEvent": "CANCEL_REVIEW",
2329
+ "fields": [
2330
+ "draftComment"
2331
+ ],
2332
+ "submitLabel": "@config.submitLabel",
2333
+ "type": "form-section",
2334
+ "mode": "edit",
2335
+ "entity": "@entity",
2336
+ "submitEvent": "SUBMIT_REVIEW"
2337
+ }
2338
+ ],
2339
+ "type": "stack"
2340
+ }
2341
+ ]
2342
+ }
2343
+ ]
2344
+ ]
2345
+ },
2346
+ {
2347
+ "from": "composing",
2348
+ "to": "submitting",
2349
+ "event": "SUBMIT_REVIEW",
2350
+ "effects": [
2351
+ [
2352
+ "persist",
2353
+ "create",
2354
+ "ReviewView",
2355
+ {
2356
+ "rating": "@entity.draftRating",
2357
+ "comment": "@entity.draftComment"
2358
+ },
2359
+ {
2360
+ "emit": {
2361
+ "success": "ReviewSaved",
2362
+ "failure": "ReviewSaveFailed"
2363
+ }
2364
+ }
2365
+ ],
2366
+ [
2367
+ "render-ui",
2368
+ "main",
2369
+ {
2370
+ "type": "stack",
2371
+ "gap": "md",
2372
+ "align": "center",
2373
+ "children": [
2374
+ {
2375
+ "name": "send",
2376
+ "size": "lg",
2377
+ "type": "icon"
2378
+ },
2379
+ {
2380
+ "content": "Submitting…",
2381
+ "variant": "h3",
2382
+ "type": "typography"
2383
+ }
2384
+ ],
2385
+ "direction": "vertical"
2386
+ }
2387
+ ]
2388
+ ]
2389
+ },
2390
+ {
2391
+ "from": "composing",
2392
+ "to": "composing",
2393
+ "event": "CANCEL_REVIEW",
2394
+ "effects": [
2395
+ [
2396
+ "set",
2397
+ "@entity.draftRating",
2398
+ 0.0
2399
+ ],
2400
+ [
2401
+ "set",
2402
+ "@entity.draftComment",
2403
+ ""
2404
+ ],
2405
+ [
2406
+ "render-ui",
2407
+ "main",
2408
+ {
2409
+ "type": "card",
2410
+ "children": [
2411
+ {
2412
+ "gap": "md",
2413
+ "children": [
2414
+ {
2415
+ "variant": "h3",
2416
+ "content": "@config.title",
2417
+ "type": "typography"
2418
+ },
2419
+ {
2420
+ "action": "RATE_DRAFT",
2421
+ "type": "star-rating",
2422
+ "value": 0.0,
2423
+ "max": "@config.maxStars"
2424
+ },
2425
+ {
2426
+ "cancelEvent": "CANCEL_REVIEW",
2427
+ "submitLabel": "@config.submitLabel",
2428
+ "fields": [
2429
+ "draftComment"
2430
+ ],
2431
+ "type": "form-section",
2432
+ "submitEvent": "SUBMIT_REVIEW",
2433
+ "entity": "@entity",
2434
+ "mode": "edit"
2435
+ }
2436
+ ],
2437
+ "type": "stack",
2438
+ "direction": "vertical"
2439
+ }
2440
+ ]
2441
+ }
2442
+ ]
2443
+ ]
2444
+ },
2445
+ {
2446
+ "from": "submitting",
2447
+ "to": "submitted",
2448
+ "event": "ReviewSaved",
2449
+ "effects": [
2450
+ [
2451
+ "render-ui",
2452
+ "main",
2453
+ {
2454
+ "type": "stack",
2455
+ "align": "center",
2456
+ "direction": "vertical",
2457
+ "children": [
2458
+ {
2459
+ "type": "icon",
2460
+ "size": "lg",
2461
+ "name": "check-circle"
2462
+ },
2463
+ {
2464
+ "variant": "h2",
2465
+ "type": "typography",
2466
+ "content": "Thanks for your review!"
2467
+ }
2468
+ ],
2469
+ "gap": "lg"
2470
+ }
2471
+ ]
2472
+ ]
2473
+ },
2474
+ {
2475
+ "from": "submitting",
2476
+ "to": "error",
2477
+ "event": "ReviewSaveFailed",
2478
+ "effects": [
2479
+ [
2480
+ "set",
2481
+ "@entity.errorMessage",
2482
+ "@payload.error"
2483
+ ],
2484
+ [
2485
+ "render-ui",
2486
+ "main",
2487
+ {
2488
+ "message": "@entity.errorMessage",
2489
+ "title": "Submit failed",
2490
+ "type": "error-state"
2491
+ }
2492
+ ]
2493
+ ]
2494
+ },
2495
+ {
2496
+ "from": "submitted",
2497
+ "to": "composing",
2498
+ "event": "RESTART",
2499
+ "effects": [
2500
+ [
2501
+ "set",
2502
+ "@entity.draftRating",
2503
+ 0.0
2504
+ ],
2505
+ [
2506
+ "set",
2507
+ "@entity.draftComment",
2508
+ ""
2509
+ ],
2510
+ [
2511
+ "render-ui",
2512
+ "main",
2513
+ {
2514
+ "type": "card",
2515
+ "children": [
2516
+ {
2517
+ "direction": "vertical",
2518
+ "children": [
2519
+ {
2520
+ "variant": "h3",
2521
+ "content": "@config.title",
2522
+ "type": "typography"
2523
+ },
2524
+ {
2525
+ "max": "@config.maxStars",
2526
+ "value": 0.0,
2527
+ "type": "star-rating",
2528
+ "action": "RATE_DRAFT"
2529
+ },
2530
+ {
2531
+ "type": "form-section",
2532
+ "cancelEvent": "CANCEL_REVIEW",
2533
+ "entity": "@entity",
2534
+ "submitEvent": "SUBMIT_REVIEW",
2535
+ "mode": "edit",
2536
+ "fields": [
2537
+ "draftComment"
2538
+ ],
2539
+ "submitLabel": "@config.submitLabel"
2540
+ }
2541
+ ],
2542
+ "gap": "md",
2543
+ "type": "stack"
2544
+ }
2545
+ ]
2546
+ }
2547
+ ]
2548
+ ]
2549
+ },
2550
+ {
2551
+ "from": "error",
2552
+ "to": "composing",
2553
+ "event": "RESTART",
2554
+ "effects": [
2555
+ [
2556
+ "render-ui",
2557
+ "main",
2558
+ {
2559
+ "children": [
2560
+ {
2561
+ "gap": "md",
2562
+ "children": [
2563
+ {
2564
+ "content": "@config.title",
2565
+ "variant": "h3",
2566
+ "type": "typography"
2567
+ },
2568
+ {
2569
+ "max": "@config.maxStars",
2570
+ "type": "star-rating",
2571
+ "value": 0.0,
2572
+ "action": "RATE_DRAFT"
2573
+ },
2574
+ {
2575
+ "submitEvent": "SUBMIT_REVIEW",
2576
+ "cancelEvent": "CANCEL_REVIEW",
2577
+ "fields": [
2578
+ "draftComment"
2579
+ ],
2580
+ "mode": "edit",
2581
+ "type": "form-section",
2582
+ "submitLabel": "@config.submitLabel",
2583
+ "entity": "@entity"
2584
+ }
2585
+ ],
2586
+ "type": "stack",
2587
+ "direction": "vertical"
2588
+ }
2589
+ ],
2590
+ "type": "card"
2591
+ }
2592
+ ]
2593
+ ]
2594
+ }
2595
+ ]
2596
+ },
2597
+ "config": {
2598
+ "allowPhotos": {
2599
+ "type": "boolean",
2600
+ "default": false
2601
+ },
2602
+ "title": {
2603
+ "type": "string",
2604
+ "default": "Write a review"
2605
+ },
2606
+ "cancelLabel": {
2607
+ "type": "string",
2608
+ "default": "Cancel"
2609
+ },
2610
+ "submitLabel": {
2611
+ "type": "string",
2612
+ "default": "Submit review"
2613
+ },
2614
+ "submitEvent": {
2615
+ "type": "string",
2616
+ "default": "SUBMIT_REVIEW"
2617
+ },
2618
+ "allowComment": {
2619
+ "type": "boolean",
2620
+ "default": true
2621
+ },
2622
+ "maxStars": {
2623
+ "type": "number",
2624
+ "default": 5.0
2625
+ }
2626
+ },
2627
+ "scope": "instance"
2628
+ }
2629
+ ],
2630
+ "pages": [
2631
+ {
2632
+ "name": "RatingReviewPage",
2633
+ "path": "/reviews",
2634
+ "traits": [
2635
+ {
2636
+ "ref": "RatingReviewBoard"
2637
+ }
2638
+ ]
2639
+ },
2640
+ {
2641
+ "name": "RatingReviewSubmitPage",
2642
+ "path": "/reviews/new",
2643
+ "traits": [
2644
+ {
2645
+ "ref": "RatingReviewSubmit"
2122
2646
  }
2123
2647
  ]
2124
2648
  }