stream-chat-react-native-core 5.25.0-beta.5 → 5.25.0-beta.7
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/Channel/Channel.js +20 -15
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js +3 -1
- package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateOwnCapabilitiesContext.js +22 -5
- package/lib/commonjs/components/Channel/hooks/useCreateOwnCapabilitiesContext.js.map +1 -1
- package/lib/commonjs/components/Chat/Chat.js +10 -6
- package/lib/commonjs/components/Chat/Chat.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useSyncDatabase.js +4 -3
- package/lib/commonjs/components/Chat/hooks/useSyncDatabase.js.map +1 -1
- package/lib/commonjs/components/Message/Message.js +5 -2
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +7 -3
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js +7 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MessageInput.js +5 -5
- package/lib/commonjs/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/commonjs/components/MessageList/MessageList.js +32 -30
- package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +3 -1
- package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/commonjs/i18n/en.json +1 -1
- package/lib/commonjs/i18n/es.json +57 -57
- package/lib/commonjs/i18n/fr.json +57 -57
- package/lib/commonjs/i18n/he.json +57 -57
- package/lib/commonjs/i18n/hi.json +57 -57
- package/lib/commonjs/i18n/it.json +57 -57
- package/lib/commonjs/i18n/ja.json +57 -57
- package/lib/commonjs/i18n/ko.json +57 -57
- package/lib/commonjs/i18n/nl.json +57 -57
- package/lib/commonjs/i18n/ru.json +54 -54
- package/lib/commonjs/i18n/tr.json +54 -54
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Channel/Channel.js +20 -15
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js +3 -1
- package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateOwnCapabilitiesContext.js +22 -5
- package/lib/module/components/Channel/hooks/useCreateOwnCapabilitiesContext.js.map +1 -1
- package/lib/module/components/Chat/Chat.js +10 -6
- package/lib/module/components/Chat/Chat.js.map +1 -1
- package/lib/module/components/Chat/hooks/useSyncDatabase.js +4 -3
- package/lib/module/components/Chat/hooks/useSyncDatabase.js.map +1 -1
- package/lib/module/components/Message/Message.js +5 -2
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageContent.js +7 -3
- package/lib/module/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageSimple.js +7 -1
- package/lib/module/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/module/components/MessageInput/MessageInput.js +5 -5
- package/lib/module/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/module/components/MessageList/MessageList.js +32 -30
- package/lib/module/components/MessageList/MessageList.js.map +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +3 -1
- package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/module/i18n/en.json +1 -1
- package/lib/module/i18n/es.json +57 -57
- package/lib/module/i18n/fr.json +57 -57
- package/lib/module/i18n/he.json +57 -57
- package/lib/module/i18n/hi.json +57 -57
- package/lib/module/i18n/it.json +57 -57
- package/lib/module/i18n/ja.json +57 -57
- package/lib/module/i18n/ko.json +57 -57
- package/lib/module/i18n/nl.json +57 -57
- package/lib/module/i18n/ru.json +54 -54
- package/lib/module/i18n/tr.json +54 -54
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts +62 -1
- package/lib/typescript/components/Chat/hooks/useSyncDatabase.d.ts +2 -1
- package/lib/typescript/components/Message/MessageSimple/MessageSimple.d.ts +1 -1
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +2 -2
- package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts +1 -1
- package/lib/typescript/i18n/en.json +1 -1
- package/lib/typescript/i18n/es.json +57 -57
- package/lib/typescript/i18n/fr.json +57 -57
- package/lib/typescript/i18n/he.json +57 -57
- package/lib/typescript/i18n/hi.json +57 -57
- package/lib/typescript/i18n/it.json +57 -57
- package/lib/typescript/i18n/ja.json +57 -57
- package/lib/typescript/i18n/ko.json +57 -57
- package/lib/typescript/i18n/nl.json +57 -57
- package/lib/typescript/i18n/ru.json +54 -54
- package/lib/typescript/i18n/tr.json +54 -54
- package/package.json +2 -2
- package/src/components/Channel/Channel.tsx +8 -2
- package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +11 -1
- package/src/components/Channel/hooks/useCreateOwnCapabilitiesContext.ts +24 -6
- package/src/components/Chat/Chat.tsx +5 -0
- package/src/components/Chat/hooks/useSyncDatabase.ts +4 -2
- package/src/components/Message/Message.tsx +6 -1
- package/src/components/Message/MessageSimple/MessageContent.tsx +5 -0
- package/src/components/Message/MessageSimple/MessageSimple.tsx +8 -2
- package/src/components/MessageInput/MessageInput.tsx +3 -7
- package/src/components/MessageList/MessageList.tsx +3 -1
- package/src/contexts/messageInputContext/MessageInputContext.tsx +1 -1
- package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +3 -0
- package/src/i18n/en.json +1 -1
- package/src/i18n/es.json +57 -57
- package/src/i18n/fr.json +57 -57
- package/src/i18n/he.json +57 -57
- package/src/i18n/hi.json +57 -57
- package/src/i18n/it.json +57 -57
- package/src/i18n/ja.json +57 -57
- package/src/i18n/ko.json +57 -57
- package/src/i18n/nl.json +57 -57
- package/src/i18n/ru.json +54 -54
- package/src/i18n/tr.json +54 -54
- package/src/version.json +1 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
|
-
"1 Reply": "",
|
|
3
|
-
"1 Thread Reply": "",
|
|
4
|
-
"Allow access to your Gallery": "",
|
|
5
|
-
"Allow camera access in device settings": "",
|
|
6
|
-
"Also send to channel": "
|
|
7
|
-
"Are you sure you want to permanently delete this message?": "
|
|
2
|
+
"1 Reply": "1 Cevap",
|
|
3
|
+
"1 Thread Reply": "1 Konu Yanıtı",
|
|
4
|
+
"Allow access to your Gallery": "Galerinize erişime izin verin",
|
|
5
|
+
"Allow camera access in device settings": "Cihaz ayarlarında kamera erişimine izin ver",
|
|
6
|
+
"Also send to channel": "",
|
|
7
|
+
"Are you sure you want to permanently delete this message?": "",
|
|
8
8
|
"Are you sure?": "",
|
|
9
|
-
"Block User": "
|
|
10
|
-
"Cancel": "
|
|
11
|
-
"Cannot Flag Message": "
|
|
9
|
+
"Block User": "",
|
|
10
|
+
"Cancel": "",
|
|
11
|
+
"Cannot Flag Message": "",
|
|
12
12
|
"Consider how your comment might make others feel and be sure to follow our Community Guidelines": "",
|
|
13
|
-
"Copy Message": "
|
|
14
|
-
"Delete": "
|
|
15
|
-
"Delete Message": "
|
|
16
|
-
"Device camera is used to take photos or videos.": "",
|
|
17
|
-
"Do you want to send a copy of this message to a moderator for further investigation?": "
|
|
18
|
-
"Edit Message": "
|
|
13
|
+
"Copy Message": "",
|
|
14
|
+
"Delete": "",
|
|
15
|
+
"Delete Message": "",
|
|
16
|
+
"Device camera is used to take photos or videos.": "Cihaz kamerası fotoğraf veya video çekmek için kullanılır.",
|
|
17
|
+
"Do you want to send a copy of this message to a moderator for further investigation?": "",
|
|
18
|
+
"Edit Message": "",
|
|
19
19
|
"Editing Message": "",
|
|
20
20
|
"Emoji matching": "Emoji eşleştirme",
|
|
21
21
|
"Empty message...": "",
|
|
@@ -24,56 +24,56 @@
|
|
|
24
24
|
"Error loading messages for this channel...": "",
|
|
25
25
|
"Error while loading, please reload/refresh": "",
|
|
26
26
|
"File type not supported": "",
|
|
27
|
-
"Flag": "
|
|
28
|
-
"Flag Message": "
|
|
29
|
-
"Flag action failed either due to a network issue or the message is already flagged": "
|
|
27
|
+
"Flag": "",
|
|
28
|
+
"Flag Message": "",
|
|
29
|
+
"Flag action failed either due to a network issue or the message is already flagged": "",
|
|
30
30
|
"How about sending your first message to a friend?": "",
|
|
31
31
|
"Instant Commands": "Anlık Komutlar",
|
|
32
32
|
"Let's start chatting!": "",
|
|
33
|
-
"Links are disabled": "
|
|
34
|
-
"Loading channels...": "",
|
|
35
|
-
"Loading messages...": "",
|
|
36
|
-
"Loading...": "",
|
|
37
|
-
"Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "
|
|
38
|
-
"Message Reactions": "
|
|
33
|
+
"Links are disabled": "",
|
|
34
|
+
"Loading channels...": "Kanallar yükleniyor...",
|
|
35
|
+
"Loading messages...": "Mesajlar yükleniyor...",
|
|
36
|
+
"Loading...": "Yükleniyor...",
|
|
37
|
+
"Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "",
|
|
38
|
+
"Message Reactions": "",
|
|
39
39
|
"Message deleted": "",
|
|
40
|
-
"Message flagged": "
|
|
41
|
-
"Mute User": "
|
|
42
|
-
"Not supported": "",
|
|
40
|
+
"Message flagged": "",
|
|
41
|
+
"Mute User": "",
|
|
42
|
+
"Not supported": "Desteklenmiyor",
|
|
43
43
|
"Nothing yet...": "",
|
|
44
|
-
"Ok": "
|
|
45
|
-
"Only visible to you": "",
|
|
46
|
-
"Open Settings": "",
|
|
44
|
+
"Ok": "",
|
|
45
|
+
"Only visible to you": "Sadece siz görebilirsiniz",
|
|
46
|
+
"Open Settings": "Ayarları aç",
|
|
47
47
|
"Photo": "Fotoğraf",
|
|
48
|
-
"Photos and Videos": "",
|
|
49
|
-
"Pin to Conversation": "
|
|
48
|
+
"Photos and Videos": "Fotoğraflar ve Videolar",
|
|
49
|
+
"Pin to Conversation": "",
|
|
50
50
|
"Pinned by": "",
|
|
51
|
-
"Please enable access to your photos and videos so you can share them.": "",
|
|
52
|
-
"Please select a channel first": "
|
|
51
|
+
"Please enable access to your photos and videos so you can share them.": "Paylaşım yapabilmek için lutfen fotoğraflarınıza ve videolarınıza erişimi etkinleştirin.",
|
|
52
|
+
"Please select a channel first": "",
|
|
53
53
|
"Reconnecting...": "",
|
|
54
|
-
"Reply": "
|
|
54
|
+
"Reply": "",
|
|
55
55
|
"Reply to Message": "",
|
|
56
|
-
"Resend": "
|
|
57
|
-
"Search GIFs": "",
|
|
58
|
-
"Select More Photos": "",
|
|
56
|
+
"Resend": "",
|
|
57
|
+
"Search GIFs": "GIF Ara",
|
|
58
|
+
"Select More Photos": "Daha Fazla Fotoğraf Seçin",
|
|
59
59
|
"Send Anyway": "",
|
|
60
|
-
"Send a message": "",
|
|
61
|
-
"Sending links is not allowed in this conversation": "
|
|
62
|
-
"Slow mode ON": "",
|
|
63
|
-
"The message has been reported to a moderator.": "
|
|
64
|
-
"Thread Reply": "
|
|
65
|
-
"Unblock User": "
|
|
66
|
-
"Unknown User": "",
|
|
67
|
-
"Unmute User": "
|
|
68
|
-
"Unpin from Conversation": "
|
|
69
|
-
"Unread Messages": "
|
|
60
|
+
"Send a message": "Mesaj gönder",
|
|
61
|
+
"Sending links is not allowed in this conversation": "",
|
|
62
|
+
"Slow mode ON": "Yavaş Mod Açık",
|
|
63
|
+
"The message has been reported to a moderator.": "",
|
|
64
|
+
"Thread Reply": "",
|
|
65
|
+
"Unblock User": "",
|
|
66
|
+
"Unknown User": "Bilinmeyen kullanıcı",
|
|
67
|
+
"Unmute User": "",
|
|
68
|
+
"Unpin from Conversation": "",
|
|
69
|
+
"Unread Messages": "",
|
|
70
70
|
"Video": "Video",
|
|
71
71
|
"You": "",
|
|
72
|
-
"You can't send messages in this channel": "
|
|
73
|
-
"{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "",
|
|
74
|
-
"{{ index }} of {{ photoLength }}": "",
|
|
75
|
-
"{{ replyCount }} Replies": "",
|
|
76
|
-
"{{ replyCount }} Thread Replies": "",
|
|
77
|
-
"{{ user }} is typing": "",
|
|
72
|
+
"You can't send messages in this channel": "",
|
|
73
|
+
"{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} ve {{ nonSelfUserLength }} kişi daha yazıyor",
|
|
74
|
+
"{{ index }} of {{ photoLength }}": "{{ index }} / {{ photoLength }}",
|
|
75
|
+
"{{ replyCount }} Replies": "{{ replyCount }} Cevap",
|
|
76
|
+
"{{ replyCount }} Thread Replies": "{{responseCount}} Konu Cevapı",
|
|
77
|
+
"{{ user }} is typing": "{{ user }} yazıyor",
|
|
78
78
|
"🏙 Attachment...": ""
|
|
79
79
|
}
|
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.25.0-beta.
|
|
4
|
+
"version": "5.25.0-beta.7",
|
|
5
5
|
"author": {
|
|
6
6
|
"company": "Stream.io Inc",
|
|
7
7
|
"name": "Stream.io Inc"
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"path": "0.12.7",
|
|
82
82
|
"react-native-markdown-package": "1.8.2",
|
|
83
83
|
"react-native-url-polyfill": "^1.3.0",
|
|
84
|
-
"stream-chat": "8.
|
|
84
|
+
"stream-chat": "8.17.0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
"react-native-quick-sqlite": ">=5.1.0",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { PropsWithChildren, useCallback, useEffect, useRef, useState } from 'react';
|
|
1
|
+
import React, { PropsWithChildren, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import { KeyboardAvoidingViewProps, StyleSheet, Text, View } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import debounce from 'lodash/debounce';
|
|
@@ -2093,6 +2093,11 @@ const ChannelWithContext = <
|
|
|
2093
2093
|
}
|
|
2094
2094
|
};
|
|
2095
2095
|
|
|
2096
|
+
const disabledValue = useMemo(
|
|
2097
|
+
() => !!channel?.data?.frozen && disableIfFrozenChannel,
|
|
2098
|
+
[channel.data?.frozen, disableIfFrozenChannel],
|
|
2099
|
+
);
|
|
2100
|
+
|
|
2096
2101
|
const ownCapabilitiesContext = useCreateOwnCapabilitiesContext({
|
|
2097
2102
|
channel,
|
|
2098
2103
|
overrideCapabilities: overrideOwnCapabilities,
|
|
@@ -2100,7 +2105,7 @@ const ChannelWithContext = <
|
|
|
2100
2105
|
|
|
2101
2106
|
const channelContext = useCreateChannelContext({
|
|
2102
2107
|
channel,
|
|
2103
|
-
disabled:
|
|
2108
|
+
disabled: disabledValue,
|
|
2104
2109
|
EmptyStateIndicator,
|
|
2105
2110
|
enableMessageGroupingByUser,
|
|
2106
2111
|
enforceUniqueReaction,
|
|
@@ -2147,6 +2152,7 @@ const ChannelWithContext = <
|
|
|
2147
2152
|
CommandsButton,
|
|
2148
2153
|
compressImageQuality,
|
|
2149
2154
|
CooldownTimer,
|
|
2155
|
+
disabled: disabledValue,
|
|
2150
2156
|
doDocUploadRequest,
|
|
2151
2157
|
doImageUploadRequest,
|
|
2152
2158
|
editing,
|
|
@@ -16,6 +16,7 @@ export const useCreateInputMessageInputContext = <
|
|
|
16
16
|
CommandsButton,
|
|
17
17
|
compressImageQuality,
|
|
18
18
|
CooldownTimer,
|
|
19
|
+
disabled,
|
|
19
20
|
doDocUploadRequest,
|
|
20
21
|
doImageUploadRequest,
|
|
21
22
|
editing,
|
|
@@ -72,6 +73,7 @@ export const useCreateInputMessageInputContext = <
|
|
|
72
73
|
CommandsButton,
|
|
73
74
|
compressImageQuality,
|
|
74
75
|
CooldownTimer,
|
|
76
|
+
disabled,
|
|
75
77
|
doDocUploadRequest,
|
|
76
78
|
doImageUploadRequest,
|
|
77
79
|
editing,
|
|
@@ -105,7 +107,15 @@ export const useCreateInputMessageInputContext = <
|
|
|
105
107
|
ShowThreadMessageInChannelButton,
|
|
106
108
|
UploadProgressIndicator,
|
|
107
109
|
}),
|
|
108
|
-
[
|
|
110
|
+
[
|
|
111
|
+
compressImageQuality,
|
|
112
|
+
channelId,
|
|
113
|
+
disabled,
|
|
114
|
+
editingDep,
|
|
115
|
+
initialValue,
|
|
116
|
+
maxMessageLength,
|
|
117
|
+
quotedMessageId,
|
|
118
|
+
],
|
|
109
119
|
);
|
|
110
120
|
|
|
111
121
|
return inputMessageInputContext;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
1
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import type { Channel } from 'stream-chat';
|
|
4
4
|
|
|
@@ -18,15 +18,33 @@ export const useCreateOwnCapabilitiesContext = <
|
|
|
18
18
|
channel: Channel<StreamChatGenerics>;
|
|
19
19
|
overrideCapabilities?: Partial<OwnCapabilitiesContextValue>;
|
|
20
20
|
}) => {
|
|
21
|
+
const [own_capabilities, setOwnCapabilites] = useState(
|
|
22
|
+
JSON.stringify(channel.data?.own_capabilities as Array<string>),
|
|
23
|
+
);
|
|
21
24
|
const overrideCapabilitiesStr = overrideCapabilities
|
|
22
25
|
? JSON.stringify(Object.values(overrideCapabilities))
|
|
23
26
|
: null;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
|
|
28
|
+
// Effect to watch for changes in channel.data?.own_capabilities and update the own_capabilties state accordingly.
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
setOwnCapabilites(JSON.stringify(channel.data?.own_capabilities as Array<string>));
|
|
31
|
+
}, [channel.data?.own_capabilities]);
|
|
32
|
+
|
|
33
|
+
// Effect to listen to the `capabilities.changed` event.
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
const listener = channel.on('capabilities.changed', (event) => {
|
|
36
|
+
if (event.own_capabilities) {
|
|
37
|
+
setOwnCapabilites(JSON.stringify(event.own_capabilities as Array<string>));
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
return () => {
|
|
42
|
+
listener.unsubscribe();
|
|
43
|
+
};
|
|
44
|
+
}, []);
|
|
27
45
|
|
|
28
46
|
const ownCapabilitiesContext: OwnCapabilitiesContextValue = useMemo(() => {
|
|
29
|
-
const capabilities = (
|
|
47
|
+
const capabilities = (own_capabilities || []) as Array<string>;
|
|
30
48
|
const ownCapabilitiesContext = Object.keys(allOwnCapabilities).reduce(
|
|
31
49
|
(result, capability) => ({
|
|
32
50
|
...result,
|
|
@@ -38,7 +56,7 @@ export const useCreateOwnCapabilitiesContext = <
|
|
|
38
56
|
);
|
|
39
57
|
|
|
40
58
|
return ownCapabilitiesContext;
|
|
41
|
-
}, [channel.id, overrideCapabilitiesStr,
|
|
59
|
+
}, [channel.id, overrideCapabilitiesStr, own_capabilities]);
|
|
42
60
|
|
|
43
61
|
return ownCapabilitiesContext;
|
|
44
62
|
};
|
|
@@ -215,8 +215,13 @@ const ChatWithContext = <
|
|
|
215
215
|
useSyncDatabase({
|
|
216
216
|
client,
|
|
217
217
|
enableOfflineSupport,
|
|
218
|
+
initialisedDatabase,
|
|
218
219
|
});
|
|
219
220
|
|
|
221
|
+
if (enableOfflineSupport && !initialisedDatabase) {
|
|
222
|
+
return null;
|
|
223
|
+
}
|
|
224
|
+
|
|
220
225
|
return (
|
|
221
226
|
<ChatProvider<StreamChatGenerics> value={chatContext}>
|
|
222
227
|
<TranslationProvider
|
|
@@ -9,22 +9,24 @@ import type { DefaultStreamChatGenerics } from '../../../types/types';
|
|
|
9
9
|
type Params<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
|
|
10
10
|
client: StreamChat<StreamChatGenerics>;
|
|
11
11
|
enableOfflineSupport: boolean;
|
|
12
|
+
initialisedDatabase: boolean;
|
|
12
13
|
};
|
|
13
14
|
export const useSyncDatabase = <
|
|
14
15
|
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
15
16
|
>({
|
|
16
17
|
client,
|
|
17
18
|
enableOfflineSupport,
|
|
19
|
+
initialisedDatabase,
|
|
18
20
|
}: Params<StreamChatGenerics>) => {
|
|
19
21
|
useEffect(() => {
|
|
20
22
|
let listener: ReturnType<StreamChat['on']> | undefined;
|
|
21
23
|
|
|
22
|
-
if (enableOfflineSupport) {
|
|
24
|
+
if (enableOfflineSupport && initialisedDatabase) {
|
|
23
25
|
listener = client?.on(handleEventToSyncDB);
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
return () => {
|
|
27
29
|
listener?.unsubscribe();
|
|
28
30
|
};
|
|
29
|
-
}, [client]);
|
|
31
|
+
}, [client, initialisedDatabase]);
|
|
30
32
|
};
|
|
@@ -590,7 +590,7 @@ const MessageWithContext = <
|
|
|
590
590
|
images: attachments.images,
|
|
591
591
|
message,
|
|
592
592
|
messageActions: messageActions?.filter(Boolean) as MessageActionListItemProps[] | undefined,
|
|
593
|
-
messageContext: { ...messageContext,
|
|
593
|
+
messageContext: { ...messageContext, preventPress: true },
|
|
594
594
|
messageReactionTitle: !error && messageReactions ? t('Message Reactions') : undefined,
|
|
595
595
|
messagesContext: { ...messagesContext, messageContentOrder },
|
|
596
596
|
onlyEmojis,
|
|
@@ -768,6 +768,7 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
768
768
|
) => {
|
|
769
769
|
const {
|
|
770
770
|
chatContext: { mutedUsers: prevMutedUsers },
|
|
771
|
+
disabled: prevDisabled,
|
|
771
772
|
goToMessage: prevGoToMessage,
|
|
772
773
|
groupStyles: prevGroupStyles,
|
|
773
774
|
isAttachmentEqual,
|
|
@@ -781,6 +782,7 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
781
782
|
} = prevProps;
|
|
782
783
|
const {
|
|
783
784
|
chatContext: { mutedUsers: nextMutedUsers },
|
|
785
|
+
disabled: nextDisabled,
|
|
784
786
|
goToMessage: nextGoToMessage,
|
|
785
787
|
groupStyles: nextGroupStyles,
|
|
786
788
|
isTargetedMessage: nextIsTargetedMessage,
|
|
@@ -792,6 +794,9 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
792
794
|
t: nextT,
|
|
793
795
|
} = nextProps;
|
|
794
796
|
|
|
797
|
+
const disabledEqual = prevDisabled === nextDisabled;
|
|
798
|
+
if (!disabledEqual) return false;
|
|
799
|
+
|
|
795
800
|
const membersEqual = Object.keys(prevMembers).length === Object.keys(nextMembers).length;
|
|
796
801
|
if (!membersEqual) return false;
|
|
797
802
|
|
|
@@ -410,6 +410,7 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
410
410
|
nextProps: MessageContentPropsWithContext<StreamChatGenerics>,
|
|
411
411
|
) => {
|
|
412
412
|
const {
|
|
413
|
+
disabled: prevDisabled,
|
|
413
414
|
goToMessage: prevGoToMessage,
|
|
414
415
|
groupStyles: prevGroupStyles,
|
|
415
416
|
hasReactions: prevHasReactions,
|
|
@@ -425,6 +426,7 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
425
426
|
tDateTimeParser: prevTDateTimeParser,
|
|
426
427
|
} = prevProps;
|
|
427
428
|
const {
|
|
429
|
+
disabled: nextDisabled,
|
|
428
430
|
goToMessage: nextGoToMessage,
|
|
429
431
|
groupStyles: nextGroupStyles,
|
|
430
432
|
hasReactions: nextHasReactions,
|
|
@@ -439,6 +441,9 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
439
441
|
tDateTimeParser: nextTDateTimeParser,
|
|
440
442
|
} = nextProps;
|
|
441
443
|
|
|
444
|
+
const disabledEqual = prevDisabled === nextDisabled;
|
|
445
|
+
if (!disabledEqual) return false;
|
|
446
|
+
|
|
442
447
|
const hasReactionsEqual = prevHasReactions === nextHasReactions;
|
|
443
448
|
if (!hasReactionsEqual) return false;
|
|
444
449
|
|
|
@@ -24,7 +24,7 @@ export type MessageSimplePropsWithContext<
|
|
|
24
24
|
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
25
25
|
> = Pick<
|
|
26
26
|
MessageContextValue<StreamChatGenerics>,
|
|
27
|
-
'alignment' | 'channel' | 'groupStyles' | 'hasReactions' | 'message'
|
|
27
|
+
'alignment' | 'channel' | 'disabled' | 'groupStyles' | 'hasReactions' | 'message'
|
|
28
28
|
> &
|
|
29
29
|
Pick<
|
|
30
30
|
MessagesContextValue<StreamChatGenerics>,
|
|
@@ -102,6 +102,7 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
102
102
|
) => {
|
|
103
103
|
const {
|
|
104
104
|
channel: prevChannel,
|
|
105
|
+
disabled: prevDisabled,
|
|
105
106
|
groupStyles: prevGroupStyles,
|
|
106
107
|
hasReactions: prevHasReactions,
|
|
107
108
|
message: prevMessage,
|
|
@@ -109,12 +110,16 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
109
110
|
} = prevProps;
|
|
110
111
|
const {
|
|
111
112
|
channel: nextChannel,
|
|
113
|
+
disabled: nextDisabled,
|
|
112
114
|
groupStyles: nextGroupStyles,
|
|
113
115
|
hasReactions: nextHasReactions,
|
|
114
116
|
message: nextMessage,
|
|
115
117
|
myMessageTheme: nextMyMessageTheme,
|
|
116
118
|
} = nextProps;
|
|
117
119
|
|
|
120
|
+
const disabledEqual = prevDisabled === nextDisabled;
|
|
121
|
+
if (!disabledEqual) return false;
|
|
122
|
+
|
|
118
123
|
const hasReactionsEqual = prevHasReactions === nextHasReactions;
|
|
119
124
|
if (!hasReactionsEqual) return false;
|
|
120
125
|
|
|
@@ -197,7 +202,7 @@ export const MessageSimple = <
|
|
|
197
202
|
>(
|
|
198
203
|
props: MessageSimpleProps<StreamChatGenerics>,
|
|
199
204
|
) => {
|
|
200
|
-
const { alignment, channel, groupStyles, hasReactions, message } =
|
|
205
|
+
const { alignment, channel, disabled, groupStyles, hasReactions, message } =
|
|
201
206
|
useMessageContext<StreamChatGenerics>();
|
|
202
207
|
const {
|
|
203
208
|
enableMessageGroupingByUser,
|
|
@@ -213,6 +218,7 @@ export const MessageSimple = <
|
|
|
213
218
|
{...{
|
|
214
219
|
alignment,
|
|
215
220
|
channel,
|
|
221
|
+
disabled,
|
|
216
222
|
enableMessageGroupingByUser,
|
|
217
223
|
groupStyles,
|
|
218
224
|
hasReactions,
|
|
@@ -792,12 +792,7 @@ export const MessageInput = <
|
|
|
792
792
|
const { isOnline } = useChatContext();
|
|
793
793
|
const ownCapabilities = useOwnCapabilitiesContext();
|
|
794
794
|
|
|
795
|
-
const {
|
|
796
|
-
disabled = false,
|
|
797
|
-
members,
|
|
798
|
-
threadList,
|
|
799
|
-
watchers,
|
|
800
|
-
} = useChannelContext<StreamChatGenerics>();
|
|
795
|
+
const { disabled, members, threadList, watchers } = useChannelContext<StreamChatGenerics>();
|
|
801
796
|
|
|
802
797
|
const {
|
|
803
798
|
additionalTextInputProps,
|
|
@@ -854,7 +849,7 @@ export const MessageInput = <
|
|
|
854
849
|
|
|
855
850
|
const { t } = useTranslationContext();
|
|
856
851
|
|
|
857
|
-
if (!ownCapabilities.sendMessage && SendMessageDisallowedIndicator) {
|
|
852
|
+
if ((disabled || !ownCapabilities.sendMessage) && SendMessageDisallowedIndicator) {
|
|
858
853
|
return <SendMessageDisallowedIndicator />;
|
|
859
854
|
}
|
|
860
855
|
|
|
@@ -899,6 +894,7 @@ export const MessageInput = <
|
|
|
899
894
|
SendButton,
|
|
900
895
|
sending,
|
|
901
896
|
sendMessageAsync,
|
|
897
|
+
SendMessageDisallowedIndicator,
|
|
902
898
|
setGiphyActive,
|
|
903
899
|
setShowMoreOptions,
|
|
904
900
|
showMoreOptions,
|
|
@@ -210,7 +210,7 @@ export type LocalMessageInputContext<
|
|
|
210
210
|
|
|
211
211
|
export type InputMessageInputContextValue<
|
|
212
212
|
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
213
|
-
> = {
|
|
213
|
+
> = Pick<ChannelContextValue<StreamChatGenerics>, 'disabled'> & {
|
|
214
214
|
/**
|
|
215
215
|
* Custom UI component for attach button.
|
|
216
216
|
*
|
|
@@ -20,6 +20,7 @@ export const useCreateMessageInputContext = <
|
|
|
20
20
|
compressImageQuality,
|
|
21
21
|
cooldownEndsAt,
|
|
22
22
|
CooldownTimer,
|
|
23
|
+
disabled,
|
|
23
24
|
doDocUploadRequest,
|
|
24
25
|
doImageUploadRequest,
|
|
25
26
|
editing,
|
|
@@ -124,6 +125,7 @@ export const useCreateMessageInputContext = <
|
|
|
124
125
|
compressImageQuality,
|
|
125
126
|
cooldownEndsAt,
|
|
126
127
|
CooldownTimer,
|
|
128
|
+
disabled,
|
|
127
129
|
doDocUploadRequest,
|
|
128
130
|
doImageUploadRequest,
|
|
129
131
|
editing,
|
|
@@ -200,6 +202,7 @@ export const useCreateMessageInputContext = <
|
|
|
200
202
|
}),
|
|
201
203
|
[
|
|
202
204
|
cooldownEndsAt,
|
|
205
|
+
disabled,
|
|
203
206
|
editingdep,
|
|
204
207
|
fileUploadsValue,
|
|
205
208
|
giphyActive,
|
package/src/i18n/en.json
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"File type not supported": "File type not supported",
|
|
27
27
|
"Flag": "Flag",
|
|
28
28
|
"Flag Message": "Flag Message",
|
|
29
|
-
"Flag action failed either due to a network issue or the message is already flagged": "Flag action failed either due to a network issue or the message is already flagged
|
|
29
|
+
"Flag action failed either due to a network issue or the message is already flagged": "Flag action failed either due to a network issue or the message is already flagged",
|
|
30
30
|
"How about sending your first message to a friend?": "How about sending your first message to a friend?",
|
|
31
31
|
"Instant Commands": "Instant Commands",
|
|
32
32
|
"Let's start chatting!": "Let's start chatting!",
|
package/src/i18n/es.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
|
-
"1 Reply": "",
|
|
3
|
-
"1 Thread Reply": "",
|
|
4
|
-
"Allow access to your Gallery": "",
|
|
5
|
-
"Allow camera access in device settings": "",
|
|
6
|
-
"Also send to channel": "
|
|
7
|
-
"Are you sure you want to permanently delete this message?": "
|
|
8
|
-
"Are you sure?": "",
|
|
9
|
-
"Block User": "
|
|
10
|
-
"Cancel": "
|
|
11
|
-
"Cannot Flag Message": "
|
|
12
|
-
"Consider how your comment might make others feel and be sure to follow our Community Guidelines": "",
|
|
13
|
-
"Copy Message": "
|
|
14
|
-
"Delete": "
|
|
15
|
-
"Delete Message": "
|
|
16
|
-
"Device camera is used to take photos or videos.": "",
|
|
17
|
-
"Do you want to send a copy of this message to a moderator for further investigation?": "
|
|
18
|
-
"Edit Message": "
|
|
2
|
+
"1 Reply": "1 respuesta",
|
|
3
|
+
"1 Thread Reply": "1 respuesta de hilo",
|
|
4
|
+
"Allow access to your Gallery": "Permitir acceso a tu galería",
|
|
5
|
+
"Allow camera access in device settings": "Permitir el acceso a la cámara en la configuración del dispositivo",
|
|
6
|
+
"Also send to channel": "",
|
|
7
|
+
"Are you sure you want to permanently delete this message?": "",
|
|
8
|
+
"Are you sure?": "¿Estás seguro?",
|
|
9
|
+
"Block User": "",
|
|
10
|
+
"Cancel": "",
|
|
11
|
+
"Cannot Flag Message": "",
|
|
12
|
+
"Consider how your comment might make others feel and be sure to follow our Community Guidelines": "Considera cómo tu comentario podría hacer sentir a los demás y asegúrate de seguir nuestras Normas de la Comunidad",
|
|
13
|
+
"Copy Message": "",
|
|
14
|
+
"Delete": "",
|
|
15
|
+
"Delete Message": "",
|
|
16
|
+
"Device camera is used to take photos or videos.": "La cámara del dispositivo se utiliza para tomar fotografías o vídeos.",
|
|
17
|
+
"Do you want to send a copy of this message to a moderator for further investigation?": "",
|
|
18
|
+
"Edit Message": "",
|
|
19
19
|
"Editing Message": "",
|
|
20
20
|
"Emoji matching": "Coincidencia de emoji",
|
|
21
21
|
"Empty message...": "",
|
|
@@ -24,56 +24,56 @@
|
|
|
24
24
|
"Error loading messages for this channel...": "",
|
|
25
25
|
"Error while loading, please reload/refresh": "",
|
|
26
26
|
"File type not supported": "",
|
|
27
|
-
"Flag": "
|
|
28
|
-
"Flag Message": "
|
|
29
|
-
"Flag action failed either due to a network issue or the message is already flagged": "
|
|
27
|
+
"Flag": "",
|
|
28
|
+
"Flag Message": "",
|
|
29
|
+
"Flag action failed either due to a network issue or the message is already flagged": "",
|
|
30
30
|
"How about sending your first message to a friend?": "",
|
|
31
31
|
"Instant Commands": "Comandos instantáneos",
|
|
32
32
|
"Let's start chatting!": "",
|
|
33
|
-
"Links are disabled": "
|
|
34
|
-
"Loading channels...": "",
|
|
35
|
-
"Loading messages...": "",
|
|
36
|
-
"Loading...": "",
|
|
37
|
-
"Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "
|
|
38
|
-
"Message Reactions": "
|
|
33
|
+
"Links are disabled": "",
|
|
34
|
+
"Loading channels...": "Cargando canales...",
|
|
35
|
+
"Loading messages...": "Cargando mensajes...",
|
|
36
|
+
"Loading...": "Cargando...",
|
|
37
|
+
"Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "",
|
|
38
|
+
"Message Reactions": "",
|
|
39
39
|
"Message deleted": "",
|
|
40
|
-
"Message flagged": "
|
|
41
|
-
"Mute User": "
|
|
42
|
-
"Not supported": "",
|
|
40
|
+
"Message flagged": "",
|
|
41
|
+
"Mute User": "",
|
|
42
|
+
"Not supported": "No admitido",
|
|
43
43
|
"Nothing yet...": "",
|
|
44
|
-
"Ok": "
|
|
45
|
-
"Only visible to you": "",
|
|
46
|
-
"Open Settings": "",
|
|
44
|
+
"Ok": "",
|
|
45
|
+
"Only visible to you": "Solo visible para ti",
|
|
46
|
+
"Open Settings": "Configuración abierta",
|
|
47
47
|
"Photo": "Foto",
|
|
48
|
-
"Photos and Videos": "",
|
|
49
|
-
"Pin to Conversation": "
|
|
48
|
+
"Photos and Videos": "Fotos y videos",
|
|
49
|
+
"Pin to Conversation": "",
|
|
50
50
|
"Pinned by": "",
|
|
51
|
-
"Please enable access to your photos and videos so you can share them.": "",
|
|
52
|
-
"Please select a channel first": "
|
|
51
|
+
"Please enable access to your photos and videos so you can share them.": "Por favor, habilita el acceso a tus fotos y videos para poder compartirlos.",
|
|
52
|
+
"Please select a channel first": "",
|
|
53
53
|
"Reconnecting...": "",
|
|
54
|
-
"Reply": "
|
|
54
|
+
"Reply": "",
|
|
55
55
|
"Reply to Message": "",
|
|
56
|
-
"Resend": "
|
|
57
|
-
"Search GIFs": "",
|
|
58
|
-
"Select More Photos": "",
|
|
59
|
-
"Send Anyway": "",
|
|
60
|
-
"Send a message": "",
|
|
61
|
-
"Sending links is not allowed in this conversation": "
|
|
62
|
-
"Slow mode ON": "",
|
|
63
|
-
"The message has been reported to a moderator.": "
|
|
64
|
-
"Thread Reply": "
|
|
65
|
-
"Unblock User": "
|
|
66
|
-
"Unknown User": "",
|
|
67
|
-
"Unmute User": "
|
|
68
|
-
"Unpin from Conversation": "
|
|
69
|
-
"Unread Messages": "
|
|
56
|
+
"Resend": "",
|
|
57
|
+
"Search GIFs": "Buscar GIFs",
|
|
58
|
+
"Select More Photos": "Seleccionar más fotos",
|
|
59
|
+
"Send Anyway": "Enviar de todos modos",
|
|
60
|
+
"Send a message": "Enviar un mensaje",
|
|
61
|
+
"Sending links is not allowed in this conversation": "",
|
|
62
|
+
"Slow mode ON": "Modo lento ACTIVADO",
|
|
63
|
+
"The message has been reported to a moderator.": "",
|
|
64
|
+
"Thread Reply": "",
|
|
65
|
+
"Unblock User": "",
|
|
66
|
+
"Unknown User": "Usuario desconocido",
|
|
67
|
+
"Unmute User": "",
|
|
68
|
+
"Unpin from Conversation": "",
|
|
69
|
+
"Unread Messages": "",
|
|
70
70
|
"Video": "Video",
|
|
71
71
|
"You": "",
|
|
72
|
-
"You can't send messages in this channel": "
|
|
73
|
-
"{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "",
|
|
74
|
-
"{{ index }} of {{ photoLength }}": "",
|
|
75
|
-
"{{ replyCount }} Replies": "",
|
|
76
|
-
"{{ replyCount }} Thread Replies": "",
|
|
77
|
-
"{{ user }} is typing": "",
|
|
72
|
+
"You can't send messages in this channel": "",
|
|
73
|
+
"{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} y {{ nonSelfUserLength }} más están escribiendo",
|
|
74
|
+
"{{ index }} of {{ photoLength }}": "{{ index }} de {{ photoLength }}",
|
|
75
|
+
"{{ replyCount }} Replies": "{{ replyCount }} Respuestas",
|
|
76
|
+
"{{ replyCount }} Thread Replies": "{{ replyCount }} respuestas de hilo",
|
|
77
|
+
"{{ user }} is typing": "{{ user }} está escribiendo",
|
|
78
78
|
"🏙 Attachment...": ""
|
|
79
79
|
}
|