stream-chat-react-native-core 5.27.0-beta.9 → 5.27.0

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 (96) hide show
  1. package/lib/commonjs/components/Attachment/Gallery.js +4 -4
  2. package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
  3. package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js +1 -1
  4. package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
  5. package/lib/commonjs/components/Chat/hooks/handleEventToSyncDB.js +100 -37
  6. package/lib/commonjs/components/Chat/hooks/handleEventToSyncDB.js.map +1 -1
  7. package/lib/commonjs/components/Chat/hooks/useSyncDatabase.js +3 -1
  8. package/lib/commonjs/components/Chat/hooks/useSyncDatabase.js.map +1 -1
  9. package/lib/commonjs/components/ImageGallery/ImageGallery.js +39 -21
  10. package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
  11. package/lib/commonjs/i18n/en.json +1 -1
  12. package/lib/commonjs/i18n/es.json +64 -64
  13. package/lib/commonjs/i18n/fr.json +64 -64
  14. package/lib/commonjs/i18n/he.json +64 -64
  15. package/lib/commonjs/i18n/hi.json +64 -64
  16. package/lib/commonjs/i18n/it.json +64 -64
  17. package/lib/commonjs/i18n/ja.json +64 -64
  18. package/lib/commonjs/i18n/ko.json +64 -64
  19. package/lib/commonjs/i18n/nl.json +64 -64
  20. package/lib/commonjs/i18n/pt-BR.json +64 -64
  21. package/lib/commonjs/i18n/ru.json +64 -64
  22. package/lib/commonjs/i18n/tr.json +64 -64
  23. package/lib/commonjs/store/apis/upsertChannelDataFromChannel.js +21 -0
  24. package/lib/commonjs/store/apis/upsertChannelDataFromChannel.js.map +1 -0
  25. package/lib/commonjs/store/mappers/mapChannelToStorable.js +63 -0
  26. package/lib/commonjs/store/mappers/mapChannelToStorable.js.map +1 -0
  27. package/lib/commonjs/utils/DBSyncManager.js +73 -68
  28. package/lib/commonjs/utils/DBSyncManager.js.map +1 -1
  29. package/lib/commonjs/version.json +1 -1
  30. package/lib/module/components/Attachment/Gallery.js +4 -4
  31. package/lib/module/components/Attachment/Gallery.js.map +1 -1
  32. package/lib/module/components/AttachmentPicker/AttachmentPicker.js +1 -1
  33. package/lib/module/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
  34. package/lib/module/components/Chat/hooks/handleEventToSyncDB.js +100 -37
  35. package/lib/module/components/Chat/hooks/handleEventToSyncDB.js.map +1 -1
  36. package/lib/module/components/Chat/hooks/useSyncDatabase.js +3 -1
  37. package/lib/module/components/Chat/hooks/useSyncDatabase.js.map +1 -1
  38. package/lib/module/components/ImageGallery/ImageGallery.js +39 -21
  39. package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
  40. package/lib/module/i18n/en.json +1 -1
  41. package/lib/module/i18n/es.json +64 -64
  42. package/lib/module/i18n/fr.json +64 -64
  43. package/lib/module/i18n/he.json +64 -64
  44. package/lib/module/i18n/hi.json +64 -64
  45. package/lib/module/i18n/it.json +64 -64
  46. package/lib/module/i18n/ja.json +64 -64
  47. package/lib/module/i18n/ko.json +64 -64
  48. package/lib/module/i18n/nl.json +64 -64
  49. package/lib/module/i18n/pt-BR.json +64 -64
  50. package/lib/module/i18n/ru.json +64 -64
  51. package/lib/module/i18n/tr.json +64 -64
  52. package/lib/module/store/apis/upsertChannelDataFromChannel.js +21 -0
  53. package/lib/module/store/apis/upsertChannelDataFromChannel.js.map +1 -0
  54. package/lib/module/store/mappers/mapChannelToStorable.js +63 -0
  55. package/lib/module/store/mappers/mapChannelToStorable.js.map +1 -0
  56. package/lib/module/utils/DBSyncManager.js +73 -68
  57. package/lib/module/utils/DBSyncManager.js.map +1 -1
  58. package/lib/module/version.json +1 -1
  59. package/lib/typescript/components/Chat/hooks/handleEventToSyncDB.d.ts +4 -2
  60. package/lib/typescript/i18n/en.json +1 -1
  61. package/lib/typescript/i18n/es.json +64 -64
  62. package/lib/typescript/i18n/fr.json +64 -64
  63. package/lib/typescript/i18n/he.json +64 -64
  64. package/lib/typescript/i18n/hi.json +64 -64
  65. package/lib/typescript/i18n/it.json +64 -64
  66. package/lib/typescript/i18n/ja.json +64 -64
  67. package/lib/typescript/i18n/ko.json +64 -64
  68. package/lib/typescript/i18n/nl.json +64 -64
  69. package/lib/typescript/i18n/pt-BR.json +64 -64
  70. package/lib/typescript/i18n/ru.json +64 -64
  71. package/lib/typescript/i18n/tr.json +64 -64
  72. package/lib/typescript/store/apis/upsertChannelDataFromChannel.d.ts +6 -0
  73. package/lib/typescript/store/mappers/mapChannelToStorable.d.ts +4 -0
  74. package/lib/typescript/utils/DBSyncManager.d.ts +1 -1
  75. package/package.json +1 -1
  76. package/src/components/Attachment/Gallery.tsx +5 -5
  77. package/src/components/AttachmentPicker/AttachmentPicker.tsx +1 -1
  78. package/src/components/Chat/hooks/handleEventToSyncDB.ts +132 -46
  79. package/src/components/Chat/hooks/useSyncDatabase.ts +1 -1
  80. package/src/components/ImageGallery/ImageGallery.tsx +25 -2
  81. package/src/i18n/en.json +1 -1
  82. package/src/i18n/es.json +64 -64
  83. package/src/i18n/fr.json +64 -64
  84. package/src/i18n/he.json +64 -64
  85. package/src/i18n/hi.json +64 -64
  86. package/src/i18n/it.json +64 -64
  87. package/src/i18n/ja.json +64 -64
  88. package/src/i18n/ko.json +64 -64
  89. package/src/i18n/nl.json +64 -64
  90. package/src/i18n/pt-BR.json +64 -64
  91. package/src/i18n/ru.json +64 -64
  92. package/src/i18n/tr.json +64 -64
  93. package/src/store/apis/upsertChannelDataFromChannel.ts +25 -0
  94. package/src/store/mappers/mapChannelToStorable.ts +68 -0
  95. package/src/utils/DBSyncManager.ts +7 -3
  96. package/src/version.json +1 -1
