@flamingo-stack/openframe-frontend-core 0.0.610-snapshot.20260908185814 → 0.0.610

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 (94) hide show
  1. package/dist/{chunk-2R36JUKN.js → chunk-25YIHMZ6.js} +2 -2
  2. package/dist/{chunk-DOIBUVVN.js → chunk-2QBXG74C.js} +5 -5
  3. package/dist/{chunk-IRUSFKE4.cjs → chunk-2YMDDD5V.cjs} +3 -3
  4. package/dist/{chunk-IRUSFKE4.cjs.map → chunk-2YMDDD5V.cjs.map} +1 -1
  5. package/dist/{chunk-D4R3QSNG.js → chunk-37CAZTLP.js} +4 -4
  6. package/dist/{chunk-DV4UKIPN.cjs → chunk-C4KQ2XPK.cjs} +13 -13
  7. package/dist/{chunk-DV4UKIPN.cjs.map → chunk-C4KQ2XPK.cjs.map} +1 -1
  8. package/dist/{chunk-24KS3ZL3.cjs → chunk-EANAFFAD.cjs} +17 -17
  9. package/dist/{chunk-24KS3ZL3.cjs.map → chunk-EANAFFAD.cjs.map} +1 -1
  10. package/dist/{chunk-NWET25AT.cjs → chunk-FASOANK7.cjs} +4 -4
  11. package/dist/{chunk-NWET25AT.cjs.map → chunk-FASOANK7.cjs.map} +1 -1
  12. package/dist/{chunk-QI2CAZES.js → chunk-FS3CTGIR.js} +2 -2
  13. package/dist/{chunk-ROBMD5C5.cjs → chunk-GFAHCXIL.cjs} +10 -10
  14. package/dist/{chunk-ROBMD5C5.cjs.map → chunk-GFAHCXIL.cjs.map} +1 -1
  15. package/dist/{chunk-UZQ25ZD6.cjs → chunk-GNLV326I.cjs} +4 -4
  16. package/dist/{chunk-UZQ25ZD6.cjs.map → chunk-GNLV326I.cjs.map} +1 -1
  17. package/dist/{chunk-4MOB63HI.cjs → chunk-HKJ3WKGW.cjs} +320 -325
  18. package/dist/chunk-HKJ3WKGW.cjs.map +1 -0
  19. package/dist/{chunk-CEW2A4PV.js → chunk-HQSCJYCF.js} +2 -2
  20. package/dist/{chunk-QQYV4CMH.js → chunk-HZS4TV34.js} +5 -5
  21. package/dist/{chunk-VFYAJDFR.js → chunk-IBMHEOBV.js} +2 -2
  22. package/dist/{chunk-LLYGTLJ4.js → chunk-MGXSJI23.js} +2 -2
  23. package/dist/{chunk-THAE6Y2T.js → chunk-O6PO5BHE.js} +4 -4
  24. package/dist/{chunk-HS4YYQA6.js → chunk-OIKZDXNW.js} +2 -2
  25. package/dist/{chunk-55M4LRMY.js → chunk-OJZW3GE2.js} +2 -2
  26. package/dist/{chunk-DQHAT6VG.cjs → chunk-OVVKVIMH.cjs} +34 -34
  27. package/dist/{chunk-DQHAT6VG.cjs.map → chunk-OVVKVIMH.cjs.map} +1 -1
  28. package/dist/{chunk-5EEUZULX.js → chunk-Q2CNCBMK.js} +3 -3
  29. package/dist/{chunk-CFJFWJG7.cjs → chunk-Q3APHZK5.cjs} +17 -17
  30. package/dist/{chunk-CFJFWJG7.cjs.map → chunk-Q3APHZK5.cjs.map} +1 -1
  31. package/dist/{chunk-WMFG2QJ2.cjs → chunk-QE2Z6WME.cjs} +33 -33
  32. package/dist/{chunk-WMFG2QJ2.cjs.map → chunk-QE2Z6WME.cjs.map} +1 -1
  33. package/dist/{chunk-JOMGPWBN.js → chunk-R2UDEMKK.js} +2 -2
  34. package/dist/{chunk-SPUW2YXQ.js → chunk-ROOIHDLS.js} +2 -2
  35. package/dist/{chunk-O5FEBR3Q.cjs → chunk-THCB7NHV.cjs} +3 -3
  36. package/dist/{chunk-O5FEBR3Q.cjs.map → chunk-THCB7NHV.cjs.map} +1 -1
  37. package/dist/{chunk-IIE5NCTX.cjs → chunk-THCSSPXU.cjs} +50 -50
  38. package/dist/{chunk-IIE5NCTX.cjs.map → chunk-THCSSPXU.cjs.map} +1 -1
  39. package/dist/{chunk-PI7AV4GT.cjs → chunk-UFFVMZDL.cjs} +3 -3
  40. package/dist/{chunk-PI7AV4GT.cjs.map → chunk-UFFVMZDL.cjs.map} +1 -1
  41. package/dist/{chunk-AQABZFS2.js → chunk-V6TINNLD.js} +18 -23
  42. package/dist/chunk-V6TINNLD.js.map +1 -0
  43. package/dist/{chunk-QQ5G6PM4.cjs → chunk-WJQOYSR3.cjs} +3 -3
  44. package/dist/{chunk-QQ5G6PM4.cjs.map → chunk-WJQOYSR3.cjs.map} +1 -1
  45. package/dist/{chunk-GEKWQVSG.cjs → chunk-ZDLCWNM6.cjs} +18 -18
  46. package/dist/{chunk-GEKWQVSG.cjs.map → chunk-ZDLCWNM6.cjs.map} +1 -1
  47. package/dist/components/case-studies/index.cjs +8 -8
  48. package/dist/components/case-studies/index.js +2 -2
  49. package/dist/components/contact/index.cjs +3 -3
  50. package/dist/components/contact/index.js +2 -2
  51. package/dist/components/docs/index.cjs +6 -6
  52. package/dist/components/docs/index.js +5 -5
  53. package/dist/components/embeds/index.cjs +3 -3
  54. package/dist/components/embeds/index.js +2 -2
  55. package/dist/components/embeds/og-link-preview.d.ts +11 -24
  56. package/dist/components/embeds/og-link-preview.d.ts.map +1 -1
  57. package/dist/components/faq/index.cjs +3 -3
  58. package/dist/components/faq/index.js +2 -2
  59. package/dist/components/features/index.cjs +2 -2
  60. package/dist/components/features/index.js +1 -1
  61. package/dist/components/help-center-pages/index.cjs +22 -22
  62. package/dist/components/help-center-pages/index.js +13 -13
  63. package/dist/components/index.cjs +31 -31
  64. package/dist/components/index.js +12 -12
  65. package/dist/components/meeting-scheduler/index.cjs +21 -21
  66. package/dist/components/meeting-scheduler/index.js +1 -1
  67. package/dist/components/navigation/index.cjs +5 -5
  68. package/dist/components/navigation/index.js +4 -4
  69. package/dist/components/onboarding-guides/index.cjs +5 -5
  70. package/dist/components/onboarding-guides/index.js +4 -4
  71. package/dist/components/tickets/index.cjs +6 -6
  72. package/dist/components/tickets/index.js +5 -5
  73. package/dist/components/ui/index.cjs +2 -2
  74. package/dist/components/ui/index.js +1 -1
  75. package/dist/index.cjs +6 -6
  76. package/dist/index.js +5 -5
  77. package/package.json +1 -1
  78. package/src/components/embeds/og-link-preview.tsx +35 -56
  79. package/dist/chunk-4MOB63HI.cjs.map +0 -1
  80. package/dist/chunk-AQABZFS2.js.map +0 -1
  81. /package/dist/{chunk-2R36JUKN.js.map → chunk-25YIHMZ6.js.map} +0 -0
  82. /package/dist/{chunk-DOIBUVVN.js.map → chunk-2QBXG74C.js.map} +0 -0
  83. /package/dist/{chunk-D4R3QSNG.js.map → chunk-37CAZTLP.js.map} +0 -0
  84. /package/dist/{chunk-QI2CAZES.js.map → chunk-FS3CTGIR.js.map} +0 -0
  85. /package/dist/{chunk-CEW2A4PV.js.map → chunk-HQSCJYCF.js.map} +0 -0
  86. /package/dist/{chunk-QQYV4CMH.js.map → chunk-HZS4TV34.js.map} +0 -0
  87. /package/dist/{chunk-VFYAJDFR.js.map → chunk-IBMHEOBV.js.map} +0 -0
  88. /package/dist/{chunk-LLYGTLJ4.js.map → chunk-MGXSJI23.js.map} +0 -0
  89. /package/dist/{chunk-THAE6Y2T.js.map → chunk-O6PO5BHE.js.map} +0 -0
  90. /package/dist/{chunk-HS4YYQA6.js.map → chunk-OIKZDXNW.js.map} +0 -0
  91. /package/dist/{chunk-55M4LRMY.js.map → chunk-OJZW3GE2.js.map} +0 -0
  92. /package/dist/{chunk-5EEUZULX.js.map → chunk-Q2CNCBMK.js.map} +0 -0
  93. /package/dist/{chunk-JOMGPWBN.js.map → chunk-R2UDEMKK.js.map} +0 -0
  94. /package/dist/{chunk-SPUW2YXQ.js.map → chunk-ROOIHDLS.js.map} +0 -0
