@thorprovider/storefront 0.7.0 → 0.10.0

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 (164) hide show
  1. package/README.md +22 -2
  2. package/assets/templates/AGENTS.md +14 -2
  3. package/assets/templates/app/app/[[...slug]]/page.tsx +9 -2
  4. package/assets/templates/app/lib/__STOREFRONT__/account-address.ts +129 -0
  5. package/assets/templates/app/lib/__STOREFRONT__/account-lifecycle.client.tsx +2 -2
  6. package/assets/templates/app/lib/__STOREFRONT__/account-private.core.ts +143 -0
  7. package/assets/templates/app/lib/__STOREFRONT__/account-profile.ts +220 -0
  8. package/assets/templates/app/lib/__STOREFRONT__/actions.ts +677 -80
  9. package/assets/templates/app/lib/__STOREFRONT__/addresses-port.ts +107 -0
  10. package/assets/templates/app/lib/__STOREFRONT__/commerce.ts +477 -38
  11. package/assets/templates/app/lib/__STOREFRONT__/confirmation.core.ts +240 -0
  12. package/assets/templates/app/lib/__STOREFRONT__/customer-profile-port.ts +103 -0
  13. package/assets/templates/app/lib/__STOREFRONT__/fulfillment-evidence-port.ts +31 -0
  14. package/assets/templates/app/lib/__STOREFRONT__/handlers.core.ts +21 -4
  15. package/assets/templates/app/lib/__STOREFRONT__/mappers.ts +6 -2
  16. package/assets/templates/app/lib/__STOREFRONT__/order-detail-mapper.ts +642 -0
  17. package/assets/templates/app/lib/__STOREFRONT__/order-detail-port.ts +25 -0
  18. package/assets/templates/app/lib/__STOREFRONT__/orders-port.ts +30 -0
  19. package/assets/templates/app/lib/__STOREFRONT__/ports.ts +28 -0
  20. package/assets/templates/app/lib/__STOREFRONT__/projection-ownership.client.tsx +4 -4
  21. package/assets/templates/app/lib/__STOREFRONT__/session.ts +24 -6
  22. package/assets/templates/app/lib/__STOREFRONT__/state.core.ts +21 -0
  23. package/assets/templates/app/lib/__STOREFRONT__/views/sections/address-book-advanced.client.tsx +29 -0
  24. package/assets/templates/app/lib/__STOREFRONT__/views/sections/checkout-commerce-v1.client.tsx +19 -0
  25. package/assets/templates/app/lib/__STOREFRONT__/views/sections/checkout-commerce-v1.tsx +16 -0
  26. package/assets/templates/app/lib/__STOREFRONT__/views/sections/customer-profile.client.tsx +27 -0
  27. package/assets/templates/app/lib/__STOREFRONT__/views/sections/index.ts +4 -1
  28. package/assets/templates/app/lib/__STOREFRONT__/views/sections/mega-menu-universal.client.tsx +19 -0
  29. package/assets/templates/app/lib/__STOREFRONT__/views/sections/mega-menu-universal.tsx +16 -0
  30. package/assets/templates/app/lib/__STOREFRONT__/views/sections/schema.address-book-advanced.ts +437 -0
  31. package/assets/templates/app/lib/__STOREFRONT__/views/sections/schema.checkout-commerce-v1.ts +398 -0
  32. package/assets/templates/app/lib/__STOREFRONT__/views/sections/schema.customer-profile.ts +138 -0
  33. package/assets/templates/app/lib/__STOREFRONT__/views/sections/schema.mega-menu-universal.ts +76 -0
  34. package/assets/templates/app/lib/__STOREFRONT__/views/sections/schema.universal-banner.ts +217 -0
  35. package/assets/templates/app/lib/__STOREFRONT__/views/sections/universal-banner.client.tsx +24 -0
  36. package/assets/templates/app/lib/__STOREFRONT__/views/sections/universal-banner.tsx +16 -0
  37. package/assets/templates/features/checkout/handlers.ts +24 -4
  38. package/assets/templates/features/customer-addresses/handlers.ts +11 -0
  39. package/assets/templates/features/customer-addresses/state.ts +33 -0
  40. package/assets/templates/features/customer-auth/state.ts +10 -0
  41. package/assets/templates/features/customer-profile/handlers.ts +11 -0
  42. package/assets/templates/features/customer-profile/state.ts +18 -0
  43. package/assets/templates/views/account/address-book-advanced.defaults.ts +534 -0
  44. package/assets/templates/views/account/assembly/assembly.json +36 -0
  45. package/assets/templates/views/account/assembly/index.skeleton.tsx +277 -0
  46. package/assets/templates/views/account/assembly/registry.skeleton.tsx +1057 -0
  47. package/assets/templates/views/account/assembly/slots/addresses/AddressBookAdvanced/binding.json +5 -0
  48. package/assets/templates/views/account/assembly/slots/addresses/AddressBookAdvanced/catalog.part +4 -0
  49. package/assets/templates/views/account/assembly/slots/addresses/AddressBookAdvanced/element.part +5 -0
  50. package/assets/templates/views/account/assembly/slots/addresses/AddressBookAdvanced/registry.part +1 -0
  51. package/assets/templates/views/account/assembly/slots/addresses/cards/catalog.part +5 -0
  52. package/assets/templates/views/account/assembly/slots/addresses/cards/element.part +10 -0
  53. package/assets/templates/views/account/assembly/slots/addresses/cards/registry.part +1 -0
  54. package/assets/templates/views/account/assembly/slots/login/card/catalog.part +4 -0
  55. package/assets/templates/views/account/assembly/slots/login/card/element.part +13 -0
  56. package/assets/templates/views/account/assembly/slots/login/card/registry.part +1 -0
  57. package/assets/templates/views/account/assembly/slots/orders/OrderHistory/catalog.part +5 -0
  58. package/assets/templates/views/account/assembly/slots/orders/OrderHistory/element.part +5 -0
  59. package/assets/templates/views/account/assembly/slots/orders/OrderHistory/registry.part +2 -0
  60. package/assets/templates/views/account/assembly/slots/orders/OrderHistoryAdvanced/binding.json +5 -0
  61. package/assets/templates/views/account/assembly/slots/orders/OrderHistoryAdvanced/catalog.part +5 -0
  62. package/assets/templates/views/account/assembly/slots/orders/OrderHistoryAdvanced/element.part +5 -0
  63. package/assets/templates/views/account/assembly/slots/orders/OrderHistoryAdvanced/registry.part +1 -0
  64. package/assets/templates/views/account/assembly/slots/profile/CustomerProfileAdvanced/binding.json +5 -0
  65. package/assets/templates/views/account/assembly/slots/profile/CustomerProfileAdvanced/catalog.part +4 -0
  66. package/assets/templates/views/account/assembly/slots/profile/CustomerProfileAdvanced/element.part +5 -0
  67. package/assets/templates/views/account/assembly/slots/profile/CustomerProfileAdvanced/registry.part +1 -0
  68. package/assets/templates/views/account/assembly/slots/profile/form/catalog.part +5 -0
  69. package/assets/templates/views/account/assembly/slots/profile/form/element.part +10 -0
  70. package/assets/templates/views/account/assembly/slots/profile/form/registry.part +1 -0
  71. package/assets/templates/views/account/assembly/slots/register/SignUpPage1/catalog.part +4 -0
  72. package/assets/templates/views/account/assembly/slots/register/SignUpPage1/element.part +13 -0
  73. package/assets/templates/views/account/assembly/slots/register/SignUpPage1/registry.part +1 -0
  74. package/assets/templates/views/account/assembly/slots/summary/stack/catalog.part +5 -0
  75. package/assets/templates/views/account/assembly/slots/summary/stack/element.part +5 -0
  76. package/assets/templates/views/account/assembly/slots/summary/stack/registry.part +1 -0
  77. package/assets/templates/views/account/assembly/slots/summary/tabs/catalog.part +5 -0
  78. package/assets/templates/views/account/assembly/slots/summary/tabs/element.part +5 -0
  79. package/assets/templates/views/account/assembly/slots/summary/tabs/registry.part +1 -0
  80. package/assets/templates/views/account/content.ts +326 -0
  81. package/assets/templates/views/account/customer-profile.defaults.ts +136 -0
  82. package/assets/templates/views/account/fulfillment-evidence.client.tsx +34 -0
  83. package/assets/templates/views/account/fulfillment-evidence.defaults.ts +145 -0
  84. package/assets/templates/views/account/fulfillment-evidence.schema.ts +15 -0
  85. package/assets/templates/views/account/index.tsx +259 -38
  86. package/assets/templates/views/account/order-detail.client.tsx +35 -0
  87. package/assets/templates/views/account/order-detail.defaults.ts +457 -0
  88. package/assets/templates/views/account/orders-advanced.client.tsx +77 -0
  89. package/assets/templates/views/account/orders-advanced.defaults.ts +230 -0
  90. package/assets/templates/views/account/registry.tsx +935 -420
  91. package/assets/templates/views/account/schema.ts +50 -0
  92. package/assets/templates/views/account/sections-data.ts +2 -0
  93. package/assets/templates/views/cart/content.ts +1 -0
  94. package/assets/templates/views/category/assembly/index.skeleton.tsx +1 -0
  95. package/assets/templates/views/category/assembly/slots/filter/CategoryListing/element.part +1 -0
  96. package/assets/templates/views/category/content.ts +2 -0
  97. package/assets/templates/views/category/index.tsx +2 -0
  98. package/assets/templates/views/category/sections-data.ts +2 -0
  99. package/assets/templates/views/checkout/checkout-commerce-hosted.tsx +1089 -0
  100. package/assets/templates/views/checkout/content.ts +51 -0
  101. package/assets/templates/views/checkout/index.tsx +1 -1
  102. package/assets/templates/views/checkout/props.ts +10 -2
  103. package/assets/templates/views/checkout/registry.tsx +104 -42
  104. package/assets/templates/views/checkout/schema.ts +76 -1
  105. package/assets/templates/views/home/assembly/assembly.json +23 -2
  106. package/assets/templates/views/home/assembly/index.skeleton.tsx +4 -1
  107. package/assets/templates/views/home/assembly/registry.skeleton.tsx +1 -0
  108. package/assets/templates/views/home/assembly/slots/hero/UniversalBanner/binding.json +5 -0
  109. package/assets/templates/views/home/assembly/slots/hero/UniversalBanner/catalog.part +4 -0
  110. package/assets/templates/views/home/assembly/slots/hero/UniversalBanner/element.part +4 -0
  111. package/assets/templates/views/home/assembly/slots/hero/UniversalBanner/registry.part +10 -0
  112. package/assets/templates/views/home/content.ts +247 -1
  113. package/assets/templates/views/home/data.ts +10 -1
  114. package/assets/templates/views/home/index.tsx +8 -6
  115. package/assets/templates/views/home/props.ts +7 -1
  116. package/assets/templates/views/home/registry.tsx +11 -28
  117. package/assets/templates/views/home/schema.ts +163 -0
  118. package/assets/templates/views/home/sections-data.ts +2 -0
  119. package/assets/templates/views/product/content.ts +1 -0
  120. package/assets/templates/views/static/content.ts +1 -0
  121. package/bin/storefront.js +356 -27
  122. package/package.json +2 -1
  123. package/recipes/adapter-surface.json +159 -0
  124. package/recipes/archetypes.json +43 -4
  125. package/recipes/catalog.json +147 -2
  126. package/recipes/feature.schema.json +9 -0
  127. package/recipes/features.json +72 -1
  128. package/recipes/manifest.schema.json +5 -0
  129. package/recipes/recipe.schema.json +13 -1
  130. package/recipes/recipes.json +37 -7
  131. package/recipes/section.schema.json +112 -0
  132. package/recipes/sections.json +281 -4
  133. package/recipes/validate.mjs +83 -1
  134. package/scripts/adapter-surface.mjs +41 -0
  135. package/scripts/agent-blocks.mjs +700 -0
  136. package/scripts/block-validator.mjs +45 -0
  137. package/scripts/candidate.mjs +56 -14
  138. package/scripts/composers.mjs +7 -2
  139. package/scripts/default-sections.mjs +78 -0
  140. package/scripts/file-classes.mjs +18 -0
  141. package/scripts/generate-adapter-surface.mjs +148 -0
  142. package/scripts/operations.mjs +100 -0
  143. package/scripts/reconcile.mjs +67 -39
  144. package/scripts/section-configure.mjs +316 -0
  145. package/scripts/sync-assets.mjs +1 -0
  146. package/scripts/view-assembly.mjs +101 -14
  147. package/skills/sf-feature/SKILL.md +19 -0
  148. package/skills/sf-view-gen/SKILL.md +73 -7
  149. package/skills/sf-view-gen/assets/recipes/archetypes.json +43 -4
  150. package/skills/sf-view-gen/assets/recipes/catalog.json +147 -2
  151. package/skills/sf-view-gen/assets/recipes/features.json +72 -1
  152. package/skills/sf-view-gen/assets/recipes/recipes.json +37 -7
  153. package/skills/sf-view-gen/assets/recipes/section.schema.json +112 -0
  154. package/skills/sf-view-gen/assets/recipes/sections.json +281 -4
  155. package/skills/sf-view-gen/assets/templates/views/sections/checkout-commerce-v1.client.tsx +19 -0
  156. package/skills/sf-view-gen/assets/templates/views/sections/checkout-commerce-v1.tsx +16 -0
  157. package/skills/sf-view-gen/assets/templates/views/sections/mega-menu-universal.client.tsx +19 -0
  158. package/skills/sf-view-gen/assets/templates/views/sections/mega-menu-universal.tsx +16 -0
  159. package/skills/sf-view-gen/assets/templates/views/sections/schema.checkout-commerce-v1.ts +398 -0
  160. package/skills/sf-view-gen/assets/templates/views/sections/schema.mega-menu-universal.ts +76 -0
  161. package/skills/sf-view-gen/assets/templates/views/sections/schema.universal-banner.ts +217 -0
  162. package/skills/sf-view-gen/assets/templates/views/sections/universal-banner.client.tsx +24 -0
  163. package/skills/sf-view-gen/assets/templates/views/sections/universal-banner.tsx +16 -0
  164. package/skills/sf-view-gen/scripts/validate.mjs +83 -1
