@linktr.ee/messaging-react 4.4.4 → 4.4.5-rc-1788226564

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/index.d.ts CHANGED
@@ -601,8 +601,10 @@ declare type ImageLoadingMode = 'lazy' | 'eager';
601
601
 
602
602
  /**
603
603
  * True when an attachment is a link preview (OG card) rather than media:
604
- * either Stream's native `link` type, or a non-empty (trimmed) `og_scrape_url`
605
- * with no `asset_url`. A whitespace-only `og_scrape_url` is not a link.
604
+ * either Stream's native `link` type, or a non-empty (trimmed) `og_scrape_url`.
605
+ * A whitespace-only `og_scrape_url` is not a link. Only enrichment sets
606
+ * `og_scrape_url`, so it stays authoritative even when the scrape also filled
607
+ * `asset_url` with a preview clip (Spotify).
606
608
  */
607
609
  export declare function isLinkAttachment(a: Attachment): boolean;
608
610
 
package/dist/index.js CHANGED
@@ -705,7 +705,7 @@ function Ot({ message: e, viewerLanguage: t }) {
705
705
  //#endregion
706
706
  //#region src/components/MediaMessage/index.tsx
707
707
  function kt(e) {
708
- return e.type === "link" || !!e.og_scrape_url?.trim() && !e.asset_url;
708
+ return e.type === "link" || !!e.og_scrape_url?.trim();
709
709
  }
710
710
  //#endregion
711
711
  //#region src/components/CustomMessage/context.tsx
@@ -2351,15 +2351,15 @@ function ti(e, t) {
2351
2351
  return !/[^\p{P}\p{Z}\p{C}]/u.test(i);
2352
2352
  }
2353
2353
  function ni(e) {
2354
- let t = $(e.og_scrape_url) ?? $(e.title_link), n = $(e.image_url) ?? $(e.thumb_url), r = $(e.asset_url), i = $(e.mime_type);
2354
+ let t = $(e.og_scrape_url) ?? $(e.title_link), n = $(e.image_url) ?? $(e.thumb_url), r = $(e.mime_type), i = $(e.asset_url), o = n && Tn(r, i) ? void 0 : i;
2355
2355
  return {
2356
2356
  title: $(e.title),
2357
2357
  description: $(e.text),
2358
2358
  url: t,
2359
2359
  thumbnailUrl: a(n),
2360
- sourceUrl: r,
2361
- layout: n || En(i, r) ? "featured" : "classic",
2362
- mimeType: i,
2360
+ sourceUrl: o,
2361
+ layout: n || En(r, o) ? "featured" : "classic",
2362
+ mimeType: r,
2363
2363
  accentColor: $(e.accent_color),
2364
2364
  status: "ready"
2365
2365
  };