@@ -95,15 +95,14 @@ export interface OGLinkPreviewProps {
95
95
  * (the card then degrades to a favicon+title chip when no scraped image
96
96
  * is available). The hub injects its `buildOgPlaceholderUrl` here. */
97
97
  buildPlaceholderUrl?: BuildPlaceholderUrl;
98
- /** CURATED title — our own copy for this link (e.g. a CMS-managed press
99
- * row). Wins over the scrape; see the precedence rule on the component. */
100
- curatedTitle?: string;
101
- /** CURATED description. Wins over the scrape. */
102
- curatedDescription?: string;
103
- /** CURATED cover image. Wins over the scrape — an outlet's og:image is a
104
- * fallback for links we have no cover for, never an override of one we
105
- * deliberately chose. */
106
- curatedImage?: string;
98
+ /** Override the scraped title (used by publication cards that already know
99
+ * the title locally — e.g. a CMS-managed press link). */
100
+ fallbackTitle?: string;
101
+ /** Override the scraped description. */
102
+ fallbackDescription?: string;
103
+ /** Override the scraped image — useful when the scrape returns no image but
104
+ * the embedder has a CMS-stored hero image to fall back to. */
105
+ fallbackImage?: string;
107
106
  /** Publication / source name shown alongside the favicon (e.g. "TechCrunch"). */
108
107
  publicationName?: string;
109
108
  /** Publication logo URL shown alongside the title (defaults to favicon). */
@@ -174,35 +173,23 @@ const Favicon = ({ src, size = 'w-6 h-6' }: { src: string; size?: string }) => (
174
173
  * RFC1918 ranges — those render as plain `<a>` tags).
175
174
  * 2. `GET ogEndpointPath?url=<encoded>` — embedder serves the shape declared
176
175
  * in `OGData`.
177
- * 3. Resolve the image by the PRECEDENCE rule below.
176
+ * 3. Resolve image: scraped og:image → `originalImage` fallback → `fallbackImage`
177
+ * prop → `buildPlaceholderUrl(title, siteName)`. Each step has its own
178
+ * error toggle so a 404 / CORS-tainted image gracefully degrades.
178
179
  * 4. Extract a letterbox background color from the resolved image via
179
180
  * `useImageEdgeColor`. Same-origin proxy is REQUIRED for cross-origin
180
181
  * images so the `<canvas>` extraction doesn't taint.
181
182
  * 5. Render compact (h-[120px] horizontal) or default (vertical w/ aspect-video
182
183
  * hero) variant, with image-less degraded variants for each.
183
- *
184
- * PRECEDENCE — curated over scraped, for EVERY field alike. A `curated*` prop
185
- * is a value we chose ourselves; the scrape only fills what curation left
186
- * empty:
187
- *
188
- * curatedImage → scraped og:image → scraped originalImage → placeholder
189
- *
190
- * The image chain used to invert this — any outlet og:image beat an uploaded
191
- * cover — so a deliberate editorial choice was silently overridden wherever
192
- * the outlet happened to publish one, while title and description read
193
- * curated-first 200 lines down. The chain is now expressed ONCE, as
194
- * `imageCandidates`, and `handleImageError` retires the candidate currently on
195
- * screen instead of restating the order: a positional error handler is how the
196
- * two halves drift apart.
197
184
  */
198
185
  export const OGLinkPreview: React.FC<OGLinkPreviewProps> = ({
199
186
  url,
200
187
  apiBaseUrl,
201
188
  ogEndpointPath = '/api/og-scraper',
202
189
  buildPlaceholderUrl,
203
- curatedTitle,
204
- curatedDescription,
205
- curatedImage,
190
+ fallbackTitle,
191
+ fallbackDescription,
192
+ fallbackImage,
206
193
  publicationName,
207
194
  publicationLogo,
208
195
  variant = 'default',
@@ -211,9 +198,9 @@ export const OGLinkPreview: React.FC<OGLinkPreviewProps> = ({
211
198
  const [ogData, setOgData] = useState<OGData | null>(null);
212
199
  const [loading, setLoading] = useState(true);
213
200
  const [error, setError] = useState(false);
214
- /** URLs that failed to load. Keyed by url, so the candidate order below is
215
- * the single owner of precedence. */
216
- const [failedImages, setFailedImages] = useState<ReadonlySet<string>>(new Set());
201
+ const [imageError, setImageError] = useState(false);
202
+ const [originalImageError, setOriginalImageError] = useState(false);
203
+ const [fallbackImageError, setFallbackImageError] = useState(false);
217
204
 
218
205
  let isValidUrl = true;
219
206
  let isLocalhost = false;
@@ -304,8 +291,8 @@ export const OGLinkPreview: React.FC<OGLinkPreviewProps> = ({
304
291
  ogData ??
305
292
  (error
306
293
  ? {
307
- title: curatedTitle || domainToTitle(domain),
308
- description: curatedDescription || domain,
294
+ title: fallbackTitle || domainToTitle(domain),
295
+ description: fallbackDescription || domain,
309
296
  image: '',
310
297
  url,
311
298
  siteName: publicationName || domain,
@@ -321,24 +308,18 @@ export const OGLinkPreview: React.FC<OGLinkPreviewProps> = ({
321
308
  ? buildPlaceholderUrl(effectiveData.title, effectiveData.siteName || domain)
322
309
  : null;
323
310
 
324
- // THE precedence rule, in one place (see the component doc). Each candidate
325
- // carries its SLOT, so the winner is identified by where it came from and
326
- // never by string-comparing the resolved url back against the inputs: two
327
- // slots can legitimately hold the same url (an embedder passing the outlet's
328
- // own image as `curatedImage`), and `===` would then pick the render branch
329
- // by coincidence.
330
- const imageCandidates: { source: 'curated' | 'og' | 'og-original' | 'placeholder'; url?: string | null }[] = [
331
- { source: 'curated', url: curatedImage },
332
- { source: 'og', url: effectiveData?.image },
333
- { source: 'og-original', url: effectiveData?.originalImage },
334
- { source: 'placeholder', url: placeholderImageUrl },
335
- ];
336
- const resolvedImage = imageCandidates.find(c => !!c.url && !failedImages.has(c.url)) ?? null;
337
- const resolvedImageUrl = resolvedImage?.url ?? null;
311
+ const resolvedImageUrl =
312
+ effectiveData?.image && !imageError
313
+ ? effectiveData.image
314
+ : effectiveData?.originalImage && !originalImageError
315
+ ? effectiveData.originalImage
316
+ : fallbackImage && !fallbackImageError
317
+ ? fallbackImage
318
+ : placeholderImageUrl;
338
319
 
339
320
  const hasImage = !!resolvedImageUrl;
340
- const isCuratedImage = resolvedImage?.source === 'curated';
341
- const isPlaceholder = resolvedImage?.source === 'placeholder';
321
+ const isFallbackImage = resolvedImageUrl === fallbackImage;
322
+ const isPlaceholder = resolvedImageUrl === placeholderImageUrl && !isFallbackImage;
342
323
  const bgColor = useImageEdgeColor(resolvedImageUrl ?? null, 'var(--color-bg-surface)');
343
324
 
344
325
  const renderSkeleton = () =>
@@ -408,21 +389,19 @@ export const OGLinkPreview: React.FC<OGLinkPreviewProps> = ({
408
389
  if (loading) return renderSkeleton();
409
390
  if (!effectiveData) return renderSkeleton();
410
391
 
411
- const title = curatedTitle || effectiveData.title;
392
+ const title = fallbackTitle || effectiveData.title;
412
393
  // Empty string when the scrape returned nothing — descriptions render
413
394
  // conditionally below. Avoids the legacy `'No description available'` filler
414
395
  // that signaled "broken card" to users.
415
- const description = curatedDescription || effectiveData.description || '';
396
+ const description = fallbackDescription || effectiveData.description || '';
416
397
  const ogDomain = getDomain(effectiveData.url);
417
398
  const faviconSrc = effectiveData.favicon || `https://www.google.com/s2/favicons?domain=${ogDomain}&sz=32`;
418
399
  const logoSrc = publicationLogo || faviconSrc;
419
400
 
420
- // Retire whichever candidate is on screen; the next one down the chain
421
- // takes over on the re-render. Never restate the order here.
422
401
  const handleImageError = () => {
423
- const failed = resolvedImageUrl;
424
- if (!failed) return;
425
- setFailedImages(prev => (prev.has(failed) ? prev : new Set(prev).add(failed)));
402
+ if (effectiveData.image && !imageError) setImageError(true);
403
+ else if (effectiveData.originalImage && !originalImageError) setOriginalImageError(true);
404
+ else setFallbackImageError(true);
426
405
  };
427
406
 
428
407
  const renderImage = () => {
@@ -432,7 +411,7 @@ export const OGLinkPreview: React.FC<OGLinkPreviewProps> = ({
432
411
  <Image src={resolvedImageUrl} alt={title} className="rounded-md object-cover" fill sizes="100vw" unoptimized />
433
412
  );
434
413
  }
435
- if (isCuratedImage) {
414
+ if (isFallbackImage) {
436
415
  return (
437
416
  <Image
438
417
  src={resolvedImageUrl}