basklee-nuxt 0.9.13 → 0.9.15

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.13",
3
+ "version": "0.9.15",
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(() =>
@@ -346,7 +346,7 @@
346
346
  }
347
347
 
348
348
  function orderTitle(order: IOrder) {
349
- return `${labels.value.order} № ${order.id}`;
349
+ return labels.value.orderNumber.replace('{id}', String(order.id));
350
350
  }
351
351
 
352
352
  async function confirm(order: IOrder) {
@@ -2,6 +2,7 @@ const en = {
2
2
  title: 'My orders',
3
3
  allOrders: 'All orders',
4
4
  order: 'Order',
5
+ orderNumber: 'Order #{id}',
5
6
  placed: 'Placed',
6
7
  empty: 'No orders in this group',
7
8
  emptyHint: 'Check the other tabs or browse the catalog.',
@@ -144,6 +145,7 @@ const ru: typeof en = {
144
145
  title: 'Мои заказы',
145
146
  allOrders: 'Все заказы',
146
147
  order: 'Заказ',
148
+ orderNumber: 'Заказ № {id}',
147
149
  placed: 'Оформлен',
148
150
  empty: 'В этой группе нет заказов',
149
151
  emptyHint: 'Проверьте другие вкладки или перейдите в каталог.',
@@ -286,6 +288,7 @@ const es: typeof en = {
286
288
  title: 'Mis pedidos',
287
289
  allOrders: 'Todos los pedidos',
288
290
  order: 'Pedido',
291
+ orderNumber: 'Pedido n.º {id}',
289
292
  placed: 'Realizado',
290
293
  empty: 'No hay pedidos en este grupo',
291
294
  emptyHint: 'Revisa las otras pestañas o explora el catálogo.',
@@ -293,8 +296,8 @@ const es: typeof en = {
293
296
  loading: 'Cargando pedidos',
294
297
  tabs: 'Grupos de pedidos',
295
298
  active: 'Activos',
296
- canceled: 'Cancelado',
297
- finished: 'Completado',
299
+ canceled: 'Cancelados',
300
+ finished: 'Completados',
298
301
  refund: 'Devoluciones',
299
302
  details: 'Detalles',
300
303
  status: 'Estado',
@@ -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
+ }
@@ -102,8 +102,8 @@ const en = {
102
102
  const ru: typeof en = {
103
103
  title: 'Поддержка',
104
104
  new: 'Новое обращение',
105
- newAction: 'Создать',
106
- newHint: 'Создать обращение',
105
+ newAction: 'Новое',
106
+ newHint: 'Новое обращение',
107
107
  ticket: 'Обращение',
108
108
  open: 'Открытые',
109
109
  closed: 'Закрытые',