@linktr.ee/messaging-react 3.12.3-rc-1784036626 → 3.12.3-rc-1784084417
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-C-iqbUa2.cjs → Card-BMJl2xlA.cjs} +2 -2
- package/dist/{Card-C-iqbUa2.cjs.map → Card-BMJl2xlA.cjs.map} +1 -1
- package/dist/{Card-B-Sn9hc8.js → Card-CWlzDHJA.js} +2 -2
- package/dist/{Card-B-Sn9hc8.js.map → Card-CWlzDHJA.js.map} +1 -1
- package/dist/{index-5kR8BcYv.js → index-B2BrYTjw.js} +3 -2
- package/dist/{index-5kR8BcYv.js.map → index-B2BrYTjw.js.map} +1 -1
- package/dist/{index-BB78YkWG.cjs → index-DSxpS5J9.cjs} +2 -2
- package/dist/{index-BB78YkWG.cjs.map → index-DSxpS5J9.cjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +11 -10
- package/package.json +2 -2
- package/src/components/ChannelView.test.tsx +23 -3
- package/src/components/ChannelView.tsx +1 -0
- package/src/index.test.ts +13 -0
- package/src/index.ts +1 -0
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-DSxpS5J9.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.MessageVoteButtons=e.MessageVoteButtons;exports.MessagingProvider=e.MessagingProvider;exports.MessagingShell=e.MessagingShell;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.useMessageVote=e.useMessageVote;exports.useMessaging=e.useMessaging;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1465,6 +1465,8 @@ export declare type OfficialCtaAttachment = Attachment & {
|
|
|
1465
1465
|
type: 'linktree_official_cta';
|
|
1466
1466
|
};
|
|
1467
1467
|
|
|
1468
|
+
export declare function optimizeMessagingAttachmentUrl(url: string | undefined | null): string | undefined;
|
|
1469
|
+
|
|
1468
1470
|
/**
|
|
1469
1471
|
* Generic participant interface for different host environments
|
|
1470
1472
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, b as t, C as i, c as o, d as n, e as m, F as r, f as g, L as l, h as M, M as
|
|
1
|
+
import { a as e, b as t, C as i, c as o, d as n, e as m, F as r, f as g, L as l, h as M, M as c, i as u, j as L, k as h, l as p, m as d, n as v, p as C, q as A, s as k, t as F, u as b, v as P, w as f, x, o as y, y as z, z as B, B as S, D as q, E as D, G as E, H as V, I as w } from "./index-B2BrYTjw.js";
|
|
2
2
|
export {
|
|
3
3
|
e as ActionButton,
|
|
4
4
|
t as Avatar,
|
|
@@ -10,12 +10,12 @@ export {
|
|
|
10
10
|
g as FaqListItem,
|
|
11
11
|
l as LinkAttachment,
|
|
12
12
|
M as LockedAttachment,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
c as MediaMessage,
|
|
14
|
+
u as MessageAttachment,
|
|
15
15
|
L as MessageBubble,
|
|
16
16
|
h as MessageVoteButtons,
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
p as MessagingProvider,
|
|
18
|
+
d as MessagingShell,
|
|
19
19
|
v as buildCompactMetaLabel,
|
|
20
20
|
C as formatFileSize,
|
|
21
21
|
A as formatRelativeTime,
|
|
@@ -25,13 +25,14 @@ export {
|
|
|
25
25
|
P as isUuidLike,
|
|
26
26
|
f as messageAttachmentGroupPositionFromStream,
|
|
27
27
|
x as normalizeLanguageCode,
|
|
28
|
-
y as
|
|
28
|
+
y as optimizeMessagingAttachmentUrl,
|
|
29
|
+
z as resolveConversationParticipant,
|
|
29
30
|
B as resolveLinkAttachment,
|
|
30
31
|
S as resolveMediaFromMessage,
|
|
31
32
|
q as resolveParticipantDisplayName,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
D as useComposerLocked,
|
|
34
|
+
E as useCustomMessage,
|
|
35
|
+
V as useMessageVote,
|
|
36
|
+
w as useMessaging
|
|
36
37
|
};
|
|
37
38
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linktr.ee/messaging-react",
|
|
3
|
-
"version": "3.12.3-rc-
|
|
3
|
+
"version": "3.12.3-rc-1784084417",
|
|
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
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@linktr.ee/component-library": "11.8.6",
|
|
53
|
-
"@linktr.ee/messaging-core": "2.3.0-rc-
|
|
53
|
+
"@linktr.ee/messaging-core": "2.3.0-rc-1784084417",
|
|
54
54
|
"@phosphor-icons/react": "^2.1.10"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
@@ -8,6 +8,7 @@ import { ChannelView } from './ChannelView'
|
|
|
8
8
|
|
|
9
9
|
let activeChannel: unknown
|
|
10
10
|
let activeChannelProps: Record<string, unknown> = {}
|
|
11
|
+
let activeComponentOverrides: Record<string, unknown> = {}
|
|
11
12
|
|
|
12
13
|
vi.mock('stream-chat-react', () => ({
|
|
13
14
|
Channel: (props: {
|
|
@@ -25,9 +26,16 @@ vi.mock('stream-chat-react', () => ({
|
|
|
25
26
|
MessageList: ({ head }: { head?: React.ReactElement }) => (
|
|
26
27
|
<div data-testid="message-list">{head}</div>
|
|
27
28
|
),
|
|
28
|
-
WithComponents: ({
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
WithComponents: ({
|
|
30
|
+
children,
|
|
31
|
+
overrides,
|
|
32
|
+
}: {
|
|
33
|
+
children: React.ReactNode
|
|
34
|
+
overrides?: Record<string, unknown>
|
|
35
|
+
}) => {
|
|
36
|
+
activeComponentOverrides = overrides ?? {}
|
|
37
|
+
return <>{children}</>
|
|
38
|
+
},
|
|
31
39
|
useMessageContext: () => ({ message: { id: 'message-1', text: 'hello' } }),
|
|
32
40
|
useChannelStateContext: () => ({ channel: activeChannel }),
|
|
33
41
|
useChatContext: () => ({
|
|
@@ -162,6 +170,7 @@ describe('ChannelView', () => {
|
|
|
162
170
|
beforeEach(() => {
|
|
163
171
|
activeChannel = undefined
|
|
164
172
|
activeChannelProps = {}
|
|
173
|
+
activeComponentOverrides = {}
|
|
165
174
|
avatarRenderCalls.length = 0
|
|
166
175
|
channelActionsMenuProps.length = 0
|
|
167
176
|
messageInputProps.length = 0
|
|
@@ -301,6 +310,17 @@ describe('ChannelView', () => {
|
|
|
301
310
|
).toBeGreaterThan(0)
|
|
302
311
|
})
|
|
303
312
|
|
|
313
|
+
it('suppresses stream unread message UI overrides', () => {
|
|
314
|
+
renderWithProviders(<ChannelView channel={createChannel()} />)
|
|
315
|
+
|
|
316
|
+
expect(activeComponentOverrides.UnreadMessagesSeparator).toBeTypeOf(
|
|
317
|
+
'function'
|
|
318
|
+
)
|
|
319
|
+
expect(activeComponentOverrides.UnreadMessagesNotification).toBeTypeOf(
|
|
320
|
+
'function'
|
|
321
|
+
)
|
|
322
|
+
})
|
|
323
|
+
|
|
304
324
|
it('hides the actions menu (both desktop and mobile) when showChannelInfo is false', () => {
|
|
305
325
|
renderWithProviders(
|
|
306
326
|
<ChannelView channel={createChannel()} showChannelInfo={false} />
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
|
|
3
|
+
import { optimizeMessagingAttachmentUrl } from './index'
|
|
4
|
+
|
|
5
|
+
describe('messaging-react public utils', () => {
|
|
6
|
+
it('exports optimizeMessagingAttachmentUrl from the package root', () => {
|
|
7
|
+
expect(
|
|
8
|
+
optimizeMessagingAttachmentUrl('https://assets.linktr.ee/photo.jpg')
|
|
9
|
+
).toBe(
|
|
10
|
+
'https://assets.linktr.ee/photo.jpg?io=true&size=messaging-attachment-v1_0'
|
|
11
|
+
)
|
|
12
|
+
})
|
|
13
|
+
})
|
package/src/index.ts
CHANGED
|
@@ -48,6 +48,7 @@ export {
|
|
|
48
48
|
} from './utils/resolveParticipantDisplayName'
|
|
49
49
|
export type { ParticipantDisplayUser } from './utils/resolveParticipantDisplayName'
|
|
50
50
|
export { resolveConversationParticipant } from './utils/resolveConversationParticipant'
|
|
51
|
+
export { optimizeMessagingAttachmentUrl } from './utils/cdnImageUrl'
|
|
51
52
|
|
|
52
53
|
// Types
|
|
53
54
|
export type {
|