@@ -4,6 +4,7 @@
4
4
  // view module (./index.tsx) imports it and wires it into the element tree, so
5
5
  // your edits here survive `storefront sync` and unit removal. Plain data only:
6
6
  // no React and no server imports.
7
+ // A configured `sections/<id>.json` sidecar wins over this map for that instance.
7
8
 
8
9
  export interface HeroImageContent {
9
10
  src: string
@@ -81,6 +82,244 @@ export const categoriesContent = {
81
82
  viewAllLabel: 'Ver todas las categorías',
82
83
  }
83
84
 
85
+ /**
86
+ * Banner-hero campaign (hero slot, UniversalBanner variant). Editorial content
87
+ * in the marketplace deal-wall voice: every destination is a real category or
88
+ * product handle, and every price, compare-at anchor, and discount percentage
89
+ * is derivable from real variant data in the connected catalog. Copy claims:
90
+ * Atlas $1.890 / antes $2.190 (−12%…−13% pair), Aurora $129 / antes $159
91
+ * (−19%), Luna $82, Helios $96. A conformance test pins each claim to the
92
+ * catalog fixtures, so editing a claim to an unsupported value fails CI.
93
+ */
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
+ export const heroBannerData = {
131
+ campaign: {
132
+ schemaVersion: 1,
133
+ campaignId: 'campaign-thor-salon',
134
+ banners: [
135
+ {
136
+ id: 'banner-salon-oferta',
137
+ campaignId: 'campaign-thor-salon',
138
+ content: {
139
+ name: 'El salón en oferta',
140
+ alt: 'Sofá modular de bouclé crema en un salón cálido con luz de ventana',
141
+ title: 'El salón está en oferta',
142
+ subtitle: 'Sofás, mesas y sillones con precio real',
143
+ description:
144
+ 'Atlas modular en bouclé desde $1.890 (antes $2.190). Piezas seleccionadas de salón y comedor.',
145
+ badge: 'Oferta',
146
+ target: { kind: 'category', id: 'furniture' },
147
+ ctas: [
148
+ { id: 'cta-salon', label: 'Ver salón', target: { kind: 'category', id: 'furniture' }, tone: 'primary' },
149
+ { id: 'cta-atlas', label: 'Comprar Atlas', target: { kind: 'product', id: 'atlas-sofa' }, tone: 'secondary' },
150
+ ],
151
+ },
152
+ media: { desktop: salonDesktop, mobile: salonMobile },
153
+ presentation: {
154
+ mode: 'overlay',
155
+ width: 'full',
156
+ height: 'auto',
157
+ heightToken: 'lg',
158
+ aspect: 'tall',
159
+ fit: 'cover',
160
+ focal: 'center',
161
+ align: 'start',
162
+ radius: '2xl',
163
+ surface: 'card',
164
+ overlay: 'gradient',
165
+ overlayOpacity: 'strong',
166
+ padding: 'lg',
167
+ textScale: 'lg',
168
+ },
169
+ visible: true,
170
+ },
171
+ {
172
+ id: 'banner-aurora-deal',
173
+ campaignId: 'campaign-thor-salon',
174
+ content: {
175
+ name: 'Aurora en oferta',
176
+ alt: 'Chaqueta acolchada azul medianoche sobre fondo frío',
177
+ title: '−19% en Aurora',
178
+ description: 'Chaqueta acolchada en medianoche: $129 (antes $159). Tallas S a M.',
179
+ badge: 'Oferta',
180
+ target: { kind: 'product', id: 'aurora-jacket' },
181
+ ctas: [
182
+ { id: 'cta-aurora', label: 'Ver chaqueta', target: { kind: 'product', id: 'aurora-jacket' }, tone: 'primary' },
183
+ ],
184
+ },
185
+ media: { desktop: auroraDesktop, mobile: auroraMobile },
186
+ presentation: {
187
+ mode: 'overlay',
188
+ width: 'full',
189
+ height: 'auto',
190
+ heightToken: 'sm',
191
+ aspect: 'photo',
192
+ fit: 'cover',
193
+ focal: 'center',
194
+ align: 'start',
195
+ radius: '2xl',
196
+ surface: 'card',
197
+ overlay: 'scrim',
198
+ overlayOpacity: 'medium',
199
+ padding: 'md',
200
+ textScale: 'sm',
201
+ },
202
+ visible: true,
203
+ },
204
+ {
205
+ id: 'banner-nuevas-llegadas',
206
+ campaignId: 'campaign-thor-salon',
207
+ content: {
208
+ name: 'Nuevas llegadas',
209
+ alt: 'Espejo de arco dorado junto a una planta sobre pared verde salvia',
210
+ title: 'Recién llegados a casa',
211
+ description: 'Espejo arco, cojines y la lámpara de cerámica ya están aquí.',
212
+ badge: 'Nuevo',
213
+ target: { kind: 'category', id: 'furniture' },
214
+ ctas: [
215
+ { id: 'cta-novedades', label: 'Ver novedades', target: { kind: 'category', id: 'furniture' }, tone: 'secondary' },
216
+ ],
217
+ },
218
+ media: { desktop: arrivalsDesktop, mobile: arrivalsMobile },
219
+ presentation: {
220
+ mode: 'overlay',
221
+ width: 'full',
222
+ height: 'auto',
223
+ heightToken: 'sm',
224
+ aspect: 'photo',
225
+ fit: 'cover',
226
+ focal: 'center',
227
+ align: 'start',
228
+ radius: '2xl',
229
+ surface: 'card',
230
+ overlay: 'scrim',
231
+ overlayOpacity: 'light',
232
+ padding: 'md',
233
+ textScale: 'sm',
234
+ },
235
+ visible: true,
236
+ },
237
+ {
238
+ id: 'banner-guia-regalo',
239
+ campaignId: 'campaign-thor-salon',
240
+ content: {
241
+ name: 'Guía de regalo',
242
+ alt: 'Bandolera color baya sobre un pedestal claro',
243
+ title: 'Regalos bajo $100',
244
+ description: 'Luna a $82 y Helios a $96: piezas listas para regalar.',
245
+ badge: 'Menos de $100',
246
+ target: { kind: 'category', id: 'accessories' },
247
+ ctas: [
248
+ { id: 'cta-regalos', label: 'Ver regalos', target: { kind: 'category', id: 'accessories' }, tone: 'primary' },
249
+ ],
250
+ },
251
+ media: { desktop: giftsDesktop, mobile: giftsMobile },
252
+ presentation: {
253
+ mode: 'overlay',
254
+ width: 'full',
255
+ height: 'auto',
256
+ heightToken: 'sm',
257
+ aspect: 'photo',
258
+ fit: 'cover',
259
+ focal: 'center',
260
+ align: 'start',
261
+ radius: '2xl',
262
+ surface: 'card',
263
+ overlay: 'scrim',
264
+ overlayOpacity: 'medium',
265
+ padding: 'md',
266
+ textScale: 'sm',
267
+ },
268
+ visible: true,
269
+ },
270
+ ],
271
+ },
272
+ config: {
273
+ schemaVersion: 1,
274
+ blockId: 'home-hero-universal-banner',
275
+ name: 'Banners de portada',
276
+ visible: true,
277
+ scheduleAware: true,
278
+ responsiveEnabled: true,
279
+ presentation: 'grid',
280
+ preset: 'hero-three',
281
+ refs: [
282
+ { bannerId: 'banner-salon-oferta' },
283
+ { bannerId: 'banner-aurora-deal' },
284
+ { bannerId: 'banner-nuevas-llegadas' },
285
+ { bannerId: 'banner-guia-regalo' },
286
+ ],
287
+ layout: {
288
+ gapX: 'md',
289
+ gapY: 'md',
290
+ maxWidth: 'full',
291
+ maxHeight: 'lg',
292
+ align: 'center',
293
+ radius: '2xl',
294
+ },
295
+ carousel: {
296
+ visible: { base: 1, md: 2, '2xl': 3 },
297
+ autoplay: false,
298
+ intervalMs: 6000,
299
+ loop: true,
300
+ indicators: true,
301
+ carouselOnMobile: false,
302
+ peek: true,
303
+ story: false,
304
+ },
305
+ rules: {
306
+ emptyLabel: 'No hay banners publicados ahora mismo.',
307
+ inactiveLabel: 'Esta campaña no está activa.',
308
+ danglingLabel: 'El destino de este banner ya no existe.',
309
+ },
310
+ },
311
+ now: '2026-01-01T00:00:00.000Z',
312
+ banner: {
313
+ carouselPrevious: 'Banner anterior',
314
+ carouselNext: 'Banner siguiente',
315
+ carouselStatus: 'Banner {page} de {pages}',
316
+ carouselRole: 'Carrusel de banners',
317
+ storyPrevious: 'Historia anterior',
318
+ storyNext: 'Historia siguiente',
319
+ storyRole: 'Historias de banners',
320
+ },
321
+ }
322
+
84
323
  /**
85
324
  * Editorial section instance content, keyed by the section instance id the
86
325
  * manifest persists (`views[].sections[].id`, e.g. `home-faq-1`). The derived
@@ -89,4 +328,11 @@ export const categoriesContent = {
89
328
  * Plain data only, matching the section fragment's props; an unset id renders
90
329
  * the section's neutral default.
91
330
  */
92
- export const sectionContent: Record<string, Record<string, unknown>> = {}
331
+ export const sectionContent: Record<string, Record<string, unknown>> = {
332
+ 'home-products-1': {
333
+ heading: 'Los más vendidos en tu tienda',
334
+ description: 'Piezas reales del catálogo, con sus descuentos honestos.',
335
+ ctaLabel: 'Ver todo el catálogo',
336
+ ctaHref: '/categories',
337
+ },
338
+ }
@@ -21,4 +21,13 @@ export function toNavCategories(
21
21
  // by default: a data-bound section with no entry renders an `unconfigured`
22
22
  // state. Entries whose id is no longer referenced by the composition are kept
23
23
  // but never queried, so re-adding the section with the same id restores them.
24
- export const sectionSources: Record<string, unknown> = {}
24
+ export const sectionSources: Record<string, unknown> = {
25
+ // The seeded merchandising grid: the mock catalog's real `best-sellers`
26
+ // collection through the canonical catalog bridge. The id matches the
27
+ // auto-minted instance id of the recipe's default `products` seed.
28
+ 'home-products-1': {
29
+ kind: 'products',
30
+ query: { collections: ['best-sellers'], pageSize: 8 },
31
+ maxItems: 8,
32
+ },
33
+ }
@@ -10,7 +10,9 @@ import { pageRoot } from '../../spec/page-root'
10
10
  import type { StorefrontElement } from '../../spec/types'
11
11
  import type { ViewModule } from '../types'
12
12
  import { registry } from './registry'
13
+ import { sectionData } from './sections-data'
13
14
  import { benefitsProps, categoriesProps, heroProps } from './props'
15
+ import * as homeProps from './props'
14
16
  import * as homeData from './data'
15
17
  import { toCategoryCard, toFeaturedProduct } from '../../mappers'
16
18
  import { resolveSectionSources, resolveSectionViewStates } from '../../section-sources'
@@ -20,14 +22,14 @@ import {
20
22
  featurePropsSchema,
21
23
  storefrontHeroPropsSchema,
22
24
  } from './schema'
25
+ import * as homeSchemas from './schema'
23
26
 
24
27
  // The element tree is derived wiring; the rendered props come from the
25
28
  // user-owned ./props.ts module so they survive sync and unit removal.
26
29
  const elements: Record<string, StorefrontElement> = {
27
30
  'home.hero': {
28
- type: 'StorefrontHero',
29
- props: heroProps,
30
- on: { addClickedToCart: { action: 'addClickedToCart' }, openProduct: { action: 'openProduct' } },
31
+ type: 'UniversalBanner',
32
+ props: homeProps.heroBannerProps,
31
33
  },
32
34
  'home.benefits': {
33
35
  type: 'Feature',
@@ -41,9 +43,9 @@ const elements: Record<string, StorefrontElement> = {
41
43
  }
42
44
 
43
45
  const catalog = {
44
- StorefrontHero: {
45
- props: storefrontHeroPropsSchema,
46
- description: 'Landing hero (presentations: compact, showcase, editorial, promotional).',
46
+ UniversalBanner: {
47
+ props: homeSchemas.universalBannerPropsSchema,
48
+ description: 'Campaign banner collection (presentations: single, grid, carousel).',
47
49
  },
48
50
  Feature: {
49
51
  props: featurePropsSchema,
@@ -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, heroImage } from './content'
7
+ import { benefitsContent, categoriesContent, heroContent, heroBannerData, heroImage } from './content'
8
8
 
9
9
  export const heroProps = {
10
10
  ...heroContent,
@@ -12,6 +12,12 @@ export const heroProps = {
12
12
  heroImage,
13
13
  }
14
14
 
15
+ // Banner-hero campaign props (hero slot, UniversalBanner variant). The wrapper
16
+ // shape mirrors `universalBannerPropsSchema` in ./schema.ts.
17
+ export const heroBannerProps = {
18
+ data: heroBannerData,
19
+ }
20
+
15
21
  export const benefitsProps = {
16
22
  ...benefitsContent,
17
23
  }
@@ -11,9 +11,10 @@
11
11
  // the boundary instead of rendering undefined fields or literal icon tags.
12
12
 
13
13
  import { CategoryCard as CategoryCardBlock } from '@thorprovider/blocks/blocks/e-commerce/product-categories/category-card'
14
+ import { UniversalBanner as UniversalBannerBlock } from '@thorprovider/blocks'
14
15
  import { CategoryGrid as CategoryGridBlock } from '@thorprovider/blocks/blocks/e-commerce/product-categories/product-category-grid'
15
- import { StorefrontHero as StorefrontHeroBlock } from '@thorprovider/blocks/blocks/e-commerce/storefront-hero/storefront-hero'
16
16
  import { Feature as FeatureBlock } from '@thorprovider/blocks/blocks/marketing/features/feature'
17
+ import { useEffect, useState } from 'react'
17
18
  import { useStateStore } from '@json-render/react'
18
19
  import { resolveIcon } from '../../icon-map'
19
20
  import type { ViewRegistry } from '../types'
@@ -26,33 +27,15 @@ import {
26
27
  } from './schema'
27
28
 
28
29
  export const registry: ViewRegistry = {
29
- StorefrontHero: ({ props, emit }) => {
30
- const { set } = useStateStore()
31
- const hero = storefrontHeroPropsSchema.parse(props)
32
- return (
33
- <StorefrontHeroBlock
34
- title={hero.title}
35
- description={hero.description}
36
- presentation={hero.presentation}
37
- currency={hero.currency}
38
- products={hero.products}
39
- titleAccent={hero.titleAccent}
40
- badge={hero.badge}
41
- primaryCta={hero.primaryCta}
42
- secondaryCta={hero.secondaryCta}
43
- heroImage={hero.heroImage}
44
- rotationInterval={hero.rotationInterval}
45
- onAddToCart={(product) => {
46
- // Product-card shortcut: add the first purchasable variant.
47
- set('/lastClicked', product)
48
- emit('addClickedToCart')
49
- }}
50
- onBuyNow={(product) => {
51
- set('/lastClicked', product)
52
- emit('openProduct')
53
- }}
54
- />
55
- )
30
+ UniversalBanner: ({ props }) => {
31
+ // The banner hero parses through the same contract the editorial section
32
+ // uses; `now` refreshes at mount so schedule awareness starts truthful.
33
+ const parsed = featureSchemas.universalBannerPropsSchema.parse(props)
34
+ const [now, setNow] = useState(parsed.data.now)
35
+ useEffect(() => {
36
+ setNow(new Date().toISOString())
37
+ }, [])
38
+ return <UniversalBannerBlock data={{ ...parsed.data, now }} />
56
39
  },
57
40
  Feature: ({ props }) => {
58
41
  const feature = featureSchemas.featureCardsSpecSchema.parse({
@@ -194,6 +194,167 @@ export const categoryGridPropsSchema = z.object({
194
194
  skeletonCount: z.number().int().positive().optional(),
195
195
  })
196
196
 
197
+ // Local mirror of the canonical UniversalBanner contract (delivery
198
+ // universal-banner, contract version 4.1.0) — the same shape the editorial
199
+ // section fragment mirrors. Kept local (not imported from the section module)
200
+ // so the home view stays self-contained for homes generated before that
201
+ // delivery. The React-only callbacks (onBannerClick, onCtaClick) are
202
+ // intentionally absent: they are consumer bindings, not serializable props.
203
+ const bannerTargetSchema = z.object({
204
+ kind: z.string(),
205
+ id: z.string().optional(),
206
+ slug: z.string().optional(),
207
+ query: z.string().optional(),
208
+ url: z.string().optional(),
209
+ })
210
+
211
+ const bannerPresentationSchema = z.object({
212
+ mode: z.enum(['image-only', 'overlay', 'split']),
213
+ width: z.enum(['full', 'content', 'custom']),
214
+ maxWidth: z.enum(['sm', 'md', 'lg', 'xl']).optional(),
215
+ height: z.enum(['auto', 'fixed', 'adaptive']),
216
+ heightToken: z.enum(['sm', 'md', 'lg', 'xl']).optional(),
217
+ aspect: z.enum(['square', 'video', 'photo', 'wide', 'tall', 'natural']),
218
+ fit: z.enum(['natural', 'cover', 'contain']),
219
+ focal: z.enum(['top-left', 'top', 'top-right', 'left', 'center', 'right', 'bottom-left', 'bottom', 'bottom-right']),
220
+ align: z.enum(['center', 'start', 'end']),
221
+ radius: z.enum(['md', 'lg', 'xl', 'none', '2xl']),
222
+ surface: z.enum(['primary', 'secondary', 'none', 'card', 'muted', 'accent']),
223
+ overlay: z.enum(['none', 'scrim', 'gradient']),
224
+ overlayOpacity: z.enum(['light', 'medium', 'strong']),
225
+ padding: z.enum(['sm', 'md', 'lg', 'none']),
226
+ textScale: z.enum(['sm', 'md', 'lg']),
227
+ splitSide: z.enum(['media-start', 'media-end']).optional(),
228
+ hiddenFields: z.array(z.string()).optional(),
229
+ })
230
+
231
+ const bannerOverrideSchema = z.object({
232
+ mode: z.enum(['image-only', 'overlay', 'split']).optional(),
233
+ width: z.enum(['full', 'content', 'custom']).optional(),
234
+ maxWidth: z.enum(['sm', 'md', 'lg', 'xl']).optional(),
235
+ height: z.enum(['auto', 'fixed', 'adaptive']).optional(),
236
+ heightToken: z.enum(['sm', 'md', 'lg', 'xl']).optional(),
237
+ aspect: z.enum(['square', 'video', 'photo', 'wide', 'tall', 'natural']).optional(),
238
+ fit: z.enum(['natural', 'cover', 'contain']).optional(),
239
+ focal: z.enum(['top-left', 'top', 'top-right', 'left', 'center', 'right', 'bottom-left', 'bottom', 'bottom-right']).optional(),
240
+ align: z.enum(['center', 'start', 'end']).optional(),
241
+ radius: z.enum(['md', 'lg', 'xl', 'none', '2xl']).optional(),
242
+ surface: z.enum(['primary', 'secondary', 'none', 'card', 'muted', 'accent']).optional(),
243
+ overlay: z.enum(['none', 'scrim', 'gradient']).optional(),
244
+ overlayOpacity: z.enum(['light', 'medium', 'strong']).optional(),
245
+ padding: z.enum(['sm', 'md', 'lg', 'none']).optional(),
246
+ textScale: z.enum(['sm', 'md', 'lg']).optional(),
247
+ splitSide: z.enum(['media-start', 'media-end']).optional(),
248
+ hiddenFields: z.array(z.string()).optional(),
249
+ })
250
+
251
+ const bannerScheduleSchema = z.object({
252
+ from: z.string().optional(),
253
+ to: z.string().optional(),
254
+ timezone: z.string(),
255
+ })
256
+
257
+ export const universalBannerDataSchema = z.object({
258
+ campaign: z.object({
259
+ schemaVersion: z.number(),
260
+ campaignId: z.string(),
261
+ banners: z.array(
262
+ z.object({
263
+ id: z.string(),
264
+ campaignId: z.string(),
265
+ content: z.object({
266
+ name: z.string(),
267
+ alt: z.string(),
268
+ title: z.string().optional(),
269
+ subtitle: z.string().optional(),
270
+ description: z.string().optional(),
271
+ badge: z.string().optional(),
272
+ target: bannerTargetSchema.optional(),
273
+ ctas: z.array(
274
+ z.object({
275
+ id: z.string(),
276
+ label: z.string(),
277
+ target: bannerTargetSchema,
278
+ tone: z.enum(['primary', 'secondary']),
279
+ }),
280
+ ),
281
+ }),
282
+ media: z.object({
283
+ desktop: z.string().optional(),
284
+ tablet: z.string().optional(),
285
+ mobile: z.string().optional(),
286
+ }),
287
+ presentation: bannerPresentationSchema,
288
+ responsive: z
289
+ .object({
290
+ md: bannerOverrideSchema.optional(),
291
+ '2xl': bannerOverrideSchema.optional(),
292
+ base: bannerOverrideSchema.optional(),
293
+ })
294
+ .optional(),
295
+ schedule: bannerScheduleSchema.optional(),
296
+ visible: z.boolean(),
297
+ }),
298
+ ),
299
+ }),
300
+ config: z.object({
301
+ schemaVersion: z.number(),
302
+ blockId: z.string(),
303
+ name: z.string(),
304
+ visible: z.boolean(),
305
+ schedule: bannerScheduleSchema.optional(),
306
+ scheduleAware: z.boolean(),
307
+ responsiveEnabled: z.boolean(),
308
+ presentation: z.enum(['single', 'grid', 'carousel']),
309
+ preset: z.enum(['custom', 'one', 'two', 'three', 'four', 'mosaic', 'hero-two', 'hero-three']),
310
+ refs: z.array(
311
+ z.object({
312
+ bannerId: z.string(),
313
+ overrides: bannerOverrideSchema.optional(),
314
+ }),
315
+ ),
316
+ layout: z.object({
317
+ gapX: z.enum(['sm', 'md', 'lg', 'xl', 'none']),
318
+ gapY: z.enum(['sm', 'md', 'lg', 'xl', 'none']),
319
+ maxWidth: z.enum(['full', 'sm', 'md', 'lg', 'xl']),
320
+ maxHeight: z.enum(['sm', 'md', 'lg', 'xl', 'none']),
321
+ align: z.enum(['center', 'start', 'end']),
322
+ radius: z.enum(['md', 'lg', 'xl', 'none', '2xl']),
323
+ columns: z.object({ md: z.number(), '2xl': z.number(), base: z.number() }).optional(),
324
+ spans: z.array(z.number()).optional(),
325
+ }),
326
+ carousel: z.object({
327
+ visible: z.object({ md: z.number(), '2xl': z.number(), base: z.number() }),
328
+ autoplay: z.boolean(),
329
+ intervalMs: z.number(),
330
+ loop: z.boolean(),
331
+ indicators: z.boolean(),
332
+ carouselOnMobile: z.boolean(),
333
+ peek: z.boolean(),
334
+ story: z.boolean(),
335
+ }),
336
+ rules: z.object({
337
+ emptyLabel: z.string(),
338
+ inactiveLabel: z.string(),
339
+ danglingLabel: z.string(),
340
+ }),
341
+ }),
342
+ now: z.string(),
343
+ banner: z.object({
344
+ carouselPrevious: z.string(),
345
+ carouselNext: z.string(),
346
+ carouselStatus: z.string(),
347
+ carouselRole: z.string(),
348
+ storyPrevious: z.string(),
349
+ storyNext: z.string(),
350
+ storyRole: z.string(),
351
+ }),
352
+ })
353
+
354
+ export const universalBannerPropsSchema = z.object({
355
+ data: universalBannerDataSchema,
356
+ })
357
+
197
358
  export type FeaturedProduct = z.infer<typeof featuredProductSchema>
198
359
  export type FeatureItem = z.infer<typeof featureItemSchema>
199
360
  export type CategoryCard = z.infer<typeof categoryCardSchema>
@@ -208,3 +369,5 @@ export type FeatureCardsSpecProps = z.infer<typeof featureCardsSpecSchema>
208
369
  export type FeatureSplitSpecProps = z.infer<typeof featureSplitSpecSchema>
209
370
  export type CategoryCardProps = z.infer<typeof categoryCardPropsSchema>
210
371
  export type CategoryGridProps = z.infer<typeof categoryGridPropsSchema>
372
+ export type UniversalBannerData = z.infer<typeof universalBannerDataSchema>
373
+ export type UniversalBannerProps = z.infer<typeof universalBannerPropsSchema>
@@ -0,0 +1,2 @@
1
+ // Generated by @thorprovider/storefront. Do not edit directly.
2
+ export const sectionData: Record<string, Record<string, unknown>> = {}
@@ -6,6 +6,7 @@
6
6
  // imports it and wires it into the element tree, so your edits here survive
7
7
  // `storefront sync` and unit removal. Plain data only: no React and no server
8
8
  // imports.
9
+ // A configured `sections/<id>.json` sidecar wins over this map for that instance.
9
10
 
10
11
  export const productLabels = {
11
12
  sizesLabel: 'Variantes',
@@ -8,6 +8,7 @@
8
8
  // Neutral, truthful copy only: these pages make no delivery, shipping, or price
9
9
  // promise and invent no company facts. Replace the copy with your own before
10
10
  // publishing.
11
+ // A configured `sections/<id>.json` sidecar wins over this map for that instance.
11
12
 
12
13
  import type { StaticPageContent } from './schema'
13
14