@ecomplus/widget-martan 1.1.22 → 1.2.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.
Files changed (97) hide show
  1. package/.version +0 -0
  2. package/CHANGELOG.md +14 -0
  3. package/cms.config.js +78 -83
  4. package/dist/public/widget-martan.0.min.js +62 -0
  5. package/dist/public/widget-martan.0.min.js.map +1 -0
  6. package/dist/public/widget-martan.1.min.js.map +1 -1
  7. package/dist/public/widget-martan.2.min.js +1 -1
  8. package/dist/public/widget-martan.2.min.js.map +1 -1
  9. package/dist/public/widget-martan.3.min.js +1 -1
  10. package/dist/public/widget-martan.3.min.js.map +1 -1
  11. package/dist/public/widget-martan.4.min.js +1 -1
  12. package/dist/public/widget-martan.4.min.js.map +1 -1
  13. package/dist/public/widget-martan.5.min.js +1 -1
  14. package/dist/public/widget-martan.5.min.js.map +1 -1
  15. package/dist/public/widget-martan.6.min.js +2 -0
  16. package/dist/public/widget-martan.6.min.js.map +1 -0
  17. package/dist/public/widget-martan.7.min.js +2 -0
  18. package/dist/public/widget-martan.7.min.js.map +1 -0
  19. package/dist/public/widget-martan.8.min.js +2 -0
  20. package/dist/public/widget-martan.8.min.js.map +1 -0
  21. package/dist/public/widget-martan.9.min.js +2 -0
  22. package/dist/public/widget-martan.9.min.js.map +1 -0
  23. package/dist/public/widget-martan.var.min.js +3 -3
  24. package/dist/public/widget-martan.var.min.js.map +1 -1
  25. package/dist/widget-martan.0.min.js +62 -0
  26. package/dist/widget-martan.0.min.js.map +1 -0
  27. package/dist/widget-martan.1.min.js.map +1 -1
  28. package/dist/widget-martan.2.min.js +1 -1
  29. package/dist/widget-martan.2.min.js.map +1 -1
  30. package/dist/widget-martan.3.min.js +1 -1
  31. package/dist/widget-martan.3.min.js.map +1 -1
  32. package/dist/widget-martan.4.min.js +1 -1
  33. package/dist/widget-martan.4.min.js.map +1 -1
  34. package/dist/widget-martan.5.min.js +1 -1
  35. package/dist/widget-martan.5.min.js.map +1 -1
  36. package/dist/widget-martan.6.min.js +2 -0
  37. package/dist/widget-martan.6.min.js.map +1 -0
  38. package/dist/widget-martan.7.min.js +2 -0
  39. package/dist/widget-martan.7.min.js.map +1 -0
  40. package/dist/widget-martan.8.min.js +2 -0
  41. package/dist/widget-martan.8.min.js.map +1 -0
  42. package/dist/widget-martan.9.min.js +2 -0
  43. package/dist/widget-martan.9.min.js.map +1 -0
  44. package/dist/widget-martan.min.js +3 -3
  45. package/dist/widget-martan.min.js.map +1 -1
  46. package/package.json +2 -2
  47. package/src/append/product-block.ejs +5 -1
  48. package/src/append/product-card-slots.ejs +1 -1
  49. package/src/append/product-slots.ejs +1 -9
  50. package/src/index.js +17 -12
  51. package/src/utils/configProps.js +29 -0
  52. package/src/utils/lighten-color.js +20 -0
  53. package/src/utils/widget-initializer.js +60 -0
  54. package/src/widgets/questions/Questions.vue +436 -0
  55. package/src/widgets/questions/index.js +10 -0
  56. package/src/widgets/ratings/Rating.vue +223 -0
  57. package/src/widgets/ratings/index.js +232 -0
  58. package/src/widgets/reviews/Reviews.vue +317 -288
  59. package/src/widgets/reviews/components/Quickview.vue +390 -0
  60. package/src/widgets/reviews/components/Rating.vue +106 -0
  61. package/src/widgets/reviews/components/RatingBreakdown.vue +171 -0
  62. package/src/widgets/reviews/components/RatingHistogram.vue +306 -0
  63. package/src/widgets/reviews/components/RatingSummary.vue +226 -0
  64. package/src/widgets/reviews/components/RatingSummaryG.vue +104 -0
  65. package/src/widgets/reviews/components/ReviewCard.vue +223 -0
  66. package/src/widgets/reviews/{ReviewReply.vue → components/ReviewReply.vue} +42 -1
  67. package/src/widgets/reviews/{Score.vue → components/Score.vue} +3 -4
  68. package/src/widgets/reviews/{Sort.vue → components/Sort.vue} +1 -1
  69. package/src/widgets/reviews/components/SortDropdown.vue +184 -0
  70. package/src/widgets/reviews/components/VerifiedPurchase.vue +121 -0
  71. package/src/widgets/reviews/headers/Center.vue +248 -0
  72. package/src/widgets/reviews/headers/Compact.vue +225 -0
  73. package/src/widgets/reviews/headers/Histogram.vue +224 -0
  74. package/src/widgets/reviews/headers/Padrao.vue +113 -0
  75. package/src/widgets/reviews/headers/Summary.vue +217 -0
  76. package/src/widgets/reviews/index.js +2 -48
  77. package/src/append/body.ejs +0 -79
  78. package/src/append/head.ejs +0 -5
  79. package/src/append/stamps.ejs +0 -3
  80. package/src/widgets/reviews/AuthorAndRating.vue +0 -30
  81. package/src/widgets/reviews/AverageScore.vue +0 -160
  82. package/src/widgets/reviews/AverageTotal.vue +0 -35
  83. package/src/widgets/reviews/CardReview.vue +0 -87
  84. package/src/widgets/reviews/GridView.vue +0 -113
  85. package/src/widgets/reviews/HeaderExpanded.vue +0 -84
  86. package/src/widgets/reviews/HeaderMinimal.vue +0 -110
  87. package/src/widgets/reviews/ListView.vue +0 -47
  88. package/src/widgets/reviews/Quickview.vue +0 -397
  89. package/src/widgets/reviews/ReviewBody.vue +0 -39
  90. package/src/widgets/reviews/ThumbsPictures.vue +0 -135
  91. package/src/widgets/reviews/Total.vue +0 -79
  92. package/src/widgets/reviews/VerifiedPurchase.vue +0 -110
  93. package/src/widgets/reviews/isRecommended.vue +0 -44
  94. package/src/widgets/snippets/Rating.vue +0 -71
  95. package/src/widgets/snippets/Snippets.vue +0 -311
  96. package/src/widgets/snippets/index.js +0 -45
  97. /package/src/widgets/reviews/{VideoPlayer.vue → components/VideoPlayer.vue} +0 -0
