fragment-headless-sdk 2.4.0 → 2.4.3

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.
@@ -23,7 +23,7 @@ export default function DesktopHero({ buttonHref, content, colors, contentWidthC
23
23
  /* Image Background */
24
24
  content?.imageUrl && (React.createElement("img", { src: content.imageUrl, alt: content.title || "Hero", className: "absolute inset-0 z-0 object-cover w-full h-full" }))),
25
25
  React.createElement("div", { className: `relative z-10 mx-auto flex h-full max-w-screen-xl flex-col justify-center px-10 ${getPositionClasses()} xl:px-4` },
26
- React.createElement("div", { className: joinClassNames("max-w-full flex flex-col", contentSpacing ?? "gap-4", contentWidthClass || DEFAULT_CONTENT_WIDTH_CLASS) },
26
+ React.createElement("div", { className: joinClassNames("max-w-full flex flex-col items-start", contentSpacing ?? "gap-4", contentWidthClass || DEFAULT_CONTENT_WIDTH_CLASS) },
27
27
  renderText({
28
28
  fontSize: typography.title.fontSize,
29
29
  lineHeight: typography.title.lineHeight,
@@ -22,6 +22,7 @@ export interface IAnnouncement {
22
22
  name: string;
23
23
  status: AnnouncementStatus;
24
24
  content: IAnnouncementContent | null;
25
+ page_order: number | null;
25
26
  active_duration_seconds: number | null;
26
27
  active_start_date: string | null;
27
28
  active_end_date: string | null;
@@ -26,6 +26,7 @@ export interface IHero {
26
26
  name: string;
27
27
  type: HeroType;
28
28
  page: ShopPage["handle"] | null;
29
+ page_order: number | null;
29
30
  status: HeroStatus;
30
31
  content: IHeroContent | null;
31
32
  active_duration_seconds: number | null;
@@ -127,7 +127,7 @@ export function renderText({ fontSize, lineHeight, text, className, color, font,
127
127
  if (!text || text.trim().length === 0) {
128
128
  return null;
129
129
  }
130
- const baseClasses = "drop-shadow-lg";
130
+ const baseClasses = "drop-shadow-lg max-w-full break-words";
131
131
  const combinedClasses = className
132
132
  ? `${baseClasses} ${fontSize} ${lineHeight} ${className}`
133
133
  : `${baseClasses} ${fontSize} ${lineHeight}`;
@@ -18,6 +18,10 @@ const KNOWN_ANNOUNCEMENT_SLOTS = [
18
18
  "countdownItem",
19
19
  "countdownLabel",
20
20
  "countdownValue",
21
+ "countdownContainer",
22
+ "countdownBlock",
23
+ "countdownDigit",
24
+ "countdownSeparator",
21
25
  ];
22
26
  const KNOWN_HERO_SLOTS = [
23
27
  "root",
@@ -43,7 +47,11 @@ const KNOWN_HERO_SLOTS = [
43
47
  "mobileDescription",
44
48
  "button",
45
49
  "desktopButton",
46
- "mobileButton",
50
+ "mobileButton", "countdownContainer",
51
+ "countdownBlock",
52
+ "countdownDigit",
53
+ "countdownLabel",
54
+ "countdownSeparator",
47
55
  ];
48
56
  const ALL_KNOWN_SLOTS = [...KNOWN_ANNOUNCEMENT_SLOTS, ...KNOWN_HERO_SLOTS];
49
57
  function getCacheKey(base, slots, extra) {
package/docs/CHANGELOG.md CHANGED
@@ -7,12 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ### [Unreleased]
9
9
 
10
+ ### [2.4.3] - 2026-04-14
11
+
12
+ #### Fixed
13
+
14
+ - **Hero text overflow**: `renderText` base classes now include `max-w-full break-words` so title and description respect their content column width and wrap correctly when content contains non-breaking spaces.
15
+ - **Desktop hero content alignment**: `DesktopHero` content column now uses `items-start` so child elements (button, countdown) no longer stretch to full column width.
16
+
17
+ ### [2.4.2] - 2026-04-14
18
+
19
+ #### Fixed
20
+
21
+ - **Hero banner text overflow**: Title and description in `DesktopHero` are now clamped to 3 lines with ellipsis (`line-clamp-3`) to prevent layout overflow at narrower viewport widths.
22
+
23
+ ### [2.4.1] - 2026-04-10
24
+
25
+ #### Added
26
+
27
+ - **`IHero.page_order`** – New `page_order: number | null` field on `IHero`. Consumers can use this to sort hero banners by their merchant-defined display order.
28
+
10
29
  ### [2.4.0] - 2026-03-08
11
30
 
12
31
  #### Added
13
32
 
14
33
  - **Hero countdown option** – Hero content supports optional countdown via `content.showCountdown` and `content.counterEndDate`. New `HeroCountdownTimer` component is used by Desktop/Mobile Hero when countdown is enabled.
15
34
  - **Button spacing** – Hero resolvers support `buttonSpacing` for configurable CTA spacing (`hero.ts`, `hero-resolvers.ts`).
35
+ - **Content spacing** – Hero resolvers support `contentSpacing` for configurable gap between title, description, countdown, and button (`hero-resolvers.ts`); UI options in the app mirror this.
36
+ - **Countdown color tokens** – Hero countdown supports `counterDigitColor`, `counterDigitBackgroundColor`, and `counterTextColor` via `content.styling.tokens.colors`; resolved by `resolveHeroCountdownColors()` in `hero-resolvers.ts`.
16
37
 
17
38
  #### Changed
18
39
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fragment-headless-sdk",
3
- "version": "2.4.0",
3
+ "version": "2.4.3",
4
4
  "description": "Official SDK for Fragment-Shopify CMS: React components, TypeScript types, and utilities for headless Shopify storefronts.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
package/readme.md CHANGED
@@ -4,7 +4,7 @@ The official SDK for integrating with Fragment-Shopify CMS. Provides React compo
4
4
 
5
5
  ## ✨ What's New
6
6
 
7
- **v2.3.3** – `fetchResource` uses environment-aware default caching: Next.js production defaults to 60s revalidation and resource-type cache tags; development and non–Next.js use `cache: "default"`. Request deduplication normalizes `status` for consistent cache keys.
7
+ **v2.4.1** – `IHero` now includes a `page_order: number | null` field. Use this to sort hero banners by their merchant-defined display order; when all values are `null` the recommended behaviour is to randomize.
8
8
 
9
9
  > See [CHANGELOG.md](./docs/CHANGELOG.md) for full release history
10
10