@revenexx/cover 0.2.25 → 0.2.27

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 (83) hide show
  1. package/app/api/brands.ts +5 -0
  2. package/app/api/categories.ts +1 -0
  3. package/app/api/product.ts +2 -0
  4. package/app/app.config.ts +8 -0
  5. package/app/components/cart/quickadd/CartQuickAdd.vue +110 -34
  6. package/app/components/category/view/GridView.vue +34 -13
  7. package/app/components/category/view/ListView.vue +5 -5
  8. package/app/components/checkout/onepage/CheckoutDeliverySection.vue +29 -1
  9. package/app/components/checkout/onepage/CheckoutPaymentSection.vue +30 -1
  10. package/app/components/layout/AppLogo.vue +2 -1
  11. package/app/components/layout/footer/Footer.vue +9 -3
  12. package/app/components/layout/header/CategoryPanel.vue +92 -0
  13. package/app/components/layout/header/MainNav.vue +89 -2
  14. package/app/components/listing/ListingResults.vue +16 -2
  15. package/app/components/listing/ListingSubcategories.vue +124 -0
  16. package/app/components/product/card/Compact.vue +144 -0
  17. package/app/components/product/detail/ProductDetailAssociations.vue +96 -0
  18. package/app/components/product/detail/ProductDetailIdentity.vue +50 -5
  19. package/app/components/product/detail/ProductDetailVariantRow.vue +139 -0
  20. package/app/components/product/detail/ProductDetailVariants.vue +613 -0
  21. package/app/components/product/media/ProductMediaImage.vue +70 -0
  22. package/app/components/ui/forms/SearchInput.vue +14 -2
  23. package/app/components/ui/media/ImageSlider.vue +158 -0
  24. package/app/composables/useBranding.ts +22 -0
  25. package/app/composables/useBrands.ts +42 -0
  26. package/app/composables/useCategories.ts +55 -1
  27. package/app/composables/useProduct.ts +5 -4
  28. package/app/composables/useProductAssociations.ts +35 -0
  29. package/app/composables/useProductImage.ts +35 -2
  30. package/app/composables/useProductVariants.ts +46 -0
  31. package/app/composables/useSearchListing.ts +16 -5
  32. package/app/composables/useSubcategoryTiles.ts +36 -0
  33. package/app/config/navigation.ts +9 -0
  34. package/app/config/palette.ts +1 -0
  35. package/app/config/quickActions.ts +137 -0
  36. package/app/config/themes.ts +1 -0
  37. package/app/interfaces/brand.ts +16 -0
  38. package/app/interfaces/category.ts +45 -0
  39. package/app/interfaces/image-slider.ts +18 -0
  40. package/app/interfaces/product-associations.ts +32 -0
  41. package/app/interfaces/product-detail.ts +6 -0
  42. package/app/interfaces/product-variants.ts +73 -0
  43. package/i18n/locales/de/account.json +17 -0
  44. package/i18n/locales/de/cart.json +5 -1
  45. package/i18n/locales/de/checkout.json +2 -0
  46. package/i18n/locales/de/common.json +42 -2
  47. package/i18n/locales/de/editor.json +91 -0
  48. package/i18n/locales/de/product.json +48 -2
  49. package/i18n/locales/de/search.json +4 -2
  50. package/i18n/locales/en/account.json +17 -0
  51. package/i18n/locales/en/cart.json +4 -0
  52. package/i18n/locales/en/checkout.json +2 -0
  53. package/i18n/locales/en/common.json +42 -2
  54. package/i18n/locales/en/editor.json +91 -0
  55. package/i18n/locales/en/product.json +47 -1
  56. package/i18n/locales/en/search.json +3 -1
  57. package/nuxt.config.ts +10 -0
  58. package/package.json +3 -1
  59. package/public/img/brands/revenexx.svg +39 -0
  60. package/server/api/brands.get.ts +27 -0
  61. package/server/api/categories/[slug]/subcategories.get.ts +280 -0
  62. package/server/api/product/[id]/associations.get.ts +27 -0
  63. package/server/api/product/[id]/variants.get.ts +27 -0
  64. package/server/api/quick-actions.get.ts +43 -0
  65. package/server/api/typesense/search.post.ts +116 -13
  66. package/server/data/categories.json +5 -0
  67. package/server/data/product-associations.json +44 -0
  68. package/server/data/product-detail.json +346 -0
  69. package/server/data/product-list.json +340 -0
  70. package/server/data/product-variant-models.json +75 -0
  71. package/server/interfaces/brand.ts +17 -0
  72. package/server/interfaces/product.ts +14 -0
  73. package/server/services/ApiBrandService.ts +110 -0
  74. package/server/services/ApiProductService.ts +43 -9
  75. package/server/services/LocalFileProductService.ts +200 -6
  76. package/server/services/MockBrandService.ts +52 -0
  77. package/server/utils/brandService.ts +24 -0
  78. package/server/utils/contentTenant.ts +67 -0
  79. package/server/utils/liveCatalog.ts +744 -46
  80. package/server/utils/productService.ts +6 -1
  81. package/server/utils/productsSchema.ts +5 -2
  82. package/server/utils/revenexxCredentials.ts +258 -0
  83. package/server/utils/revenexxSdk.ts +38 -47
