stream-chat-react-native-core 4.7.3 → 4.9.0-beta.1

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.
Files changed (107) hide show
  1. package/lib/commonjs/components/Attachment/GallaryImage.js +41 -0
  2. package/lib/commonjs/components/Attachment/GallaryImage.js.map +1 -0
  3. package/lib/commonjs/components/Attachment/Gallery.js +101 -36
  4. package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
  5. package/lib/commonjs/components/Attachment/Giphy.js +118 -25
  6. package/lib/commonjs/components/Attachment/Giphy.js.map +1 -1
  7. package/lib/commonjs/components/Attachment/ImageLoadingFailedIndicator.js +105 -0
  8. package/lib/commonjs/components/Attachment/ImageLoadingFailedIndicator.js.map +1 -0
  9. package/lib/commonjs/components/Attachment/ImageLoadingIndicator.js +58 -0
  10. package/lib/commonjs/components/Attachment/ImageLoadingIndicator.js.map +1 -0
  11. package/lib/commonjs/components/Attachment/hooks/useLoadingImage.js +32 -0
  12. package/lib/commonjs/components/Attachment/hooks/useLoadingImage.js.map +1 -0
  13. package/lib/commonjs/components/Channel/Channel.js +23 -13
  14. package/lib/commonjs/components/Channel/Channel.js.map +1 -1
  15. package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js +4 -0
  16. package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
  17. package/lib/commonjs/components/ChannelPreview/hooks/useLatestMessagePreview.js +43 -19
  18. package/lib/commonjs/components/ChannelPreview/hooks/useLatestMessagePreview.js.map +1 -1
  19. package/lib/commonjs/components/MessageInput/FileUploadPreview.js +20 -19
  20. package/lib/commonjs/components/MessageInput/FileUploadPreview.js.map +1 -1
  21. package/lib/commonjs/components/MessageInput/ImageUploadPreview.js +14 -15
  22. package/lib/commonjs/components/MessageInput/ImageUploadPreview.js.map +1 -1
  23. package/lib/commonjs/contexts/messagesContext/MessagesContext.js +2 -2
  24. package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
  25. package/lib/commonjs/contexts/themeContext/utils/theme.js +4 -0
  26. package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
  27. package/lib/commonjs/i18n/he.json +67 -0
  28. package/lib/commonjs/index.js +9 -0
  29. package/lib/commonjs/index.js.map +1 -1
  30. package/lib/commonjs/mock-builders/api/channelMocks.js +299 -0
  31. package/lib/commonjs/mock-builders/api/channelMocks.js.map +1 -0
  32. package/lib/commonjs/utils/Streami18n.js +5 -0
  33. package/lib/commonjs/utils/Streami18n.js.map +1 -1
  34. package/lib/commonjs/version.json +1 -1
  35. package/lib/module/components/Attachment/GallaryImage.js +41 -0
  36. package/lib/module/components/Attachment/GallaryImage.js.map +1 -0
  37. package/lib/module/components/Attachment/Gallery.js +101 -36
  38. package/lib/module/components/Attachment/Gallery.js.map +1 -1
  39. package/lib/module/components/Attachment/Giphy.js +118 -25
  40. package/lib/module/components/Attachment/Giphy.js.map +1 -1
  41. package/lib/module/components/Attachment/ImageLoadingFailedIndicator.js +105 -0
  42. package/lib/module/components/Attachment/ImageLoadingFailedIndicator.js.map +1 -0
  43. package/lib/module/components/Attachment/ImageLoadingIndicator.js +58 -0
  44. package/lib/module/components/Attachment/ImageLoadingIndicator.js.map +1 -0
  45. package/lib/module/components/Attachment/hooks/useLoadingImage.js +32 -0
  46. package/lib/module/components/Attachment/hooks/useLoadingImage.js.map +1 -0
  47. package/lib/module/components/Channel/Channel.js +23 -13
  48. package/lib/module/components/Channel/Channel.js.map +1 -1
  49. package/lib/module/components/Channel/hooks/useCreateMessagesContext.js +4 -0
  50. package/lib/module/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
  51. package/lib/module/components/ChannelPreview/hooks/useLatestMessagePreview.js +43 -19
  52. package/lib/module/components/ChannelPreview/hooks/useLatestMessagePreview.js.map +1 -1
  53. package/lib/module/components/MessageInput/FileUploadPreview.js +20 -19
  54. package/lib/module/components/MessageInput/FileUploadPreview.js.map +1 -1
  55. package/lib/module/components/MessageInput/ImageUploadPreview.js +14 -15
  56. package/lib/module/components/MessageInput/ImageUploadPreview.js.map +1 -1
  57. package/lib/module/contexts/messagesContext/MessagesContext.js +2 -2
  58. package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
  59. package/lib/module/contexts/themeContext/utils/theme.js +4 -0
  60. package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
  61. package/lib/module/i18n/he.json +67 -0
  62. package/lib/module/index.js +9 -0
  63. package/lib/module/index.js.map +1 -1
  64. package/lib/module/mock-builders/api/channelMocks.js +299 -0
  65. package/lib/module/mock-builders/api/channelMocks.js.map +1 -0
  66. package/lib/module/utils/Streami18n.js +5 -0
  67. package/lib/module/utils/Streami18n.js.map +1 -1
  68. package/lib/module/version.json +1 -1
  69. package/lib/typescript/components/Attachment/GallaryImage.d.ts +5 -0
  70. package/lib/typescript/components/Attachment/Gallery.d.ts +1 -1
  71. package/lib/typescript/components/Attachment/Giphy.d.ts +1 -1
  72. package/lib/typescript/components/Attachment/ImageLoadingFailedIndicator.d.ts +3 -0
  73. package/lib/typescript/components/Attachment/ImageLoadingIndicator.d.ts +3 -0
  74. package/lib/typescript/components/Attachment/hooks/useLoadingImage.d.ts +7 -0
  75. package/lib/typescript/components/Channel/Channel.d.ts +1 -1
  76. package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts +1 -1
  77. package/lib/typescript/components/ChannelPreview/hooks/__tests__/useLatestMessagePreview.test.d.ts +1 -0
  78. package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +10 -0
  79. package/lib/typescript/contexts/themeContext/utils/theme.d.ts +4 -0
  80. package/lib/typescript/i18n/he.json +67 -0
  81. package/lib/typescript/index.d.ts +1 -0
  82. package/lib/typescript/mock-builders/api/channelMocks.d.ts +14 -0
  83. package/lib/typescript/utils/Streami18n.d.ts +1 -4
  84. package/package.json +1 -1
  85. package/src/components/Attachment/GallaryImage.tsx +22 -0
  86. package/src/components/Attachment/Gallery.tsx +68 -35
  87. package/src/components/Attachment/Giphy.tsx +68 -1
  88. package/src/components/Attachment/ImageLoadingFailedIndicator.tsx +56 -0
  89. package/src/components/Attachment/ImageLoadingIndicator.tsx +31 -0
  90. package/src/components/Attachment/__tests__/Attachment.test.js +9 -3
  91. package/src/components/Attachment/__tests__/Gallery.test.js +36 -1
  92. package/src/components/Attachment/__tests__/Giphy.test.js +110 -90
  93. package/src/components/Attachment/hooks/useLoadingImage.tsx +8 -0
  94. package/src/components/Channel/Channel.tsx +8 -0
  95. package/src/components/Channel/hooks/useCreateMessagesContext.ts +4 -0
  96. package/src/components/ChannelPreview/__tests__/ChannelPreviewMessenger.test.js +0 -1
  97. package/src/components/ChannelPreview/hooks/__tests__/useLatestMessagePreview.test.tsx +145 -0
  98. package/src/components/ChannelPreview/hooks/useLatestMessagePreview.ts +50 -24
  99. package/src/components/MessageInput/FileUploadPreview.tsx +5 -4
  100. package/src/components/MessageInput/ImageUploadPreview.tsx +2 -3
  101. package/src/contexts/messagesContext/MessagesContext.tsx +15 -0
  102. package/src/contexts/themeContext/utils/theme.ts +8 -0
  103. package/src/i18n/he.json +67 -0
  104. package/src/index.ts +1 -0
  105. package/src/mock-builders/api/channelMocks.tsx +272 -0
  106. package/src/utils/Streami18n.ts +6 -3
  107. package/src/version.json +1 -1
