@linktr.ee/messaging-react 4.0.0 → 4.0.1-rc-1786428994
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/{Card-DNfF_nfR.js → Card-CTyW9Kgf.js} +2 -2
- package/dist/{Card-DNfF_nfR.js.map → Card-CTyW9Kgf.js.map} +1 -1
- package/dist/{Card-BH865r-V.cjs → Card-Uf-xzlU1.cjs} +2 -2
- package/dist/{Card-BH865r-V.cjs.map → Card-Uf-xzlU1.cjs.map} +1 -1
- package/dist/{index-Dyxu8r07.js → index-BMcKJFQs.js} +6 -6
- package/dist/{index-Dyxu8r07.js.map → index-BMcKJFQs.js.map} +1 -1
- package/dist/{index-B0CZqFER.cjs → index-JMYJWHTI.cjs} +3 -3
- package/dist/{index-B0CZqFER.cjs.map → index-JMYJWHTI.cjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/RichCard/RichCardBody.tsx +7 -2
- package/src/components/RichCard/RichCardImages.tsx +21 -10
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-JMYJWHTI.cjs");exports.ActionButton=e.ActionButton;exports.Avatar=e.Avatar;exports.ChannelEmptyState=e.ChannelEmptyState;exports.ChannelList=e.ChannelList;exports.ChannelView=e.ChannelView;exports.CustomMessageProvider=e.CustomMessageProvider;exports.FaqList=e.FaqList;exports.FaqListItem=e.FaqListItem;exports.LinkAttachment=e.LinkAttachment;exports.LockedAttachment=e.LockedAttachment;exports.MediaMessage=e.MediaMessage;exports.MessageAttachment=e.MessageAttachment;exports.MessageBubble=e.MessageBubble;exports.MessagingProvider=e.MessagingProvider;exports.MessagingShell=e.MessagingShell;exports.RichCard=e.RichCard;exports.buildCompactMetaLabel=e.buildCompactMetaLabel;exports.formatFileSize=e.formatFileSize;exports.formatRelativeTime=e.formatRelativeTime;exports.getFileExtensionLabel=e.getFileExtensionLabel;exports.getMessageDisplayText=e.getMessageDisplayText;exports.isLinkAttachment=e.isLinkAttachment;exports.isUuidLike=e.isUuidLike;exports.messageAttachmentGroupPositionFromStream=e.bubbleGroupPositionFromStream;exports.normalizeLanguageCode=e.normalizeLanguageCode;exports.optimizeMessagingAttachmentUrl=e.optimizeMessagingAttachmentUrl;exports.resolveConversationParticipant=e.resolveConversationParticipant;exports.resolveLinkAttachment=e.resolveLinkAttachment;exports.resolveMediaFromMessage=e.resolveMediaFromMessage;exports.resolveParticipantDisplayName=e.resolveParticipantDisplayName;exports.useComposerLocked=e.useComposerLocked;exports.useCustomMessage=e.useCustomMessage;exports.useMessaging=e.useMessaging;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, b as t, C as i, c as n, d as o, e as m, F as r, f as l, L as g, h as c, M, i as h, j as L, k as u, l as d, R as p, m as C, n as v, p as A, q as k, s as F, t as b, u as P, v as f, w as x, o as y, x as z, y as S, z as q, B, D, E, G as R } from "./index-
|
|
1
|
+
import { a as e, b as t, C as i, c as n, d as o, e as m, F as r, f as l, L as g, h as c, M, i as h, j as L, k as u, l as d, R as p, m as C, n as v, p as A, q as k, s as F, t as b, u as P, v as f, w as x, o as y, x as z, y as S, z as q, B, D, E, G as R } from "./index-BMcKJFQs.js";
|
|
2
2
|
export {
|
|
3
3
|
e as ActionButton,
|
|
4
4
|
t as Avatar,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linktr.ee/messaging-react",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1-rc-1786428994",
|
|
4
4
|
"description": "React messaging components built on messaging-core for web applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"chromatic:local": "yarn storybook:build && chromatic"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@linktr.ee/messaging-core": "
|
|
53
|
+
"@linktr.ee/messaging-core": "2.4.0-rc-1786428994",
|
|
54
54
|
"@linktr.ee/messaging-taxonomy": "^0.9.0",
|
|
55
55
|
"@phosphor-icons/react": "^2.1.10"
|
|
56
56
|
},
|
|
@@ -21,9 +21,14 @@ export interface RichCardBodyProps {
|
|
|
21
21
|
// Mirror LinkAttachment's `CardBody` type scales so the two cards read
|
|
22
22
|
// identically (14/20 medium title, 12/16 subtitle). Colour is always supplied
|
|
23
23
|
// via `chinTextColor`, so no per-variant text class is needed here.
|
|
24
|
+
// `[text-wrap:balance]` evens the title's line lengths so a two-line title
|
|
25
|
+
// doesn't drop a single word onto its own line; `[text-wrap:pretty]` does the
|
|
26
|
+
// lighter last-line-widow fix for the longer subtitle prose. Arbitrary-property
|
|
27
|
+
// form so the utilities generate regardless of the consumer's Tailwind version.
|
|
24
28
|
const TITLE_CLASS =
|
|
25
|
-
'line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px]'
|
|
26
|
-
const SUBTITLE_CLASS =
|
|
29
|
+
'line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text-wrap:balance]'
|
|
30
|
+
const SUBTITLE_CLASS =
|
|
31
|
+
'text-[12px] leading-4 tracking-[0.24px] [text-wrap:pretty]'
|
|
27
32
|
|
|
28
33
|
/**
|
|
29
34
|
* The action footer. `layout` (chosen by the first action's `variant` in
|
|
@@ -33,10 +33,14 @@ const FAN_ROTATION: Record<1 | 2 | 3, number[]> = {
|
|
|
33
33
|
2: [-10, 10],
|
|
34
34
|
3: [-13, 0, 13],
|
|
35
35
|
}
|
|
36
|
+
// Offsets sit a hair inside the mobile renderer's so the outer tiles' rotated
|
|
37
|
+
// bounding box stays within the 290px shell's `overflow-hidden` edge (a `w-62%`
|
|
38
|
+
// tile at ±40 + 13° rotation lands ~6px shy of the boundary, vs the old ±44
|
|
39
|
+
// which clipped).
|
|
36
40
|
const FAN_OFFSET_PX: Record<1 | 2 | 3, number[]> = {
|
|
37
41
|
1: [0],
|
|
38
|
-
2: [-
|
|
39
|
-
3: [-
|
|
42
|
+
2: [-26, 26],
|
|
43
|
+
3: [-40, 0, 40],
|
|
40
44
|
}
|
|
41
45
|
// Paint z-order per slot so the **centre** card sits on top. Survivors render
|
|
42
46
|
// left→right, so with the naive `zIndex: position` the right card overlaps the
|
|
@@ -110,14 +114,21 @@ const RichCardFan: React.FC<{
|
|
|
110
114
|
loading="lazy"
|
|
111
115
|
decoding="async"
|
|
112
116
|
onError={() => setFailed((prev) => ({ ...prev, [index]: true }))}
|
|
113
|
-
// A uniform, slightly-landscape tile (`
|
|
114
|
-
//
|
|
115
|
-
//
|
|
116
|
-
// crop reads better than
|
|
117
|
-
//
|
|
118
|
-
//
|
|
119
|
-
//
|
|
120
|
-
|
|
117
|
+
// A uniform, slightly-landscape tile (`w-62% aspect-[3/2]`, matching
|
|
118
|
+
// the mobile renderer) with `object-cover` so the fan stays tidy
|
|
119
|
+
// whatever the source thumbnails are (OG scrape, upload, video frame)
|
|
120
|
+
// — the tiles are decorative, so an even cover crop reads better than
|
|
121
|
+
// per-image aspect. `rounded-[12px]` explicit, NOT `rounded-xl` — this
|
|
122
|
+
// preset's `xl` radius is 4rem, which rounds a tile into an oval.
|
|
123
|
+
// `bg-[#ffffff]` gives each tile an opaque holder so a transparent
|
|
124
|
+
// (PNG/WebP) source composites over white instead of letting the
|
|
125
|
+
// fan-region tint and the tiles beneath bleed through — and so the
|
|
126
|
+
// drop shadow reads against a solid card, not the see-through image.
|
|
127
|
+
// Arbitrary hex, not `bg-white`, since this package ships no Tailwind
|
|
128
|
+
// utilities and consumers scan `dist` against their own theme (same
|
|
129
|
+
// reason CardShell uses `bg-[#…]`). `shadow-md` (not `shadow-lg`)
|
|
130
|
+
// keeps the elevation subtle, matching mobile's `Shadow100`.
|
|
131
|
+
className="absolute left-1/2 top-1/2 w-[62%] aspect-[3/2] rounded-[12px] bg-[#ffffff] object-cover shadow-md"
|
|
121
132
|
style={{
|
|
122
133
|
transform: `translate(-50%, -50%) translateX(${offsets[position]}px) rotate(${rotations[position]}deg) scale(${scales[position]})`,
|
|
123
134
|
zIndex: zorder[position],
|