@@ -0,0 +1,139 @@
1
+ <script setup lang="ts">
2
+ /**
3
+ * One row of the variants table.
4
+ *
5
+ * Its own component because price, orderability and add-to-cart are per-product
6
+ * composable instances (`useOffer` via CategoryPrice, `useProductCardActions`) —
7
+ * they cannot be called from inside a `v-for`. The row synthesises the
8
+ * `ProductList` shape those expect from the variant plus the page product's tax
9
+ * rate and category path.
10
+ *
11
+ * Two details that read as odd in the template: the current article links to
12
+ * ITSELF, because that is what makes the router mark it `aria-current="page"` —
13
+ * the cue that tells a screen reader which row you are on; and the order
14
+ * button's absolutely positioned empty span pads its hit area out to 3rem on
15
+ * coarse pointers only.
16
+ */
17
+ import type { ProductList } from "../../../interfaces/product-list";
18
+ import type { ProductVariantAxis, ProductVariantRow } from "../../../interfaces/product-variants";
19
+
20
+ const props = withDefaults(defineProps<{
21
+ row: ProductVariantRow;
22
+ axes: readonly ProductVariantAxis[];
23
+ /** Localised route to this variant's detail page. */
24
+ to: string;
25
+ /** Catalog tax rate of the page's article — variants share the model's. */
26
+ taxRate: number;
27
+ categorySlug?: string;
28
+ subcategorySlug?: string;
29
+ showOrderButton?: boolean;
30
+ }>(), {
31
+ categorySlug: "",
32
+ showOrderButton: true,
33
+ });
34
+
35
+ const { t } = useI18n();
36
+ const { icon } = useIcons();
37
+
38
+ const asProduct = computed<ProductList>(() => ({
39
+ id: props.row.id,
40
+ sku: props.row.sku,
41
+ name: props.row.name,
42
+ available: props.row.available,
43
+ prices: [],
44
+ tax: { rate: props.taxRate },
45
+ // No per-variant image in the payload — the cart falls back to its
46
+ // placeholder icon, and the table shows no thumbnails anyway. The category
47
+ // path IS carried through so a cart line can link back to its product.
48
+ image: "",
49
+ category: "",
50
+ categorySlug: props.categorySlug,
51
+ ...(props.subcategorySlug ? { subcategorySlug: props.subcategorySlug } : {}),
52
+ }));
53
+
54
+ const { isOutOfStock, hasPrice, addToCart } = useProductCardActions(() => asProduct.value);
55
+
56
+ const isInStock = computed(() => props.row.available && !isOutOfStock.value);
57
+ const canOrder = computed(() => !isOutOfStock.value && hasPrice.value);
58
+ const addToCartLabel = computed(() => t("product.actions.addToCart"));
59
+ </script>
60
+
61
+ <template>
62
+ <tr :class="row.isSelf ? 'bg-primary/5' : 'hover:bg-elevated/40'">
63
+ <td
64
+ class="py-3 pr-4 whitespace-nowrap"
65
+ :class="row.isSelf ? 'border-l-2 border-primary pl-3' : 'pl-0'"
66
+ >
67
+ <NuxtLink
68
+ :to="to"
69
+ class="tabular-nums"
70
+ :class="row.isSelf ? 'font-semibold text-highlighted' : 'text-primary hover:underline'"
71
+ >
72
+ {{ row.sku }}
73
+ </NuxtLink>
74
+ </td>
75
+
76
+ <td
77
+ v-for="axis in axes"
78
+ :key="axis.code"
79
+ class="py-3 pr-4 whitespace-nowrap tabular-nums"
80
+ :class="row.values[axis.code] ? 'text-highlighted' : 'text-muted'"
81
+ >
82
+ {{ row.values[axis.code] ?? '—' }}
83
+ </td>
84
+
85
+ <td class="py-3 pr-4 text-muted">
86
+ {{ row.shortName }}
87
+ </td>
88
+
89
+ <td class="py-3 pr-4 text-right whitespace-nowrap">
90
+ <CategoryInfoCategoryPrice
91
+ :product="asProduct"
92
+ class="justify-items-end"
93
+ />
94
+ </td>
95
+
96
+ <td class="py-3 pr-4 whitespace-nowrap">
97
+ <span class="inline-flex items-center gap-1.5">
98
+ <span
99
+ class="size-2 shrink-0 rounded-full"
100
+ :class="isInStock ? 'bg-success' : 'bg-error'"
101
+ aria-hidden="true"
102
+ />
103
+ <span :class="isInStock ? 'text-success' : 'text-error'">
104
+ {{ isInStock ? t('product.stock.available') : t('product.stock.unavailable') }}
105
+ </span>
106
+ </span>
107
+ </td>
108
+
109
+ <td
110
+ v-if="showOrderButton"
111
+ class="py-3 text-right"
112
+ >
113
+ <button
114
+ type="button"
115
+ :disabled="!canOrder"
116
+ class="relative inline-flex items-center gap-1.5 rounded-md py-1.5 pr-2.5 pl-2
117
+ text-sm font-medium ring-1 cursor-pointer text-primary ring-(--ui-border)
118
+ hover:bg-primary/5 disabled:cursor-not-allowed disabled:text-dimmed
119
+ disabled:ring-(--ui-border) disabled:hover:bg-transparent
120
+ focus-visible:outline-2 focus-visible:outline-offset-2
121
+ focus-visible:outline-(--ui-primary)"
122
+ :title="canOrder ? addToCartLabel : t('product.variants.notOrderable')"
123
+ :aria-label="t('product.variants.addToCartAria', { sku: row.sku })"
124
+ @click="addToCart()"
125
+ >
126
+ <span
127
+ class="absolute top-1/2 left-1/2 size-[max(100%,3rem)] -translate-1/2
128
+ pointer-fine:hidden"
129
+ aria-hidden="true"
130
+ />
131
+ <UIcon
132
+ :name="icon('cart')"
133
+ class="size-4 shrink-0"
134
+ />
135
+ <span class="max-sm:sr-only">{{ t('product.actions.order') }}</span>
136
+ </button>
137
+ </td>
138
+ </tr>
139
+ </template>