stream-chat-react-native-core 5.26.1-beta.2 → 5.26.1-beta.3

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 (74) hide show
  1. package/lib/commonjs/components/Chat/Chat.js +12 -5
  2. package/lib/commonjs/components/Chat/Chat.js.map +1 -1
  3. package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js +2 -0
  4. package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js.map +1 -1
  5. package/lib/commonjs/contexts/chatContext/ChatContext.js +2 -2
  6. package/lib/commonjs/contexts/chatContext/ChatContext.js.map +1 -1
  7. package/lib/commonjs/i18n/en.json +1 -1
  8. package/lib/commonjs/i18n/es.json +34 -34
  9. package/lib/commonjs/i18n/fr.json +34 -34
  10. package/lib/commonjs/i18n/he.json +34 -34
  11. package/lib/commonjs/i18n/hi.json +34 -34
  12. package/lib/commonjs/i18n/it.json +34 -34
  13. package/lib/commonjs/i18n/ja.json +34 -34
  14. package/lib/commonjs/i18n/ko.json +34 -34
  15. package/lib/commonjs/i18n/nl.json +34 -34
  16. package/lib/commonjs/i18n/pt-BR.json +34 -34
  17. package/lib/commonjs/i18n/ru.json +34 -34
  18. package/lib/commonjs/i18n/tr.json +34 -34
  19. package/lib/commonjs/utils/StreamChatRN.js.map +1 -1
  20. package/lib/commonjs/version.json +1 -1
  21. package/lib/module/components/Chat/Chat.js +12 -5
  22. package/lib/module/components/Chat/Chat.js.map +1 -1
  23. package/lib/module/components/Chat/hooks/useCreateChatContext.js +2 -0
  24. package/lib/module/components/Chat/hooks/useCreateChatContext.js.map +1 -1
  25. package/lib/module/contexts/chatContext/ChatContext.js +2 -2
  26. package/lib/module/contexts/chatContext/ChatContext.js.map +1 -1
  27. package/lib/module/i18n/en.json +1 -1
  28. package/lib/module/i18n/es.json +34 -34
  29. package/lib/module/i18n/fr.json +34 -34
  30. package/lib/module/i18n/he.json +34 -34
  31. package/lib/module/i18n/hi.json +34 -34
  32. package/lib/module/i18n/it.json +34 -34
  33. package/lib/module/i18n/ja.json +34 -34
  34. package/lib/module/i18n/ko.json +34 -34
  35. package/lib/module/i18n/nl.json +34 -34
  36. package/lib/module/i18n/pt-BR.json +34 -34
  37. package/lib/module/i18n/ru.json +34 -34
  38. package/lib/module/i18n/tr.json +34 -34
  39. package/lib/module/utils/StreamChatRN.js.map +1 -1
  40. package/lib/module/version.json +1 -1
  41. package/lib/typescript/components/Chat/Chat.d.ts +1 -1
  42. package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts +1 -1
  43. package/lib/typescript/contexts/chatContext/ChatContext.d.ts +4 -0
  44. package/lib/typescript/i18n/en.json +1 -1
  45. package/lib/typescript/i18n/es.json +34 -34
  46. package/lib/typescript/i18n/fr.json +34 -34
  47. package/lib/typescript/i18n/he.json +34 -34
  48. package/lib/typescript/i18n/hi.json +34 -34
  49. package/lib/typescript/i18n/it.json +34 -34
  50. package/lib/typescript/i18n/ja.json +34 -34
  51. package/lib/typescript/i18n/ko.json +34 -34
  52. package/lib/typescript/i18n/nl.json +34 -34
  53. package/lib/typescript/i18n/pt-BR.json +34 -34
  54. package/lib/typescript/i18n/ru.json +34 -34
  55. package/lib/typescript/i18n/tr.json +34 -34
  56. package/lib/typescript/utils/StreamChatRN.d.ts +2 -0
  57. package/package.json +1 -1
  58. package/src/components/Chat/Chat.tsx +7 -1
  59. package/src/components/Chat/hooks/useCreateChatContext.ts +2 -0
  60. package/src/contexts/chatContext/ChatContext.tsx +4 -0
  61. package/src/i18n/en.json +1 -1
  62. package/src/i18n/es.json +34 -34
  63. package/src/i18n/fr.json +34 -34
  64. package/src/i18n/he.json +34 -34
  65. package/src/i18n/hi.json +34 -34
  66. package/src/i18n/it.json +34 -34
  67. package/src/i18n/ja.json +34 -34
  68. package/src/i18n/ko.json +34 -34
  69. package/src/i18n/nl.json +34 -34
  70. package/src/i18n/pt-BR.json +34 -34
  71. package/src/i18n/ru.json +34 -34
  72. package/src/i18n/tr.json +34 -34
  73. package/src/utils/StreamChatRN.ts +2 -0
  74. package/src/version.json +1 -1
@@ -4,29 +4,29 @@
4
4
  "Allow access to your Gallery": "Permitir acesso à sua Galeria",
5
5
  "Allow camera access in device settings": "Permitir acesso à câmera nas configurações do dispositivo",
6
6
  "Also send to channel": "",
7
- "Are you sure you want to permanently delete this message?": "",
7
+ "Are you sure you want to permanently delete this message?": "Tem certeza de que deseja excluir esta mensagem permanentemente?",
8
8
  "Are you sure?": "",
9
- "Block User": "",
10
- "Cancel": "",
11
- "Cannot Flag Message": "",
9
+ "Block User": "Bloquear Usuário",
10
+ "Cancel": "Cancelar",
11
+ "Cannot Flag Message": "Não é possível reportar a mensagem",
12
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": "",
13
+ "Copy Message": "Copiar Mensagem",
14
+ "Delete": "Excluir",
15
+ "Delete Message": "Excluir Mensagem",
16
16
  "Device camera is used to take photos or videos.": "A câmera do dispositivo é usada para tirar fotos ou vídeos.",
17
- "Do you want to send a copy of this message to a moderator for further investigation?": "",
18
- "Edit Message": "",
19
- "Editing Message": "Editando Mensagem",
17
+ "Do you want to send a copy of this message to a moderator for further investigation?": "Deseja enviar uma cópia desta mensagem para um moderador para investigação adicional?",
18
+ "Edit Message": "Editar Mensagem",
19
+ "Editing Message": "",
20
20
  "Emoji matching": "",
21
21
  "Empty message...": "",
22
- "Error loading": "Erro ao carregar",
22
+ "Error loading": "",
23
23
  "Error loading channel list...": "",
24
24
  "Error loading messages for this channel...": "",
25
25
  "Error while loading, please reload/refresh": "",
26
- "File type not supported": "",
27
- "Flag": "",
28
- "Flag Message": "",
29
- "Flag action failed either due to a network issue or the message is already flagged": "",
26
+ "File type not supported": "Tipo de arquivo não suportado",
27
+ "Flag": "Reportar",
28
+ "Flag Message": "Reportar Mensagem",
29
+ "Flag action failed either due to a network issue or the message is already flagged": "A ação para reportar a mensagem falhou devido a um problema de rede ou a mensagem já foi reportada.",
30
30
  "How about sending your first message to a friend?": "",
31
31
  "Instant Commands": "",
32
32
  "Let's start chatting!": "",
@@ -35,45 +35,45 @@
35
35
  "Loading messages...": "",
36
36
  "Loading...": "",
37
37
  "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "",
38
- "Message Reactions": "",
38
+ "Message Reactions": "Reações à Mensagem",
39
39
  "Message deleted": "",
40
- "Message flagged": "",
41
- "Mute User": "",
42
- "Not supported": "Não suportado",
40
+ "Message flagged": "Mensagem sinalizada",
41
+ "Mute User": "Silenciar Usuário",
42
+ "Not supported": "",
43
43
  "Nothing yet...": "",
44
- "Ok": "",
45
- "Only visible to you": "Apenas visível para você",
44
+ "Ok": "Ok",
45
+ "Only visible to you": "",
46
46
  "Open Settings": "Abrir Configurações",
47
47
  "Photo": "",
48
48
  "Photos and Videos": "Fotos e Vídeos",
49
- "Pin to Conversation": "",
50
- "Pinned by": "Fixado por",
49
+ "Pin to Conversation": "Fixar na Conversa",
50
+ "Pinned by": "",
51
51
  "Please enable access to your photos and videos so you can share them.": "Por favor, habilite o acesso às suas fotos e vídeos para poder compartilhá-los.",
52
52
  "Please select a channel first": "",
53
53
  "Reconnecting...": "",
54
- "Reply": "",
54
+ "Reply": "Responder",
55
55
  "Reply to Message": "Responder à Mensagem",
56
- "Resend": "",
56
+ "Resend": "Reenviar",
57
57
  "Search GIFs": "Pesquisar GIFs",
58
58
  "Select More Photos": "Selecionar Mais Fotos",
59
59
  "Send Anyway": "",
60
60
  "Send a message": "Enviar uma mensagem",
61
61
  "Sending links is not allowed in this conversation": "",
62
62
  "Slow mode ON": "Modo Lento ATIVADO",
