@linktr.ee/messaging-react 4.4.5 → 4.4.6-rc-1788234121
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 +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/CustomMessage/StreamAttachmentMessage.stories.tsx +14 -0
- package/src/components/CustomMessage/StreamAttachmentMessage.test.tsx +27 -0
- package/src/components/CustomMessage/StreamAttachmentMessage.tsx +9 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linktr.ee/messaging-react",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.6-rc-1788234121",
|
|
4
4
|
"description": "React messaging components built on messaging-core for web applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"chromatic:local": "yarn storybook:build && chromatic"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@linktr.ee/messaging-core": "
|
|
54
|
-
"@linktr.ee/messaging-taxonomy": "
|
|
53
|
+
"@linktr.ee/messaging-core": "2.6.0-rc-1788234121",
|
|
54
|
+
"@linktr.ee/messaging-taxonomy": "0.11.0-rc-1788234121",
|
|
55
55
|
"@phosphor-icons/react": "^2.1.10"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
@@ -109,6 +109,20 @@ export const LinkClassic = Render([
|
|
|
109
109
|
linkAttachment({ image_url: undefined, thumb_url: undefined }),
|
|
110
110
|
])
|
|
111
111
|
|
|
112
|
+
/** Two link shares stacked in one message. */
|
|
113
|
+
export const MultipleLinks = Render([
|
|
114
|
+
linkAttachment({
|
|
115
|
+
og_scrape_url: 'https://linktr.ee/marketplace',
|
|
116
|
+
title: 'Linktree Marketplace',
|
|
117
|
+
image_url: HERO,
|
|
118
|
+
}),
|
|
119
|
+
linkAttachment({
|
|
120
|
+
og_scrape_url: 'https://linktr.ee/creator',
|
|
121
|
+
title: 'Creator profile',
|
|
122
|
+
image_url: PHOTO('multiple-links'),
|
|
123
|
+
}),
|
|
124
|
+
])
|
|
125
|
+
|
|
112
126
|
/**
|
|
113
127
|
* Link share with an emoji-only caption alongside the URL. The emoji is
|
|
114
128
|
* real content, so the caption is preserved as a separate bubble beneath
|
|
@@ -95,6 +95,33 @@ describe('linkCaptionDuplicatesAttachmentUrl', () => {
|
|
|
95
95
|
})
|
|
96
96
|
|
|
97
97
|
describe('StreamAttachmentMessage', () => {
|
|
98
|
+
it('spaces multiple link cards inside the attachment rows wrapper', () => {
|
|
99
|
+
renderWithProviders(
|
|
100
|
+
<StreamAttachmentMessage
|
|
101
|
+
groupPosition="single"
|
|
102
|
+
isMyMessage={true}
|
|
103
|
+
message={message([
|
|
104
|
+
{
|
|
105
|
+
type: 'link',
|
|
106
|
+
og_scrape_url: 'https://linktr.ee/first',
|
|
107
|
+
title: 'First Link',
|
|
108
|
+
image_url: 'https://cdn.example.com/first.jpg',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
type: 'link',
|
|
112
|
+
og_scrape_url: 'https://linktr.ee/second',
|
|
113
|
+
title: 'Second Link',
|
|
114
|
+
image_url: 'https://cdn.example.com/second.jpg',
|
|
115
|
+
},
|
|
116
|
+
])}
|
|
117
|
+
/>
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
const rows = screen.getByTestId('message-attachment-rows')
|
|
121
|
+
expect(rows).toHaveClass('flex', 'flex-col', 'gap-[4px]')
|
|
122
|
+
expect(within(rows).getAllByTestId('link-card')).toHaveLength(2)
|
|
123
|
+
})
|
|
124
|
+
|
|
98
125
|
it('renders a sent link card and suppresses a URL-only caption', () => {
|
|
99
126
|
renderWithProviders(
|
|
100
127
|
<StreamAttachmentMessage
|
|
@@ -424,7 +424,15 @@ const StreamAttachmentMessage: React.FC<StreamAttachmentMessageProps> = ({
|
|
|
424
424
|
padding: 0,
|
|
425
425
|
}}
|
|
426
426
|
>
|
|
427
|
-
|
|
427
|
+
<div
|
|
428
|
+
data-testid="message-attachment-rows"
|
|
429
|
+
className={classNames(
|
|
430
|
+
'flex flex-col gap-[4px]',
|
|
431
|
+
isMyMessage ? 'items-end' : 'items-start'
|
|
432
|
+
)}
|
|
433
|
+
>
|
|
434
|
+
{rows}
|
|
435
|
+
</div>
|
|
428
436
|
{!caption && <MessageErrorIcon />}
|
|
429
437
|
</div>
|
|
430
438
|
{caption ? (
|