@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.
- package/dist/{chunk-2R36JUKN.js → chunk-25YIHMZ6.js} +2 -2
- package/dist/{chunk-DOIBUVVN.js → chunk-2QBXG74C.js} +5 -5
- package/dist/{chunk-IRUSFKE4.cjs → chunk-2YMDDD5V.cjs} +3 -3
- package/dist/{chunk-IRUSFKE4.cjs.map → chunk-2YMDDD5V.cjs.map} +1 -1
- package/dist/{chunk-D4R3QSNG.js → chunk-37CAZTLP.js} +4 -4
- package/dist/{chunk-DV4UKIPN.cjs → chunk-C4KQ2XPK.cjs} +13 -13
- package/dist/{chunk-DV4UKIPN.cjs.map → chunk-C4KQ2XPK.cjs.map} +1 -1
- package/dist/{chunk-24KS3ZL3.cjs → chunk-EANAFFAD.cjs} +17 -17
- package/dist/{chunk-24KS3ZL3.cjs.map → chunk-EANAFFAD.cjs.map} +1 -1
- package/dist/{chunk-NWET25AT.cjs → chunk-FASOANK7.cjs} +4 -4
- package/dist/{chunk-NWET25AT.cjs.map → chunk-FASOANK7.cjs.map} +1 -1
- package/dist/{chunk-QI2CAZES.js → chunk-FS3CTGIR.js} +2 -2
- package/dist/{chunk-ROBMD5C5.cjs → chunk-GFAHCXIL.cjs} +10 -10
- package/dist/{chunk-ROBMD5C5.cjs.map → chunk-GFAHCXIL.cjs.map} +1 -1
- package/dist/{chunk-UZQ25ZD6.cjs → chunk-GNLV326I.cjs} +4 -4
- package/dist/{chunk-UZQ25ZD6.cjs.map → chunk-GNLV326I.cjs.map} +1 -1
- package/dist/{chunk-4MOB63HI.cjs → chunk-HKJ3WKGW.cjs} +320 -325
- package/dist/chunk-HKJ3WKGW.cjs.map +1 -0
- package/dist/{chunk-CEW2A4PV.js → chunk-HQSCJYCF.js} +2 -2
- package/dist/{chunk-QQYV4CMH.js → chunk-HZS4TV34.js} +5 -5
- package/dist/{chunk-VFYAJDFR.js → chunk-IBMHEOBV.js} +2 -2
- package/dist/{chunk-LLYGTLJ4.js → chunk-MGXSJI23.js} +2 -2
- package/dist/{chunk-THAE6Y2T.js → chunk-O6PO5BHE.js} +4 -4
- package/dist/{chunk-HS4YYQA6.js → chunk-OIKZDXNW.js} +2 -2
- package/dist/{chunk-55M4LRMY.js → chunk-OJZW3GE2.js} +2 -2
- package/dist/{chunk-DQHAT6VG.cjs → chunk-OVVKVIMH.cjs} +34 -34
- package/dist/{chunk-DQHAT6VG.cjs.map → chunk-OVVKVIMH.cjs.map} +1 -1
- package/dist/{chunk-5EEUZULX.js → chunk-Q2CNCBMK.js} +3 -3
- package/dist/{chunk-CFJFWJG7.cjs → chunk-Q3APHZK5.cjs} +17 -17
- package/dist/{chunk-CFJFWJG7.cjs.map → chunk-Q3APHZK5.cjs.map} +1 -1
- package/dist/{chunk-WMFG2QJ2.cjs → chunk-QE2Z6WME.cjs} +33 -33
- package/dist/{chunk-WMFG2QJ2.cjs.map → chunk-QE2Z6WME.cjs.map} +1 -1
- package/dist/{chunk-JOMGPWBN.js → chunk-R2UDEMKK.js} +2 -2
- package/dist/{chunk-SPUW2YXQ.js → chunk-ROOIHDLS.js} +2 -2
- package/dist/{chunk-O5FEBR3Q.cjs → chunk-THCB7NHV.cjs} +3 -3
- package/dist/{chunk-O5FEBR3Q.cjs.map → chunk-THCB7NHV.cjs.map} +1 -1
- package/dist/{chunk-IIE5NCTX.cjs → chunk-THCSSPXU.cjs} +50 -50
- package/dist/{chunk-IIE5NCTX.cjs.map → chunk-THCSSPXU.cjs.map} +1 -1
- package/dist/{chunk-PI7AV4GT.cjs → chunk-UFFVMZDL.cjs} +3 -3
- package/dist/{chunk-PI7AV4GT.cjs.map → chunk-UFFVMZDL.cjs.map} +1 -1
- package/dist/{chunk-AQABZFS2.js → chunk-V6TINNLD.js} +18 -23
- package/dist/chunk-V6TINNLD.js.map +1 -0
- package/dist/{chunk-QQ5G6PM4.cjs → chunk-WJQOYSR3.cjs} +3 -3
- package/dist/{chunk-QQ5G6PM4.cjs.map → chunk-WJQOYSR3.cjs.map} +1 -1
- package/dist/{chunk-GEKWQVSG.cjs → chunk-ZDLCWNM6.cjs} +18 -18
- package/dist/{chunk-GEKWQVSG.cjs.map → chunk-ZDLCWNM6.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +8 -8
- package/dist/components/case-studies/index.js +2 -2
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/docs/index.cjs +6 -6
- package/dist/components/docs/index.js +5 -5
- package/dist/components/embeds/index.cjs +3 -3
- package/dist/components/embeds/index.js +2 -2
- package/dist/components/embeds/og-link-preview.d.ts +11 -24
- package/dist/components/embeds/og-link-preview.d.ts.map +1 -1
- package/dist/components/faq/index.cjs +3 -3
- package/dist/components/faq/index.js +2 -2
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/help-center-pages/index.cjs +22 -22
- package/dist/components/help-center-pages/index.js +13 -13
- package/dist/components/index.cjs +31 -31
- package/dist/components/index.js +12 -12
- package/dist/components/meeting-scheduler/index.cjs +21 -21
- package/dist/components/meeting-scheduler/index.js +1 -1
- package/dist/components/navigation/index.cjs +5 -5
- package/dist/components/navigation/index.js +4 -4
- package/dist/components/onboarding-guides/index.cjs +5 -5
- package/dist/components/onboarding-guides/index.js +4 -4
- package/dist/components/tickets/index.cjs +6 -6
- package/dist/components/tickets/index.js +5 -5
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.js +5 -5
- package/package.json +1 -1
- package/src/components/embeds/og-link-preview.tsx +35 -56
- package/dist/chunk-4MOB63HI.cjs.map +0 -1
- package/dist/chunk-AQABZFS2.js.map +0 -1
- /package/dist/{chunk-2R36JUKN.js.map → chunk-25YIHMZ6.js.map} +0 -0
- /package/dist/{chunk-DOIBUVVN.js.map → chunk-2QBXG74C.js.map} +0 -0
- /package/dist/{chunk-D4R3QSNG.js.map → chunk-37CAZTLP.js.map} +0 -0
- /package/dist/{chunk-QI2CAZES.js.map → chunk-FS3CTGIR.js.map} +0 -0
- /package/dist/{chunk-CEW2A4PV.js.map → chunk-HQSCJYCF.js.map} +0 -0
- /package/dist/{chunk-QQYV4CMH.js.map → chunk-HZS4TV34.js.map} +0 -0
- /package/dist/{chunk-VFYAJDFR.js.map → chunk-IBMHEOBV.js.map} +0 -0
- /package/dist/{chunk-LLYGTLJ4.js.map → chunk-MGXSJI23.js.map} +0 -0
- /package/dist/{chunk-THAE6Y2T.js.map → chunk-O6PO5BHE.js.map} +0 -0
- /package/dist/{chunk-HS4YYQA6.js.map → chunk-OIKZDXNW.js.map} +0 -0
- /package/dist/{chunk-55M4LRMY.js.map → chunk-OJZW3GE2.js.map} +0 -0
- /package/dist/{chunk-5EEUZULX.js.map → chunk-Q2CNCBMK.js.map} +0 -0
- /package/dist/{chunk-JOMGPWBN.js.map → chunk-R2UDEMKK.js.map} +0 -0
- /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
|
-
/**
|
|
99
|
-
*
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
*
|
|
105
|
-
|
|
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
|
|
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
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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
|
-
|
|
215
|
-
|
|
216
|
-
const [
|
|
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:
|
|
308
|
-
description:
|
|
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
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
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
|
|
341
|
-
const isPlaceholder =
|
|
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 =
|
|
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 =
|
|
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
|
-
|
|
424
|
-
if (!
|
|
425
|
-
|
|
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 (
|
|
414
|
+
if (isFallbackImage) {
|
|
436
415
|
return (
|
|
437
416
|
<Image
|
|
438
417
|
src={resolvedImageUrl}
|