stream-chat-react 13.2.2 → 13.2.3
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/components/Attachment/AttachmentContainer.js +14 -10
- package/dist/components/Chat/hooks/useChat.js +1 -1
- package/dist/components/Message/index.d.ts +1 -0
- package/dist/components/Message/index.js +1 -0
- package/dist/index.browser.cjs +15 -10
- package/dist/index.browser.cjs.map +2 -2
- package/dist/index.node.cjs +16 -10
- package/dist/index.node.cjs.map +2 -2
- package/package.json +1 -1
|
@@ -57,17 +57,21 @@ export const GalleryContainer = ({ attachment, Gallery = DefaultGallery, }) => {
|
|
|
57
57
|
const { imageAttachmentSizeHandler } = useChannelStateContext();
|
|
58
58
|
const [attachmentConfigurations, setAttachmentConfigurations] = useState([]);
|
|
59
59
|
useLayoutEffect(() => {
|
|
60
|
-
if (imageElements.current
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
newConfigurations.push(config);
|
|
67
|
-
});
|
|
68
|
-
setAttachmentConfigurations(newConfigurations);
|
|
60
|
+
if (!imageElements.current || !imageAttachmentSizeHandler)
|
|
61
|
+
return;
|
|
62
|
+
const newConfigurations = [];
|
|
63
|
+
const nonNullImageElements = imageElements.current.filter((e) => !!e);
|
|
64
|
+
if (nonNullImageElements.length < imageElements.current.length) {
|
|
65
|
+
imageElements.current = nonNullImageElements;
|
|
69
66
|
}
|
|
70
|
-
|
|
67
|
+
imageElements.current.forEach((element, i) => {
|
|
68
|
+
if (!element)
|
|
69
|
+
return;
|
|
70
|
+
const config = imageAttachmentSizeHandler(attachment.images[i], element);
|
|
71
|
+
newConfigurations.push(config);
|
|
72
|
+
});
|
|
73
|
+
setAttachmentConfigurations(newConfigurations);
|
|
74
|
+
}, [imageAttachmentSizeHandler, attachment]);
|
|
71
75
|
const images = attachment.images.map((image, i) => ({
|
|
72
76
|
...image,
|
|
73
77
|
previewUrl: attachmentConfigurations[i]?.url || 'about:blank',
|
|
@@ -24,7 +24,7 @@ export const useChat = ({ client, defaultLanguage = 'en', i18nInstance, initialN
|
|
|
24
24
|
useEffect(() => {
|
|
25
25
|
if (!client)
|
|
26
26
|
return;
|
|
27
|
-
const version = "13.2.
|
|
27
|
+
const version = "13.2.3";
|
|
28
28
|
const userAgent = client.getUserAgent();
|
|
29
29
|
if (!userAgent.includes('stream-chat-react')) {
|
|
30
30
|
// result looks like: 'stream-chat-react-2.3.2-stream-chat-javascript-client-browser-2.2.2'
|
|
@@ -3,6 +3,7 @@ export * from './hooks';
|
|
|
3
3
|
export * from './icons';
|
|
4
4
|
export * from './Message';
|
|
5
5
|
export * from './MessageDeleted';
|
|
6
|
+
export * from './MessageIsThreadReplyInChannelButtonIndicator';
|
|
6
7
|
export * from './MessageOptions';
|
|
7
8
|
export * from './MessageRepliesCountButton';
|
|
8
9
|
export * from './MessageSimple';
|
|
@@ -3,6 +3,7 @@ export * from './hooks';
|
|
|
3
3
|
export * from './icons';
|
|
4
4
|
export * from './Message';
|
|
5
5
|
export * from './MessageDeleted';
|
|
6
|
+
export * from './MessageIsThreadReplyInChannelButtonIndicator';
|
|
6
7
|
export * from './MessageOptions';
|
|
7
8
|
export * from './MessageRepliesCountButton';
|
|
8
9
|
export * from './MessageSimple';
|
package/dist/index.browser.cjs
CHANGED
|
@@ -402,6 +402,7 @@ __export(src_exports, {
|
|
|
402
402
|
MessageInputContext: () => MessageInputContext,
|
|
403
403
|
MessageInputContextProvider: () => MessageInputContextProvider,
|
|
404
404
|
MessageInputFlat: () => MessageInputFlat,
|
|
405
|
+
MessageIsThreadReplyInChannelButtonIndicator: () => MessageIsThreadReplyInChannelButtonIndicator,
|
|
405
406
|
MessageList: () => MessageList,
|
|
406
407
|
MessageListContext: () => MessageListContext,
|
|
407
408
|
MessageListContextProvider: () => MessageListContextProvider,
|
|
@@ -33280,15 +33281,19 @@ var GalleryContainer = ({
|
|
|
33280
33281
|
const { imageAttachmentSizeHandler } = useChannelStateContext();
|
|
33281
33282
|
const [attachmentConfigurations, setAttachmentConfigurations] = (0, import_react259.useState)([]);
|
|
33282
33283
|
(0, import_react259.useLayoutEffect)(() => {
|
|
33283
|
-
if (imageElements.current
|
|
33284
|
-
|
|
33285
|
-
|
|
33286
|
-
|
|
33287
|
-
|
|
33288
|
-
|
|
33289
|
-
|
|
33290
|
-
|
|
33291
|
-
|
|
33284
|
+
if (!imageElements.current || !imageAttachmentSizeHandler) return;
|
|
33285
|
+
const newConfigurations = [];
|
|
33286
|
+
const nonNullImageElements = imageElements.current.filter((e) => !!e);
|
|
33287
|
+
if (nonNullImageElements.length < imageElements.current.length) {
|
|
33288
|
+
imageElements.current = nonNullImageElements;
|
|
33289
|
+
}
|
|
33290
|
+
imageElements.current.forEach((element4, i) => {
|
|
33291
|
+
if (!element4) return;
|
|
33292
|
+
const config = imageAttachmentSizeHandler(attachment.images[i], element4);
|
|
33293
|
+
newConfigurations.push(config);
|
|
33294
|
+
});
|
|
33295
|
+
setAttachmentConfigurations(newConfigurations);
|
|
33296
|
+
}, [imageAttachmentSizeHandler, attachment]);
|
|
33292
33297
|
const images = attachment.images.map((image3, i) => ({
|
|
33293
33298
|
...image3,
|
|
33294
33299
|
previewUrl: attachmentConfigurations[i]?.url || "about:blank",
|
|
@@ -35001,7 +35006,7 @@ var useChat = ({
|
|
|
35001
35006
|
};
|
|
35002
35007
|
(0, import_react269.useEffect)(() => {
|
|
35003
35008
|
if (!client) return;
|
|
35004
|
-
const version = "13.2.
|
|
35009
|
+
const version = "13.2.3";
|
|
35005
35010
|
const userAgent = client.getUserAgent();
|
|
35006
35011
|
if (!userAgent.includes("stream-chat-react")) {
|
|
35007
35012
|
client.setUserAgent(`stream-chat-react-${version}-${userAgent}`);
|