@linktr.ee/messaging-react 1.25.0 → 1.26.0
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/assets/index.css +1 -1
- package/dist/index.d.ts +28 -1
- package/dist/index.js +891 -824
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ChannelList/CustomChannelPreview.test.tsx +31 -0
- package/src/components/ChannelList/index.test.tsx +18 -0
- package/src/components/ChannelList/index.tsx +2 -0
- package/src/components/CustomSystemMessage/CustomSystemMessage.stories.tsx +8 -0
- package/src/components/CustomSystemMessage/CustomSystemMessage.test.tsx +48 -2
- package/src/components/CustomSystemMessage/index.tsx +119 -13
- package/src/components/MessagingShell/index.tsx +2 -0
- package/src/stream-custom-data.ts +3 -0
- package/src/styles.css +0 -30
- package/src/types.ts +26 -0
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export declare interface ActionButtonProps extends default_2.ButtonHTMLAttribute
|
|
|
18
18
|
variant?: "default" | "danger";
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
declare type AgeSafetySystemType = 'SYSTEM_AGE_SAFETY_BLOCKED';
|
|
22
|
+
|
|
21
23
|
/**
|
|
22
24
|
* Avatar component that displays a user image or colored initial fallback
|
|
23
25
|
*/
|
|
@@ -75,6 +77,20 @@ export declare interface ChannelListProps {
|
|
|
75
77
|
* channel belongs in the current list before inserting it.
|
|
76
78
|
*/
|
|
77
79
|
onAddedToChannel?: ChannelListProps_2['onAddedToChannel'];
|
|
80
|
+
/**
|
|
81
|
+
* Client-side filter applied before rendering the channel list.
|
|
82
|
+
* Websocket events can add channels to the list that bypass server-side
|
|
83
|
+
* query filters. Use this to enforce visibility rules that can't be
|
|
84
|
+
* automatically derived from the filters prop (e.g. $or conditions).
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* // Hide channels where the visitor hasn't sent a message yet,
|
|
88
|
+
* // but keep legacy channels that predate the has_visitor_message field
|
|
89
|
+
* channelRenderFilterFn={(channels) =>
|
|
90
|
+
* channels.filter(ch => ch.data?.has_visitor_message !== false)
|
|
91
|
+
* }
|
|
92
|
+
*/
|
|
93
|
+
channelRenderFilterFn?: (channels: Channel[]) => Channel[];
|
|
78
94
|
/**
|
|
79
95
|
* Sort order for the channel list query.
|
|
80
96
|
* Defaults to `{ last_message_at: -1 }` (most recent first).
|
|
@@ -237,7 +253,7 @@ export declare interface FaqListProps {
|
|
|
237
253
|
*/
|
|
238
254
|
export declare const formatRelativeTime: (date: Date) => string;
|
|
239
255
|
|
|
240
|
-
declare type MessageCustomType = 'MESSAGE_TIP' | 'MESSAGE_PAID' | 'MESSAGE_CHATBOT' | DmAgentSystemType;
|
|
256
|
+
declare type MessageCustomType = 'MESSAGE_TIP' | 'MESSAGE_PAID' | 'MESSAGE_CHATBOT' | AgeSafetySystemType | DmAgentSystemType;
|
|
241
257
|
|
|
242
258
|
/**
|
|
243
259
|
* Message metadata for paid messaging and chatbot flows.
|
|
@@ -344,6 +360,17 @@ export declare interface MessagingShellProps extends ChannelViewPassthroughProps
|
|
|
344
360
|
* Filters for channel list. Passed through to StreamChat ChannelList.
|
|
345
361
|
*/
|
|
346
362
|
filters?: ChannelFilters;
|
|
363
|
+
/**
|
|
364
|
+
* Client-side filter applied before rendering the channel list.
|
|
365
|
+
* Websocket events can add channels to the list that bypass server-side
|
|
366
|
+
* query filters. Use this to enforce visibility rules client-side.
|
|
367
|
+
*
|
|
368
|
+
* @example
|
|
369
|
+
* channelRenderFilterFn={(channels) =>
|
|
370
|
+
* channels.filter(ch => ch.data?.has_visitor_message !== false)
|
|
371
|
+
* }
|
|
372
|
+
*/
|
|
373
|
+
channelRenderFilterFn?: (channels: Channel[]) => Channel[];
|
|
347
374
|
/**
|
|
348
375
|
* Custom empty state indicator component to render when the channel list is empty.
|
|
349
376
|
* Useful for showing a custom empty state indicator when the channel list is empty.
|