stream-chat-react-native-core 4.8.0-beta.1 → 4.9.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/Attachment/GallaryImage.js +41 -0
- package/lib/commonjs/components/Attachment/GallaryImage.js.map +1 -0
- package/lib/commonjs/components/Attachment/Gallery.js +101 -36
- package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
- package/lib/commonjs/components/Attachment/Giphy.js +118 -25
- package/lib/commonjs/components/Attachment/Giphy.js.map +1 -1
- package/lib/commonjs/components/Attachment/ImageLoadingFailedIndicator.js +105 -0
- package/lib/commonjs/components/Attachment/ImageLoadingFailedIndicator.js.map +1 -0
- package/lib/commonjs/components/Attachment/ImageLoadingIndicator.js +58 -0
- package/lib/commonjs/components/Attachment/ImageLoadingIndicator.js.map +1 -0
- package/lib/commonjs/components/Attachment/hooks/useLoadingImage.js +32 -0
- package/lib/commonjs/components/Attachment/hooks/useLoadingImage.js.map +1 -0
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteInput.js +3 -2
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteInput.js.map +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionItem.js.map +1 -1
- package/lib/commonjs/components/Channel/Channel.js +23 -13
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js +4 -0
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useLatestMessagePreview.js +43 -19
- package/lib/commonjs/components/ChannelPreview/hooks/useLatestMessagePreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js +20 -19
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/ImageUploadPreview.js +14 -15
- package/lib/commonjs/components/MessageInput/ImageUploadPreview.js.map +1 -1
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js +2 -2
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/commonjs/contexts/themeContext/utils/theme.js +4 -0
- package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/commonjs/mock-builders/api/channelMocks.js +299 -0
- package/lib/commonjs/mock-builders/api/channelMocks.js.map +1 -0
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/GallaryImage.js +41 -0
- package/lib/module/components/Attachment/GallaryImage.js.map +1 -0
- package/lib/module/components/Attachment/Gallery.js +101 -36
- package/lib/module/components/Attachment/Gallery.js.map +1 -1
- package/lib/module/components/Attachment/Giphy.js +118 -25
- package/lib/module/components/Attachment/Giphy.js.map +1 -1
- package/lib/module/components/Attachment/ImageLoadingFailedIndicator.js +105 -0
- package/lib/module/components/Attachment/ImageLoadingFailedIndicator.js.map +1 -0
- package/lib/module/components/Attachment/ImageLoadingIndicator.js +58 -0
- package/lib/module/components/Attachment/ImageLoadingIndicator.js.map +1 -0
- package/lib/module/components/Attachment/hooks/useLoadingImage.js +32 -0
- package/lib/module/components/Attachment/hooks/useLoadingImage.js.map +1 -0
- package/lib/module/components/AutoCompleteInput/AutoCompleteInput.js +3 -2
- package/lib/module/components/AutoCompleteInput/AutoCompleteInput.js.map +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionItem.js.map +1 -1
- package/lib/module/components/Channel/Channel.js +23 -13
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js +4 -0
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/module/components/ChannelPreview/hooks/useLatestMessagePreview.js +43 -19
- package/lib/module/components/ChannelPreview/hooks/useLatestMessagePreview.js.map +1 -1
- package/lib/module/components/MessageInput/FileUploadPreview.js +20 -19
- package/lib/module/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/ImageUploadPreview.js +14 -15
- package/lib/module/components/MessageInput/ImageUploadPreview.js.map +1 -1
- package/lib/module/contexts/messagesContext/MessagesContext.js +2 -2
- package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/module/contexts/themeContext/utils/theme.js +4 -0
- package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/module/mock-builders/api/channelMocks.js +299 -0
- package/lib/module/mock-builders/api/channelMocks.js.map +1 -0
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Attachment/GallaryImage.d.ts +5 -0
- package/lib/typescript/components/Attachment/Gallery.d.ts +1 -1
- package/lib/typescript/components/Attachment/Giphy.d.ts +1 -1
- package/lib/typescript/components/Attachment/ImageLoadingFailedIndicator.d.ts +3 -0
- package/lib/typescript/components/Attachment/ImageLoadingIndicator.d.ts +3 -0
- package/lib/typescript/components/Attachment/hooks/useLoadingImage.d.ts +7 -0
- package/lib/typescript/components/Channel/Channel.d.ts +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts +1 -1
- package/lib/typescript/components/ChannelPreview/hooks/__tests__/useLatestMessagePreview.test.d.ts +1 -0
- package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +10 -0
- package/lib/typescript/contexts/themeContext/utils/theme.d.ts +4 -0
- package/lib/typescript/mock-builders/api/channelMocks.d.ts +14 -0
- package/package.json +1 -1
- package/src/components/Attachment/GallaryImage.tsx +22 -0
- package/src/components/Attachment/Gallery.tsx +68 -35
- package/src/components/Attachment/Giphy.tsx +68 -1
- package/src/components/Attachment/ImageLoadingFailedIndicator.tsx +56 -0
- package/src/components/Attachment/ImageLoadingIndicator.tsx +31 -0
- package/src/components/Attachment/__tests__/Attachment.test.js +9 -3
- package/src/components/Attachment/__tests__/Gallery.test.js +36 -1
- package/src/components/Attachment/__tests__/Giphy.test.js +110 -90
- package/src/components/Attachment/hooks/useLoadingImage.tsx +8 -0
- package/src/components/AutoCompleteInput/AutoCompleteInput.tsx +2 -1
- package/src/components/AutoCompleteInput/AutoCompleteSuggestionItem.tsx +1 -1
- package/src/components/Channel/Channel.tsx +8 -0
- package/src/components/Channel/hooks/useCreateMessagesContext.ts +4 -0
- package/src/components/ChannelPreview/__tests__/ChannelPreviewMessenger.test.js +0 -1
- package/src/components/ChannelPreview/hooks/__tests__/useLatestMessagePreview.test.tsx +145 -0
- package/src/components/ChannelPreview/hooks/useLatestMessagePreview.ts +50 -24
- package/src/components/MessageInput/FileUploadPreview.tsx +5 -4
- package/src/components/MessageInput/ImageUploadPreview.tsx +2 -3
- package/src/components/MessageInput/__tests__/__snapshots__/MessageInput.test.js.snap +1 -0
- package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap +1 -0
- package/src/contexts/messagesContext/MessagesContext.tsx +15 -0
- package/src/contexts/themeContext/utils/theme.ts +8 -0
- package/src/mock-builders/api/channelMocks.tsx +272 -0
- package/src/version.json +1 -1
|
@@ -44,7 +44,7 @@ const styles = StyleSheet.create({
|
|
|
44
44
|
borderRadius: 20,
|
|
45
45
|
bottom: 8,
|
|
46
46
|
flexDirection: 'row',
|
|
47
|
-
|
|
47
|
+
marginHorizontal: 3,
|
|
48
48
|
position: 'absolute',
|
|
49
49
|
},
|
|
50
50
|
upload: {
|
|
@@ -54,7 +54,6 @@ const styles = StyleSheet.create({
|
|
|
54
54
|
},
|
|
55
55
|
warningIconStyle: {
|
|
56
56
|
borderRadius: 24,
|
|
57
|
-
marginLeft: 4,
|
|
58
57
|
marginTop: 4,
|
|
59
58
|
},
|
|
60
59
|
warningText: {
|
|
@@ -62,7 +61,7 @@ const styles = StyleSheet.create({
|
|
|
62
61
|
color: 'black',
|
|
63
62
|
fontSize: 10,
|
|
64
63
|
justifyContent: 'center',
|
|
65
|
-
|
|
64
|
+
marginHorizontal: 4,
|
|
66
65
|
},
|
|
67
66
|
});
|
|
68
67
|
|
|
@@ -2,6 +2,9 @@ import React, { PropsWithChildren, useContext } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import type { TouchableOpacityProps } from 'react-native';
|
|
4
4
|
|
|
5
|
+
import type { ImageLoadingFailedIndicatorProps } from 'src/components/Attachment/ImageLoadingFailedIndicator';
|
|
6
|
+
import type { ImageLoadingIndicatorProps } from 'src/components/Attachment/ImageLoadingIndicator';
|
|
7
|
+
|
|
5
8
|
import type { MessagePinnedHeaderProps } from 'src/components/Message/MessageSimple/MessagePinnedHeader';
|
|
6
9
|
|
|
7
10
|
import type { Attachment, ChannelState, MessageResponse } from 'stream-chat';
|
|
@@ -115,6 +118,17 @@ export type MessagesContextValue<
|
|
|
115
118
|
* The giphy version to render - check the keys of the [Image Object](https://developers.giphy.com/docs/api/schema#image-object) for possible values. Uses 'fixed_height' by default
|
|
116
119
|
* */
|
|
117
120
|
giphyVersion: keyof NonNullable<Attachment['giphy']>;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* The indicator rendered when loading an image fails.
|
|
124
|
+
*/
|
|
125
|
+
ImageLoadingFailedIndicator: React.ComponentType<ImageLoadingFailedIndicatorProps>;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The indicator rendered when image is loading. By default renders <ActivityIndicator/>
|
|
129
|
+
*/
|
|
130
|
+
ImageLoadingIndicator: React.ComponentType<ImageLoadingIndicatorProps>;
|
|
131
|
+
|
|
118
132
|
/**
|
|
119
133
|
* When true, messageList will be scrolled at first unread message, when opened.
|
|
120
134
|
*/
|
|
@@ -129,6 +143,7 @@ export type MessagesContextValue<
|
|
|
129
143
|
* Defaults to: [InlineUnreadIndicator](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Message/MessageSimple/InlineUnreadIndicator.tsx)
|
|
130
144
|
**/
|
|
131
145
|
InlineUnreadIndicator: React.ComponentType;
|
|
146
|
+
|
|
132
147
|
Message: React.ComponentType<MessageProps<StreamChatGenerics>>;
|
|
133
148
|
/**
|
|
134
149
|
* UI component for MessageAvatar
|
|
@@ -454,6 +454,10 @@ export type Theme = {
|
|
|
454
454
|
shuffle: TextStyle;
|
|
455
455
|
title: TextStyle;
|
|
456
456
|
};
|
|
457
|
+
loadingIndicator: {
|
|
458
|
+
container: ViewStyle;
|
|
459
|
+
roundedView: ViewStyle;
|
|
460
|
+
};
|
|
457
461
|
pinnedHeader: {
|
|
458
462
|
container: ViewStyle;
|
|
459
463
|
label: TextStyle;
|
|
@@ -971,6 +975,10 @@ export const defaultTheme: Theme = {
|
|
|
971
975
|
shuffle: {},
|
|
972
976
|
title: {},
|
|
973
977
|
},
|
|
978
|
+
loadingIndicator: {
|
|
979
|
+
container: {},
|
|
980
|
+
roundedView: {},
|
|
981
|
+
},
|
|
974
982
|
pinnedHeader: {
|
|
975
983
|
container: {},
|
|
976
984
|
label: {},
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Attachment,
|
|
3
|
+
Channel,
|
|
4
|
+
FormatMessageResponse,
|
|
5
|
+
MessageResponse,
|
|
6
|
+
UserResponse,
|
|
7
|
+
} from 'stream-chat';
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
GROUP_CHANNEL_MEMBERS_MOCK,
|
|
11
|
+
ONE_MEMBER_WITH_EMPTY_USER_MOCK,
|
|
12
|
+
} from '../../mock-builders/api/queryMembers';
|
|
13
|
+
|
|
14
|
+
import type { DefaultStreamChatGenerics } from '../../types/types';
|
|
15
|
+
|
|
16
|
+
const channelName = 'okechukwu';
|
|
17
|
+
const CHANNEL = {
|
|
18
|
+
data: { name: channelName },
|
|
19
|
+
state: { messages: [] },
|
|
20
|
+
} as unknown as Channel<DefaultStreamChatGenerics>;
|
|
21
|
+
|
|
22
|
+
const CHANNEL_WITH_MESSAGES_TEXT = {
|
|
23
|
+
data: { name: channelName },
|
|
24
|
+
state: {
|
|
25
|
+
members: GROUP_CHANNEL_MEMBERS_MOCK,
|
|
26
|
+
messages: [
|
|
27
|
+
{
|
|
28
|
+
args: 'string',
|
|
29
|
+
attachments: [],
|
|
30
|
+
channel: CHANNEL,
|
|
31
|
+
cid: 'stridkncnng',
|
|
32
|
+
command: 'giphy',
|
|
33
|
+
command_info: { name: 'string' },
|
|
34
|
+
created_at: new Date('2021-02-12T12:12:35.862Z'),
|
|
35
|
+
deleted_at: new Date('2021-02-12T12:12:35.862Z'),
|
|
36
|
+
id: 'ljkblk',
|
|
37
|
+
text: 'jkbkbiubicbi',
|
|
38
|
+
type: 'MessageLabel',
|
|
39
|
+
user: { id: 'okechukwu' } as unknown as UserResponse<DefaultStreamChatGenerics>,
|
|
40
|
+
} as unknown as MessageResponse<DefaultStreamChatGenerics>,
|
|
41
|
+
{
|
|
42
|
+
args: 'string',
|
|
43
|
+
attachments: [],
|
|
44
|
+
channel: CHANNEL,
|
|
45
|
+
cid: 'stridodong',
|
|
46
|
+
command: 'giphy',
|
|
47
|
+
command_info: { name: 'string' },
|
|
48
|
+
created_at: new Date('2021-02-12T12:12:35.862Z'),
|
|
49
|
+
deleted_at: new Date('2021-02-12T12:12:35.862Z'),
|
|
50
|
+
id: 'jbkjb',
|
|
51
|
+
text: 'jkbkbiubicbi',
|
|
52
|
+
type: 'MessageLabel',
|
|
53
|
+
user: { id: 'okechukwu' } as unknown as UserResponse<DefaultStreamChatGenerics>,
|
|
54
|
+
} as unknown as MessageResponse<DefaultStreamChatGenerics>,
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
} as unknown as Channel<DefaultStreamChatGenerics>;
|
|
58
|
+
|
|
59
|
+
const CHANNEL_WITH_DELETED_MESSAGES = {
|
|
60
|
+
data: { name: channelName },
|
|
61
|
+
state: {
|
|
62
|
+
members: GROUP_CHANNEL_MEMBERS_MOCK,
|
|
63
|
+
messages: [
|
|
64
|
+
{
|
|
65
|
+
type: 'deleted',
|
|
66
|
+
} as unknown as MessageResponse<DefaultStreamChatGenerics>,
|
|
67
|
+
{
|
|
68
|
+
type: 'deleted',
|
|
69
|
+
} as unknown as MessageResponse<DefaultStreamChatGenerics>,
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
} as unknown as Channel<DefaultStreamChatGenerics>;
|
|
73
|
+
|
|
74
|
+
const CHANNEL_WITH_NO_MESSAGES = {
|
|
75
|
+
data: { name: channelName },
|
|
76
|
+
state: {
|
|
77
|
+
members: GROUP_CHANNEL_MEMBERS_MOCK,
|
|
78
|
+
messages: [],
|
|
79
|
+
},
|
|
80
|
+
} as unknown as Channel<DefaultStreamChatGenerics>;
|
|
81
|
+
|
|
82
|
+
const CHANNEL_WITH_MESSAGE_COMMAND = {
|
|
83
|
+
data: { name: channelName },
|
|
84
|
+
state: {
|
|
85
|
+
members: GROUP_CHANNEL_MEMBERS_MOCK,
|
|
86
|
+
messages: [
|
|
87
|
+
{
|
|
88
|
+
args: 'string',
|
|
89
|
+
attachments: [],
|
|
90
|
+
channel: CHANNEL,
|
|
91
|
+
cid: 'stridkncnng',
|
|
92
|
+
command: 'giphy',
|
|
93
|
+
command_info: { name: 'string' },
|
|
94
|
+
created_at: new Date('2021-02-12T12:12:35.862Z'),
|
|
95
|
+
deleted_at: new Date('2021-02-12T12:12:35.862Z'),
|
|
96
|
+
id: 'ljkblk',
|
|
97
|
+
user: { id: 'okechukwu' } as unknown as UserResponse<DefaultStreamChatGenerics>,
|
|
98
|
+
} as unknown as MessageResponse<DefaultStreamChatGenerics>,
|
|
99
|
+
{
|
|
100
|
+
args: 'string',
|
|
101
|
+
attachments: [],
|
|
102
|
+
channel: CHANNEL,
|
|
103
|
+
cid: 'stridodong',
|
|
104
|
+
command: 'giphy',
|
|
105
|
+
command_info: { name: 'string' },
|
|
106
|
+
created_at: new Date('2021-02-12T12:12:35.862Z'),
|
|
107
|
+
deleted_at: new Date('2021-02-12T12:12:35.862Z'),
|
|
108
|
+
id: 'jbkjb',
|
|
109
|
+
user: { id: 'okechukwu' } as unknown as UserResponse<DefaultStreamChatGenerics>,
|
|
110
|
+
} as unknown as MessageResponse<DefaultStreamChatGenerics>,
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
} as unknown as Channel<DefaultStreamChatGenerics>;
|
|
114
|
+
|
|
115
|
+
const CHANNEL_WITH_MESSAGES_ATTACHMENTS = {
|
|
116
|
+
data: { name: channelName },
|
|
117
|
+
state: {
|
|
118
|
+
members: GROUP_CHANNEL_MEMBERS_MOCK,
|
|
119
|
+
messages: [
|
|
120
|
+
{
|
|
121
|
+
args: 'string',
|
|
122
|
+
attachments: [
|
|
123
|
+
{
|
|
124
|
+
actions: [],
|
|
125
|
+
asset_url: 'string',
|
|
126
|
+
author_icon: 'string',
|
|
127
|
+
author_link: 'string',
|
|
128
|
+
author_name: 'string',
|
|
129
|
+
color: 'string',
|
|
130
|
+
fallback: 'string',
|
|
131
|
+
fields: [],
|
|
132
|
+
file_size: 25,
|
|
133
|
+
footer: 'string',
|
|
134
|
+
footer_icon: 'string',
|
|
135
|
+
image_url: 'string',
|
|
136
|
+
mime_type: 'string',
|
|
137
|
+
og_scrape_url: 'string',
|
|
138
|
+
original_height: 5,
|
|
139
|
+
original_width: 4,
|
|
140
|
+
pretext: 'string',
|
|
141
|
+
text: 'string',
|
|
142
|
+
thumb_url: 'string',
|
|
143
|
+
title: 'string',
|
|
144
|
+
title_link: 'string',
|
|
145
|
+
type: 'string',
|
|
146
|
+
} as Attachment<DefaultStreamChatGenerics>,
|
|
147
|
+
],
|
|
148
|
+
channel: CHANNEL,
|
|
149
|
+
created_at: new Date('2021-02-12T12:12:35.862Z'),
|
|
150
|
+
deleted_at: new Date('2021-02-12T12:12:35.862Z'),
|
|
151
|
+
id: 'ljkblk',
|
|
152
|
+
user: { id: 'okechukwu' } as unknown as UserResponse<DefaultStreamChatGenerics>,
|
|
153
|
+
} as unknown as MessageResponse<DefaultStreamChatGenerics>,
|
|
154
|
+
],
|
|
155
|
+
},
|
|
156
|
+
} as unknown as Channel<DefaultStreamChatGenerics>;
|
|
157
|
+
|
|
158
|
+
const LATEST_MESSAGE = {
|
|
159
|
+
args: 'string',
|
|
160
|
+
attachments: [],
|
|
161
|
+
channel: CHANNEL,
|
|
162
|
+
cid: 'string',
|
|
163
|
+
command: 'giphy',
|
|
164
|
+
command_info: { name: 'string' },
|
|
165
|
+
created_at: new Date('2021-02-12T12:12:35.862Z'),
|
|
166
|
+
deleted_at: new Date('2021-02-12T12:12:35.862Z'),
|
|
167
|
+
id: 'string',
|
|
168
|
+
text: 'jkbkbiubicbi',
|
|
169
|
+
type: 'MessageLabel',
|
|
170
|
+
user: { id: 'okechukwu' } as unknown as UserResponse<DefaultStreamChatGenerics>,
|
|
171
|
+
} as unknown as MessageResponse<DefaultStreamChatGenerics>;
|
|
172
|
+
|
|
173
|
+
const FORMATTED_MESSAGE: FormatMessageResponse<DefaultStreamChatGenerics> = {
|
|
174
|
+
created_at: new Date('2021-02-12T12:12:35.862282Z'),
|
|
175
|
+
id: '',
|
|
176
|
+
message: {} as unknown as MessageResponse<DefaultStreamChatGenerics>,
|
|
177
|
+
pinned_at: new Date('2021-02-12T12:12:35.862282Z'),
|
|
178
|
+
status: 'received',
|
|
179
|
+
updated_at: new Date('2021-02-12T12:12:35.862282Z'),
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
const CHANNEL_WITH_MENTIONED_USERS = {
|
|
183
|
+
state: {
|
|
184
|
+
members: ONE_MEMBER_WITH_EMPTY_USER_MOCK,
|
|
185
|
+
messages: [
|
|
186
|
+
{
|
|
187
|
+
args: 'string',
|
|
188
|
+
attachments: [],
|
|
189
|
+
cid: 'stridkncnng',
|
|
190
|
+
command_info: { name: 'string' },
|
|
191
|
+
created_at: new Date('2021-02-12T12:12:35.862Z'),
|
|
192
|
+
deleted_at: new Date('2021-02-12T12:12:35.862Z'),
|
|
193
|
+
mentioned_users: [
|
|
194
|
+
{ id: 'Max', name: 'Max' },
|
|
195
|
+
{ id: 'Ada', name: 'Ada' },
|
|
196
|
+
{ id: 'Enzo', name: 'Enzo' },
|
|
197
|
+
] as UserResponse<DefaultStreamChatGenerics>[],
|
|
198
|
+
text: 'Max',
|
|
199
|
+
} as unknown as MessageResponse<DefaultStreamChatGenerics>,
|
|
200
|
+
{
|
|
201
|
+
args: 'string',
|
|
202
|
+
attachments: [],
|
|
203
|
+
cid: 'stridodong',
|
|
204
|
+
command_info: { name: 'string' },
|
|
205
|
+
created_at: new Date('2021-02-12T12:12:35.862Z'),
|
|
206
|
+
deleted_at: new Date('2021-02-12T12:12:35.862Z'),
|
|
207
|
+
mentioned_users: [
|
|
208
|
+
{ id: 'Max', name: 'Max' },
|
|
209
|
+
{ id: 'Ada', name: 'Ada' },
|
|
210
|
+
{ id: 'Enzo', name: 'Enzo' },
|
|
211
|
+
] as UserResponse<DefaultStreamChatGenerics>[],
|
|
212
|
+
text: 'Max',
|
|
213
|
+
} as unknown as MessageResponse<DefaultStreamChatGenerics>,
|
|
214
|
+
],
|
|
215
|
+
},
|
|
216
|
+
} as unknown as Channel<DefaultStreamChatGenerics>;
|
|
217
|
+
|
|
218
|
+
const CHANNEL_WITH_EMPTY_MESSAGE = {
|
|
219
|
+
state: {
|
|
220
|
+
members: ONE_MEMBER_WITH_EMPTY_USER_MOCK,
|
|
221
|
+
messages: [
|
|
222
|
+
{
|
|
223
|
+
args: 'string',
|
|
224
|
+
attachments: [],
|
|
225
|
+
cid: 'stridkncnng',
|
|
226
|
+
command_info: { name: 'string' },
|
|
227
|
+
created_at: new Date('2021-02-12T12:12:35.862Z'),
|
|
228
|
+
deleted_at: new Date('2021-02-12T12:12:35.862Z'),
|
|
229
|
+
mentioned_users: [
|
|
230
|
+
{ id: 'Max', name: 'Max' },
|
|
231
|
+
{ id: 'Ada', name: 'Ada' },
|
|
232
|
+
{ id: 'Enzo', name: 'Enzo' },
|
|
233
|
+
] as UserResponse<DefaultStreamChatGenerics>[],
|
|
234
|
+
} as unknown as MessageResponse<DefaultStreamChatGenerics>,
|
|
235
|
+
{
|
|
236
|
+
args: 'string',
|
|
237
|
+
attachments: [],
|
|
238
|
+
cid: 'stridodong',
|
|
239
|
+
command_info: { name: 'string' },
|
|
240
|
+
created_at: new Date('2021-02-12T12:12:35.862Z'),
|
|
241
|
+
deleted_at: new Date('2021-02-12T12:12:35.862Z'),
|
|
242
|
+
mentioned_users: [
|
|
243
|
+
{ id: 'Max', name: 'Max' },
|
|
244
|
+
{ id: 'Ada', name: 'Ada' },
|
|
245
|
+
{ id: 'Enzo', name: 'Enzo' },
|
|
246
|
+
] as UserResponse<DefaultStreamChatGenerics>[],
|
|
247
|
+
} as unknown as MessageResponse<DefaultStreamChatGenerics>,
|
|
248
|
+
],
|
|
249
|
+
},
|
|
250
|
+
} as unknown as Channel<DefaultStreamChatGenerics>;
|
|
251
|
+
|
|
252
|
+
const CHANNEL_WITH_MESSAGES = {
|
|
253
|
+
data: { name: channelName },
|
|
254
|
+
state: {
|
|
255
|
+
members: GROUP_CHANNEL_MEMBERS_MOCK,
|
|
256
|
+
messages: [FORMATTED_MESSAGE, FORMATTED_MESSAGE],
|
|
257
|
+
},
|
|
258
|
+
} as unknown as Channel<DefaultStreamChatGenerics>;
|
|
259
|
+
|
|
260
|
+
export {
|
|
261
|
+
CHANNEL,
|
|
262
|
+
CHANNEL_WITH_EMPTY_MESSAGE,
|
|
263
|
+
CHANNEL_WITH_MESSAGES,
|
|
264
|
+
CHANNEL_WITH_MENTIONED_USERS,
|
|
265
|
+
FORMATTED_MESSAGE,
|
|
266
|
+
LATEST_MESSAGE,
|
|
267
|
+
CHANNEL_WITH_MESSAGES_ATTACHMENTS,
|
|
268
|
+
CHANNEL_WITH_MESSAGE_COMMAND as CHANNEL_WITH_MESSAGES_COMMAND,
|
|
269
|
+
CHANNEL_WITH_NO_MESSAGES,
|
|
270
|
+
CHANNEL_WITH_DELETED_MESSAGES,
|
|
271
|
+
CHANNEL_WITH_MESSAGES_TEXT,
|
|
272
|
+
};
|
package/src/version.json
CHANGED