@revenexx/cover 0.2.23 → 0.2.24
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/app/app.config.ts
CHANGED
|
@@ -54,6 +54,32 @@ export default defineAppConfig({
|
|
|
54
54
|
sku_desc: true,
|
|
55
55
|
},
|
|
56
56
|
},
|
|
57
|
+
// The reassurance lines under the buy box and in the cart summary. Both
|
|
58
|
+
// are promises about THIS merchant's terms, and a storefront whose terms
|
|
59
|
+
// differ has to be able to take one down — a shop with three weeks of lead
|
|
60
|
+
// time must not tell buyers it delivers by the next working day.
|
|
61
|
+
//
|
|
62
|
+
// Maps rather than lists, for the reason spelled out at `search.sorts`:
|
|
63
|
+
// app.config merges with defu, which CONCATENATES arrays, so an app
|
|
64
|
+
// overriding a list would append to the layer's instead of replacing it.
|
|
65
|
+
// Booleans merge key by key, and an unset key stays on — an app that
|
|
66
|
+
// configures nothing behaves exactly as before.
|
|
67
|
+
//
|
|
68
|
+
// Display order follows the declaration here, not the override.
|
|
69
|
+
product: {
|
|
70
|
+
incentives: {
|
|
71
|
+
delivery: true,
|
|
72
|
+
paymentTerms: true,
|
|
73
|
+
volume: true,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
cart: {
|
|
77
|
+
trust: {
|
|
78
|
+
delivery: true,
|
|
79
|
+
invoice: true,
|
|
80
|
+
support: true,
|
|
81
|
+
},
|
|
82
|
+
},
|
|
57
83
|
ui: {
|
|
58
84
|
icons: nuxtUiIcons(DEFAULT_ICON_WEIGHT),
|
|
59
85
|
},
|
|
@@ -73,11 +73,24 @@ const incentiveProgress = computed(() => {
|
|
|
73
73
|
return Math.min(100, Math.round((subtotalAmount.value / openIncentive.value.threshold) * 100));
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
+
/**
|
|
77
|
+
* The promises that close B2B orders — and promises are merchant-specific. A
|
|
78
|
+
* storefront switches off what its own terms do not cover; a shop with three
|
|
79
|
+
* weeks of lead time must not tell buyers it delivers by the next working day.
|
|
80
|
+
* `id` is the config key, `token` only the icon. Declaration order decides
|
|
81
|
+
* display order, the config only membership, and an unset key stays on.
|
|
82
|
+
*/
|
|
76
83
|
const TRUST_ITEMS = [
|
|
77
|
-
{ token: "delivery", key: "cart.trust.delivery" },
|
|
78
|
-
{ token: "payment", key: "cart.trust.invoice" },
|
|
79
|
-
{ token: "phone", key: "cart.trust.support" },
|
|
84
|
+
{ id: "delivery", token: "delivery", key: "cart.trust.delivery" },
|
|
85
|
+
{ id: "invoice", token: "payment", key: "cart.trust.invoice" },
|
|
86
|
+
{ id: "support", token: "phone", key: "cart.trust.support" },
|
|
80
87
|
] as const;
|
|
88
|
+
|
|
89
|
+
const appConfig = useAppConfig();
|
|
90
|
+
const trustItems = computed(() => {
|
|
91
|
+
const configured = appConfig.cart?.trust as Record<string, boolean> | undefined;
|
|
92
|
+
return TRUST_ITEMS.filter(item => configured?.[item.id] !== false);
|
|
93
|
+
});
|
|
81
94
|
</script>
|
|
82
95
|
|
|
83
96
|
<template>
|
|
@@ -176,12 +189,13 @@ const TRUST_ITEMS = [
|
|
|
176
189
|
|
|
177
190
|
<!-- Trust: the promises that close B2B orders -->
|
|
178
191
|
<ul
|
|
192
|
+
v-if="trustItems.length"
|
|
179
193
|
role="list"
|
|
180
194
|
class="space-y-1.5 pt-1 border-t border-(--ui-border) print:hidden"
|
|
181
195
|
>
|
|
182
196
|
<li
|
|
183
|
-
v-for="item in
|
|
184
|
-
:key="item.
|
|
197
|
+
v-for="item in trustItems"
|
|
198
|
+
:key="item.id"
|
|
185
199
|
class="flex items-start gap-2 text-xs text-muted pt-1"
|
|
186
200
|
>
|
|
187
201
|
<UIcon
|
|
@@ -34,6 +34,19 @@ const quantityExceeded = computed(() =>
|
|
|
34
34
|
let exceededTimer: ReturnType<typeof setTimeout> | null = null;
|
|
35
35
|
const showQuantityExceeded = ref(false);
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* The reassurance lines under the buy box. A storefront switches off what its
|
|
39
|
+
* terms do not cover — offering "volume pricing" where none exists is a promise
|
|
40
|
+
* the merchant then has to explain away. Declaration order here decides display
|
|
41
|
+
* order; the config only decides membership, and an unset key stays on.
|
|
42
|
+
*/
|
|
43
|
+
const INCENTIVES = ["delivery", "paymentTerms", "volume"] as const;
|
|
44
|
+
const appConfig = useAppConfig();
|
|
45
|
+
const incentives = computed<string[]>(() => {
|
|
46
|
+
const configured = appConfig.product?.incentives as Record<string, boolean> | undefined;
|
|
47
|
+
return INCENTIVES.filter(key => configured?.[key] !== false);
|
|
48
|
+
});
|
|
49
|
+
|
|
37
50
|
function triggerExceededError() {
|
|
38
51
|
showQuantityExceeded.value = true;
|
|
39
52
|
if (exceededTimer !== null) {
|
|
@@ -171,9 +184,12 @@ onUnmounted(() => {
|
|
|
171
184
|
/>
|
|
172
185
|
|
|
173
186
|
<!-- B2B incentives -->
|
|
174
|
-
<ul
|
|
187
|
+
<ul
|
|
188
|
+
v-if="incentives.length"
|
|
189
|
+
class="rounded-xl bg-elevated/60 ring-1 ring-(--ui-border) divide-y divide-(--ui-border)"
|
|
190
|
+
>
|
|
175
191
|
<li
|
|
176
|
-
v-for="incentive in
|
|
192
|
+
v-for="incentive in incentives"
|
|
177
193
|
:key="incentive"
|
|
178
194
|
class="flex items-center gap-2.5 px-3.5 py-2.5 text-sm text-muted"
|
|
179
195
|
>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revenexx/cover",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.24",
|
|
4
4
|
"description": "Cover \u2014 revenexx design system for Nuxt. Distributed as a Nuxt layer: generic UI components, theming tokens and stores shared by the demo shop, custom storefronts and the Blokkli theme.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./nuxt.config.ts",
|