@revenexx/cover 0.1.5 → 0.1.6

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.
@@ -9,6 +9,7 @@ const footerLinks = computed(() => (appConfig.footerLinks as typeof defaultFoote
9
9
  const legalLinks = computed(() => (appConfig.legalLinks as typeof defaultLegalLinks | undefined) ?? defaultLegalLinks);
10
10
 
11
11
  const { icon } = useIcons();
12
+ const localePath = useLocalePath();
12
13
 
13
14
  const { t } = useI18n();
14
15
  const year = new Date().getFullYear();
@@ -78,7 +79,7 @@ const year = new Date().getFullYear();
78
79
  :key="link.to"
79
80
  >
80
81
  <NuxtLink
81
- :to="link.to"
82
+ :to="localePath(link.to)"
82
83
  tabindex="0"
83
84
  class="text-sm text-muted dark:text-white/90
84
85
  hover:text-default dark:hover:text-white transition-colors"
@@ -115,7 +116,7 @@ const year = new Date().getFullYear();
115
116
  <NuxtLink
116
117
  v-for="link in legalLinks"
117
118
  :key="link.to"
118
- :to="link.to"
119
+ :to="localePath(link.to)"
119
120
  tabindex="0"
120
121
  class="text-xs text-dimmed dark:text-white/70
121
122
  hover:text-default dark:hover:text-white transition-colors"
@@ -29,7 +29,12 @@ const MULTI_CART_STORAGE = "cover-carts";
29
29
  const ADD_PREF_STORAGE = "cover-cart-add-pref";
30
30
 
31
31
  export const useCartStore = defineStore("cart", () => {
32
- const { public: { cartInactivityTtl, taxIncludedPrices } } = useRuntimeConfig();
32
+ const { public: { cartInactivityTtl: cartInactivityTtlRaw, taxIncludedPrices } } = useRuntimeConfig();
33
+ // A missing/invalid TTL must never collapse to setTimeout(..., NaN),
34
+ // which fires immediately and silently empties the cart after every add.
35
+ const cartInactivityTtl = Number.isFinite(Number(cartInactivityTtlRaw)) && Number(cartInactivityTtlRaw) > 0
36
+ ? Number(cartInactivityTtlRaw)
37
+ : 31 * 60 * 1_000;
33
38
  const items = skipHydrate(ref<CartItem[]>([]));
34
39
  /** Meta of requisitions currently loaded into the cart. */
35
40
  const requisitions = skipHydrate(ref<CartRequisitionMeta[]>([]));
package/nuxt.config.ts CHANGED
@@ -72,6 +72,13 @@ export default defineNuxtConfig({
72
72
  typesensePort: 8108,
73
73
  typesenseProtocol: "http",
74
74
  typesenseApiKey: "xyz",
75
+ public: {
76
+ // Cart state keys the layer's stores read — apps may override, but
77
+ // the layer must ship working defaults (an undefined TTL turns the
78
+ // inactivity timer into setTimeout(..., NaN) = clear immediately).
79
+ cartInactivityTtl: 31 * 60 * 1_000,
80
+ taxIncludedPrices: false,
81
+ },
75
82
  },
76
83
 
77
84
  css: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revenexx/cover",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
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",