@tokenoftrust/storefront-runner 2.2.126 → 2.3.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 (107) hide show
  1. package/apps/storefront/package.json +3 -1
  2. package/apps/storefront/public/shared/commerce-chrome.css +57 -15
  3. package/apps/storefront/public/shared/commerce-marketing.css +7 -7
  4. package/apps/storefront/src/components/Badge.astro +1 -1
  5. package/apps/storefront/src/components/Breadcrumbs.astro +8 -3
  6. package/apps/storefront/src/components/Section.astro +4 -1
  7. package/apps/storefront/src/components/Seo.astro +7 -5
  8. package/apps/storefront/src/components/blog/BlogIndexView.astro +22 -13
  9. package/apps/storefront/src/components/blog/ShareRow.astro +43 -0
  10. package/apps/storefront/src/components/chrome/AnnouncementBar.astro +1 -1
  11. package/apps/storefront/src/components/chrome/NavDropdown.astro +7 -7
  12. package/apps/storefront/src/components/chrome/SiteFooter.astro +17 -0
  13. package/apps/storefront/src/components/chrome/SiteHeader.astro +5 -5
  14. package/apps/storefront/src/components/commerce/TagFilterCloud.astro +1 -1
  15. package/apps/storefront/src/components/compliance/NicotineWarning.astro +12 -22
  16. package/apps/storefront/src/components/compliance/PactActNotice.astro +9 -10
  17. package/apps/storefront/src/components/content/ProseSections.astro +2 -2
  18. package/apps/storefront/src/components/home/Hero.astro +34 -12
  19. package/apps/storefront/src/components/islands/IsolatedAgeGate.tsx +39 -5
  20. package/apps/storefront/src/components/islands/VariantSelector.tsx +3 -3
  21. package/apps/storefront/src/components/marketing/CardGrid.astro +1 -1
  22. package/apps/storefront/src/components/marketing/CodeSample.astro +1 -1
  23. package/apps/storefront/src/components/marketing/CtaBand.astro +1 -1
  24. package/apps/storefront/src/components/marketing/Faq.astro +1 -1
  25. package/apps/storefront/src/components/marketing/Integrations.astro +1 -1
  26. package/apps/storefront/src/components/marketing/MarketingCtas.astro +1 -1
  27. package/apps/storefront/src/components/marketing/MarketingHero.astro +1 -1
  28. package/apps/storefront/src/components/marketing/ProofStrip.astro +1 -1
  29. package/apps/storefront/src/components/marketing/SplitCompare.astro +1 -1
  30. package/apps/storefront/src/components/marketing/Steps.astro +1 -1
  31. package/apps/storefront/src/components/marketing/Testimonials.astro +2 -2
  32. package/apps/storefront/src/components/marketing/TrustBar.astro +1 -1
  33. package/apps/storefront/src/components/membership/TierComparisonTable.astro +1 -1
  34. package/apps/storefront/src/components/plp/ActiveFilters.astro +1 -1
  35. package/apps/storefront/src/components/plp/FacetSidebar.astro +4 -4
  36. package/apps/storefront/src/components/plp/Pagination.astro +1 -1
  37. package/apps/storefront/src/components/plp/SortSelect.astro +1 -1
  38. package/apps/storefront/src/components/style-guide/StyleGuideNav.astro +18 -3
  39. package/apps/storefront/src/components/the-build/TheBuildIndexView.astro +9 -5
  40. package/apps/storefront/src/config/devTenantSeed.ts +20 -34
  41. package/apps/storefront/src/config/resolver.ts +0 -38
  42. package/apps/storefront/src/layouts/Layout.astro +8 -1
  43. package/apps/storefront/src/lib/assets/preview-version-cookie.ts +52 -5
  44. package/apps/storefront/src/lib/blog/pagination.ts +20 -10
  45. package/apps/storefront/src/lib/blog/presentation.ts +94 -0
  46. package/apps/storefront/src/lib/blog/rss.ts +1 -1
  47. package/apps/storefront/src/lib/blog/types.ts +24 -7
  48. package/apps/storefront/src/lib/breadcrumbs.ts +25 -0
  49. package/apps/storefront/src/lib/chrome/model.ts +4 -0
  50. package/apps/storefront/src/lib/cloudflare-workers.d.ts +53 -0
  51. package/apps/storefront/src/lib/compliance/rawComplianceNotices.ts +38 -18
  52. package/apps/storefront/src/lib/dashboard/delegateGate.ts +28 -0
  53. package/apps/storefront/src/lib/homeVisualParity.ts +8 -5
  54. package/apps/storefront/src/lib/jsonld.ts +5 -5
  55. package/apps/storefront/src/lib/pinnedRouteRewriteBoundary.ts +20 -2
  56. package/apps/storefront/src/lib/rawChrome.ts +74 -12
  57. package/apps/storefront/src/lib/runtimeEnv.ts +1 -1
  58. package/apps/storefront/src/lib/seo/documentTitle.ts +19 -0
  59. package/apps/storefront/src/lib/shared/addToRelease.ts +32 -0
  60. package/apps/storefront/src/lib/storyblok/content-model.ts +3 -0
  61. package/apps/storefront/src/lib/styleGuideThemes.ts +20 -22
  62. package/apps/storefront/src/pages/[...slug].astro +13 -8
  63. package/apps/storefront/src/pages/blog/[slug].astro +56 -24
  64. package/apps/storefront/src/pages/blog/author/[author].astro +17 -9
  65. package/apps/storefront/src/pages/blog/category/[category].astro +18 -10
  66. package/apps/storefront/src/pages/blog/index.astro +2 -0
  67. package/apps/storefront/src/pages/blog/page/[n].astro +2 -0
  68. package/apps/storefront/src/pages/blog/tag/[tag].astro +18 -10
  69. package/apps/storefront/src/pages/collections/[handle].astro +5 -4
  70. package/apps/storefront/src/pages/collections/index.astro +4 -3
  71. package/apps/storefront/src/pages/index.astro +34 -27
  72. package/apps/storefront/src/pages/products/[handle].astro +5 -4
  73. package/apps/storefront/src/pages/saved.astro +4 -3
  74. package/apps/storefront/src/pages/search.astro +4 -3
  75. package/apps/storefront/src/pages/style-guide/[tenant]/[theme].astro +129 -118
  76. package/apps/storefront/src/pages/style-guide/[tenant]/chrome/[theme].astro +19 -15
  77. package/apps/storefront/src/pages/style-guide/[tenant]/guide/[theme].astro +23 -27
  78. package/apps/storefront/src/pages/style-guide/[tenant]/index.astro +7 -14
  79. package/apps/storefront/src/pages/style-guide/index.astro +6 -5
  80. package/apps/storefront/src/pages/tenants/[id]/[...path].ts +32 -7
  81. package/apps/storefront/src/pages/the-build/[slug].astro +44 -20
  82. package/apps/storefront/src/pages/the-build/index.astro +2 -0
  83. package/apps/storefront/src/pages/the-build/page/[n].astro +2 -0
  84. package/apps/storefront/src/styles/admin.css +47 -0
  85. package/apps/storefront/src/styles/global.css +104 -56
  86. package/apps/storefront/src/themes/derivedTokens.ts +34 -0
  87. package/apps/storefront/src/themes/schema.ts +6 -0
  88. package/apps/storefront/test/pipeline/harness.ts +164 -0
  89. package/apps/storefront/test/pipeline/intake-worker.mjs +14 -0
  90. package/apps/storefront/test/pipeline/pipeline-host.ts +77 -0
  91. package/apps/storefront/test/pipeline/synthetic-job.ts +156 -0
  92. package/apps/storefront/vitest.workers.config.cts +67 -0
  93. package/docs/widget-library-guide.md +1496 -0
  94. package/package.json +1 -1
  95. package/packages/cli/src/declared-config.mjs +400 -5
  96. package/packages/public-runtime/package.json +1 -0
  97. package/packages/public-runtime/src/chrome.ts +93 -2
  98. package/packages/public-runtime/src/compliance-coherence.d.mts +17 -0
  99. package/packages/public-runtime/src/compliance-coherence.mjs +84 -0
  100. package/packages/public-runtime/src/declared-tenant-config.d.mts +1 -1
  101. package/packages/public-runtime/src/declared-tenant-config.mjs +6 -2
  102. package/packages/public-runtime/src/extension-contract-values.d.mts +4 -1
  103. package/packages/public-runtime/src/extension-contract-values.mjs +14 -1
  104. package/packages/public-runtime/src/extension-contract.ts +2 -0
  105. package/packages/public-runtime/src/tenant.ts +48 -4
  106. package/pnpm-lock.runner.yaml +469 -0
  107. package/scripts/tenant/validate.mjs +27 -1
