@techninja/clearstack 0.3.39 → 0.3.40

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.
@@ -71,6 +71,8 @@ export function buildContext(config, itemData, site) {
71
71
  const title = interpolate(config.title, itemData);
72
72
  const desc = config.description ? interpolate(config.description, itemData) : '';
73
73
  const image = config.image ? interpolate(config.image, itemData) : '';
74
+ const baseUrl = itemData.store?.url || '';
75
+ const resolvedImage = image && !image.startsWith('http') ? `${baseUrl}${image}` : image;
74
76
  const item = itemData.item || {};
75
77
  const emoji = item.emoji || itemData.emoji || '';
76
78
 
@@ -84,11 +86,12 @@ export function buildContext(config, itemData, site) {
84
86
  accent: t['color-accent'] || '#34d399',
85
87
  text: t['color-text'] || '#e2e8f0',
86
88
  textMuted: t['color-text-muted'] || '#a8b8cc',
87
- emoji, image,
89
+ emoji, image: resolvedImage,
88
90
  variantsFormatted: formatNum(item.expected_variants),
89
91
  uniqueFormatted: formatNum(item.estimated_unique_variants),
90
- imageHtml: image ? `<img class="hero" src="${image}">` : '',
91
- cardClass: image ? 'card-with-image' : '',
92
+ priceFormatted: item.price ? `$${(item.price / 100).toFixed(2)}` : '',
93
+ imageHtml: resolvedImage ? `<img class="hero" src="${resolvedImage}">` : '',
94
+ cardClass: resolvedImage ? 'card-with-image' : '',
92
95
  logoHtml: site.logo ? `<img class="logo" src="${site.logo}">` : '',
93
96
  badgeHtml: site.siteName ? `<div class="badge">${site.siteName}</div>` : '',
94
97
  emojiHtml: emoji ? `<div class="emoji">${emoji}</div>` : '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@techninja/clearstack",
3
- "version": "0.3.39",
3
+ "version": "0.3.40",
4
4
  "type": "module",
5
5
  "description": "A no-build web component framework specification — scaffold, validate, and evolve spec-compliant projects",
6
6
  "bin": {