create-brainerce-store 1.54.0 → 1.57.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/dist/index.js CHANGED
@@ -31,7 +31,7 @@ var require_package = __commonJS({
31
31
  "package.json"(exports2, module2) {
32
32
  module2.exports = {
33
33
  name: "create-brainerce-store",
34
- version: "1.54.0",
34
+ version: "1.57.0",
35
35
  description: "Scaffold a production-ready e-commerce storefront connected to Brainerce",
36
36
  bin: {
37
37
  "create-brainerce-store": "dist/index.js"
@@ -399,6 +399,9 @@ async function scaffold(options) {
399
399
  * must keep using the escaped storeNameJs / storeNameEnv variants. */
400
400
  storeName: cleanStoreName,
401
401
  storeNameJs: toJsStringLiteral(cleanStoreName),
402
+ /** Pre-escaped for splicing into a JSON string value (no wrapping
403
+ * quotes) — used by the `{{storeName}}` token in messages-patch files. */
404
+ storeNameJsonEscaped: JSON.stringify(cleanStoreName).slice(1, -1),
402
405
  titleTemplateJs: toJsStringLiteral(`%s | ${cleanStoreName}`),
403
406
  storeNameEnv: toEnvLiteral(cleanStoreName),
404
407
  currencyEnv: toEnvLiteral(cleanCurrency),
@@ -479,7 +482,11 @@ async function scaffold(options) {
479
482
  if (!await import_fs_extra.default.pathExists(patchFile)) continue;
480
483
  const targetFile = import_path.default.join(targetMessages, file);
481
484
  const base = await import_fs_extra.default.readJson(targetFile);
482
- const patch = await import_fs_extra.default.readJson(patchFile);
485
+ const patchText = (await import_fs_extra.default.readFile(patchFile, "utf-8")).replace(
486
+ /\{\{storeName\}\}/g,
487
+ templateVars.storeNameJsonEscaped
488
+ );
489
+ const patch = JSON.parse(patchText);
483
490
  await import_fs_extra.default.writeJson(targetFile, deepMerge(base, patch), { spaces: 2 });
484
491
  }
485
492
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-brainerce-store",
3
- "version": "1.54.0",
3
+ "version": "1.57.0",
4
4
  "description": "Scaffold a production-ready e-commerce storefront connected to Brainerce",
5
5
  "bin": {
6
6
  "create-brainerce-store": "dist/index.js"
@@ -6,6 +6,7 @@ import { buildMetaDescription } from '@/core/lib/seo';
6
6
  import { sanitizeHtml } from '@/core/lib/sanitize';
7
7
  import { decodeSlug } from '@/core/lib/utils';
8
8
  import { CategoryJsonLd } from '@/components/seo/category-json-ld';
9
+ import { Breadcrumbs } from '@/components/seo/breadcrumbs';
9
10
  import { ProductGrid } from '@/ui/product/product-grid';
10
11
 
11
12
  type Props = {
@@ -29,8 +30,9 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
29
30
  const description =
30
31
  category.metaDescription || buildMetaDescription(category.description) || category.name;
31
32
  const canonicalSlug = category.slug || slug;
32
- const canonicalPath =
33
- locale ? `/${locale}/category/${canonicalSlug}` : `/category/${canonicalSlug}`;
33
+ const canonicalPath = locale
34
+ ? `/${locale}/category/${canonicalSlug}`
35
+ : `/category/${canonicalSlug}`;
34
36
  return {
35
37
  title: category.name,
36
38
  description,
@@ -69,11 +71,23 @@ export default async function CategoryPage({ params }: Props) {
69
71
 
70
72
  const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || '';
71
73
  const url = `${baseUrl}/category/${category.slug || slug}`;
74
+ const localePrefix = locale ? `/${locale}` : '';
75
+ const breadcrumbItems = [
76
+ { name: 'Home', href: `${localePrefix}/` },
77
+ ...category.breadcrumb
78
+ .filter((ancestor) => ancestor.slug)
79
+ .map((ancestor) => ({
80
+ name: ancestor.name,
81
+ href: `${localePrefix}/category/${ancestor.slug}`,
82
+ })),
83
+ { name: category.name },
84
+ ];
72
85
 
73
86
  return (
74
87
  <>
75
88
  <CategoryJsonLd category={category} url={url} />
76
89
  <div className="container mx-auto px-4 py-8">
90
+ <Breadcrumbs items={breadcrumbItems} />
77
91
  <header className="mb-6">
78
92
  <h1 className="text-3xl font-bold tracking-tight">{category.name}</h1>
79
93
  </header>
@@ -1,157 +1,175 @@
1
- import type { Metadata } from 'next';
2
- import { notFound } from 'next/navigation';
3
- import { getProductPriceInfo } from 'brainerce';
4
- import { getServerClient, fetchStoreInfo } from '@/core/lib/brainerce';
5
- import { resolveCurrency } from '@/core/lib/resolve-currency';
6
- import { buildMetaDescription } from '@/core/lib/seo';
7
- import { decodeSlug } from '@/core/lib/utils';
8
- import { ProductJsonLd } from '@/components/seo/product-json-ld';
9
- import { ReviewsSection } from '@/ui/product/reviews-section';
10
- import { ProductClientSection } from '@/ui/product/product-client-section';
11
-
12
- type Props = {
13
- params: Promise<{ slug: string; locale?: string }>;
14
- };
15
-
16
- function buildHreflang(
17
- baseUrl: string,
18
- baseSlug: string,
19
- localeSlugs: Record<string, string>,
20
- locales: string[],
21
- defaultLoc: string
22
- ): Record<string, string> {
23
- const langs: Record<string, string> = {};
24
- for (const loc of locales) {
25
- const locSlug = localeSlugs[loc] || baseSlug;
26
- const path = loc === defaultLoc ? `/products/${locSlug}` : `/${loc}/products/${locSlug}`;
27
- langs[loc] = `${baseUrl}${path}`;
28
- }
29
- // x-default points to the default-locale canonical (no prefix)
30
- langs['x-default'] = `${baseUrl}/products/${localeSlugs[defaultLoc] || baseSlug}`;
31
- return langs;
32
- }
33
-
34
- export async function generateMetadata({ params }: Props): Promise<Metadata> {
35
- const { slug: rawSlug, locale } = await params;
36
- const slug = decodeSlug(rawSlug);
37
-
38
- try {
39
- const client = getServerClient(locale);
40
- // Fetch product + store info in parallel; storeInfo gives us the live
41
- // currency for OG price tags (with env-var + USD fallbacks so we never
42
- // silently emit a wrong currency when the API is briefly unreachable).
43
- const [product, storeInfo] = await Promise.all([
44
- client.getProductBySlug(slug),
45
- fetchStoreInfo(locale),
46
- ]);
47
- const imageUrl = product.images?.[0]?.url;
48
- // Prefer merchant-authored SEO copy; fall back to a stripped+truncated
49
- // version of the visible description, then product name. We must NEVER
50
- // emit raw HTML or a mid-word cut into <meta name="description">.
51
- const seoTitle = (product as { seoTitle?: string | null }).seoTitle || product.name;
52
- const seoDescription =
53
- (product as { seoDescription?: string | null }).seoDescription ||
54
- buildMetaDescription(product.description) ||
55
- product.name;
56
-
57
- // OG product meta tags drive WhatsApp / Facebook / X link previews and
58
- // Google Merchant Center product enrichment. Emitting the literal "0"
59
- // here (the previous bug) causes price-zero link cards. Use the real
60
- // effective price from the SDK helper.
61
- const priceInfo = getProductPriceInfo(product);
62
- const currency = resolveCurrency(storeInfo);
63
- const priceAmount = priceInfo.price > 0 ? priceInfo.price.toFixed(2) : null;
64
- const inStock = product.inventory?.canPurchase !== false;
65
- const brandName = (product as { brand?: { name?: string } | null }).brand?.name;
66
-
67
- // Multilingual SEO: hreflang tags + correct canonical per locale.
68
- // Locales come from storeInfo.i18n already fetched above, zero extra cost.
69
- const supportedLocales = storeInfo?.i18n?.supportedLocales ?? [];
70
- const defaultLoc = storeInfo?.i18n?.defaultLocale ?? storeInfo?.language ?? '';
71
- const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || '';
72
- const baseSlug = product.slug || slug;
73
- const localeSlugs = product.localeSlugs ?? {};
74
-
75
- // Canonical: use the locale-specific slug for this locale when available.
76
- const canonicalSlug = (locale && localeSlugs[locale]) || baseSlug;
77
- const canonicalPath =
78
- locale && locale !== defaultLoc
79
- ? `/${locale}/products/${canonicalSlug}`
80
- : `/products/${canonicalSlug}`;
81
-
82
- const hreflangLanguages =
83
- supportedLocales.length > 1
84
- ? buildHreflang(baseUrl, baseSlug, localeSlugs, supportedLocales, defaultLoc)
85
- : undefined;
86
-
87
- return {
88
- title: seoTitle,
89
- description: seoDescription,
90
- alternates: {
91
- canonical: canonicalPath,
92
- ...(hreflangLanguages ? { languages: hreflangLanguages } : {}),
93
- },
94
- openGraph: {
95
- title: seoTitle,
96
- description: seoDescription,
97
- images: imageUrl ? [{ url: imageUrl, alt: product.name }] : [],
98
- type: 'website',
99
- },
100
- twitter: {
101
- card: 'summary_large_image',
102
- title: seoTitle,
103
- description: seoDescription,
104
- images: imageUrl ? [imageUrl] : [],
105
- },
106
- // Emit the OG product extension (Facebook / WhatsApp / X link previews,
107
- // Google Merchant Center). Skips the price pair entirely when the SDK
108
- // can't determine a positive amount, rather than shipping "0".
109
- other: {
110
- ...(priceAmount
111
- ? {
112
- 'og:price:amount': priceAmount,
113
- 'og:price:currency': currency,
114
- 'product:price:amount': priceAmount,
115
- 'product:price:currency': currency,
116
- }
117
- : {}),
118
- 'product:availability': inStock ? 'in stock' : 'out of stock',
119
- 'product:condition': 'new',
120
- ...(brandName ? { 'product:brand': brandName } : {}),
121
- },
122
- };
123
- } catch {
124
- return {
125
- title: 'Product not found',
126
- };
127
- }
128
- }
129
-
130
- export default async function ProductDetailPage({ params }: Props) {
131
- const { slug: rawSlug, locale } = await params;
132
- const slug = decodeSlug(rawSlug);
133
-
134
- let product;
135
- try {
136
- const client = getServerClient(locale);
137
- product = await client.getProductBySlug(slug);
138
- } catch {
139
- notFound();
140
- }
141
-
142
- const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || '';
143
- const productUrl = `${baseUrl}/products/${slug}`;
144
- // Reuse the cached storeInfo from generateMetadata's call — React cache()
145
- // collapses both into one backend request per render. resolveCurrency owns
146
- // the env-var + USD fallback chain so this stays a single source of truth.
147
- const storeInfo = await fetchStoreInfo(locale);
148
- const currency = resolveCurrency(storeInfo);
149
-
150
- return (
151
- <>
152
- <ProductJsonLd product={product} url={productUrl} currency={currency} />
153
- <ProductClientSection product={product} />
154
- <ReviewsSection productId={product.id} />
155
- </>
156
- );
157
- }
1
+ import type { Metadata } from 'next';
2
+ import { notFound } from 'next/navigation';
3
+ import { getProductPriceInfo } from 'brainerce';
4
+ import { getServerClient, fetchStoreInfo } from '@/core/lib/brainerce';
5
+ import { resolveCurrency } from '@/core/lib/resolve-currency';
6
+ import { buildMetaDescription } from '@/core/lib/seo';
7
+ import { decodeSlug } from '@/core/lib/utils';
8
+ import { ProductJsonLd } from '@/components/seo/product-json-ld';
9
+ import { Breadcrumbs } from '@/components/seo/breadcrumbs';
10
+ import { ReviewsSection } from '@/ui/product/reviews-section';
11
+ import { ProductClientSection } from '@/ui/product/product-client-section';
12
+
13
+ type Props = {
14
+ params: Promise<{ slug: string; locale?: string }>;
15
+ };
16
+
17
+ function buildHreflang(
18
+ baseUrl: string,
19
+ baseSlug: string,
20
+ localeSlugs: Record<string, string>,
21
+ locales: string[],
22
+ defaultLoc: string
23
+ ): Record<string, string> {
24
+ const langs: Record<string, string> = {};
25
+ for (const loc of locales) {
26
+ const locSlug = localeSlugs[loc] || baseSlug;
27
+ const path = loc === defaultLoc ? `/products/${locSlug}` : `/${loc}/products/${locSlug}`;
28
+ langs[loc] = `${baseUrl}${path}`;
29
+ }
30
+ // x-default points to the default-locale canonical (no prefix)
31
+ langs['x-default'] = `${baseUrl}/products/${localeSlugs[defaultLoc] || baseSlug}`;
32
+ return langs;
33
+ }
34
+
35
+ export async function generateMetadata({ params }: Props): Promise<Metadata> {
36
+ const { slug: rawSlug, locale } = await params;
37
+ const slug = decodeSlug(rawSlug);
38
+
39
+ try {
40
+ const client = getServerClient(locale);
41
+ // Fetch product + store info in parallel; storeInfo gives us the live
42
+ // currency for OG price tags (with env-var + USD fallbacks so we never
43
+ // silently emit a wrong currency when the API is briefly unreachable).
44
+ const [product, storeInfo] = await Promise.all([
45
+ client.getProductBySlug(slug),
46
+ fetchStoreInfo(locale),
47
+ ]);
48
+ const imageUrl = product.images?.[0]?.url;
49
+ // Prefer merchant-authored SEO copy; fall back to a stripped+truncated
50
+ // version of the visible description, then product name. We must NEVER
51
+ // emit raw HTML or a mid-word cut into <meta name="description">.
52
+ const seoTitle = (product as { seoTitle?: string | null }).seoTitle || product.name;
53
+ const seoDescription =
54
+ (product as { seoDescription?: string | null }).seoDescription ||
55
+ buildMetaDescription(product.description) ||
56
+ product.name;
57
+
58
+ // OG product meta tags drive WhatsApp / Facebook / X link previews and
59
+ // Google Merchant Center product enrichment. Emitting the literal "0"
60
+ // here (the previous bug) causes price-zero link cards. Use the real
61
+ // effective price from the SDK helper.
62
+ const priceInfo = getProductPriceInfo(product);
63
+ const currency = resolveCurrency(storeInfo);
64
+ const priceAmount = priceInfo.price > 0 ? priceInfo.price.toFixed(2) : null;
65
+ const inStock = product.inventory?.canPurchase !== false;
66
+ const brandName = (product as { brand?: { name?: string } | null }).brand?.name;
67
+
68
+ // Multilingual SEO: hreflang tags + correct canonical per locale.
69
+ // Locales come from storeInfo.i18n already fetched above, zero extra cost.
70
+ const supportedLocales = storeInfo?.i18n?.supportedLocales ?? [];
71
+ const defaultLoc = storeInfo?.i18n?.defaultLocale ?? storeInfo?.language ?? '';
72
+ const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || '';
73
+ const baseSlug = product.slug || slug;
74
+ const localeSlugs = product.localeSlugs ?? {};
75
+
76
+ // Canonical: use the locale-specific slug for this locale when available.
77
+ const canonicalSlug = (locale && localeSlugs[locale]) || baseSlug;
78
+ const canonicalPath =
79
+ locale && locale !== defaultLoc
80
+ ? `/${locale}/products/${canonicalSlug}`
81
+ : `/products/${canonicalSlug}`;
82
+
83
+ const hreflangLanguages =
84
+ supportedLocales.length > 1
85
+ ? buildHreflang(baseUrl, baseSlug, localeSlugs, supportedLocales, defaultLoc)
86
+ : undefined;
87
+
88
+ return {
89
+ title: seoTitle,
90
+ description: seoDescription,
91
+ alternates: {
92
+ canonical: canonicalPath,
93
+ ...(hreflangLanguages ? { languages: hreflangLanguages } : {}),
94
+ },
95
+ openGraph: {
96
+ title: seoTitle,
97
+ description: seoDescription,
98
+ images: imageUrl ? [{ url: imageUrl, alt: product.name }] : [],
99
+ type: 'website',
100
+ },
101
+ twitter: {
102
+ card: 'summary_large_image',
103
+ title: seoTitle,
104
+ description: seoDescription,
105
+ images: imageUrl ? [imageUrl] : [],
106
+ },
107
+ // Emit the OG product extension (Facebook / WhatsApp / X link previews,
108
+ // Google Merchant Center). Skips the price pair entirely when the SDK
109
+ // can't determine a positive amount, rather than shipping "0".
110
+ other: {
111
+ ...(priceAmount
112
+ ? {
113
+ 'og:price:amount': priceAmount,
114
+ 'og:price:currency': currency,
115
+ 'product:price:amount': priceAmount,
116
+ 'product:price:currency': currency,
117
+ }
118
+ : {}),
119
+ 'product:availability': inStock ? 'in stock' : 'out of stock',
120
+ 'product:condition': 'new',
121
+ ...(brandName ? { 'product:brand': brandName } : {}),
122
+ },
123
+ };
124
+ } catch {
125
+ return {
126
+ title: 'Product not found',
127
+ };
128
+ }
129
+ }
130
+
131
+ export default async function ProductDetailPage({ params }: Props) {
132
+ const { slug: rawSlug, locale } = await params;
133
+ const slug = decodeSlug(rawSlug);
134
+
135
+ let product;
136
+ try {
137
+ const client = getServerClient(locale);
138
+ product = await client.getProductBySlug(slug);
139
+ } catch {
140
+ notFound();
141
+ }
142
+
143
+ const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || '';
144
+ const productUrl = `${baseUrl}/products/${slug}`;
145
+ // Reuse the cached storeInfo from generateMetadata's call React cache()
146
+ // collapses both into one backend request per render. resolveCurrency owns
147
+ // the env-var + USD fallback chain so this stays a single source of truth.
148
+ const storeInfo = await fetchStoreInfo(locale);
149
+ const currency = resolveCurrency(storeInfo);
150
+ const localePrefix = locale ? `/${locale}` : '';
151
+ const primaryCategory = product.categories?.find((c) => c.slug);
152
+ const breadcrumbItems = [
153
+ { name: 'Home', href: `${localePrefix}/` },
154
+ ...(primaryCategory
155
+ ? [{ name: primaryCategory.name, href: `${localePrefix}/category/${primaryCategory.slug}` }]
156
+ : []),
157
+ { name: product.name },
158
+ ];
159
+
160
+ return (
161
+ <>
162
+ <ProductJsonLd
163
+ product={product}
164
+ url={productUrl}
165
+ currency={currency}
166
+ shipping={storeInfo?.shipping}
167
+ />
168
+ <div className="mx-auto max-w-7xl px-4 pt-6 sm:px-6 lg:px-8">
169
+ <Breadcrumbs items={breadcrumbItems} />
170
+ </div>
171
+ <ProductClientSection product={product} />
172
+ <ReviewsSection productId={product.id} />
173
+ </>
174
+ );
175
+ }
@@ -0,0 +1,37 @@
1
+ import Link from 'next/link';
2
+
3
+ interface Crumb {
4
+ name: string;
5
+ /** Site-relative path, e.g. "/category/shoes". Omit on the current (last) crumb. */
6
+ href?: string;
7
+ }
8
+
9
+ /**
10
+ * Visible breadcrumb trail. Renders the exact same path structured data
11
+ * already declares (see category-json-ld.tsx / product-json-ld.tsx) as real
12
+ * `<Link>`s — search engines weight on-page navigation links much more than
13
+ * sitemap-only or script-only (JSON-LD) mentions of a URL.
14
+ */
15
+ export function Breadcrumbs({ items }: { items: Crumb[] }) {
16
+ if (items.length < 2) return null;
17
+ return (
18
+ <nav aria-label="Breadcrumb" className="text-muted-foreground mb-4 text-sm">
19
+ <ol className="flex flex-wrap items-center gap-1.5">
20
+ {items.map((item, idx) => (
21
+ <li key={`${item.name}-${idx}`} className="flex items-center gap-1.5">
22
+ {idx > 0 && <span aria-hidden="true">/</span>}
23
+ {item.href ? (
24
+ <Link href={item.href} className="hover:text-foreground transition-colors">
25
+ {item.name}
26
+ </Link>
27
+ ) : (
28
+ <span aria-current="page" className="text-foreground">
29
+ {item.name}
30
+ </span>
31
+ )}
32
+ </li>
33
+ ))}
34
+ </ol>
35
+ </nav>
36
+ );
37
+ }
@@ -1,4 +1,4 @@
1
- import type { Product } from 'brainerce';
1
+ import type { Product, ShippingSummaryEntry } from 'brainerce';
2
2
  import { getProductPriceInfo } from 'brainerce';
3
3
  import { getNonce } from '@/core/lib/nonce';
4
4
  import { resolveCurrency } from '@/core/lib/resolve-currency';
@@ -8,9 +8,11 @@ interface ProductJsonLdProps {
8
8
  product: Product;
9
9
  url: string;
10
10
  currency?: string;
11
+ /** From `storeInfo.shipping` — real flat-rate/free zones only. Omitted entirely when unset, never fabricated. */
12
+ shipping?: ShippingSummaryEntry[];
11
13
  }
12
14
 
13
- export async function ProductJsonLd({ product, url, currency }: ProductJsonLdProps) {
15
+ export async function ProductJsonLd({ product, url, currency, shipping }: ProductJsonLdProps) {
14
16
  // Defer to the shared server helper so the env-var + USD fallback chain
15
17
  // lives in exactly one place across all server-side currency reads.
16
18
  const resolvedCurrency = resolveCurrency(null, currency);
@@ -24,6 +26,44 @@ export async function ProductJsonLd({ product, url, currency }: ProductJsonLdPro
24
26
  ? 'https://schema.org/InStock'
25
27
  : 'https://schema.org/OutOfStock';
26
28
 
29
+ // All Brainerce catalog listings are first-party new-goods sales — no
30
+ // used/refurbished condition data exists anywhere in the product model, so
31
+ // this is a deliberate always-true assumption, not a per-product field.
32
+ const itemCondition = 'https://schema.org/NewCondition';
33
+
34
+ const shippingDetails = (shipping ?? [])
35
+ .filter((z) => z.amount !== null)
36
+ .map((z) => ({
37
+ '@type': 'OfferShippingDetails',
38
+ shippingRate: { '@type': 'MonetaryAmount', value: z.amount, currency: resolvedCurrency },
39
+ shippingDestination: { '@type': 'DefinedRegion', addressCountry: z.countries },
40
+ ...(z.handlingTime != null || z.minDeliveryDays != null || z.maxDeliveryDays != null
41
+ ? {
42
+ deliveryTime: {
43
+ '@type': 'ShippingDeliveryTime',
44
+ ...(z.handlingTime != null
45
+ ? {
46
+ handlingTime: {
47
+ '@type': 'QuantitativeValue',
48
+ minValue: 0,
49
+ maxValue: z.handlingTime,
50
+ },
51
+ }
52
+ : {}),
53
+ ...(z.minDeliveryDays != null || z.maxDeliveryDays != null
54
+ ? {
55
+ transitTime: {
56
+ '@type': 'QuantitativeValue',
57
+ minValue: z.minDeliveryDays ?? z.maxDeliveryDays,
58
+ maxValue: z.maxDeliveryDays ?? z.minDeliveryDays,
59
+ },
60
+ }
61
+ : {}),
62
+ },
63
+ }
64
+ : {}),
65
+ }));
66
+
27
67
  const isVariable = product.type === 'VARIABLE';
28
68
  const offers =
29
69
  isVariable && product.priceMin
@@ -34,6 +74,8 @@ export async function ProductJsonLd({ product, url, currency }: ProductJsonLdPro
34
74
  offerCount: product.variants?.length ?? 1,
35
75
  priceCurrency: resolvedCurrency,
36
76
  availability,
77
+ itemCondition,
78
+ ...(shippingDetails.length > 0 ? { shippingDetails } : {}),
37
79
  url,
38
80
  }
39
81
  : {
@@ -41,6 +83,11 @@ export async function ProductJsonLd({ product, url, currency }: ProductJsonLdPro
41
83
  price: priceInfo.price,
42
84
  priceCurrency: resolvedCurrency,
43
85
  availability,
86
+ itemCondition,
87
+ ...(product.salePrice && product.salePriceEndsAt
88
+ ? { priceValidUntil: product.salePriceEndsAt }
89
+ : {}),
90
+ ...(shippingDetails.length > 0 ? { shippingDetails } : {}),
44
91
  url,
45
92
  };
46
93
 
@@ -23,6 +23,8 @@ export interface PublicStoreInfo {
23
23
  requireEmailVerification?: boolean;
24
24
  upsell?: StoreInfo['upsell'];
25
25
  i18n?: StoreInfo['i18n'];
26
+ /** Real flat-rate/free shipping zones — feeds Product JSON-LD `shippingDetails`. Public by design (merchants display shipping rates openly). */
27
+ shipping?: StoreInfo['shipping'];
26
28
  }
27
29
 
28
30
  /**
@@ -44,5 +46,6 @@ export function pickPublicStoreInfo(raw: StoreInfo): PublicStoreInfo {
44
46
  requireEmailVerification: raw.requireEmailVerification,
45
47
  upsell: raw.upsell,
46
48
  i18n: raw.i18n,
49
+ shipping: raw.shipping,
47
50
  };
48
51
  }
@@ -3,7 +3,7 @@
3
3
  @tailwind utilities;
4
4
 
5
5
  /* ---------------------------------------------------------------------------
6
- Design system — "Atelier" (premium modern jewelry commerce)
6
+ Design system — "Atelier" (premium modern handcrafted-goods commerce)
7
7
  Palette (5 total): warm white / warm ink / deep forest / warm sand (2 tints)
8
8
  + functional destructive. Tokens only — never raw colors in components.
9
9
  --------------------------------------------------------------------------- */
@@ -350,9 +350,10 @@
350
350
  .cart-bump { animation: cart-bump 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
351
351
  }
352
352
 
353
- /* Full-page loader — a gem orbiting a ring band (Atelier's "polishing" mark).
354
- Static ring + gem under reduced motion; the orbit/breathe are additive. */
355
- .loader-orbit {
353
+ /* Full-page loader — a soft pulsing core inside a thin rotating ring
354
+ (Atelier's breathing mark). No iconography, so it fits any store niche.
355
+ Static ring + core under reduced motion; the spin/breathe are additive. */
356
+ .loader-ring {
356
357
  position: relative;
357
358
  display: flex;
358
359
  height: 3.5rem;
@@ -360,35 +361,40 @@
360
361
  align-items: center;
361
362
  justify-content: center;
362
363
  border-radius: 9999px;
363
- border: 1px solid hsl(var(--primary) / 0.25);
364
- box-shadow: inset 0 0 18px hsl(var(--primary) / 0.06);
364
+ border: 1px solid hsl(var(--primary) / 0.15);
365
365
  }
366
- .loader-orbit-dot {
367
- position: absolute;
368
- inset: 0;
369
- }
370
- .loader-orbit-dot::before {
366
+ .loader-ring::before {
371
367
  content: '';
372
368
  position: absolute;
373
- top: -3px;
374
- inset-inline-start: 50%;
375
- margin-inline-start: -3.5px;
376
- height: 7px;
377
- width: 7px;
369
+ inset: -1px;
370
+ border-radius: 9999px;
371
+ border: 1.5px solid transparent;
372
+ border-top-color: hsl(var(--primary) / 0.9);
373
+ }
374
+ .loader-ring-core {
375
+ height: 0.6rem;
376
+ width: 0.6rem;
378
377
  border-radius: 9999px;
379
378
  background: hsl(var(--primary));
380
- box-shadow: 0 0 12px hsl(var(--primary) / 0.55);
379
+ box-shadow: 0 0 12px hsl(var(--primary) / 0.4);
381
380
  }
382
381
  @media (prefers-reduced-motion: no-preference) {
383
- .loader-orbit-dot {
384
- animation: orbit 1.5s cubic-bezier(0.55, 0.12, 0.45, 0.88) infinite;
382
+ .loader-ring::before {
383
+ animation: ring-spin 1.4s linear infinite;
384
+ }
385
+ .loader-ring-core {
386
+ animation: ring-breathe 2s ease-in-out infinite;
385
387
  }
386
388
  .loader-text {
387
389
  animation: loader-breathe 2.2s ease-in-out infinite;
388
390
  }
389
- @keyframes orbit {
391
+ @keyframes ring-spin {
390
392
  to { transform: rotate(360deg); }
391
393
  }
394
+ @keyframes ring-breathe {
395
+ 0%, 100% { opacity: 0.45; transform: scale(0.85); }
396
+ 50% { opacity: 1; transform: scale(1); }
397
+ }
392
398
  @keyframes loader-breathe {
393
399
  0%, 100% { opacity: 0.55; }
394
400
  50% { opacity: 1; }