@shopbite-de/storefront 1.2.4 → 1.2.5

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.
@@ -17,6 +17,9 @@
17
17
  --color-brand-900: #7a2800;
18
18
  --color-brand-950: #471500;
19
19
  --color-neutral-950: #171717;
20
+
21
+ /* This is important because apple devices will zoom in when the font size is below 16px */
22
+ --text-sm: 16px;
20
23
  }
21
24
 
22
25
  :root {
@@ -24,7 +24,7 @@ const props = withDefaults(defineProps<Props>(), {
24
24
  duration: "duration-1000",
25
25
  delay: "delay-0",
26
26
  threshold: 0.1,
27
- rootMargin: "0px 0px -100px 0px",
27
+ rootMargin: "0px 0px 100px 0px",
28
28
  });
29
29
 
30
30
  const { isVisible, elementRef } = useScrollAnimation({
@@ -27,17 +27,12 @@ defineProps<{
27
27
  <div v-else class="absolute inset-0 bg-primary" />
28
28
 
29
29
  <div class="relative p-4">
30
- <h2
31
- class="text-pretty font-semibold text-3xl md:text-4xl text-white drop-shadow"
32
- >
30
+ <h1 class="text-white font-semibold">
33
31
  {{ category.name }}
34
- </h2>
35
- <h3
36
- v-if="category.description"
37
- class="text-white/90 text-[15px] text-pretty mt-1"
38
- >
32
+ </h1>
33
+ <p v-if="category.description">
39
34
  {{ category.description }}
40
- </h3>
35
+ </p>
41
36
  </div>
42
37
  </div>
43
38
  <UPageCard
@@ -51,3 +46,15 @@ defineProps<{
51
46
  }"
52
47
  />
53
48
  </template>
49
+
50
+ <style scoped>
51
+ @import "tailwindcss";
52
+
53
+ h1 {
54
+ @apply text-white text-4xl md:text-5xl lg:text-6xl font-extrabold leading-none tracking-tighter mb-3;
55
+ }
56
+
57
+ p {
58
+ @apply text-white/90 text-[16px] text-pretty mt-1;
59
+ }
60
+ </style>
@@ -16,21 +16,13 @@ const searchCriteria = {
16
16
  "description",
17
17
  "calculatedPrice",
18
18
  "translated",
19
- "categories",
20
19
  "properties",
21
20
  "propertyIds",
22
- "options",
23
- "optionIds",
24
- "configuratorSettings",
25
- "children",
26
- "parentId",
27
21
  "sortedProperties",
28
22
  "cover",
29
- "parentId",
30
23
  ],
31
24
  property: ["id", "name", "translated", "options"],
32
25
  property_group_option: ["id", "name", "translated", "group"],
33
- product_configurator_setting: ["id", "optionId", "option", "productId"],
34
26
  product_option: ["id", "groupId", "name", "translated", "group"],
35
27
  },
36
28
  associations: {
@@ -39,57 +31,14 @@ const searchCriteria = {
39
31
  media: {},
40
32
  },
41
33
  },
42
- categories: {},
43
34
  properties: {
44
35
  associations: {
45
36
  group: {},
46
37
  },
47
38
  },
48
- options: {
49
- associations: {
50
- group: {},
51
- },
52
- },
53
- configuratorSettings: {
54
- associations: {
55
- option: {
56
- associations: {
57
- group: {},
58
- },
59
- },
60
- },
61
- },
62
- children: {
63
- associations: {
64
- properties: {
65
- associations: {
66
- group: {},
67
- },
68
- },
69
- options: {
70
- associations: {
71
- group: {},
72
- },
73
- },
74
- },
75
- },
76
39
  },
77
40
  } as operations["searchPage post /search"]["body"];
78
41
 
79
- const defaultSorting = {
80
- sort: [
81
- {
82
- field: "productNumber",
83
- order: "ASC",
84
- },
85
- ],
86
- };
87
-
88
- const searchCriteriaWithSorting = {
89
- ...searchCriteria,
90
- ...defaultSorting,
91
- } as operations["searchPage post /search"]["body"];
92
-
93
42
  const {
94
43
  resetFilters,
95
44
  loading,
@@ -149,30 +98,27 @@ const selectedListingFilters = computed<ShortcutFilterParam[]>(() => {
149
98
  });
150
99
 
151
100
  await useAsyncData(`listing${categoryId.value}`, async () => {
152
- await search(searchCriteriaWithSorting);
101
+ await search(searchCriteria);
153
102
  });
154
103
 
155
- watch(selectedListingFilters, () => {
156
- if (selectedListingFilters.value[0]?.value == "") {
157
- handleFilterRest();
158
- } else {
159
- setCurrentFilters(selectedListingFilters.value);
104
+ watch(selectedListingFilters, (newFilters, oldFilters) => {
105
+ if (newFilters[0]?.value === oldFilters?.[0]?.value) {
106
+ return;
160
107
  }
108
+ setCurrentFilters(newFilters);
109
+ currentSorting.value = "Sortieren";
161
110
  });
162
111
 
163
- watch(currentSorting, () => {
164
- const q = {
112
+ watch(currentSorting, async () => {
113
+ const sortingQuery = {
165
114
  query: getCurrentFilters.value?.search,
166
115
  properties: getCurrentFilters.value?.properties?.join("|"),
167
116
  };
168
-
169
- changeCurrentSortingOrder(currentSorting.value as string, q);
117
+ await changeCurrentSortingOrder(currentSorting.value as string, sortingQuery);
170
118
  });
171
119
 
172
120
  async function handleFilterRest() {
173
121
  await resetFilters();
174
- selectedPropertyFilters.value = [];
175
- currentSorting.value = "number-asc";
176
122
  }
177
123
 
178
124
  const moreThanOneFilterAndOption = computed<boolean>(
@@ -278,7 +224,7 @@ const moreThanOneFilterAndOption = computed<boolean>(
278
224
  <template #right>
279
225
  <UPageAside>
280
226
  <div v-if="moreThanOneFilterAndOption" class="flex flex-col gap-4">
281
- <h3>Filter</h3>
227
+ <h2 class="text-3xl md:text-4xl mt-8 mb-3 pb-2">Filter</h2>
282
228
  <div
283
229
  v-for="filter in propertyFilters"
284
230
  :key="filter.id"
@@ -18,6 +18,7 @@ defineProps<{
18
18
  <UPageSection
19
19
  id="features"
20
20
  :description="description"
21
+ :title="title"
21
22
  :features="features"
22
23
  :headline="headline"
23
24
  class="relative overflow-hidden"
@@ -127,6 +127,17 @@ const cartQuickViewOpen = ref(false);
127
127
  icon="i-lucide-shopping-cart"
128
128
  />
129
129
  </UChip>
130
+
131
+ <template #header>
132
+ <h2 class="text-3xl md:text-4xl mt-8 mb-3 pb-2">
133
+ <UIcon
134
+ name="i-lucide-shopping-cart"
135
+ class="size-8"
136
+ color="primary"
137
+ />
138
+ Warenkorb
139
+ </h2>
140
+ </template>
130
141
  <template #body>
131
142
  <CartQuickView
132
143
  :with-to-cart-button="true"
@@ -32,7 +32,7 @@ const navItems = computed<NavigationMenuItem[]>(() => {
32
32
 
33
33
  <template>
34
34
  <div>
35
- <h2>Navigation</h2>
35
+ <h2 class="text-3xl md:text-4xl mt-8 mb-3 pb-2">Speisekarte</h2>
36
36
  <UNavigationMenu
37
37
  variant="link"
38
38
  orientation="vertical"
@@ -87,7 +87,7 @@ const mainIngredients = computed<Schemas["PropertyGroupOption"][]>(() => {
87
87
  >
88
88
 
89
89
  <p class="text-base text-pretty font-semibold text-highlighted">
90
- {{ product.translated.name }}
90
+ {{ product.translated.name ?? product.name }}
91
91
  </p>
92
92
  </div>
93
93
  </template>
@@ -123,7 +123,10 @@ const mainIngredients = computed<Schemas["PropertyGroupOption"][]>(() => {
123
123
  </div>
124
124
  <UCollapsible v-model:open="openDetails" class="flex flex-col gap-2">
125
125
  <template #content>
126
- <ProductDetail2 :product="product" @product-added="toggleDetails" />
126
+ <ProductDetail2
127
+ :product-id="product.id"
128
+ @product-added="toggleDetails"
129
+ />
127
130
  </template>
128
131
  </UCollapsible>
129
132
  </template>
@@ -1,14 +1,81 @@
1
1
  <script setup lang="ts">
2
- import type { Schemas } from "#shopware";
2
+ import type { operations, Schemas } from "#shopware";
3
3
  import type { AssociationItemProduct } from "~/types/Association";
4
4
 
5
5
  const props = defineProps<{
6
- product: Schemas["Product"];
6
+ productId: string;
7
7
  }>();
8
8
 
9
9
  const { apiClient } = useShopwareContext();
10
10
 
11
- const productId = toRef(props.product.id);
11
+ const productId = toRef(props.productId);
12
+
13
+ const searchCriteria = {
14
+ includes: {
15
+ product: [
16
+ "id",
17
+ "productNumber",
18
+ "name",
19
+ "description",
20
+ "calculatedPrice",
21
+ "translated",
22
+ "properties",
23
+ "propertyIds",
24
+ "options",
25
+ "optionIds",
26
+ "configuratorSettings",
27
+ "children",
28
+ "parentId",
29
+ "sortedProperties",
30
+ "cover",
31
+ ],
32
+ property: ["id", "name", "translated", "options"],
33
+ property_group_option: ["id", "name", "translated", "group"],
34
+ product_configurator_setting: ["id", "optionId", "option", "productId"],
35
+ product_option: ["id", "groupId", "name", "translated", "group"],
36
+ },
37
+ associations: {
38
+ cover: {
39
+ associations: {
40
+ media: {},
41
+ },
42
+ },
43
+ properties: {
44
+ associations: {
45
+ group: {},
46
+ },
47
+ },
48
+ options: {
49
+ associations: {
50
+ group: {},
51
+ },
52
+ },
53
+ configuratorSettings: {
54
+ associations: {
55
+ option: {
56
+ associations: {
57
+ group: {},
58
+ },
59
+ },
60
+ },
61
+ },
62
+ children: {
63
+ associations: {
64
+ properties: {
65
+ associations: {
66
+ group: {},
67
+ },
68
+ },
69
+ options: {
70
+ associations: {
71
+ group: {},
72
+ },
73
+ },
74
+ },
75
+ },
76
+ },
77
+ } as operations["searchPage post /search"]["body"];
78
+
12
79
  const { data: productDetails, pending } = useAsyncData(
13
80
  () => `product-${productId.value ?? "none"}`,
14
81
  async () => {
@@ -17,6 +84,7 @@ const { data: productDetails, pending } = useAsyncData(
17
84
  "readProductDetail post /product/{productId}",
18
85
  {
19
86
  pathParams: { productId: productId.value },
87
+ body: searchCriteria,
20
88
  },
21
89
  );
22
90
  return response.data;
@@ -65,7 +133,7 @@ const emit = defineEmits(["product-added"]);
65
133
  <div v-if="productDetails?.configurator">
66
134
  <ProductConfigurator2
67
135
  v-if="productDetails?.configurator"
68
- :p="product"
136
+ :p="productDetails.product"
69
137
  :c="productDetails.configurator"
70
138
  @variant-switched="onVariantSwitched"
71
139
  />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopbite-de/storefront",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "main": "nuxt.config.ts",
5
5
  "description": "Shopware storefront for food delivery shops",
6
6
  "keywords": [