stream-chat-react-native-core 5.31.2-beta.3 → 5.32.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.
Files changed (235) hide show
  1. package/lib/commonjs/components/Channel/Channel.js +21 -20
  2. package/lib/commonjs/components/Channel/Channel.js.map +1 -1
  3. package/lib/commonjs/components/Chat/hooks/handleEventToSyncDB.js.map +1 -1
  4. package/lib/commonjs/components/Message/Message.js +9 -19
  5. package/lib/commonjs/components/Message/Message.js.map +1 -1
  6. package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js +1 -2
  7. package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js.map +1 -1
  8. package/lib/commonjs/components/Message/MessageSimple/ReactionList.js +54 -37
  9. package/lib/commonjs/components/Message/MessageSimple/ReactionList.js.map +1 -1
  10. package/lib/commonjs/components/Message/hooks/useCreateMessageContext.js +6 -11
  11. package/lib/commonjs/components/Message/hooks/useCreateMessageContext.js.map +1 -1
  12. package/lib/commonjs/components/Message/hooks/useProcessReactions.js +90 -0
  13. package/lib/commonjs/components/Message/hooks/useProcessReactions.js.map +1 -0
  14. package/lib/commonjs/components/MessageOverlay/MessageOverlay.js +3 -12
  15. package/lib/commonjs/components/MessageOverlay/MessageOverlay.js.map +1 -1
  16. package/lib/commonjs/components/MessageOverlay/OverlayReactions.js +47 -143
  17. package/lib/commonjs/components/MessageOverlay/OverlayReactions.js.map +1 -1
  18. package/lib/commonjs/components/MessageOverlay/OverlayReactionsItem.js +166 -0
  19. package/lib/commonjs/components/MessageOverlay/OverlayReactionsItem.js.map +1 -0
  20. package/lib/commonjs/components/MessageOverlay/hooks/useFetchReactions.js +144 -0
  21. package/lib/commonjs/components/MessageOverlay/hooks/useFetchReactions.js.map +1 -0
  22. package/lib/commonjs/contexts/messageContext/MessageContext.js.map +1 -1
  23. package/lib/commonjs/contexts/themeContext/utils/theme.js +0 -1
  24. package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
  25. package/lib/commonjs/i18n/en.json +81 -81
  26. package/lib/commonjs/i18n/es.json +81 -81
  27. package/lib/commonjs/i18n/fr.json +81 -81
  28. package/lib/commonjs/i18n/he.json +81 -81
  29. package/lib/commonjs/i18n/hi.json +81 -81
  30. package/lib/commonjs/i18n/it.json +81 -81
  31. package/lib/commonjs/i18n/ja.json +81 -81
  32. package/lib/commonjs/i18n/ko.json +81 -81
  33. package/lib/commonjs/i18n/nl.json +81 -81
  34. package/lib/commonjs/i18n/pt-br.json +83 -0
  35. package/lib/commonjs/i18n/ru.json +81 -81
  36. package/lib/commonjs/i18n/tr.json +81 -81
  37. package/lib/commonjs/mock-builders/generator/message.js +2 -0
  38. package/lib/commonjs/mock-builders/generator/message.js.map +1 -1
  39. package/lib/commonjs/store/QuickSqliteClient.js +1 -1
  40. package/lib/commonjs/store/apis/getReactions.js +17 -0
  41. package/lib/commonjs/store/apis/getReactions.js.map +1 -0
  42. package/lib/commonjs/store/apis/getReactionsforFilterSort.js +30 -0
  43. package/lib/commonjs/store/apis/getReactionsforFilterSort.js.map +1 -0
  44. package/lib/commonjs/store/apis/insertReaction.js +8 -1
  45. package/lib/commonjs/store/apis/insertReaction.js.map +1 -1
  46. package/lib/commonjs/store/apis/queries/selectReactionsForMessages.js +1 -1
  47. package/lib/commonjs/store/apis/queries/selectReactionsForMessages.js.map +1 -1
  48. package/lib/commonjs/store/apis/updateReaction.js +6 -6
  49. package/lib/commonjs/store/apis/updateReaction.js.map +1 -1
  50. package/lib/commonjs/store/mappers/mapMessageToStorable.js +5 -3
  51. package/lib/commonjs/store/mappers/mapMessageToStorable.js.map +1 -1
  52. package/lib/commonjs/store/mappers/mapStorableToMessage.js +5 -3
  53. package/lib/commonjs/store/mappers/mapStorableToMessage.js.map +1 -1
  54. package/lib/commonjs/store/schema.js +2 -1
  55. package/lib/commonjs/store/schema.js.map +1 -1
  56. package/lib/commonjs/utils/Streami18n.js +2 -2
  57. package/lib/commonjs/utils/Streami18n.js.map +1 -1
  58. package/lib/commonjs/utils/addReactionToLocalState.js +25 -13
  59. package/lib/commonjs/utils/addReactionToLocalState.js.map +1 -1
  60. package/lib/commonjs/utils/removeReactionFromLocalState.js +11 -3
  61. package/lib/commonjs/utils/removeReactionFromLocalState.js.map +1 -1
  62. package/lib/commonjs/utils/removeReservedFields.js +1 -1
  63. package/lib/commonjs/utils/removeReservedFields.js.map +1 -1
  64. package/lib/commonjs/utils/utils.js +19 -5
  65. package/lib/commonjs/utils/utils.js.map +1 -1
  66. package/lib/commonjs/version.json +1 -1
  67. package/lib/module/components/Channel/Channel.js +21 -20
  68. package/lib/module/components/Channel/Channel.js.map +1 -1
  69. package/lib/module/components/Chat/hooks/handleEventToSyncDB.js.map +1 -1
  70. package/lib/module/components/Message/Message.js +9 -19
  71. package/lib/module/components/Message/Message.js.map +1 -1
  72. package/lib/module/components/Message/MessageSimple/MessageFooter.js +1 -2
  73. package/lib/module/components/Message/MessageSimple/MessageFooter.js.map +1 -1
  74. package/lib/module/components/Message/MessageSimple/ReactionList.js +54 -37
  75. package/lib/module/components/Message/MessageSimple/ReactionList.js.map +1 -1
  76. package/lib/module/components/Message/hooks/useCreateMessageContext.js +6 -11
  77. package/lib/module/components/Message/hooks/useCreateMessageContext.js.map +1 -1
  78. package/lib/module/components/Message/hooks/useProcessReactions.js +90 -0
  79. package/lib/module/components/Message/hooks/useProcessReactions.js.map +1 -0
  80. package/lib/module/components/MessageOverlay/MessageOverlay.js +3 -12
  81. package/lib/module/components/MessageOverlay/MessageOverlay.js.map +1 -1
  82. package/lib/module/components/MessageOverlay/OverlayReactions.js +47 -143
  83. package/lib/module/components/MessageOverlay/OverlayReactions.js.map +1 -1
  84. package/lib/module/components/MessageOverlay/OverlayReactionsItem.js +166 -0
  85. package/lib/module/components/MessageOverlay/OverlayReactionsItem.js.map +1 -0
  86. package/lib/module/components/MessageOverlay/hooks/useFetchReactions.js +144 -0
  87. package/lib/module/components/MessageOverlay/hooks/useFetchReactions.js.map +1 -0
  88. package/lib/module/contexts/messageContext/MessageContext.js.map +1 -1
  89. package/lib/module/contexts/themeContext/utils/theme.js +0 -1
  90. package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
  91. package/lib/module/i18n/en.json +81 -81
  92. package/lib/module/i18n/es.json +81 -81
  93. package/lib/module/i18n/fr.json +81 -81
  94. package/lib/module/i18n/he.json +81 -81
  95. package/lib/module/i18n/hi.json +81 -81
  96. package/lib/module/i18n/it.json +81 -81
  97. package/lib/module/i18n/ja.json +81 -81
  98. package/lib/module/i18n/ko.json +81 -81
  99. package/lib/module/i18n/nl.json +81 -81
  100. package/lib/module/i18n/pt-br.json +83 -0
  101. package/lib/module/i18n/ru.json +81 -81
  102. package/lib/module/i18n/tr.json +81 -81
  103. package/lib/module/mock-builders/generator/message.js +2 -0
  104. package/lib/module/mock-builders/generator/message.js.map +1 -1
  105. package/lib/module/store/QuickSqliteClient.js +1 -1
  106. package/lib/module/store/apis/getReactions.js +17 -0
  107. package/lib/module/store/apis/getReactions.js.map +1 -0
  108. package/lib/module/store/apis/getReactionsforFilterSort.js +30 -0
  109. package/lib/module/store/apis/getReactionsforFilterSort.js.map +1 -0
  110. package/lib/module/store/apis/insertReaction.js +8 -1
  111. package/lib/module/store/apis/insertReaction.js.map +1 -1
  112. package/lib/module/store/apis/queries/selectReactionsForMessages.js +1 -1
  113. package/lib/module/store/apis/queries/selectReactionsForMessages.js.map +1 -1
  114. package/lib/module/store/apis/updateReaction.js +6 -6
  115. package/lib/module/store/apis/updateReaction.js.map +1 -1
  116. package/lib/module/store/mappers/mapMessageToStorable.js +5 -3
  117. package/lib/module/store/mappers/mapMessageToStorable.js.map +1 -1
  118. package/lib/module/store/mappers/mapStorableToMessage.js +5 -3
  119. package/lib/module/store/mappers/mapStorableToMessage.js.map +1 -1
  120. package/lib/module/store/schema.js +2 -1
  121. package/lib/module/store/schema.js.map +1 -1
  122. package/lib/module/utils/Streami18n.js +2 -2
  123. package/lib/module/utils/Streami18n.js.map +1 -1
  124. package/lib/module/utils/addReactionToLocalState.js +25 -13
  125. package/lib/module/utils/addReactionToLocalState.js.map +1 -1
  126. package/lib/module/utils/removeReactionFromLocalState.js +11 -3
  127. package/lib/module/utils/removeReactionFromLocalState.js.map +1 -1
  128. package/lib/module/utils/removeReservedFields.js +1 -1
  129. package/lib/module/utils/removeReservedFields.js.map +1 -1
  130. package/lib/module/utils/utils.js +19 -5
  131. package/lib/module/utils/utils.js.map +1 -1
  132. package/lib/module/version.json +1 -1
  133. package/lib/typescript/components/Channel/Channel.d.ts.map +1 -1
  134. package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts +2 -2
  135. package/lib/typescript/components/Chat/hooks/handleEventToSyncDB.d.ts.map +1 -1
  136. package/lib/typescript/components/Message/Message.d.ts.map +1 -1
  137. package/lib/typescript/components/Message/MessageSimple/ReactionList.d.ts +11 -3
  138. package/lib/typescript/components/Message/MessageSimple/ReactionList.d.ts.map +1 -1
  139. package/lib/typescript/components/Message/hooks/useCreateMessageContext.d.ts.map +1 -1
  140. package/lib/typescript/components/Message/hooks/useMessageActionHandlers.d.ts +1 -1
  141. package/lib/typescript/components/Message/hooks/useMessageActions.d.ts +1 -1
  142. package/lib/typescript/components/Message/hooks/useProcessReactions.d.ts +38 -0
  143. package/lib/typescript/components/Message/hooks/useProcessReactions.d.ts.map +1 -0
  144. package/lib/typescript/components/MessageOverlay/MessageOverlay.d.ts.map +1 -1
  145. package/lib/typescript/components/MessageOverlay/OverlayReactions.d.ts +2 -1
  146. package/lib/typescript/components/MessageOverlay/OverlayReactions.d.ts.map +1 -1
  147. package/lib/typescript/components/MessageOverlay/OverlayReactionsItem.d.ts +11 -0
  148. package/lib/typescript/components/MessageOverlay/OverlayReactionsItem.d.ts.map +1 -0
  149. package/lib/typescript/components/MessageOverlay/hooks/useFetchReactions.d.ts +14 -0
  150. package/lib/typescript/components/MessageOverlay/hooks/useFetchReactions.d.ts.map +1 -0
  151. package/lib/typescript/contexts/messageContext/MessageContext.d.ts +3 -6
  152. package/lib/typescript/contexts/messageContext/MessageContext.d.ts.map +1 -1
  153. package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +1 -1
  154. package/lib/typescript/contexts/themeContext/utils/theme.d.ts +0 -1
  155. package/lib/typescript/contexts/themeContext/utils/theme.d.ts.map +1 -1
  156. package/lib/typescript/i18n/en.json +81 -81
  157. package/lib/typescript/i18n/es.json +81 -81
  158. package/lib/typescript/i18n/fr.json +81 -81
  159. package/lib/typescript/i18n/he.json +81 -81
  160. package/lib/typescript/i18n/hi.json +81 -81
  161. package/lib/typescript/i18n/it.json +81 -81
  162. package/lib/typescript/i18n/ja.json +81 -81
  163. package/lib/typescript/i18n/ko.json +81 -81
  164. package/lib/typescript/i18n/nl.json +81 -81
  165. package/lib/typescript/i18n/pt-br.json +83 -0
  166. package/lib/typescript/i18n/ru.json +81 -81
  167. package/lib/typescript/i18n/tr.json +81 -81
  168. package/lib/typescript/store/apis/getReactions.d.ts +7 -0
  169. package/lib/typescript/store/apis/getReactions.d.ts.map +1 -0
  170. package/lib/typescript/store/apis/getReactionsforFilterSort.d.ts +14 -0
  171. package/lib/typescript/store/apis/getReactionsforFilterSort.d.ts.map +1 -0
  172. package/lib/typescript/store/apis/insertReaction.d.ts +3 -2
  173. package/lib/typescript/store/apis/insertReaction.d.ts.map +1 -1
  174. package/lib/typescript/store/apis/queries/selectReactionsForMessages.d.ts +4 -0
  175. package/lib/typescript/store/apis/queries/selectReactionsForMessages.d.ts.map +1 -1
  176. package/lib/typescript/store/apis/updateReaction.d.ts.map +1 -1
  177. package/lib/typescript/store/mappers/mapMessageToStorable.d.ts.map +1 -1
  178. package/lib/typescript/store/mappers/mapStorableToMessage.d.ts.map +1 -1
  179. package/lib/typescript/store/schema.d.ts +2 -1
  180. package/lib/typescript/store/schema.d.ts.map +1 -1
  181. package/lib/typescript/utils/Streami18n.d.ts +0 -5
  182. package/lib/typescript/utils/Streami18n.d.ts.map +1 -1
  183. package/lib/typescript/utils/addReactionToLocalState.d.ts.map +1 -1
  184. package/lib/typescript/utils/removeReactionFromLocalState.d.ts.map +1 -1
  185. package/lib/typescript/utils/removeReservedFields.d.ts.map +1 -1
  186. package/lib/typescript/utils/utils.d.ts +9 -3
  187. package/lib/typescript/utils/utils.d.ts.map +1 -1
  188. package/package.json +8 -9
  189. package/src/components/Channel/Channel.tsx +24 -34
  190. package/src/components/Chat/hooks/handleEventToSyncDB.ts +1 -2
  191. package/src/components/Message/Message.tsx +8 -26
  192. package/src/components/Message/MessageSimple/MessageFooter.tsx +1 -1
  193. package/src/components/Message/MessageSimple/ReactionList.tsx +72 -47
  194. package/src/components/Message/MessageSimple/__tests__/MessageContent.test.js +1 -1
  195. package/src/components/Message/hooks/useCreateMessageContext.ts +5 -10
  196. package/src/components/Message/hooks/useProcessReactions.ts +116 -0
  197. package/src/components/MessageOverlay/MessageOverlay.tsx +4 -17
  198. package/src/components/MessageOverlay/OverlayReactions.tsx +75 -176
  199. package/src/components/MessageOverlay/OverlayReactionsItem.tsx +188 -0
  200. package/src/components/MessageOverlay/hooks/useFetchReactions.ts +85 -0
  201. package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap +139 -0
  202. package/src/contexts/messageContext/MessageContext.tsx +2 -6
  203. package/src/contexts/themeContext/utils/theme.ts +0 -2
  204. package/src/i18n/en.json +1 -1
  205. package/src/i18n/es.json +57 -57
  206. package/src/i18n/fr.json +57 -57
  207. package/src/i18n/he.json +57 -57
  208. package/src/i18n/hi.json +57 -57
  209. package/src/i18n/it.json +57 -57
  210. package/src/i18n/ja.json +57 -57
  211. package/src/i18n/ko.json +59 -59
  212. package/src/i18n/nl.json +57 -57
  213. package/src/i18n/pt-br.json +83 -0
  214. package/src/i18n/ru.json +57 -57
  215. package/src/i18n/tr.json +57 -57
  216. package/src/mock-builders/generator/message.js +2 -0
  217. package/src/store/QuickSqliteClient.ts +1 -1
  218. package/src/store/apis/getReactions.ts +21 -0
  219. package/src/store/apis/getReactionsforFilterSort.ts +43 -0
  220. package/src/store/apis/insertReaction.ts +15 -5
  221. package/src/store/apis/queries/selectReactionsForMessages.ts +5 -1
  222. package/src/store/apis/updateReaction.ts +6 -18
  223. package/src/store/mappers/mapMessageToStorable.ts +4 -2
  224. package/src/store/mappers/mapStorableToMessage.ts +12 -2
  225. package/src/store/schema.ts +4 -2
  226. package/src/utils/Streami18n.ts +1 -1
  227. package/src/utils/addReactionToLocalState.ts +33 -17
  228. package/src/utils/removeReactionFromLocalState.ts +22 -2
  229. package/src/utils/removeReservedFields.ts +2 -0
  230. package/src/utils/utils.ts +19 -7
  231. package/src/version.json +1 -1
  232. package/lib/commonjs/i18n/pt-BR.json +0 -83
  233. package/lib/module/i18n/pt-BR.json +0 -83
  234. package/lib/typescript/i18n/pt-BR.json +0 -83
  235. package/src/i18n/pt-BR.json +0 -83
