@sarimarcus/content-sites-ui 0.72.0 → 0.74.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/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  All packages in the platform release in lockstep; entries are per release version.
4
4
 
5
+ ## 0.74.0 (2026-11-15)
6
+
7
+ Additive (SLA-4242). No codemod.
8
+
9
+ - `./affiliate` exports `pinnedGygTours(activities, ids, locale?)` and `gygTourMeta(activity, locale?)`, with the `PinnedTour` and `PinnedTourActivity` types: hand-picked GYG tours in `ids` order, missing ids dropped, each with its "from €X · duration · rating (reviews)" line. They replace the sites' `src/utils/pinnedTours.ts` (a different signature, so adoption edits the call sites by hand and deletes the copy); the copy is refused as an extracted path from 0.75.0. Callers keep the ids as a quoted `'gyg-N'` literal array in the page, where `validate-affiliate-ids.mjs` reads them.
10
+
11
+ ## 0.73.0 (2026-11-15)
12
+
13
+ - No changes (lockstep release).
14
+
5
15
  ## 0.72.0 (2026-11-14)
6
16
 
7
17
  - No changes (lockstep release).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sarimarcus/content-sites-ui",
3
- "version": "0.72.0",
3
+ "version": "0.74.0",
4
4
  "description": "Universal Astro UI components, layout shell and design tokens shared by the content sites.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -51,6 +51,6 @@
51
51
  "@lucide/astro": "^1.23.0",
52
52
  "astro": "^7.0.6",
53
53
  "tailwindcss": "^4.1.18",
54
- "@sarimarcus/content-sites-core": "0.72.0"
54
+ "@sarimarcus/content-sites-core": "0.74.0"
55
55
  }
56
56
  }
@@ -17,6 +17,7 @@ export { gygCardItem, gygCardLocale, type GygCardActivity, type GygActivity } fr
17
17
  export type { WidgetKind, CspDirective, WidgetResources } from './resources';
18
18
  export type { AffiliateCardLabels, AffiliateCardOptions, AffiliateCardItem, HotelCtaLabels, ComparisonRow, ComparisonTableLabels } from './types';
19
19
  export { selectActivities, type SelectableActivity, type SelectOptions } from './select';
20
+ export { pinnedGygTours, gygTourMeta, type PinnedTour, type PinnedTourActivity } from './pinnedTours';
20
21
  export { default as EmeraldLoader } from './EmeraldLoader.astro';
21
22
  export { setupTravelpayoutsStyler } from './travelpayoutsStyler.ts';
22
23
  export type { TravelpayoutsStylerOptions, TravelpayoutsStylerColors } from './travelpayoutsStyler.ts';
@@ -0,0 +1,27 @@
1
+ import { selectActivities } from './select.ts';
2
+ import type { GygActivity } from './cardItem';
3
+
4
+ export type PinnedTourActivity = Pick<GygActivity, 'id' | 'title' | 'affiliateUrl' | 'price' | 'duration' | 'rating' | 'reviewCount'>;
5
+
6
+ export interface PinnedTour { id: string; label: string; url: string; meta: string }
7
+
8
+ export function gygTourMeta(a: Omit<PinnedTourActivity, 'id' | 'title' | 'affiliateUrl'>, locale = 'en-GB'): string {
9
+ return [
10
+ `from €${a.price}`,
11
+ a.duration,
12
+ a.reviewCount > 0 ? `${a.rating.toFixed(1)}/5 (${a.reviewCount.toLocaleString(locale)} reviews)` : null,
13
+ ].filter(Boolean).join(' · ');
14
+ }
15
+
16
+ /**
17
+ * Hand-picked GYG tours, in `ids` order, missing ids dropped. Callers keep `ids` as a quoted literal array ('gyg-N')
18
+ * in their .astro file: validate-affiliate-ids.mjs only sees ids written there.
19
+ */
20
+ export function pinnedGygTours(activities: ReadonlyArray<PinnedTourActivity>, ids: readonly string[], locale = 'en-GB'): PinnedTour[] {
21
+ return selectActivities(activities, { pinnedIds: ids, exclusive: true, maxCards: ids.length }).map((a) => ({
22
+ id: a.id,
23
+ label: a.title,
24
+ url: a.affiliateUrl,
25
+ meta: gygTourMeta(a, locale),
26
+ }));
27
+ }