63
- "The message has been reported to a moderator.": "",
64
- "Thread Reply": "",
65
- "Unblock User": "",
63
+ "The message has been reported to a moderator.": "A mensagem foi relatada a um moderador.",
64
+ "Thread Reply": "Respostas de Tópico",
65
+ "Unblock User": "Desbloquear Usuário",
66
66
  "Unknown User": "Usuário Desconhecido",
67
- "Unmute User": "",
68
- "Unpin from Conversation": "",
69
- "Unread Messages": "Mensagens não lidas",
67
+ "Unmute User": "Remover usuário do modo silencioso",
68
+ "Unpin from Conversation": "Desmarcar como fixado na conversa",
69
+ "Unread Messages": "",
70
70
  "Video": "",
71
71
  "You": "",
72
- "You can't send messages in this channel": "Você não pode enviar mensagens neste canal",
73
- "{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} e mais {{ nonSelfUserLength }} pessoa(s) estão digitando",
72
+ "You can't send messages in this channel": "",
73
+ "{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "",
74
74
  "{{ index }} of {{ photoLength }}": "{{ index }} de {{ photoLength }}",
75
75
  "{{ replyCount }} Replies": "{{ replyCount }} Respostas",
76
76
  "{{ replyCount }} Thread Replies": "{{ replyCount }} Respostas de Thread",
77
- "{{ user }} is typing": "{{ user }} está digitando",
77
+ "{{ user }} is typing": "",
78
78
  "🏙 Attachment...": ""
79
79
  }
@@ -4,29 +4,29 @@
4
4
  "Allow access to your Gallery": "Разрешить доступ к вашей галерее",
5
5
  "Allow camera access in device settings": "Разрешите доступ к камере в настройках устройства.",
6
6
  "Also send to channel": "",
7
- "Are you sure you want to permanently delete this message?": "",
7
+ "Are you sure you want to permanently delete this message?": "Вы действительно хотите удалить это сообщение без возможности восстановления?",
8
8
  "Are you sure?": "",
9
- "Block User": "",
10
- "Cancel": "",
11
- "Cannot Flag Message": "",
9
+ "Block User": "Заблокировать пользователя",
10
+ "Cancel": "Отмена",
11
+ "Cannot Flag Message": "Невозможно пожаловаться на сообщение",
12
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": "",
13
+ "Copy Message": "Копировать сообщение",
14
+ "Delete": "удалять",
15
+ "Delete Message": "Удалить сообщение",
16
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": "Редактирование сообщения",
17
+ "Do you want to send a copy of this message to a moderator for further investigation?": "Вы хотите отправить копию этого сообщения модератору для дальнейшего изучения?",
18
+ "Edit Message": "Редактировать сообщение",
19
+ "Editing Message": "",
20
20
  "Emoji matching": "",
21
21
  "Empty message...": "",
22
- "Error loading": "Ошибка при загрузке",
22
+ "Error loading": "",
23
23
  "Error loading channel list...": "",
24
24
  "Error loading messages for this channel...": "",
25
25
  "Error while loading, please reload/refresh": "",
26
- "File type not supported": "",
27
- "Flag": "",
28
- "Flag Message": "",
29
- "Flag action failed either due to a network issue or the message is already flagged": "",
26
+ "File type not supported": "Тип файла не поддерживается",
27
+ "Flag": "Пометить",
28
+ "Flag Message": "Пометить сообщение",
29
+ "Flag action failed either due to a network issue or the message is already flagged": "Не удалось отправить жалобу. Возможные причины: проблема с подключением к интернету или ваша жалоба уже была принята.",
30
30
  "How about sending your first message to a friend?": "",
31
31
  "Instant Commands": "",
32
32
  "Let's start chatting!": "",
@@ -35,45 +35,45 @@
35
35
  "Loading messages...": "",
36
36
  "Loading...": "",
37
37
  "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "",
38
- "Message Reactions": "",
38
+ "Message Reactions": "Сообщения Реакции",
39
39
  "Message deleted": "",
40
- "Message flagged": "",
41
- "Mute User": "",
42
- "Not supported": "не поддерживается",
40
+ "Message flagged": "Сообщение отмечено",
41
+ "Mute User": "Отключить пользователя",
42
+ "Not supported": "",
43
43
  "Nothing yet...": "",
44
- "Ok": "",
45
- "Only visible to you": "Видно только вам",
44
+ "Ok": "",
45
+ "Only visible to you": "",
46
46
  "Open Settings": "Открыть настройки",
47
47
  "Photo": "",
48
48
  "Photos and Videos": "Фото и видео",
49
- "Pin to Conversation": "",
50
- "Pinned by": "Закреплено пользователем",
49
+ "Pin to Conversation": "Закрепить к беседе",
50
+ "Pinned by": "",
51
51
  "Please enable access to your photos and videos so you can share them.": "Разрешите доступ к своим фотографиям и видео, чтобы вы могли ими поделиться.",
52
52
  "Please select a channel first": "",
53
53
  "Reconnecting...": "",
54
- "Reply": "",
54
+ "Reply": "Ответить",
55
55
  "Reply to Message": "Ответить на сообщение",
56
- "Resend": "",
56
+ "Resend": "Отправить",
57
57
  "Search GIFs": "Поиск GIF",
58
58
  "Select More Photos": "Выбрать больше фотографий",
59
59
  "Send Anyway": "",
60
60
  "Send a message": "Отправить сообщение",
61
61
  "Sending links is not allowed in this conversation": "",
62
62
  "Slow mode ON": "Медленный режим включен",
63
- "The message has been reported to a moderator.": "",
64
- "Thread Reply": "",
65
- "Unblock User": "",
63
+ "The message has been reported to a moderator.": "Сообщение отправлено модератору.",
64
+ "Thread Reply": "Тема Ответить",
65
+ "Unblock User": "Разблокировать пользователя",
66
66
  "Unknown User": "Неизвестный пользователь",
67
- "Unmute User": "",
68
- "Unpin from Conversation": "",
69
- "Unread Messages": "Непрочитанные Сообщения",
67
+ "Unmute User": "Включить микрофон",
68
+ "Unpin from Conversation": "Открепить от беседы",
69
+ "Unread Messages": "",
70
70
  "Video": "",
71
71
  "You": "",
72
- "You can't send messages in this channel": "Вы не можете отправлять сообщения в этот канал",
73
- "{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} и еще {{ nonSelfUserLength }} пишут",
72
+ "You can't send messages in this channel": "",
73
+ "{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "",
74
74
  "{{ index }} of {{ photoLength }}": "{{ index }} из {{ photoLength }}",
75
75
  "{{ replyCount }} Replies": "{{ replyCount }} Ответов",
76
76
  "{{ replyCount }} Thread Replies": "{{replyCount}} Ответы в темах",
77
- "{{ user }} is typing": "{{ user }} пишет",
77
+ "{{ user }} is typing": "",
78
78
  "🏙 Attachment...": ""
79
79
  }
@@ -4,29 +4,29 @@
4
4
  "Allow access to your Gallery": "Galerinize erişime izin verin",
5
5
  "Allow camera access in device settings": "Cihaz ayarlarında kamera erişimine izin ver",
6
6
  "Also send to channel": "",
7
- "Are you sure you want to permanently delete this message?": "",
7
+ "Are you sure you want to permanently delete this message?": "Bu mesajı kalıcı olarak silmek istediğinizden emin misiniz?",
8
8
  "Are you sure?": "",
9
- "Block User": "",
10
- "Cancel": "",
11
- "Cannot Flag Message": "",
9
+ "Block User": "Kullanıcıyı engelle",
10
+ "Cancel": "İptal",
11
+ "Cannot Flag Message": "Raporlama Başarısız",
12
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": "",
13
+ "Copy Message": "Mesajı Kopyala",
14
+ "Delete": "Sil",
15
+ "Delete Message": "Mesajı Sil",
16
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?": "",
18
- "Edit Message": "",
19
- "Editing Message": "Mesaj Düzenleniyor",
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": "",
20
20
  "Emoji matching": "",
21
21
  "Empty message...": "",
22
- "Error loading": "Yükleme hatası",
22
+ "Error loading": "",
23
23
  "Error loading channel list...": "",
24
24
  "Error loading messages for this channel...": "",
25
25
  "Error while loading, please reload/refresh": "",
26
- "File type not supported": "",
27
- "Flag": "",
28
- "Flag Message": "",
29
- "Flag action failed either due to a network issue or the message is already flagged": "",
26
+ "File type not supported": "Dosya türü desteklenmiyor",
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
30
  "How about sending your first message to a friend?": "",
31
31
  "Instant Commands": "",
32
32
  "Let's start chatting!": "",
@@ -35,45 +35,45 @@
35
35
  "Loading messages...": "",
36
36
  "Loading...": "",
37
37
  "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "",
38
- "Message Reactions": "",
38
+ "Message Reactions": "Mesaj Tepkileri",
39
39
  "Message deleted": "",
40
- "Message flagged": "",
41
- "Mute User": "",
42
- "Not supported": "Desteklenmiyor",
40
+ "Message flagged": "Mesaj işaretlendi",
41
+ "Mute User": "Kullanıcıyı sessize al",
42
+ "Not supported": "",
43
43
  "Nothing yet...": "",