@@ -34,9 +34,11 @@ import {
34
34
  BLOCK_PALETTE_SUPPORTED_CONTRACTS,
35
35
  FEATURED_PRODUCT_PRESENTATIONS,
36
36
  PROMO_TILE_PRESENTATIONS,
37
+ THEME_HEADING_LEVELS,
37
38
  isSafeRehostedAssetPath,
38
39
  isSafeRehostedAssetPathForTenant,
39
40
  isSafeStorefrontHref,
41
+ isThemeCssSize,
40
42
  } from "../../packages/public-runtime/src/extension-contract-values.mjs";
41
43
  import {
42
44
  foreignTenantSegments,
@@ -333,6 +335,25 @@ function validateScriptsDoc(doc, file, config) {
333
335
  return out;
334
336
  }
335
337
 
338
+ /** theme.json `type.headings`: fixed heading sizes the renderer emits as --heading-<level>. */
339
+ function validateThemeHeadings(theme, file) {
340
+ const out = [];
341
+ const headings = theme?.type?.headings;
342
+ if (headings === undefined) return out;
343
+ if (headings == null || typeof headings !== "object" || Array.isArray(headings)) {
344
+ return [mk(ERROR, "theme-token", file, "type.headings must be an object of hero/h1/h2/h3 sizes")];
345
+ }
346
+ for (const [level, size] of Object.entries(headings)) {
347
+ if (!(/** @type {readonly string[]} */ (THEME_HEADING_LEVELS)).includes(level)) {
348
+ out.push(mk(ERROR, "theme-token", file, `type.headings.${level} is not a heading level (use ${THEME_HEADING_LEVELS.join(", ")})`));
349
+ } else if (!isThemeCssSize(size)) {
350
+ out.push(mk(ERROR, "theme-token", file, `type.headings.${level} must be a CSS length such as "28px", "1.75rem" or "clamp(1.5rem, 4vw, 2rem)"`));
351
+ }
352
+ }
353
+ return out;
354
+ }
355
+
356
+
336
357
  const SUPPORTED_BLOCK_CONTRACTS = new Set(BLOCK_PALETTE_SUPPORTED_CONTRACTS);
337
358
  const KNOWN_BLOCKS = new Set([
338
359
  "hero",
@@ -585,6 +606,9 @@ function validateHomeDoc(doc, file, tenantId) {
585
606
  validateVisualAsset(block.image, file, `${at}.image`, out, tenantId);
586
607
  }
587
608
  if (component === "hero" && block.slides !== undefined) validateHeroSlides(block.slides, file, at, out, tenantId);
609
+ if (component === "hero" && block.notice !== undefined && (typeof block.notice !== "string" || !block.notice.trim())) {
610
+ out.push(mk(ERROR, "block-prop", file, `${at}.notice must be a non-empty plain-text string`));
611
+ }
588
612
  if (component === "editorial" && block.image !== undefined) {
589
613
  validateVisualAsset(block.image, file, `${at}.image`, out, tenantId);
590
614
  if (typeof block.imageAlt !== "string") {
@@ -1088,12 +1112,14 @@ export function validateTenant(tenantDir, opts = {}) {
1088
1112
  // 2. theme.json — parse (a malformed one is a WHOLE-APP BUILD FAILURE)
1089
1113
  const themePath = located("theme.json");
1090
1114
  if (existsSync(themePath)) {
1091
- const { error } = readJsonSafe(themePath);
1115
+ const { value: theme, error } = readJsonSafe(themePath);
1092
1116
  if (error) {
1093
1117
  findings.push(
1094
1118
  mk(ERROR, "theme-parse", rel(themePath),
1095
1119
  `invalid JSON: ${error}`, "theme.json is loaded by an eager Vite glob — a parse error fails the entire storefront build"),
1096
1120
  );
1121
+ } else {
1122
+ findings.push(...validateThemeHeadings(theme, rel(themePath)));
1097
1123
  }
1098
1124
  }
1099
1125