stream-chat-react-native-core 5.39.1 → 5.39.2-beta.2
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/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerItem.js +7 -2
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerItem.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelList.js +2 -1
- package/lib/commonjs/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useUserPresence.js +5 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useUserPresence.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.js +4 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +49 -33
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/i18n/en.json +1 -0
- package/lib/commonjs/i18n/es.json +1 -0
- package/lib/commonjs/i18n/fr.json +1 -0
- package/lib/commonjs/i18n/he.json +1 -0
- package/lib/commonjs/i18n/hi.json +1 -0
- package/lib/commonjs/i18n/it.json +1 -0
- package/lib/commonjs/i18n/ja.json +1 -0
- package/lib/commonjs/i18n/ko.json +1 -0
- package/lib/commonjs/i18n/nl.json +1 -0
- package/lib/commonjs/i18n/pt-br.json +1 -0
- package/lib/commonjs/i18n/ru.json +1 -0
- package/lib/commonjs/i18n/tr.json +1 -0
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerItem.js +7 -2
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerItem.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelList.js +2 -1
- package/lib/module/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useUserPresence.js +5 -1
- package/lib/module/components/ChannelList/hooks/listeners/useUserPresence.js.map +1 -1
- package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.js +4 -1
- package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.js.map +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js +49 -33
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/i18n/en.json +1 -0
- package/lib/module/i18n/es.json +1 -0
- package/lib/module/i18n/fr.json +1 -0
- package/lib/module/i18n/he.json +1 -0
- package/lib/module/i18n/hi.json +1 -0
- package/lib/module/i18n/it.json +1 -0
- package/lib/module/i18n/ja.json +1 -0
- package/lib/module/i18n/ko.json +1 -0
- package/lib/module/i18n/nl.json +1 -0
- package/lib/module/i18n/pt-br.json +1 -0
- package/lib/module/i18n/ru.json +1 -0
- package/lib/module/i18n/tr.json +1 -0
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/AttachmentPicker/components/AttachmentPickerItem.d.ts.map +1 -1
- package/lib/typescript/components/ChannelList/ChannelList.d.ts.map +1 -1
- package/lib/typescript/components/ChannelList/hooks/listeners/useUserPresence.d.ts +2 -1
- package/lib/typescript/components/ChannelList/hooks/listeners/useUserPresence.d.ts.map +1 -1
- package/lib/typescript/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.d.ts.map +1 -1
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts.map +1 -1
- package/lib/typescript/i18n/en.json +1 -0
- package/lib/typescript/i18n/es.json +1 -0
- package/lib/typescript/i18n/fr.json +1 -0
- package/lib/typescript/i18n/he.json +1 -0
- package/lib/typescript/i18n/hi.json +1 -0
- package/lib/typescript/i18n/it.json +1 -0
- package/lib/typescript/i18n/ja.json +1 -0
- package/lib/typescript/i18n/ko.json +1 -0
- package/lib/typescript/i18n/nl.json +1 -0
- package/lib/typescript/i18n/pt-br.json +1 -0
- package/lib/typescript/i18n/ru.json +1 -0
- package/lib/typescript/i18n/tr.json +1 -0
- package/lib/typescript/utils/i18n/Streami18n.d.ts +1 -0
- package/lib/typescript/utils/i18n/Streami18n.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/AttachmentPicker/components/AttachmentPickerItem.tsx +5 -2
- package/src/components/ChannelList/ChannelList.tsx +1 -0
- package/src/components/ChannelList/hooks/listeners/useUserPresence.ts +3 -0
- package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.ts +3 -2
- package/src/contexts/messageInputContext/MessageInputContext.tsx +13 -1
- package/src/i18n/en.json +1 -0
- package/src/i18n/es.json +1 -0
- package/src/i18n/fr.json +1 -0
- package/src/i18n/he.json +1 -0
- package/src/i18n/hi.json +1 -0
- package/src/i18n/it.json +1 -0
- package/src/i18n/ja.json +1 -0
- package/src/i18n/ko.json +1 -0
- package/src/i18n/nl.json +1 -0
- package/src/i18n/pt-br.json +1 -0
- package/src/i18n/ru.json +1 -0
- package/src/i18n/tr.json +1 -0
- package/src/version.json +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stream-chat-react-native-core",
|
|
3
3
|
"description": "The official React Native and Expo components for Stream Chat, a service for building chat applications",
|
|
4
|
-
"version": "5.39.
|
|
4
|
+
"version": "5.39.2-beta.2",
|
|
5
5
|
"author": {
|
|
6
6
|
"company": "Stream.io Inc",
|
|
7
7
|
"name": "Stream.io Inc"
|
|
@@ -5,6 +5,7 @@ import { Alert, ImageBackground, Platform, StyleSheet, Text, View } from 'react-
|
|
|
5
5
|
import { TouchableOpacity } from '@gorhom/bottom-sheet';
|
|
6
6
|
import { lookup } from 'mime-types';
|
|
7
7
|
|
|
8
|
+
import { useTranslationContext } from '../../../contexts';
|
|
8
9
|
import { AttachmentPickerContextValue } from '../../../contexts/attachmentPickerContext/AttachmentPickerContext';
|
|
9
10
|
import { useTheme } from '../../../contexts/themeContext/ThemeContext';
|
|
10
11
|
import { useViewport } from '../../../hooks/useViewport';
|
|
@@ -39,6 +40,7 @@ const AttachmentVideo = (props: AttachmentVideoProps) => {
|
|
|
39
40
|
setSelectedFiles,
|
|
40
41
|
} = props;
|
|
41
42
|
const { vw } = useViewport();
|
|
43
|
+
const { t } = useTranslationContext();
|
|
42
44
|
|
|
43
45
|
const {
|
|
44
46
|
theme: {
|
|
@@ -76,7 +78,7 @@ const AttachmentVideo = (props: AttachmentVideoProps) => {
|
|
|
76
78
|
|
|
77
79
|
const updateSelectedFiles = async () => {
|
|
78
80
|
if (numberOfUploads >= maxNumberOfFiles) {
|
|
79
|
-
Alert.alert('Maximum number of files reached');
|
|
81
|
+
Alert.alert(t('Maximum number of files reached'));
|
|
80
82
|
return;
|
|
81
83
|
}
|
|
82
84
|
const files = await patchVideoFile(selectedFiles);
|
|
@@ -143,6 +145,7 @@ const AttachmentImage = (props: AttachmentImageProps) => {
|
|
|
143
145
|
},
|
|
144
146
|
} = useTheme();
|
|
145
147
|
const { vw } = useViewport();
|
|
148
|
+
const { t } = useTranslationContext();
|
|
146
149
|
|
|
147
150
|
const size = vw(100) / (numberOfAttachmentPickerImageColumns || 3) - 2;
|
|
148
151
|
|
|
@@ -165,7 +168,7 @@ const AttachmentImage = (props: AttachmentImageProps) => {
|
|
|
165
168
|
|
|
166
169
|
const updateSelectedImages = async () => {
|
|
167
170
|
if (numberOfUploads >= maxNumberOfFiles) {
|
|
168
|
-
Alert.alert('Maximum number of files reached');
|
|
171
|
+
Alert.alert(t('Maximum number of files reached'));
|
|
169
172
|
return;
|
|
170
173
|
}
|
|
171
174
|
const images = await patchImageFile(selectedImages);
|
|
@@ -9,12 +9,14 @@ import type { DefaultStreamChatGenerics } from '../../../../types/types';
|
|
|
9
9
|
type Parameters<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> =
|
|
10
10
|
{
|
|
11
11
|
setChannels: React.Dispatch<React.SetStateAction<Channel<StreamChatGenerics>[] | null>>;
|
|
12
|
+
setForceUpdate: React.Dispatch<React.SetStateAction<number>>;
|
|
12
13
|
};
|
|
13
14
|
|
|
14
15
|
export const useUserPresence = <
|
|
15
16
|
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
16
17
|
>({
|
|
17
18
|
setChannels,
|
|
19
|
+
setForceUpdate,
|
|
18
20
|
}: Parameters<StreamChatGenerics>) => {
|
|
19
21
|
const { client } = useChatContext<StreamChatGenerics>();
|
|
20
22
|
|
|
@@ -33,6 +35,7 @@ export const useUserPresence = <
|
|
|
33
35
|
|
|
34
36
|
return [...newChannels];
|
|
35
37
|
});
|
|
38
|
+
setForceUpdate((u) => u + 1);
|
|
36
39
|
};
|
|
37
40
|
|
|
38
41
|
const listeners = [
|
|
@@ -2,6 +2,7 @@ import { useEffect, useState } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import type { Channel, StreamChat } from 'stream-chat';
|
|
4
4
|
|
|
5
|
+
import { useChannelsContext } from '../../../contexts';
|
|
5
6
|
import { useChatContext } from '../../../contexts/chatContext/ChatContext';
|
|
6
7
|
|
|
7
8
|
import type { DefaultStreamChatGenerics } from '../../../types/types';
|
|
@@ -37,6 +38,7 @@ export const useChannelPreviewDisplayPresence = <
|
|
|
37
38
|
channel: Channel<StreamChatGenerics>,
|
|
38
39
|
) => {
|
|
39
40
|
const { client } = useChatContext<StreamChatGenerics>();
|
|
41
|
+
const { forceUpdate } = useChannelsContext<StreamChatGenerics>();
|
|
40
42
|
|
|
41
43
|
const currentUserId = client.userID;
|
|
42
44
|
const members = Object.values(channel.state.members).filter(
|
|
@@ -48,8 +50,7 @@ export const useChannelPreviewDisplayPresence = <
|
|
|
48
50
|
|
|
49
51
|
useEffect(() => {
|
|
50
52
|
setDisplayPresence(getChannelPreviewDisplayPresence(channel, client));
|
|
51
|
-
|
|
52
|
-
}, [channelMemberOnline]);
|
|
53
|
+
}, [channel, channelMemberOnline, client, forceUpdate]);
|
|
53
54
|
|
|
54
55
|
return displayPresence;
|
|
55
56
|
};
|
|
@@ -694,7 +694,19 @@ export const MessageInputProvider = <
|
|
|
694
694
|
],
|
|
695
695
|
);
|
|
696
696
|
}
|
|
697
|
+
|
|
698
|
+
// RN CLI
|
|
699
|
+
if (numberOfUploads >= value.maxNumberOfFiles) {
|
|
700
|
+
Alert.alert(t('Maximum number of files reached'));
|
|
701
|
+
return;
|
|
702
|
+
}
|
|
703
|
+
|
|
697
704
|
if (result.assets && result.assets.length > 0) {
|
|
705
|
+
// Expo
|
|
706
|
+
if (result.assets.length > value.maxNumberOfFiles) {
|
|
707
|
+
Alert.alert(t('Maximum number of files reached'));
|
|
708
|
+
return;
|
|
709
|
+
}
|
|
698
710
|
result.assets.forEach(async (asset) => {
|
|
699
711
|
if (asset.type.includes('image')) {
|
|
700
712
|
await uploadNewImage(asset);
|
|
@@ -746,7 +758,7 @@ export const MessageInputProvider = <
|
|
|
746
758
|
}
|
|
747
759
|
|
|
748
760
|
if (numberOfUploads >= value.maxNumberOfFiles) {
|
|
749
|
-
Alert.alert('Maximum number of files reached');
|
|
761
|
+
Alert.alert(t('Maximum number of files reached'));
|
|
750
762
|
return;
|
|
751
763
|
}
|
|
752
764
|
|
package/src/i18n/en.json
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"Loading messages...": "Loading messages...",
|
|
41
41
|
"Loading threads...": "Loading threads...",
|
|
42
42
|
"Loading...": "Loading...",
|
|
43
|
+
"Maximum number of files reached": "Maximum number of files reached",
|
|
43
44
|
"Message Reactions": "Message Reactions",
|
|
44
45
|
"Message deleted": "Message deleted",
|
|
45
46
|
"Message flagged": "Message flagged",
|
package/src/i18n/es.json
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"Loading messages...": "Cargando mensajes...",
|
|
41
41
|
"Loading threads...": "Cargando hilos...",
|
|
42
42
|
"Loading...": "Cargando...",
|
|
43
|
+
"Maximum number of files reached": "Número máximo de archivos alcanzado",
|
|
43
44
|
"Message Reactions": "Reacciones al mensaje",
|
|
44
45
|
"Message deleted": "Mensaje eliminado",
|
|
45
46
|
"Message flagged": "Mensaje reportado",
|
package/src/i18n/fr.json
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"Loading messages...": "Chargement des messages...",
|
|
41
41
|
"Loading threads...": "Chargement des fils...",
|
|
42
42
|
"Loading...": "Chargement...",
|
|
43
|
+
"Maximum number of files reached": "Nombre maximal de fichiers atteint",
|
|
43
44
|
"Message Reactions": "Réactions aux messages",
|
|
44
45
|
"Message deleted": "Message supprimé",
|
|
45
46
|
"Message flagged": "Message signalé",
|
package/src/i18n/he.json
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"Loading messages...": "ההודעות בטעינה..",
|
|
41
41
|
"Loading threads...": "טוען שרשורים...",
|
|
42
42
|
"Loading...": "טוען...",
|
|
43
|
+
"Maximum number of files reached": "הגעת למספר המרבי של קבצים",
|
|
43
44
|
"Message Reactions": "תגובות להודעה",
|
|
44
45
|
"Message deleted": "ההודעה נמחקה",
|
|
45
46
|
"Message flagged": "ההודעה סומנה",
|
package/src/i18n/hi.json
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"Loading messages...": "मेसेजस लोड हो रहे हैं...",
|
|
41
41
|
"Loading threads...": "थ्रेड्स लोड हो रहे हैं...",
|
|
42
42
|
"Loading...": "लोड हो रहा है...",
|
|
43
|
+
"Maximum number of files reached": "फ़ाइलों की अधिकतम संख्या पहुँच गई",
|
|
43
44
|
"Message Reactions": "संदेश प्रतिक्रियाएँ",
|
|
44
45
|
"Message deleted": "मैसेज हटा दिया गया",
|
|
45
46
|
"Message flagged": "संदेश को ध्वजांकित किया गया",
|
package/src/i18n/it.json
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"Loading messages...": "Caricamento messaggi...",
|
|
41
41
|
"Loading threads...": "Caricamento dei thread...",
|
|
42
42
|
"Loading...": "Caricamento...",
|
|
43
|
+
"Maximum number of files reached": "Numero massimo di file raggiunto",
|
|
43
44
|
"Message Reactions": "Reazioni ai Messaggi",
|
|
44
45
|
"Message deleted": "Messaggio cancellato",
|
|
45
46
|
"Message flagged": "Messaggio contrassegnato",
|
package/src/i18n/ja.json
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"Loading messages...": "メッセージを読み込み中。。。",
|
|
41
41
|
"Loading threads...": "スレッドを読み込み中...",
|
|
42
42
|
"Loading...": "読み込み中。。。",
|
|
43
|
+
"Maximum number of files reached": "ファイルの最大数に達しました",
|
|
43
44
|
"Message Reactions": "メッセージのリアクション",
|
|
44
45
|
"Message deleted": "メッセージが削除されました",
|
|
45
46
|
"Message flagged": "メッセージにフラグが付けられました",
|
package/src/i18n/ko.json
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"Loading messages...": "메시지를 로딩 중...",
|
|
41
41
|
"Loading threads...": "스레드 로딩 중...",
|
|
42
42
|
"Loading...": "로딩 중...",
|
|
43
|
+
"Maximum number of files reached": "최대 파일 수에 도달했습니다",
|
|
43
44
|
"Message Reactions": "메시지의 리액션",
|
|
44
45
|
"Message deleted": "메시지가 삭제되었습니다.",
|
|
45
46
|
"Message flagged": "메시지에 플래그가 지정되었습니다",
|
package/src/i18n/nl.json
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"Loading messages...": "Berichten aan het laden...",
|
|
41
41
|
"Loading threads...": "Threads laden...",
|
|
42
42
|
"Loading...": "Aan het laden...",
|
|
43
|
+
"Maximum number of files reached": "Maximaal aantal bestanden bereikt",
|
|
43
44
|
"Message Reactions": "Bericht Reacties",
|
|
44
45
|
"Message deleted": "Bericht verwijderd",
|
|
45
46
|
"Message flagged": "Bericht gemarkeerd",
|
package/src/i18n/pt-br.json
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"Loading messages...": "Carregando mensagens...",
|
|
41
41
|
"Loading threads...": "Carregando tópicos...",
|
|
42
42
|
"Loading...": "Carregando...",
|
|
43
|
+
"Maximum number of files reached": "Número máximo de arquivos atingido",
|
|
43
44
|
"Message Reactions": "Reações à Mensagem",
|
|
44
45
|
"Message deleted": "Mensagem excluída",
|
|
45
46
|
"Message flagged": "Mensagem sinalizada",
|
package/src/i18n/ru.json
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"Loading messages...": "Загружаю сообщения...",
|
|
41
41
|
"Loading threads...": "Загрузка потоков...",
|
|
42
42
|
"Loading...": "Загружаю...",
|
|
43
|
+
"Maximum number of files reached": "Достигнуто максимальное количество файлов",
|
|
43
44
|
"Message Reactions": "Сообщения Реакции",
|
|
44
45
|
"Message deleted": "Сообщение удалено",
|
|
45
46
|
"Message flagged": "Сообщение отмечено",
|
package/src/i18n/tr.json
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"Loading messages...": "Mesajlar yükleniyor...",
|
|
41
41
|
"Loading threads...": "Akışlar yükleniyor...",
|
|
42
42
|
"Loading...": "Yükleniyor...",
|
|
43
|
+
"Maximum number of files reached": "Maksimum dosya sayısına ulaşıldı",
|
|
43
44
|
"Message Reactions": "Mesaj Tepkileri",
|
|
44
45
|
"Message deleted": "Mesaj silindi",
|
|
45
46
|
"Message flagged": "Mesaj işaretlendi",
|
package/src/version.json
CHANGED