@@ -1,87 +0,0 @@
1
- <template>
2
- <div class="mt-review">
3
- <div class="mt-rating__group">
4
- <author-and-rating
5
- v-if="review"
6
- :author="review.display_name"
7
- :isAnonymous="review.is_anonymous"
8
- :rating="review.rating"
9
- :starColor="starColor"
10
- />
11
-
12
- <is-recommended v-if="review" :recommended="review.is_recommended" />
13
-
14
- <verified-purchase v-if="isVerified" />
15
- </div>
16
-
17
- <thumbs-pictures
18
- :review="review"
19
- @onClick="(e) => $emit('openQuickview', e)"
20
- />
21
-
22
- <review-body
23
- v-if="review"
24
- :body="review.body"
25
- :createdAt="review.created_at"
26
- />
27
-
28
- <review-reply :reply="review.reply" />
29
- </div>
30
- </template>
31
-
32
- <script>
33
- import Rating from "../snippets/Rating.vue";
34
- import ThumbsPictures from "./ThumbsPictures.vue";
35
- import VerifiedPurchase from "./VerifiedPurchase.vue";
36
- import AuthorAndRating from "./AuthorAndRating.vue";
37
- import IsRecommended from "./isRecommended.vue";
38
- import ReviewBody from "./ReviewBody.vue";
39
- import ReviewReply from "./ReviewReply.vue";
40
-
41
- export default {
42
- name: "CardReview",
43
-
44
- props: {
45
- review: {
46
- type: Object,
47
- default () {
48
- return {}
49
- }
50
- },
51
-
52
- starColor: {
53
- type: String,
54
- default: "#212529",
55
- },
56
- },
57
-
58
- components: {
59
- ThumbsPictures,
60
- Rating,
61
- VerifiedPurchase,
62
- AuthorAndRating,
63
- IsRecommended,
64
- ReviewBody,
65
- ReviewReply,
66
- },
67
-
68
- computed: {
69
- isVerified: function () {
70
- return this.review && this.review.verified_purchase;
71
- },
72
- },
73
- };
74
- </script>
75
-
76
- <style>
77
- .mt-reply__wrapper {
78
- display: flex;
79
- align-items: center;
80
- }
81
-
82
- @media (max-width: 580px) {
83
- .body-wrapper {
84
- padding: 0px;
85
- }
86
- }
87
- </style>
@@ -1,113 +0,0 @@
1
- <template>
2
- <div class="mt-gridview">
3
- <div class="mt-gridview__card" v-for="review in reviews.list" :key="review.id" @click="(e) => openQuickview(review)">
4
- <div class="mt-gridview__thumb" v-if="getPictureURL(review)">
5
- <img :src="getPictureURL(review)" :alt="review.title" @click="() => openQuickview(review)" />
6
- </div>
7
-
8
- <div class="mt-gridview__detail">
9
- <span class="mt-gridview__author">{{ review.display_name.substr(0, 16) }}</span>
10
- <rating :rating="review.rating" :color="starColor" />
11
- <verified-purchase v-if="review.verified_purchase" />
12
- <span class="mt-gridview__body">{{ review.body.substr(0, 250) }}</span>
13
- </div>
14
- </div>
15
- </div>
16
- </template>
17
-
18
- <script>
19
- import Rating from '../snippets/Rating.vue';
20
- import CardReview from "./CardReview.vue";
21
- import VerifiedPurchase from './VerifiedPurchase.vue';
22
-
23
- export default {
24
- name: "GridView",
25
-
26
- components: {
27
- CardReview,
28
- Rating,
29
- VerifiedPurchase,
30
- },
31
-
32
- props: {
33
- starColor: {
34
- type: String,
35
- default: "#212529",
36
- },
37
-
38
- reviews: {
39
- type: Object,
40
- default: {
41
- list: [],
42
- orderRating: null,
43
- total: 0,
44
- },
45
- },
46
- },
47
-
48
- methods: {
49
- openQuickview: function (review) {
50
- this.$emit('openQuickview', { review })
51
- },
52
-
53
- getPictureURL(review) {
54
- if (review && review.pictures && review.pictures.length && review.pictures[0].normal) {
55
- return review.pictures[0].normal
56
- }
57
-
58
- return false
59
- },
60
- },
61
- };
62
- </script>
63
-
64
- <style lang="scss">
65
- .mt-gridview {
66
- transition: all 0.7s ease;
67
- column-count: 2;
68
- column-gap: 10px;
69
- margin-right: auto;
70
- margin-left: auto;
71
-
72
- @media only screen and (min-width: 600px) {
73
- column-count: 3;
74
- }
75
-
76
- @media only screen and (min-width: 768px) {
77
- column-count: 4;
78
- }
79
-
80
- @media only screen and (min-width: 992px) {
81
- column-count: 5;
82
- }
83
-
84
- &__card {
85
- width: 100%;
86
- border: 1px #d5d9d9 solid;
87
- border-radius: 6px;
88
- cursor: pointer;
89
- margin: 0;
90
- display: grid;
91
- grid-template-rows: 1fr auto;
92
- margin-bottom: 10px;
93
- break-inside: avoid;
94
- }
95
-
96
- &__detail {
97
- padding: 10px;
98
- display: flex;
99
- flex-direction: column;
100
- gap: 8px;
101
- }
102
-
103
- &__thumb {
104
- img {
105
- max-width: 250px;
106
- width: 100%;
107
- object-fit: contain;
108
- border-top-right-radius: 5px;
109
- border-top-left-radius: 5px;
110
- }
111
- }
112
- }
113
- </style>
@@ -1,84 +0,0 @@
1
- <template>
2
- <div class="mt-header--expanded">
3
- <average-total :average="reviews.averageTotal" />
4
- <score
5
- :reviews="reviews"
6
- :starColor="starColor"
7
- @updateOrderByAverage="updateOrderBy"
8
- />
9
- </div>
10
- </template>
11
-
12
- <script>
13
- export default {
14
- props: {
15
- starColor: {
16
- type: String,
17
- default: '#212529'
18
- },
19
-
20
- reviews: {
21
- type: Object,
22
- default: {
23
- list: [],
24
- orderRating: null,
25
- total: 0,
26
- average: {
27
- one: 0,
28
- two: 0,
29
- three: 0,
30
- four: 0,
31
- five: 0,
32
- },
33
- averageTotal: 0,
34
- }
35
- },
36
- },
37
-
38
- name: 'header-expanded',
39
-
40
- components: {
41
- AverageTotal: () => import("./AverageTotal.vue"),
42
- AverageScore: () => import("./AverageScore.vue"),
43
- Score: () => import("./Score.vue"),
44
- },
45
-
46
- methods: {
47
- updateOrderBy: ({ rating }) => this.$emit('updateOrderByAverage', { rating })
48
- }
49
- };
50
- </script>
51
-
52
- <style lang="scss">
53
- .mt-header--expanded {
54
- display: flex;
55
- align-items: center;
56
- border-bottom: 1px solid #e3e3e3;
57
- padding-bottom: 25px;
58
-
59
- .mt-rating__average {
60
- display: flex;
61
- align-items: center;
62
- }
63
-
64
- .mt-rating__average__wrapper {
65
- display: flex;
66
- flex-direction: column;
67
- justify-content: center;
68
- height: 100%;
69
- padding-top: 5px;
70
- }
71
-
72
- .mt-rating__average_total {
73
- font-size: 48px;
74
- margin: 0 18px 0 0;
75
- padding: 0;
76
- }
77
- }
78
-
79
- @media (max-width: 580px) {
80
- .mt-rating__options {
81
- max-width: 97%;
82
- }
83
- }
84
- </style>
@@ -1,110 +0,0 @@
1
- <template>
2
- <div class="mt-header--minimal">
3
- <div class="rating">
4
- <div style="display: flex; align-items: center; gap: 10px">
5
- <rating :color="starColor" :rating="reviews.averageTotal" />
6
-
7
- <span class="average" v-if="reviews.averageTotal > 0">
8
- {{ reviews.averageTotal }}
9
- <span class="baseado" style="font-size: 10px; opacity: 0.8"
10
- >({{
11
- reviews.total > 1
12
- ? i19basedOn$1Reviews.replace("$1", reviews.total)
13
- : i19basedOn$1Review.replace("$1", reviews.total)
14
- }})</span
15
- ></span
16
- >
17
- <span class="average" v-else>
18
- {{ reviews.averageTotal }}
19
- <span class="baseado" style="font-size: 10px; opacity: 0.8"
20
- >({{ i19noReview }})</span
21
- ></span
22
- >
23
- </div>
24
-
25
- <Sort @onSort="onSort" />
26
- </div>
27
- </div>
28
- </template>
29
-
30
- <script>
31
- import Rating from "../snippets/Rating.vue";
32
- import Sort from "./Sort.vue";
33
-
34
- export default {
35
- props: {
36
- starColor: {
37
- type: String,
38
- default: "#212529",
39
- },
40
-
41
- reviews: {
42
- type: Object,
43
- default: {
44
- list: [],
45
- orderRating: null,
46
- total: 0,
47
- average: {
48
- one: 0,
49
- two: 0,
50
- three: 0,
51
- four: 0,
52
- five: 0,
53
- },
54
- averageTotal: 0,
55
- },
56
- },
57
- },
58
-
59
- name: "header-minimal",
60
-
61
- components: {
62
- Rating,
63
- Sort,
64
- },
65
-
66
- computed: {
67
- i19basedOn$1Reviews: () => "Baseado em $1 avaliações",
68
- i19basedOn$1Review: () => "Baseado em $1 avaliação",
69
- i19noReview: () => "Nenhuma avaliação",
70
- },
71
-
72
- methods: {
73
- updateOrderBy: ({ rating }) =>
74
- this.$emit("updateOrderByAverage", { rating }),
75
-
76
- onSort(value) {
77
- this.$emit("onSort", value);
78
- },
79
- },
80
- };
81
- </script>
82
-
83
- <style lang="scss">
84
- .mt-header--minimal {
85
- .rating {
86
- display: flex;
87
- align-items: center;
88
- gap: 15px;
89
- border-bottom: 1px solid #eee;
90
- justify-content: space-between;
91
- margin-bottom: 10px;
92
- padding-bottom: 10px;
93
- }
94
-
95
- .average {
96
- font-size: 26px;
97
- color: #6c757d;
98
- }
99
-
100
- .mt-rating__average__sort {
101
- width: 100%;
102
- }
103
-
104
- .baseado {
105
- @media (max-width: 580px) {
106
- display: none;
107
- }
108
- }
109
- }
110
- </style>
@@ -1,47 +0,0 @@
1
- <template>
2
- <div class="mt-reviews__list">
3
- <card-review
4
- v-for="review in reviews.list"
5
- :key="review.id"
6
- :review="review"
7
- :starColor="starColor"
8
- @openQuickview="openQuickview"
9
- />
10
- </div>
11
- </template>
12
-
13
- <script>
14
- import CardReview from "./CardReview.vue";
15
- import Quickview from "./Quickview.vue";
16
-
17
- export default {
18
- name: 'ListView',
19
-
20
- components: {
21
- CardReview,
22
- Quickview,
23
- },
24
-
25
- props: {
26
- starColor: {
27
- type: String,
28
- default: "#212529",
29
- },
30
-
31
- reviews: {
32
- type: Object,
33
- default: {
34
- list: [],
35
- orderRating: null,
36
- total: 0,
37
- },
38
- },
39
- },
40
-
41
- methods: {
42
- openQuickview: function ({ review, slide }) {
43
- this.$emit('openQuickview', { review, slide })
44
- },
45
- },
46
- };
47
- </script>