@@ -45,11 +45,11 @@ const styles = StyleSheet.create({
45
45
  filenameText: {
46
46
  fontSize: 14,
47
47
  fontWeight: 'bold',
48
- paddingLeft: 10,
48
+ paddingHorizontal: 10,
49
49
  },
50
50
  fileSizeText: {
51
51
  fontSize: 12,
52
- paddingLeft: 10,
52
+ paddingHorizontal: 10,
53
53
  },
54
54
  fileTextContainer: {
55
55
  height: '100%',
@@ -66,11 +66,12 @@ const styles = StyleSheet.create({
66
66
  paddingLeft: 10,
67
67
  },
68
68
  unsupportedFileText: {
69
- fontSize: 16,
69
+ fontSize: 12,
70
+ marginHorizontal: 4,
70
71
  },
71
72
  warningIconStyle: {
72
73
  borderRadius: 24,
73
- marginTop: 4,
74
+ marginTop: 3,
74
75
  },
75
76
  });
76
77
 
@@ -44,7 +44,7 @@ const styles = StyleSheet.create({
44
44
  borderRadius: 20,
45
45
  bottom: 8,
46
46
  flexDirection: 'row',
47
- marginLeft: 3,
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
- paddingRight: 8,
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,67 @@
1
+ {
2
+ "1 Reply": "תגובה אחת",
3
+ "1 Thread Reply": "תגובה אחת לשרשור",
4
+ "Allow access to your Gallery": "אפשר גישה לגלריה שלך",
5
+ "Also send to channel": "שלח/י הודעה לשיחה",
6
+ "Are you sure you want to permanently delete this message?": "האם את/ה בטוח/ה שאת/ה רוצה למחוק את ההודעה הזו לצמיתות?",
7
+ "Block User": "חסום משתמש",
8
+ "Cancel": "ביטול",
9
+ "Cannot Flag Message": "סימון הודעה לא אפשרי",
10
+ "Copy Message": "העתק/י הודעה",
11
+ "Delete": "מחק",
12
+ "Delete Message": "מחק/י הודעה",
13
+ "Do you want to send a copy of this message to a moderator for further investigation?": "האם את/ה רוצה לשלוח עותק של הודעה זו למנחה להמשך חקירה?",
14
+ "Edit Message": "ערוך הודעה",
15
+ "Editing Message": "הודעה בעריכה",
16
+ "Emoji matching": "התאמת אמוג'י",
17
+ "Empty message...": "הודעה ריקה...",
18
+ "Error loading": "שגיאה ארעה בעת הטעינה",
19
+ "Error loading channel list...": "שגיאה ארעה בטעינת השיחות...",
20
+ "Error loading messages for this channel...": "שגיאה ארעה בטעינת הודעות עבור שיחה זאת...",
21
+ "Error while loading, please reload/refresh": "שגיאה ארעה בזמן הטעינה, אנא טען מחדש/רענן",
22
+ "File type not supported": "סוג הקובץ אינו נתמך",
23
+ "Flag": "סמן",
24
+ "Flag Message": "סמן הודעה",
25
+ "Flag action failed either due to a network issue or the message is already flagged": "פעולת הסימון נכשלה בגלל בעיית רשת או שההודעה כבר סומנה.",
26
+ "Instant Commands": "פעולות מיידיות",
27
+ "Links are disabled": "הקישורים מבוטלים",
28
+ "Loading channels...": "השיחות בטעינה...",
29
+ "Loading messages...": "ההודעות בטעינה..",
30
+ "Loading...": "טוען...",
31
+ "Message Reactions": "תגובות להודעה",
32
+ "Message deleted": "ההודעה נמחקה",
33
+ "Message flagged": "ההודעה סומנה",
34
+ "Mute User": "השתק/י משתמש",
35
+ "Not supported": "לא נתמך",
36
+ "Nothing yet...": "אינפורמציה תתקבל בהמשך...",
37
+ "Ok": "אוקיי",
38
+ "Only visible to you": "גלוי רק לך",
39
+ "Photo": "תמונה",
40
+ "Photos": "תמונות",
41
+ "Pin to Conversation": "הצמד/י לשיחה",
42
+ "Please enable access to your photos and videos so you can share them.": "אפשר/י גישה לתמונות ולסרטונים שלך כדי שתוכל/י לשתף אותם.",
43
+ "Please select a channel first": "אנא בחר/י שיחה תחילה",
44
+ "Reconnecting...": "מתחבר מחדש...",
45
+ "Reply": "השב/י",
46
+ "Reply to Message": "השב/י להודעה",
47
+ "Resend": "שלח/י שוב",
48
+ "Search GIFs": "חפש/י GIFs",
49
+ "Send a message": "שלח/י הודעה",
50
+ "Sending links is not allowed in this conversation": "שליחת קישורים אינה מותרת בשיחה זו",
51
+ "Slow mode ON": "מצב איטי מופעל",
52
+ "The message has been reported to a moderator.": "ההודעה דווחה למנהל",
53
+ "Thread Reply": "הגב/י בשרשור",
54
+ "Unblock User": "בטל/י חסימת משתמש",
55
+ "Unknown User": "משתמש לא ידוע",
56
+ "Unmute User": "בטל/י השתקת משתמש",
57
+ "Unpin from Conversation": "בטל/י הצמדה לשיחה",
58
+ "Unread Messages": "הודעות שטרם נקרו",
59
+ "You": "את/ה",
60
+ "You can't send messages in this channel": "את/ב לא יכול/ה לשלוח הודעות בשיחה זו",
61
+ "{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} ו-{{ nonSelfUserLength }} משתמש/ים אחר/ים מקלידים",
62
+ "{{ index }} of {{ photoLength }}": "{{ index }} מתוך {{ photoLength }}",
63
+ "{{ replyCount }} Replies": "{{ replyCount }} תגובות",
64
+ "{{ replyCount }} Thread Replies": "{{ replyCount }} תגובות שרשור",
65
+ "{{ user }} is typing": "{{ user }} מקליד/ה",
66
+ "🏙 Attachment...": "🏙 קובץ מצורף..."
67
+ }
package/src/index.ts CHANGED
@@ -18,5 +18,6 @@ export { default as itTranslations } from './i18n/it.json';
18
18
  export { default as nlTranslations } from './i18n/nl.json';
19
19
  export { default as ruTranslations } from './i18n/ru.json';
20
20
  export { default as trTranslations } from './i18n/tr.json';
21
+ export { default as heTranslations } from './i18n/he.json';
21
22
 
22
23
  export { version } from './version.json';
@@ -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
+ };
@@ -11,6 +11,7 @@ import type moment from 'moment';
11
11
  import type { TDateTimeParser } from '../contexts/translationContext/TranslationContext';
12
12
  import enTranslations from '../i18n/en.json';
13
13
  import frTranslations from '../i18n/fr.json';
14
+ import heTranslations from '../i18n/he.json';
14
15
  import hiTranslations from '../i18n/hi.json';
15
16
  import itTranslations from '../i18n/it.json';
16
17
  import jaTranslations from '../i18n/ja.json';
@@ -19,9 +20,6 @@ import nlTranslations from '../i18n/nl.json';
19
20
  import ruTranslations from '../i18n/ru.json';
20
21
  import trTranslations from '../i18n/tr.json';
21
22
 
22
- const defaultNS = 'translation';
23
- const defaultLng = 'en';
24
-
25
23
  import 'dayjs/locale/fr';
26
24
  import 'dayjs/locale/hi';
27
25
  import 'dayjs/locale/it';
@@ -30,6 +28,7 @@ import 'dayjs/locale/ko';
30
28
  import 'dayjs/locale/nl';
31
29
  import 'dayjs/locale/ru';
32
30
  import 'dayjs/locale/tr';
31
+ import 'dayjs/locale/he';
33
32
 
34
33
  /**
35
34
  * These locale imports also set these locales globally.
@@ -40,6 +39,9 @@ import 'dayjs/locale/en';
40
39
 
41
40
  import type { DefaultStreamChatGenerics } from '../types/types';
42
41
 
42
+ const defaultNS = 'translation';
43
+ const defaultLng = 'en';
44
+
43
45
  Dayjs.extend(updateLocale);
44
46
 
45
47
  Dayjs.updateLocale('en', {
@@ -357,6 +359,7 @@ export class Streami18n {
357
359
  } = {
358
360
  en: { [defaultNS]: enTranslations },
359
361
  fr: { [defaultNS]: frTranslations },
362
+ he: { [defaultNS]: heTranslations },
360
363
  hi: { [defaultNS]: hiTranslations },
361
364
  it: { [defaultNS]: itTranslations },
362
365
  ja: { [defaultNS]: jaTranslations },
package/src/version.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "4.7.3"
2
+ "version": "4.9.0-beta.1"
3
3
  }