44
- "Ok": "",
45
- "Only visible to you": "Sadece siz görebilirsiniz",
44
+ "Ok": "Tamam",
45
+ "Only visible to you": "",
46
46
  "Open Settings": "Ayarları aç",
47
47
  "Photo": "",
48
48
  "Photos and Videos": "Fotoğraflar ve Videolar",
49
- "Pin to Conversation": "",
50
- "Pinned by": "Tarafından sabitlendi",
49
+ "Pin to Conversation": "Konuşmaya sabitle",
50
+ "Pinned by": "",
51
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": "",
53
53
  "Reconnecting...": "",
54
- "Reply": "",
54
+ "Reply": "Yanıtla",
55
55
  "Reply to Message": "Mesajı Yanıtla",
56
- "Resend": "",
56
+ "Resend": "Yeniden gönder",
57
57
  "Search GIFs": "GIF Ara",
58
58
  "Select More Photos": "Daha Fazla Fotoğraf Seçin",
59
59
  "Send Anyway": "",
60
60
  "Send a message": "Mesaj gönder",
61
61
  "Sending links is not allowed in this conversation": "",
62
62
  "Slow mode ON": "Yavaş Mod Açık",
63
- "The message has been reported to a moderator.": "",
64
- "Thread Reply": "",
65
- "Unblock User": "",
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
66
  "Unknown User": "Bilinmeyen kullanıcı",
67
- "Unmute User": "",
68
- "Unpin from Conversation": "",
69
- "Unread Messages": "Okunmamış Mesajlar",
67
+ "Unmute User": "Kullanıcının sesini aç",
68
+ "Unpin from Conversation": "Sabitlemeyi kaldır",
69
+ "Unread Messages": "",
70
70
  "Video": "",
71
71
  "You": "",
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",
72
+ "You can't send messages in this channel": "",
73
+ "{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "",
74
74
  "{{ index }} of {{ photoLength }}": "{{ index }} / {{ photoLength }}",
75
75
  "{{ replyCount }} Replies": "{{ replyCount }} Cevap",
76
76
  "{{ replyCount }} Thread Replies": "{{responseCount}} Konu Cevapı",
77
- "{{ user }} is typing": "{{ user }} yazıyor",
77
+ "{{ user }} is typing": "",
78
78
  "🏙 Attachment...": ""
79
79
  }
@@ -1 +1 @@
1
- {"version":3,"names":["DEFAULT_GLOBAL_STREAM_CONFIG","resizableCDNHosts","StreamChatRN","_classCallCheck2","_createClass2","key","value","setConfig","config","_extends2","exports"],"sources":["StreamChatRN.ts"],"sourcesContent":["type StreamConfig = {\n resizableCDNHosts: string[];\n};\nconst DEFAULT_GLOBAL_STREAM_CONFIG = {\n resizableCDNHosts: ['.stream-io-cdn.com'],\n};\n\n/**\n * StreamChatRN - Global config for the RN Chat SDK\n * This config is used to enable/disable features and options for the SDK.\n */\nexport class StreamChatRN {\n /**\n * Global config for StreamChatRN.\n */\n static config: StreamConfig = DEFAULT_GLOBAL_STREAM_CONFIG;\n /**\n * Set global config for StreamChatRN allows you to set wished CDN hosts for resizing images.\n * This function accepts an config object that will be merged with the default config.\n * @example StreamChatRN.setConfig({ resizableCDNHosts: ['my-custom-cdn.com', 'my-other-cdn.com'] });\n */\n static setConfig(config: Partial<StreamConfig>) {\n this.config = { ...this.config, ...config };\n }\n}\n"],"mappings":";;;;;;;;AAGA,IAAMA,4BAA4B,GAAG;EACnCC,iBAAiB,EAAE,CAAC,oBAAoB;AAC1C,CAAC;AAAC,IAMWC,YAAY;EAAA,SAAAA,aAAA;IAAA,IAAAC,gBAAA,mBAAAD,YAAA;EAAA;EAAA,IAAAE,aAAA,aAAAF,YAAA;IAAAG,GAAA;IAAAC,KAAA,EAUvB,SAAAC,UAAiBC,MAA6B,EAAE;MAC9C,IAAI,CAACA,MAAM,OAAAC,SAAA,iBAAQ,IAAI,CAACD,MAAM,EAAKA,MAAM,CAAE;IAC7C;EAAC;EAAA,OAAAN,YAAA;AAAA;AAAAQ,OAAA,CAAAR,YAAA,GAAAA,YAAA;AAZUA,YAAY,CAIhBM,MAAM,GAAiBR,4BAA4B"}
1
+ {"version":3,"names":["DEFAULT_GLOBAL_STREAM_CONFIG","resizableCDNHosts","StreamChatRN","_classCallCheck2","_createClass2","key","value","setConfig","config","_extends2","exports"],"sources":["StreamChatRN.ts"],"sourcesContent":["type StreamConfig = {\n resizableCDNHosts: string[];\n};\nconst DEFAULT_GLOBAL_STREAM_CONFIG = {\n resizableCDNHosts: ['.stream-io-cdn.com'],\n};\n\n/**\n * StreamChatRN - Global config for the RN Chat SDK\n * This config is used to enable/disable features and options for the SDK.\n *\n * @deprecated Use the `resizableCDNHosts` prop in the `Chat` component, instead. StreamChatRN will not be exposed starting the next major release.\n */\nexport class StreamChatRN {\n /**\n * Global config for StreamChatRN.\n */\n static config: StreamConfig = DEFAULT_GLOBAL_STREAM_CONFIG;\n /**\n * Set global config for StreamChatRN allows you to set wished CDN hosts for resizing images.\n * This function accepts an config object that will be merged with the default config.\n * @example StreamChatRN.setConfig({ resizableCDNHosts: ['my-custom-cdn.com', 'my-other-cdn.com'] });\n */\n static setConfig(config: Partial<StreamConfig>) {\n this.config = { ...this.config, ...config };\n }\n}\n"],"mappings":";;;;;;;;AAGA,IAAMA,4BAA4B,GAAG;EACnCC,iBAAiB,EAAE,CAAC,oBAAoB;AAC1C,CAAC;AAAC,IAQWC,YAAY;EAAA,SAAAA,aAAA;IAAA,IAAAC,gBAAA,mBAAAD,YAAA;EAAA;EAAA,IAAAE,aAAA,aAAAF,YAAA;IAAAG,GAAA;IAAAC,KAAA,EAUvB,SAAAC,UAAiBC,MAA6B,EAAE;MAC9C,IAAI,CAACA,MAAM,OAAAC,SAAA,iBAAQ,IAAI,CAACD,MAAM,EAAKA,MAAM,CAAE;IAC7C;EAAC;EAAA,OAAAN,YAAA;AAAA;AAAAQ,OAAA,CAAAR,YAAA,GAAAA,YAAA;AAZUA,YAAY,CAIhBM,MAAM,GAAiBR,4BAA4B"}
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "5.26.1-beta.2"
2
+ "version": "5.26.1-beta.3"
3
3
  }
@@ -24,6 +24,7 @@ var _init = _interopRequireDefault(require("../../init"));
24
24
  var _native = require("../../native");
25
25
  var _QuickSqliteClient = require("../../store/QuickSqliteClient");
26
26
  var _DBSyncManager = require("../../utils/DBSyncManager");
27
+ var _StreamChatRN = require("../../utils/StreamChatRN");
27
28
  var _version = require("../../version.json");
28
29
  var _this = this,
29
30
  _jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/Chat/Chat.tsx";
