@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.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/CustomMessage/StreamAttachmentMessage.test.tsx +46 -0
- package/src/components/CustomMessage/StreamAttachmentMessage.tsx +10 -2
- package/src/components/MediaMessage/index.tsx +5 -3
- package/src/components/MediaMessage/isLinkAttachment.test.ts +14 -2
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
|
-
*
|
|
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()
|
|
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.
|
|
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:
|
|
2361
|
-
layout: n || En(
|
|
2362
|
-
mimeType:
|
|
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
|
};
|