@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.
Files changed (177) hide show
  1. package/dist/{chunk-3ELW4VML.js → chunk-2Y5UT5VF.js} +3 -3
  2. package/dist/{chunk-YFZDIEVC.js → chunk-3HYHYKNL.js} +6 -6
  3. package/dist/{chunk-5CJKZHWO.js → chunk-3JVYM4ZN.js} +5 -5
  4. package/dist/{chunk-P2VRLSAP.cjs → chunk-3WR5R6H6.cjs} +21 -21
  5. package/dist/{chunk-P2VRLSAP.cjs.map → chunk-3WR5R6H6.cjs.map} +1 -1
  6. package/dist/{chunk-UCNEQKIT.cjs → chunk-4VZFJKPT.cjs} +5 -5
  7. package/dist/{chunk-UCNEQKIT.cjs.map → chunk-4VZFJKPT.cjs.map} +1 -1
  8. package/dist/{chunk-VEHZNQ77.cjs → chunk-5LUPIYPH.cjs} +30 -30
  9. package/dist/{chunk-VEHZNQ77.cjs.map → chunk-5LUPIYPH.cjs.map} +1 -1
  10. package/dist/{chunk-TLKHLGAB.js → chunk-5OIXAV4P.js} +3 -3
  11. package/dist/{chunk-LNKULR4V.js → chunk-6EZGJZVH.js} +2 -2
  12. package/dist/{chunk-JWKAJTNA.cjs → chunk-6ZNWY6WW.cjs} +28 -28
  13. package/dist/{chunk-JWKAJTNA.cjs.map → chunk-6ZNWY6WW.cjs.map} +1 -1
  14. package/dist/{chunk-QJR32JM2.cjs → chunk-A6ETQEWK.cjs} +615 -485
  15. package/dist/chunk-A6ETQEWK.cjs.map +1 -0
  16. package/dist/{chunk-JFKK3ZOA.cjs → chunk-BMORFCT2.cjs} +57 -57
  17. package/dist/{chunk-JFKK3ZOA.cjs.map → chunk-BMORFCT2.cjs.map} +1 -1
  18. package/dist/{chunk-33DHEEMP.cjs → chunk-C3MRLZUI.cjs} +33 -33
  19. package/dist/{chunk-33DHEEMP.cjs.map → chunk-C3MRLZUI.cjs.map} +1 -1
  20. package/dist/{chunk-XWBND4G5.js → chunk-D7YISHXC.js} +17 -2
  21. package/dist/{chunk-XWBND4G5.js.map → chunk-D7YISHXC.js.map} +1 -1
  22. package/dist/{chunk-EJKEDCTH.js → chunk-DQUEVRDU.js} +7 -7
  23. package/dist/{chunk-HCKEDTKJ.cjs → chunk-EAYMX22G.cjs} +15 -15
  24. package/dist/{chunk-HCKEDTKJ.cjs.map → chunk-EAYMX22G.cjs.map} +1 -1
  25. package/dist/{chunk-NNFQLTJ3.cjs → chunk-EMF64FWA.cjs} +31 -5
  26. package/dist/chunk-EMF64FWA.cjs.map +1 -0
  27. package/dist/{chunk-IKUSKKFZ.cjs → chunk-G45RGWHF.cjs} +159 -144
  28. package/dist/chunk-G45RGWHF.cjs.map +1 -0
  29. package/dist/{chunk-TOUD3AGK.js → chunk-KLWJRGNN.js} +5 -5
  30. package/dist/{chunk-MYEG5ZDT.js → chunk-L4WLYGB4.js} +3 -3
  31. package/dist/{chunk-VZSTL5VG.js → chunk-LV6CORVJ.js} +3 -3
  32. package/dist/{chunk-MEJFHD5N.cjs → chunk-M36XSGZV.cjs} +19 -19
  33. package/dist/{chunk-MEJFHD5N.cjs.map → chunk-M36XSGZV.cjs.map} +1 -1
  34. package/dist/{chunk-MCWAZ5XI.js → chunk-NFWAL6UV.js} +2 -2
  35. package/dist/{chunk-3ZA2OYRE.cjs → chunk-NISAGFEM.cjs} +3 -3
  36. package/dist/{chunk-3ZA2OYRE.cjs.map → chunk-NISAGFEM.cjs.map} +1 -1
  37. package/dist/{chunk-7X5TCK4R.cjs → chunk-NYLWMAHP.cjs} +10 -10
  38. package/dist/{chunk-7X5TCK4R.cjs.map → chunk-NYLWMAHP.cjs.map} +1 -1
  39. package/dist/{chunk-RURZ6QLN.js → chunk-OZNFPQT5.js} +3 -3
  40. package/dist/{chunk-VOAZU46B.cjs → chunk-P2CKLIOM.cjs} +80 -80
  41. package/dist/{chunk-VOAZU46B.cjs.map → chunk-P2CKLIOM.cjs.map} +1 -1
  42. package/dist/{chunk-KP6VJP36.js → chunk-PLMJVA2H.js} +4 -4
  43. package/dist/{chunk-JAJQ5P2Q.cjs → chunk-QZYYNBMI.cjs} +28 -28
  44. package/dist/{chunk-JAJQ5P2Q.cjs.map → chunk-QZYYNBMI.cjs.map} +1 -1
  45. package/dist/{chunk-4T5KOD3G.js → chunk-S7YXLZNG.js} +6 -6
  46. package/dist/{chunk-Q66AMADB.cjs → chunk-SSGM2NKA.cjs} +6 -6
  47. package/dist/{chunk-Q66AMADB.cjs.map → chunk-SSGM2NKA.cjs.map} +1 -1
  48. package/dist/{chunk-IIT5HWLY.cjs → chunk-V7ZJTUV2.cjs} +11 -11
  49. package/dist/{chunk-IIT5HWLY.cjs.map → chunk-V7ZJTUV2.cjs.map} +1 -1
  50. package/dist/{chunk-3LMYQGAJ.js → chunk-X7YSF6A3.js} +28 -2
  51. package/dist/chunk-X7YSF6A3.js.map +1 -0
  52. package/dist/{chunk-ZHUBNWEX.cjs → chunk-XMK24INA.cjs} +6 -6
  53. package/dist/{chunk-ZHUBNWEX.cjs.map → chunk-XMK24INA.cjs.map} +1 -1
  54. package/dist/{chunk-XPJKQ63S.js → chunk-XMTGLQSD.js} +3 -3
  55. package/dist/{chunk-6BJYPG2V.js → chunk-YEQAA6I4.js} +4 -4
  56. package/dist/{chunk-JVWRMLQZ.js → chunk-YYC7V7YC.js} +2059 -1929
  57. package/dist/chunk-YYC7V7YC.js.map +1 -0
  58. package/dist/components/case-studies/index.cjs +10 -10
  59. package/dist/components/case-studies/index.js +4 -4
  60. package/dist/components/chat/entity-cards/program-card.d.ts.map +1 -1
  61. package/dist/components/chat/index.cjs +3 -3
  62. package/dist/components/chat/index.js +2 -2
  63. package/dist/components/contact/index.cjs +5 -5
  64. package/dist/components/contact/index.js +4 -4
  65. package/dist/components/docs/index.cjs +8 -8
  66. package/dist/components/docs/index.js +7 -7
  67. package/dist/components/embeds/index.cjs +5 -5
  68. package/dist/components/embeds/index.js +4 -4
  69. package/dist/components/faq/index.cjs +5 -5
  70. package/dist/components/faq/index.js +4 -4
  71. package/dist/components/features/auth/account-details-fields.d.ts +34 -0
  72. package/dist/components/features/auth/account-details-fields.d.ts.map +1 -0
  73. package/dist/components/features/auth/complete-account-form.d.ts.map +1 -1
  74. package/dist/components/features/auth/create-organization-form.d.ts +43 -6
  75. package/dist/components/features/auth/create-organization-form.d.ts.map +1 -1
  76. package/dist/components/features/auth/index.d.ts +2 -0
  77. package/dist/components/features/auth/index.d.ts.map +1 -1
  78. package/dist/components/features/auth/labeled-divider.d.ts +6 -0
  79. package/dist/components/features/auth/labeled-divider.d.ts.map +1 -0
  80. package/dist/components/features/auth/login-form.d.ts +32 -9
  81. package/dist/components/features/auth/login-form.d.ts.map +1 -1
  82. package/dist/components/features/auth/openframe-sso-signup-form.d.ts.map +1 -1
  83. package/dist/components/features/auth/sso-providers.d.ts +1 -1
  84. package/dist/components/features/auth/sso-providers.d.ts.map +1 -1
  85. package/dist/components/features/index.cjs +8 -4
  86. package/dist/components/features/index.cjs.map +1 -1
  87. package/dist/components/features/index.js +7 -3
  88. package/dist/components/features/media-gallery-manager.d.ts.map +1 -1
  89. package/dist/components/features/push-button-selector.d.ts +9 -7
  90. package/dist/components/features/push-button-selector.d.ts.map +1 -1
  91. package/dist/components/features/release-media-manager.d.ts.map +1 -1
  92. package/dist/components/features/video.d.ts +8 -0
  93. package/dist/components/features/video.d.ts.map +1 -1
  94. package/dist/components/help-center-pages/index.cjs +24 -24
  95. package/dist/components/help-center-pages/index.js +15 -15
  96. package/dist/components/index.cjs +57 -51
  97. package/dist/components/index.cjs.map +1 -1
  98. package/dist/components/index.js +21 -15
  99. package/dist/components/index.js.map +1 -1
  100. package/dist/components/loading/unified-skeleton.d.ts.map +1 -1
  101. package/dist/components/meeting-scheduler/index.cjs +31 -31
  102. package/dist/components/meeting-scheduler/index.js +3 -3
  103. package/dist/components/navigation/index.cjs +7 -7
  104. package/dist/components/navigation/index.js +6 -6
  105. package/dist/components/onboarding-guides/index.cjs +7 -7
  106. package/dist/components/onboarding-guides/index.js +6 -6
  107. package/dist/components/related-content/index.cjs +3 -3
  108. package/dist/components/related-content/index.js +2 -2
  109. package/dist/components/tickets/index.cjs +8 -8
  110. package/dist/components/tickets/index.js +7 -7
  111. package/dist/components/ui/index.cjs +6 -4
  112. package/dist/components/ui/index.cjs.map +1 -1
  113. package/dist/components/ui/index.d.ts +1 -0
  114. package/dist/components/ui/index.d.ts.map +1 -1
  115. package/dist/components/ui/index.js +5 -3
  116. package/dist/components/ui/lazy-mount.d.ts +21 -0
  117. package/dist/components/ui/lazy-mount.d.ts.map +1 -0
  118. package/dist/index.cjs +24 -8
  119. package/dist/index.cjs.map +1 -1
  120. package/dist/index.js +23 -7
  121. package/dist/index.js.map +1 -1
  122. package/dist/types/marketing.d.ts +1 -1
  123. package/dist/types/marketing.d.ts.map +1 -1
  124. package/dist/utils/index.cjs +26 -0
  125. package/dist/utils/index.cjs.map +1 -1
  126. package/dist/utils/index.d.ts +1 -0
  127. package/dist/utils/index.d.ts.map +1 -1
  128. package/dist/utils/index.js +22 -1
  129. package/dist/utils/index.js.map +1 -1
  130. package/dist/utils/media-type.d.ts +26 -0
  131. package/dist/utils/media-type.d.ts.map +1 -0
  132. package/package.json +1 -1
  133. package/src/components/chat/entity-cards/program-card.tsx +2 -2
  134. package/src/components/features/auth/account-details-fields.tsx +124 -0
  135. package/src/components/features/auth/complete-account-form.tsx +13 -52
  136. package/src/components/features/auth/create-organization-form.tsx +128 -38
  137. package/src/components/features/auth/index.ts +2 -0
  138. package/src/components/features/auth/labeled-divider.tsx +16 -0
  139. package/src/components/features/auth/login-form.tsx +102 -23
  140. package/src/components/features/auth/openframe-sso-signup-form.tsx +11 -43
  141. package/src/components/features/auth/sso-providers.tsx +3 -3
  142. package/src/components/features/media-gallery-manager.tsx +4 -3
  143. package/src/components/features/push-button-selector.tsx +15 -12
  144. package/src/components/features/release-media-manager.tsx +3 -2
  145. package/src/components/features/video.tsx +28 -0
  146. package/src/components/loading/__tests__/unified-skeleton.test.tsx +16 -0
  147. package/src/components/loading/unified-skeleton.tsx +5 -1
  148. package/src/components/ui/__tests__/lazy-mount.test.tsx +46 -0
  149. package/src/components/ui/index.ts +3 -0
  150. package/src/components/ui/lazy-mount.tsx +38 -0
  151. package/src/stories/auth/Login.stories.tsx +15 -5
  152. package/src/types/.marketing.md +0 -1
  153. package/src/types/marketing.ts +4 -2
  154. package/src/utils/__tests__/media-type.test.ts +30 -0
  155. package/src/utils/index.ts +3 -0
  156. package/src/utils/media-type.ts +39 -0
  157. package/src/utils/vendor-media-stub.ts +7 -7
  158. package/dist/chunk-3LMYQGAJ.js.map +0 -1
  159. package/dist/chunk-IKUSKKFZ.cjs.map +0 -1
  160. package/dist/chunk-JVWRMLQZ.js.map +0 -1
  161. package/dist/chunk-NNFQLTJ3.cjs.map +0 -1
  162. package/dist/chunk-QJR32JM2.cjs.map +0 -1
  163. /package/dist/{chunk-3ELW4VML.js.map → chunk-2Y5UT5VF.js.map} +0 -0
  164. /package/dist/{chunk-YFZDIEVC.js.map → chunk-3HYHYKNL.js.map} +0 -0
  165. /package/dist/{chunk-5CJKZHWO.js.map → chunk-3JVYM4ZN.js.map} +0 -0
  166. /package/dist/{chunk-TLKHLGAB.js.map → chunk-5OIXAV4P.js.map} +0 -0
  167. /package/dist/{chunk-LNKULR4V.js.map → chunk-6EZGJZVH.js.map} +0 -0
  168. /package/dist/{chunk-EJKEDCTH.js.map → chunk-DQUEVRDU.js.map} +0 -0
  169. /package/dist/{chunk-TOUD3AGK.js.map → chunk-KLWJRGNN.js.map} +0 -0
  170. /package/dist/{chunk-MYEG5ZDT.js.map → chunk-L4WLYGB4.js.map} +0 -0
  171. /package/dist/{chunk-VZSTL5VG.js.map → chunk-LV6CORVJ.js.map} +0 -0
  172. /package/dist/{chunk-MCWAZ5XI.js.map → chunk-NFWAL6UV.js.map} +0 -0
  173. /package/dist/{chunk-RURZ6QLN.js.map → chunk-OZNFPQT5.js.map} +0 -0
  174. /package/dist/{chunk-KP6VJP36.js.map → chunk-PLMJVA2H.js.map} +0 -0
  175. /package/dist/{chunk-4T5KOD3G.js.map → chunk-S7YXLZNG.js.map} +0 -0
  176. /package/dist/{chunk-XPJKQ63S.js.map → chunk-XMTGLQSD.js.map} +0 -0
  177. /package/dist/{chunk-6BJYPG2V.js.map → chunk-YEQAA6I4.js.map} +0 -0
@@ -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
- // Publishing & Override fields
159
- selected_for_publish: boolean;
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
+ });
@@ -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.media_type === 'image');
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.media_type === 'video');
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.media_type === 'image').map(m => fixSupabaseStorageUrl(m.media_url)),
79
- videos: media.filter(m => m.media_type === 'video').map(m => fixSupabaseStorageUrl(m.media_url)),
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.media_type === 'image').length;
119
- const videos = media.filter(m => m.media_type === 'video').length;
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,