@@ -41,6 +42,8 @@ var ChatWithContext = function ChatWithContext(props) {
41
42
  i18nInstance = props.i18nInstance,
42
43
  _props$ImageComponent = props.ImageComponent,
43
44
  ImageComponent = _props$ImageComponent === void 0 ? _reactNative.Image : _props$ImageComponent,
45
+ _props$resizableCDNHo = props.resizableCDNHosts,
46
+ resizableCDNHosts = _props$resizableCDNHo === void 0 ? ['.stream-io-cdn.com'] : _props$resizableCDNHo,
44
47
  style = props.style;
45
48
  var _useState = (0, _react.useState)(),
46
49
  _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
@@ -57,6 +60,9 @@ var ChatWithContext = function ChatWithContext(props) {
57
60
  var mutedUsers = (0, _useMutedUsers.useMutedUsers)(client);
58
61
  var debugRef = (0, _DebugContext.useDebugContext)();
59
62
  var isDebugModeEnabled = __DEV__ && debugRef && debugRef.current;
63
+ _StreamChatRN.StreamChatRN.setConfig({
64
+ resizableCDNHosts: resizableCDNHosts
65
+ });
60
66
  (0, _react.useEffect)(function () {
61
67
  if (client) {
62
68
  client.setUserAgent(_native.SDK + "-" + _reactNative.Platform.OS + "-" + _version.version);
@@ -93,6 +99,7 @@ var ChatWithContext = function ChatWithContext(props) {
93
99
  ImageComponent: ImageComponent,
94
100
  isOnline: isOnline,
95
101
  mutedUsers: mutedUsers,
102
+ resizableCDNHosts: resizableCDNHosts,
96
103
  setActiveChannel: setActiveChannel
97
104
  });
98
105
  (0, _useSyncDatabase.useSyncDatabase)({
@@ -108,7 +115,7 @@ var ChatWithContext = function ChatWithContext(props) {
108
115
  __self: _this,
109
116
  __source: {
110
117
  fileName: _jsxFileName,
111
- lineNumber: 226,
118
+ lineNumber: 232,
112
119
  columnNumber: 5
113
120
  }
114
121
  }, _react["default"].createElement(_TranslationContext.TranslationProvider, {
@@ -118,7 +125,7 @@ var ChatWithContext = function ChatWithContext(props) {
118
125
  __self: _this,
119
126
  __source: {
120
127
  fileName: _jsxFileName,
121
- lineNumber: 227,
128
+ lineNumber: 233,
122
129
  columnNumber: 7
123
130
  }
124
131
  }, _react["default"].createElement(_ThemeContext.ThemeProvider, {
@@ -126,14 +133,14 @@ var ChatWithContext = function ChatWithContext(props) {
126
133
  __self: _this,
127
134
  __source: {
128
135
  fileName: _jsxFileName,
129
- lineNumber: 230,
136
+ lineNumber: 236,
130
137
  columnNumber: 9
131
138
  }
132
139
  }, _react["default"].createElement(_ChannelsStateContext.ChannelsStateProvider, {
133
140
  __self: _this,
134
141
  __source: {
135
142
  fileName: _jsxFileName,
136
- lineNumber: 231,
143
+ lineNumber: 237,
137
144
  columnNumber: 11
138
145
  }
139
146
  }, children))));
@@ -147,7 +154,7 @@ var Chat = function Chat(props) {
147
154
  __self: _this,
148
155
  __source: {
149
156
  fileName: _jsxFileName,
150
- lineNumber: 266,
157
+ lineNumber: 272,
151
158
  columnNumber: 10
152
159
  }
153
160
  }));
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_useAppSettings","_useCreateChatContext","_useIsOnline2","_useMutedUsers","_useSyncDatabase","_ChannelsStateContext","_ChatContext","_DebugContext","_OverlayContext","_ThemeContext","_TranslationContext","_useStreami18n","_init","_interopRequireDefault","_native","_QuickSqliteClient","_DBSyncManager","_version","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","init","ChatWithContext","props","_client$user2","_client$user3","children","client","_props$closeConnectio","closeConnectionOnBackground","_props$enableOfflineS","enableOfflineSupport","i18nInstance","_props$ImageComponent","ImageComponent","Image","style","_useState","useState","_useState2","_slicedToArray2","channel","setChannel","translators","useStreami18n","_useIsOnline","useIsOnline","connectionRecovering","isOnline","_useState3","_useState4","initialisedDatabase","setInitialisedDatabase","mutedUsers","useMutedUsers","debugRef","useDebugContext","isDebugModeEnabled","__DEV__","current","useEffect","setUserAgent","SDK","Platform","OS","version","recoverStateOnReconnect","persistUserOnConnectionFailure","setEventType","setSendEventParams","action","data","user","setActiveChannel","newChannel","_client$user","id","QuickSqliteClient","initializeDatabase","DBSyncManager","appSettings","useAppSettings","chatContext","useCreateChatContext","useSyncDatabase","createElement","ChatProvider","value","__self","__source","fileName","lineNumber","columnNumber","TranslationProvider","_extends2","userLanguage","language","DEFAULT_USER_LANGUAGE","ThemeProvider","ChannelsStateProvider","Chat","_useOverlayContext","useOverlayContext","exports"],"sources":["Chat.tsx"],"sourcesContent":["import React, { PropsWithChildren, useEffect, useState } from 'react';\nimport { Image, Platform } from 'react-native';\n\nimport type { Channel, StreamChat } from 'stream-chat';\n\nimport { useAppSettings } from './hooks/useAppSettings';\nimport { useCreateChatContext } from './hooks/useCreateChatContext';\nimport { useIsOnline } from './hooks/useIsOnline';\nimport { useMutedUsers } from './hooks/useMutedUsers';\n\nimport { useSyncDatabase } from './hooks/useSyncDatabase';\n\nimport { ChannelsStateProvider } from '../../contexts/channelsStateContext/ChannelsStateContext';\nimport { ChatContextValue, ChatProvider } from '../../contexts/chatContext/ChatContext';\nimport { useDebugContext } from '../../contexts/debugContext/DebugContext';\nimport { useOverlayContext } from '../../contexts/overlayContext/OverlayContext';\nimport { DeepPartial, ThemeProvider } from '../../contexts/themeContext/ThemeContext';\nimport type { Theme } from '../../contexts/themeContext/utils/theme';\nimport {\n DEFAULT_USER_LANGUAGE,\n TranslationProvider,\n} from '../../contexts/translationContext/TranslationContext';\nimport { useStreami18n } from '../../hooks/useStreami18n';\nimport init from '../../init';\n\nimport { SDK } from '../../native';\nimport { QuickSqliteClient } from '../../store/QuickSqliteClient';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { DBSyncManager } from '../../utils/DBSyncManager';\nimport type { Streami18n } from '../../utils/Streami18n';\nimport { version } from '../../version.json';\n\ninit();\n\nexport type ChatProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<ChatContextValue<StreamChatGenerics>, 'client'> &\n Partial<Pick<ChatContextValue<StreamChatGenerics>, 'ImageComponent'>> & {\n /**\n * When false, ws connection won't be disconnection upon backgrounding the app.\n * To receive push notifications, its necessary that user doesn't have active\n * websocket connection. So by default, we disconnect websocket connection when\n * app goes to background, and reconnect when app comes to foreground.\n */\n closeConnectionOnBackground?: boolean;\n /**\n * Enables offline storage and loading for chat data.\n */\n enableOfflineSupport?: boolean;\n /**\n * Instance of Streami18n class should be provided to Chat component to enable internationalization.\n *\n * Stream provides following list of in-built translations:\n * 1. English (en)\n * 2. Dutch (nl)\n * 3. ...\n * 4. ...\n *\n * Simplest way to start using chat components in one of the in-built languages would be following:\n *\n * ```\n * const i18n = new Streami18n('nl');\n * <Chat client={chatClient} i18nInstance={i18n}>\n * ...\n * </Chat>\n * ```\n *\n * If you would like to override certain keys in in-built translation.\n * UI will be automatically updated in this case.\n *\n * ```\n * const i18n = new Streami18n('nl');\n *\n * i18n.registerTranslation('nl', {\n * 'Nothing yet...': 'Nog Niet ...',\n * '{{ firstUser }} and {{ secondUser }} are typing...': '{{ firstUser }} en {{ secondUser }} zijn aan het typen...',\n * });\n *\n * <Chat client={chatClient} i18nInstance={i18n}>\n * ...\n * </Chat>\n * ```\n *\n * You can use the same function to add whole new language.\n *\n * ```\n * const i18n = new Streami18n('it');\n *\n * i18n.registerTranslation('it', {\n * 'Nothing yet...': 'Non ancora ...',\n * '{{ firstUser }} and {{ secondUser }} are typing...': '{{ firstUser }} a {{ secondUser }} stanno scrivendo...',\n * });\n *\n * // Make sure to call setLanguage to reflect new language in UI.\n * i18n.setLanguage('it');\n * <Chat client={chatClient} i18nInstance={i18n}>\n * ...\n * </Chat>\n * ```\n */\n i18nInstance?: Streami18n;\n /**\n * You can pass the theme object to customize the styles of Chat components. You can check the default theme in [theme.ts](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/contexts/themeContext/utils/theme.ts)\n *\n * Please check section about [themes in cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#theme) for details.\n *\n * ```\n * import type { DeepPartial, Theme } from 'stream-chat-react-native';\n *\n * const theme: DeepPartial<Theme> = {\n * messageSimple: {\n * file: {\n * container: {\n * backgroundColor: 'red',\n * },\n * icon: {\n * height: 16,\n * width: 16,\n * },\n * },\n * },\n * };\n *\n * <Chat style={theme}>\n * </Chat>\n * ```\n *\n * @overrideType object\n */\n style?: DeepPartial<Theme>;\n };\n\nconst ChatWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: PropsWithChildren<ChatProps<StreamChatGenerics>>,\n) => {\n const {\n children,\n client,\n closeConnectionOnBackground = true,\n enableOfflineSupport = false,\n i18nInstance,\n ImageComponent = Image,\n style,\n } = props;\n\n const [channel, setChannel] = useState<Channel<StreamChatGenerics>>();\n\n // Setup translators\n const translators = useStreami18n(i18nInstance);\n\n /**\n * Setup connection event listeners\n */\n const { connectionRecovering, isOnline } = useIsOnline<StreamChatGenerics>(\n client,\n closeConnectionOnBackground,\n );\n\n const [initialisedDatabase, setInitialisedDatabase] = useState(false);\n\n /**\n * Setup muted user listener\n * TODO: reimplement\n */\n const mutedUsers = useMutedUsers<StreamChatGenerics>(client);\n\n const debugRef = useDebugContext();\n const isDebugModeEnabled = __DEV__ && debugRef && debugRef.current;\n\n useEffect(() => {\n if (client) {\n client.setUserAgent(`${SDK}-${Platform.OS}-${version}`);\n // This is to disable recovery related logic in js client, since we handle it in this SDK\n client.recoverStateOnReconnect = false;\n client.persistUserOnConnectionFailure = enableOfflineSupport;\n }\n\n if (isDebugModeEnabled) {\n if (debugRef.current.setEventType) debugRef.current.setEventType('send');\n if (debugRef.current.setSendEventParams)\n debugRef.current.setSendEventParams({\n action: 'Client',\n data: client.user,\n });\n }\n }, [client, enableOfflineSupport]);\n\n const setActiveChannel = (newChannel?: Channel<StreamChatGenerics>) => setChannel(newChannel);\n\n useEffect(() => {\n if (client.user?.id && enableOfflineSupport) {\n setInitialisedDatabase(false);\n QuickSqliteClient.initializeDatabase();\n DBSyncManager.init(client as unknown as StreamChat);\n setInitialisedDatabase(true);\n }\n }, [client?.user?.id, enableOfflineSupport]);\n\n const appSettings = useAppSettings(client, isOnline, enableOfflineSupport, initialisedDatabase);\n\n const chatContext = useCreateChatContext({\n appSettings,\n channel,\n client,\n connectionRecovering,\n enableOfflineSupport,\n ImageComponent,\n isOnline,\n mutedUsers,\n setActiveChannel,\n });\n\n useSyncDatabase({\n client,\n enableOfflineSupport,\n initialisedDatabase,\n });\n\n if (enableOfflineSupport && !initialisedDatabase) {\n return null;\n }\n\n return (\n <ChatProvider<StreamChatGenerics> value={chatContext}>\n <TranslationProvider\n value={{ ...translators, userLanguage: client.user?.language || DEFAULT_USER_LANGUAGE }}\n >\n <ThemeProvider style={style}>\n <ChannelsStateProvider<StreamChatGenerics>>{children}</ChannelsStateProvider>\n </ThemeProvider>\n </TranslationProvider>\n </ChatProvider>\n );\n};\n\n/**\n * Chat - Wrapper component for Chat. The needs to be placed around any other chat components.\n * This Chat component provides the ChatContext to all other components.\n *\n * The ChatContext provides the following props:\n *\n * - channel - currently active channel\n * - client - client connection\n * - connectionRecovering - whether or not websocket is reconnecting\n * - isOnline - whether or not set user is active\n * - setActiveChannel - function to set the currently active channel\n *\n * The Chat Component takes the following generics in order:\n * - At (AttachmentType) - custom Attachment object extension\n * - Ct (ChannelType) - custom Channel object extension\n * - Co (CommandType) - custom Command string union extension\n * - Ev (EventType) - custom Event object extension\n * - Me (MessageType) - custom Message object extension\n * - Re (ReactionType) - custom Reaction object extension\n * - Us (UserType) - custom User object extension\n */\nexport const Chat = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: PropsWithChildren<ChatProps<StreamChatGenerics>>,\n) => {\n const { style } = useOverlayContext();\n\n return <ChatWithContext {...{ style }} {...props} />;\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AAEA,IAAAM,gBAAA,GAAAN,OAAA;AAEA,IAAAO,qBAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AACA,IAAAU,eAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAX,OAAA;AAEA,IAAAY,mBAAA,GAAAZ,OAAA;AAIA,IAAAa,cAAA,GAAAb,OAAA;AACA,IAAAc,KAAA,GAAAC,sBAAA,CAAAf,OAAA;AAEA,IAAAgB,OAAA,GAAAhB,OAAA;AACA,IAAAiB,kBAAA,GAAAjB,OAAA;AAEA,IAAAkB,c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QAAA,EAAA5F,YAAA;MAAA6F,UAAA;MAAAC,YAAA;IAAA;EAAA,GAC1BrH,MAAA,YAAA8G,aAAA,CAACrG,qBAAA,CAAAmH,qBAAqB;IAAAX,MAAA,EAAA3F,KAAA;IAAA4F,QAAA;MAAAC,QAAA,EAAA5F,YAAA;MAAA6F,UAAA;MAAAC,YAAA;IAAA;EAAA,GAAsBlE,QAAgC,CAC/D,CACI,CACT,CAAC;AAEnB,CAAC;AAuBM,IAAM0E,IAAI,GAAG,SAAPA,IAAIA,CAGf7E,KAAuD,EACpD;EACH,IAAA8E,kBAAA,GAAkB,IAAAC,iCAAiB,EAAC,CAAC;IAA7BlE,KAAK,GAAAiE,kBAAA,CAALjE,KAAK;EAEb,OAAO7D,MAAA,YAAA8G,aAAA,CAAC/D,eAAe,MAAAwE,SAAA;IAAO1D,KAAK,EAALA;EAAK,GAAQb,KAAK;IAAAiE,MAAA,EAAA3F,KAAA;IAAA4F,QAAA;MAAAC,QAAA,EAAA5F,YAAA;MAAA6F,UAAA;MAAAC,YAAA;IAAA;EAAA,EAAG,CAAC;AACtD,CAAC;AAACW,OAAA,CAAAH,IAAA,GAAAA,IAAA"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_useAppSettings","_useCreateChatContext","_useIsOnline2","_useMutedUsers","_useSyncDatabase","_ChannelsStateContext","_ChatContext","_DebugContext","_OverlayContext","_ThemeContext","_TranslationContext","_useStreami18n","_init","_interopRequireDefault","_native","_QuickSqliteClient","_DBSyncManager","_StreamChatRN","_version","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","init","ChatWithContext","props","_client$user2","_client$user3","children","client","_props$closeConnectio","closeConnectionOnBackground","_props$enableOfflineS","enableOfflineSupport","i18nInstance","_props$ImageComponent","ImageComponent","Image","_props$resizableCDNHo","resizableCDNHosts","style","_useState","useState","_useState2","_slicedToArray2","channel","setChannel","translators","useStreami18n","_useIsOnline","useIsOnline","connectionRecovering","isOnline","_useState3","_useState4","initialisedDatabase","setInitialisedDatabase","mutedUsers","useMutedUsers","debugRef","useDebugContext","isDebugModeEnabled","__DEV__","current","StreamChatRN","setConfig","useEffect","setUserAgent","SDK","Platform","OS","version","recoverStateOnReconnect","persistUserOnConnectionFailure","setEventType","setSendEventParams","action","data","user","setActiveChannel","newChannel","_client$user","id","QuickSqliteClient","initializeDatabase","DBSyncManager","appSettings","useAppSettings","chatContext","useCreateChatContext","useSyncDatabase","createElement","ChatProvider","value","__self","__source","fileName","lineNumber","columnNumber","TranslationProvider","_extends2","userLanguage","language","DEFAULT_USER_LANGUAGE","ThemeProvider","ChannelsStateProvider","Chat","_useOverlayContext","useOverlayContext","exports"],"sources":["Chat.tsx"],"sourcesContent":["import React, { PropsWithChildren, useEffect, useState } from 'react';\nimport { Image, Platform } from 'react-native';\n\nimport type { Channel, StreamChat } from 'stream-chat';\n\nimport { useAppSettings } from './hooks/useAppSettings';\nimport { useCreateChatContext } from './hooks/useCreateChatContext';\nimport { useIsOnline } from './hooks/useIsOnline';\nimport { useMutedUsers } from './hooks/useMutedUsers';\n\nimport { useSyncDatabase } from './hooks/useSyncDatabase';\n\nimport { ChannelsStateProvider } from '../../contexts/channelsStateContext/ChannelsStateContext';\nimport { ChatContextValue, ChatProvider } from '../../contexts/chatContext/ChatContext';\nimport { useDebugContext } from '../../contexts/debugContext/DebugContext';\nimport { useOverlayContext } from '../../contexts/overlayContext/OverlayContext';\nimport { DeepPartial, ThemeProvider } from '../../contexts/themeContext/ThemeContext';\nimport type { Theme } from '../../contexts/themeContext/utils/theme';\nimport {\n DEFAULT_USER_LANGUAGE,\n TranslationProvider,\n} from '../../contexts/translationContext/TranslationContext';\nimport { useStreami18n } from '../../hooks/useStreami18n';\nimport init from '../../init';\n\nimport { SDK } from '../../native';\nimport { QuickSqliteClient } from '../../store/QuickSqliteClient';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { DBSyncManager } from '../../utils/DBSyncManager';\nimport { StreamChatRN } from '../../utils/StreamChatRN';\nimport type { Streami18n } from '../../utils/Streami18n';\nimport { version } from '../../version.json';\n\ninit();\n\nexport type ChatProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<ChatContextValue<StreamChatGenerics>, 'client'> &\n Partial<Pick<ChatContextValue<StreamChatGenerics>, 'ImageComponent' | 'resizableCDNHosts'>> & {\n /**\n * When false, ws connection won't be disconnection upon backgrounding the app.\n * To receive push notifications, its necessary that user doesn't have active\n * websocket connection. So by default, we disconnect websocket connection when\n * app goes to background, and reconnect when app comes to foreground.\n */\n closeConnectionOnBackground?: boolean;\n /**\n * Enables offline storage and loading for chat data.\n */\n enableOfflineSupport?: boolean;\n /**\n * Instance of Streami18n class should be provided to Chat component to enable internationalization.\n *\n * Stream provides following list of in-built translations:\n * 1. English (en)\n * 2. Dutch (nl)\n * 3. ...\n * 4. ...\n *\n * Simplest way to start using chat components in one of the in-built languages would be following:\n *\n * ```\n * const i18n = new Streami18n('nl');\n * <Chat client={chatClient} i18nInstance={i18n}>\n * ...\n * </Chat>\n * ```\n *\n * If you would like to override certain keys in in-built translation.\n * UI will be automatically updated in this case.\n *\n * ```\n * const i18n = new Streami18n('nl');\n *\n * i18n.registerTranslation('nl', {\n * 'Nothing yet...': 'Nog Niet ...',\n * '{{ firstUser }} and {{ secondUser }} are typing...': '{{ firstUser }} en {{ secondUser }} zijn aan het typen...',\n * });\n *\n * <Chat client={chatClient} i18nInstance={i18n}>\n * ...\n * </Chat>\n * ```\n *\n * You can use the same function to add whole new language.\n *\n * ```\n * const i18n = new Streami18n('it');\n *\n * i18n.registerTranslation('it', {\n * 'Nothing yet...': 'Non ancora ...',\n * '{{ firstUser }} and {{ secondUser }} are typing...': '{{ firstUser }} a {{ secondUser }} stanno scrivendo...',\n * });\n *\n * // Make sure to call setLanguage to reflect new language in UI.\n * i18n.setLanguage('it');\n * <Chat client={chatClient} i18nInstance={i18n}>\n * ...\n * </Chat>\n * ```\n */\n i18nInstance?: Streami18n;\n /**\n * You can pass the theme object to customize the styles of Chat components. You can check the default theme in [theme.ts](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/contexts/themeContext/utils/theme.ts)\n *\n * Please check section about [themes in cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#theme) for details.\n *\n * ```\n * import type { DeepPartial, Theme } from 'stream-chat-react-native';\n *\n * const theme: DeepPartial<Theme> = {\n * messageSimple: {\n * file: {\n * container: {\n * backgroundColor: 'red',\n * },\n * icon: {\n * height: 16,\n * width: 16,\n * },\n * },\n * },\n * };\n *\n * <Chat style={theme}>\n * </Chat>\n * ```\n *\n * @overrideType object\n */\n style?: DeepPartial<Theme>;\n };\n\nconst ChatWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: PropsWithChildren<ChatProps<StreamChatGenerics>>,\n) => {\n const {\n children,\n client,\n closeConnectionOnBackground = true,\n enableOfflineSupport = false,\n i18nInstance,\n ImageComponent = Image,\n resizableCDNHosts = ['.stream-io-cdn.com'],\n style,\n } = props;\n\n const [channel, setChannel] = useState<Channel<StreamChatGenerics>>();\n\n // Setup translators\n const translators = useStreami18n(i18nInstance);\n\n /**\n * Setup connection event listeners\n */\n const { connectionRecovering, isOnline } = useIsOnline<StreamChatGenerics>(\n client,\n closeConnectionOnBackground,\n );\n\n const [initialisedDatabase, setInitialisedDatabase] = useState(false);\n\n /**\n * Setup muted user listener\n * TODO: reimplement\n */\n const mutedUsers = useMutedUsers<StreamChatGenerics>(client);\n\n const debugRef = useDebugContext();\n const isDebugModeEnabled = __DEV__ && debugRef && debugRef.current;\n\n // Set the `resizableCDNHosts` as per the prop.\n StreamChatRN.setConfig({ resizableCDNHosts });\n\n useEffect(() => {\n if (client) {\n client.setUserAgent(`${SDK}-${Platform.OS}-${version}`);\n // This is to disable recovery related logic in js client, since we handle it in this SDK\n client.recoverStateOnReconnect = false;\n client.persistUserOnConnectionFailure = enableOfflineSupport;\n }\n\n if (isDebugModeEnabled) {\n if (debugRef.current.setEventType) debugRef.current.setEventType('send');\n if (debugRef.current.setSendEventParams)\n debugRef.current.setSendEventParams({\n action: 'Client',\n data: client.user,\n });\n }\n }, [client, enableOfflineSupport]);\n\n const setActiveChannel = (newChannel?: Channel<StreamChatGenerics>) => setChannel(newChannel);\n\n useEffect(() => {\n if (client.user?.id && enableOfflineSupport) {\n setInitialisedDatabase(false);\n QuickSqliteClient.initializeDatabase();\n DBSyncManager.init(client as unknown as StreamChat);\n setInitialisedDatabase(true);\n }\n }, [client?.user?.id, enableOfflineSupport]);\n\n const appSettings = useAppSettings(client, isOnline, enableOfflineSupport, initialisedDatabase);\n\n const chatContext = useCreateChatContext({\n appSettings,\n channel,\n client,\n connectionRecovering,\n enableOfflineSupport,\n ImageComponent,\n isOnline,\n mutedUsers,\n resizableCDNHosts,\n setActiveChannel,\n });\n\n useSyncDatabase({\n client,\n enableOfflineSupport,\n initialisedDatabase,\n });\n\n if (enableOfflineSupport && !initialisedDatabase) {\n return null;\n }\n\n return (\n <ChatProvider<StreamChatGenerics> value={chatContext}>\n <TranslationProvider\n value={{ ...translators, userLanguage: client.user?.language || DEFAULT_USER_LANGUAGE }}\n >\n <ThemeProvider style={style}>\n <ChannelsStateProvider<StreamChatGenerics>>{children}</ChannelsStateProvider>\n </ThemeProvider>\n </TranslationProvider>\n </ChatProvider>\n );\n};\n\n/**\n * Chat - Wrapper component for Chat. The needs to be placed around any other chat components.\n * This Chat component provides the ChatContext to all other components.\n *\n * The ChatContext provides the following props:\n *\n * - channel - currently active channel\n * - client - client connection\n * - connectionRecovering - whether or not websocket is reconnecting\n * - isOnline - whether or not set user is active\n * - setActiveChannel - function to set the currently active channel\n *\n * The Chat Component takes the following generics in order:\n * - At (AttachmentType) - custom Attachment object extension\n * - Ct (ChannelType) - custom Channel object extension\n * - Co (CommandType) - custom Command string union extension\n * - Ev (EventType) - custom Event object extension\n * - Me (MessageType) - custom Message object extension\n * - Re (ReactionType) - custom Reaction object extension\n * - Us (UserType) - custom User object extension\n */\nexport const Chat = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: PropsWithChildren<ChatProps<StreamChatGenerics>>,\n) => {\n const { style } = useOverlayContext();\n\n return <ChatWithContext {...{ style }} {...props} />;\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AAEA,IAAAM,gBAAA,GAAAN,OAAA;AAEA,IAAAO,qBAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AACA,IAAAU,eAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAX,OAAA;AAEA,IAAAY,mBAAA,GAAAZ,OAAA;AAIA,IAAAa,cAAA,GAAAb,OAAA;AACA,IAAAc,KAAA,GAAAC,sBAAA,CAAAf,OAAA;AAEA,IAAAgB,OAAA,GAAAhB,OAAA;AACA,IAAAiB,kBAAA,GAAAjB,OAAA;AAEA,IAAAkB,cAAA,GAAAlB,OAAA;AACA,IAAAmB,aAAA,GAAAnB,OAAA;AAEA,IAAAoB,QAAA,GAAApB,OAAA;AAA6C,IAAAqB,KAAA;EAAAC,YAAA;AAAA,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,K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MAAAC,YAAA;IAAA;EAAA,GAC1B1H,MAAA,YAAAmH,aAAA,CAAC1G,qBAAA,CAAAwH,qBAAqB;IAAAX,MAAA,EAAA/F,KAAA;IAAAgG,QAAA;MAAAC,QAAA,EAAAhG,YAAA;MAAAiG,UAAA;MAAAC,YAAA;IAAA;EAAA,GAAsBtE,QAAgC,CAC/D,CACI,CACT,CAAC;AAEnB,CAAC;AAuBM,IAAM8E,IAAI,GAAG,SAAPA,IAAIA,CAGfjF,KAAuD,EACpD;EACH,IAAAkF,kBAAA,GAAkB,IAAAC,iCAAiB,EAAC,CAAC;IAA7BpE,KAAK,GAAAmE,kBAAA,CAALnE,KAAK;EAEb,OAAOhE,MAAA,YAAAmH,aAAA,CAACnE,eAAe,MAAA4E,SAAA;IAAO5D,KAAK,EAALA;EAAK,GAAQf,KAAK;IAAAqE,MAAA,EAAA/F,KAAA;IAAAgG,QAAA;MAAAC,QAAA,EAAAhG,YAAA;MAAAiG,UAAA;MAAAC,YAAA;IAAA;EAAA,EAAG,CAAC;AACtD,CAAC;AAACW,OAAA,CAAAH,IAAA,GAAAA,IAAA"}
@@ -12,6 +12,7 @@ var useCreateChatContext = function useCreateChatContext(_ref) {
12
12
  ImageComponent = _ref.ImageComponent,
13
13
  isOnline = _ref.isOnline,
14
14
  mutedUsers = _ref.mutedUsers,
15
+ resizableCDNHosts = _ref.resizableCDNHosts,
15
16
  setActiveChannel = _ref.setActiveChannel;
16
17
  var channelId = channel == null ? void 0 : channel.id;
17
18
  var clientValues = client ? "" + client.clientID + Object.keys(client.activeChannels).length + Object.keys(client.listeners).length + client.mutedChannels.length : 'Offline';
@@ -26,6 +27,7 @@ var useCreateChatContext = function useCreateChatContext(_ref) {
26
27
  ImageComponent: ImageComponent,
27
28
  isOnline: isOnline,
28
29
  mutedUsers: mutedUsers,
30
+ resizableCDNHosts: resizableCDNHosts,
29
31
  setActiveChannel: setActiveChannel
30
32
  };
31
33
  }, [channelId, clientValues, connectionRecovering, isOnline, mutedUsersLength]);
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","useCreateChatContext","_ref","appSettings","channel","client","connectionRecovering","enableOfflineSupport","ImageComponent","isOnline","mutedUsers","setActiveChannel","channelId","id","clientValues","clientID","Object","keys","activeChannels","length","listeners","mutedChannels","mutedUsersLength","chatContext","useMemo","exports"],"sources":["useCreateChatContext.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport type { ChatContextValue } from '../../../contexts/chatContext/ChatContext';\nimport type { DefaultStreamChatGenerics } from '../../../types/types';\n\nexport const useCreateChatContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n appSettings,\n channel,\n client,\n connectionRecovering,\n enableOfflineSupport,\n ImageComponent,\n isOnline,\n mutedUsers,\n setActiveChannel,\n}: ChatContextValue<StreamChatGenerics>) => {\n const channelId = channel?.id;\n const clientValues = client\n ? `${client.clientID}${Object.keys(client.activeChannels).length}${\n Object.keys(client.listeners).length\n }${client.mutedChannels.length}`\n : 'Offline';\n const mutedUsersLength = mutedUsers.length;\n\n const chatContext: ChatContextValue<StreamChatGenerics> = useMemo(\n () => ({\n appSettings,\n channel,\n client,\n connectionRecovering,\n enableOfflineSupport,\n ImageComponent,\n isOnline,\n mutedUsers,\n setActiveChannel,\n }),\n [channelId, clientValues, connectionRecovering, isOnline, mutedUsersLength],\n );\n\n return chatContext;\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAKO,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAAC,IAAA,EAYW;EAAA,IAT1CC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IACXC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IACPC,MAAM,GAAAH,IAAA,CAANG,MAAM;IACNC,oBAAoB,GAAAJ,IAAA,CAApBI,oBAAoB;IACpBC,oBAAoB,GAAAL,IAAA,CAApBK,oBAAoB;IACpBC,cAAc,GAAAN,IAAA,CAAdM,cAAc;IACdC,QAAQ,GAAAP,IAAA,CAARO,QAAQ;IACRC,UAAU,GAAAR,IAAA,CAAVQ,UAAU;IACVC,gBAAgB,GAAAT,IAAA,CAAhBS,gBAAgB;EAEhB,IAAMC,SAAS,GAAGR,OAAO,oBAAPA,OAAO,CAAES,EAAE;EAC7B,IAAMC,YAAY,GAAGT,MAAM,QACpBA,MAAM,CAACU,QAAQ,GAAGC,MAAM,CAACC,IAAI,CAACZ,MAAM,CAACa,cAAc,CAAC,CAACC,MAAM,GAC5DH,MAAM,CAACC,IAAI,CAACZ,MAAM,CAACe,SAAS,CAAC,CAACD,MAAM,GACnCd,MAAM,CAACgB,aAAa,CAACF,MAAM,GAC9B,SAAS;EACb,IAAMG,gBAAgB,GAAGZ,UAAU,CAACS,MAAM;EAE1C,IAAMI,WAAiD,GAAG,IAAAC,cAAO,EAC/D;IAAA,OAAO;MACLrB,WAAW,EAAXA,WAAW;MACXC,OAAO,EAAPA,OAAO;MACPC,MAAM,EAANA,MAAM;MACNC,oBAAoB,EAApBA,oBAAoB;MACpBC,oBAAoB,EAApBA,oBAAoB;MACpBC,cAAc,EAAdA,cAAc;MACdC,QAAQ,EAARA,QAAQ;MACRC,UAAU,EAAVA,UAAU;MACVC,gBAAgB,EAAhBA;IACF,CAAC;EAAA,CAAC,EACF,CAACC,SAAS,EAAEE,YAAY,EAAER,oBAAoB,EAAEG,QAAQ,EAAEa,gBAAgB,CAC5E,CAAC;EAED,OAAOC,WAAW;AACpB,CAAC;AAACE,OAAA,CAAAxB,oBAAA,GAAAA,oBAAA"}
1
+ {"version":3,"names":["_react","require","useCreateChatContext","_ref","appSettings","channel","client","connectionRecovering","enableOfflineSupport","ImageComponent","isOnline","mutedUsers","resizableCDNHosts","setActiveChannel","channelId","id","clientValues","clientID","Object","keys","activeChannels","length","listeners","mutedChannels","mutedUsersLength","chatContext","useMemo","exports"],"sources":["useCreateChatContext.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport type { ChatContextValue } from '../../../contexts/chatContext/ChatContext';\nimport type { DefaultStreamChatGenerics } from '../../../types/types';\n\nexport const useCreateChatContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n appSettings,\n channel,\n client,\n connectionRecovering,\n enableOfflineSupport,\n ImageComponent,\n isOnline,\n mutedUsers,\n resizableCDNHosts,\n setActiveChannel,\n}: ChatContextValue<StreamChatGenerics>) => {\n const channelId = channel?.id;\n const clientValues = client\n ? `${client.clientID}${Object.keys(client.activeChannels).length}${\n Object.keys(client.listeners).length\n }${client.mutedChannels.length}`\n : 'Offline';\n const mutedUsersLength = mutedUsers.length;\n\n const chatContext: ChatContextValue<StreamChatGenerics> = useMemo(\n () => ({\n appSettings,\n channel,\n client,\n connectionRecovering,\n enableOfflineSupport,\n ImageComponent,\n isOnline,\n mutedUsers,\n resizableCDNHosts,\n setActiveChannel,\n }),\n [channelId, clientValues, connectionRecovering, isOnline, mutedUsersLength],\n );\n\n return chatContext;\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAKO,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAAC,IAAA,EAaW;EAAA,IAV1CC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IACXC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IACPC,MAAM,GAAAH,IAAA,CAANG,MAAM;IACNC,oBAAoB,GAAAJ,IAAA,CAApBI,oBAAoB;IACpBC,oBAAoB,GAAAL,IAAA,CAApBK,oBAAoB;IACpBC,cAAc,GAAAN,IAAA,CAAdM,cAAc;IACdC,QAAQ,GAAAP,IAAA,CAARO,QAAQ;IACRC,UAAU,GAAAR,IAAA,CAAVQ,UAAU;IACVC,iBAAiB,GAAAT,IAAA,CAAjBS,iBAAiB;IACjBC,gBAAgB,GAAAV,IAAA,CAAhBU,gBAAgB;EAEhB,IAAMC,SAAS,GAAGT,OAAO,oBAAPA,OAAO,CAAEU,EAAE;EAC7B,IAAMC,YAAY,GAAGV,MAAM,QACpBA,MAAM,CAACW,QAAQ,GAAGC,MAAM,CAACC,IAAI,CAACb,MAAM,CAACc,cAAc,CAAC,CAACC,MAAM,GAC5DH,MAAM,CAACC,IAAI,CAACb,MAAM,CAACgB,SAAS,CAAC,CAACD,MAAM,GACnCf,MAAM,CAACiB,aAAa,CAACF,MAAM,GAC9B,SAAS;EACb,IAAMG,gBAAgB,GAAGb,UAAU,CAACU,MAAM;EAE1C,IAAMI,WAAiD,GAAG,IAAAC,cAAO,EAC/D;IAAA,OAAO;MACLtB,WAAW,EAAXA,WAAW;MACXC,OAAO,EAAPA,OAAO;MACPC,MAAM,EAANA,MAAM;MACNC,oBAAoB,EAApBA,oBAAoB;MACpBC,oBAAoB,EAApBA,oBAAoB;MACpBC,cAAc,EAAdA,cAAc;MACdC,QAAQ,EAARA,QAAQ;MACRC,UAAU,EAAVA,UAAU;MACVC,iBAAiB,EAAjBA,iBAAiB;MACjBC,gBAAgB,EAAhBA;IACF,CAAC;EAAA,CAAC,EACF,CAACC,SAAS,EAAEE,YAAY,EAAET,oBAAoB,EAAEG,QAAQ,EAAEc,gBAAgB,CAC5E,CAAC;EAED,OAAOC,WAAW;AACpB,CAAC;AAACE,OAAA,CAAAzB,oBAAA,GAAAA,oBAAA"}
@@ -23,7 +23,7 @@ var ChatProvider = function ChatProvider(_ref) {
23
23
  __self: _this,
24
24
  __source: {
25
25
  fileName: _jsxFileName,
26
- lineNumber: 80,
26
+ lineNumber: 84,
27
27
  columnNumber: 3
28
28
  }
29
29
  }, children);
@@ -44,7 +44,7 @@ var withChatContext = function withChatContext(Component) {
44
44
  __self: _this,
45
45
  __source: {
46
46
  fileName: _jsxFileName,
47
- lineNumber: 113,
47
+ lineNumber: 117,
48
48
  columnNumber: 12
49
49
  }
50
50
  }));
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_defaultBaseContextValue","_getDisplayName","_isTestEnvironment","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ChatContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","exports","ChatProvider","_ref","children","value","createElement","Provider","__self","__source","fileName","lineNumber","columnNumber","useChatContext","contextValue","useContext","isTestEnvironment","Error","withChatContext","Component","WithChatContextComponent","props","chatContext","_extends2","displayName","getDisplayName"],"sources":["ChatContext.tsx"],"sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\nimport type { ImageProps } from 'react-native';\n\nimport type { AppSettingsAPIResponse, Channel, Mute, StreamChat } from 'stream-chat';\n\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';\n\nimport { getDisplayName } from '../utils/getDisplayName';\nimport { isTestEnvironment } from '../utils/isTestEnvironment';\n\nexport type ChatContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /**\n * Object of application settings returned from Stream.\n * */\n appSettings: AppSettingsAPIResponse<StreamChatGenerics> | null;\n /**\n * The StreamChat client object\n *\n * ```\n * import { StreamChat } from 'stream-chat';\n * import { Chat } from 'stream-chat-react-native';\n *\n * const client = StreamChat.getInstance('api_key);\n * await client.connectUser('user_id', 'userToken');\n *\n * <Chat client={client}>\n * </Chat>\n * ```\n *\n * @overrideType StreamChat\n * */\n client: StreamChat<StreamChatGenerics>;\n connectionRecovering: boolean;\n enableOfflineSupport: boolean;\n /**\n * Drop in replacement of all the underlying Image components within SDK. This is useful for the purpose of offline caching of images. Please check the Offline Support Guide for usage.\n */\n ImageComponent: React.ComponentType<ImageProps>;\n isOnline: boolean | null;\n mutedUsers: Mute<StreamChatGenerics>[];\n /**\n * @param newChannel Channel to set as active.\n *\n * @overrideType Function\n */\n setActiveChannel: (newChannel?: Channel<StreamChatGenerics>) => void;\n /**\n * Instance of channel object from stream-chat package.\n *\n * Please check the docs around how to create or query channel - https://getstream.io/chat/docs/javascript/creating_channels/?language=javascript\n *\n * ```\n * import { StreamChat, Channel } from 'stream-chat';\n * import { Chat, Channel} from 'stream-chat-react-native';\n *\n * const client = StreamChat.getInstance('api_key');\n * await client.connectUser('user_id', 'user_token');\n * const channel = client.channel('messaging', 'channel_id');\n * await channel.watch();\n * ```\n *\n * @overrideType Channel\n */\n channel?: Channel<StreamChatGenerics>;\n};\n\nexport const ChatContext = React.createContext(DEFAULT_BASE_CONTEXT_VALUE as ChatContextValue);\n\nexport const ChatProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value?: ChatContextValue<StreamChatGenerics>;\n}>) => (\n <ChatContext.Provider value={value as unknown as ChatContextValue}>\n {children}\n </ChatContext.Provider>\n);\n\nexport const useChatContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => {\n const contextValue = useContext(ChatContext) as unknown as ChatContextValue<StreamChatGenerics>;\n\n if (contextValue === DEFAULT_BASE_CONTEXT_VALUE && !isTestEnvironment()) {\n throw new Error(\n `The useChatContext hook was called outside the ChatContext Provider. Make sure you have configured Chat component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#chat`,\n );\n }\n\n return contextValue;\n};\n\n/**\n * Typescript currently does not support partial inference so if ChatContext\n * typing is desired while using the HOC withChatContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withChatContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof ChatContextValue<StreamChatGenerics>>> => {\n const WithChatContextComponent = (props: Omit<P, keyof ChatContextValue<StreamChatGenerics>>) => {\n const chatContext = useChatContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...chatContext} />;\n };\n WithChatContextCom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AAA,EAAApC,YAAA;QAAAqC,UAAA;QAAAC,YAAA;MAAA;IAAA,EAAG,CAAC;EACzD,CAAC;EACDQ,wBAAwB,CAACI,WAAW,uBAAqB,IAAAC,8BAAc,EAACN,SAAS,CAAG;EACpF,OAAOC,wBAAwB;AACjC,CAAC;AAACnB,OAAA,CAAAiB,eAAA,GAAAA,eAAA"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_defaultBaseContextValue","_getDisplayName","_isTestEnvironment","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ChatContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","exports","ChatProvider","_ref","children","value","createElement","Provider","__self","__source","fileName","lineNumber","columnNumber","useChatContext","contextValue","useContext","isTestEnvironment","Error","withChatContext","Component","WithChatContextComponent","props","chatContext","_extends2","displayName","getDisplayName"],"sources":["ChatContext.tsx"],"sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\nimport type { ImageProps } from 'react-native';\n\nimport type { AppSettingsAPIResponse, Channel, Mute, StreamChat } from 'stream-chat';\n\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';\n\nimport { getDisplayName } from '../utils/getDisplayName';\nimport { isTestEnvironment } from '../utils/isTestEnvironment';\n\nexport type ChatContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /**\n * Object of application settings returned from Stream.\n * */\n appSettings: AppSettingsAPIResponse<StreamChatGenerics> | null;\n /**\n * The StreamChat client object\n *\n * ```\n * import { StreamChat } from 'stream-chat';\n * import { Chat } from 'stream-chat-react-native';\n *\n * const client = StreamChat.getInstance('api_key);\n * await client.connectUser('user_id', 'userToken');\n *\n * <Chat client={client}>\n * </Chat>\n * ```\n *\n * @overrideType StreamChat\n * */\n client: StreamChat<StreamChatGenerics>;\n connectionRecovering: boolean;\n enableOfflineSupport: boolean;\n /**\n * Drop in replacement of all the underlying Image components within SDK. This is useful for the purpose of offline caching of images. Please check the Offline Support Guide for usage.\n */\n ImageComponent: React.ComponentType<ImageProps>;\n isOnline: boolean | null;\n mutedUsers: Mute<StreamChatGenerics>[];\n /**\n * @param newChannel Channel to set as active.\n *\n * @overrideType Function\n */\n setActiveChannel: (newChannel?: Channel<StreamChatGenerics>) => void;\n /**\n * Instance of channel object from stream-chat package.\n *\n * Please check the docs around how to create or query channel - https://getstream.io/chat/docs/javascript/creating_channels/?language=javascript\n *\n * ```\n * import { StreamChat, Channel } from 'stream-chat';\n * import { Chat, Channel} from 'stream-chat-react-native';\n *\n * const client = StreamChat.getInstance('api_key');\n * await client.connectUser('user_id', 'user_token');\n * const channel = client.channel('messaging', 'channel_id');\n * await channel.watch();\n * ```\n *\n * @overrideType Channel\n */\n channel?: Channel<StreamChatGenerics>;\n /**\n * This option allows you to specify a list of CDNs that offer image resizing.\n */\n resizableCDNHosts?: string[];\n};\n\nexport const ChatContext = React.createContext(DEFAULT_BASE_CONTEXT_VALUE as ChatContextValue);\n\nexport const ChatProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value?: ChatContextValue<StreamChatGenerics>;\n}>) => (\n <ChatContext.Provider value={value as unknown as ChatContextValue}>\n {children}\n </ChatContext.Provider>\n);\n\nexport const useChatContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => {\n const contextValue = useContext(ChatContext) as unknown as ChatContextValue<StreamChatGenerics>;\n\n if (contextValue === DEFAULT_BASE_CONTEXT_VALUE && !isTestEnvironment()) {\n throw new Error(\n `The useChatContext hook was called outside the ChatContext Provider. Make sure you have configured Chat component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#chat`,\n );\n }\n\n return contextValue;\n};\n\n/**\n * Typescript currently does not support partial inference so if ChatContext\n * typing is desired while using the HOC withChatContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withChatContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof ChatContextValue<StreamChatGenerics>>> => {\n const WithChatContextComponent = (props: Omit<P, keyof ChatContextValue<StreamChatGenerics>>) => {\n const chatContext = useChatContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...chatContext} />;\n };\n WithChatContextComponent.displayName = `WithChatContext${getDisplayName(Component)}`;\n return WithChatContextComponent;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAMA,IAAAC,wBAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AAA+D,IAAAI,KAAA;EAAAC,YAAA;AAAA,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAR,wBAAAY,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,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