@thorprovider/storefront 0.14.0 → 0.15.1

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 (112) hide show
  1. package/README.md +28 -12
  2. package/assets/templates/app/app/[[...slug]]/page.tsx +6 -0
  3. package/assets/templates/app/app/layout.tsx +2 -2
  4. package/assets/templates/app/lib/__STOREFRONT__/commerce.ts +11 -4
  5. package/assets/templates/app/lib/__STOREFRONT__/confirmation.core.ts +7 -4
  6. package/assets/templates/app/lib/__STOREFRONT__/mappers.ts +18 -3
  7. package/assets/templates/app/lib/__STOREFRONT__/registry.tsx +10 -0
  8. package/assets/templates/app/lib/__STOREFRONT__/state.core.ts +8 -0
  9. package/assets/templates/app/lib/__STOREFRONT__/store-context.ts +84 -18
  10. package/assets/templates/app/lib/__STOREFRONT__/views/sections/schema.universal-main-menu.ts +3 -1
  11. package/assets/templates/app/public/images/README.md +43 -0
  12. package/assets/templates/app/public/images/banners/banner-aurora-deal.webp +0 -0
  13. package/assets/templates/app/public/images/banners/banner-guia-regalo.webp +0 -0
  14. package/assets/templates/app/public/images/banners/banner-mesa-decor.webp +0 -0
  15. package/assets/templates/app/public/images/banners/banner-nuevas-llegadas.webp +0 -0
  16. package/assets/templates/app/public/images/banners/banner-salon-oferta.webp +0 -0
  17. package/assets/templates/app/public/images/categories/accessories.webp +0 -0
  18. package/assets/templates/app/public/images/categories/dresses.webp +0 -0
  19. package/assets/templates/app/public/images/categories/furniture.webp +0 -0
  20. package/assets/templates/app/public/images/categories/home.webp +0 -0
  21. package/assets/templates/app/public/images/categories/jackets.webp +0 -0
  22. package/assets/templates/app/public/images/editorial/studio.webp +0 -0
  23. package/assets/templates/app/public/images/products/alpine-jacket.webp +0 -0
  24. package/assets/templates/app/public/images/products/amber-dress.webp +0 -0
  25. package/assets/templates/app/public/images/products/atlas-lamp.webp +0 -0
  26. package/assets/templates/app/public/images/products/atlas-sofa.webp +0 -0
  27. package/assets/templates/app/public/images/products/aurora-jacket.webp +0 -0
  28. package/assets/templates/app/public/images/products/boreal-jacket.webp +0 -0
  29. package/assets/templates/app/public/images/products/camille-dress.webp +0 -0
  30. package/assets/templates/app/public/images/products/ceramic-table-lamp.webp +0 -0
  31. package/assets/templates/app/public/images/products/cinder-jacket.webp +0 -0
  32. package/assets/templates/app/public/images/products/copper-lamp.webp +0 -0
  33. package/assets/templates/app/public/images/products/cove-bag.webp +0 -0
  34. package/assets/templates/app/public/images/products/dahlia-dress.webp +0 -0
  35. package/assets/templates/app/public/images/products/drift-jacket.webp +0 -0
  36. package/assets/templates/app/public/images/products/dune-lamp.webp +0 -0
  37. package/assets/templates/app/public/images/products/elara-dress.webp +0 -0
  38. package/assets/templates/app/public/images/products/ember-jacket.webp +0 -0
  39. package/assets/templates/app/public/images/products/fable-bag.webp +0 -0
  40. package/assets/templates/app/public/images/products/fjord-jacket.webp +0 -0
  41. package/assets/templates/app/public/images/products/floor-cushion.webp +0 -0
  42. package/assets/templates/app/public/images/products/harbor-jacket.webp +0 -0
  43. package/assets/templates/app/public/images/products/helios-lamp.webp +0 -0
  44. package/assets/templates/app/public/images/products/iris-dress.webp +0 -0
  45. package/assets/templates/app/public/images/products/juniper-bag.webp +0 -0
  46. package/assets/templates/app/public/images/products/kestrel-bag.webp +0 -0
  47. package/assets/templates/app/public/images/products/linen-armchair.webp +0 -0
  48. package/assets/templates/app/public/images/products/lumen-dress.webp +0 -0
  49. package/assets/templates/app/public/images/products/luna-bag.webp +0 -0
  50. package/assets/templates/app/public/images/products/marble-coffee-table.webp +0 -0
  51. package/assets/templates/app/public/images/products/marlowe-bag.webp +0 -0
  52. package/assets/templates/app/public/images/products/meridian-jacket.webp +0 -0
  53. package/assets/templates/app/public/images/products/nomad-jacket.webp +0 -0
  54. package/assets/templates/app/public/images/products/nova-dress.webp +0 -0
  55. package/assets/templates/app/public/images/products/oak-dining-table.webp +0 -0
  56. package/assets/templates/app/public/images/products/onyx-lamp.webp +0 -0
  57. package/assets/templates/app/public/images/products/piper-bag.webp +0 -0
  58. package/assets/templates/app/public/images/products/quill-lamp.webp +0 -0
  59. package/assets/templates/app/public/images/products/rosalind-dress.webp +0 -0
  60. package/assets/templates/app/public/images/products/rune-bag.webp +0 -0
  61. package/assets/templates/app/public/images/products/side-table.webp +0 -0
  62. package/assets/templates/app/public/images/products/slate-lamp.webp +0 -0
  63. package/assets/templates/app/public/images/products/solis-dress.webp +0 -0
  64. package/assets/templates/app/public/images/products/storage-shelf.webp +0 -0
  65. package/assets/templates/app/public/images/products/terra-lamp.webp +0 -0
  66. package/assets/templates/app/public/images/products/tundra-jacket.webp +0 -0
  67. package/assets/templates/app/public/images/products/vantage-jacket.webp +0 -0
  68. package/assets/templates/app/public/images/products/vera-dress.webp +0 -0
  69. package/assets/templates/app/public/images/products/verdant-lamp.webp +0 -0
  70. package/assets/templates/app/public/images/products/wall-mirror.webp +0 -0
  71. package/assets/templates/app/public/images/products/wool-rug.webp +0 -0
  72. package/assets/templates/views/account/address-book-advanced.defaults.ts +1 -1
  73. package/assets/templates/views/cart/registry.tsx +9 -0
  74. package/assets/templates/views/checkout/checkout-commerce-hosted.tsx +5 -1
  75. package/assets/templates/views/home/assembly/assembly.json +0 -1
  76. package/assets/templates/views/home/assembly/index.skeleton.tsx +3 -7
  77. package/assets/templates/views/home/assembly/registry.skeleton.tsx +0 -3
  78. package/assets/templates/views/home/content.ts +34 -80
  79. package/assets/templates/views/home/data.ts +12 -0
  80. package/assets/templates/views/home/index.tsx +4 -21
  81. package/assets/templates/views/home/props.ts +1 -7
  82. package/assets/templates/views/home/registry.tsx +0 -35
  83. package/assets/templates/views/home/schema.ts +0 -36
  84. package/bin/storefront.js +12 -27
  85. package/package.json +3 -2
  86. package/recipes/archetypes.json +0 -21
  87. package/recipes/catalog.json +0 -22
  88. package/recipes/features.json +0 -2
  89. package/recipes/recipe.schema.json +5 -0
  90. package/recipes/recipes.json +19 -16
  91. package/recipes/validate.mjs +7 -0
  92. package/scripts/candidate.mjs +3 -3
  93. package/scripts/default-sections.mjs +1 -0
  94. package/scripts/env-file.mjs +10 -0
  95. package/scripts/file-classes.mjs +3 -0
  96. package/scripts/generate-demo-images.mjs +507 -0
  97. package/scripts/reconcile.mjs +32 -1
  98. package/scripts/render-templates.mjs +13 -1
  99. package/scripts/section-compat.mjs +10 -1
  100. package/scripts/section-operations.mjs +3 -0
  101. package/scripts/starter.mjs +25 -1
  102. package/scripts/theme/starter-theme.mjs +118 -0
  103. package/skills/sf-view-gen/assets/recipes/archetypes.json +0 -21
  104. package/skills/sf-view-gen/assets/recipes/catalog.json +0 -22
  105. package/skills/sf-view-gen/assets/recipes/features.json +0 -2
  106. package/skills/sf-view-gen/assets/recipes/recipes.json +19 -16
  107. package/skills/sf-view-gen/assets/templates/views/sections/schema.universal-main-menu.ts +3 -1
  108. package/skills/sf-view-gen/scripts/validate.mjs +7 -0
  109. package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/binding.json +0 -5
  110. package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/catalog.part +0 -8
  111. package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/element.part +0 -5
  112. package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/registry.part +0 -31
