fragment-headless-sdk 2.5.0 → 2.6.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.
@@ -16,8 +16,8 @@ export default function MobileHero({ buttonHref, content, colors, typography, bu
16
16
  color: colors.title,
17
17
  font: typography.title.font,
18
18
  }),
19
- content?.videoUrl ? (React.createElement("div", { className: "w-full" },
20
- React.createElement("video", { src: content.videoUrl, autoPlay: true, muted: true, loop: true, playsInline: true, className: "h-full w-full object-cover" }))) : content?.mobileImageUrl ? (React.createElement("div", { className: "w-full" },
19
+ content?.mobileVideoUrl || content?.videoUrl ? (React.createElement("div", { className: "w-full" },
20
+ React.createElement("video", { src: content.mobileVideoUrl || content.videoUrl, autoPlay: true, muted: true, loop: true, playsInline: true, className: "h-full w-full object-cover" }))) : content?.mobileImageUrl ? (React.createElement("div", { className: "w-full" },
21
21
  React.createElement("img", { src: content.mobileImageUrl, alt: content.title || "Hero", className: "h-full w-full object-cover" }))) : content?.imageUrl ? (React.createElement("div", { className: "w-full" },
22
22
  React.createElement("img", { src: content.imageUrl, alt: content.title || "Hero", className: "h-full w-full object-cover" }))) : null,
23
23
  renderText({
@@ -13,6 +13,7 @@ export interface IHeroContent {
13
13
  imageUrl: string;
14
14
  mobileImageUrl: string;
15
15
  videoUrl?: string;
16
+ mobileVideoUrl?: string;
16
17
  counterEndDate?: string;
17
18
  showCountdown?: boolean;
18
19
  measurementId?: string;
package/docs/CHANGELOG.md CHANGED
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  #### Added
11
11
 
12
+ - **`mobileVideoUrl` on `IHeroContent`** – Optional hero content field for a mobile-specific video. `MobileHero` now plays `mobileVideoUrl` when set and falls back to `videoUrl` otherwise, mirroring the existing `mobileImageUrl` → `imageUrl` fallback (`types/hero.ts`, `components/Hero/MobileHero.tsx`).
12
13
  - **`normalizeRichTextHtml` utility** – New shared helper in `utils/html.ts` that normalizes rich-text editor output (replaces ` ` with regular spaces so words wrap at natural boundaries). Exported from the SDK entrypoint and used by both `Announcement` and `renderText` in `hero-resolvers`, replacing previously duplicated inline implementations.
13
14
  - **`parseTailwindHeight` is now public** – Previously an internal helper, now exported so preview/template consumers (e.g. `HeroBannerTemplate`) can share the same Tailwind-height → CSS conversion. Also accepts raw CSS values (`500px`, `50vh`) as pass-through (`hero-resolvers.ts`).
14
15
  - **`AnnouncementTypographySettings.fontFamily`** – `resolveAnnouncementTypography` now returns a resolved `fontFamily` CSS value alongside `font`/`fontSize`/`lineHeight`, so callers no longer need to import `FONT_FAMILY_MAP` to translate the font key themselves.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fragment-headless-sdk",
3
- "version": "2.5.0",
3
+ "version": "2.6.0",
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",