@tower_74/cms-app 0.4.0 → 0.6.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.
@@ -1,47 +0,0 @@
1
- <script setup lang="ts">
2
- import Seo from '@/components/Seo.vue';
3
- import PublicLayout from '@/layouts/PublicLayout.vue';
4
- import { pluginBlocks } from '@/plugins';
5
- import { router } from '@inertiajs/vue3';
6
- import { type Block, BlockRenderer, ProductOverview } from '@tower_74/cms-ui';
7
-
8
- interface ProductData {
9
- name: string;
10
- description: string | null;
11
- image: { src: string; alt?: string } | null;
12
- blocks: Block[];
13
- options: Array<{ name: string; values: string[] }>;
14
- variants: Array<{ id: number; options: Record<string, string>; price: string; available: boolean }>;
15
- }
16
-
17
- defineProps<{
18
- site: { name: string };
19
- menu: Array<{ label: string; url: string }>;
20
- footerWidgets: Block[];
21
- cartCount?: number | null;
22
- product: ProductData;
23
- seo: { title: string; description?: string | null; url?: string | null; image?: string | null; type?: string | null };
24
- }>();
25
-
26
- const addToCart = (payload: { variantId: number | string; quantity: number }) => {
27
- // Wired to the cart in Phase 8.3. For now this posts to the (future) cart endpoint.
28
- router.post('/cart', { variant_id: payload.variantId, quantity: payload.quantity }, { preserveScroll: true });
29
- };
30
- </script>
31
-
32
- <template>
33
- <Seo :seo="seo" />
34
-
35
- <PublicLayout :site="site" :menu="menu" :footer-widgets="footerWidgets" :cart-count="cartCount">
36
- <ProductOverview
37
- :name="product.name"
38
- :description="product.description ?? undefined"
39
- :image="product.image ?? undefined"
40
- :options="product.options"
41
- :variants="product.variants"
42
- @add-to-cart="addToCart"
43
- />
44
-
45
- <BlockRenderer v-if="product.blocks.length" :blocks="product.blocks" :components="pluginBlocks()" />
46
- </PublicLayout>
47
- </template>