@thorprovider/storefront 0.14.0 → 0.15.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.
- package/README.md +19 -8
- package/assets/templates/app/lib/__STOREFRONT__/mappers.ts +18 -3
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/schema.universal-main-menu.ts +3 -1
- package/assets/templates/app/public/images/README.md +43 -0
- package/assets/templates/app/public/images/banners/banner-aurora-deal.webp +0 -0
- package/assets/templates/app/public/images/banners/banner-guia-regalo.webp +0 -0
- package/assets/templates/app/public/images/banners/banner-mesa-decor.webp +0 -0
- package/assets/templates/app/public/images/banners/banner-nuevas-llegadas.webp +0 -0
- package/assets/templates/app/public/images/banners/banner-salon-oferta.webp +0 -0
- package/assets/templates/app/public/images/categories/accessories.webp +0 -0
- package/assets/templates/app/public/images/categories/dresses.webp +0 -0
- package/assets/templates/app/public/images/categories/furniture.webp +0 -0
- package/assets/templates/app/public/images/categories/home.webp +0 -0
- package/assets/templates/app/public/images/categories/jackets.webp +0 -0
- package/assets/templates/app/public/images/editorial/studio.webp +0 -0
- package/assets/templates/app/public/images/products/alpine-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/amber-dress.webp +0 -0
- package/assets/templates/app/public/images/products/atlas-lamp.webp +0 -0
- package/assets/templates/app/public/images/products/atlas-sofa.webp +0 -0
- package/assets/templates/app/public/images/products/aurora-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/boreal-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/camille-dress.webp +0 -0
- package/assets/templates/app/public/images/products/ceramic-table-lamp.webp +0 -0
- package/assets/templates/app/public/images/products/cinder-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/copper-lamp.webp +0 -0
- package/assets/templates/app/public/images/products/cove-bag.webp +0 -0
- package/assets/templates/app/public/images/products/dahlia-dress.webp +0 -0
- package/assets/templates/app/public/images/products/drift-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/dune-lamp.webp +0 -0
- package/assets/templates/app/public/images/products/elara-dress.webp +0 -0
- package/assets/templates/app/public/images/products/ember-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/fable-bag.webp +0 -0
- package/assets/templates/app/public/images/products/fjord-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/floor-cushion.webp +0 -0
- package/assets/templates/app/public/images/products/harbor-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/helios-lamp.webp +0 -0
- package/assets/templates/app/public/images/products/iris-dress.webp +0 -0
- package/assets/templates/app/public/images/products/juniper-bag.webp +0 -0
- package/assets/templates/app/public/images/products/kestrel-bag.webp +0 -0
- package/assets/templates/app/public/images/products/linen-armchair.webp +0 -0
- package/assets/templates/app/public/images/products/lumen-dress.webp +0 -0
- package/assets/templates/app/public/images/products/luna-bag.webp +0 -0
- package/assets/templates/app/public/images/products/marble-coffee-table.webp +0 -0
- package/assets/templates/app/public/images/products/marlowe-bag.webp +0 -0
- package/assets/templates/app/public/images/products/meridian-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/nomad-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/nova-dress.webp +0 -0
- package/assets/templates/app/public/images/products/oak-dining-table.webp +0 -0
- package/assets/templates/app/public/images/products/onyx-lamp.webp +0 -0
- package/assets/templates/app/public/images/products/piper-bag.webp +0 -0
- package/assets/templates/app/public/images/products/quill-lamp.webp +0 -0
- package/assets/templates/app/public/images/products/rosalind-dress.webp +0 -0
- package/assets/templates/app/public/images/products/rune-bag.webp +0 -0
- package/assets/templates/app/public/images/products/side-table.webp +0 -0
- package/assets/templates/app/public/images/products/slate-lamp.webp +0 -0
- package/assets/templates/app/public/images/products/solis-dress.webp +0 -0
- package/assets/templates/app/public/images/products/storage-shelf.webp +0 -0
- package/assets/templates/app/public/images/products/terra-lamp.webp +0 -0
- package/assets/templates/app/public/images/products/tundra-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/vantage-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/vera-dress.webp +0 -0
- package/assets/templates/app/public/images/products/verdant-lamp.webp +0 -0
- package/assets/templates/app/public/images/products/wall-mirror.webp +0 -0
- package/assets/templates/app/public/images/products/wool-rug.webp +0 -0
- package/assets/templates/views/account/address-book-advanced.defaults.ts +1 -1
- package/assets/templates/views/home/assembly/assembly.json +0 -1
- package/assets/templates/views/home/assembly/index.skeleton.tsx +3 -7
- package/assets/templates/views/home/assembly/registry.skeleton.tsx +0 -3
- package/assets/templates/views/home/content.ts +34 -80
- package/assets/templates/views/home/data.ts +12 -0
- package/assets/templates/views/home/index.tsx +4 -21
- package/assets/templates/views/home/props.ts +1 -7
- package/assets/templates/views/home/registry.tsx +0 -35
- package/assets/templates/views/home/schema.ts +0 -36
- package/bin/storefront.js +12 -27
- package/package.json +3 -2
- package/recipes/archetypes.json +0 -21
- package/recipes/catalog.json +0 -22
- package/recipes/features.json +0 -2
- package/recipes/recipe.schema.json +5 -0
- package/recipes/recipes.json +19 -16
- package/recipes/validate.mjs +7 -0
- package/scripts/candidate.mjs +3 -3
- package/scripts/default-sections.mjs +1 -0
- package/scripts/env-file.mjs +5 -0
- package/scripts/file-classes.mjs +3 -0
- package/scripts/generate-demo-images.mjs +507 -0
- package/scripts/reconcile.mjs +32 -1
- package/scripts/render-templates.mjs +13 -1
- package/scripts/section-compat.mjs +10 -1
- package/scripts/section-operations.mjs +3 -0
- package/scripts/starter.mjs +25 -1
- package/scripts/theme/starter-theme.mjs +118 -0
- package/skills/sf-view-gen/assets/recipes/archetypes.json +0 -21
- package/skills/sf-view-gen/assets/recipes/catalog.json +0 -22
- package/skills/sf-view-gen/assets/recipes/features.json +0 -2
- package/skills/sf-view-gen/assets/recipes/recipes.json +19 -16
- package/skills/sf-view-gen/assets/templates/views/sections/schema.universal-main-menu.ts +3 -1
- package/skills/sf-view-gen/scripts/validate.mjs +7 -0
- package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/binding.json +0 -5
- package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/catalog.part +0 -8
- package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/element.part +0 -5
- package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/registry.part +0 -31
package/README.md
CHANGED
|
@@ -110,9 +110,17 @@ storefront create my-shop \
|
|
|
110
110
|
| `--site-name <name>` | human site name (`__SITE_NAME__`) | Title Case of `<name>` (`my-shop` → `My Shop`) |
|
|
111
111
|
| `--preset <preset>` | visual preset: `maia`, `nova`, `vega`, `luma`, `lyra`, `mira` | prompted in the wizard (Maia preselected) |
|
|
112
112
|
| `--starter` | seed the full curated composition — every curated view and feature — instead of the minimal `home`+`cart` baseline | off |
|
|
113
|
-
| `--brand <color>` | named brand color (`orange`, `blue`, …) applied as a chromatic primary family (primary/foreground/ring/nav) over the
|
|
113
|
+
| `--brand <color>` | named brand color (`orange`, `blue`, …) applied as a chromatic primary family (primary/foreground/ring/nav) over the starter theme (never prompted) | none |
|
|
114
114
|
| `--force`, `-f` | overwrite files that already exist | off |
|
|
115
115
|
|
|
116
|
+
Every scaffold ships a **marketplace starter theme** before any brand override:
|
|
117
|
+
an orange call-to-action with dark text on it, navy chrome, a grey page field with
|
|
118
|
+
white cards, and `0.25rem` corners — every color pair clears WCAG AA in both
|
|
119
|
+
modes. It is applied through the same theme plan as `storefront theme --set`
|
|
120
|
+
(`scripts/theme/starter-theme.mjs`), so a starter palette and a hand-applied one
|
|
121
|
+
cannot drift; `--brand` is applied last and still wins for the primary family. A
|
|
122
|
+
later `sync` never reverts a theme change.
|
|
123
|
+
|
|
116
124
|
The pipeline runs: preconditions → Next.js base (files only) → `.yarnrc.yml`
|
|
117
125
|
(`nodeLinker: node-modules`) → shadcn base with the preset → dependency install →
|
|
118
126
|
template copy + placeholder substitution → mock `.env.local` + theme → suite install.
|
|
@@ -206,13 +214,16 @@ storefront feature add customer-addresses # refused when the backend lacks man
|
|
|
206
214
|
|
|
207
215
|
A failed probe records no list (unknown), so capability-gated features stay
|
|
208
216
|
uninstallable until `storefront setup` succeeds again. In **mock mode** there is no
|
|
209
|
-
endpoint to probe, so `setup`
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
217
|
+
endpoint to probe, so both `create` and `setup` record the mock provider's own flags:
|
|
218
|
+
a freshly scaffolded store installs the modules the mock genuinely supports (profile
|
|
219
|
+
updates, address book, order history), and the ones it refuses truthfully (email
|
|
220
|
+
change, password change, saved payment methods) stay out. `create` writes that list
|
|
221
|
+
because it always leaves the store in mock mode; `setup` replaces it with the live
|
|
222
|
+
probe when a real backend is connected. `storefront doctor` re-probes and reports an
|
|
223
|
+
installed feature whose capability the backend no longer advertises. Features also
|
|
224
|
+
declare `requires` (a module needs its host feature) and `adapter.needs` (callables
|
|
225
|
+
checked against the adapter/commerce surface), and a held feature is inspectable with
|
|
226
|
+
`storefront features --json` but never installable.
|
|
216
227
|
|
|
217
228
|
The guest flow is backend-authoritative end to end: the signed host cookie binds a
|
|
218
229
|
persistent backend cart; the PDP adds the explicitly selected variant; the cart and
|
|
@@ -5,6 +5,21 @@
|
|
|
5
5
|
|
|
6
6
|
import type { CardProduct, FeaturedProduct, ProductCategoryItem, StoreCategory } from '@thorprovider/blocks'
|
|
7
7
|
|
|
8
|
+
/** Base of the starter's local demo imagery (see `public/images/README.md`). */
|
|
9
|
+
const CATEGORY_IMAGE_BASE = '/images/categories'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Category shot for a `StoreCategory`. The category URL is `/categories/<handle>`
|
|
13
|
+
* and the starter ships one shot per handle, so the handle is the file name: a
|
|
14
|
+
* swapped photo needs no mapper change. The runtime projection carries no image,
|
|
15
|
+
* so the local asset is the source here; `CATEGORY_IMAGE_FALLBACK` covers a
|
|
16
|
+
* category without a shipped file (e.g. a real backend's own taxonomy).
|
|
17
|
+
*/
|
|
18
|
+
export function categoryImage(href: string): string {
|
|
19
|
+
const handle = href.split('/').filter(Boolean).pop()
|
|
20
|
+
return handle ? `${CATEGORY_IMAGE_BASE}/${handle}.webp` : CATEGORY_IMAGE_FALLBACK
|
|
21
|
+
}
|
|
22
|
+
|
|
8
23
|
export const CATEGORY_IMAGE_FALLBACK =
|
|
9
24
|
"data:image/svg+xml;charset=utf-8," +
|
|
10
25
|
encodeURIComponent(
|
|
@@ -38,15 +53,15 @@ export function toFeaturedProduct(card: CardProduct): FeaturedProduct {
|
|
|
38
53
|
* carries no product count, so `itemCount` is unknown here: it is OMITTED (the
|
|
39
54
|
* block then renders no count) rather than fabricated as `0`. A genuine `0`
|
|
40
55
|
* supplied by a richer source is preserved because `itemCount` is optional.
|
|
41
|
-
* `image`
|
|
42
|
-
*
|
|
56
|
+
* `image` is the shipped shot for the category's handle (see `categoryImage`),
|
|
57
|
+
* so a category tile never renders the neutral block placeholder by default. */
|
|
43
58
|
export function toCategoryCard(category: StoreCategory): ProductCategoryItem {
|
|
44
59
|
return {
|
|
45
60
|
id: category.label,
|
|
46
61
|
handle: category.href,
|
|
47
62
|
name: category.label,
|
|
48
63
|
description: '',
|
|
49
|
-
image:
|
|
64
|
+
image: categoryImage(category.href),
|
|
50
65
|
trending: false,
|
|
51
66
|
}
|
|
52
67
|
}
|
package/assets/templates/app/lib/__STOREFRONT__/views/sections/schema.universal-main-menu.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Optional section fragment: universal-main-menu (mirrors recipes/sections.json) — shared contract.
|
|
2
|
-
// Zod mirror of the UniversalMainMenu block contract (delivery universal-main-menu, contract version 4.
|
|
2
|
+
// Zod mirror of the UniversalMainMenu block contract (delivery universal-main-menu, contract version 4.6.1),
|
|
3
3
|
// shared by the server catalog (universal-main-menu.tsx) and the client registry (universal-main-menu.client.tsx).
|
|
4
4
|
// The React-only callbacks (onNavigate, onOpenChange) are intentionally excluded.
|
|
5
5
|
|
|
@@ -79,6 +79,8 @@ export const universalMainMenuDataSchema = z.object({
|
|
|
79
79
|
}),
|
|
80
80
|
behavior: z.object({
|
|
81
81
|
platform: z.string().optional(),
|
|
82
|
+
anchor: z.string().optional(),
|
|
83
|
+
trigger: z.string().optional(),
|
|
82
84
|
mobilePattern: z.string().optional(),
|
|
83
85
|
openOnHover: z.boolean().optional(),
|
|
84
86
|
openDelayMs: z.number().optional(),
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Demo imagery
|
|
2
|
+
|
|
3
|
+
Local static images the starter ships so a generated store looks like a shop
|
|
4
|
+
without a network call. Everything here is served from `public/`, so these are
|
|
5
|
+
plain files, not a CDN and not remote URLs.
|
|
6
|
+
|
|
7
|
+
Replace any file with your own shot **at the same path** — no code change, no
|
|
8
|
+
manifest, no rebuild step. Delete a file and the block falls back to its own
|
|
9
|
+
placeholder.
|
|
10
|
+
|
|
11
|
+
| Path | Size | Used by |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| `products/<handle>.webp` | 1200×1200 (square) | product cards in the grid and the sliders, product gallery |
|
|
14
|
+
| `categories/<handle>.webp` | 900×900 (square) | category tiles |
|
|
15
|
+
| `banners/<banner-id>.webp` | 1800×1000 (landscape) | campaign banners on the home view |
|
|
16
|
+
| `editorial/studio.webp` | 1600×1200 | the benefits section (rendered in grayscale) |
|
|
17
|
+
|
|
18
|
+
The file name is the contract: `<handle>` is the product or category handle in
|
|
19
|
+
your catalog, `<banner-id>` is the id of the banner in `views/home/content.ts`.
|
|
20
|
+
Serving a new banner is a new file plus its id in the content; serving a new
|
|
21
|
+
product is a new file named after the product.
|
|
22
|
+
|
|
23
|
+
## How the mock catalog finds these
|
|
24
|
+
|
|
25
|
+
Mock mode resolves `<base>/products/<handle>.webp` and
|
|
26
|
+
`<base>/categories/<handle>.webp`, where `<base>` is `THOR_MOCK_ASSETS` from
|
|
27
|
+
`.env.local` (`/images` in a generated store). Unset the variable and the mock
|
|
28
|
+
provider draws its own SVG placeholders instead, so the store still renders
|
|
29
|
+
with no assets at all.
|
|
30
|
+
|
|
31
|
+
Real mode (Medusa) ignores this folder entirely — the backend serves its own
|
|
32
|
+
product images.
|
|
33
|
+
|
|
34
|
+
## Regenerating the shipped art
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
yarn workspace @thorprovider/storefront demo:images --force
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The script (`scripts/generate-demo-images.mjs`) renders deterministic SVG
|
|
41
|
+
through `sharp`. The shipped art is illustration, not photography: it exists to
|
|
42
|
+
show the composition a real shot belongs in. Swap in photography for a
|
|
43
|
+
production store.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -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,
|
|
14
|
+
import { benefitsProps, heroProps } from './props'
|
|
15
15
|
import * as homeProps from './props'
|
|
16
16
|
import * as homeData from './data'
|
|
17
|
-
import {
|
|
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,
|
|
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
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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:
|
|
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: '
|
|
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:
|
|
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: '
|
|
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:
|
|
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: '
|
|
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:
|
|
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: '
|
|
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:
|
|
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: '
|
|
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
|
|
418
|
-
// the campaign band changes the tone, deals carry urgency,
|
|
419
|
-
// the returning visitor something new
|
|
420
|
-
//
|
|
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
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
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
|
}
|