@flamingo-stack/openframe-frontend-core 0.0.584 → 0.0.585-snapshot.20260903083645
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/{chunk-3ELW4VML.js → chunk-2Y5UT5VF.js} +3 -3
- package/dist/{chunk-YFZDIEVC.js → chunk-3HYHYKNL.js} +6 -6
- package/dist/{chunk-5CJKZHWO.js → chunk-3JVYM4ZN.js} +5 -5
- package/dist/{chunk-P2VRLSAP.cjs → chunk-3WR5R6H6.cjs} +21 -21
- package/dist/{chunk-P2VRLSAP.cjs.map → chunk-3WR5R6H6.cjs.map} +1 -1
- package/dist/{chunk-UCNEQKIT.cjs → chunk-4VZFJKPT.cjs} +5 -5
- package/dist/{chunk-UCNEQKIT.cjs.map → chunk-4VZFJKPT.cjs.map} +1 -1
- package/dist/{chunk-VEHZNQ77.cjs → chunk-5LUPIYPH.cjs} +30 -30
- package/dist/{chunk-VEHZNQ77.cjs.map → chunk-5LUPIYPH.cjs.map} +1 -1
- package/dist/{chunk-TLKHLGAB.js → chunk-5OIXAV4P.js} +3 -3
- package/dist/{chunk-LNKULR4V.js → chunk-6EZGJZVH.js} +2 -2
- package/dist/{chunk-JWKAJTNA.cjs → chunk-6ZNWY6WW.cjs} +28 -28
- package/dist/{chunk-JWKAJTNA.cjs.map → chunk-6ZNWY6WW.cjs.map} +1 -1
- package/dist/{chunk-QJR32JM2.cjs → chunk-A6ETQEWK.cjs} +615 -485
- package/dist/chunk-A6ETQEWK.cjs.map +1 -0
- package/dist/{chunk-JFKK3ZOA.cjs → chunk-BMORFCT2.cjs} +57 -57
- package/dist/{chunk-JFKK3ZOA.cjs.map → chunk-BMORFCT2.cjs.map} +1 -1
- package/dist/{chunk-33DHEEMP.cjs → chunk-C3MRLZUI.cjs} +33 -33
- package/dist/{chunk-33DHEEMP.cjs.map → chunk-C3MRLZUI.cjs.map} +1 -1
- package/dist/{chunk-XWBND4G5.js → chunk-D7YISHXC.js} +17 -2
- package/dist/{chunk-XWBND4G5.js.map → chunk-D7YISHXC.js.map} +1 -1
- package/dist/{chunk-EJKEDCTH.js → chunk-DQUEVRDU.js} +7 -7
- package/dist/{chunk-HCKEDTKJ.cjs → chunk-EAYMX22G.cjs} +15 -15
- package/dist/{chunk-HCKEDTKJ.cjs.map → chunk-EAYMX22G.cjs.map} +1 -1
- package/dist/{chunk-NNFQLTJ3.cjs → chunk-EMF64FWA.cjs} +31 -5
- package/dist/chunk-EMF64FWA.cjs.map +1 -0
- package/dist/{chunk-IKUSKKFZ.cjs → chunk-G45RGWHF.cjs} +159 -144
- package/dist/chunk-G45RGWHF.cjs.map +1 -0
- package/dist/{chunk-TOUD3AGK.js → chunk-KLWJRGNN.js} +5 -5
- package/dist/{chunk-MYEG5ZDT.js → chunk-L4WLYGB4.js} +3 -3
- package/dist/{chunk-VZSTL5VG.js → chunk-LV6CORVJ.js} +3 -3
- package/dist/{chunk-MEJFHD5N.cjs → chunk-M36XSGZV.cjs} +19 -19
- package/dist/{chunk-MEJFHD5N.cjs.map → chunk-M36XSGZV.cjs.map} +1 -1
- package/dist/{chunk-MCWAZ5XI.js → chunk-NFWAL6UV.js} +2 -2
- package/dist/{chunk-3ZA2OYRE.cjs → chunk-NISAGFEM.cjs} +3 -3
- package/dist/{chunk-3ZA2OYRE.cjs.map → chunk-NISAGFEM.cjs.map} +1 -1
- package/dist/{chunk-7X5TCK4R.cjs → chunk-NYLWMAHP.cjs} +10 -10
- package/dist/{chunk-7X5TCK4R.cjs.map → chunk-NYLWMAHP.cjs.map} +1 -1
- package/dist/{chunk-RURZ6QLN.js → chunk-OZNFPQT5.js} +3 -3
- package/dist/{chunk-VOAZU46B.cjs → chunk-P2CKLIOM.cjs} +80 -80
- package/dist/{chunk-VOAZU46B.cjs.map → chunk-P2CKLIOM.cjs.map} +1 -1
- package/dist/{chunk-KP6VJP36.js → chunk-PLMJVA2H.js} +4 -4
- package/dist/{chunk-JAJQ5P2Q.cjs → chunk-QZYYNBMI.cjs} +28 -28
- package/dist/{chunk-JAJQ5P2Q.cjs.map → chunk-QZYYNBMI.cjs.map} +1 -1
- package/dist/{chunk-4T5KOD3G.js → chunk-S7YXLZNG.js} +6 -6
- package/dist/{chunk-Q66AMADB.cjs → chunk-SSGM2NKA.cjs} +6 -6
- package/dist/{chunk-Q66AMADB.cjs.map → chunk-SSGM2NKA.cjs.map} +1 -1
- package/dist/{chunk-IIT5HWLY.cjs → chunk-V7ZJTUV2.cjs} +11 -11
- package/dist/{chunk-IIT5HWLY.cjs.map → chunk-V7ZJTUV2.cjs.map} +1 -1
- package/dist/{chunk-3LMYQGAJ.js → chunk-X7YSF6A3.js} +28 -2
- package/dist/chunk-X7YSF6A3.js.map +1 -0
- package/dist/{chunk-ZHUBNWEX.cjs → chunk-XMK24INA.cjs} +6 -6
- package/dist/{chunk-ZHUBNWEX.cjs.map → chunk-XMK24INA.cjs.map} +1 -1
- package/dist/{chunk-XPJKQ63S.js → chunk-XMTGLQSD.js} +3 -3
- package/dist/{chunk-6BJYPG2V.js → chunk-YEQAA6I4.js} +4 -4
- package/dist/{chunk-JVWRMLQZ.js → chunk-YYC7V7YC.js} +2059 -1929
- package/dist/chunk-YYC7V7YC.js.map +1 -0
- package/dist/components/case-studies/index.cjs +10 -10
- package/dist/components/case-studies/index.js +4 -4
- package/dist/components/chat/entity-cards/program-card.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +3 -3
- package/dist/components/chat/index.js +2 -2
- package/dist/components/contact/index.cjs +5 -5
- package/dist/components/contact/index.js +4 -4
- package/dist/components/docs/index.cjs +8 -8
- package/dist/components/docs/index.js +7 -7
- package/dist/components/embeds/index.cjs +5 -5
- package/dist/components/embeds/index.js +4 -4
- package/dist/components/faq/index.cjs +5 -5
- package/dist/components/faq/index.js +4 -4
- package/dist/components/features/auth/account-details-fields.d.ts +34 -0
- package/dist/components/features/auth/account-details-fields.d.ts.map +1 -0
- package/dist/components/features/auth/complete-account-form.d.ts.map +1 -1
- package/dist/components/features/auth/create-organization-form.d.ts +43 -6
- package/dist/components/features/auth/create-organization-form.d.ts.map +1 -1
- package/dist/components/features/auth/index.d.ts +2 -0
- package/dist/components/features/auth/index.d.ts.map +1 -1
- package/dist/components/features/auth/labeled-divider.d.ts +6 -0
- package/dist/components/features/auth/labeled-divider.d.ts.map +1 -0
- package/dist/components/features/auth/login-form.d.ts +32 -9
- package/dist/components/features/auth/login-form.d.ts.map +1 -1
- package/dist/components/features/auth/openframe-sso-signup-form.d.ts.map +1 -1
- package/dist/components/features/auth/sso-providers.d.ts +1 -1
- package/dist/components/features/auth/sso-providers.d.ts.map +1 -1
- package/dist/components/features/index.cjs +8 -4
- package/dist/components/features/index.cjs.map +1 -1
- package/dist/components/features/index.js +7 -3
- package/dist/components/features/media-gallery-manager.d.ts.map +1 -1
- package/dist/components/features/push-button-selector.d.ts +9 -7
- package/dist/components/features/push-button-selector.d.ts.map +1 -1
- package/dist/components/features/release-media-manager.d.ts.map +1 -1
- package/dist/components/features/video.d.ts +8 -0
- package/dist/components/features/video.d.ts.map +1 -1
- package/dist/components/help-center-pages/index.cjs +24 -24
- package/dist/components/help-center-pages/index.js +15 -15
- package/dist/components/index.cjs +57 -51
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +21 -15
- package/dist/components/index.js.map +1 -1
- package/dist/components/loading/unified-skeleton.d.ts.map +1 -1
- package/dist/components/meeting-scheduler/index.cjs +31 -31
- package/dist/components/meeting-scheduler/index.js +3 -3
- package/dist/components/navigation/index.cjs +7 -7
- package/dist/components/navigation/index.js +6 -6
- package/dist/components/onboarding-guides/index.cjs +7 -7
- package/dist/components/onboarding-guides/index.js +6 -6
- package/dist/components/related-content/index.cjs +3 -3
- package/dist/components/related-content/index.js +2 -2
- package/dist/components/tickets/index.cjs +8 -8
- package/dist/components/tickets/index.js +7 -7
- package/dist/components/ui/index.cjs +6 -4
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +5 -3
- package/dist/components/ui/lazy-mount.d.ts +21 -0
- package/dist/components/ui/lazy-mount.d.ts.map +1 -0
- package/dist/index.cjs +24 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +23 -7
- package/dist/index.js.map +1 -1
- package/dist/types/marketing.d.ts +1 -1
- package/dist/types/marketing.d.ts.map +1 -1
- package/dist/utils/index.cjs +26 -0
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +22 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/media-type.d.ts +26 -0
- package/dist/utils/media-type.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/chat/entity-cards/program-card.tsx +2 -2
- package/src/components/features/auth/account-details-fields.tsx +124 -0
- package/src/components/features/auth/complete-account-form.tsx +13 -52
- package/src/components/features/auth/create-organization-form.tsx +128 -38
- package/src/components/features/auth/index.ts +2 -0
- package/src/components/features/auth/labeled-divider.tsx +16 -0
- package/src/components/features/auth/login-form.tsx +102 -23
- package/src/components/features/auth/openframe-sso-signup-form.tsx +11 -43
- package/src/components/features/auth/sso-providers.tsx +3 -3
- package/src/components/features/media-gallery-manager.tsx +4 -3
- package/src/components/features/push-button-selector.tsx +15 -12
- package/src/components/features/release-media-manager.tsx +3 -2
- package/src/components/features/video.tsx +28 -0
- package/src/components/loading/__tests__/unified-skeleton.test.tsx +16 -0
- package/src/components/loading/unified-skeleton.tsx +5 -1
- package/src/components/ui/__tests__/lazy-mount.test.tsx +46 -0
- package/src/components/ui/index.ts +3 -0
- package/src/components/ui/lazy-mount.tsx +38 -0
- package/src/stories/auth/Login.stories.tsx +15 -5
- package/src/types/.marketing.md +0 -1
- package/src/types/marketing.ts +4 -2
- package/src/utils/__tests__/media-type.test.ts +30 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/media-type.ts +39 -0
- package/src/utils/vendor-media-stub.ts +7 -7
- package/dist/chunk-3LMYQGAJ.js.map +0 -1
- package/dist/chunk-IKUSKKFZ.cjs.map +0 -1
- package/dist/chunk-JVWRMLQZ.js.map +0 -1
- package/dist/chunk-NNFQLTJ3.cjs.map +0 -1
- package/dist/chunk-QJR32JM2.cjs.map +0 -1
- /package/dist/{chunk-3ELW4VML.js.map → chunk-2Y5UT5VF.js.map} +0 -0
- /package/dist/{chunk-YFZDIEVC.js.map → chunk-3HYHYKNL.js.map} +0 -0
- /package/dist/{chunk-5CJKZHWO.js.map → chunk-3JVYM4ZN.js.map} +0 -0
- /package/dist/{chunk-TLKHLGAB.js.map → chunk-5OIXAV4P.js.map} +0 -0
- /package/dist/{chunk-LNKULR4V.js.map → chunk-6EZGJZVH.js.map} +0 -0
- /package/dist/{chunk-EJKEDCTH.js.map → chunk-DQUEVRDU.js.map} +0 -0
- /package/dist/{chunk-TOUD3AGK.js.map → chunk-KLWJRGNN.js.map} +0 -0
- /package/dist/{chunk-MYEG5ZDT.js.map → chunk-L4WLYGB4.js.map} +0 -0
- /package/dist/{chunk-VZSTL5VG.js.map → chunk-LV6CORVJ.js.map} +0 -0
- /package/dist/{chunk-MCWAZ5XI.js.map → chunk-NFWAL6UV.js.map} +0 -0
- /package/dist/{chunk-RURZ6QLN.js.map → chunk-OZNFPQT5.js.map} +0 -0
- /package/dist/{chunk-KP6VJP36.js.map → chunk-PLMJVA2H.js.map} +0 -0
- /package/dist/{chunk-4T5KOD3G.js.map → chunk-S7YXLZNG.js.map} +0 -0
- /package/dist/{chunk-XPJKQ63S.js.map → chunk-XMTGLQSD.js.map} +0 -0
- /package/dist/{chunk-6BJYPG2V.js.map → chunk-YEQAA6I4.js.map} +0 -0
package/src/types/marketing.ts
CHANGED
|
@@ -109,6 +109,7 @@ export interface CreateAIContentInput {
|
|
|
109
109
|
// AI Media Types
|
|
110
110
|
// =============================================================================
|
|
111
111
|
|
|
112
|
+
/** Row union. Compare through `utils/media-type` (`isVideoMedia` / `isImageMedia` / `MEDIA_TYPE`), never a literal. */
|
|
112
113
|
export type MediaType = 'image' | 'video' | 'figma_export';
|
|
113
114
|
export type MediaProvider =
|
|
114
115
|
| 'dalle'
|
|
@@ -155,8 +156,9 @@ export interface AIMedia {
|
|
|
155
156
|
social_account_id: number | null; // FK to social_accounts table - primary source of truth
|
|
156
157
|
created_at: string;
|
|
157
158
|
updated_at: string;
|
|
158
|
-
//
|
|
159
|
-
|
|
159
|
+
// Override fields. NOTE: there is no `selected_for_publish` on media — a
|
|
160
|
+
// media item is "selected" by being ATTACHED to a post that is selected
|
|
161
|
+
// (`ai_content_media`); consumers derive the flag in their DAL.
|
|
160
162
|
override_url: string | null;
|
|
161
163
|
override_at: string | null;
|
|
162
164
|
override_by: string | null;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { MEDIA_TYPE, isImageMedia, isPublishableMediaType, isVideoMedia, partitionMediaByType } from '../media-type';
|
|
3
|
+
|
|
4
|
+
describe('media-type', () => {
|
|
5
|
+
it('predicates read the discriminator and tolerate missing rows', () => {
|
|
6
|
+
expect(isVideoMedia({ media_type: MEDIA_TYPE.VIDEO })).toBe(true);
|
|
7
|
+
expect(isImageMedia({ media_type: MEDIA_TYPE.VIDEO })).toBe(false);
|
|
8
|
+
expect(isVideoMedia(null)).toBe(false);
|
|
9
|
+
expect(isImageMedia(undefined)).toBe(false);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('only image and video are publishable', () => {
|
|
13
|
+
expect(isPublishableMediaType('image')).toBe(true);
|
|
14
|
+
expect(isPublishableMediaType('video')).toBe(true);
|
|
15
|
+
expect(isPublishableMediaType('figma_export')).toBe(false);
|
|
16
|
+
expect(isPublishableMediaType(null)).toBe(false);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('partitions in order', () => {
|
|
20
|
+
const rows = [
|
|
21
|
+
{ id: 1, media_type: 'video' },
|
|
22
|
+
{ id: 2, media_type: 'image' },
|
|
23
|
+
{ id: 3, media_type: 'video' },
|
|
24
|
+
{ id: 4, media_type: 'logo' },
|
|
25
|
+
];
|
|
26
|
+
const { videos, images } = partitionMediaByType(rows);
|
|
27
|
+
expect(videos.map(r => r.id)).toEqual([1, 3]);
|
|
28
|
+
expect(images.map(r => r.id)).toEqual([2]);
|
|
29
|
+
});
|
|
30
|
+
});
|
package/src/utils/index.ts
CHANGED
|
@@ -365,3 +365,6 @@ export * from './embed-url-converters';
|
|
|
365
365
|
export * from './hubspot-meetings-convention';
|
|
366
366
|
export * from './page-header-constants';
|
|
367
367
|
export * from './first-touch-attribution';
|
|
368
|
+
|
|
369
|
+
// Media type SSOT — `media_type` discriminator predicates (leaf, zero imports)
|
|
370
|
+
export * from './media-type';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Media type — THE single source of truth for the `media_type` discriminator
|
|
3
|
+
* on media rows (ai_media, program media, vendor media). Zero imports (a leaf),
|
|
4
|
+
* so every consumer reads the same predicate instead of scattering
|
|
5
|
+
* `=== 'video'` literals. `MediaType` (types/marketing.ts) is the row union;
|
|
6
|
+
* these are the two values a post can publish.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export const MEDIA_TYPE = {
|
|
10
|
+
IMAGE: 'image',
|
|
11
|
+
VIDEO: 'video',
|
|
12
|
+
} as const;
|
|
13
|
+
|
|
14
|
+
/** The two media types a post can publish. */
|
|
15
|
+
export type PublishableMediaType = (typeof MEDIA_TYPE)[keyof typeof MEDIA_TYPE];
|
|
16
|
+
|
|
17
|
+
interface MediaTyped {
|
|
18
|
+
media_type?: string | null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function isVideoMedia(media: MediaTyped | null | undefined): boolean {
|
|
22
|
+
return media?.media_type === MEDIA_TYPE.VIDEO;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function isImageMedia(media: MediaTyped | null | undefined): boolean {
|
|
26
|
+
return media?.media_type === MEDIA_TYPE.IMAGE;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function isPublishableMediaType(mediaType: string | null | undefined): mediaType is PublishableMediaType {
|
|
30
|
+
return mediaType === MEDIA_TYPE.VIDEO || mediaType === MEDIA_TYPE.IMAGE;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Split a media list into its videos and images, preserving order. */
|
|
34
|
+
export function partitionMediaByType<T extends MediaTyped>(media: readonly T[]): { videos: T[]; images: T[] } {
|
|
35
|
+
return {
|
|
36
|
+
videos: media.filter(m => isVideoMedia(m)),
|
|
37
|
+
images: media.filter(m => isImageMedia(m)),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Vendor media utilities for UI kit
|
|
2
2
|
// Real implementation copied from main project
|
|
3
3
|
|
|
4
|
+
import { isImageMedia, isVideoMedia } from './media-type';
|
|
4
5
|
import { fixSupabaseStorageUrl } from './url-fix';
|
|
5
|
-
|
|
6
6
|
export interface VendorMedia {
|
|
7
7
|
media_type: 'logo' | 'image' | 'video';
|
|
8
8
|
media_url: string;
|
|
@@ -44,7 +44,7 @@ export function getVendorLogo(vendor: VendorWithMedia): string | null {
|
|
|
44
44
|
* Get the main image URL from vendor_media array
|
|
45
45
|
*/
|
|
46
46
|
export function getVendorImage(vendor: VendorWithMedia): string | null {
|
|
47
|
-
const imageMedia = vendor.vendor_media?.find(m => m
|
|
47
|
+
const imageMedia = vendor.vendor_media?.find(m => isImageMedia(m));
|
|
48
48
|
return imageMedia?.media_url ? fixSupabaseStorageUrl(imageMedia.media_url) : null;
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -52,7 +52,7 @@ export function getVendorImage(vendor: VendorWithMedia): string | null {
|
|
|
52
52
|
* Get the video URL from vendor_media array
|
|
53
53
|
*/
|
|
54
54
|
export function getVendorVideo(vendor: VendorWithMedia): string | null {
|
|
55
|
-
const videoMedia = vendor.vendor_media?.find(m => m
|
|
55
|
+
const videoMedia = vendor.vendor_media?.find(m => isVideoMedia(m));
|
|
56
56
|
return videoMedia?.media_url ? fixSupabaseStorageUrl(videoMedia.media_url) : null;
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -75,8 +75,8 @@ export function getVendorMediaGrouped(vendor: VendorWithMedia): {
|
|
|
75
75
|
|
|
76
76
|
return {
|
|
77
77
|
logos: media.filter(m => m.media_type === 'logo').map(m => fixSupabaseStorageUrl(m.media_url)),
|
|
78
|
-
images: media.filter(m => m
|
|
79
|
-
videos: media.filter(m => m
|
|
78
|
+
images: media.filter(m => isImageMedia(m)).map(m => fixSupabaseStorageUrl(m.media_url)),
|
|
79
|
+
videos: media.filter(m => isVideoMedia(m)).map(m => fixSupabaseStorageUrl(m.media_url)),
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
82
|
|
|
@@ -115,8 +115,8 @@ export function getVendorMediaCount(vendor: VendorWithMedia): {
|
|
|
115
115
|
const media = vendor.vendor_media || [];
|
|
116
116
|
|
|
117
117
|
const logos = media.filter(m => m.media_type === 'logo').length;
|
|
118
|
-
const images = media.filter(m => m
|
|
119
|
-
const videos = media.filter(m => m
|
|
118
|
+
const images = media.filter(m => isImageMedia(m)).length;
|
|
119
|
+
const videos = media.filter(m => isVideoMedia(m)).length;
|
|
120
120
|
|
|
121
121
|
return {
|
|
122
122
|
logos,
|