package/src/i18n/tr.json CHANGED
@@ -1,79 +1,79 @@
1
1
  {
2
- "1 Reply": "",
3
- "1 Thread Reply": "",
4
- "Allow access to your Gallery": "",
5
- "Allow camera access in device settings": "",
6
- "Also send to channel": "",
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
- "Editing Message": "",
2
+ "1 Reply": "1 Cevap",
3
+ "1 Thread Reply": "1 Konu Yanıtı",
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
+ "Also send to channel": "Kanala da gönder",
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
+ "Editing Message": "Mesaj Düzenleniyor",
20
20
  "Emoji matching": "Emoji eşleştirme",
21
- "Empty message...": "",
21
+ "Empty message...": "Boş mesaj...",
22
22
  "Error loading": "Yükleme hatası",
23
- "Error loading channel list...": "",
23
+ "Error loading channel list...": "Kanal listesi yüklenirken hata oluştu...",
24
24
  "Error loading messages for this channel...": "Bu kanal için mesajlar yüklenirken hata oluştu...",
25
- "Error while loading, please reload/refresh": "",
25
+ "Error while loading, please reload/refresh": "Yüklenirken hata oluştu, lütfen tekrar deneyiniz",
26
26
  "File type not supported": "Dosya türü desteklenmiyor",
27
- "Flag": "",
28
- "Flag Message": "",
29
- "Flag action failed either due to a network issue or the message is already flagged": "",
30
- "How about sending your first message to a friend?": "",
27
+ "Flag": "Raporla",
28
+ "Flag Message": "Mesajı Raporla",
29
+ "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.",
30
+ "How about sending your first message to a friend?": "İlk mesajınızı bir arkadaşınıza göndermeye ne dersiniz?",
31
31
  "Instant Commands": "Anlık Komutlar",
32
- "Let's start chatting!": "",
32
+ "Let's start chatting!": "Haydi sohbete başlayalım!",
33
33
  "Links are disabled": "Bağlantılar devre dışı",
34
- "Loading channels...": "",
35
- "Loading messages...": "",
36
- "Loading...": "",
34
+ "Loading channels...": "Kanallar yükleniyor...",
35
+ "Loading messages...": "Mesajlar yükleniyor...",
36
+ "Loading...": "Yükleniyor...",
37
37
  "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "Maksimum dosya boyutu yükleme sınırına ulaşıldı. Lütfen {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB'ın altında bir dosya yükleyin.",
38
- "Message Reactions": "",
38
+ "Message Reactions": "Mesaj Tepkileri",
39
39
  "Message deleted": "Mesaj silindi",
40
- "Message flagged": "",
41
- "Mute User": "",
40
+ "Message flagged": "Mesaj işaretlendi",
41
+ "Mute User": "Kullanıcıyı sessize al",
42
42
  "Not supported": "Desteklenmiyor",
43
- "Nothing yet...": "",
44
- "Ok": "",
45
- "Only visible to you": "",
46
- "Open Settings": "",
47
- "Photo": "",
48
- "Photos and Videos": "",
49
- "Pin to Conversation": "",
50
- "Pinned by": "",
51
- "Please enable access to your photos and videos so you can share them.": "",
43
+ "Nothing yet...": "Henüz değil...",
44
+ "Ok": "Tamam",
45
+ "Only visible to you": "Sadece siz görebilirsiniz",
46
+ "Open Settings": "Ayarları aç",
47
+ "Photo": "Fotoğraf",
48
+ "Photos and Videos": "Fotoğraflar ve Videolar",
49
+ "Pin to Conversation": "Konuşmaya sabitle",
50
+ "Pinned by": "Tarafından sabitlendi",
51
+ "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.",
52
52
  "Please select a channel first": "Lütfen önce bir kanal seçiniz",
53
53
  "Reconnecting...": "Yeniden Bağlanılıyor...",
54
- "Reply": "",
55
- "Reply to Message": "",
56
- "Resend": "",
57
- "Search GIFs": "",
58
- "Select More Photos": "",
59
- "Send Anyway": "",
60
- "Send a message": "",
54
+ "Reply": "Yanıtla",
55
+ "Reply to Message": "Mesajı Yanıtla",
56
+ "Resend": "Yeniden gönder",
57
+ "Search GIFs": "GIF Ara",
58
+ "Select More Photos": "Daha Fazla Fotoğraf Seçin",
59
+ "Send Anyway": "Yine de Gönder",
60
+ "Send a message": "Mesaj gönder",
61
61
  "Sending links is not allowed in this conversation": "Bu konuşmada bağlantı göndermek desteklenmiyor",
62
- "Slow mode ON": "",
63
- "The message has been reported to a moderator.": "",
64
- "Thread Reply": "",
65
- "Unblock User": "",
66
- "Unknown User": "",
67
- "Unmute User": "",
68
- "Unpin from Conversation": "",
69
- "Unread Messages": "",
70
- "Video": "",
62
+ "Slow mode ON": "Yavaş Mod Açık",
63
+ "The message has been reported to a moderator.": "Mesaj moderatöre bildirildi.",
64
+ "Thread Reply": "Konu Yanıtı",
65
+ "Unblock User": "Kullanıcının engelini kaldır",
66
+ "Unknown User": "Bilinmeyen kullanıcı",
67
+ "Unmute User": "Kullanıcının sesini aç",
68
+ "Unpin from Conversation": "Sabitlemeyi kaldır",
69
+ "Unread Messages": "Okunmamış Mesajlar",
70
+ "Video": "Video",
71
71
  "You": "Sen",
72
- "You can't send messages in this channel": "",
73
- "{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "",
74
- "{{ index }} of {{ photoLength }}": "",
75
- "{{ replyCount }} Replies": "",
76
- "{{ replyCount }} Thread Replies": "",
77
- "{{ user }} is typing": "",
78
- "🏙 Attachment...": ""
72
+ "You can't send messages in this channel": "Bu konuşmaya mesaj gönderemezsiniz",
73
+ "{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} ve {{ nonSelfUserLength }} kişi daha yazıyor",
74
+ "{{ index }} of {{ photoLength }}": "{{ index }} / {{ photoLength }}",
75
+ "{{ replyCount }} Replies": "{{ replyCount }} Cevap",
76
+ "{{ replyCount }} Thread Replies": "{{responseCount}} Konu Cevapı",
77
+ "{{ user }} is typing": "{{ user }} yazıyor",
78
+ "🏙 Attachment...": "🏙 Ek..."
79
79
  }
@@ -0,0 +1,25 @@
1
+ import { DefaultStreamChatGenerics } from 'src/types/types';
2
+ import type { Channel } from 'stream-chat';
3
+
4
+ import { mapChannelToStorable } from '../mappers/mapChannelToStorable';
5
+ import { QuickSqliteClient } from '../QuickSqliteClient';
6
+ import { createUpsertQuery } from '../sqlite-utils/createUpsertQuery';
7
+
8
+ export const upsertChannelDataFromChannel = <
9
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
10
+ >({
11
+ channel,
12
+ flush = true,
13
+ }: {
14
+ channel: Channel<StreamChatGenerics>;
15
+ flush?: boolean;
16
+ }) => {
17
+ const storableChannel = mapChannelToStorable(channel);
18
+ if (!storableChannel) return;
19
+ const query = createUpsertQuery('channels', storableChannel);
20
+ if (flush) {
21
+ QuickSqliteClient.executeSqlBatch([query]);
22
+ }
23
+
24
+ return [query];
25
+ };
@@ -0,0 +1,68 @@
1
+ import type { Channel, ChannelResponse } from 'stream-chat';
2
+
3
+ import { mapDateTimeToStorable } from './mapDateTimeToStorable';
4
+
5
+ import type { DefaultStreamChatGenerics } from '../../types/types';
6
+
7
+ import type { TableRow } from '../types';
8
+
9
+ export const mapChannelToStorable = <
10
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
11
+ >(
12
+ channel: Channel<StreamChatGenerics>,
13
+ ): TableRow<'channels'> | undefined => {
14
+ if (!channel.data) return;
15
+ const {
16
+ auto_translation_enabled,
17
+ auto_translation_language,
18
+ cid,
19
+ config,
20
+ cooldown,
21
+ created_at,
22
+ deleted_at,
23
+ disabled,
24
+ frozen,
25
+ hidden,
26
+ id,
27
+ invites,
28
+ last_message_at,
29
+ member_count,
30
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
31
+ members,
32
+ muted,
33
+ own_capabilities,
34
+ team,
35
+ truncated_at,
36
+ truncated_by,
37
+ truncated_by_id,
38
+ type,
39
+ updated_at,
40
+ ...extraData
41
+ } = channel.data as unknown as ChannelResponse<StreamChatGenerics>;
42
+
43
+ return {
44
+ autoTranslationEnabled: auto_translation_enabled,
45
+ autoTranslationLanguage: auto_translation_language,
46
+ cid,
47
+ config: config && JSON.stringify(config),
48
+ cooldown,
49
+ createdAt: mapDateTimeToStorable(created_at),
50
+ deletedAt: mapDateTimeToStorable(deleted_at),
51
+ disabled,
52
+ extraData: JSON.stringify(extraData),
53
+ frozen,
54
+ hidden,
55
+ id,
56
+ invites: invites && JSON.stringify(invites),
57
+ lastMessageAt: mapDateTimeToStorable(last_message_at),
58
+ memberCount: member_count,
59
+ muted,
60
+ ownCapabilities: own_capabilities && JSON.stringify(own_capabilities),
61
+ team,
62
+ truncatedAt: truncated_at,
63
+ truncatedBy: truncated_by && JSON.stringify(truncated_by),
64
+ truncatedById: truncated_by_id,
65
+ type,
66
+ updatedAt: updated_at,
67
+ };
68
+ };
@@ -90,7 +90,11 @@ export class DBSyncManager {
90
90
  };
91
91
  };
92
92
 
93
- static sync = async () => {
93
+ static sync = async <
94
+ StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
95
+ >(
96
+ client: StreamChat<StreamChatGenerics>,
97
+ ) => {
94
98
  if (!this.client?.user) return;
95
99
  const cids = getAllChannelIds();
96
100
  // If there are no channels, then there is no need to sync.
@@ -113,7 +117,7 @@ export class DBSyncManager {
113
117
  try {
114
118
  const result = await this.client.sync(cids, lastSyncedAtDate.toISOString());
115
119
  const queries = result.events.reduce<PreparedQueries[]>((queries, event) => {
116
- queries = queries.concat(handleEventToSyncDB(event, false));
120
+ queries = queries.concat(handleEventToSyncDB(event, client, false));
117
121
  return queries;
118
122
  }, []);
119
123
 
@@ -137,7 +141,7 @@ export class DBSyncManager {
137
141
  if (!this.client) return;
138
142
 
139
143
  await this.executePendingTasks(this.client);
140
- await this.sync();
144
+ await this.sync(this.client);
141
145
  };
142
146
 
143
147
  static queueTask = async <
package/src/version.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "5.27.0-beta.9"
2
+ "version": "5.27.0"
3
3
  }