keystone-design-bootstrap 1.0.41 → 1.0.43

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.
@@ -0,0 +1,46 @@
1
+ import { W as WebsitePhotos } from '../website-photos-_n2g24IM.js';
2
+
3
+ /**
4
+ * Helper functions for extracting photo URLs from photo associations
5
+ */
6
+
7
+ interface PhotoAttachment {
8
+ id: number;
9
+ photo: {
10
+ id: number;
11
+ title: string;
12
+ thumbnail_url?: string;
13
+ medium_url?: string;
14
+ large_url?: string;
15
+ original_url?: string;
16
+ };
17
+ featured: boolean;
18
+ sort_order: number;
19
+ }
20
+ /**
21
+ * Get the best available photo URL from a photos array
22
+ * Priority: featured photo > first photo > fallback
23
+ */
24
+ declare function getPhotoUrl(photos?: PhotoAttachment[]): string | null;
25
+ /**
26
+ * Get avatar URL for team members or authors.
27
+ * Returns a URL only when there is a real photo in attachments; otherwise null.
28
+ * Callers should use PhotoWithFallback (gradient fallback) or Avatar with initials when null.
29
+ */
30
+ /** Optional fallbackId/name reserved for future use (e.g. deterministic fallback). */
31
+ declare function getAvatarUrl(photos?: PhotoAttachment[], _fallbackId?: number | string, _name?: string): string | null;
32
+ /**
33
+ * Get featured image URL for blog posts
34
+ */
35
+ declare function getFeaturedImageUrl(photos?: PhotoAttachment[]): string | null;
36
+ /**
37
+ * Get logo URL from website_photos API (which aggregates from account_photos)
38
+ *
39
+ * The website_photos API endpoint returns logos from account_photos with photo_type: 'logo',
40
+ * with industry fallback. This is the primary and only source for logos.
41
+ *
42
+ * Returns undefined if no logo is available (for PhotoWithFallback gradient fallback)
43
+ */
44
+ declare function getLogoUrl(websitePhotos?: WebsitePhotos | null): string | undefined;
45
+
46
+ export { type PhotoAttachment, getAvatarUrl, getFeaturedImageUrl, getLogoUrl, getPhotoUrl };
@@ -0,0 +1,20 @@
1
+ interface WebsitePhoto {
2
+ id: number;
3
+ url: string;
4
+ thumbnail_url?: string;
5
+ medium_url?: string;
6
+ alt: string;
7
+ source: 'account' | 'industry';
8
+ }
9
+ interface WebsitePhotos {
10
+ logo?: WebsitePhoto | null;
11
+ favicon?: WebsitePhoto | null;
12
+ hero?: WebsitePhoto | null;
13
+ contact?: WebsitePhoto | null;
14
+ about?: WebsitePhoto | null;
15
+ careers?: WebsitePhoto | null;
16
+ stock_photos?: WebsitePhoto[];
17
+ }
18
+ type WebsitePhotosResponse = WebsitePhotos;
19
+
20
+ export type { WebsitePhotos as W, WebsitePhoto as a, WebsitePhotosResponse as b };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keystone-design-bootstrap",
3
- "version": "1.0.41",
3
+ "version": "1.0.43",
4
4
  "description": "Keystone Design Bootstrap - Sections, Elements, and Theme System for customer websites",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -5,6 +5,7 @@
5
5
 
6
6
  import type { CompanyInformation } from '../types/api/company-information';
7
7
  import type { Service } from '../types/api/service';
8
+ import type { WebsitePhotos } from '../types/api/website-photos';
8
9
 
9
10
  const API_URL = process.env.API_URL || 'http://localhost:3000/api/v1';
10
11
  const API_KEY = process.env.API_KEY || '';
@@ -112,8 +113,8 @@ export async function getTeamMembers() {
112
113
  return serverFetch('/public/team_members', defaultOptions);
113
114
  }
114
115
 
115
- export async function getWebsitePhotos() {
116
- return serverFetch('/public/website_photos', defaultOptions);
116
+ export async function getWebsitePhotos(): Promise<WebsitePhotos | null> {
117
+ return serverFetch<WebsitePhotos>('/public/website_photos', defaultOptions);
117
118
  }
118
119
 
119
120
  export async function getJobPostings() {
@@ -14,6 +14,7 @@ export interface WebsitePhotos {
14
14
  contact?: WebsitePhoto | null;
15
15
  about?: WebsitePhoto | null;
16
16
  careers?: WebsitePhoto | null;
17
+ preview_image?: WebsitePhoto | null;
17
18
  stock_photos?: WebsitePhoto[]; // Array of 'none' type photos for stub mode fallback
18
19
  }
19
20