stream-chat-react-native-core 5.22.0-beta.7 → 5.22.0-beta.8
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 +4 -4
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerItem.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/utils/generateMarkdownText.js +7 -5
- package/lib/commonjs/components/Message/MessageSimple/utils/generateMarkdownText.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/utils/generateMarkdownText.test.js +8 -0
- package/lib/commonjs/components/Message/MessageSimple/utils/generateMarkdownText.test.js.map +1 -0
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js +17 -16
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js.map +1 -1
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js +30 -20
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MessageInput.js +1 -1
- package/lib/commonjs/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +7 -7
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/i18n/fr.json +12 -12
- package/lib/commonjs/i18n/hi.json +12 -12
- package/lib/commonjs/i18n/it.json +12 -12
- package/lib/commonjs/i18n/nl.json +12 -12
- package/lib/commonjs/i18n/ru.json +12 -12
- package/lib/commonjs/i18n/tr.json +12 -12
- package/lib/commonjs/types/types.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerItem.js +4 -4
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerItem.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/utils/generateMarkdownText.js +7 -5
- package/lib/module/components/Message/MessageSimple/utils/generateMarkdownText.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/utils/generateMarkdownText.test.js +8 -0
- package/lib/module/components/Message/MessageSimple/utils/generateMarkdownText.test.js.map +1 -0
- package/lib/module/components/Message/MessageSimple/utils/renderText.js +17 -16
- package/lib/module/components/Message/MessageSimple/utils/renderText.js.map +1 -1
- package/lib/module/components/MessageInput/FileUploadPreview.js +30 -20
- package/lib/module/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/MessageInput.js +1 -1
- package/lib/module/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js +7 -7
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/i18n/fr.json +12 -12
- package/lib/module/i18n/hi.json +12 -12
- package/lib/module/i18n/it.json +12 -12
- package/lib/module/i18n/nl.json +12 -12
- package/lib/module/i18n/ru.json +12 -12
- package/lib/module/i18n/tr.json +12 -12
- package/lib/module/types/types.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Message/MessageSimple/utils/generateMarkdownText.d.ts +1 -3
- package/lib/typescript/components/Message/MessageSimple/utils/generateMarkdownText.test.d.ts +1 -0
- package/lib/typescript/i18n/fr.json +12 -12
- package/lib/typescript/i18n/hi.json +12 -12
- package/lib/typescript/i18n/it.json +12 -12
- package/lib/typescript/i18n/nl.json +12 -12
- package/lib/typescript/i18n/ru.json +12 -12
- package/lib/typescript/i18n/tr.json +12 -12
- package/lib/typescript/types/types.d.ts +8 -11
- package/package.json +1 -1
- package/src/components/AttachmentPicker/components/AttachmentPickerItem.tsx +4 -4
- package/src/components/Message/MessageSimple/utils/generateMarkdownText.test.ts +23 -0
- package/src/components/Message/MessageSimple/utils/generateMarkdownText.ts +12 -13
- package/src/components/Message/MessageSimple/utils/renderText.tsx +2 -1
- package/src/components/MessageInput/FileUploadPreview.tsx +16 -1
- package/src/components/MessageInput/MessageInput.tsx +1 -1
- package/src/components/MessageInput/__tests__/MessageInput.test.js +2 -2
- package/src/contexts/messageInputContext/MessageInputContext.tsx +2 -2
- package/src/i18n/fr.json +12 -12
- package/src/i18n/hi.json +12 -12
- package/src/i18n/it.json +12 -12
- package/src/i18n/nl.json +12 -12
- package/src/i18n/ru.json +12 -12
- package/src/i18n/tr.json +12 -12
- package/src/types/types.ts +8 -12
- package/src/version.json +1 -1
|
@@ -15,23 +15,23 @@
|
|
|
15
15
|
"Do you want to send a copy of this message to a moderator for further investigation?": "",
|
|
16
16
|
"Edit Message": "",
|
|
17
17
|
"Editing Message": "",
|
|
18
|
-
"Emoji matching": "",
|
|
18
|
+
"Emoji matching": "Соответствие эмодзи",
|
|
19
19
|
"Empty message...": "",
|
|
20
20
|
"Error loading": "",
|
|
21
21
|
"Error loading channel list...": "",
|
|
22
22
|
"Error loading messages for this channel...": "",
|
|
23
23
|
"Error while loading, please reload/refresh": "",
|
|
24
|
-
"File type not supported": "
|
|
24
|
+
"File type not supported": "",
|
|
25
25
|
"Flag": "",
|
|
26
26
|
"Flag Message": "",
|
|
27
27
|
"Flag action failed either due to a network issue or the message is already flagged": "",
|
|
28
28
|
"How about sending your first message to a friend?": "",
|
|
29
|
-
"Instant Commands": "",
|
|
29
|
+
"Instant Commands": "Мгновенные Команды",
|
|
30
30
|
"Let's start chatting!": "",
|
|
31
31
|
"Links are disabled": "",
|
|
32
|
-
"Loading channels...": "
|
|
33
|
-
"Loading messages...": "
|
|
34
|
-
"Loading...": "
|
|
32
|
+
"Loading channels...": "",
|
|
33
|
+
"Loading messages...": "",
|
|
34
|
+
"Loading...": "",
|
|
35
35
|
"Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "",
|
|
36
36
|
"Message Reactions": "",
|
|
37
37
|
"Message deleted": "",
|
|
@@ -40,23 +40,23 @@
|
|
|
40
40
|
"Not supported": "не поддерживается",
|
|
41
41
|
"Nothing yet...": "",
|
|
42
42
|
"Ok": "",
|
|
43
|
-
"Only visible to you": "
|
|
43
|
+
"Only visible to you": "",
|
|
44
44
|
"Open Settings": "",
|
|
45
45
|
"Photo": "Фото",
|
|
46
46
|
"Photos and Videos": "",
|
|
47
47
|
"Pin to Conversation": "",
|
|
48
48
|
"Pinned by": "",
|
|
49
49
|
"Please enable access to your photos and videos so you can share them.": "",
|
|
50
|
-
"Please select a channel first": "
|
|
50
|
+
"Please select a channel first": "",
|
|
51
51
|
"Reconnecting...": "",
|
|
52
52
|
"Reply": "",
|
|
53
53
|
"Reply to Message": "",
|
|
54
54
|
"Resend": "",
|
|
55
|
-
"Search GIFs": "",
|
|
55
|
+
"Search GIFs": "Поиск GIF",
|
|
56
56
|
"Select More Photos": "",
|
|
57
|
-
"Send a message": "",
|
|
57
|
+
"Send a message": "Отправить сообщение",
|
|
58
58
|
"Sending links is not allowed in this conversation": "",
|
|
59
|
-
"Slow mode ON": "",
|
|
59
|
+
"Slow mode ON": "Медленный режим включен",
|
|
60
60
|
"The message has been reported to a moderator.": "",
|
|
61
61
|
"Thread Reply": "",
|
|
62
62
|
"Unblock User": "",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"Unread Messages": "",
|
|
67
67
|
"Video": "видео",
|
|
68
68
|
"You": "",
|
|
69
|
-
"You can't send messages in this channel": "
|
|
69
|
+
"You can't send messages in this channel": "",
|
|
70
70
|
"{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} и еще {{ nonSelfUserLength }} пишут",
|
|
71
71
|
"{{ index }} of {{ photoLength }}": "",
|
|
72
72
|
"{{ replyCount }} Replies": "",
|
|
@@ -15,23 +15,23 @@
|
|
|
15
15
|
"Do you want to send a copy of this message to a moderator for further investigation?": "",
|
|
16
16
|
"Edit Message": "",
|
|
17
17
|
"Editing Message": "",
|
|
18
|
-
"Emoji matching": "",
|
|
18
|
+
"Emoji matching": "Emoji eşleştirme",
|
|
19
19
|
"Empty message...": "",
|
|
20
20
|
"Error loading": "",
|
|
21
21
|
"Error loading channel list...": "",
|
|
22
22
|
"Error loading messages for this channel...": "",
|
|
23
23
|
"Error while loading, please reload/refresh": "",
|
|
24
|
-
"File type not supported": "
|
|
24
|
+
"File type not supported": "",
|
|
25
25
|
"Flag": "",
|
|
26
26
|
"Flag Message": "",
|
|
27
27
|
"Flag action failed either due to a network issue or the message is already flagged": "",
|
|
28
28
|
"How about sending your first message to a friend?": "",
|
|
29
|
-
"Instant Commands": "",
|
|
29
|
+
"Instant Commands": "Anlık Komutlar",
|
|
30
30
|
"Let's start chatting!": "",
|
|
31
31
|
"Links are disabled": "",
|
|
32
|
-
"Loading channels...": "
|
|
33
|
-
"Loading messages...": "
|
|
34
|
-
"Loading...": "
|
|
32
|
+
"Loading channels...": "",
|
|
33
|
+
"Loading messages...": "",
|
|
34
|
+
"Loading...": "",
|
|
35
35
|
"Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "",
|
|
36
36
|
"Message Reactions": "",
|
|
37
37
|
"Message deleted": "",
|
|
@@ -40,23 +40,23 @@
|
|
|
40
40
|
"Not supported": "Desteklenmiyor",
|
|
41
41
|
"Nothing yet...": "",
|
|
42
42
|
"Ok": "",
|
|
43
|
-
"Only visible to you": "
|
|
43
|
+
"Only visible to you": "",
|
|
44
44
|
"Open Settings": "",
|
|
45
45
|
"Photo": "Fotoğraf",
|
|
46
46
|
"Photos and Videos": "",
|
|
47
47
|
"Pin to Conversation": "",
|
|
48
48
|
"Pinned by": "",
|
|
49
49
|
"Please enable access to your photos and videos so you can share them.": "",
|
|
50
|
-
"Please select a channel first": "
|
|
50
|
+
"Please select a channel first": "",
|
|
51
51
|
"Reconnecting...": "",
|
|
52
52
|
"Reply": "",
|
|
53
53
|
"Reply to Message": "",
|
|
54
54
|
"Resend": "",
|
|
55
|
-
"Search GIFs": "",
|
|
55
|
+
"Search GIFs": "GIF Ara",
|
|
56
56
|
"Select More Photos": "",
|
|
57
|
-
"Send a message": "",
|
|
57
|
+
"Send a message": "Mesaj gönder",
|
|
58
58
|
"Sending links is not allowed in this conversation": "",
|
|
59
|
-
"Slow mode ON": "",
|
|
59
|
+
"Slow mode ON": "Yavaş Mod Açık",
|
|
60
60
|
"The message has been reported to a moderator.": "",
|
|
61
61
|
"Thread Reply": "",
|
|
62
62
|
"Unblock User": "",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"Unread Messages": "",
|
|
67
67
|
"Video": "Video",
|
|
68
68
|
"You": "",
|
|
69
|
-
"You can't send messages in this channel": "
|
|
69
|
+
"You can't send messages in this channel": "",
|
|
70
70
|
"{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} ve {{ nonSelfUserLength }} kişi daha yazıyor",
|
|
71
71
|
"{{ index }} of {{ photoLength }}": "",
|
|
72
72
|
"{{ replyCount }} Replies": "",
|
|
@@ -1,28 +1,25 @@
|
|
|
1
1
|
import type { ExtendableGenerics, LiteralStringForUnion } from 'stream-chat';
|
|
2
2
|
export declare type Asset = {
|
|
3
|
-
duration: number
|
|
4
|
-
filename: string;
|
|
3
|
+
duration: number;
|
|
5
4
|
height: number;
|
|
5
|
+
name: string;
|
|
6
6
|
source: 'camera' | 'picker';
|
|
7
7
|
type: string;
|
|
8
8
|
uri: string;
|
|
9
9
|
width: number;
|
|
10
|
-
fileSize?: number;
|
|
11
10
|
id?: string;
|
|
12
|
-
size?: number
|
|
11
|
+
size?: number;
|
|
13
12
|
};
|
|
14
|
-
export declare type
|
|
13
|
+
export declare type File = {
|
|
15
14
|
name: string;
|
|
15
|
+
duration?: number;
|
|
16
|
+
id?: string;
|
|
16
17
|
mimeType?: string;
|
|
17
|
-
size?: number
|
|
18
|
+
size?: number;
|
|
18
19
|
uri?: string;
|
|
19
20
|
};
|
|
20
|
-
export declare type File = FileAssetType & {
|
|
21
|
-
duration?: string | null;
|
|
22
|
-
id?: string;
|
|
23
|
-
};
|
|
24
21
|
export declare type DefaultAttachmentType = UnknownType & {
|
|
25
|
-
file_size?: number
|
|
22
|
+
file_size?: number;
|
|
26
23
|
mime_type?: string;
|
|
27
24
|
originalFile?: File;
|
|
28
25
|
};
|
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.22.0-beta.
|
|
4
|
+
"version": "5.22.0-beta.8",
|
|
5
5
|
"author": {
|
|
6
6
|
"company": "Stream.io Inc",
|
|
7
7
|
"name": "Stream.io Inc"
|
|
@@ -71,15 +71,15 @@ const AttachmentVideo: React.FC<AttachmentVideoProps> = (props) => {
|
|
|
71
71
|
const localAssetURI = Platform.OS === 'ios' && asset.id && (await getLocalAssetUri(asset.id));
|
|
72
72
|
const uri = localAssetURI || asset.uri || '';
|
|
73
73
|
// We need a mime-type to upload a video file.
|
|
74
|
-
const mimeType = lookup(asset.
|
|
74
|
+
const mimeType = lookup(asset.name) || 'multipart/form-data';
|
|
75
75
|
return [
|
|
76
76
|
...files,
|
|
77
77
|
{
|
|
78
|
-
duration:
|
|
78
|
+
duration: asset.duration,
|
|
79
79
|
id: asset.id,
|
|
80
80
|
mimeType,
|
|
81
|
-
name: asset.
|
|
82
|
-
size: asset.
|
|
81
|
+
name: asset.name,
|
|
82
|
+
size: asset.size,
|
|
83
83
|
uri,
|
|
84
84
|
},
|
|
85
85
|
];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { generateMarkdownText } from './generateMarkdownText';
|
|
2
|
+
|
|
3
|
+
describe('generateMarkdownText', () => {
|
|
4
|
+
it.each([
|
|
5
|
+
['', null],
|
|
6
|
+
[' test message ', 'test message'],
|
|
7
|
+
['https://www.getstream.io', '[https://www.getstream.io](https://www.getstream.io)'],
|
|
8
|
+
[
|
|
9
|
+
'https://getstream-production.s3-accelerate.amazonaws.com/N336903591601695/33e78ef89e64642862a75c5cca2541eaf6b1c924/trimmedVideos/alert/2_270_881/outputVideo.mp4?AWSAccessKeyId=AKIAVJAW2AD2SQVQCBXV&Expires=1699998768&Signature=zdEMCGzf4Pq++16YkPprvN5NAds=',
|
|
10
|
+
'[https://getstream-production.s3-accelerate.amazonaws.com/N336903591601695/33e78ef89e64642862a75c5cca2541eaf6b1c924/trimmedVideos/alert/2_270_881/outputVideo.mp4?AWSAccessKeyId=AKIAVJAW2AD2SQVQCBXV&...](https://getstream-production.s3-accelerate.amazonaws.com/N336903591601695/33e78ef89e64642862a75c5cca2541eaf6b1c924/trimmedVideos/alert/2_270_881/outputVideo.mp4?AWSAccessKeyId=AKIAVJAW2AD2SQVQCBXV&Expires=1699998768&Signature=zdEMCGzf4Pq++16YkPprvN5NAds=)',
|
|
11
|
+
],
|
|
12
|
+
['Hi @getstream.io', 'Hi @getstream.io'],
|
|
13
|
+
[
|
|
14
|
+
'Hi test@gmail.com @test@gmail.com',
|
|
15
|
+
'Hi [test@gmail.com](mailto:test@gmail.com) @test@gmail.com',
|
|
16
|
+
],
|
|
17
|
+
['Hi @getstream.io getstream.io', 'Hi @getstream.io [getstream.io](http://getstream.io)'],
|
|
18
|
+
['Hi <Stream>', 'Hi \\<Stream\\>'],
|
|
19
|
+
])('Returns the generated markdown text for %p and %p', (text, expected) => {
|
|
20
|
+
const result = generateMarkdownText(text);
|
|
21
|
+
expect(result).toBe(expected);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -2,16 +2,12 @@ import truncate from 'lodash/truncate';
|
|
|
2
2
|
|
|
3
3
|
import { parseLinksFromText } from './parseLinks';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
10
|
-
>(
|
|
11
|
-
message: MessageType<StreamChatGenerics>,
|
|
12
|
-
) => {
|
|
13
|
-
const { text } = message;
|
|
5
|
+
// If you need to use any of the special characters literally (actually searching for a "*", for instance), you must escape it by putting a backslash in front of it.
|
|
6
|
+
function escapeRegExp(text: string) {
|
|
7
|
+
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
|
8
|
+
}
|
|
14
9
|
|
|
10
|
+
export const generateMarkdownText = (text?: string) => {
|
|
15
11
|
if (!text) return null;
|
|
16
12
|
|
|
17
13
|
// Trim the extra spaces from the text.
|
|
@@ -26,18 +22,21 @@ export const generateMarkdownText = <
|
|
|
26
22
|
omission: '...',
|
|
27
23
|
});
|
|
28
24
|
// Convert raw links/emails in the text to respective markdown syntax.
|
|
29
|
-
// Eg: Hi getstream.io -> Hi [getstream.io](getstream.io).
|
|
30
|
-
const normalRegEx = new RegExp(linkInfo.raw, 'g');
|
|
25
|
+
// Eg: Hi @getstream.io -> Hi @[getstream.io](getstream.io).
|
|
26
|
+
const normalRegEx = new RegExp(escapeRegExp(linkInfo.raw), 'g');
|
|
31
27
|
const markdown = `[${displayLink}](${linkInfo.encodedUrl})`;
|
|
32
28
|
resultText = text.replace(normalRegEx, markdown);
|
|
33
29
|
|
|
34
30
|
// After previous step, in some cases, the mentioned user after `@` might have a link/email so we convert it back to normal raw text.
|
|
35
31
|
// Eg: Hi, @[test.user@gmail.com](mailto:test.user@gmail.com) to @test.user@gmail.com.
|
|
36
|
-
const mentionsRegex = new RegExp(
|
|
32
|
+
const mentionsRegex = new RegExp(
|
|
33
|
+
`@\\[${escapeRegExp(displayLink)}\\]\\(${escapeRegExp(linkInfo.encodedUrl)}\\)`,
|
|
34
|
+
'g',
|
|
35
|
+
);
|
|
37
36
|
resultText = resultText.replace(mentionsRegex, `@${displayLink}`);
|
|
38
37
|
}
|
|
39
38
|
|
|
40
|
-
resultText = resultText.replace(/[
|
|
39
|
+
resultText = resultText.replace(/[<"'>]/g, '\\$&');
|
|
41
40
|
|
|
42
41
|
return resultText;
|
|
43
42
|
};
|
|
@@ -100,8 +100,9 @@ export const renderText = <
|
|
|
100
100
|
onPress: onPressParam,
|
|
101
101
|
preventPress,
|
|
102
102
|
} = params;
|
|
103
|
+
const { text } = message;
|
|
103
104
|
|
|
104
|
-
const markdownText = generateMarkdownText
|
|
105
|
+
const markdownText = generateMarkdownText(text);
|
|
105
106
|
|
|
106
107
|
const styles: MarkdownStyle = {
|
|
107
108
|
...defaultMarkdownStyles,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { FlatList, I18nManager, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import dayjs from 'dayjs';
|
|
5
|
+
|
|
4
6
|
import { UploadProgressIndicator } from './UploadProgressIndicator';
|
|
5
7
|
|
|
6
8
|
import { ChatContextValue, useChatContext } from '../../contexts';
|
|
@@ -101,6 +103,19 @@ const UnsupportedFileTypeOrFileSizeIndicator = ({
|
|
|
101
103
|
},
|
|
102
104
|
} = useTheme();
|
|
103
105
|
|
|
106
|
+
const ONE_HOUR_IN_SECONDS = 3600;
|
|
107
|
+
let durationLabel = '00:00';
|
|
108
|
+
const videoDuration = item.file.duration;
|
|
109
|
+
|
|
110
|
+
if (videoDuration) {
|
|
111
|
+
const isDurationLongerThanHour = videoDuration / ONE_HOUR_IN_SECONDS >= 1;
|
|
112
|
+
const formattedDurationParam = isDurationLongerThanHour ? 'HH:mm:ss' : 'mm:ss';
|
|
113
|
+
const formattedVideoDuration = dayjs
|
|
114
|
+
.duration(videoDuration, 'second')
|
|
115
|
+
.format(formattedDurationParam);
|
|
116
|
+
durationLabel = formattedVideoDuration;
|
|
117
|
+
}
|
|
118
|
+
|
|
104
119
|
const { t } = useTranslationContext();
|
|
105
120
|
|
|
106
121
|
return indicatorType === ProgressIndicatorTypes.NOT_SUPPORTED ? (
|
|
@@ -117,7 +132,7 @@ const UnsupportedFileTypeOrFileSizeIndicator = ({
|
|
|
117
132
|
</View>
|
|
118
133
|
) : (
|
|
119
134
|
<WritingDirectionAwareText style={[styles.fileSizeText, { color: grey }, fileSizeText]}>
|
|
120
|
-
{
|
|
135
|
+
{videoDuration ? durationLabel : getFileSizeDisplayText(item.file.size)}
|
|
121
136
|
</WritingDirectionAwareText>
|
|
122
137
|
);
|
|
123
138
|
};
|
|
@@ -288,7 +288,7 @@ const MessageInputWithContext = <
|
|
|
288
288
|
// Check if the file size of the image exceeds the threshold of 100MB
|
|
289
289
|
if (
|
|
290
290
|
imageToUpload &&
|
|
291
|
-
Number(imageToUpload.
|
|
291
|
+
Number(imageToUpload.size) / MEGA_BYTES_TO_BYTES > MAX_FILE_SIZE_TO_UPLOAD_IN_MB
|
|
292
292
|
) {
|
|
293
293
|
Alert.alert(
|
|
294
294
|
t(
|
|
@@ -39,12 +39,12 @@ describe('MessageInput', () => {
|
|
|
39
39
|
selectedImages: [
|
|
40
40
|
generateImageAttachment({
|
|
41
41
|
file: { height: 100, uri: 'https://picsum.photos/200/300', width: 100 },
|
|
42
|
-
|
|
42
|
+
size: 500000000,
|
|
43
43
|
uri: 'https://picsum.photos/200/300',
|
|
44
44
|
}),
|
|
45
45
|
generateImageAttachment({
|
|
46
46
|
file: { height: 100, uri: 'https://picsum.photos/200/300', width: 100 },
|
|
47
|
-
|
|
47
|
+
size: 600000000,
|
|
48
48
|
uri: 'https://picsum.photos/200/300',
|
|
49
49
|
}),
|
|
50
50
|
],
|
|
@@ -641,7 +641,7 @@ export const MessageInputProvider = <
|
|
|
641
641
|
};
|
|
642
642
|
|
|
643
643
|
const mapImageUploadToAttachment = (image: ImageUpload) => {
|
|
644
|
-
const mime_type: string | boolean = lookup(image.file.
|
|
644
|
+
const mime_type: string | boolean = lookup(image.file.name as string);
|
|
645
645
|
return {
|
|
646
646
|
fallback: image.file.name,
|
|
647
647
|
image_url: image.url,
|
|
@@ -1006,7 +1006,7 @@ export const MessageInputProvider = <
|
|
|
1006
1006
|
uri,
|
|
1007
1007
|
width: file.width,
|
|
1008
1008
|
}));
|
|
1009
|
-
const filename = file.
|
|
1009
|
+
const filename = file.name ?? uri.replace(/^(file:\/\/|content:\/\/)/, '');
|
|
1010
1010
|
const contentType = lookup(filename) || 'multipart/form-data';
|
|
1011
1011
|
if (value.doImageUploadRequest) {
|
|
1012
1012
|
response = await value.doImageUploadRequest(file, channel);
|
package/src/i18n/fr.json
CHANGED
|
@@ -15,23 +15,23 @@
|
|
|
15
15
|
"Do you want to send a copy of this message to a moderator for further investigation?": "",
|
|
16
16
|
"Edit Message": "",
|
|
17
17
|
"Editing Message": "",
|
|
18
|
-
"Emoji matching": "",
|
|
18
|
+
"Emoji matching": "Correspondance Emoji",
|
|
19
19
|
"Empty message...": "",
|
|
20
20
|
"Error loading": "",
|
|
21
21
|
"Error loading channel list...": "",
|
|
22
22
|
"Error loading messages for this channel...": "",
|
|
23
23
|
"Error while loading, please reload/refresh": "",
|
|
24
|
-
"File type not supported": "
|
|
24
|
+
"File type not supported": "",
|
|
25
25
|
"Flag": "",
|
|
26
26
|
"Flag Message": "",
|
|
27
27
|
"Flag action failed either due to a network issue or the message is already flagged": "",
|
|
28
28
|
"How about sending your first message to a friend?": "",
|
|
29
|
-
"Instant Commands": "",
|
|
29
|
+
"Instant Commands": "Commandes Instantanées",
|
|
30
30
|
"Let's start chatting!": "",
|
|
31
31
|
"Links are disabled": "",
|
|
32
|
-
"Loading channels...": "
|
|
33
|
-
"Loading messages...": "
|
|
34
|
-
"Loading...": "
|
|
32
|
+
"Loading channels...": "",
|
|
33
|
+
"Loading messages...": "",
|
|
34
|
+
"Loading...": "",
|
|
35
35
|
"Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "",
|
|
36
36
|
"Message Reactions": "",
|
|
37
37
|
"Message deleted": "",
|
|
@@ -40,23 +40,23 @@
|
|
|
40
40
|
"Not supported": "Non pris en charge",
|
|
41
41
|
"Nothing yet...": "",
|
|
42
42
|
"Ok": "",
|
|
43
|
-
"Only visible to you": "
|
|
43
|
+
"Only visible to you": "",
|
|
44
44
|
"Open Settings": "",
|
|
45
45
|
"Photo": "Photo",
|
|
46
46
|
"Photos and Videos": "",
|
|
47
47
|
"Pin to Conversation": "",
|
|
48
48
|
"Pinned by": "",
|
|
49
49
|
"Please enable access to your photos and videos so you can share them.": "",
|
|
50
|
-
"Please select a channel first": "
|
|
50
|
+
"Please select a channel first": "",
|
|
51
51
|
"Reconnecting...": "",
|
|
52
52
|
"Reply": "",
|
|
53
53
|
"Reply to Message": "",
|
|
54
54
|
"Resend": "",
|
|
55
|
-
"Search GIFs": "",
|
|
55
|
+
"Search GIFs": "Rechercher des GIF",
|
|
56
56
|
"Select More Photos": "",
|
|
57
|
-
"Send a message": "",
|
|
57
|
+
"Send a message": "Envoyer un message",
|
|
58
58
|
"Sending links is not allowed in this conversation": "",
|
|
59
|
-
"Slow mode ON": "",
|
|
59
|
+
"Slow mode ON": "Mode lent activé",
|
|
60
60
|
"The message has been reported to a moderator.": "",
|
|
61
61
|
"Thread Reply": "",
|
|
62
62
|
"Unblock User": "",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"Unread Messages": "",
|
|
67
67
|
"Video": "Vidéo",
|
|
68
68
|
"You": "",
|
|
69
|
-
"You can't send messages in this channel": "
|
|
69
|
+
"You can't send messages in this channel": "",
|
|
70
70
|
"{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} et {{ nonSelfUserLength }} autres sont en train d'écrire",
|
|
71
71
|
"{{ index }} of {{ photoLength }}": "",
|
|
72
72
|
"{{ replyCount }} Replies": "",
|
package/src/i18n/hi.json
CHANGED
|
@@ -15,23 +15,23 @@
|
|
|
15
15
|
"Do you want to send a copy of this message to a moderator for further investigation?": "",
|
|
16
16
|
"Edit Message": "",
|
|
17
17
|
"Editing Message": "",
|
|
18
|
-
"Emoji matching": "",
|
|
18
|
+
"Emoji matching": "इमोजी मिलान",
|
|
19
19
|
"Empty message...": "",
|
|
20
20
|
"Error loading": "",
|
|
21
21
|
"Error loading channel list...": "",
|
|
22
22
|
"Error loading messages for this channel...": "",
|
|
23
23
|
"Error while loading, please reload/refresh": "",
|
|
24
|
-
"File type not supported": "
|
|
24
|
+
"File type not supported": "",
|
|
25
25
|
"Flag": "",
|
|
26
26
|
"Flag Message": "",
|
|
27
27
|
"Flag action failed either due to a network issue or the message is already flagged": "",
|
|
28
28
|
"How about sending your first message to a friend?": "",
|
|
29
|
-
"Instant Commands": "",
|
|
29
|
+
"Instant Commands": "त्वरित कमांड",
|
|
30
30
|
"Let's start chatting!": "",
|
|
31
31
|
"Links are disabled": "",
|
|
32
|
-
"Loading channels...": "
|
|
33
|
-
"Loading messages...": "
|
|
34
|
-
"Loading...": "
|
|
32
|
+
"Loading channels...": "",
|
|
33
|
+
"Loading messages...": "",
|
|
34
|
+
"Loading...": "",
|
|
35
35
|
"Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "",
|
|
36
36
|
"Message Reactions": "",
|
|
37
37
|
"Message deleted": "",
|
|
@@ -40,23 +40,23 @@
|
|
|
40
40
|
"Not supported": "समर्थित नहीं",
|
|
41
41
|
"Nothing yet...": "",
|
|
42
42
|
"Ok": "",
|
|
43
|
-
"Only visible to you": "
|
|
43
|
+
"Only visible to you": "",
|
|
44
44
|
"Open Settings": "",
|
|
45
45
|
"Photo": "तस्वीर",
|
|
46
46
|
"Photos and Videos": "",
|
|
47
47
|
"Pin to Conversation": "",
|
|
48
48
|
"Pinned by": "",
|
|
49
49
|
"Please enable access to your photos and videos so you can share them.": "",
|
|
50
|
-
"Please select a channel first": "
|
|
50
|
+
"Please select a channel first": "",
|
|
51
51
|
"Reconnecting...": "",
|
|
52
52
|
"Reply": "",
|
|
53
53
|
"Reply to Message": "",
|
|
54
54
|
"Resend": "",
|
|
55
|
-
"Search GIFs": "",
|
|
55
|
+
"Search GIFs": "GIF खोजें",
|
|
56
56
|
"Select More Photos": "",
|
|
57
|
-
"Send a message": "",
|
|
57
|
+
"Send a message": "एक संदेश भेजें",
|
|
58
58
|
"Sending links is not allowed in this conversation": "",
|
|
59
|
-
"Slow mode ON": "",
|
|
59
|
+
"Slow mode ON": "स्लो मोड चालू",
|
|
60
60
|
"The message has been reported to a moderator.": "",
|
|
61
61
|
"Thread Reply": "",
|
|
62
62
|
"Unblock User": "",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"Unread Messages": "",
|
|
67
67
|
"Video": "वीडियो",
|
|
68
68
|
"You": "",
|
|
69
|
-
"You can't send messages in this channel": "
|
|
69
|
+
"You can't send messages in this channel": "",
|
|
70
70
|
"{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} और {{ nonSelfUserLength }} अधिक टाइप कर रहे हैं",
|
|
71
71
|
"{{ index }} of {{ photoLength }}": "",
|
|
72
72
|
"{{ replyCount }} Replies": "",
|
package/src/i18n/it.json
CHANGED
|
@@ -15,23 +15,23 @@
|
|
|
15
15
|
"Do you want to send a copy of this message to a moderator for further investigation?": "",
|
|
16
16
|
"Edit Message": "",
|
|
17
17
|
"Editing Message": "",
|
|
18
|
-
"Emoji matching": "",
|
|
18
|
+
"Emoji matching": "Abbinamento emoji",
|
|
19
19
|
"Empty message...": "",
|
|
20
20
|
"Error loading": "",
|
|
21
21
|
"Error loading channel list...": "",
|
|
22
22
|
"Error loading messages for this channel...": "",
|
|
23
23
|
"Error while loading, please reload/refresh": "",
|
|
24
|
-
"File type not supported": "
|
|
24
|
+
"File type not supported": "",
|
|
25
25
|
"Flag": "",
|
|
26
26
|
"Flag Message": "",
|
|
27
27
|
"Flag action failed either due to a network issue or the message is already flagged": "",
|
|
28
28
|
"How about sending your first message to a friend?": "",
|
|
29
|
-
"Instant Commands": "",
|
|
29
|
+
"Instant Commands": "Comandi Istantanei",
|
|
30
30
|
"Let's start chatting!": "",
|
|
31
31
|
"Links are disabled": "",
|
|
32
|
-
"Loading channels...": "
|
|
33
|
-
"Loading messages...": "
|
|
34
|
-
"Loading...": "
|
|
32
|
+
"Loading channels...": "",
|
|
33
|
+
"Loading messages...": "",
|
|
34
|
+
"Loading...": "",
|
|
35
35
|
"Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "",
|
|
36
36
|
"Message Reactions": "",
|
|
37
37
|
"Message deleted": "",
|
|
@@ -40,23 +40,23 @@
|
|
|
40
40
|
"Not supported": "non supportato",
|
|
41
41
|
"Nothing yet...": "",
|
|
42
42
|
"Ok": "",
|
|
43
|
-
"Only visible to you": "
|
|
43
|
+
"Only visible to you": "",
|
|
44
44
|
"Open Settings": "",
|
|
45
45
|
"Photo": "Foto",
|
|
46
46
|
"Photos and Videos": "",
|
|
47
47
|
"Pin to Conversation": "",
|
|
48
48
|
"Pinned by": "",
|
|
49
49
|
"Please enable access to your photos and videos so you can share them.": "",
|
|
50
|
-
"Please select a channel first": "
|
|
50
|
+
"Please select a channel first": "",
|
|
51
51
|
"Reconnecting...": "",
|
|
52
52
|
"Reply": "",
|
|
53
53
|
"Reply to Message": "",
|
|
54
54
|
"Resend": "",
|
|
55
|
-
"Search GIFs": "",
|
|
55
|
+
"Search GIFs": "Cerca GIF",
|
|
56
56
|
"Select More Photos": "",
|
|
57
|
-
"Send a message": "",
|
|
57
|
+
"Send a message": "Mandare un messaggio",
|
|
58
58
|
"Sending links is not allowed in this conversation": "",
|
|
59
|
-
"Slow mode ON": "",
|
|
59
|
+
"Slow mode ON": "Slowmode attiva",
|
|
60
60
|
"The message has been reported to a moderator.": "",
|
|
61
61
|
"Thread Reply": "",
|
|
62
62
|
"Unblock User": "",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"Unread Messages": "",
|
|
67
67
|
"Video": "Video",
|
|
68
68
|
"You": "",
|
|
69
|
-
"You can't send messages in this channel": "
|
|
69
|
+
"You can't send messages in this channel": "",
|
|
70
70
|
"{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} e altri {{ nonSelfUserLength }} stanno scrivendo",
|
|
71
71
|
"{{ index }} of {{ photoLength }}": "",
|
|
72
72
|
"{{ replyCount }} Replies": "",
|
package/src/i18n/nl.json
CHANGED
|
@@ -15,23 +15,23 @@
|
|
|
15
15
|
"Do you want to send a copy of this message to a moderator for further investigation?": "",
|
|
16
16
|
"Edit Message": "",
|
|
17
17
|
"Editing Message": "",
|
|
18
|
-
"Emoji matching": "",
|
|
18
|
+
"Emoji matching": "Emoji-overeenkomsten",
|
|
19
19
|
"Empty message...": "",
|
|
20
20
|
"Error loading": "",
|
|
21
21
|
"Error loading channel list...": "",
|
|
22
22
|
"Error loading messages for this channel...": "",
|
|
23
23
|
"Error while loading, please reload/refresh": "",
|
|
24
|
-
"File type not supported": "
|
|
24
|
+
"File type not supported": "",
|
|
25
25
|
"Flag": "",
|
|
26
26
|
"Flag Message": "",
|
|
27
27
|
"Flag action failed either due to a network issue or the message is already flagged": "",
|
|
28
28
|
"How about sending your first message to a friend?": "",
|
|
29
|
-
"Instant Commands": "",
|
|
29
|
+
"Instant Commands": "Directe Opdrachten",
|
|
30
30
|
"Let's start chatting!": "",
|
|
31
31
|
"Links are disabled": "",
|
|
32
|
-
"Loading channels...": "
|
|
33
|
-
"Loading messages...": "
|
|
34
|
-
"Loading...": "
|
|
32
|
+
"Loading channels...": "",
|
|
33
|
+
"Loading messages...": "",
|
|
34
|
+
"Loading...": "",
|
|
35
35
|
"Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "",
|
|
36
36
|
"Message Reactions": "",
|
|
37
37
|
"Message deleted": "",
|
|
@@ -40,23 +40,23 @@
|
|
|
40
40
|
"Not supported": "niet ondersteund",
|
|
41
41
|
"Nothing yet...": "",
|
|
42
42
|
"Ok": "",
|
|
43
|
-
"Only visible to you": "
|
|
43
|
+
"Only visible to you": "",
|
|
44
44
|
"Open Settings": "",
|
|
45
45
|
"Photo": "Foto",
|
|
46
46
|
"Photos and Videos": "",
|
|
47
47
|
"Pin to Conversation": "",
|
|
48
48
|
"Pinned by": "",
|
|
49
49
|
"Please enable access to your photos and videos so you can share them.": "",
|
|
50
|
-
"Please select a channel first": "
|
|
50
|
+
"Please select a channel first": "",
|
|
51
51
|
"Reconnecting...": "",
|
|
52
52
|
"Reply": "",
|
|
53
53
|
"Reply to Message": "",
|
|
54
54
|
"Resend": "",
|
|
55
|
-
"Search GIFs": "",
|
|
55
|
+
"Search GIFs": "Zoek GIF's",
|
|
56
56
|
"Select More Photos": "",
|
|
57
|
-
"Send a message": "",
|
|
57
|
+
"Send a message": "Stuur een bericht",
|
|
58
58
|
"Sending links is not allowed in this conversation": "",
|
|
59
|
-
"Slow mode ON": "",
|
|
59
|
+
"Slow mode ON": "Langzame modus aan",
|
|
60
60
|
"The message has been reported to a moderator.": "",
|
|
61
61
|
"Thread Reply": "",
|
|
62
62
|
"Unblock User": "",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"Unread Messages": "",
|
|
67
67
|
"Video": "Video",
|
|
68
68
|
"You": "",
|
|
69
|
-
"You can't send messages in this channel": "
|
|
69
|
+
"You can't send messages in this channel": "",
|
|
70
70
|
"{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} en {{ nonSelfUserLength }} anderen zijn aan het typen",
|
|
71
71
|
"{{ index }} of {{ photoLength }}": "",
|
|
72
72
|
"{{ replyCount }} Replies": "",
|