basklee-nuxt 0.9.3 → 0.9.5

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 (35) hide show
  1. package/README.md +4 -0
  2. package/package.json +2 -2
  3. package/templates/app/components/basklee/account/StorefrontLogout.README.md +2 -0
  4. package/templates/app/components/basklee/blog/BlogArticle.README.md +1 -1
  5. package/templates/app/components/basklee/blog/BlogArticle.vue +64 -11
  6. package/templates/app/components/basklee/orders/OrderDetails.README.md +2 -0
  7. package/templates/app/components/basklee/orders/OrderDetails.vue +5 -0
  8. package/templates/app/components/basklee/storefront/StorefrontFooter.README.md +6 -0
  9. package/templates/app/components/basklee/storefront/StorefrontFooter.vue +21 -4
  10. package/templates/app/components/basklee/stores/StorefrontStores.README.md +2 -0
  11. package/templates/app/components/basklee/stores/StorefrontStores.vue +2 -1
  12. package/templates/app/composables/useBaskleeCart.ts +356 -2
  13. package/templates/app/layouts/default.vue +2 -1
  14. package/templates/app/pages/browse.vue +2 -2
  15. package/templates/app/utils/basklee/activityLabels.ts +15 -0
  16. package/templates/app/utils/basklee/blogArticleHtml.ts +268 -2
  17. package/templates/app/utils/basklee/browseLabels.ts +12 -0
  18. package/templates/app/utils/basklee/cartLabels.ts +124 -0
  19. package/templates/app/utils/basklee/cartMemory.ts +614 -0
  20. package/templates/app/utils/basklee/contactLabels.ts +12 -0
  21. package/templates/app/utils/basklee/directoryLabels.ts +3 -0
  22. package/templates/app/utils/basklee/featureLabels.ts +12 -0
  23. package/templates/app/utils/basklee/footerLabels.ts +3 -0
  24. package/templates/app/utils/basklee/htmlText.ts +1 -1
  25. package/templates/app/utils/basklee/photoDetail.ts +59 -0
  26. package/templates/app/utils/basklee/productActions.ts +8 -0
  27. package/templates/app/utils/basklee/profile.ts +52 -0
  28. package/templates/app/utils/basklee/profileLabels.ts +15 -0
  29. package/templates/app/utils/basklee/reviewLabels.ts +6 -0
  30. package/templates/app/utils/basklee/sellerDirectory.ts +112 -0
  31. package/templates/app/utils/basklee/sessionLabels.ts +6 -6
  32. package/templates/app/utils/basklee/storeDirectory.ts +26 -0
  33. package/templates/app/utils/basklee/subscriptionLabels.ts +3 -0
  34. package/templates/app/utils/basklee/tabLocation.ts +37 -0
  35. package/templates/app/utils/basklee/ticketDraft.ts +56 -0
package/README.md CHANGED
@@ -1170,3 +1170,7 @@ See [`templates/basklee/COMPONENTS.md`](templates/basklee/COMPONENTS.md)
1170
1170
  for the maintained route/component/endpoint table. Components use the named
1171
1171
  API client, confirmed mutation results and English/Russian/Spanish labels. Customer
1172
1172
  source bundles include transitive dependencies and installation guidance.
