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.
- package/dist/blog-post-CvRhU9ss.d.ts +50 -0
- package/dist/company-information-C_k_sLSB.d.ts +46 -0
- package/dist/contexts/index.d.ts +13 -0
- package/dist/design_system/elements/index.d.ts +348 -0
- package/dist/design_system/logo/keystone-logo.d.ts +6 -0
- package/dist/design_system/sections/index.d.ts +194 -0
- package/dist/form-CWXC-IHT.d.ts +88 -0
- package/dist/index.d.ts +76 -0
- package/dist/lib/component-registry.d.ts +13 -0
- package/dist/lib/hooks/index.d.ts +64 -0
- package/dist/lib/server-api.d.ts +41 -0
- package/dist/lib/server-api.js.map +1 -1
- package/dist/themes/index.d.ts +16 -0
- package/dist/types/index.d.ts +263 -0
- package/dist/utils/cx.d.ts +15 -0
- package/dist/utils/gradient-placeholder.d.ts +8 -0
- package/dist/utils/is-react-component.d.ts +21 -0
- package/dist/utils/markdown-toc.d.ts +14 -0
- package/dist/utils/photo-helpers.d.ts +46 -0
- package/dist/website-photos-_n2g24IM.d.ts +20 -0
- package/package.json +1 -1
- package/src/lib/server-api.ts +3 -2
- package/src/types/api/website-photos.ts +1 -0
|
@@ -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
package/src/lib/server-api.ts
CHANGED
|
@@ -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
|
|