@thorprovider/storefront 0.15.1 → 0.15.2

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.
@@ -3,7 +3,9 @@
3
3
  import { notFound } from 'next/navigation'
4
4
  import { buildBreadcrumbListJsonLd, serializeJsonLd } from '@thorprovider/runtime/contracts'
5
5
  import { getCatalog } from '@thorprovider/runtime/commerce'
6
+ import type { UniversalMainMenuData } from '@thorprovider/blocks'
6
7
  import { __STOREFRONT_CAMEL__App } from '@/lib/__STOREFRONT__/runtime'
8
+ import { buildDemoHeaderMenu, buildHeaderMenu } from '@/lib/__STOREFRONT__/header-universal'
7
9
  import { readCartStateForRender } from '@/lib/__STOREFRONT__/cart-state'
8
10
  import { readAccountSession } from '@/lib/__STOREFRONT__/account-session'
9
11
  import { toAccountInitialState } from '@/lib/__STOREFRONT__/account-session.core'
@@ -25,15 +27,25 @@ export default async function Page({
25
27
  const data = await __STOREFRONT_CAMEL__App.getPageData({ params, searchParams })
26
28
  if (!data) return notFound()
27
29
 
28
- // The shared shell is rendered for every route, so resolve its category links
29
- // here rather than relying on a particular view loader. `getCatalog()` is
30
+ // The shared shell is rendered for every route, so resolve its navigation here
31
+ // rather than relying on a particular view loader. `getCatalog()` is
30
32
  // request-cached by the commerce bridge and is shared with the view loader.
33
+ // The header's menu is the storefront's real catalog taxonomy for a LIVE
34
+ // catalog; without one (mock or no backend) it is the design-B demo taxonomy.
35
+ // The legacy `navCategories` flat list is kept for consumers that still read
36
+ // it.
31
37
  let navCategories: { label: string; href: string }[] = []
38
+ let headerMenu: UniversalMainMenuData = buildDemoHeaderMenu()
32
39
  try {
33
- navCategories = (await getCatalog()).categories.map(({ label, href }) => ({ label, href }))
40
+ const catalog = await getCatalog()
41
+ navCategories = catalog.categories.map(({ label, href }) => ({ label, href }))
42
+ headerMenu =
43
+ catalog.source === 'medusa'
44
+ ? buildHeaderMenu(catalog.categoriesRaw ?? [])
45
+ : buildDemoHeaderMenu()
34
46
  } catch (error) {
35
47
  // A failed catalog read must not invent links or take down otherwise usable
36
- // page content; keep the shell empty and leave a diagnostic for operators.
48
+ // page content; keep the demo taxonomy and leave a diagnostic for operators.
37
49
  console.error('[storefront] Failed to resolve shared navigation categories', error)
38
50
  }
39
51
 
@@ -0,0 +1,363 @@
1
+ // Thor Commerce shell data: the universal header's authored config and the
2
+ // menu builder that turns the storefront's own catalog taxonomy into the
3
+ // header's navigation.
4
+ //
5
+ // Derived (package-owned): regenerate on `storefront sync`. The header's menu
6
+ // IS the universal main menu — there is no horizontal category strip and no
7
+ // separate mega menu.
8
+ //
9
+ // Two navigation sources, one seam:
10
+ // - `buildHeaderMenu` maps the provider's real `ProductCategory[]` taxonomy
11
+ // (id/name/handle/description/productCount/image + parentCategoryId) to a
12
+ // `UniversalMainMenuData`, so hrefs are the storefront's real
13
+ // `/categories/<handle>` routes and images/counts are whatever the backend
14
+ // supplies. This is the live-catalog path and is preferred when a live
15
+ // (Medusa) catalog is present.
16
+ // - `buildDemoHeaderMenu` is a clearly-labelled DEMO taxonomy — the design-B
17
+ // delivery demo — used when no live catalog is present. Its categories reuse
18
+ // the starter's real catalog handles as hrefs (never `#`) and are enriched to
19
+ // the full menu shape (children, badges, counts, descriptions, the season
20
+ // promotion card and the demo labels).
21
+
22
+ import { createDefaultConfig } from '@thorprovider/blocks/blocks/designs/header-universal/contracts'
23
+ import type {
24
+ HeaderConfig,
25
+ HeaderContext,
26
+ HeaderModule,
27
+ } from '@thorprovider/blocks/blocks/designs/header-universal/contracts'
28
+ import type { UniversalMainMenuData, UniversalMainMenuItem } from '@thorprovider/blocks'
29
+ import type { ProductCategory } from '@thorprovider/types'
30
+
31
+ /**
32
+ * The starter header. The demo feeds the commerce surface the starter can
33
+ * honestly render: the announcement, the search field, the account/wishlist/
34
+ * cart accesses and the main menu. The horizontal category strip (`navigation`)
35
+ * and the region/language/support accesses stay off — the starter feeds no data
36
+ * for them, and the support module's default `/help` action is a route the
37
+ * scaffold does not serve.
38
+ */
39
+ export function createStorefrontHeaderConfig(): HeaderConfig {
40
+ const base = createDefaultConfig()
41
+
42
+ // Keep the demo surface and drop the host-optional modules the starter does
43
+ // not use (the `navigation` strip, region/language/support, and every other
44
+ // preset module).
45
+ const kept = new Set([
46
+ 'announcement',
47
+ 'logo',
48
+ 'main-menu',
49
+ 'search',
50
+ 'account',
51
+ 'cart',
52
+ ])
53
+ const wishlistModule: HeaderModule = {
54
+ id: 'wishlist',
55
+ type: 'wishlist',
56
+ enabled: true,
57
+ requires: 'saved-items',
58
+ props: { showCount: true },
59
+ // The starter has no dedicated wishlist route; the icon navigates to the
60
+ // account surface where saved items live.
61
+ actions: { click: { name: 'navigate', payload: { href: '/account' } } },
62
+ }
63
+ const modules = [
64
+ ...base.modules
65
+ .filter((module) => kept.has(module.id))
66
+ .map((module) => {
67
+ if (module.id !== 'search') return module
68
+ // The demo search is always a bar (never the icon fallback): the block
69
+ // measures its container client-side, so the server render would
70
+ // otherwise fall back to the base-breakpoint icon and the search field
71
+ // copy would never appear in the SSR HTML.
72
+ return { ...module, responsive: undefined }
73
+ }),
74
+ wishlistModule,
75
+ ]
76
+
77
+ const layout = base.layout.map((row) => {
78
+ if (row.id === 'main') {
79
+ return {
80
+ ...row,
81
+ zones: {
82
+ start: ['logo', 'main-menu'],
83
+ center: ['search'],
84
+ end: ['account', 'wishlist', 'cart'],
85
+ },
86
+ }
87
+ }
88
+ if (row.id === 'utility') {
89
+ // Only the announcement; region/language/support are removed above.
90
+ return { ...row, zones: { start: ['announcement'], center: [], end: [] } }
91
+ }
92
+ return row
93
+ })
94
+
95
+ return {
96
+ ...base,
97
+ // The shell `Layout` already wraps the header slot in a sticky `<header>`,
98
+ // so the block itself stays static rather than stacking another sticky.
99
+ behavior: { ...base.behavior, position: 'static' },
100
+ layout,
101
+ modules,
102
+ // The demo feeds every capability the enriched modules require.
103
+ capabilities: {
104
+ catalog: true,
105
+ 'catalog-search': true,
106
+ checkout: true,
107
+ 'customer-account': true,
108
+ 'saved-items': true,
109
+ },
110
+ visibilityRules: [],
111
+ }
112
+ }
113
+
114
+ /** Per-module copy the header block reads through `labels[module.type]`. */
115
+ export const storefrontHeaderLabels: Record<string, Record<string, string>> = {
116
+ logo: { home: 'Inicio' },
117
+ 'main-menu': { triggerLabel: 'Menú' },
118
+ search: {
119
+ label: 'Buscar',
120
+ placeholder: 'Buscar productos, marcas o SKU',
121
+ submit: 'Buscar',
122
+ },
123
+ cart: { label: 'Carrito' },
124
+ account: { account: 'Cuenta' },
125
+ wishlist: { label: 'Favoritos' },
126
+ announcement: { link: 'Ver más' },
127
+ }
128
+
129
+ /** The live-catalog menu labels: the trigger is `Menú`, the rest are required. */
130
+ const HEADER_MENU_LABELS: UniversalMainMenuData['labels'] = {
131
+ menuTrigger: 'Menú',
132
+ menuTitle: 'Categorías',
133
+ close: 'Cerrar menú',
134
+ back: 'Volver',
135
+ openSubmenu: 'Abrir {name}',
136
+ viewAll: 'Ver todo {name}',
137
+ productCount: '{count} productos',
138
+ productCountOne: '1 producto',
139
+ featured: 'Destacado',
140
+ empty: 'No hay categorías disponibles',
141
+ emptyHint: 'El catálogo se está actualizando.',
142
+ panelLabel: 'Menú de {name}',
143
+ railLabel: 'Categorías',
144
+ levelLabel: 'Nivel {level}',
145
+ noImage: 'Sin imagen',
146
+ }
147
+
148
+ /** The demo labels: identical to the live set except the design-B menu title. */
149
+ const DEMO_MENU_LABELS: UniversalMainMenuData['labels'] = {
150
+ ...HEADER_MENU_LABELS,
151
+ menuTitle: 'Todo empieza aquí',
152
+ }
153
+
154
+ /**
155
+ * The shared menu config: hybrid layout, container-anchored panel, light ghost
156
+ * trigger. Both the live taxonomy and the demo taxonomy render identically.
157
+ */
158
+ function buildMenuConfig(): UniversalMainMenuData['config'] {
159
+ return {
160
+ layouts: {
161
+ default: 'hybrid',
162
+ desktop: 'hybrid',
163
+ mobile: 'hybrid',
164
+ bindings: {},
165
+ options: {},
166
+ },
167
+ behavior: {
168
+ platform: 'auto',
169
+ anchor: 'container',
170
+ trigger: 'ghost',
171
+ mobilePattern: 'drill-down',
172
+ openOnHover: true,
173
+ openDelayMs: 200,
174
+ closeDelayMs: 160,
175
+ direction: 'auto',
176
+ },
177
+ transition: {
178
+ panel: 'slide',
179
+ level: 'fade',
180
+ duration: 'base',
181
+ respectReducedMotion: true,
182
+ },
183
+ }
184
+ }
185
+
186
+ function toMenuItem(category: ProductCategory): UniversalMainMenuItem {
187
+ return {
188
+ id: category.id,
189
+ label: category.name,
190
+ href: `/categories/${category.handle}`,
191
+ ...(category.description ? { description: category.description } : {}),
192
+ ...(category.image ? { image: { src: category.image, alt: category.name } } : {}),
193
+ ...(category.productCount !== undefined ? { count: category.productCount } : {}),
194
+ }
195
+ }
196
+
197
+ /** Build the recursive menu tree from the provider's flat taxonomy. */
198
+ function buildTree(categories: ProductCategory[]): UniversalMainMenuItem[] {
199
+ const byParent = new Map<string | undefined, ProductCategory[]>()
200
+ for (const category of categories) {
201
+ const list = byParent.get(category.parentCategoryId)
202
+ if (list) list.push(category)
203
+ else byParent.set(category.parentCategoryId, [category])
204
+ }
205
+ const build = (parentId: string | undefined): UniversalMainMenuItem[] =>
206
+ (byParent.get(parentId) ?? []).map((category) => {
207
+ const children = build(category.id)
208
+ return {
209
+ ...toMenuItem(category),
210
+ ...(children.length > 0 ? { children } : {}),
211
+ }
212
+ })
213
+ return build(undefined)
214
+ }
215
+
216
+ /**
217
+ * The header's LIVE navigation source: a `UniversalMainMenuData` whose
218
+ * categories are the storefront's real catalog taxonomy. The panel is
219
+ * container-anchored and the trigger is the light ghost control.
220
+ */
221
+ export function buildHeaderMenu(categories: ProductCategory[]): UniversalMainMenuData {
222
+ return {
223
+ categories: buildTree(categories),
224
+ config: buildMenuConfig(),
225
+ labels: HEADER_MENU_LABELS,
226
+ }
227
+ }
228
+
229
+ /**
230
+ * The design-B delivery demo taxonomy. Demo-only: the starter's real catalog
231
+ * handles are reused as hrefs so every link resolves to a real route (never
232
+ * `#`), while the menu is enriched to the full shape the designer delivered —
233
+ * children (a featured grid), badges (`Nuevo`, `-30%`), counts, descriptions,
234
+ * the season promotion card and the demo labels. Fed only when no live catalog
235
+ * is present.
236
+ */
237
+ const DEMO_MENU_CATEGORIES: UniversalMainMenuItem[] = [
238
+ {
239
+ id: 'demo-jackets',
240
+ label: 'Jackets',
241
+ href: '/categories/jackets',
242
+ description: 'Outerwear and layering pieces.',
243
+ count: 12,
244
+ badge: { label: 'Nuevo', tone: 'accent' },
245
+ children: [
246
+ { id: 'demo-jackets-quilted', label: 'Quilted', href: '/categories/jackets', count: 6 },
247
+ { id: 'demo-jackets-coats', label: 'Coats', href: '/categories/dresses', count: 4 },
248
+ { id: 'demo-jackets-layers', label: 'Light layers', href: '/categories/accessories', count: 2 },
249
+ ],
250
+ },
251
+ {
252
+ id: 'demo-dresses',
253
+ label: 'Dresses',
254
+ href: '/categories/dresses',
255
+ description: 'Editorial silhouettes for seasonal collections.',
256
+ count: 9,
257
+ },
258
+ {
259
+ id: 'demo-home',
260
+ label: 'Home',
261
+ href: '/categories/home',
262
+ description: 'Decor and living objects for lifestyle layouts.',
263
+ count: 14,
264
+ },
265
+ {
266
+ id: 'demo-accessories',
267
+ label: 'Accessories',
268
+ href: '/categories/accessories',
269
+ description: 'Complementary products for cart and bundle flows.',
270
+ count: 7,
271
+ },
272
+ {
273
+ id: 'demo-furniture',
274
+ label: 'Furniture',
275
+ href: '/categories/furniture',
276
+ description: 'Statement pieces for the home, including oversized and fragile deliveries.',
277
+ count: 5,
278
+ badge: { label: '-30%', tone: 'promo' },
279
+ },
280
+ ]
281
+
282
+ /** The design-B season promotion card (demo copy). */
283
+ const DEMO_PROMOTION: UniversalMainMenuData['promotion'] = {
284
+ id: 'demo-promo-invierno',
285
+ eyebrow: 'COLECCIÓN DE INVIERNO',
286
+ title: 'Textiles que abrigan la casa',
287
+ description: 'Lana virgen y lino lavado, tejidos en talleres locales.',
288
+ href: '/categories/home',
289
+ ctaLabel: 'Ver la colección',
290
+ }
291
+
292
+ /**
293
+ * The header's DEMO navigation source: the full design-B taxonomy. The panel is
294
+ * open in the first paint so the designer sees the rail, the featured grid and
295
+ * the promotion card without a click.
296
+ */
297
+ export function buildDemoHeaderMenu(): UniversalMainMenuData {
298
+ return {
299
+ categories: DEMO_MENU_CATEGORIES,
300
+ config: buildMenuConfig(),
301
+ labels: DEMO_MENU_LABELS,
302
+ promotion: DEMO_PROMOTION,
303
+ preview: { defaultOpen: true },
304
+ }
305
+ }
306
+
307
+ /**
308
+ * The runtime context the shell feeds the header. This is the clearly-labelled
309
+ * DEMO state: the announcement, cart badge (3), wishlist count (4) and account
310
+ * access are demo copy fed so the full design-B header renders in the starter —
311
+ * never a real commerce read. Region/language stay empty (their modules are
312
+ * removed from the config, so nothing reads them). The live catalog/menu seam
313
+ * is the `menu` argument (built by the host from the real taxonomy or the demo
314
+ * taxonomy above).
315
+ */
316
+ export function buildHeaderContext(
317
+ siteName: string,
318
+ menu?: UniversalMainMenuData,
319
+ accent?: string,
320
+ ): HeaderContext {
321
+ return {
322
+ brand: { name: siteName, href: '/', ...(accent ? { accent } : {}) },
323
+ menu,
324
+ cart: {
325
+ state: 'ready',
326
+ // Demo badge count only: no real cart lines are fabricated.
327
+ lines: [],
328
+ quantity: 3,
329
+ lineCount: 0,
330
+ currency: 'EUR',
331
+ shippingGroups: 0,
332
+ subtotalUnavailableLabel: 'Envío calculado al finalizar la compra',
333
+ promotions: [],
334
+ },
335
+ account: { state: 'guest', menu: [] },
336
+ wishlist: { count: 4, lists: 1 },
337
+ regions: { activeId: '', options: [] },
338
+ languages: { activeCode: '', options: [] },
339
+ locations: { enabled: false, options: [] },
340
+ announcements: [
341
+ {
342
+ id: 'demo-free-shipping',
343
+ message: 'Envío gratis desde 250 EUR',
344
+ href: '/categories',
345
+ linkLabel: 'Ver más',
346
+ tone: 'accent',
347
+ dismissible: false,
348
+ },
349
+ ],
350
+ notifications: { available: false, unread: 0, items: [] },
351
+ openComponents: [],
352
+ now: new Date().toISOString(),
353
+ capabilities: {
354
+ catalog: true,
355
+ 'catalog-search': true,
356
+ checkout: true,
357
+ 'customer-account': true,
358
+ 'saved-items': true,
359
+ },
360
+ context: 'guest',
361
+ page: 'home',
362
+ }
363
+ }
@@ -10,13 +10,14 @@
10
10
  // navigates to the detail, where a variant is chosen explicitly.
11
11
 
12
12
  import { defineRegistry, useStateStore } from '@json-render/react'
13
+ import { useNextApp } from '@json-render/next'
13
14
  import { useEffect } from 'react'
14
15
  import { usePathname } from 'next/navigation'
15
16
  import { BackToTop as BackToTopBlock } from '@thorprovider/blocks/blocks/e-commerce/navigation/back-to-top'
16
17
  import { MobileBottomNav as MobileBottomNavBlock } from '@thorprovider/blocks/blocks/e-commerce/navigation/mobile-bottom-nav'
17
18
  import { SkipToContent as SkipToContentBlock } from '@thorprovider/blocks/blocks/e-commerce/navigation/skip-to-content'
18
19
  import Banner1 from '@thorprovider/blocks/blocks/marketing/banners/banner-1'
19
- import { Navbar, StorefrontNavbar, UniversalFooter } from '@thorprovider/blocks'
20
+ import { HeaderUniversal, Navbar, StorefrontNavbar, UniversalFooter } from '@thorprovider/blocks'
20
21
  import { ProductGrid as ProductGridBlock } from '@thorprovider/blocks/blocks/e-commerce/product-list/product-grid'
21
22
  import type { BackToTopProps } from '@thorprovider/blocks/blocks/e-commerce/navigation/back-to-top'
22
23
  import type { MobileBottomNavProps } from '@thorprovider/blocks/blocks/e-commerce/navigation/mobile-bottom-nav'
@@ -30,6 +31,7 @@ import { useStorefrontHandlers } from './handlers'
30
31
  import { cartViewAvailable, checkoutAvailable, mountedFeatureNames } from './composition'
31
32
  import { accountStoreUser } from './account-user.core'
32
33
  import { toUniversalFooterProps } from './footer-content'
34
+ import { buildHeaderContext, createStorefrontHeaderConfig, storefrontHeaderLabels } from './header-universal'
33
35
  import type { AccountIdentity, AccountResolution } from './account-session.core'
34
36
  import {
35
37
  bannerPropsSchema,
@@ -37,6 +39,7 @@ import {
37
39
  navbarPropsSchema,
38
40
  productGridPropsSchema,
39
41
  storefrontNavbarPropsSchema,
42
+ universalHeaderShellPropsSchema,
40
43
  } from './schema'
41
44
  import { viewRegistries } from './views/registry'
42
45
 
@@ -195,6 +198,9 @@ const baseComponents = {
195
198
  logoHref={parsed.logoHref}
196
199
  logoAccent={parsed.logoAccent}
197
200
  className={parsed.className}
201
+ // Chrome copy in the store language, authored in the user-owned shell
202
+ // (`shell/content.ts`); omitted fields keep the block's English default.
203
+ labels={parsed.labels}
198
204
  accountHref={parsed.accountHref}
199
205
  // Signed-in identity + account feedback, only while customer-auth is
200
206
  // mounted. `user` is mapped from the shared allowlisted identity; the
@@ -251,6 +257,37 @@ const baseComponents = {
251
257
  />
252
258
  )
253
259
  },
260
+ HeaderUniversal: ({ props }: { props: Record<string, unknown> }) => {
261
+ const parsed = universalHeaderShellPropsSchema.parse(props)
262
+ const { navigate } = useNextApp()
263
+ const config = createStorefrontHeaderConfig()
264
+ const context = buildHeaderContext(
265
+ parsed.siteName,
266
+ parsed.menu,
267
+ parsed.logoAccent?.text.trim() || undefined,
268
+ )
269
+ // The block prevents the default anchor navigation and emits `navigate`
270
+ // instead, so the host resolves it to client navigation (the logo and every
271
+ // menu destination). Any other action name is intentionally unhandled: the
272
+ // starter header has no cart/account/search surface.
273
+ const handleAction = (action: {
274
+ name: string
275
+ payload?: Record<string, string | number | boolean>
276
+ }) => {
277
+ if (action.name === 'navigate' && typeof action.payload?.href === 'string') {
278
+ navigate(action.payload.href)
279
+ }
280
+ }
281
+ return (
282
+ <HeaderUniversal
283
+ config={config}
284
+ context={context}
285
+ labels={storefrontHeaderLabels}
286
+ className={parsed.className}
287
+ onAction={handleAction}
288
+ />
289
+ )
290
+ },
254
291
  Banner: ({ props, emit }: { props: Record<string, unknown>; emit: (event: string) => void }) => {
255
292
  const parsed = bannerPropsSchema.parse(props)
256
293
  const { set } = useStateStore()
@@ -261,6 +298,7 @@ const baseComponents = {
261
298
  href={parsed.href}
262
299
  linkLabel={parsed.linkLabel}
263
300
  avatars={parsed.avatars}
301
+ dismissLabel={parsed.dismissLabel}
264
302
  onDismiss={() => {
265
303
  set('/bannerDismissed', true)
266
304
  emit('dismissBanner')
@@ -7,6 +7,7 @@
7
7
  import { z } from 'zod'
8
8
 
9
9
  import { footerContentSchema } from './footer-content'
10
+ import { universalMainMenuDataSchema } from './views/sections/schema.universal-main-menu'
10
11
 
11
12
  export const ctaSchema = z.object({
12
13
  label: z.string(),
@@ -126,6 +127,40 @@ export const accountMenuItemSchema = z.object({
126
127
  icon: z.enum(['orders', 'wishlist', 'addresses', 'settings']).optional(),
127
128
  })
128
129
 
130
+ // Chrome copy mirror of the block's `StorefrontNavbarLabels` (quality baseline
131
+ // D3). Plain strings only; every field optional so an omitted label keeps the
132
+ // block's shipped English default. `{count}`/`{name}` tokens are filled by the
133
+ // block, so they survive serialization untouched.
134
+ export const storefrontNavbarLabelsSchema = z.object({
135
+ openMenu: z.string().optional(),
136
+ storeNav: z.string().optional(),
137
+ account: z.string().optional(),
138
+ search: z.string().optional(),
139
+ loadingAccount: z.string().optional(),
140
+ accountRetry: z.string().optional(),
141
+ accountUnavailableTitle: z.string().optional(),
142
+ accountMenu: z.string().optional(),
143
+ help: z.string().optional(),
144
+ signOut: z.string().optional(),
145
+ cartCount: z.string().optional(),
146
+ cartCountOne: z.string().optional(),
147
+ cartContains: z.string().optional(),
148
+ cartContainsOne: z.string().optional(),
149
+ cartTitle: z.string().optional(),
150
+ cartClose: z.string().optional(),
151
+ decreaseQuantity: z.string().optional(),
152
+ increaseQuantity: z.string().optional(),
153
+ remove: z.string().optional(),
154
+ removeItem: z.string().optional(),
155
+ emptyTitle: z.string().optional(),
156
+ emptyDescription: z.string().optional(),
157
+ continueShopping: z.string().optional(),
158
+ subtotal: z.string().optional(),
159
+ shippingTaxes: z.string().optional(),
160
+ checkout: z.string().optional(),
161
+ viewCart: z.string().optional(),
162
+ })
163
+
129
164
  export const storefrontNavbarPropsSchema = z.object({
130
165
  storeCategories: z.array(navCategorySchema),
131
166
  shippingNote: z.string().optional(),
@@ -145,6 +180,8 @@ export const storefrontNavbarPropsSchema = z.object({
145
180
  // Held global search (E2 task 5.4): the generated shell opts out of the
146
181
  // navbar search control while no verified global search contract exists.
147
182
  showSearch: z.boolean().optional(),
183
+ // Chrome copy in the store language, from the user-owned shell seam.
184
+ labels: storefrontNavbarLabelsSchema.optional(),
148
185
  })
149
186
 
150
187
  export const bannerPropsSchema = z.object({
@@ -153,6 +190,8 @@ export const bannerPropsSchema = z.object({
153
190
  href: z.string(),
154
191
  linkLabel: z.string(),
155
192
  avatars: z.array(z.string()).optional(),
193
+ // Dismiss copy in the store language; the block defaults to English.
194
+ dismissLabel: z.string().optional(),
156
195
  })
157
196
 
158
197
  export const productGridPropsSchema = z.object({
@@ -204,3 +243,16 @@ export const mobileBottomNavPropsSchema = z.object({
204
243
  ariaLabel: z.string().optional(),
205
244
  className: z.string().optional(),
206
245
  })
246
+
247
+ // The universal header's shell props. The config and labels are authored in
248
+ // the shell data module (`../header-universal`) and the runtime `HeaderContext`
249
+ // is built from the site name and the host-fed menu, so the shell only declares
250
+ // the serializable chrome: the site name, the menu data, and the user-owned
251
+ // brand seam (wordmark accent + surface class). `menu` is optional so a failed
252
+ // catalog read still renders the wordmark.
253
+ export const universalHeaderShellPropsSchema = z.object({
254
+ siteName: z.string(),
255
+ menu: universalMainMenuDataSchema.optional(),
256
+ logoAccent: shellAccentSchema.optional(),
257
+ className: z.string().optional(),
258
+ })
@@ -14,6 +14,7 @@
14
14
  // the footer content contract, not here: `GET /store/footer` is what a backend
15
15
  // implements, and `../footer-content.ts` documents its shape and defaults.
16
16
 
17
+ import type { StorefrontNavbarLabels } from '@thorprovider/blocks'
17
18
  import type { FooterContent } from '../footer-content'
18
19
 
19
20
  export interface ShellAccent {
@@ -59,6 +60,48 @@ export const navbarClassName: string | undefined = undefined
59
60
  */
60
61
  export const footerClassName: string | undefined = undefined
61
62
 
63
+ /**
64
+ * Accessible name of the announcement banner's dismiss control. The block
65
+ * defaults to English; the generated store speaks Spanish from here.
66
+ */
67
+ export const bannerDismissLabel: string = 'Cerrar anuncio'
68
+
69
+ /**
70
+ * Chrome copy for the navbar and its cart sheet (header, search, account,
71
+ * cart count, sheet actions). The blocks default to English; the generated
72
+ * store speaks Spanish from here. `{count}`/`{name}` are filled by the block;
73
+ * keep them in any translation. Omit a key to keep the block's default.
74
+ */
75
+ export const navbarLabels: StorefrontNavbarLabels = {
76
+ openMenu: 'Abrir menú',
77
+ storeNav: 'Tienda',
78
+ account: 'Cuenta',
79
+ search: 'Buscar productos',
80
+ loadingAccount: 'Cargando sesión de cuenta',
81
+ accountRetry: 'Reintentar sesión de cuenta',
82
+ accountUnavailableTitle: 'Sesión de cuenta no disponible',
83
+ accountMenu: 'Menú de cuenta de {name}',
84
+ help: 'Ayuda y soporte',
85
+ signOut: 'Cerrar sesión',
86
+ cartCount: 'Carrito, {count} artículos',
87
+ cartCountOne: 'Carrito, {count} artículo',
88
+ cartContains: 'El carrito contiene {count} artículos',
89
+ cartContainsOne: 'El carrito contiene {count} artículo',
90
+ cartTitle: 'Carrito',
91
+ cartClose: 'Cerrar',
92
+ decreaseQuantity: 'Disminuir cantidad',
93
+ increaseQuantity: 'Aumentar cantidad',
94
+ remove: 'Quitar',
95
+ removeItem: 'Quitar {name} del carrito',
96
+ emptyTitle: 'Tu carrito está vacío',
97
+ emptyDescription: 'Cuando agregues algo, aparecerá aquí.',
98
+ continueShopping: 'Seguir comprando',
99
+ subtotal: 'Subtotal',
100
+ shippingTaxes: 'El envío y los impuestos se calculan al finalizar la compra.',
101
+ checkout: 'Finalizar compra',
102
+ viewCart: 'Ver carrito',
103
+ }
104
+
62
105
  /** Neutral footer brand description. No delivery/shipping promise. */
63
106
  export const brandDescription: string =
64
107
  'Catálogo en línea de productos para tu hogar y tu negocio.'
@@ -12,6 +12,7 @@ import {
12
12
  linkColumns,
13
13
  logoAccent,
14
14
  navbarClassName,
15
+ navbarLabels,
15
16
  shippingNote,
16
17
  } from './content'
17
18
  import { footerContentDefaults } from '../footer-content'
@@ -19,6 +20,9 @@ import { footerContentDefaults } from '../footer-content'
19
20
  export const navbarShellProps = {
20
21
  logoAccent,
21
22
  className: navbarClassName,
23
+ // Chrome copy in the store language; the blocks keep English defaults for
24
+ // consumers that supply nothing (quality baseline D3).
25
+ labels: navbarLabels,
22
26
  // Optional utility-strip note. Empty by default, so the strip renders only
23
27
  // once a real note (or a utility link) is configured.
24
28
  shippingNote,