@@ -53,7 +53,7 @@ export const addressBookAdvancedDefaults = {
53
53
  },
54
54
  "deleteDefaultPolicy": "clear",
55
55
  "deleteConfirmation": true,
56
- "searchThreshold": 3,
56
+ "searchThreshold": 0,
57
57
  "pageSize": 6,
58
58
  "validationProvider": false,
59
59
  "coverageProvider": false,
@@ -11,6 +11,7 @@ import ShoppingCart from '@thorprovider/blocks/blocks/e-commerce/shopping-carts/
11
11
  import { isAvailableMoney } from '@thorprovider/blocks/contracts'
12
12
  import { useStateStore } from '@json-render/react'
13
13
  import { checkoutAvailable } from '../../composition'
14
+ import { createStoreMoneyFormatter, DEFAULT_STORE_LOCALE } from '../../store-context'
14
15
  import type { ViewRegistry } from '../types'
15
16
  import { toCartViewItems } from './data'
16
17
  import { cartViewPropsSchema } from './schema'
@@ -20,6 +21,13 @@ export const registry: ViewRegistry = {
20
21
  const { state, set } = useStateStore()
21
22
  const parsed = cartViewPropsSchema.parse(props)
22
23
  const cart = parsed.items
24
+ // The same store-locale formatter the shell chrome uses, so the cart page
25
+ // and the cart sheet render one Money identically (design D4).
26
+ const storeLocale =
27
+ typeof state.storeLocale === 'string' && state.storeLocale.trim() !== ''
28
+ ? state.storeLocale
29
+ : DEFAULT_STORE_LOCALE
30
+ const formatMoney = createStoreMoneyFormatter(storeLocale)
23
31
  const cartError = typeof state.cartError === 'string' ? state.cartError : undefined
24
32
  const readError = typeof state.cartReadError === 'string' ? state.cartReadError : undefined
25
33
  const isPending = state.cartPending === true
@@ -55,6 +63,7 @@ export const registry: ViewRegistry = {
55
63
  items={toCartViewItems(cart)}
56
64
  promotions={[]}
57
65
  totals={parsed.totals ?? undefined}
66
+ formatMoney={formatMoney}
58
67
  totalsState={totalsState}
59
68
  totalsErrorLabel={errorLabel}
60
69
  titleLabel={parsed.titleLabel}
@@ -58,6 +58,8 @@ export type HostedCheckoutState = {
58
58
  checkoutShippingState: CheckoutReadState;
59
59
  checkoutPaymentState: CheckoutReadState;
60
60
  checkoutFieldErrors?: Record<string, unknown>;
61
+ /** The store's shopper locale, seeded by the catch-all host (design D4). */
62
+ storeLocale: string;
61
63
  };
62
64
 
63
65
  type HostedSetter = (path: string, value: unknown) => void;
@@ -655,7 +657,9 @@ export function toHostedCheckoutModel(
655
657
 
656
658
  return {
657
659
  labels: copyFor(props),
658
- locale: 'es-ES',
660
+ // One store locale for every money surface: the checkout summary formats
661
+ // with the same locale as the cart and `<html lang>` (design D4).
662
+ locale: state.storeLocale,
659
663
  currencyCode,
660
664
  countries: (props.shippingLocations?.countries ?? [])
661
665
  .filter((country) => country.value.trim() !== '' && country.label.trim() !== '')
@@ -2,7 +2,6 @@
2
2
  "view": "home",
3
3
  "slots": [
4
4
  { "id": "home.hero", "slot": "hero", "default": "UniversalBanner" },
5
- { "id": "home.categories", "slot": "categories", "default": "CategoryGrid" },
6
5
  { "id": "home.benefits", "slot": "benefits", "default": "cards" }
7
6
  ],
8
7
  "sections": {
@@ -11,14 +11,12 @@ import type { StorefrontElement } from '../../spec/types'
11
11
  import type { ViewModule } from '../types'
12
12
  import { registry } from './registry'
13
13
  import { sectionData } from './sections-data'
14
- import { benefitsProps, categoriesProps, heroProps } from './props'
14
+ import { benefitsProps, heroProps } from './props'
15
15
  import * as homeProps from './props'
16
16
  import * as homeData from './data'
17
- import { toCategoryCard, toFeaturedProduct } from '../../mappers'
17
+ import { toFeaturedProduct } from '../../mappers'
18
18
  import { resolveSectionSources, resolveSectionViewStates } from '../../section-sources'
19
19
  import {
20
- categoryCardPropsSchema,
21
- categoryGridPropsSchema,
22
20
  featurePropsSchema,
23
21
  storefrontHeroPropsSchema,
24
22
  } from './schema'
@@ -67,10 +65,9 @@ export const home: ViewModule = {
67
65
  sections = {}
68
66
  }
69
67
  try {
70
- const { products, categories, source } = await getCatalog()
68
+ const { products, source } = await getCatalog()
71
69
  return {
72
70
  heroProducts: homeData.selectHeroProducts(products).map(toFeaturedProduct),
73
- categories: categories.map(toCategoryCard),
74
71
  dataSource: source,
75
72
  dataError: null,
76
73
  sections,
@@ -80,7 +77,6 @@ export const home: ViewModule = {
80
77
  // data. Mock mode is labelled by `dataSource`.
81
78
  return {
82
79
  heroProducts: [],
83
- categories: [],
84
80
  dataSource: getDataSource(),
85
81
  dataError:
86
82
  error instanceof Error ? error.message : 'No se pudo cargar el catálogo.',
@@ -10,7 +10,6 @@
10
10
  // schema (./schema.ts) before binding, so a contract mismatch fails loudly at
11
11
  // the boundary instead of rendering undefined fields or literal icon tags.
12
12
 
13
- import { CategoryCard as CategoryCardBlock } from '@thorprovider/blocks/blocks/e-commerce/product-categories/category-card'
14
13
  @@BLOCK_IMPORTS@@@@SECTION_REGISTRY_IMPORTS@@
15
14
  import { useEffect, useState } from 'react'
16
15
  import { useStateStore } from '@json-render/react'
@@ -18,8 +17,6 @@ import { resolveIcon } from '../../icon-map'
18
17
  import type { ViewRegistry } from '../types'
19
18
  import * as featureSchemas from './schema'
20
19
  import {
21
- categoryCardPropsSchema,
22
- categoryGridPropsSchema,
23
20
  featurePropsSchema,
24
21
  storefrontHeroPropsSchema,
25
22
  } from './schema'
@@ -34,11 +34,7 @@ export const heroContent = {
34
34
  * user-owned content, not in the block library.
35
35
  */
36
36
  const editorialImage = {
37
- src:
38
- 'data:image/svg+xml;charset=utf-8,' +
39
- encodeURIComponent(
40
- `<svg xmlns='http://www.w3.org/2000/svg' width='1200' height='900'><rect width='100%' height='100%' fill='#e2e8f0'/><circle cx='360' cy='300' r='170' fill='#cbd5e1'/><rect x='560' y='180' width='420' height='420' rx='24' fill='#94a3b8' opacity='.55'/><path d='M120 720h960' stroke='#94a3b8' stroke-width='14' stroke-linecap='round'/></svg>`,
41
- ),
37
+ src: '/images/editorial/studio.webp',
42
38
  alt: '',
43
39
  }
44
40
 
@@ -70,18 +66,6 @@ export const benefitsContent = {
70
66
  ],
71
67
  }
72
68
 
73
- export const categoriesContent = {
74
- title: 'Compra por categoría',
75
- description: 'Explora nuestro catálogo completo.',
76
- browseLabel: 'Explorar',
77
- itemsLabel: 'productos',
78
- searchLabel: 'Buscar categorías',
79
- searchPlaceholder: 'Buscar categorías',
80
- emptyLabel: 'No hay categorías disponibles.',
81
- noResultsLabel: 'No se encontraron categorías.',
82
- viewAllLabel: 'Ver todas las categorías',
83
- }
84
-
85
69
  /**
86
70
  * Banner-hero campaign (hero slot, UniversalBanner variant). Editorial content
87
71
  * in the marketplace deal-wall voice: every destination is a real category or
@@ -91,49 +75,13 @@ export const categoriesContent = {
91
75
  * (−19%), Luna $82, Helios $96. A conformance test pins each claim to the
92
76
  * catalog fixtures, so editing a claim to an unsupported value fails CI.
93
77
  */
94
- const bannerScene = (svg: string) =>
95
- 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(svg)
96
-
97
- // Warm living-room scene for the salon anchor deal: cream wall, window light,
98
- // bouclé sofa silhouette with a terracotta cushion.
99
- const salonDesktop = bannerScene(
100
- `<svg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'><defs><linearGradient id='wall' x1='0' y1='0' x2='0' y2='1'><stop offset='0' stop-color='#f2e9dd'/><stop offset='1' stop-color='#e5d6c3'/></linearGradient><linearGradient id='glow' x1='0' y1='0' x2='1' y2='0'><stop offset='0' stop-color='#fff6e8' stop-opacity='0.95'/><stop offset='1' stop-color='#fff6e8' stop-opacity='0'/></linearGradient></defs><rect width='1600' height='900' fill='url(#wall)'/><rect x='980' y='90' width='380' height='560' rx='18' fill='#fdfaf4' opacity='0.9'/><rect x='1010' y='120' width='320' height='500' rx='12' fill='url(#glow)'/><rect x='0' y='720' width='1600' height='180' fill='#d9c4a8'/><g fill='#efe3d2' stroke='#c9b295' stroke-width='6'><rect x='330' y='430' width='740' height='240' rx='46'/><rect x='330' y='340' width='360' height='140' rx='42'/><rect x='700' y='340' width='370' height='140' rx='42'/></g><rect x='620' y='470' width='120' height='90' rx='24' fill='#c96f4a'/><rect x='1120' y='250' width='140' height='470' rx='14' fill='#b7a184' opacity='0.7'/><circle cx='1190' cy='210' r='52' fill='#8a9b6e'/><text x='90' y='140' font-family='system-ui, sans-serif' font-size='40' fill='#8b7a63' opacity='0.55'>SALÓN</text></svg>`,
101
- )
102
- const salonMobile = bannerScene(
103
- `<svg xmlns='http://www.w3.org/2000/svg' width='640' height='960' viewBox='0 0 640 960'><defs><linearGradient id='wallm' x1='0' y1='0' x2='0' y2='1'><stop offset='0' stop-color='#f2e9dd'/><stop offset='1' stop-color='#e5d6c3'/></linearGradient></defs><rect width='640' height='960' fill='url(#wallm)'/><rect x='60' y='140' width='520' height='300' rx='16' fill='#fdfaf4' opacity='0.9'/><rect x='0' y='760' width='640' height='200' fill='#d9c4a8'/><g fill='#efe3d2' stroke='#c9b295' stroke-width='5'><rect x='80' y='520' width='480' height='220' rx='40'/><rect x='80' y='440' width='230' height='120' rx='34'/><rect x='320' y='440' width='240' height='120' rx='34'/></g><rect x='270' y='550' width='100' height='76' rx='20' fill='#c96f4a'/></svg>`,
104
- )
105
-
106
- // Cool quilted-jacket scene for the Aurora deal tile (catalog imageHue 222).
107
- const auroraDesktop = bannerScene(
108
- `<svg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'><defs><linearGradient id='night' x1='0' y1='0' x2='1' y2='1'><stop offset='0' stop-color='#2b3d55'/><stop offset='1' stop-color='#1d2940'/></linearGradient></defs><rect width='1600' height='900' fill='url(#night)'/><circle cx='1240' cy='260' r='150' fill='#3d5578' opacity='0.5'/><g fill='#31445e' stroke='#4c6588' stroke-width='8'><path d='M690 300 L910 300 L980 420 L940 470 L940 760 L660 760 L660 470 L620 420 Z'/><path d='M790 300 L790 420' stroke='#4c6588' stroke-width='6'/></g><g stroke='#4c6588' stroke-width='4' opacity='0.8'><path d='M700 440 h200 M700 500 h200 M700 560 h200 M700 620 h200 M700 680 h200'/></g><rect x='0' y='760' width='1600' height='140' fill='#16213a'/><text x='90' y='140' font-family='system-ui, sans-serif' font-size='40' fill='#8fa8c8' opacity='0.6'>MODA</text></svg>`,
109
- )
110
- const auroraMobile = bannerScene(
111
- `<svg xmlns='http://www.w3.org/2000/svg' width='640' height='960' viewBox='0 0 640 960'><rect width='640' height='960' fill='#2b3d55'/><circle cx='480' cy='260' r='120' fill='#3d5578' opacity='0.5'/><g fill='#31445e' stroke='#4c6588' stroke-width='7'><path d='M230 380 L410 380 L470 480 L436 524 L436 780 L204 780 L204 524 L170 480 Z'/></g><g stroke='#4c6588' stroke-width='4' opacity='0.8'><path d='M216 540 h208 M216 600 h208 M216 660 h208 M216 720 h208'/></g><rect x='0' y='820' width='640' height='140' fill='#16213a'/></svg>`,
112
- )
113
-
114
- // Sage-wall arch mirror scene for the arrivals tile.
115
- const arrivalsDesktop = bannerScene(
116
- `<svg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'><rect width='1600' height='900' fill='#dde4d8'/><rect x='0' y='700' width='1600' height='200' fill='#c2cbb8'/><g><path d='M620 660 L620 340 Q620 220 740 220 Q860 220 860 340 L860 660 Z' fill='#d9c9a8' stroke='#b09b74' stroke-width='10'/><path d='M650 640 L650 350 Q650 260 740 260 Q830 260 830 350 L830 640 Z' fill='#eef2ea'/><path d='M660 620 L660 356 Q660 276 740 276 Q800 276 812 320 L688 620 Z' fill='#ffffff' opacity='0.55'/></g><rect x='1020' y='420' width='90' height='280' rx='10' fill='#b7a184' opacity='0.8'/><circle cx='1065' cy='380' r='46' fill='#8a9b6e'/><circle cx='1045' cy='340' r='26' fill='#9daf80'/><rect x='240' y='560' width='120' height='140' rx='22' fill='#c96f4a' opacity='0.85'/><text x='90' y='140' font-family='system-ui, sans-serif' font-size='40' fill='#75816a' opacity='0.6'>HOGAR</text></svg>`,
117
- )
118
- const arrivalsMobile = bannerScene(
119
- `<svg xmlns='http://www.w3.org/2000/svg' width='640' height='960' viewBox='0 0 640 960'><rect width='640' height='960' fill='#dde4d8'/><rect x='0' y='760' width='640' height='200' fill='#c2cbb8'/><path d='M210 700 L210 380 Q210 250 320 250 Q430 250 430 380 L430 700 Z' fill='#d9c9a8' stroke='#b09b74' stroke-width='9'/><path d='M236 680 L236 390 Q236 296 320 296 Q404 296 404 390 L404 680 Z' fill='#eef2ea'/><path d='M246 660 L246 400 Q246 316 320 316 Q376 316 388 356 L282 660 Z' fill='#ffffff' opacity='0.55'/><rect x='470' y='500' width='70' height='220' rx='10' fill='#b7a184' opacity='0.8'/><circle cx='505' cy='460' r='38' fill='#8a9b6e'/></svg>`,
120
- )
121
-
122
- // Gift scene for the under-$100 tile: berry crossbody bag on a pedestal.
123
- const giftsDesktop = bannerScene(
124
- `<svg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'><rect width='1600' height='900' fill='#f3e7e2'/><rect x='0' y='720' width='1600' height='180' fill='#e0cdc6'/><rect x='560' y='640' width='480' height='90' rx='14' fill='#d8c2ba'/><rect x='600' y='300' width='400' height='350' rx='30' fill='#a4465c'/><path d='M700 300 Q700 210 800 210 Q900 210 900 300' fill='none' stroke='#7d3346' stroke-width='22'/><rect x='600' y='420' width='400' height='26' fill='#7d3346' opacity='0.5'/><rect x='770' y='392' width='60' height='80' rx='10' fill='#e8c8a0'/><circle cx='1160' cy='250' r='90' fill='#e8c8a0' opacity='0.5'/><text x='90' y='140' font-family='system-ui, sans-serif' font-size='40' fill='#9c7c74' opacity='0.6'>REGALO</text></svg>`,
125
- )
126
- const giftsMobile = bannerScene(
127
- `<svg xmlns='http://www.w3.org/2000/svg' width='640' height='960' viewBox='0 0 640 960'><rect width='640' height='960' fill='#f3e7e2'/><rect x='0' y='780' width='640' height='180' fill='#e0cdc6'/><rect x='170' y='700' width='300' height='80' rx='12' fill='#d8c2ba'/><rect x='200' y='400' width='240' height='300' rx='26' fill='#a4465c'/><path d='M270 400 Q270 320 320 320 Q370 320 370 400' fill='none' stroke='#7d3346' stroke-width='20'/><rect x='200' y='510' width='240' height='22' fill='#7d3346' opacity='0.5'/><rect x='292' y='484' width='52' height='66' rx='9' fill='#e8c8a0'/></svg>`,
128
- )
129
-
130
- // Dining-table scene for the decor tile: oak table, linen runner, plate stack.
131
- const decorDesktop = bannerScene(
132
- `<svg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'><rect width='1600' height='900' fill='#eef1ec'/><rect x='0' y='640' width='1600' height='260' fill='#d5dccf'/><rect x='180' y='470' width='1240' height='190' rx='18' fill='#c9a879'/><rect x='120' y='660' width='60' height='150' rx='10' fill='#a98d63'/><rect x='1420' y='660' width='60' height='150' rx='10' fill='#a98d63'/><rect x='560' y='440' width='480' height='60' rx='8' fill='#f6f2ea'/><g fill='#ffffff' stroke='#cdd6c6' stroke-width='6'><circle cx='430' cy='440' r='110'/><circle cx='760' cy='430' r='86'/><circle cx='1050' cy='445' r='110'/></g><circle cx='430' cy='440' r='60' fill='#e8e3d6'/><circle cx='1050' cy='445' r='60' fill='#e8e3d6'/><g><rect x='1240' y='330' width='90' height='150' rx='16' fill='#b7a184'/><path d='M1265 330 q20 -70 40 0' fill='none' stroke='#8a9b6e' stroke-width='10'/><circle cx='1285' cy='248' r='34' fill='#9daf80'/></g><text x='90' y='140' font-family='system-ui, sans-serif' font-size='40' fill='#7c8778' opacity='0.6'>MESA</text></svg>`,
133
- )
134
- const decorMobile = bannerScene(
135
- `<svg xmlns='http://www.w3.org/2000/svg' width='640' height='960' viewBox='0 0 640 960'><rect width='640' height='960' fill='#eef1ec'/><rect x='0' y='700' width='640' height='260' fill='#d5dccf'/><rect x='40' y='560' width='560' height='170' rx='16' fill='#c9a879'/><rect x='180' y='530' width='280' height='50' rx='8' fill='#f6f2ea'/><g fill='#ffffff' stroke='#cdd6c6' stroke-width='6'><circle cx='230' cy='520' r='80'/><circle cx='430' cy='525' r='80'/></g><g><rect x='470' y='380' width='70' height='120' rx='14' fill='#b7a184'/><path d='M490 380 q16 -54 32 0' fill='none' stroke='#8a9b6e' stroke-width='9'/><circle cx='506' cy='318' r='28' fill='#9daf80'/></g></svg>`,
136
- )
78
+ /**
79
+ * Demo photography for the campaign banners: local static files under
80
+ * `public/images/banners`, shipped by the starter and replaced in place (see the
81
+ * folder README). The banner id is the file name, so a new shot needs no code
82
+ * change — remove a file and the block falls back to its own placeholder.
83
+ */
84
+ const bannerImage = (id: string) => `/images/banners/${id}.webp`
137
85
 
138
86
  export const heroBannerData = {
139
87
  campaign: {
@@ -157,7 +105,7 @@ export const heroBannerData = {
157
105
  { id: 'cta-atlas', label: 'Comprar Atlas', target: { kind: 'product', id: 'atlas-sofa' }, tone: 'secondary' },
158
106
  ],
159
107
  },
160
- media: { desktop: salonDesktop, mobile: salonMobile },
108
+ media: { desktop: bannerImage('banner-salon-oferta') },
161
109
  presentation: {
162
110
  mode: 'overlay',
163
111
  width: 'full',
@@ -170,7 +118,7 @@ export const heroBannerData = {
170
118
  radius: '2xl',
171
119
  surface: 'card',
172
120
  overlay: 'gradient',
173
- overlayOpacity: 'strong',
121
+ overlayOpacity: 'medium',
174
122
  padding: 'lg',
175
123
  textScale: 'lg',
176
124
  },
@@ -190,7 +138,7 @@ export const heroBannerData = {
190
138
  { id: 'cta-aurora', label: 'Ver chaqueta', target: { kind: 'product', id: 'aurora-jacket' }, tone: 'primary' },
191
139
  ],
192
140
  },
193
- media: { desktop: auroraDesktop, mobile: auroraMobile },
141
+ media: { desktop: bannerImage('banner-aurora-deal') },
194
142
  presentation: {
195
143
  mode: 'overlay',
196
144
  width: 'full',
@@ -202,7 +150,7 @@ export const heroBannerData = {
202
150
  align: 'start',
203
151
  radius: '2xl',
204
152
  surface: 'card',
205
- overlay: 'scrim',
153
+ overlay: 'gradient',
206
154
  overlayOpacity: 'medium',
207
155
  padding: 'md',
208
156
  textScale: 'sm',
@@ -226,7 +174,7 @@ export const heroBannerData = {
226
174
  { id: 'cta-novedades', label: 'Ver novedades', target: { kind: 'category', id: 'furniture' }, tone: 'secondary' },
227
175
  ],
228
176
  },
229
- media: { desktop: arrivalsDesktop, mobile: arrivalsMobile },
177
+ media: { desktop: bannerImage('banner-nuevas-llegadas') },
230
178
  presentation: {
231
179
  mode: 'overlay',
232
180
  width: 'full',
@@ -238,7 +186,7 @@ export const heroBannerData = {
238
186
  align: 'start',
239
187
  radius: '2xl',
240
188
  surface: 'card',
241
- overlay: 'scrim',
189
+ overlay: 'gradient',
242
190
  overlayOpacity: 'light',
243
191
  padding: 'md',
244
192
  textScale: 'sm',
@@ -262,7 +210,7 @@ export const heroBannerData = {
262
210
  { id: 'cta-regalos', label: 'Ver regalos', target: { kind: 'category', id: 'accessories' }, tone: 'primary' },
263
211
  ],
264
212
  },
265
- media: { desktop: giftsDesktop, mobile: giftsMobile },
213
+ media: { desktop: bannerImage('banner-guia-regalo') },
266
214
  presentation: {
267
215
  mode: 'overlay',
268
216
  width: 'full',
@@ -274,7 +222,7 @@ export const heroBannerData = {
274
222
  align: 'start',
275
223
  radius: '2xl',
276
224
  surface: 'card',
277
- overlay: 'scrim',
225
+ overlay: 'gradient',
278
226
  overlayOpacity: 'medium',
279
227
  padding: 'md',
280
228
  textScale: 'sm',
@@ -298,7 +246,7 @@ export const heroBannerData = {
298
246
  { id: 'cta-mesa', label: 'Ver decoración', target: { kind: 'category', id: 'home' }, tone: 'secondary' },
299
247
  ],
300
248
  },
301
- media: { desktop: decorDesktop, mobile: decorMobile },
249
+ media: { desktop: bannerImage('banner-mesa-decor') },
302
250
  presentation: {
303
251
  mode: 'overlay',
304
252
  width: 'full',
@@ -310,7 +258,7 @@ export const heroBannerData = {
310
258
  align: 'start',
311
259
  radius: '2xl',
312
260
  surface: 'card',
313
- overlay: 'scrim',
261
+ overlay: 'gradient',
314
262
  overlayOpacity: 'light',
315
263
  padding: 'md',
316
264
  textScale: 'sm',
@@ -414,10 +362,11 @@ export const bandBannerData = {
414
362
  * the section's neutral default.
415
363
  */
416
364
  export const sectionContent: Record<string, Record<string, unknown>> = {
417
- // Marketplace rail order, seeded by the home recipe: best sellers prove demand,
418
- // the campaign band changes the tone, deals carry urgency, and arrivals give
419
- // the returning visitor something new. Every id is minted by the manifest and
420
- // stable, so removing a section never rewrites this file.
365
+ // Marketplace shelf order, seeded by the home recipe: best sellers prove
366
+ // demand, the campaign band changes the tone, deals carry urgency, arrivals
367
+ // give the returning visitor something new, and the closing grid and showcase
368
+ // keep the shopper browsing products instead of prose. Every id is minted by
369
+ // the manifest and stable, so removing a section never rewrites this file.
421
370
  'home-products-1': {
422
371
  heading: 'Los más vendidos',
423
372
  description: 'Lo que más se está llevando, con precio y descuento reales de catálogo.',
@@ -442,11 +391,16 @@ export const sectionContent: Record<string, Record<string, unknown>> = {
442
391
  ctaLabel: 'Ver novedades',
443
392
  ctaHref: '/categories',
444
393
  },
445
- 'home-cta-1': {
446
- badgeText: 'Compra sencilla',
447
- title: 'Un catálogo, un carrito, cero sorpresas',
448
- description: 'Precios claros, stock real y devoluciones sin letra pequeña.',
449
- primaryCta: { label: 'Explorar el catálogo', href: '/categories' },
450
- secondaryCta: { label: 'Ver novedades', href: '/categories' },
394
+ // Plain product grid (`ProductGrid`): the grid presentation reads the heading
395
+ // and the resolved products only, so this instance carries no description or
396
+ // call to action the block would ignore.
397
+ 'home-products-4': {
398
+ heading: 'Ideas para regalar',
399
+ },
400
+ // Combined grid-and-showcase (`ProductShowcase1`): same resolved products, a
401
+ // shelf that pages in place instead of scrolling sideways.
402
+ 'home-products-5': {
403
+ heading: 'Favoritos del estudio',
404
+ description: 'Piezas elegidas por nuestro estudio, con stock y precio reales de catálogo.',
451
405
  },
452
406
  }
@@ -40,4 +40,16 @@ export const sectionSources: Record<string, unknown> = {
40
40
  query: { collections: ['new-arrivals'], pageSize: 8 },
41
41
  maxItems: 8,
42
42
  },
43
+ // The closing shelves read two further canonical collections: the gift guide
44
+ // renders as a plain grid, the studio selection as the paged showcase.
45
+ 'home-products-4': {
46
+ kind: 'products',
47
+ query: { collections: ['gift-guide'], pageSize: 8 },
48
+ maxItems: 8,
49
+ },
50
+ 'home-products-5': {
51
+ kind: 'products',
52
+ query: { collections: ['studio-essentials'], pageSize: 8 },
53
+ maxItems: 8,
54
+ },
43
55
  }
@@ -11,14 +11,12 @@ import type { StorefrontElement } from '../../spec/types'
11
11
  import type { ViewModule } from '../types'
12
12
  import { registry } from './registry'
13
13
  import { sectionData } from './sections-data'
14
- import { benefitsProps, categoriesProps, heroProps } from './props'
14
+ import { benefitsProps, heroProps } from './props'
15
15
  import * as homeProps from './props'
16
16
  import * as homeData from './data'
17
- import { toCategoryCard, toFeaturedProduct } from '../../mappers'
17
+ import { toFeaturedProduct } from '../../mappers'
18
18
  import { resolveSectionSources, resolveSectionViewStates } from '../../section-sources'
19
19
  import {
20
- categoryCardPropsSchema,
21
- categoryGridPropsSchema,
22
20
  featurePropsSchema,
23
21
  storefrontHeroPropsSchema,
24
22
  } from './schema'
@@ -31,11 +29,6 @@ const elements: Record<string, StorefrontElement> = {
31
29
  type: 'UniversalBanner',
32
30
  props: homeProps.heroBannerProps,
33
31
  },
34
- 'home.categories': {
35
- type: 'CategoryGrid',
36
- props: categoriesProps,
37
- on: { openCategory: { action: 'openCategory' } },
38
- },
39
32
  'home.benefits': {
40
33
  type: 'Feature',
41
34
  props: benefitsProps,
@@ -47,14 +40,6 @@ const catalog = {
47
40
  props: homeSchemas.universalBannerPropsSchema,
48
41
  description: 'Campaign banner collection (presentations: single, grid, carousel).',
49
42
  },
50
- CategoryGrid: {
51
- props: categoryGridPropsSchema,
52
- description: 'Category listing that renders category cells.',
53
- },
54
- CategoryCard: {
55
- props: categoryCardPropsSchema,
56
- description: 'One category cell, without listing section chrome.',
57
- },
58
43
  Feature: {
59
44
  props: featurePropsSchema,
60
45
  description: 'Benefit highlights.',
@@ -74,7 +59,7 @@ export const home: ViewModule = {
74
59
  title: 'Inicio',
75
60
  description: 'Descubre los productos de __SITE_NAME__.',
76
61
  },
77
- entry: pageRoot('home', ['home.hero', 'home.categories', 'home.benefits'], elements),
62
+ entry: pageRoot('home', ['home.hero', 'home.benefits'], elements),
78
63
  },
79
64
  loader: {
80
65
  home: async () => {
@@ -94,10 +79,9 @@ export const home: ViewModule = {
94
79
  sections = {}
95
80
  }
96
81
  try {
97
- const { products, categories, source } = await getCatalog()
82
+ const { products, source } = await getCatalog()
98
83
  return {
99
84
  heroProducts: homeData.selectHeroProducts(products).map(toFeaturedProduct),
100
- categories: categories.map(toCategoryCard),
101
85
  dataSource: source,
102
86
  dataError: null,
103
87
  sections,
@@ -107,7 +91,6 @@ export const home: ViewModule = {
107
91
  // data. Mock mode is labelled by `dataSource`.
108
92
  return {
109
93
  heroProducts: [],
110
- categories: [],
111
94
  dataSource: getDataSource(),
112
95
  dataError:
113
96
  error instanceof Error ? error.message : 'No se pudo cargar el catálogo.',
@@ -4,7 +4,7 @@
4
4
  // and binds them into the element tree, so edits here survive `storefront sync`
5
5
  // and unit removal. Plain data only: no React and no server imports.
6
6
 
7
- import { benefitsContent, categoriesContent, heroContent, heroBannerData, heroImage } from './content'
7
+ import { benefitsContent, heroContent, heroBannerData, heroImage } from './content'
8
8
 
9
9
  export const heroProps = {
10
10
  ...heroContent,
@@ -21,9 +21,3 @@ export const heroBannerProps = {
21
21
  export const benefitsProps = {
22
22
  ...benefitsContent,
23
23
  }
24
-
25
- export const categoriesProps = {
26
- ...categoriesContent,
27
- categories: { $state: '/categories' },
28
- query: { $state: '/categoryQuery' },
29
- }
@@ -10,9 +10,7 @@
10
10
  // schema (./schema.ts) before binding, so a contract mismatch fails loudly at
11
11
  // the boundary instead of rendering undefined fields or literal icon tags.
12
12
 
13
- import { CategoryCard as CategoryCardBlock } from '@thorprovider/blocks/blocks/e-commerce/product-categories/category-card'
14
13
  import { UniversalBanner as UniversalBannerBlock } from '@thorprovider/blocks'
15
- import { CategoryGrid as CategoryGridBlock } from '@thorprovider/blocks/blocks/e-commerce/product-categories/product-category-grid'
16
14
  import { Feature as FeatureBlock } from '@thorprovider/blocks/blocks/marketing/features/feature'
17
15
  import { useEffect, useState } from 'react'
18
16
  import { useStateStore } from '@json-render/react'
@@ -20,8 +18,6 @@ import { resolveIcon } from '../../icon-map'
20
18
  import type { ViewRegistry } from '../types'
21
19
  import * as featureSchemas from './schema'
22
20
  import {
23
- categoryCardPropsSchema,
24
- categoryGridPropsSchema,
25
21
  featurePropsSchema,
26
22
  storefrontHeroPropsSchema,
27
23
  } from './schema'
@@ -37,37 +33,6 @@ export const registry: ViewRegistry = {
37
33
  }, [])
38
34
  return <UniversalBannerBlock data={{ ...parsed.data, now }} />
39
35
  },
40
- CategoryCard: ({ props, emit }) => {
41
- const { set } = useStateStore()
42
- const card = categoryCardPropsSchema.parse(props)
43
- return (
44
- <CategoryCardBlock
45
- {...card}
46
- onBrowse={(category) => {
47
- set('/lastCategory', category.handle ?? String(category.id))
48
- emit('openCategory')
49
- }}
50
- />
51
- )
52
- },
53
- CategoryGrid: ({ props, emit }) => {
54
- const { set } = useStateStore()
55
- const grid = categoryGridPropsSchema.parse(props)
56
- return (
57
- <CategoryGridBlock
58
- {...grid}
59
- onBrowse={(category) => {
60
- set('/lastCategory', category.handle ?? String(category.id))
61
- emit('openCategory')
62
- }}
63
- onViewAll={() => {
64
- set('/lastCategory', '/categories')
65
- emit('openCategory')
66
- }}
67
- onQueryChange={(query) => set('/categoryQuery', query)}
68
- />
69
- )
70
- },
71
36
  Feature: ({ props }) => {
72
37
  const feature = featureSchemas.featureCardsSpecSchema.parse({
73
38
  ...props,
@@ -160,40 +160,6 @@ export const featureSplitSpecSchema = z.object({
160
160
 
161
161
  export const featurePropsSchema = z.union([featureSplitSpecSchema, featureCardsSpecSchema])
162
162
 
163
- export const categoryCardPropsSchema = z.object({
164
- category: categoryCardSchema,
165
- presentation: z.enum(['grid', 'icons', 'list']).optional(),
166
- browseLabel: z.string().optional(),
167
- itemsLabel: z.string().optional(),
168
- trendingLabel: z.string().optional(),
169
- featuredLabel: z.string().optional(),
170
- imageFallback: z.string().optional(),
171
- })
172
-
173
- export const categoryGridPropsSchema = z.object({
174
- title: z.string().optional(),
175
- description: z.string().optional(),
176
- badge: z.string().optional(),
177
- presentation: z.enum(['grid', 'icons', 'list']).optional(),
178
- categories: z.array(categoryCardSchema),
179
- cta: ctaSchema.optional(),
180
- query: z.string().optional(),
181
- searchPlaceholder: z.string().optional(),
182
- searchLabel: z.string().optional(),
183
- emptyLabel: z.string().optional(),
184
- noResultsLabel: z.string().optional(),
185
- browseLabel: z.string().optional(),
186
- viewAllLabel: z.string().optional(),
187
- trendingLabel: z.string().optional(),
188
- featuredLabel: z.string().optional(),
189
- itemsLabel: z.string().optional(),
190
- imageFallback: z.string().optional(),
191
- className: z.string().optional(),
192
- maxItems: z.number().int().positive().optional(),
193
- loading: z.boolean().optional(),
194
- skeletonCount: z.number().int().positive().optional(),
195
- })
196
-
197
163
  // Local mirror of the canonical UniversalBanner contract (delivery
198
164
  // universal-banner, contract version 4.1.0) — the same shape the editorial
199
165
  // section fragment mirrors. Kept local (not imported from the section module)
@@ -367,7 +333,5 @@ export type StorefrontHeroProps = z.infer<typeof storefrontHeroPropsSchema>
367
333
  export type FeatureProps = z.infer<typeof featurePropsSchema>
368
334
  export type FeatureCardsSpecProps = z.infer<typeof featureCardsSpecSchema>
369
335
  export type FeatureSplitSpecProps = z.infer<typeof featureSplitSpecSchema>
370
- export type CategoryCardProps = z.infer<typeof categoryCardPropsSchema>
371
- export type CategoryGridProps = z.infer<typeof categoryGridPropsSchema>
372
336
  export type UniversalBannerData = z.infer<typeof universalBannerDataSchema>
373
337
  export type UniversalBannerProps = z.infer<typeof universalBannerPropsSchema>