stream-chat-react-native-core 5.21.0 → 5.22.0-beta.10
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/README.md +10 -5
- package/lib/commonjs/components/Attachment/AudioAttachment.js +12 -12
- package/lib/commonjs/components/Attachment/AudioAttachment.js.map +1 -1
- package/lib/commonjs/components/Attachment/FileAttachment.js +10 -7
- package/lib/commonjs/components/Attachment/FileAttachment.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js +8 -6
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerItem.js +24 -20
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerItem.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentSelectionBar.js +26 -11
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentSelectionBar.js.map +1 -1
- package/lib/commonjs/components/Channel/Channel.js +65 -46
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js +2 -0
- package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js +2 -2
- package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js +16 -14
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js +4 -2
- package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +30 -32
- package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js +7 -5
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryVideo.js +10 -8
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryVideo.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +18 -15
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js +41 -12
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGrid.js +10 -8
- package/lib/commonjs/components/ImageGallery/components/ImageGrid.js.map +1 -1
- package/lib/commonjs/components/Indicators/EmptyStateIndicator.js +17 -12
- package/lib/commonjs/components/Indicators/EmptyStateIndicator.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +20 -17
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/ReactionList.js +18 -17
- package/lib/commonjs/components/Message/MessageSimple/ReactionList.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 +25 -17
- 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/ImageUploadPreview.js +13 -13
- package/lib/commonjs/components/MessageInput/ImageUploadPreview.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/components/MessageInput/UploadProgressIndicator.js.map +1 -1
- package/lib/commonjs/components/MessageList/InlineUnreadIndicator.js +13 -11
- package/lib/commonjs/components/MessageList/InlineUnreadIndicator.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageActionList.js +8 -14
- package/lib/commonjs/components/MessageOverlay/MessageActionList.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js +11 -8
- package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js +32 -29
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js.map +1 -1
- package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js +17 -15
- package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js.map +1 -1
- package/lib/commonjs/contexts/channelContext/ChannelContext.js +2 -2
- package/lib/commonjs/contexts/channelContext/ChannelContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +66 -45
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +2 -2
- package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/hooks/useMessageDetailsForState.js.map +1 -1
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/commonjs/contexts/themeContext/utils/theme.js +1 -4
- package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/commonjs/hooks/index.js +11 -0
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/hooks/useViewport.js +47 -0
- package/lib/commonjs/hooks/useViewport.js.map +1 -0
- package/lib/commonjs/i18n/en.json +6 -1
- package/lib/commonjs/i18n/es.json +77 -0
- package/lib/commonjs/i18n/fr.json +65 -60
- package/lib/commonjs/i18n/he.json +6 -1
- package/lib/commonjs/i18n/hi.json +65 -60
- package/lib/commonjs/i18n/it.json +65 -60
- package/lib/commonjs/i18n/ja.json +6 -1
- package/lib/commonjs/i18n/ko.json +6 -1
- package/lib/commonjs/i18n/nl.json +65 -60
- package/lib/commonjs/i18n/ru.json +65 -60
- package/lib/commonjs/i18n/tr.json +65 -60
- package/lib/commonjs/native.js.map +1 -1
- package/lib/commonjs/types/types.js.map +1 -1
- package/lib/commonjs/utils/Streami18n.js +4 -1
- package/lib/commonjs/utils/Streami18n.js.map +1 -1
- package/lib/commonjs/utils/compressImage.js +37 -0
- package/lib/commonjs/utils/compressImage.js.map +1 -0
- package/lib/commonjs/utils/utils.js +1 -15
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/AudioAttachment.js +12 -12
- package/lib/module/components/Attachment/AudioAttachment.js.map +1 -1
- package/lib/module/components/Attachment/FileAttachment.js +10 -7
- package/lib/module/components/Attachment/FileAttachment.js.map +1 -1
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js +8 -6
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerItem.js +24 -20
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerItem.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentSelectionBar.js +26 -11
- package/lib/module/components/AttachmentPicker/components/AttachmentSelectionBar.js.map +1 -1
- package/lib/module/components/Channel/Channel.js +65 -46
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateChannelContext.js +2 -0
- package/lib/module/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js +2 -2
- package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js +16 -14
- package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js.map +1 -1
- package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js +4 -2
- package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js.map +1 -1
- package/lib/module/components/ImageGallery/ImageGallery.js +30 -32
- package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js +7 -5
- package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
- package/lib/module/components/ImageGallery/components/AnimatedGalleryVideo.js +10 -8
- package/lib/module/components/ImageGallery/components/AnimatedGalleryVideo.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +18 -15
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js +41 -12
- package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGrid.js +10 -8
- package/lib/module/components/ImageGallery/components/ImageGrid.js.map +1 -1
- package/lib/module/components/Indicators/EmptyStateIndicator.js +17 -12
- package/lib/module/components/Indicators/EmptyStateIndicator.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageContent.js +20 -17
- package/lib/module/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/ReactionList.js +18 -17
- package/lib/module/components/Message/MessageSimple/ReactionList.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 +25 -17
- 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/ImageUploadPreview.js +13 -13
- package/lib/module/components/MessageInput/ImageUploadPreview.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/components/MessageInput/UploadProgressIndicator.js.map +1 -1
- package/lib/module/components/MessageList/InlineUnreadIndicator.js +13 -11
- package/lib/module/components/MessageList/InlineUnreadIndicator.js.map +1 -1
- package/lib/module/components/MessageOverlay/MessageActionList.js +8 -14
- package/lib/module/components/MessageOverlay/MessageActionList.js.map +1 -1
- package/lib/module/components/MessageOverlay/MessageActionListItem.js +11 -8
- package/lib/module/components/MessageOverlay/MessageActionListItem.js.map +1 -1
- package/lib/module/components/MessageOverlay/MessageOverlay.js +32 -29
- package/lib/module/components/MessageOverlay/MessageOverlay.js.map +1 -1
- package/lib/module/components/Thread/components/ThreadFooterComponent.js +17 -15
- package/lib/module/components/Thread/components/ThreadFooterComponent.js.map +1 -1
- package/lib/module/contexts/channelContext/ChannelContext.js +2 -2
- package/lib/module/contexts/channelContext/ChannelContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js +66 -45
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +2 -2
- package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/hooks/useMessageDetailsForState.js.map +1 -1
- package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/module/contexts/themeContext/utils/theme.js +1 -4
- package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/module/hooks/index.js +11 -0
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/useViewport.js +47 -0
- package/lib/module/hooks/useViewport.js.map +1 -0
- package/lib/module/i18n/en.json +6 -1
- package/lib/module/i18n/es.json +77 -0
- package/lib/module/i18n/fr.json +65 -60
- package/lib/module/i18n/he.json +6 -1
- package/lib/module/i18n/hi.json +65 -60
- package/lib/module/i18n/it.json +65 -60
- package/lib/module/i18n/ja.json +6 -1
- package/lib/module/i18n/ko.json +6 -1
- package/lib/module/i18n/nl.json +65 -60
- package/lib/module/i18n/ru.json +65 -60
- package/lib/module/i18n/tr.json +65 -60
- package/lib/module/native.js.map +1 -1
- package/lib/module/types/types.js.map +1 -1
- package/lib/module/utils/Streami18n.js +4 -1
- package/lib/module/utils/Streami18n.js.map +1 -1
- package/lib/module/utils/compressImage.js +37 -0
- package/lib/module/utils/compressImage.js.map +1 -0
- package/lib/module/utils/utils.js +1 -15
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Attachment/AudioAttachment.d.ts +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateChannelContext.d.ts +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGalleryFooter.d.ts +3 -0
- 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/components/Message/hooks/useMessageActionHandlers.d.ts +1 -1
- package/lib/typescript/components/Message/hooks/useMessageActions.d.ts +1 -1
- package/lib/typescript/components/MessageInput/UploadProgressIndicator.d.ts +5 -2
- package/lib/typescript/contexts/channelContext/ChannelContext.d.ts +5 -0
- package/lib/typescript/contexts/messageContext/MessageContext.d.ts +1 -1
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +3 -23
- package/lib/typescript/contexts/messageInputContext/hooks/useMessageDetailsForState.d.ts +2 -2
- package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +2 -2
- package/lib/typescript/contexts/themeContext/utils/theme.d.ts +1 -3
- package/lib/typescript/hooks/index.d.ts +1 -0
- package/lib/typescript/hooks/useViewport.d.ts +11 -0
- package/lib/typescript/i18n/en.json +6 -1
- package/lib/typescript/i18n/es.json +77 -0
- package/lib/typescript/i18n/fr.json +65 -60
- package/lib/typescript/i18n/he.json +6 -1
- package/lib/typescript/i18n/hi.json +65 -60
- package/lib/typescript/i18n/it.json +65 -60
- package/lib/typescript/i18n/ja.json +6 -1
- package/lib/typescript/i18n/ko.json +6 -1
- package/lib/typescript/i18n/nl.json +65 -60
- package/lib/typescript/i18n/ru.json +65 -60
- package/lib/typescript/i18n/tr.json +65 -60
- package/lib/typescript/native.d.ts +2 -0
- package/lib/typescript/store/mappers/mapStorableToChannel.d.ts +1 -1
- package/lib/typescript/types/types.d.ts +27 -10
- package/lib/typescript/utils/Streami18n.d.ts +7 -1
- package/lib/typescript/utils/compressImage.d.ts +8 -0
- package/lib/typescript/utils/utils.d.ts +0 -2
- package/package.json +2 -2
- package/src/components/Attachment/AudioAttachment.tsx +2 -1
- package/src/components/Attachment/FileAttachment.tsx +12 -3
- package/src/components/AttachmentPicker/AttachmentPicker.tsx +4 -2
- package/src/components/AttachmentPicker/components/AttachmentPickerItem.tsx +7 -5
- package/src/components/AttachmentPicker/components/AttachmentSelectionBar.tsx +13 -1
- package/src/components/Channel/Channel.tsx +32 -8
- package/src/components/Channel/hooks/useCreateChannelContext.ts +2 -0
- package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +2 -9
- package/src/components/ChannelPreview/ChannelPreviewMessenger.tsx +4 -3
- package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayName.ts +4 -3
- package/src/components/ImageGallery/ImageGallery.tsx +10 -19
- package/src/components/ImageGallery/components/AnimatedGalleryImage.tsx +5 -3
- package/src/components/ImageGallery/components/AnimatedGalleryVideo.tsx +5 -3
- package/src/components/ImageGallery/components/ImageGalleryFooter.tsx +6 -2
- package/src/components/ImageGallery/components/ImageGalleryVideoControl.tsx +12 -7
- package/src/components/ImageGallery/components/ImageGrid.tsx +2 -1
- package/src/components/Indicators/EmptyStateIndicator.tsx +8 -7
- package/src/components/Message/MessageSimple/MessageContent.tsx +3 -1
- package/src/components/Message/MessageSimple/ReactionList.tsx +2 -1
- 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 +12 -2
- package/src/components/MessageInput/FileUploadPreview.tsx +17 -3
- package/src/components/MessageInput/ImageUploadPreview.tsx +1 -2
- package/src/components/MessageInput/MessageInput.tsx +1 -1
- package/src/components/MessageInput/UploadProgressIndicator.tsx +2 -2
- package/src/components/MessageInput/__tests__/AudioAttachmentUploadPreviewExpo.test.tsx +1 -1
- package/src/components/MessageInput/__tests__/AudioAttachmentUploadPreviewNative.test.tsx +1 -1
- package/src/components/MessageInput/__tests__/MessageInput.test.js +2 -2
- package/src/components/MessageList/InlineUnreadIndicator.tsx +2 -1
- package/src/components/MessageOverlay/MessageActionList.tsx +3 -11
- package/src/components/MessageOverlay/MessageActionListItem.tsx +5 -2
- package/src/components/MessageOverlay/MessageOverlay.tsx +5 -3
- package/src/components/Thread/components/ThreadFooterComponent.tsx +2 -1
- package/src/contexts/channelContext/ChannelContext.tsx +5 -0
- package/src/contexts/messageInputContext/MessageInputContext.tsx +81 -69
- package/src/contexts/messageInputContext/__tests__/__snapshots__/sendMessage.test.tsx.snap +3 -3
- package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +2 -2
- package/src/contexts/messageInputContext/hooks/useMessageDetailsForState.ts +2 -2
- package/src/contexts/messagesContext/MessagesContext.tsx +2 -2
- package/src/contexts/themeContext/utils/theme.ts +2 -7
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useViewport.ts +41 -0
- package/src/i18n/en.json +6 -1
- package/src/i18n/es.json +77 -0
- package/src/i18n/fr.json +65 -60
- package/src/i18n/he.json +6 -1
- package/src/i18n/hi.json +65 -60
- package/src/i18n/it.json +65 -60
- package/src/i18n/ja.json +6 -1
- package/src/i18n/ko.json +6 -1
- package/src/i18n/nl.json +65 -60
- package/src/i18n/ru.json +65 -60
- package/src/i18n/tr.json +65 -60
- package/src/native.ts +5 -1
- package/src/types/types.ts +29 -10
- package/src/utils/Streami18n.ts +13 -6
- package/src/utils/compressImage.ts +32 -0
- package/src/utils/utils.ts +0 -13
- package/src/version.json +1 -1
package/src/types/types.ts
CHANGED
|
@@ -1,35 +1,54 @@
|
|
|
1
1
|
import type { ExtendableGenerics, LiteralStringForUnion } from 'stream-chat';
|
|
2
2
|
|
|
3
|
+
import type { FileStateValue } from '../utils/utils';
|
|
4
|
+
|
|
3
5
|
export type Asset = {
|
|
4
|
-
duration: number
|
|
5
|
-
filename: string;
|
|
6
|
+
duration: number;
|
|
6
7
|
height: number;
|
|
8
|
+
name: string;
|
|
7
9
|
source: 'camera' | 'picker';
|
|
8
10
|
type: string;
|
|
9
11
|
uri: string;
|
|
10
12
|
width: number;
|
|
11
|
-
fileSize?: number;
|
|
12
13
|
id?: string;
|
|
13
|
-
size?: number
|
|
14
|
+
size?: number;
|
|
14
15
|
};
|
|
15
16
|
|
|
16
|
-
export type
|
|
17
|
+
export type File = {
|
|
17
18
|
name: string;
|
|
19
|
+
duration?: number;
|
|
20
|
+
id?: string;
|
|
18
21
|
mimeType?: string;
|
|
19
|
-
size?: number
|
|
22
|
+
size?: number;
|
|
20
23
|
// The uri should be of type `string`. But is `string|undefined` because the same type is used for the response from Stream's Attachment. This shall be fixed.
|
|
21
24
|
uri?: string;
|
|
22
25
|
};
|
|
23
26
|
|
|
24
|
-
export type
|
|
25
|
-
|
|
26
|
-
id
|
|
27
|
+
export type FileUpload = {
|
|
28
|
+
file: File;
|
|
29
|
+
id: string;
|
|
30
|
+
state: FileStateValue;
|
|
31
|
+
duration?: number;
|
|
32
|
+
paused?: boolean;
|
|
33
|
+
progress?: number;
|
|
34
|
+
thumb_url?: string;
|
|
35
|
+
url?: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type ImageUpload = {
|
|
39
|
+
file: Partial<Asset>;
|
|
40
|
+
id: string;
|
|
41
|
+
state: FileStateValue;
|
|
42
|
+
height?: number;
|
|
43
|
+
url?: string;
|
|
44
|
+
width?: number;
|
|
27
45
|
};
|
|
28
46
|
|
|
29
47
|
export type DefaultAttachmentType = UnknownType & {
|
|
30
|
-
file_size?: number
|
|
48
|
+
file_size?: number;
|
|
31
49
|
mime_type?: string;
|
|
32
50
|
originalFile?: File;
|
|
51
|
+
originalImage?: Partial<Asset>;
|
|
33
52
|
};
|
|
34
53
|
|
|
35
54
|
interface DefaultUserType extends UnknownType {
|
package/src/utils/Streami18n.ts
CHANGED
|
@@ -10,6 +10,7 @@ import type moment from 'moment';
|
|
|
10
10
|
|
|
11
11
|
import type { TDateTimeParser } from '../contexts/translationContext/TranslationContext';
|
|
12
12
|
import enTranslations from '../i18n/en.json';
|
|
13
|
+
import esTranslations from '../i18n/es.json';
|
|
13
14
|
import frTranslations from '../i18n/fr.json';
|
|
14
15
|
import heTranslations from '../i18n/he.json';
|
|
15
16
|
import hiTranslations from '../i18n/hi.json';
|
|
@@ -20,7 +21,9 @@ import nlTranslations from '../i18n/nl.json';
|
|
|
20
21
|
import ruTranslations from '../i18n/ru.json';
|
|
21
22
|
import trTranslations from '../i18n/tr.json';
|
|
22
23
|
|
|
24
|
+
import 'dayjs/locale/es';
|
|
23
25
|
import 'dayjs/locale/fr';
|
|
26
|
+
import 'dayjs/locale/he';
|
|
24
27
|
import 'dayjs/locale/hi';
|
|
25
28
|
import 'dayjs/locale/it';
|
|
26
29
|
import 'dayjs/locale/ja';
|
|
@@ -28,7 +31,6 @@ import 'dayjs/locale/ko';
|
|
|
28
31
|
import 'dayjs/locale/nl';
|
|
29
32
|
import 'dayjs/locale/ru';
|
|
30
33
|
import 'dayjs/locale/tr';
|
|
31
|
-
import 'dayjs/locale/he';
|
|
32
34
|
|
|
33
35
|
/**
|
|
34
36
|
* These locale imports also set these locales globally.
|
|
@@ -192,12 +194,16 @@ type I18NextConfig = {
|
|
|
192
194
|
* Instance of this class should be provided to Chat component to handle translations.
|
|
193
195
|
* Stream provides following list of in-built translations:
|
|
194
196
|
* 1. English (en)
|
|
195
|
-
* 2.
|
|
196
|
-
* 3.
|
|
197
|
-
* 4.
|
|
198
|
-
* 5.
|
|
197
|
+
* 2. Spanish (es)
|
|
198
|
+
* 3. French (fr)
|
|
199
|
+
* 4. Hebrew (he)
|
|
200
|
+
* 5. Hindi (hi)
|
|
199
201
|
* 6. Italian (it)
|
|
200
|
-
* 7.
|
|
202
|
+
* 7. Japanese (ja)
|
|
203
|
+
* 8. Korean (ko)
|
|
204
|
+
* 9. Dutch (nl)
|
|
205
|
+
* 10. Russian (ru)
|
|
206
|
+
* 11. Turkish (tr)
|
|
201
207
|
*
|
|
202
208
|
* Simplest way to start using chat components in one of the in-built languages would be following:
|
|
203
209
|
*
|
|
@@ -370,6 +376,7 @@ export class Streami18n {
|
|
|
370
376
|
};
|
|
371
377
|
} = {
|
|
372
378
|
en: { [defaultNS]: enTranslations },
|
|
379
|
+
es: { [defaultNS]: esTranslations },
|
|
373
380
|
fr: { [defaultNS]: frTranslations },
|
|
374
381
|
he: { [defaultNS]: heTranslations },
|
|
375
382
|
hi: { [defaultNS]: hiTranslations },
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { compressImage } from '../native';
|
|
2
|
+
import type { Asset } from '../types/types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Function to compress and Image and return the compressed Image URI
|
|
6
|
+
* @param image
|
|
7
|
+
* @param compressImageQuality
|
|
8
|
+
* @returns string
|
|
9
|
+
*/
|
|
10
|
+
export const compressedImageURI = async (image: Partial<Asset>, compressImageQuality?: number) => {
|
|
11
|
+
const uri = image.uri || '';
|
|
12
|
+
/**
|
|
13
|
+
* We skip compression if:
|
|
14
|
+
* - the file is from the camera as that should already be compressed
|
|
15
|
+
* - the file has no height/width value to maintain for compression
|
|
16
|
+
* - the compressImageQuality number is not present or is 1 (meaning no compression)
|
|
17
|
+
*/
|
|
18
|
+
const compressedUri = await (image.source === 'camera' ||
|
|
19
|
+
!image.height ||
|
|
20
|
+
!image.width ||
|
|
21
|
+
typeof compressImageQuality !== 'number' ||
|
|
22
|
+
compressImageQuality === 1
|
|
23
|
+
? uri
|
|
24
|
+
: compressImage({
|
|
25
|
+
compressImageQuality,
|
|
26
|
+
height: image.height,
|
|
27
|
+
uri,
|
|
28
|
+
width: image.width,
|
|
29
|
+
}));
|
|
30
|
+
|
|
31
|
+
return compressedUri;
|
|
32
|
+
};
|
package/src/utils/utils.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import { Dimensions } from 'react-native';
|
|
3
2
|
|
|
4
3
|
import type { DebouncedFunc } from 'lodash';
|
|
5
4
|
import debounce from 'lodash/debounce';
|
|
@@ -519,18 +518,6 @@ export const getUrlWithoutParams = (url?: string) => {
|
|
|
519
518
|
|
|
520
519
|
export const isLocalUrl = (url: string) => url.indexOf('http') !== 0;
|
|
521
520
|
|
|
522
|
-
export const vw = (percentageWidth: number, rounded = false) => {
|
|
523
|
-
const value = Dimensions.get('window').width * (percentageWidth / 100);
|
|
524
|
-
return rounded ? Math.round(value) : value;
|
|
525
|
-
};
|
|
526
|
-
|
|
527
|
-
export const vh = (percentageHeight: number, rounded = false) => {
|
|
528
|
-
const height = Dimensions.get('window').height;
|
|
529
|
-
|
|
530
|
-
const value = height * (percentageHeight / 100);
|
|
531
|
-
return rounded ? Math.round(value) : value;
|
|
532
|
-
};
|
|
533
|
-
|
|
534
521
|
export const generateRandomId = (a = ''): string =>
|
|
535
522
|
a
|
|
536
523
|
? /* eslint-disable no-bitwise */
|
package/src/version.json
CHANGED