@linktr.ee/messaging-react 4.2.0-rc-1787181256 → 4.2.0-rc-1787239893
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-CMYD4qIB.js → Card-pnqpS46t.js} +2 -2
- package/dist/{Card-CMYD4qIB.js.map → Card-pnqpS46t.js.map} +1 -1
- package/dist/{index-pjcNrxVo.js → index-CT_7H4Gc.js} +8 -4
- package/dist/index-CT_7H4Gc.js.map +1 -0
- package/dist/index-D9hvmfn3.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +6 -6
- package/src/components/AttachmentCard/utils/icons.ts +6 -7
- package/src/components/ChannelView.test.tsx +9 -3
- package/src/components/CustomMessage/StreamAttachmentMessage.tsx +5 -6
- package/src/components/CustomSystemMessage/index.tsx +3 -2
- package/src/components/RichCard/RichCard.test.tsx +3 -1
- package/src/providers/MessagingProvider.test.tsx +3 -1
- package/src/stories/customMessageStoryTemplate.tsx +4 -1
- package/src/styles.css +2 -1
- package/dist/index-pjcNrxVo.js.map +0 -1
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 g, F as r, f as m, L as l, h as M, M as c, i as L, j as h, k as p, l as u, m as d, R as v, T as C, n as A, p as k, q as F, s as b, t as P, u as T, v as f, w as x, x as y, y as z, o as S, z as q, B, D, E, G as R, H as w, I as G, J as I } from "./index-
|
|
1
|
+
import { a as e, b as t, C as i, c as n, d as o, e as g, F as r, f as m, L as l, h as M, M as c, i as L, j as h, k as p, l as u, m as d, R as v, T as C, n as A, p as k, q as F, s as b, t as P, u as T, v as f, w as x, x as y, y as z, o as S, z as q, B, D, E, G as R, H as w, I as G, J as I } from "./index-CT_7H4Gc.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.2.0-rc-
|
|
3
|
+
"version": "4.2.0-rc-1787239893",
|
|
4
4
|
"description": "React messaging components built on messaging-core for web applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"test:ci": "vitest run",
|
|
41
41
|
"test:ui": "vitest --ui",
|
|
42
42
|
"test:coverage": "vitest --coverage",
|
|
43
|
-
"lint": "npx --no-install eslint
|
|
44
|
-
"lint:fix": "npx --no-install eslint
|
|
43
|
+
"lint": "cd \"$PROJECT_CWD\" && npx --no-install eslint packages/messaging-react",
|
|
44
|
+
"lint:fix": "cd \"$PROJECT_CWD\" && npx --no-install eslint packages/messaging-react --fix",
|
|
45
45
|
"verify": "yarn type-check && yarn lint && yarn test:ci && yarn build",
|
|
46
46
|
"storybook": "storybook dev -p 6006",
|
|
47
47
|
"storybook:build": "storybook build --stats-json",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"chromatic:local": "yarn storybook:build && chromatic"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@linktr.ee/messaging-core": "2.5.0-rc-
|
|
53
|
+
"@linktr.ee/messaging-core": "2.5.0-rc-1787239893",
|
|
54
54
|
"@linktr.ee/messaging-taxonomy": "^0.10.0",
|
|
55
55
|
"@phosphor-icons/react": "^2.1.10"
|
|
56
56
|
},
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@types/react": "^18.3.24",
|
|
72
72
|
"@types/react-dom": "^18.3.7",
|
|
73
73
|
"@vitejs/plugin-react": "^4.2.1",
|
|
74
|
-
"@vitest/ui": "^1.
|
|
74
|
+
"@vitest/ui": "^4.1.10",
|
|
75
75
|
"autoprefixer": "^10.4.20",
|
|
76
76
|
"chromatic": "^17.4.0",
|
|
77
77
|
"classnames": "^2.3.2",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"typescript": "5.9.2",
|
|
88
88
|
"vite": "^6.0.7",
|
|
89
89
|
"vite-plugin-dts": "^3.7.0",
|
|
90
|
-
"vitest": "^1.
|
|
90
|
+
"vitest": "^4.1.10"
|
|
91
91
|
},
|
|
92
92
|
"peerDependencies": {
|
|
93
93
|
"classnames": "^2.3.2",
|
|
@@ -18,13 +18,12 @@ import React from 'react'
|
|
|
18
18
|
import { getDocumentIconType, getSourceType } from './mimeType'
|
|
19
19
|
import type { AttachmentSourceType } from './mimeType'
|
|
20
20
|
|
|
21
|
-
const MEDIA_TYPE_ICON: Record<AttachmentSourceType, React.ElementType> =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
21
|
+
const MEDIA_TYPE_ICON: Record<AttachmentSourceType, React.ElementType> = {
|
|
22
|
+
video: VideoCameraIcon,
|
|
23
|
+
audio: SpeakerHighIcon,
|
|
24
|
+
image: ImageIcon,
|
|
25
|
+
document: FileIcon,
|
|
26
|
+
}
|
|
28
27
|
|
|
29
28
|
const DOCUMENT_ICON_COMPONENT = {
|
|
30
29
|
pdf: FilePdfIcon,
|
|
@@ -223,10 +223,14 @@ describe('ChannelView', () => {
|
|
|
223
223
|
|
|
224
224
|
it('widens the content column in the official (read-only) channel via the width var', () => {
|
|
225
225
|
const { container } = renderWithProviders(
|
|
226
|
-
<ChannelView
|
|
226
|
+
<ChannelView
|
|
227
|
+
channel={createChannel({ channelType: OFFICIAL_CHANNEL_TYPE })}
|
|
228
|
+
/>
|
|
227
229
|
)
|
|
228
230
|
|
|
229
|
-
const root = container.querySelector(
|
|
231
|
+
const root = container.querySelector(
|
|
232
|
+
'.messaging-channel-view'
|
|
233
|
+
) as HTMLElement
|
|
230
234
|
expect(root.style.getPropertyValue('--lt-msg-card-width')).toBe('368px')
|
|
231
235
|
})
|
|
232
236
|
|
|
@@ -235,7 +239,9 @@ describe('ChannelView', () => {
|
|
|
235
239
|
<ChannelView channel={createChannel({ channelType: 'messaging' })} />
|
|
236
240
|
)
|
|
237
241
|
|
|
238
|
-
const root = container.querySelector(
|
|
242
|
+
const root = container.querySelector(
|
|
243
|
+
'.messaging-channel-view'
|
|
244
|
+
) as HTMLElement
|
|
239
245
|
expect(root.style.getPropertyValue('--lt-msg-card-width')).toBe('')
|
|
240
246
|
})
|
|
241
247
|
|
|
@@ -155,9 +155,7 @@ export function buildOrderedAttachmentSegments(
|
|
|
155
155
|
return segments
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
function countMediaSegmentBubbles(
|
|
159
|
-
segments: AttachmentSegment[]
|
|
160
|
-
): number {
|
|
158
|
+
function countMediaSegmentBubbles(segments: AttachmentSegment[]): number {
|
|
161
159
|
return segments.filter((segment) => segment.type === 'media').length
|
|
162
160
|
}
|
|
163
161
|
|
|
@@ -245,7 +243,9 @@ function buildMediaClusterRenderProps(
|
|
|
245
243
|
): Record<string, unknown> {
|
|
246
244
|
if (attachments.length > 1) {
|
|
247
245
|
return {
|
|
248
|
-
items: attachments.map((attachment) =>
|
|
246
|
+
items: attachments.map((attachment) =>
|
|
247
|
+
mediaItemForKind(kind, attachment)
|
|
248
|
+
),
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
|
|
@@ -318,8 +318,7 @@ const StreamAttachmentMessage: React.FC<StreamAttachmentMessageProps> = ({
|
|
|
318
318
|
: groupPosition
|
|
319
319
|
// The trailing caption bubble carries the tail on single / last-in-run
|
|
320
320
|
// messages, matching the in-channel text bubbles.
|
|
321
|
-
const captionShowsTail =
|
|
322
|
-
groupPosition === 'single' || groupPosition === 'end'
|
|
321
|
+
const captionShowsTail = groupPosition === 'single' || groupPosition === 'end'
|
|
323
322
|
|
|
324
323
|
const pushLinkRow = (
|
|
325
324
|
attachment: Attachment,
|
|
@@ -19,8 +19,9 @@ const DM_AGENT_SYSTEM_MESSAGE_FALLBACK_TEXT: Record<DmAgentSystemType, string> =
|
|
|
19
19
|
* explicitly added. Keep in sync with the mobile client (cerberus
|
|
20
20
|
* `CustomMessageSystem`); there is no shared package between the two surfaces.
|
|
21
21
|
*/
|
|
22
|
-
const SHOW_SYSTEM_MESSAGE_TIMESTAMP_TYPES: readonly AgeSafetySystemType[] =
|
|
23
|
-
|
|
22
|
+
const SHOW_SYSTEM_MESSAGE_TIMESTAMP_TYPES: readonly AgeSafetySystemType[] = [
|
|
23
|
+
'SYSTEM_AGE_SAFETY_BLOCKED',
|
|
24
|
+
]
|
|
24
25
|
|
|
25
26
|
const AGE_SAFETY_SYSTEM_MESSAGE_FALLBACK_TEXT: Record<
|
|
26
27
|
AgeSafetySystemType,
|
|
@@ -29,7 +29,9 @@ describe('RichCard', () => {
|
|
|
29
29
|
renderWithProviders(
|
|
30
30
|
<RichCard.Received
|
|
31
31
|
title="Welcome"
|
|
32
|
-
subtitle={
|
|
32
|
+
subtitle={
|
|
33
|
+
'👋 Say hello as people arrive\n✨ Spark conversations\n💬 Add automated FAQs'
|
|
34
|
+
}
|
|
33
35
|
subtitleLines={6}
|
|
34
36
|
images={[HERO]}
|
|
35
37
|
/>
|
|
@@ -22,7 +22,9 @@ vi.mock('stream-chat-react', () => ({
|
|
|
22
22
|
// The provider constructs the Chat client via `new StreamChat(apiKey)` and
|
|
23
23
|
// injects it into the service. Stub the constructor so <Chat> sees an instance.
|
|
24
24
|
vi.mock('stream-chat', () => ({
|
|
25
|
-
StreamChat: vi.fn().mockImplementation(()
|
|
25
|
+
StreamChat: vi.fn().mockImplementation(function () {
|
|
26
|
+
return { userID: 'mock' }
|
|
27
|
+
}),
|
|
26
28
|
}))
|
|
27
29
|
|
|
28
30
|
const setupServiceMock = () => {
|
|
@@ -16,7 +16,10 @@ import {
|
|
|
16
16
|
} from 'stream-chat-react'
|
|
17
17
|
|
|
18
18
|
import { CustomMessage } from '../components/CustomMessage'
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
OutboundContext,
|
|
21
|
+
buildOutboundsByRecordId,
|
|
22
|
+
} from '../components/CustomMessage/OutboundContext'
|
|
20
23
|
import CustomTypingIndicator from '../components/CustomTypingIndicator'
|
|
21
24
|
import { createMockStreamChatClient } from '../testing/createMockStreamChatClient'
|
|
22
25
|
import type { OutboundResolver } from '../types'
|
package/src/styles.css
CHANGED
|
@@ -934,7 +934,8 @@
|
|
|
934
934
|
/* Tighter gap for the locked-attachment card + text bubble and the tip
|
|
935
935
|
pill + text bubble — same margin-top mechanism, smaller value. Must come
|
|
936
936
|
after the rule above: equal specificity, so source order decides. */
|
|
937
|
-
.message-locked-attachment-wrapper
|
|
937
|
+
.message-locked-attachment-wrapper
|
|
938
|
+
> .str-chat__message-bubble:not(:first-child),
|
|
938
939
|
.message-tip-wrapper > .str-chat__message-bubble:not(:first-child) {
|
|
939
940
|
margin-top: 2px;
|
|
940
941
|
}
|