package/src/i18n/tr.json CHANGED
@@ -1,81 +1,81 @@
1
1
  {
2
2
  "1 Reply": "1 Cevap",
3
3
  "1 Thread Reply": "1 Konu Yanıtı",
4
- "Allow access to your Gallery": "",
5
- "Allow camera access in device settings": "",
4
+ "Allow access to your Gallery": "Galerinize erişime izin verin",
5
+ "Allow camera access in device settings": "Cihaz ayarlarında kamera erişimine izin ver",
6
6
  "Also send to channel": "Kanala da gönder",
7
- "Are you sure you want to permanently delete this message?": "",
8
- "Are you sure?": "",
9
- "Block User": "",
10
- "Cancel": "",
11
- "Cannot Flag Message": "",
12
- "Consider how your comment might make others feel and be sure to follow our Community Guidelines": "",
13
- "Copy Message": "",
14
- "Delete": "",
15
- "Delete Message": "",
16
- "Device camera is used to take photos or videos.": "",
17
- "Do you want to send a copy of this message to a moderator for further investigation?": "",
18
- "Edit Message": "",
19
- "Edited": "",
7
+ "Are you sure you want to permanently delete this message?": "Bu mesajı kalıcı olarak silmek istediğinizden emin misiniz?",
8
+ "Are you sure?": "Emin misiniz?",
9
+ "Block User": "Kullanıcıyı engelle",
10
+ "Cancel": "İptal",
11
+ "Cannot Flag Message": "Raporlama Başarısız",
12
+ "Consider how your comment might make others feel and be sure to follow our Community Guidelines": "Yorumunuzun diğerlerini nasıl hissettirebileceğini düşünün ve topluluk kurallarımızı takip ettiğinizden emin olun",
13
+ "Copy Message": "Mesajı Kopyala",
14
+ "Delete": "Sil",
15
+ "Delete Message": "Mesajı Sil",
16
+ "Device camera is used to take photos or videos.": "Cihaz kamerası fotoğraf veya video çekmek için kullanılır.",
17
+ "Do you want to send a copy of this message to a moderator for further investigation?": "Detaylı inceleme için bu mesajın kopyasını moderatöre göndermek istiyor musunuz?",
18
+ "Edit Message": "Mesajı Düzenle",
19
+ "Edited": "Düzenlendi",
20
20
  "Editing Message": "Mesaj Düzenleniyor",
21
- "Emoji matching": "",
21
+ "Emoji matching": "Emoji eşleştirme",
22
22
  "Empty message...": "Boş mesaj...",
23
- "Error loading": "",
24
- "Error loading channel list...": "",
25
- "Error loading messages for this channel...": "",
23
+ "Error loading": "Yükleme hatası",
24
+ "Error loading channel list...": "Kanal listesi yüklenirken hata oluştu...",
25
+ "Error loading messages for this channel...": "Bu kanal için mesajlar yüklenirken hata oluştu...",
26
26
  "Error while loading, please reload/refresh": "Yüklenirken hata oluştu, lütfen tekrar deneyiniz",
27
- "File is too large: {{ size }}, maximum upload size is {{ limit }}": "",
27
+ "File is too large: {{ size }}, maximum upload size is {{ limit }}": "Dosya çok büyük: {{ size }}, maksimum yükleme boyutu {{ limit }}",
28
28
  "File type not supported": "Dosya türü desteklenmiyor",
29
- "Flag": "",
30
- "Flag Message": "",
31
- "Flag action failed either due to a network issue or the message is already flagged": "",
32
- "Hold to start recording.": "",
33
- "How about sending your first message to a friend?": "",
34
- "Instant Commands": "",
35
- "Let's start chatting!": "",
36
- "Links are disabled": "",
37
- "Loading channels...": "",
38
- "Loading messages...": "",
39
- "Loading...": "",
40
- "Message Reactions": "",
29
+ "Flag": "Raporla",
30
+ "Flag Message": "Mesajı Raporla",
31
+ "Flag action failed either due to a network issue or the message is already flagged": "Mesajın daha önce raporlanmış olması veya bir ağ bağlantısı sorunu nedeniyle raporlama işlemi başarısız oldu.",
32
+ "Hold to start recording.": "Kayıt yapmak için basılı tutun.",
33
+ "How about sending your first message to a friend?": "İlk mesajınızı bir arkadaşınıza göndermeye ne dersiniz?",
34
+ "Instant Commands": "Anlık Komutlar",
35
+ "Let's start chatting!": "Haydi sohbete başlayalım!",
36
+ "Links are disabled": "Bağlantılar devre dışı",
37
+ "Loading channels...": "Kanallar yükleniyor...",
38
+ "Loading messages...": "Mesajlar yükleniyor...",
39
+ "Loading...": "Yükleniyor...",
40
+ "Message Reactions": "Mesaj Tepkileri",
41
41
  "Message deleted": "Mesaj silindi",
42
- "Message flagged": "",
43
- "Mute User": "",
44
- "No chats here yet…": "",
42
+ "Message flagged": "Mesaj işaretlendi",
43
+ "Mute User": "Kullanıcıyı sessize al",
44
+ "No chats here yet…": "Henüz burada sohbet yok…",
45
45
  "Not supported": "Desteklenmiyor",
46
46
  "Nothing yet...": "Henüz değil...",
47
- "Ok": "",
47
+ "Ok": "Tamam",
48
48
  "Only visible to you": "Sadece siz görebilirsiniz",
49
- "Open Settings": "",
50
- "Photo": "",
51
- "Photos and Videos": "",
52
- "Pin to Conversation": "",
49
+ "Open Settings": "Ayarları aç",
50
+ "Photo": "Fotoğraf",
51
+ "Photos and Videos": "Fotoğraflar ve Videolar",
52
+ "Pin to Conversation": "Konuşmaya sabitle",
53
53
  "Pinned by": "Tarafından sabitlendi",
54
- "Please allow Audio permissions in settings.": "",
55
- "Please enable access to your photos and videos so you can share them.": "",
56
- "Please select a channel first": "",
54
+ "Please allow Audio permissions in settings.": "Lütfen ayarlarda ses izinlerine izin verin",
55
+ "Please enable access to your photos and videos so you can share them.": "Paylaşım yapabilmek için lutfen fotoğraflarınıza ve videolarınıza erişimi etkinleştirin.",
56
+ "Please select a channel first": "Lütfen önce bir kanal seçiniz",
57
57
  "Reconnecting...": "Yeniden Bağlanılıyor...",
58
- "Reply": "",
58
+ "Reply": "Yanıtla",
59
59
  "Reply to Message": "Mesajı Yanıtla",
60
- "Resend": "",
60
+ "Resend": "Yeniden gönder",
61
61
  "Search GIFs": "GIF Ara",
62
- "Select More Photos": "",
63
- "Send Anyway": "",
62
+ "Select More Photos": "Daha Fazla Fotoğraf Seçin",
63
+ "Send Anyway": "Yine de Gönder",
64
64
  "Send a message": "Mesaj gönder",
65
- "Sending links is not allowed in this conversation": "",
65
+ "Sending links is not allowed in this conversation": "Bu konuşmada bağlantı göndermek desteklenmiyor",
66
66
  "Slow mode ON": "Yavaş Mod Açık",
67
- "The message has been reported to a moderator.": "",
68
- "Thread Reply": "",
69
- "Unblock User": "",
70
- "Unknown User": "",
71
- "Unmute User": "",
72
- "Unpin from Conversation": "",
73
- "Unread Messages": "",
74
- "Video": "",
67
+ "The message has been reported to a moderator.": "Mesaj moderatöre bildirildi.",
68
+ "Thread Reply": "Konu Yanıtı",
69
+ "Unblock User": "Kullanıcının engelini kaldır",
70
+ "Unknown User": "Bilinmeyen kullanıcı",
71
+ "Unmute User": "Kullanıcının sesini aç",
72
+ "Unpin from Conversation": "Sabitlemeyi kaldır",
73
+ "Unread Messages": "Okunmamış Mesajlar",
74
+ "Video": "Video",
75
75
  "You": "Sen",
76
76
  "You can't send messages in this channel": "Bu konuşmaya mesaj gönderemezsiniz",
77
77
  "{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} ve {{ nonSelfUserLength }} kişi daha yazıyor",
78
- "{{ index }} of {{ photoLength }}": "",
78
+ "{{ index }} of {{ photoLength }}": "{{ index }} / {{ photoLength }}",
79
79
  "{{ replyCount }} Replies": "{{ replyCount }} Cevap",
80
80
  "{{ replyCount }} Thread Replies": "{{responseCount}} Konu Cevapı",
81
81
  "{{ user }} is typing": "{{ user }} yazıyor",
@@ -11,6 +11,7 @@ export const generateMessage = (options = {}) => {
11
11
  created_at: timestamp,
12
12
  html: '<p>regular</p>',
13
13
  id: uuidv4(),
14
+ message_text_updated_at: timestamp,
14
15
  text: uuidv4(),
15
16
  type: 'regular',
16
17
  updated_at: timestamp.toString(),
@@ -24,6 +25,7 @@ export const generateStaticMessage = (seed, options, date) =>
24
25
  generateMessage({
25
26
  created_at: date || '2020-04-27T13:39:49.331742Z',
26
27
  id: uuidv5(seed, StreamReactNativeNamespace),
28
+ message_text_updated_at: date || '2020-04-27T13:39:49.331742Z',
27
29
  text: seed,
28
30
  updated_at: date || '2020-04-27T13:39:49.331742Z',
29
31
  ...options,
@@ -30,7 +30,7 @@ import type { PreparedQueries, Table } from './types';
30
30
  *
31
31
  */
32
32
  export class QuickSqliteClient {
33
- static dbVersion = 3;
33
+ static dbVersion = 5;
34
34
 
35
35
  static dbName = DB_NAME;
36
36
  static dbLocation = DB_LOCATION;
@@ -0,0 +1,21 @@
1
+ import type { ReactionResponse } from 'stream-chat';
2
+
3
+ import type { DefaultStreamChatGenerics } from '../../types/types';
4
+ import { mapStorableToReaction } from '../mappers/mapStorableToReaction';
5
+ import { QuickSqliteClient } from '../QuickSqliteClient';
6
+ import { TableRowJoinedUser } from '../types';
7
+
8
+ export const getReactions = <
9
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
10
+ >({
11
+ reactions,
12
+ }: {
13
+ reactions: TableRowJoinedUser<'reactions'>[];
14
+ }): ReactionResponse<StreamChatGenerics>[] => {
15
+ QuickSqliteClient.logger?.('info', 'getReactions', { reactions });
16
+
17
+ // Enrich the channels with state
18
+ return reactions.map((reaction) => ({
19
+ ...mapStorableToReaction<StreamChatGenerics>(reaction),
20
+ }));
21
+ };
@@ -0,0 +1,43 @@
1
+ import type { ReactionFilters, ReactionResponse, ReactionSort } from 'stream-chat';
2
+
3
+ import { getReactions } from './getReactions';
4
+ import { selectReactionsForMessages } from './queries/selectReactionsForMessages';
5
+
6
+ import type { DefaultStreamChatGenerics } from '../../types/types';
7
+
8
+ import { QuickSqliteClient } from '../QuickSqliteClient';
9
+
10
+ /**
11
+ * Fetches reactions for a message from the database based on the provided filters and sort.
12
+ * @param currentMessageId The message ID for which reactions are to be fetched.
13
+ * @param filters The filters to be applied while fetching reactions.
14
+ * @param sort The sort to be applied while fetching reactions.
15
+ */
16
+ export const getReactionsForFilterSort = <
17
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
18
+ >({
19
+ currentMessageId,
20
+ filters,
21
+ sort,
22
+ }: {
23
+ currentMessageId: string;
24
+ filters?: ReactionFilters<StreamChatGenerics>;
25
+ sort?: ReactionSort<StreamChatGenerics>;
26
+ }): ReactionResponse<StreamChatGenerics>[] | null => {
27
+ if (!filters && !sort) {
28
+ console.warn('Please provide the query (filters/sort) to fetch channels from DB');
29
+ return null;
30
+ }
31
+
32
+ QuickSqliteClient.logger?.('info', 'getReactionsForFilterSort', { filters, sort });
33
+
34
+ const reactions = selectReactionsForMessages([currentMessageId]);
35
+
36
+ if (!reactions) return null;
37
+
38
+ if (reactions.length === 0) {
39
+ return [];
40
+ }
41
+
42
+ return getReactions({ reactions });
43
+ };
@@ -1,14 +1,17 @@
1
- import type { ReactionResponse } from 'stream-chat';
1
+ import type { FormatMessageResponse, MessageResponse, ReactionResponse } from 'stream-chat';
2
2
 
3
3
  import { mapReactionToStorable } from '../mappers/mapReactionToStorable';
4
4
  import { QuickSqliteClient } from '../QuickSqliteClient';
5
+ import { createUpdateQuery } from '../sqlite-utils/createUpdateQuery';
5
6
  import { createUpsertQuery } from '../sqlite-utils/createUpsertQuery';
6
7
  import type { PreparedQueries } from '../types';
7
8
 
8
9
  export const insertReaction = ({
9
10
  flush = true,
11
+ message,
10
12
  reaction,
11
13
  }: {
14
+ message: MessageResponse | FormatMessageResponse;
12
15
  reaction: ReactionResponse;
13
16
  flush?: boolean;
14
17
  }) => {
@@ -18,10 +21,17 @@ export const insertReaction = ({
18
21
 
19
22
  queries.push(createUpsertQuery('reactions', storableReaction));
20
23
 
21
- queries.push([
22
- 'UPDATE messages SET reactionCounts = reactionCounts + 1 WHERE id = ?',
23
- [reaction.message_id],
24
- ]);
24
+ const stringifiedNewReactionGroups = JSON.stringify(message.reaction_groups);
25
+
26
+ queries.push(
27
+ createUpdateQuery(
28
+ 'messages',
29
+ {
30
+ reactionGroups: stringifiedNewReactionGroups,
31
+ },
32
+ { id: reaction.message_id },
33
+ ),
34
+ );
25
35
 
26
36
  QuickSqliteClient.logger?.('info', 'insertReaction', {
27
37
  flush,
@@ -2,6 +2,10 @@ import { QuickSqliteClient } from '../../QuickSqliteClient';
2
2
  import { tables } from '../../schema';
3
3
  import type { TableRowJoinedUser } from '../../types';
4
4
 
5
+ /**
6
+ * Fetches reactions for a message from the database for messageIds.
7
+ * @param messageIds The message IDs for which reactions are to be fetched.
8
+ */
5
9
  export const selectReactionsForMessages = (
6
10
  messageIds: string[],
7
11
  ): TableRowJoinedUser<'reactions'>[] => {
@@ -28,7 +32,7 @@ export const selectReactionsForMessages = (
28
32
  FROM reactions a
29
33
  LEFT JOIN
30
34
  users b
31
- ON b.id = a.userId
35
+ ON b.id = a.userId
32
36
  WHERE a.messageId in (${questionMarks})`,
33
37
  messageIds,
34
38
  );
@@ -34,30 +34,18 @@ export const updateReaction = ({
34
34
  }),
35
35
  );
36
36
 
37
- let updatedReactionCounts: string | undefined;
38
-
39
- if (message.reaction_counts) {
40
- const { reactionCounts } = mapMessageToStorable(message);
41
- updatedReactionCounts = reactionCounts;
42
-
43
- queries.push(
44
- createUpdateQuery(
45
- 'messages',
46
- {
47
- reactionCounts,
48
- },
49
- {
50
- id: message.id,
51
- },
52
- ),
53
- );
37
+ let updatedReactionGroups: string | undefined;
38
+ if (message.reaction_groups) {
39
+ const { reactionGroups } = mapMessageToStorable(message);
40
+ updatedReactionGroups = reactionGroups;
41
+ queries.push(createUpdateQuery('messages', { reactionGroups }, { id: message.id }));
54
42
  }
55
43
 
56
44
  QuickSqliteClient.logger?.('info', 'updateReaction', {
57
45
  addedUser: storableUser,
58
46
  flush,
59
47
  updatedReaction: storableReaction,
60
- updatedReactionCounts,
48
+ updatedReactionGroups,
61
49
  });
62
50
 
63
51
  if (flush) {
@@ -15,9 +15,10 @@ export const mapMessageToStorable = (
15
15
  id,
16
16
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
17
17
  latest_reactions,
18
+ message_text_updated_at,
18
19
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
19
20
  own_reactions,
20
- reaction_counts,
21
+ reaction_groups,
21
22
  text,
22
23
  type,
23
24
  updated_at,
@@ -32,7 +33,8 @@ export const mapMessageToStorable = (
32
33
  deletedAt: mapDateTimeToStorable(deleted_at),
33
34
  extraData: JSON.stringify(extraData),
34
35
  id,
35
- reactionCounts: JSON.stringify(reaction_counts),
36
+ messageTextUpdatedAt: mapDateTimeToStorable(message_text_updated_at),
37
+ reactionGroups: JSON.stringify(reaction_groups),
36
38
  text,
37
39
  type,
38
40
  updatedAt: mapDateTimeToStorable(updated_at),
@@ -19,7 +19,16 @@ export const mapStorableToMessage = <
19
19
  messageRow: TableRowJoinedUser<'messages'>;
20
20
  reactionRows: TableRowJoinedUser<'reactions'>[];
21
21
  }): MessageResponse<StreamChatGenerics> => {
22
- const { createdAt, deletedAt, extraData, reactionCounts, updatedAt, user, ...rest } = messageRow;
22
+ const {
23
+ createdAt,
24
+ deletedAt,
25
+ extraData,
26
+ messageTextUpdatedAt,
27
+ reactionGroups,
28
+ updatedAt,
29
+ user,
30
+ ...rest
31
+ } = messageRow;
23
32
  const latestReactions =
24
33
  reactionRows?.map((reaction) => mapStorableToReaction<StreamChatGenerics>(reaction)) || [];
25
34
 
@@ -31,8 +40,9 @@ export const mapStorableToMessage = <
31
40
  created_at: createdAt,
32
41
  deleted_at: deletedAt,
33
42
  latest_reactions: latestReactions,
43
+ message_text_updated_at: messageTextUpdatedAt,
34
44
  own_reactions: ownReactions,
35
- reaction_counts: reactionCounts ? JSON.parse(reactionCounts) : {},
45
+ reaction_groups: reactionGroups ? JSON.parse(reactionGroups) : {},
36
46
  updated_at: updatedAt,
37
47
  user: mapStorableToUser(user),
38
48
  ...(extraData ? JSON.parse(extraData) : {}),
@@ -102,7 +102,8 @@ export const tables: Tables = {
102
102
  deletedAt: 'TEXT',
103
103
  extraData: 'TEXT',
104
104
  id: 'TEXT',
105
- reactionCounts: 'TEXT',
105
+ messageTextUpdatedAt: 'TEXT',
106
+ reactionGroups: 'TEXT',
106
107
  text: "TEXT DEFAULT ''",
107
108
  type: 'TEXT',
108
109
  updatedAt: 'TEXT',
@@ -262,7 +263,8 @@ export type Schema = {
262
263
  deletedAt: string;
263
264
  extraData: string;
264
265
  id: string;
265
- reactionCounts: string;
266
+ messageTextUpdatedAt: string;
267
+ reactionGroups: string;
266
268
  type: MessageLabel;
267
269
  updatedAt: string;
268
270
  text?: string;
@@ -18,7 +18,7 @@ import itTranslations from '../i18n/it.json';
18
18
  import jaTranslations from '../i18n/ja.json';
19
19
  import koTranslations from '../i18n/ko.json';
20
20
  import nlTranslations from '../i18n/nl.json';
21
- import ptBRTranslations from '../i18n/pt-BR.json';
21
+ import ptBRTranslations from '../i18n/pt-br.json';
22
22
  import ruTranslations from '../i18n/ru.json';
23
23
  import trTranslations from '../i18n/tr.json';
24
24
 
@@ -49,30 +49,45 @@ export const addReactionToLocalState = <
49
49
  message.latest_reactions = [];
50
50
  }
51
51
  message.latest_reactions = message.latest_reactions.filter((r) => r.user_id !== user.id);
52
+
52
53
  if (
53
54
  currentReaction &&
54
- message.reaction_counts &&
55
- message.reaction_counts[currentReaction.type] &&
56
- message.reaction_counts[currentReaction.type] > 0
55
+ message.reaction_groups &&
56
+ message.reaction_groups[currentReaction.type] &&
57
+ message.reaction_groups[currentReaction.type].count > 0 &&
58
+ message.reaction_groups[currentReaction.type].sum_scores > 0
57
59
  ) {
58
- message.reaction_counts[currentReaction.type] =
59
- message.reaction_counts[currentReaction.type] - 1;
60
+ message.reaction_groups[currentReaction.type].count =
61
+ message.reaction_groups[currentReaction.type].count - 1;
62
+ message.reaction_groups[currentReaction.type].sum_scores =
63
+ message.reaction_groups[currentReaction.type].sum_scores - 1;
60
64
  }
61
65
 
62
- if (!message.reaction_counts) {
63
- message.reaction_counts = {
64
- [reactionType]: 1,
65
- };
66
- } else {
67
- message.reaction_counts[reactionType] = (message.reaction_counts?.[reactionType] || 0) + 1;
68
- }
69
- } else {
70
- if (!message.reaction_counts) {
71
- message.reaction_counts = {
72
- [reactionType]: 1,
66
+ if (!message.reaction_groups) {
67
+ message.reaction_groups = {
68
+ [reactionType]: {
69
+ count: 1,
70
+ first_reaction_at: new Date().toISOString(),
71
+ last_reaction_at: new Date().toISOString(),
72
+ sum_scores: 1,
73
+ },
73
74
  };
74
75
  } else {
75
- message.reaction_counts[reactionType] = (message.reaction_counts?.[reactionType] || 0) + 1;
76
+ if (!message.reaction_groups[reactionType]) {
77
+ message.reaction_groups[reactionType] = {
78
+ count: 1,
79
+ first_reaction_at: new Date().toISOString(),
80
+ last_reaction_at: new Date().toISOString(),
81
+ sum_scores: 1,
82
+ };
83
+ } else {
84
+ message.reaction_groups[reactionType] = {
85
+ ...message.reaction_groups[reactionType],
86
+ count: message.reaction_groups[reactionType].count + 1,
87
+ last_reaction_at: new Date().toISOString(),
88
+ sum_scores: message.reaction_groups[reactionType].sum_scores + 1,
89
+ };
90
+ }
76
91
  }
77
92
  }
78
93
 
@@ -86,6 +101,7 @@ export const addReactionToLocalState = <
86
101
  });
87
102
  } else {
88
103
  insertReaction({
104
+ message,
89
105
  reaction,
90
106
  });
91
107
  }
@@ -27,8 +27,28 @@ export const removeReactionFromLocalState = <
27
27
  (r) => !(r.user_id === user?.id && r.type === reactionType),
28
28
  );
29
29
 
30
- if (message.reaction_counts?.[reactionType] && message.reaction_counts?.[reactionType] > 0) {
31
- message.reaction_counts[reactionType] = message.reaction_counts[reactionType] - 1;
30
+ if (message.reaction_groups?.[reactionType]) {
31
+ if (
32
+ message.reaction_groups[reactionType].count > 0 ||
33
+ message.reaction_groups[reactionType].sum_scores > 0
34
+ ) {
35
+ message.reaction_groups[reactionType].count = Math.max(
36
+ 0,
37
+ message.reaction_groups[reactionType].count - 1,
38
+ );
39
+ message.reaction_groups[reactionType].sum_scores = Math.max(
40
+ 0,
41
+ message.reaction_groups[reactionType].sum_scores - 1,
42
+ );
43
+ if (
44
+ message.reaction_groups[reactionType].count === 0 ||
45
+ message.reaction_groups[reactionType].sum_scores === 0
46
+ ) {
47
+ delete message.reaction_groups[reactionType];
48
+ }
49
+ } else {
50
+ delete message.reaction_groups[reactionType];
51
+ }
32
52
  }
33
53
 
34
54
  deleteReaction({
@@ -19,8 +19,10 @@ export const removeReservedFields = <
19
19
  'latest_reactions',
20
20
  'own_reactions',
21
21
  'reaction_counts',
22
+ 'reaction_groups',
22
23
  'last_message_at',
23
24
  'member_count',
25
+ 'message_text_updated_at',
24
26
  'type',
25
27
  'updated_at',
26
28
  'reply_count',
@@ -13,7 +13,8 @@ import type {
13
13
  UserResponse,
14
14
  } from 'stream-chat';
15
15
 
16
- import type { MessageType } from '../components/MessageList/hooks/useMessageList';
16
+ import { IconProps } from '../../src/icons/utils/base';
17
+ import { MessageType } from '../components/MessageList/hooks/useMessageList';
17
18
  import type {
18
19
  EmojiSearchIndex,
19
20
  MentionAllAppUsersQuery,
@@ -24,7 +25,6 @@ import type {
24
25
  SuggestionUser,
25
26
  } from '../contexts/suggestionsContext/SuggestionsContext';
26
27
  import { compiledEmojis, Emoji } from '../emoji-data';
27
- import type { IconProps } from '../icons/utils/base';
28
28
  import type { TableRowJoinedUser } from '../store/types';
29
29
  import type { DefaultStreamChatGenerics, ValueOf } from '../types/types';
30
30
 
@@ -602,19 +602,31 @@ export const hasOnlyEmojis = (text: string) => {
602
602
  * @param {FormatMessageResponse<StreamChatGenerics>} message - the message object to be stringified
603
603
  * @returns {string} The stringified message
604
604
  */
605
- const stringifyMessage = <
605
+ export const stringifyMessage = <
606
606
  StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
607
607
  >({
608
608
  deleted_at,
609
609
  latest_reactions,
610
+ reaction_groups,
611
+ readBy,
610
612
  reply_count,
611
613
  status,
614
+ text,
612
615
  type,
613
616
  updated_at,
614
- }: FormatMessageResponse<StreamChatGenerics>): string =>
615
- `${type}${deleted_at}${
616
- latest_reactions ? latest_reactions.map(({ type }) => type).join() : ''
617
- }${reply_count}${status}${updated_at?.toISOString?.() || updated_at}`;
617
+ }: FormatMessageResponse<StreamChatGenerics> | MessageType<StreamChatGenerics>): string =>
618
+ `${
619
+ latest_reactions ? latest_reactions.map(({ type, user }) => `${type}${user?.id}`).join() : ''
620
+ }${
621
+ reaction_groups
622
+ ? Object.entries(reaction_groups)
623
+ .flatMap(
624
+ ([type, { count, first_reaction_at, last_reaction_at }]) =>
625
+ `${type}${count}${first_reaction_at}${last_reaction_at}`,
626
+ )
627
+ .join()
628
+ : ''
629
+ }${type}${deleted_at}${text}${readBy}${reply_count}${status}${updated_at}`;
618
630
 
619
631
  /**
620
632
  * Reduces a list of messages to strings that are used in useEffect & useMemo
package/src/version.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "5.31.2-beta.3"
2
+ "version": "5.32.0-beta.2"
3
3
  }