basklee-nuxt 0.9.14 → 0.9.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "basklee-nuxt",
3
- "version": "0.9.14",
3
+ "version": "0.9.16",
4
4
  "description": "Nuxt 4 storefront for your Basklee marketplace: setup CLI, server API gateway, typed store and ready-made catalog, cart, checkout and account components in English, Russian and Spanish, plus an Android app build. Powered by Basklee: https://basklee.com",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -3,6 +3,7 @@
3
3
  import { useBaskleeStore } from '@/stores/basklee';
4
4
  import { useBaskleeSelectionsStore } from '@/stores/baskleeSelections';
5
5
  import { profileLabels } from '@/utils/basklee/profileLabels';
6
+ import { phoneForDisplay } from '@/utils/basklee/phone';
6
7
  import { featureLabels } from '@/utils/basklee/featureLabels';
7
8
  import '@/components/basklee/shared/features.css';
8
9
  import type {
@@ -111,7 +112,7 @@
111
112
  >
112
113
  <path d="M8 3h8v18H8zM11 18h2" />
113
114
  </svg>
114
- {{ store.profile.phone }}
115
+ {{ phoneForDisplay(store.profile.phone) }}
115
116
  </li>
116
117
  <li v-if="store.profile?.email">
117
118
  <svg
@@ -4,6 +4,7 @@
4
4
  import { useBaskleeCartContext } from '@/composables/useBaskleeCart';
5
5
  import { featureLabels } from '@/utils/basklee/featureLabels';
6
6
  import { cartLabels } from '@/utils/basklee/cartLabels';
7
+ import { phoneForDisplay } from '@/utils/basklee/phone';
7
8
  import { getAvailableValueFromObject } from '@/utils/basklee/presentation';
8
9
  import { phoneWithCountryCode } from '@/utils/basklee/phone';
9
10
  import {
@@ -216,7 +217,7 @@
216
217
  <h2 class="commerce-subtitle">{{ labels.recipient }}</h2>
217
218
  <p class="op-feature-copy">
218
219
  {{ summary?.contact.receiver?.full_name }} ·
219
- {{ summary?.contact.receiver?.phone }}
220
+ {{ phoneForDisplay(summary?.contact.receiver?.phone) }}
220
221
  </p>
221
222
  <div class="op-feature-actions">
222
223
  <button
@@ -4,6 +4,7 @@
4
4
  import { useBaskleeStore } from '@/stores/basklee';
5
5
  import { useBaskleeSelectionsStore } from '@/stores/baskleeSelections';
6
6
  import { orderLabels } from '@/utils/basklee/orderLabels';
7
+ import { phoneForDisplay } from '@/utils/basklee/phone';
7
8
  import {
8
9
  hasOrderAmount,
9
10
  orderAmount,
@@ -71,7 +72,7 @@
71
72
  const shipments = computed(() => props.order.delivery_froms ?? []);
72
73
  const recipient = computed(() => ({
73
74
  name: props.order.contact.reciever_name || props.order.contact.full_name,
74
- phone: props.order.contact.reciever_phone || props.order.contact.phone,
75
+ phone: phoneForDisplay(props.order.contact.reciever_phone || props.order.contact.phone),
75
76
  email: props.order.contact.email,
76
77
  }));
77
78
  const method = computed(() =>
@@ -60,6 +60,8 @@ export interface ICartReceipt {
60
60
  payment: IPaymentMethod | undefined;
61
61
  address: ICartAddress | null;
62
62
  shipments: ICartMemory['shipments'];
63
+ /** The delivery price was an estimate: the backend makes no invoice until the shop confirms it, so nothing is paid yet. */
64
+ estimate: boolean;
63
65
  }
64
66
  const cartKey: InjectionKey<ReturnType<typeof useBaskleeCart>> =
65
67
  Symbol('cart');
@@ -488,6 +490,7 @@ export function useBaskleeCart(options: IBaskleeCartOptions = {}) {
488
490
  ),
489
491
  address: summary?.cart_address ?? null,
490
492
  shipments: memory?.shipments ?? [],
493
+ estimate: Boolean(summary?.prices?.delivery_price_is_estimate),
491
494
  };
492
495
  keepCartMemory(summary?.id, undefined);
493
496
  memory = undefined;
@@ -147,6 +147,8 @@ const en = {
147
147
  receiptToPay: 'To pay',
148
148
  receiptOnReceipt: 'To pay on receipt',
149
149
  receiptFromWallet: 'Paid from your wallet',
150
+ receiptFromWalletLater: 'Paid from your wallet once the shop confirms the delivery price',
151
+ receiptToPayLater: 'To pay once the shop confirms the delivery price',
150
152
  receiptExpected: 'Expected',
151
153
  currentDelivery: 'Current',
152
154
  pendingDelivery: 'Not confirmed yet',
@@ -313,6 +315,8 @@ const ru: typeof en = {
313
315
  receiptToPay: 'К оплате',
314
316
  receiptOnReceipt: 'К оплате при получении',
315
317
  receiptFromWallet: 'Оплачено из кошелька',
318
+ receiptFromWalletLater: 'Спишется из кошелька, когда магазин подтвердит стоимость доставки',
319
+ receiptToPayLater: 'К оплате, когда магазин подтвердит стоимость доставки',
316
320
  receiptExpected: 'Ожидается',
317
321
  currentDelivery: 'Сейчас',
318
322
  pendingDelivery: 'Ещё не подтверждено',
@@ -481,6 +485,8 @@ const es: typeof en = {
481
485
  receiptToPay: 'A pagar',
482
486
  receiptOnReceipt: 'A pagar al recibir',
483
487
  receiptFromWallet: 'Pagado con tu monedero',
488
+ receiptFromWalletLater: 'Se pagará con tu monedero cuando la tienda confirme el coste del envío',
489
+ receiptToPayLater: 'A pagar cuando la tienda confirme el coste del envío',
484
490
  receiptExpected: 'Entrega prevista',
485
491
  currentDelivery: 'Actual',
486
492
  pendingDelivery: 'Sin confirmar todavía',
@@ -1,3 +1,5 @@
1
+ import { parsePhoneNumberFromString } from 'libphonenumber-js';
2
+
1
3
  /**
2
4
  * A phone number typed without «+» on the Russian storefront, as people in
3
5
  * Russia usually type it: «8 900 555-01-72» (the domestic prefix 8) or
@@ -20,3 +22,19 @@ export function phoneWithCountryCode(value: string, locale: string): string {
20
22
  }
21
23
  return value;
22
24
  }
25
+
26
+ /**
27
+ * A stored phone as people read it: «+12125550161» becomes «+1 212 555 0161»,
28
+ * «+74955550162» becomes «+7 495 555 01 62». The backend keeps numbers in the
29
+ * international format without spaces; a number the library cannot read is
30
+ * shown as stored.
31
+ */
32
+ export function phoneForDisplay(value: string | null | undefined): string {
33
+ const text = (value ?? '').trim();
34
+
35
+ if (!text) {
36
+ return '';
37
+ }
38
+
39
+ return parsePhoneNumberFromString(text)?.formatInternational() ?? text;
40
+ }