1173
+
1174
+ ---
1175
+
1176
+ Powered by [Basklee](https://basklee.com).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "basklee-nuxt",
3
- "version": "0.9.3",
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.",
3
+ "version": "0.9.5",
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",
7
7
  "author": "Basklee",
@@ -10,6 +10,8 @@ after successful logout retries only AppLoad, without repeating the mutation.
10
10
  The presentation component emits `retry` and `selectHome`; its documentation
11
11
  preview never signs out the reader.
12
12
 
13
+ The progress and success messages say that the session is ended on all devices: `profile_logout` signs the customer out everywhere, and the page says so.
14
+
13
15
  ## Related components
14
16
 
15
17
  [Profile menu](https://docs.basklee.com/en/sandbox/components/nuxt/profile-menu), [Header](https://docs.basklee.com/en/sandbox/components/nuxt/header).
@@ -8,7 +8,7 @@ The supplied storefront uses this component at `/journal`.
8
8
 
9
9
  ## Contract and dependencies
10
10
 
11
- The supplied `app/pages/journal/[id].vue` loads the article during the server render with `blog_posts_get` and `filters.id = postId`, using the visitor's cookies, and passes it in `initialPost`; the browser shows it without another request. Without `initialPost` (after client-side navigation) the component sends the same request itself. Full text appears only when both `is_full` and `has_full_access` are true; otherwise the preview and the access panel remain. Article HTML is sanitized with DOMPurify in `app/utils/basklee/blogArticleHtml.ts` and keeps what the marketplace blog editor writes: headings, paragraphs and line breaks, bold, italic, underline, strikethrough, subscript and superscript, links, bullet, numbered and task lists, quotes, dividers, inline code and code blocks, tables with merged cells, images and galleries, video and audio with controls, YouTube players, collapsible sections, alignment, text color, highlight, font and size. External links open in a new tab with `rel="noopener noreferrer"`; editor links to other articles open `/journal/<id>`. Formulas are shown as their LaTeX source. Wide tables and code blocks scroll inside the article, and floated images stack on narrow screens. Products the author places in the text appear at those positions: an empty block with `data-product-id="12"` shows one product card, `data-product-ids="12,15,9"` a row of up to 24 cards. The block keeps the editor's float or centred style, and `data-product-hidden-badges` (`new`, `popular`, `good-deal`) turns card badges off. Products missing from `related_products` are loaded with `products_search` and `filters.id_in`, up to 35 IDs per request, and stored with `store.setProduct()`; a block whose products are not found stays hidden. Article text styles do not reach the cards, and in a narrow article a floated card stands alone in the middle. The helper is `app/utils/basklee/blogProductPlacements.ts`. A YouTube player the editor inserts is an `<iframe>` with a `youtube.com` or `youtube-nocookie.com` `/embed/<id>` address: it is kept, played from `youtube-nocookie.com` at the article's width in 16:9, with fixed `allow`, `loading="lazy"` and referrer attributes, and an optional start second. Other frames, scripts, forms, event attributes and other styles are removed. The server render shows the text as plain paragraphs, which search engines can read; the formatted HTML replaces them in the browser.
11
+ The supplied `app/pages/journal/[id].vue` loads the article during the server render with `blog_posts_get` and `filters.id = postId`, using the visitor's cookies, and passes it in `initialPost`; the browser shows it without another request. Without `initialPost` (after client-side navigation) the component sends the same request itself. Full text appears only when both `is_full` and `has_full_access` are true; otherwise the preview and the access panel remain. Article HTML is sanitized with DOMPurify in `app/utils/basklee/blogArticleHtml.ts` and keeps what the marketplace blog editor writes: headings, paragraphs and line breaks, bold, italic, underline, strikethrough, subscript and superscript, links, bullet, numbered and task lists, quotes, dividers, inline code and code blocks, tables with merged cells, images and galleries, video and audio with controls, YouTube players, collapsible sections, alignment, text color, highlight, font and size. External links open in a new tab with `rel="noopener noreferrer"`; editor links to other articles open `/journal/<id>`. Formulas are shown as their LaTeX source. Wide tables and code blocks scroll inside the article, and floated images stack on narrow screens. Products the author places in the text appear at those positions: an empty block with `data-product-id="12"` shows one product card, `data-product-ids="12,15,9"` a row of up to 24 cards. The block keeps the editor's float or centred style, and `data-product-hidden-badges` (`new`, `popular`, `good-deal`) turns card badges off. Products missing from `related_products` are loaded with `products_search` and `filters.id_in`, up to 35 IDs per request, and stored with `store.setProduct()`; a block whose products are not found stays hidden. Article text styles do not reach the cards, and in a narrow article a floated card stands alone in the middle. The helper is `app/utils/basklee/blogProductPlacements.ts`. A YouTube player the editor inserts is an `<iframe>` with a `youtube.com` or `youtube-nocookie.com` `/embed/<id>` address: it is kept, played from `youtube-nocookie.com` at the article's width in 16:9, with fixed `allow`, `loading="lazy"` and referrer attributes, and an optional start second. Other frames, scripts, forms, event attributes and other styles are removed. The server render shows the article as plain blocks built by `blogArticleBlocks` in the same file: headings, paragraphs with their links (checked like the full text: only web, mail and phone links; editor article links open `/journal/<id>`), lists, quotes and pictures with captions. Search engines read that structure without scripts, the browser hydrates the same blocks, and the formatted HTML replaces them once the component is mounted. Nothing else of the source markup reaches the server render.
12
12
 
13
13
  Reading accounting for an accessible paid article starts after interaction with its visible text. `blog_reading_start` starts a session; `blog_reading_heartbeat` follows the returned interval. Leaving, losing focus, hiding the text or 60 seconds without interaction stops requests. Resuming and delayed timers start a fresh baseline. Confirmed loss of access removes full text and offers a refresh.
14
14
 
@@ -1,5 +1,6 @@
1
1
  <script setup lang="ts">
2
- import { computed, nextTick, onMounted, ref, shallowRef, watch } from 'vue';
2
+ import { computed, defineComponent, h, nextTick, onMounted, ref, shallowRef, watch } from 'vue';
3
+ import type { PropType, VNode } from 'vue';
3
4
  import { useRuntimeConfig } from '#imports';
4
5
  import { useBaskleeStore } from '@/stores/basklee';
5
6
  import { useBaskleeProductsStore } from '@/stores/baskleeProducts';
@@ -16,10 +17,14 @@
16
17
  safePublicUrl,
17
18
  } from '@/utils/basklee/presentation';
18
19
  import {
20
+ blogArticleBlocks,
19
21
  removeLeadingDuplicateBlogHeading,
20
22
  safeBlogArticleHtml,
21
23
  } from '@/utils/basklee/blogArticleHtml';
22
- import { htmlTextParagraphs } from '@/utils/basklee/htmlText';
24
+ import type {
25
+ IBlogArticleInline,
26
+ TBlogArticleBlock,
27
+ } from '@/utils/basklee/blogArticleHtml';
23
28
  import {
24
29
  appMediaUrl,
25
30
  nativeAppOrigin,
@@ -156,10 +161,63 @@
156
161
  const html = computed(() =>
157
162
  safeBlogArticleHtml(articleSource.value, undefined, appOrigin),
158
163
  );
159
- // The server render and hydration show the text as plain paragraphs;
160
- // the sanitized HTML replaces them once the component is mounted.
164
+ // The server render and hydration show the text as plain blocks (headings,
165
+ // paragraphs with links, lists, quotes, pictures: blogArticleBlocks), so
166
+ // search engines read its structure; the sanitized HTML replaces them once
167
+ // the component is mounted.
161
168
  const mounted = ref(false);
162
- const paragraphs = computed(() => htmlTextParagraphs(articleSource.value));
169
+ const BlogArticleBlocks = defineComponent({
170
+ name: 'BlogArticleBlocks',
171
+ props: {
172
+ blocks: { type: Array as PropType<TBlogArticleBlock[]>, required: true },
173
+ },
174
+ setup(props) {
175
+ const inline = (parts: IBlogArticleInline[]) =>
176
+ parts.map((part) =>
177
+ part.href
178
+ ? h(
179
+ 'a',
180
+ part.external
181
+ ? { href: part.href, target: '_blank', rel: 'noopener noreferrer' }
182
+ : { href: part.href },
183
+ part.text,
184
+ )
185
+ : part.text,
186
+ );
187
+ const block = (item: TBlogArticleBlock): VNode => {
188
+ switch (item.kind) {
189
+ case 'heading':
190
+ return h(`h${item.level}`, inline(item.inline));
191
+ case 'list':
192
+ return h(
193
+ item.ordered ? 'ol' : 'ul',
194
+ item.items.map((entry) => h('li', inline(entry))),
195
+ );
196
+ case 'quote':
197
+ return h('blockquote', item.blocks.map(block));
198
+ case 'image':
199
+ return h('figure', [
200
+ h('img', {
201
+ src: item.src,
202
+ alt: item.alt,
203
+ width: item.width,
204
+ height: item.height,
205
+ loading: 'lazy',
206
+ decoding: 'async',
207
+ // Without the editor's size the box stays 3:2 until the formatted text replaces it.
208
+ style: item.width && item.height ? undefined : 'aspect-ratio: 3 / 2; object-fit: contain',
209
+ }),
210
+ ...(item.caption ? [h('figcaption', item.caption)] : []),
211
+ ]);
212
+ default:
213
+ return h('p', inline(item.inline));
214
+ }
215
+ };
216
+
217
+ return () => props.blocks.map(block);
218
+ },
219
+ });
220
+ const blocks = computed(() => blogArticleBlocks(articleSource.value, appOrigin));
163
221
  const cover = computed(() => {
164
222
  const images = [...(post.value?.preview_images ?? [])].sort(
165
223
  (left, right) => left.display_order - right.display_order,
@@ -433,12 +491,7 @@
433
491
  ref="article"
434
492
  class="op-feature-prose"
435
493
  >
436
- <p
437
- v-for="(paragraph, index) in paragraphs"
438
- :key="index"
439
- >
440
- {{ paragraph }}
441
- </p>
494
+ <BlogArticleBlocks :blocks="blocks" />
442
495
  </div>
443
496
  <template
444
497
  v-for="(placement, index) in placements"
@@ -32,6 +32,8 @@ describes dependencies, theme and consumer configuration. Standalone file
32
32
  copying requires the same dependencies. Links to storefront routes use the
33
33
  pages supplied by the full starter.
34
34
 
35
+ While nothing has left yet, the first step of the rail carries the order's own status word, Processing, in place of Placed: the status card and the rail name one stage, not two.
36
+
35
37
  ## Endpoint coverage
36
38
 
37
39
  - `orders_optiongroup_file_get`
@@ -151,6 +151,11 @@
151
151
  if (step.state === 'partial' && step.key === 'delivered') {
152
152
  return statuses.partlyDelivered;
153
153
  }
154
+ // While nothing has left, the first step carries the order's own status
155
+ // word («Processing»): the card and the rail name one stage, not two.
156
+ if (step.key === 'placed' && step.current) {
157
+ return statuses.processing;
158
+ }
154
159
 
155
160
  return labels.value.steps[step.key];
156
161
  }
@@ -24,3 +24,9 @@ When Application Load reports `init.visual_settings.single_seller_mode: true`, S
24
24
  Navigation omits categories with `exclude_from_tree: true` and all their descendants. The full published catalog remains available for product main-category names, links and breadcrumbs.
25
25
 
26
26
  В навигации скрываются категории с `exclude_from_tree: true` и все их подкатегории. Полный каталог опубликованных категорий сохраняется для названий, ссылок и цепочек основной категории товара.
27
+
28
+ ## Powered by Basklee
29
+
30
+ The bottom line of the footer ends with a small link, «Powered by Basklee»: an `<a href="https://basklee.com">` that opens in a new tab and is marked `data-footer-part="PoweredBy"`. Its text is the `powered` label of `footerLabels` (English, Russian, Spanish). The link is external, so the navigation callback is not called for it.
31
+
32
+ Нижняя строка футера заканчивается маленькой ссылкой «Работает на Basklee»: это `<a href="https://basklee.com">`, она открывается в новой вкладке и отмечена `data-footer-part="PoweredBy"`. Её текст — подпись `powered` из `footerLabels` (английский, русский, испанский). Ссылка внешняя, поэтому обработчик навигации для неё не вызывается.
@@ -221,16 +221,33 @@
221
221
  </a>
222
222
  </nav>
223
223
  </div>
224
- <p
224
+ <div
225
225
  class="
226
- m-0 pt-6
226
+ flex flex-wrap items-baseline justify-between gap-x-6 gap-y-1
227
+ pt-6
227
228
  border-0 border-t border-solid border-basklee-inverse-text/15
228
229
  text-xs uppercase leading-6 tracking-[0.08em]
229
230
  text-basklee-inverse-muted
230
231
  "
231
232
  >
232
- © {{ props.year }} {{ company }} · {{ copy.rights }}
233
- </p>
233
+ <p class="m-0">
234
+ © {{ props.year }} {{ company }} · {{ copy.rights }}
235
+ </p>
236
+ <a
237
+ href="https://basklee.com"
238
+ target="_blank"
239
+ rel="noopener"
240
+ class="
241
+ text-basklee-inverse-muted no-underline
242
+ outline-none
243
+ hover:text-basklee-inverse-text
244
+ focus-visible:text-basklee-inverse-text
245
+ "
246
+ data-footer-part="PoweredBy"
247
+ >
248
+ {{ copy.powered }}
249
+ </a>
250
+ </div>
234
251
  </div>
235
252
  </footer>
236
253
  </template>
@@ -36,6 +36,8 @@ describes dependencies, theme and consumer configuration. Standalone file
36
36
  copying requires the same dependencies. Links to storefront routes use the
37
37
  pages supplied by the full starter.
38
38
 
39
+ A phone number is shown as people read it: a number typed with its own spaces, brackets or dashes stays as typed, and a bare run of digits is grouped from the end (`+78120000078` reads `+7 812 000 00 78`). The dial link keeps the digits only.
40
+
39
41
  ## Endpoint coverage
40
42
 
41
43
  - `stores_get`
@@ -20,6 +20,7 @@
20
20
  storeMapMarkers,
21
21
  storeMarkerId,
22
22
  storePhoneLink,
23
+ storePhoneText,
23
24
  } from '@/utils/basklee/storeDirectory';
24
25
  import type { IApiPagination } from '@/interfaces/basklee/accounts/IProfileData';
25
26
  import type {
@@ -298,7 +299,7 @@
298
299
  class="op-feature-link self-start"
299
300
  :href="storePhoneLink(item.phone_number)"
300
301
  >
301
- {{ item.phone_number }}
302
+ {{ storePhoneText(item.phone_number) }}
302
303
  </a>
303
304
  <details v-if="item.working_hours">
304
305
  <summary