@shopbite-de/storefront 1.23.3 → 1.24.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/.env.example +19 -0
- package/.github/workflows/build.yaml +1 -1
- package/.github/workflows/ci.yaml +6 -3
- package/CLAUDE.md +41 -3
- package/README.md +139 -40
- package/api-gen.config.json +9 -0
- package/api-types/storeApiSchema.shopbite.overrides.json +35 -0
- package/api-types/storeApiTypes.d.ts +95 -81
- package/app/app.vue +37 -53
- package/app/assets/css/main.css +20 -4
- package/app/components/Address/Fields.vue +2 -21
- package/app/components/AnimatedSection.vue +9 -4
- package/app/components/BottomNavi.vue +9 -2
- package/app/components/Cart/Item.vue +21 -10
- package/app/components/Category/Header.vue +9 -3
- package/app/components/Category/Listing.vue +51 -42
- package/app/components/Checkout/PaymentAndDelivery.vue +19 -3
- package/app/components/Checkout/Summary.vue +65 -1
- package/app/components/Cta.vue +4 -2
- package/app/components/Food/MarqueeItem.vue +20 -8
- package/app/components/Footer/Contact.vue +78 -0
- package/app/components/Footer/StoreStatus.vue +30 -0
- package/app/components/Footer.vue +2 -1
- package/app/components/Header/Body.vue +1 -1
- package/app/components/Header/Right.vue +27 -13
- package/app/components/Header/Title.vue +1 -0
- package/app/components/Header.vue +5 -15
- package/app/components/Hero.vue +45 -2
- package/app/components/ImageGallery.vue +11 -5
- package/app/components/Product/Card.vue +9 -3
- package/app/components/Product/CardFooter.vue +22 -12
- package/app/components/User/RegistrationForm.vue +0 -1
- package/app/components/Wishlist.vue +2 -15
- package/app/composables/useAddToCart.ts +13 -13
- package/app/composables/useAddressAutocomplete.ts +12 -19
- package/app/composables/useAddressSuggestionArea.ts +16 -0
- package/app/composables/useAddressValidation.ts +3 -19
- package/app/composables/useCartMutations.ts +168 -0
- package/app/composables/{useCategory.ts → useCategoryById.ts} +1 -1
- package/app/composables/useCategorySeo.ts +22 -25
- package/app/composables/useCheckoutMethodGuard.ts +201 -0
- package/app/composables/useMatomo.ts +25 -0
- package/app/composables/useMatomoConfig.ts +12 -0
- package/app/composables/useMenuSectionSchema.ts +55 -0
- package/app/composables/useNavigation.ts +12 -9
- package/app/composables/usePageSeo.ts +50 -0
- package/app/composables/useRestaurantSchema.ts +64 -0
- package/app/composables/useScrollAnimation.ts +39 -8
- package/app/composables/useSearchTracking.ts +33 -0
- package/app/composables/useSeoUrlRoute.ts +58 -0
- package/app/composables/useSortingSelection.ts +28 -0
- package/app/composables/useStoreStatus.ts +48 -0
- package/app/composables/useTrackEvent.ts +29 -23
- package/app/pages/[...all].vue +4 -4
- package/app/pages/account/recover/password/index.vue +1 -0
- package/app/pages/anmelden.vue +4 -0
- package/app/pages/bestellung/[id]/erfolg.vue +1 -5
- package/app/pages/bestellung/[id]/fehler.vue +2 -2
- package/app/pages/bestellung/[id]/index.vue +9 -3
- package/app/pages/bestellung/bestaetigen.vue +1 -5
- package/app/pages/bestellung/warenkorb.vue +1 -5
- package/app/pages/bestellung/zahlung-versand.vue +1 -5
- package/app/pages/c/[...all].vue +2 -35
- package/app/pages/index.vue +25 -13
- package/app/pages/kontakt.vue +4 -0
- package/app/pages/konto/adressen.vue +4 -0
- package/app/pages/konto/bestellung/[id].vue +4 -0
- package/app/pages/konto/bestellungen.vue +4 -0
- package/app/pages/konto/index.vue +4 -0
- package/app/pages/konto/profil.vue +4 -0
- package/app/pages/maintenance.vue +6 -0
- package/app/pages/merkliste.vue +1 -7
- package/app/pages/passwort-vergessen.vue +1 -0
- package/app/pages/registrierung/bestaetigen.vue +4 -0
- package/app/pages/registrierung/index.vue +4 -0
- package/app/pages/speisekarte/[...all].vue +2 -36
- package/app/pages/suche.vue +24 -21
- package/app/plugins/matomo.ts +35 -0
- package/app/utils/hydrateWhenVisible.ts +20 -0
- package/app/utils/media.ts +33 -0
- package/app/utils/openingHours.ts +67 -0
- package/app/utils/schema.ts +235 -0
- package/app/utils/seo.ts +56 -0
- package/app/utils/seoPath.ts +57 -0
- package/content/index.yml +10 -9
- package/content.config.ts +3 -0
- package/docs/notes/2026-07-05-issue-259-matomo-broken.md +7 -0
- package/docs/notes/2026-09-08-issue-240-shipping-method-blocked.md +83 -0
- package/docs/notes/2026-09-08-issue-241-cart-lock-conflicts.md +63 -0
- package/docs/notes/2026-09-08-issue-244-category-url-trailing-slash.md +65 -0
- package/docs/notes/2026-09-08-issue-276-payment-method-blocked.md +39 -0
- package/docs/notes/2026-09-08-issue-277-typecheck.md +99 -0
- package/docs/notes/2026-09-10-issue-250-animated-section.md +23 -0
- package/docs/notes/2026-09-10-issue-251-shop-data-in-base-layer.md +30 -0
- package/docs/notes/2026-09-10-issue-272-restaurant-schema.md +27 -0
- package/docs/notes/2026-09-10-issue-273-performance-media.md +64 -0
- package/docs/notes/2026-09-10-issue-274-seo-basics.md +49 -0
- package/docs/notes/2026-09-10-issue-275-accessibility.md +46 -0
- package/docs/notes/2026-09-10-issue-290-footer-nap.md +28 -0
- package/docs/notes/2026-09-10-issue-291-seo-url-trailing-slash.md +24 -0
- package/docs/notes/2026-09-10-issue-294-matomo-without-config.md +33 -0
- package/docs/notes/2026-09-10-issue-295-search-hydration-mismatch.md +25 -0
- package/docs/notes/2026-09-10-issue-296-track-direct-search.md +19 -0
- package/docs/notes/2026-09-10-issue-312-store-api-criteria-post.md +64 -0
- package/docs/notes/2026-09-10-issue-313-wishlist-scoped-tailwind.md +29 -0
- package/docs/notes/2026-09-10-issue-314-mobile-js-cost.md +119 -0
- package/node.dockerfile +5 -2
- package/nuxt.config.ts +74 -15
- package/package.json +5 -3
- package/patches/@shopware__nuxt-module@1.5.1.patch +32 -0
- package/pnpm-workspace.yaml +2 -0
- package/public/hero-poster.webp +0 -0
- package/server/api/__sitemap__/urls.get.ts +49 -0
- package/server/api/category/[categoryId].get.ts +20 -9
- package/server/api/content/home.get.ts +14 -0
- package/server/api/content/page.get.ts +22 -0
- package/server/api/listing/[categoryId].get.ts +12 -18
- package/server/api/product/[productId]/cross-selling.get.ts +3 -9
- package/server/api/product/[productId].get.ts +4 -8
- package/server/plugins/site-url.ts +13 -0
- package/server/plugins/sitemap-trailing-slash.ts +26 -0
- package/server/utils/sitemap.ts +60 -0
- package/server/utils/storeApi.ts +34 -0
- package/shopware.d.ts +35 -11
- package/test/nuxt/AddressFields.test.ts +2 -73
- package/test/nuxt/AnimatedSection.test.ts +67 -0
- package/test/nuxt/CartItem.test.ts +95 -0
- package/test/nuxt/FooterContact.test.ts +102 -0
- package/test/nuxt/FooterStoreStatus.test.ts +48 -0
- package/test/nuxt/HeaderRight.test.ts +14 -10
- package/test/nuxt/Hero.test.ts +68 -0
- package/test/nuxt/PaymentAndDelivery.test.ts +67 -8
- package/test/nuxt/RegistrationForm.test.ts +3 -0
- package/test/nuxt/useAddToCart.test.ts +34 -1
- package/test/nuxt/useAddressAutocomplete.test.ts +2 -38
- package/test/nuxt/useAddressSuggestionArea.test.ts +27 -0
- package/test/nuxt/useBusinessHours.test.ts +1 -1
- package/test/nuxt/useCartMutations.test.ts +225 -0
- package/test/nuxt/useCheckoutMethodGuard.test.ts +386 -0
- package/test/nuxt/useScrollAnimation.test.ts +55 -49
- package/test/nuxt/useSearchTracking.test.ts +71 -0
- package/test/nuxt/useSeoUrlRoute.test.ts +93 -0
- package/test/nuxt/useStoreStatus.test.ts +77 -0
- package/test/nuxt/useTrackEvent.test.ts +112 -0
- package/test/unit/media.spec.ts +49 -0
- package/test/unit/openingHours.spec.ts +59 -0
- package/test/unit/schema.spec.ts +243 -0
- package/test/unit/seo.spec.ts +107 -0
- package/test/unit/seoPath.spec.ts +116 -0
- package/test/unit/sitemap.spec.ts +88 -0
- package/test/unit/useCategorySeo.spec.ts +40 -30
- package/test/unit/useSortingSelection.spec.ts +39 -0
- package/app/composables/useValidCitiesForDelivery.ts +0 -12
|
@@ -9,6 +9,11 @@ const { refreshCart } = useCart();
|
|
|
9
9
|
const { isLoggedIn, isGuestSession, refreshUser } = useUser();
|
|
10
10
|
const { isCheckoutEnabled, refresh } = useShopBiteConfig();
|
|
11
11
|
const { trackOrder } = useTrackEvent();
|
|
12
|
+
const {
|
|
13
|
+
isShippingMethodBlocked,
|
|
14
|
+
isPaymentMethodBlocked,
|
|
15
|
+
ensureAvailableCheckoutMethods,
|
|
16
|
+
} = useCheckoutMethodGuard();
|
|
12
17
|
|
|
13
18
|
const {
|
|
14
19
|
public: { storeUrl },
|
|
@@ -26,6 +31,9 @@ onMounted(() => {
|
|
|
26
31
|
activeBillingAddress: {},
|
|
27
32
|
},
|
|
28
33
|
});
|
|
34
|
+
ensureAvailableCheckoutMethods().catch((error) => {
|
|
35
|
+
console.error("[checkout][ensureAvailableCheckoutMethods]", error);
|
|
36
|
+
});
|
|
29
37
|
});
|
|
30
38
|
|
|
31
39
|
useIntervalFn(refresh, 10000);
|
|
@@ -35,9 +43,41 @@ const { handlePayment, paymentUrl } = useOrderPayment(
|
|
|
35
43
|
computed(() => createdOrder.value),
|
|
36
44
|
);
|
|
37
45
|
|
|
46
|
+
/**
|
|
47
|
+
* The shipping or payment method may have become unavailable since the
|
|
48
|
+
* cart was last loaded (availability rules, order value, address).
|
|
49
|
+
* Re-check and switch before creating the order instead of failing with
|
|
50
|
+
* an invalid cart. Reports problems to the customer itself.
|
|
51
|
+
* See issues #240 and #276.
|
|
52
|
+
*/
|
|
53
|
+
async function hasAvailableCheckoutMethods(): Promise<boolean> {
|
|
54
|
+
try {
|
|
55
|
+
if (await ensureAvailableCheckoutMethods()) return true;
|
|
56
|
+
toast.add({
|
|
57
|
+
title: `Keine ${blockedMethodLabel.value} verfügbar`,
|
|
58
|
+
description: `Für deine Bestellung ist aktuell keine ${blockedMethodLabel.value} verfügbar. Bitte prüfe deine Adresse und deinen Warenkorb.`,
|
|
59
|
+
color: "error",
|
|
60
|
+
icon: blockedMethodIcon.value,
|
|
61
|
+
progress: false,
|
|
62
|
+
});
|
|
63
|
+
} catch (error) {
|
|
64
|
+
console.error("[checkout][ensureAvailableCheckoutMethods]", error);
|
|
65
|
+
toast.add({
|
|
66
|
+
title: "Versand- und Zahlart konnten nicht geprüft werden",
|
|
67
|
+
description: "Bitte versuche es in einem Moment erneut.",
|
|
68
|
+
color: "error",
|
|
69
|
+
icon: "i-lucide-x-circle",
|
|
70
|
+
progress: false,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
|
|
38
76
|
async function handleCreateOrder() {
|
|
39
77
|
isPlacingOrder.value = true;
|
|
40
78
|
try {
|
|
79
|
+
if (!(await hasAvailableCheckoutMethods())) return;
|
|
80
|
+
|
|
41
81
|
const order = await createOrder({
|
|
42
82
|
customerComment: "Wunschlieferzeit: " + selectedDeliveryTime.value,
|
|
43
83
|
});
|
|
@@ -63,6 +103,17 @@ async function handleCreateOrder() {
|
|
|
63
103
|
progress: false,
|
|
64
104
|
});
|
|
65
105
|
navigateTo(`/bestellung/${order.id}/erfolg`);
|
|
106
|
+
} catch (error) {
|
|
107
|
+
console.error("[checkout][createOrder]", error);
|
|
108
|
+
toast.add({
|
|
109
|
+
title: "Bestellung fehlgeschlagen",
|
|
110
|
+
description:
|
|
111
|
+
"Deine Bestellung konnte nicht aufgegeben werden. Bitte prüfe deine Angaben und versuche es erneut.",
|
|
112
|
+
color: "error",
|
|
113
|
+
icon: "i-lucide-x-circle",
|
|
114
|
+
progress: false,
|
|
115
|
+
});
|
|
116
|
+
await refreshCart().catch(() => {});
|
|
66
117
|
} finally {
|
|
67
118
|
isPlacingOrder.value = false;
|
|
68
119
|
}
|
|
@@ -81,7 +132,16 @@ const isValidToProceed = computed(
|
|
|
81
132
|
customerDataAvailable.value &&
|
|
82
133
|
isCheckoutEnabled.value &&
|
|
83
134
|
isValidTime.value &&
|
|
84
|
-
shippingAndPaymentSet.value
|
|
135
|
+
shippingAndPaymentSet.value &&
|
|
136
|
+
!isShippingMethodBlocked.value &&
|
|
137
|
+
!isPaymentMethodBlocked.value,
|
|
138
|
+
);
|
|
139
|
+
|
|
140
|
+
const blockedMethodLabel = computed(() =>
|
|
141
|
+
isShippingMethodBlocked.value ? "Versandart" : "Zahlart",
|
|
142
|
+
);
|
|
143
|
+
const blockedMethodIcon = computed(() =>
|
|
144
|
+
isShippingMethodBlocked.value ? "i-lucide-truck" : "i-lucide-badge-euro",
|
|
85
145
|
);
|
|
86
146
|
|
|
87
147
|
const isPlacingOrder = ref(false);
|
|
@@ -101,6 +161,10 @@ const checkoutButtonLabel = computed<string>(() => {
|
|
|
101
161
|
return "Es werden aktuell keine weiteren Bestellungen mehr aufgenommen";
|
|
102
162
|
}
|
|
103
163
|
|
|
164
|
+
if (isShippingMethodBlocked.value || isPaymentMethodBlocked.value) {
|
|
165
|
+
return `Aktuell ist keine ${blockedMethodLabel.value} verfügbar`;
|
|
166
|
+
}
|
|
167
|
+
|
|
104
168
|
return "Jetzt bestellen!";
|
|
105
169
|
});
|
|
106
170
|
</script>
|
package/app/components/Cta.vue
CHANGED
|
@@ -11,11 +11,13 @@ defineProps<{
|
|
|
11
11
|
|
|
12
12
|
<template>
|
|
13
13
|
<div class="relative overflow-hidden">
|
|
14
|
-
<
|
|
14
|
+
<img
|
|
15
15
|
v-if="backgroundImage"
|
|
16
16
|
:src="backgroundImage"
|
|
17
|
+
loading="lazy"
|
|
18
|
+
decoding="async"
|
|
17
19
|
class="absolute inset-0 z-0 w-full h-full object-cover opacity-40"
|
|
18
|
-
alt="
|
|
20
|
+
alt=""
|
|
19
21
|
/>
|
|
20
22
|
<UPageCTA
|
|
21
23
|
variant="soft"
|
|
@@ -19,9 +19,13 @@ const product: Schemas["Product"] = productResponse.product;
|
|
|
19
19
|
|
|
20
20
|
const CART_SUCCESS_TITLE = "Gute Wahl!";
|
|
21
21
|
|
|
22
|
-
const {
|
|
22
|
+
const { addLineItems } = useCartMutations();
|
|
23
23
|
const toast = useToast();
|
|
24
24
|
|
|
25
|
+
// Synchronous guard: a double-click fires before a reactive :disabled
|
|
26
|
+
// binding reaches the DOM.
|
|
27
|
+
const isAdding = ref(false);
|
|
28
|
+
|
|
25
29
|
const alt = computed(() => product.name + " #" + product.productNumber);
|
|
26
30
|
|
|
27
31
|
async function showSuccessToast() {
|
|
@@ -35,20 +39,27 @@ async function showSuccessToast() {
|
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
async function addToCart(productId: string) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
if (isAdding.value) return;
|
|
43
|
+
isAdding.value = true;
|
|
44
|
+
try {
|
|
45
|
+
const newCart = await addLineItems([
|
|
46
|
+
{ id: productId, quantity: 1, type: "product" },
|
|
47
|
+
]);
|
|
48
|
+
if (!newCart) return;
|
|
49
|
+
await showSuccessToast();
|
|
50
|
+
} finally {
|
|
51
|
+
isAdding.value = false;
|
|
52
|
+
}
|
|
44
53
|
}
|
|
45
54
|
</script>
|
|
46
55
|
|
|
47
56
|
<template>
|
|
48
57
|
<div v-if="product" :id="product.id" class="relative inline-block">
|
|
49
|
-
<
|
|
58
|
+
<img
|
|
50
59
|
:src="image"
|
|
51
60
|
:alt="alt"
|
|
61
|
+
loading="lazy"
|
|
62
|
+
decoding="async"
|
|
52
63
|
class="rounded-lg shadow-2xl ring ring-default h-50 md:h-80"
|
|
53
64
|
/>
|
|
54
65
|
<div
|
|
@@ -58,6 +69,7 @@ async function addToCart(productId: string) {
|
|
|
58
69
|
<UButton
|
|
59
70
|
icon="i-lucide-shopping-cart"
|
|
60
71
|
size="lg"
|
|
72
|
+
:disabled="isAdding"
|
|
61
73
|
@click="addToCart(product.id)"
|
|
62
74
|
/>
|
|
63
75
|
</div>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const { site } = useRuntimeConfig().public;
|
|
3
|
+
const { businessHours, refresh } = useBusinessHours();
|
|
4
|
+
|
|
5
|
+
// Put the opening hours into the server-rendered HTML (local SEO, #290);
|
|
6
|
+
// app.vue refreshes them on mount for the open/closed toast.
|
|
7
|
+
onServerPrefetch(() => refresh());
|
|
8
|
+
|
|
9
|
+
const openingHours = computed(() =>
|
|
10
|
+
groupOpeningHours(businessHours.value ?? []),
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
const { street, postalCode, city } = site.address;
|
|
14
|
+
const locality = [postalCode, city].filter(Boolean).join(" ");
|
|
15
|
+
const hasContact = Boolean(
|
|
16
|
+
street || locality || site.telephone || site.googleBusinessProfileUrl,
|
|
17
|
+
);
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<div
|
|
22
|
+
v-if="hasContact || openingHours.length"
|
|
23
|
+
class="mb-10 grid gap-8 sm:grid-cols-2 xl:grid-cols-3"
|
|
24
|
+
>
|
|
25
|
+
<address v-if="hasContact" class="not-italic text-sm">
|
|
26
|
+
<p class="font-semibold">{{ site.name }}</p>
|
|
27
|
+
<div class="mt-6 space-y-1 text-muted">
|
|
28
|
+
<p v-if="street">{{ street }}</p>
|
|
29
|
+
<p v-if="locality">{{ locality }}</p>
|
|
30
|
+
</div>
|
|
31
|
+
<ul
|
|
32
|
+
v-if="site.telephone || site.googleBusinessProfileUrl"
|
|
33
|
+
class="mt-4 space-y-3"
|
|
34
|
+
>
|
|
35
|
+
<li v-if="site.telephone">
|
|
36
|
+
<ULink
|
|
37
|
+
:to="toTelHref(site.telephone)"
|
|
38
|
+
class="flex items-center gap-1.5 text-muted hover:text-default"
|
|
39
|
+
>
|
|
40
|
+
<UIcon name="i-lucide-phone" class="size-4 shrink-0" />
|
|
41
|
+
{{ site.telephone }}
|
|
42
|
+
</ULink>
|
|
43
|
+
</li>
|
|
44
|
+
<li v-if="site.googleBusinessProfileUrl">
|
|
45
|
+
<ULink
|
|
46
|
+
:to="site.googleBusinessProfileUrl"
|
|
47
|
+
target="_blank"
|
|
48
|
+
rel="noopener"
|
|
49
|
+
class="flex items-center gap-1.5 text-muted hover:text-default"
|
|
50
|
+
>
|
|
51
|
+
<UIcon name="i-simple-icons-google" class="size-4 shrink-0" />
|
|
52
|
+
Auf Google ansehen
|
|
53
|
+
</ULink>
|
|
54
|
+
</li>
|
|
55
|
+
</ul>
|
|
56
|
+
</address>
|
|
57
|
+
|
|
58
|
+
<div v-if="openingHours.length" class="text-sm">
|
|
59
|
+
<p class="font-semibold">Öffnungszeiten</p>
|
|
60
|
+
<FooterStoreStatus class="mt-6" />
|
|
61
|
+
<dl class="mt-4 grid grid-cols-[auto_1fr] gap-x-6 gap-y-2 text-muted">
|
|
62
|
+
<template v-for="row in openingHours" :key="row.days">
|
|
63
|
+
<dt class="font-medium text-default">{{ row.days }}</dt>
|
|
64
|
+
<dd>
|
|
65
|
+
<span v-if="row.intervals.length === 0">Ruhetag</span>
|
|
66
|
+
<span
|
|
67
|
+
v-for="interval in row.intervals"
|
|
68
|
+
:key="interval"
|
|
69
|
+
class="block"
|
|
70
|
+
>
|
|
71
|
+
{{ interval }}
|
|
72
|
+
</span>
|
|
73
|
+
</dd>
|
|
74
|
+
</template>
|
|
75
|
+
</dl>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</template>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// Open/closed line above the opening hours. Replaces the status toasts,
|
|
3
|
+
// whose focus proxies Lighthouse flagged on every page (#275). Rendered on
|
|
4
|
+
// the client only, see useStoreStatus.
|
|
5
|
+
const { status } = useStoreStatus();
|
|
6
|
+
|
|
7
|
+
const text = computed(() => {
|
|
8
|
+
if (!status.value) return "";
|
|
9
|
+
if (status.value.open) return `Geöffnet bis ${status.value.closesAt} Uhr`;
|
|
10
|
+
return status.value.nextOpening
|
|
11
|
+
? `Geschlossen, wir öffnen wieder ${status.value.nextOpening}`
|
|
12
|
+
: "Geschlossen";
|
|
13
|
+
});
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<ClientOnly>
|
|
18
|
+
<p v-if="status" role="status" class="flex items-center gap-2 text-sm">
|
|
19
|
+
<span
|
|
20
|
+
class="size-2 shrink-0 rounded-full"
|
|
21
|
+
:class="status.open ? 'bg-success' : 'bg-dimmed'"
|
|
22
|
+
aria-hidden="true"
|
|
23
|
+
/>
|
|
24
|
+
<span class="text-default">{{ text }}</span>
|
|
25
|
+
</p>
|
|
26
|
+
<template #fallback>
|
|
27
|
+
<p class="h-5" aria-hidden="true" />
|
|
28
|
+
</template>
|
|
29
|
+
</ClientOnly>
|
|
30
|
+
</template>
|
|
@@ -36,6 +36,7 @@ const footerColumns = computed<FooterColumn[]>(() =>
|
|
|
36
36
|
<UFooter :ui="{ top: 'border-b border-default' }">
|
|
37
37
|
<template #top>
|
|
38
38
|
<UContainer>
|
|
39
|
+
<FooterContact />
|
|
39
40
|
<UFooterColumns :columns="footerColumns" />
|
|
40
41
|
</UContainer>
|
|
41
42
|
</template>
|
|
@@ -46,7 +47,7 @@ const footerColumns = computed<FooterColumn[]>(() =>
|
|
|
46
47
|
class="text-sm text-muted"
|
|
47
48
|
target="_blank"
|
|
48
49
|
>
|
|
49
|
-
|
|
50
|
+
Bestellsystem von ShopBite • © {{ new Date().getFullYear() }}
|
|
50
51
|
</NuxtLink>
|
|
51
52
|
</template>
|
|
52
53
|
|
|
@@ -3,11 +3,24 @@ import { useUser } from "@shopware/composables";
|
|
|
3
3
|
import type { DropdownMenuItem } from "@nuxt/ui";
|
|
4
4
|
|
|
5
5
|
const cartQuickViewOpen = ref(false);
|
|
6
|
+
// The drawer (vaul) is created on first use instead of on every page (#314).
|
|
7
|
+
const cartQuickViewMounted = ref(false);
|
|
8
|
+
|
|
9
|
+
async function openCartQuickView() {
|
|
10
|
+
if (!cartQuickViewMounted.value) {
|
|
11
|
+
cartQuickViewMounted.value = true;
|
|
12
|
+
await nextTick();
|
|
13
|
+
}
|
|
14
|
+
cartQuickViewOpen.value = true;
|
|
15
|
+
}
|
|
16
|
+
|
|
6
17
|
const { count: cartCount } = useCart();
|
|
7
18
|
const { count: wishListCount } = useWishlist();
|
|
8
19
|
const { isCheckoutEnabled } = useShopBiteConfig();
|
|
9
20
|
const { isLoggedIn, isGuestSession, logout } = useUser();
|
|
10
21
|
const toast = useToast();
|
|
22
|
+
// Shop phone number from the site config; the button is hidden without one (#251).
|
|
23
|
+
const { site } = useRuntimeConfig().public;
|
|
11
24
|
|
|
12
25
|
const logoutHandler = () => {
|
|
13
26
|
logout();
|
|
@@ -75,12 +88,12 @@ const dropDownMenu = computed<DropdownMenuItem[][]>(() => {
|
|
|
75
88
|
|
|
76
89
|
<template>
|
|
77
90
|
<UButton
|
|
91
|
+
v-if="site.telephone"
|
|
78
92
|
color="neutral"
|
|
79
93
|
variant="ghost"
|
|
80
|
-
to="
|
|
81
|
-
target="_blank"
|
|
94
|
+
:to="toTelHref(site.telephone)"
|
|
82
95
|
icon="i-lucide-phone"
|
|
83
|
-
aria-label="Anrufen"
|
|
96
|
+
:aria-label="`Anrufen: ${site.telephone}`"
|
|
84
97
|
/>
|
|
85
98
|
<UDropdownMenu :items="dropDownMenu">
|
|
86
99
|
<UChip v-if="isLoggedIn || isGuestSession" size="3xl" text="✓">
|
|
@@ -110,21 +123,22 @@ const dropDownMenu = computed<DropdownMenuItem[][]>(() => {
|
|
|
110
123
|
/>
|
|
111
124
|
</UChip>
|
|
112
125
|
</div>
|
|
126
|
+
<UChip v-if="isCheckoutEnabled" :text="cartCount" size="3xl">
|
|
127
|
+
<UButton
|
|
128
|
+
aria-label="Zum Warenkorb"
|
|
129
|
+
aria-haspopup="dialog"
|
|
130
|
+
color="neutral"
|
|
131
|
+
variant="ghost"
|
|
132
|
+
icon="i-lucide-shopping-bag"
|
|
133
|
+
@click="openCartQuickView"
|
|
134
|
+
/>
|
|
135
|
+
</UChip>
|
|
113
136
|
<LazyUDrawer
|
|
114
|
-
v-if="
|
|
137
|
+
v-if="cartQuickViewMounted"
|
|
115
138
|
v-model:open="cartQuickViewOpen"
|
|
116
139
|
title="Warenkorb"
|
|
117
140
|
direction="right"
|
|
118
141
|
>
|
|
119
|
-
<UChip :text="cartCount" size="3xl">
|
|
120
|
-
<UButton
|
|
121
|
-
aria-label="Zum Warenkorb"
|
|
122
|
-
color="neutral"
|
|
123
|
-
variant="ghost"
|
|
124
|
-
icon="i-lucide-shopping-bag"
|
|
125
|
-
/>
|
|
126
|
-
</UChip>
|
|
127
|
-
|
|
128
142
|
<template #header>
|
|
129
143
|
<div class="h-full flex flex-col justify-center">
|
|
130
144
|
<h2 class="flex items-center gap-2 text-3xl md:text-4xl mt-8 mb-3 pb-2">
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
const { mainMenu } = useNavigation(false);
|
|
3
|
-
|
|
3
|
+
// The logo link's accessible name; Nuxt UI's default is "Nuxt UI" (#275).
|
|
4
|
+
const { site, shopBite } = useRuntimeConfig().public;
|
|
4
5
|
</script>
|
|
5
6
|
|
|
6
7
|
<template>
|
|
7
|
-
<UHeader>
|
|
8
|
+
<UHeader :title="site.name">
|
|
8
9
|
<template #title>
|
|
9
10
|
<HeaderTitle />
|
|
10
11
|
</template>
|
|
11
12
|
|
|
12
13
|
<UNavigationMenu color="primary" variant="pill" :items="mainMenu" />
|
|
13
|
-
|
|
14
|
+
<!-- Lazy keeps USelectMenu out of the entry chunk of single-channel shops (#314). -->
|
|
15
|
+
<LazySalesChannelSwitch v-if="shopBite.feature.multiChannel" />
|
|
14
16
|
|
|
15
17
|
<template #right>
|
|
16
18
|
<HeaderRight />
|
|
@@ -20,16 +22,4 @@ const loginSlide = ref(false);
|
|
|
20
22
|
<LazyHeaderBody />
|
|
21
23
|
</template>
|
|
22
24
|
</UHeader>
|
|
23
|
-
|
|
24
|
-
<USlideover
|
|
25
|
-
v-model:open="loginSlide"
|
|
26
|
-
title="Konto"
|
|
27
|
-
description="Alle Vorteile eines Kontos genießen"
|
|
28
|
-
>
|
|
29
|
-
<template #body>
|
|
30
|
-
<div class="h-full m-4">
|
|
31
|
-
<LazyUserLoginForm />
|
|
32
|
-
</div>
|
|
33
|
-
</template>
|
|
34
|
-
</USlideover>
|
|
35
25
|
</template>
|
package/app/components/Hero.vue
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { ButtonProps } from "#ui/components/Button.vue";
|
|
3
3
|
|
|
4
|
-
withDefaults(
|
|
4
|
+
const props = withDefaults(
|
|
5
5
|
defineProps<{
|
|
6
6
|
title: string;
|
|
7
7
|
description?: string;
|
|
8
8
|
headline?: string;
|
|
9
9
|
backgroundVideo?: string;
|
|
10
|
+
/** First frame of the video as an image; the LCP element (#273). */
|
|
11
|
+
poster?: string;
|
|
10
12
|
links: ButtonProps[];
|
|
11
13
|
usps?: {
|
|
12
14
|
title?: string;
|
|
@@ -19,13 +21,43 @@ withDefaults(
|
|
|
19
21
|
description: undefined,
|
|
20
22
|
headline: undefined,
|
|
21
23
|
backgroundVideo: undefined,
|
|
24
|
+
poster: undefined,
|
|
22
25
|
usps: () => [],
|
|
23
26
|
},
|
|
24
27
|
);
|
|
25
28
|
|
|
29
|
+
// The poster is server-rendered and preloaded, so the largest paint is a
|
|
30
|
+
// small image instead of a multi-megabyte video. The video only joins on
|
|
31
|
+
// wide screens after hydration; phones never request it (#273).
|
|
32
|
+
const VIDEO_MEDIA_QUERY = "(min-width: 768px)";
|
|
33
|
+
const showVideo = ref(false);
|
|
26
34
|
const videoRef = ref<HTMLVideoElement>();
|
|
27
35
|
|
|
36
|
+
useHead(() => ({
|
|
37
|
+
link: props.poster
|
|
38
|
+
? [
|
|
39
|
+
{
|
|
40
|
+
key: "hero-poster-preload",
|
|
41
|
+
rel: "preload",
|
|
42
|
+
as: "image",
|
|
43
|
+
href: props.poster,
|
|
44
|
+
fetchpriority: "high",
|
|
45
|
+
},
|
|
46
|
+
]
|
|
47
|
+
: [],
|
|
48
|
+
}));
|
|
49
|
+
|
|
28
50
|
onMounted(() => {
|
|
51
|
+
const wide = props.backgroundVideo
|
|
52
|
+
? window.matchMedia?.(VIDEO_MEDIA_QUERY)
|
|
53
|
+
: undefined;
|
|
54
|
+
if (wide) {
|
|
55
|
+
showVideo.value = wide.matches;
|
|
56
|
+
wide.addEventListener("change", (event) => {
|
|
57
|
+
showVideo.value = event.matches;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
29
61
|
// Handle video playback on bfcache restore
|
|
30
62
|
window.addEventListener("pageshow", (event) => {
|
|
31
63
|
if (event.persisted && videoRef.value) {
|
|
@@ -37,13 +69,24 @@ onMounted(() => {
|
|
|
37
69
|
|
|
38
70
|
<template>
|
|
39
71
|
<div class="relative isolate overflow-hidden">
|
|
72
|
+
<!-- No CSS blur on the poster: blur the image file itself (see docs);
|
|
73
|
+
a filter on a full-screen image delays the first paint on phones. -->
|
|
74
|
+
<img
|
|
75
|
+
v-if="poster"
|
|
76
|
+
:src="poster"
|
|
77
|
+
alt=""
|
|
78
|
+
fetchpriority="high"
|
|
79
|
+
class="absolute inset-0 w-full h-full object-cover -z-20"
|
|
80
|
+
/>
|
|
40
81
|
<video
|
|
82
|
+
v-if="showVideo"
|
|
41
83
|
ref="videoRef"
|
|
42
84
|
autoplay
|
|
43
85
|
loop
|
|
44
86
|
muted
|
|
45
87
|
playsinline
|
|
46
|
-
|
|
88
|
+
preload="metadata"
|
|
89
|
+
:poster="poster"
|
|
47
90
|
class="absolute inset-0 w-full h-full object-cover -z-10 blur-sm scale-105"
|
|
48
91
|
>
|
|
49
92
|
<source :src="backgroundVideo" type="video/mp4" />
|
|
@@ -16,6 +16,10 @@ defineProps<{
|
|
|
16
16
|
images: ImageCarousel[] | undefined;
|
|
17
17
|
links?: ButtonProps[] | undefined;
|
|
18
18
|
}>();
|
|
19
|
+
|
|
20
|
+
// The gallery sits below the fold: a fixed aspect ratio reserves the space
|
|
21
|
+
// (no layout shift) and the slides load lazily (#273).
|
|
22
|
+
const imageClass = "aspect-[4/3] w-full rounded-lg object-cover";
|
|
19
23
|
</script>
|
|
20
24
|
|
|
21
25
|
<template>
|
|
@@ -28,7 +32,7 @@ defineProps<{
|
|
|
28
32
|
<template #body>
|
|
29
33
|
<ClientOnly>
|
|
30
34
|
<UCarousel
|
|
31
|
-
v-slot="{ item
|
|
35
|
+
v-slot="{ item }"
|
|
32
36
|
arrows
|
|
33
37
|
:items="images"
|
|
34
38
|
class="w-full max-w-2xl mx-auto"
|
|
@@ -36,8 +40,9 @@ defineProps<{
|
|
|
36
40
|
<img
|
|
37
41
|
:src="item.image"
|
|
38
42
|
:alt="item.alt"
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
loading="lazy"
|
|
44
|
+
decoding="async"
|
|
45
|
+
:class="imageClass"
|
|
41
46
|
/>
|
|
42
47
|
</UCarousel>
|
|
43
48
|
<template #fallback>
|
|
@@ -46,8 +51,9 @@ defineProps<{
|
|
|
46
51
|
v-if="images?.[0]"
|
|
47
52
|
:src="images[0].image"
|
|
48
53
|
:alt="images[0].alt"
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
loading="lazy"
|
|
55
|
+
decoding="async"
|
|
56
|
+
:class="imageClass"
|
|
51
57
|
/>
|
|
52
58
|
</div>
|
|
53
59
|
</template>
|
|
@@ -45,16 +45,22 @@ function onVariantSelected(variant: Schemas["Product"]) {
|
|
|
45
45
|
</template>
|
|
46
46
|
|
|
47
47
|
<div v-if="product.cover?.media?.url">
|
|
48
|
-
<
|
|
48
|
+
<img
|
|
49
49
|
:src="product.cover.media.url"
|
|
50
|
-
|
|
50
|
+
:srcset="mediaSrcSet(product.cover.media)"
|
|
51
51
|
sizes="(min-width: 1024px) 50vw, 100vw"
|
|
52
|
+
:width="mediaSize(product.cover.media)?.width"
|
|
53
|
+
:height="mediaSize(product.cover.media)?.height"
|
|
54
|
+
:alt="label"
|
|
55
|
+
loading="lazy"
|
|
56
|
+
decoding="async"
|
|
57
|
+
class="rounded-md h-auto max-w-full object-contain transition-opacity duration-700"
|
|
52
58
|
/>
|
|
53
59
|
</div>
|
|
54
60
|
|
|
55
61
|
<template #title>
|
|
56
62
|
<div class="flex flex-row items-center gap-1">
|
|
57
|
-
<span class="text-sm text-
|
|
63
|
+
<span class="text-sm text-primary">#{{ number }}</span>
|
|
58
64
|
<ProductCardKitchen :sorted-properties="sortedProperties" />
|
|
59
65
|
<p class="text-base text-pretty font-semibold text-highlighted">
|
|
60
66
|
{{ label }}
|
|
@@ -17,8 +17,16 @@ const { isCheckoutEnabled } = useShopBiteConfig();
|
|
|
17
17
|
const { getFormattedPrice } = useCommercePrice();
|
|
18
18
|
|
|
19
19
|
const openDetails = ref(false);
|
|
20
|
+
// The collapsible is created on the first toggle: mounting one per card
|
|
21
|
+
// (with its height measurement) was a large part of the listing's
|
|
22
|
+
// hydration cost (#314). Never rendered on the server.
|
|
23
|
+
const detailsMounted = ref(false);
|
|
20
24
|
|
|
21
|
-
function toggleDetails() {
|
|
25
|
+
async function toggleDetails() {
|
|
26
|
+
if (!detailsMounted.value) {
|
|
27
|
+
detailsMounted.value = true;
|
|
28
|
+
await nextTick();
|
|
29
|
+
}
|
|
22
30
|
openDetails.value = !openDetails.value;
|
|
23
31
|
}
|
|
24
32
|
</script>
|
|
@@ -37,15 +45,17 @@ function toggleDetails() {
|
|
|
37
45
|
/>
|
|
38
46
|
</div>
|
|
39
47
|
</div>
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
<UCollapsible
|
|
49
|
+
v-if="detailsMounted"
|
|
50
|
+
v-model:open="openDetails"
|
|
51
|
+
class="flex flex-col gap-2"
|
|
52
|
+
>
|
|
53
|
+
<template #content>
|
|
54
|
+
<LazyProductDetail
|
|
55
|
+
:product-id="product.id"
|
|
56
|
+
@product-added="toggleDetails"
|
|
57
|
+
@variant-selected="emit('variantSelected', $event)"
|
|
58
|
+
/>
|
|
59
|
+
</template>
|
|
60
|
+
</UCollapsible>
|
|
51
61
|
</template>
|