@ethora/chat-component-rn 26.7.9 → 26.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (652) hide show
  1. package/CHANGELOG.md +0 -93
  2. package/README.md +10 -33
  3. package/lib/commonjs/assets/icons.js +2 -7
  4. package/lib/commonjs/assets/icons.js.map +1 -1
  5. package/lib/commonjs/components/AuthForms/Login.js +4 -4
  6. package/lib/commonjs/components/AuthForms/Login.js.map +1 -1
  7. package/lib/commonjs/components/Header/HeaderRoomList.js +7 -26
  8. package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
  9. package/lib/commonjs/components/MainComponents/ChatHeader.js +3 -9
  10. package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
  11. package/lib/commonjs/components/MainComponents/ChatRoom.js +13 -101
  12. package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
  13. package/lib/commonjs/components/MainComponents/ChatWrapper.js +38 -34
  14. package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
  15. package/lib/commonjs/components/MainComponents/LoginWrapper.js +1 -2
  16. package/lib/commonjs/components/MainComponents/LoginWrapper.js.map +1 -1
  17. package/lib/commonjs/components/MainComponents/MediaMessage.js +9 -29
  18. package/lib/commonjs/components/MainComponents/MediaMessage.js.map +1 -1
  19. package/lib/commonjs/components/MainComponents/MessageContainer.js +1 -5
  20. package/lib/commonjs/components/MainComponents/MessageContainer.js.map +1 -1
  21. package/lib/commonjs/components/MainComponents/MessageList.js +5 -13
  22. package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
  23. package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js +13 -14
  24. package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
  25. package/lib/commonjs/components/MainComponents/ReduxWrapper.js +24 -3
  26. package/lib/commonjs/components/MainComponents/ReduxWrapper.js.map +1 -1
  27. package/lib/commonjs/components/MainComponents/RoomList.js +35 -208
  28. package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
  29. package/lib/commonjs/components/Menu/HeaderRoomListMenu.js +98 -317
  30. package/lib/commonjs/components/Menu/HeaderRoomListMenu.js.map +1 -1
  31. package/lib/commonjs/components/MessageBubble/MessageTranslate.js +16 -7
  32. package/lib/commonjs/components/MessageBubble/MessageTranslate.js.map +1 -1
  33. package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js +112 -320
  34. package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
  35. package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +215 -556
  36. package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
  37. package/lib/commonjs/components/Modals/ChatProfileModal/DeleteChatModal.js +9 -7
  38. package/lib/commonjs/components/Modals/ChatProfileModal/DeleteChatModal.js.map +1 -1
  39. package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +27 -69
  40. package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
  41. package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js +1 -2
  42. package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
  43. package/lib/commonjs/components/Modals/Modal/Modal.js +0 -8
  44. package/lib/commonjs/components/Modals/Modal/Modal.js.map +1 -1
  45. package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js +1 -2
  46. package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js.map +1 -1
  47. package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js +109 -205
  48. package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
  49. package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js +0 -8
  50. package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
  51. package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js +2 -4
  52. package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
  53. package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js +21 -7
  54. package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
  55. package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +244 -507
  56. package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
  57. package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +46 -74
  58. package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
  59. package/lib/commonjs/components/Modals/styledModalComponents.js +2 -9
  60. package/lib/commonjs/components/Modals/styledModalComponents.js.map +1 -1
  61. package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +39 -23
  62. package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
  63. package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js +3 -22
  64. package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
  65. package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js +3 -17
  66. package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
  67. package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js +3 -17
  68. package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
  69. package/lib/commonjs/components/VideoCalls/VideoCallSession.js +3 -6
  70. package/lib/commonjs/components/VideoCalls/VideoCallSession.js.map +1 -1
  71. package/lib/commonjs/components/styled/AudioMessage.js +1 -2
  72. package/lib/commonjs/components/styled/AudioMessage.js.map +1 -1
  73. package/lib/commonjs/components/styled/DateLabel.js +10 -3
  74. package/lib/commonjs/components/styled/DateLabel.js.map +1 -1
  75. package/lib/commonjs/components/styled/MessageImage.js +9 -37
  76. package/lib/commonjs/components/styled/MessageImage.js.map +1 -1
  77. package/lib/commonjs/components/styled/NewMessageLabel.js +3 -1
  78. package/lib/commonjs/components/styled/NewMessageLabel.js.map +1 -1
  79. package/lib/commonjs/components/styled/SendInput.js +17 -86
  80. package/lib/commonjs/components/styled/SendInput.js.map +1 -1
  81. package/lib/commonjs/components/styled/StyledComponents.js +3 -9
  82. package/lib/commonjs/components/styled/StyledComponents.js.map +1 -1
  83. package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js +4 -11
  84. package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
  85. package/lib/commonjs/components/styled/UnsupportedType.js +4 -14
  86. package/lib/commonjs/components/styled/UnsupportedType.js.map +1 -1
  87. package/lib/commonjs/components/styled/VideoMessage.js +61 -119
  88. package/lib/commonjs/components/styled/VideoMessage.js.map +1 -1
  89. package/lib/commonjs/context/xmppProvider.js +54 -128
  90. package/lib/commonjs/context/xmppProvider.js.map +1 -1
  91. package/lib/commonjs/helpers/createMessageFromXml.js +1 -19
  92. package/lib/commonjs/helpers/createMessageFromXml.js.map +1 -1
  93. package/lib/commonjs/helpers/ensureScopedChatCache.js +2 -2
  94. package/lib/commonjs/helpers/ensureScopedChatCache.js.map +1 -1
  95. package/lib/commonjs/helpers/getDataFromXml.js +24 -1
  96. package/lib/commonjs/helpers/getDataFromXml.js.map +1 -1
  97. package/lib/commonjs/helpers/historyPreloadScheduler.js +2 -65
  98. package/lib/commonjs/helpers/historyPreloadScheduler.js.map +1 -1
  99. package/lib/commonjs/helpers/initXmppRooms.js +8 -14
  100. package/lib/commonjs/helpers/initXmppRooms.js.map +1 -1
  101. package/lib/commonjs/helpers/insertMessageWithDelimiter.js +13 -0
  102. package/lib/commonjs/helpers/insertMessageWithDelimiter.js.map +1 -1
  103. package/lib/commonjs/helpers/isUnresolvedSenderId.js +6 -1
  104. package/lib/commonjs/helpers/isUnresolvedSenderId.js.map +1 -1
  105. package/lib/commonjs/helpers/mimeToExtension.js +14 -6
  106. package/lib/commonjs/helpers/mimeToExtension.js.map +1 -1
  107. package/lib/commonjs/helpers/resolveInitBeforeLoadUser.js +17 -130
  108. package/lib/commonjs/helpers/resolveInitBeforeLoadUser.js.map +1 -1
  109. package/lib/commonjs/helpers/resolveLangSource.js +38 -0
  110. package/lib/commonjs/helpers/resolveLangSource.js.map +1 -0
  111. package/lib/commonjs/helpers/xmppUsername.js +39 -0
  112. package/lib/commonjs/helpers/xmppUsername.js.map +1 -0
  113. package/lib/commonjs/hooks/useChatRoomFocus.js +8 -17
  114. package/lib/commonjs/hooks/useChatRoomFocus.js.map +1 -1
  115. package/lib/commonjs/hooks/useChatWrapperInit.js +14 -32
  116. package/lib/commonjs/hooks/useChatWrapperInit.js.map +1 -1
  117. package/lib/commonjs/hooks/useComposing.js +0 -27
  118. package/lib/commonjs/hooks/useComposing.js.map +1 -1
  119. package/lib/commonjs/hooks/useLogout.js +7 -15
  120. package/lib/commonjs/hooks/useLogout.js.map +1 -1
  121. package/lib/commonjs/hooks/usePendingNotification.js +11 -8
  122. package/lib/commonjs/hooks/usePendingNotification.js.map +1 -1
  123. package/lib/commonjs/hooks/useSendMessage.js +14 -50
  124. package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
  125. package/lib/commonjs/hooks/useUnreadMessagesCounter.js +1 -6
  126. package/lib/commonjs/hooks/useUnreadMessagesCounter.js.map +1 -1
  127. package/lib/commonjs/i18n/strings.js +133 -121
  128. package/lib/commonjs/i18n/strings.js.map +1 -1
  129. package/lib/commonjs/i18n/useT.js +1 -1
  130. package/lib/commonjs/main.js +0 -44
  131. package/lib/commonjs/main.js.map +1 -1
  132. package/lib/commonjs/networking/api-requests/auth.api.js +60 -134
  133. package/lib/commonjs/networking/api-requests/auth.api.js.map +1 -1
  134. package/lib/commonjs/networking/api-requests/roomMembers.api.js +1 -1
  135. package/lib/commonjs/networking/api-requests/roomMembers.api.js.map +1 -1
  136. package/lib/commonjs/networking/api-requests/rooms.api.js +9 -9
  137. package/lib/commonjs/networking/api-requests/rooms.api.js.map +1 -1
  138. package/lib/commonjs/networking/api-requests/user.api.js +9 -68
  139. package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
  140. package/lib/commonjs/networking/apiClient.js +112 -62
  141. package/lib/commonjs/networking/apiClient.js.map +1 -1
  142. package/lib/commonjs/networking/stanzaHandlers.js +51 -93
  143. package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
  144. package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js +8 -46
  145. package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
  146. package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js +1 -8
  147. package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
  148. package/lib/commonjs/networking/xmpp/subscribeToRoomMessages.xmpp.js +1 -5
  149. package/lib/commonjs/networking/xmpp/subscribeToRoomMessages.xmpp.js.map +1 -1
  150. package/lib/commonjs/networking/xmppClient.js +8 -124
  151. package/lib/commonjs/networking/xmppClient.js.map +1 -1
  152. package/lib/commonjs/roomStore/chatSettingsSlice.js +7 -26
  153. package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
  154. package/lib/commonjs/roomStore/index.js +2 -35
  155. package/lib/commonjs/roomStore/index.js.map +1 -1
  156. package/lib/commonjs/roomStore/persistence.js +39 -226
  157. package/lib/commonjs/roomStore/persistence.js.map +1 -1
  158. package/lib/commonjs/roomStore/roomsSlice.js +8 -87
  159. package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
  160. package/lib/commonjs/services/pushSubscriptionService.js +13 -15
  161. package/lib/commonjs/services/pushSubscriptionService.js.map +1 -1
  162. package/lib/commonjs/version.js +3 -1
  163. package/lib/commonjs/version.js.map +1 -1
  164. package/lib/module/assets/icons.js +1 -6
  165. package/lib/module/assets/icons.js.map +1 -1
  166. package/lib/module/components/AuthForms/Login.js +4 -4
  167. package/lib/module/components/AuthForms/Login.js.map +1 -1
  168. package/lib/module/components/Header/HeaderRoomList.js +7 -26
  169. package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
  170. package/lib/module/components/MainComponents/ChatHeader.js +3 -9
  171. package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
  172. package/lib/module/components/MainComponents/ChatRoom.js +14 -102
  173. package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
  174. package/lib/module/components/MainComponents/ChatWrapper.js +40 -36
  175. package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
  176. package/lib/module/components/MainComponents/LoginWrapper.js +1 -2
  177. package/lib/module/components/MainComponents/LoginWrapper.js.map +1 -1
  178. package/lib/module/components/MainComponents/MediaMessage.js +10 -30
  179. package/lib/module/components/MainComponents/MediaMessage.js.map +1 -1
  180. package/lib/module/components/MainComponents/MessageContainer.js +1 -5
  181. package/lib/module/components/MainComponents/MessageContainer.js.map +1 -1
  182. package/lib/module/components/MainComponents/MessageList.js +5 -13
  183. package/lib/module/components/MainComponents/MessageList.js.map +1 -1
  184. package/lib/module/components/MainComponents/ProfileImagePlaceholder.js +13 -14
  185. package/lib/module/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
  186. package/lib/module/components/MainComponents/ReduxWrapper.js +26 -5
  187. package/lib/module/components/MainComponents/ReduxWrapper.js.map +1 -1
  188. package/lib/module/components/MainComponents/RoomList.js +35 -207
  189. package/lib/module/components/MainComponents/RoomList.js.map +1 -1
  190. package/lib/module/components/Menu/HeaderRoomListMenu.js +101 -319
  191. package/lib/module/components/Menu/HeaderRoomListMenu.js.map +1 -1
  192. package/lib/module/components/MessageBubble/MessageTranslate.js +16 -7
  193. package/lib/module/components/MessageBubble/MessageTranslate.js.map +1 -1
  194. package/lib/module/components/Modals/AttachSheet/AttachSheet.js +115 -311
  195. package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
  196. package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +219 -559
  197. package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
  198. package/lib/module/components/Modals/ChatProfileModal/DeleteChatModal.js +9 -7
  199. package/lib/module/components/Modals/ChatProfileModal/DeleteChatModal.js.map +1 -1
  200. package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +28 -70
  201. package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
  202. package/lib/module/components/Modals/FilePreviewModal/PdfView.js +1 -2
  203. package/lib/module/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
  204. package/lib/module/components/Modals/Modal/Modal.js +1 -9
  205. package/lib/module/components/Modals/Modal/Modal.js.map +1 -1
  206. package/lib/module/components/Modals/NewChatModal/ModalContent.js +1 -2
  207. package/lib/module/components/Modals/NewChatModal/ModalContent.js.map +1 -1
  208. package/lib/module/components/Modals/NewChatModal/NewChatModal.js +111 -208
  209. package/lib/module/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
  210. package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js +0 -8
  211. package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
  212. package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js +2 -4
  213. package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
  214. package/lib/module/components/Modals/UserProfileModal/EditUserModal.js +23 -9
  215. package/lib/module/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
  216. package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +248 -509
  217. package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
  218. package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +48 -76
  219. package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
  220. package/lib/module/components/Modals/styledModalComponents.js +2 -9
  221. package/lib/module/components/Modals/styledModalComponents.js.map +1 -1
  222. package/lib/module/components/RoomComponents/ChatRoomItem.js +40 -24
  223. package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
  224. package/lib/module/components/RoomComponents/styled/LastMessageFile.js +3 -22
  225. package/lib/module/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
  226. package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js +3 -17
  227. package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
  228. package/lib/module/components/RoomComponents/styled/LastMessageVideo.js +3 -17
  229. package/lib/module/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
  230. package/lib/module/components/VideoCalls/VideoCallSession.js +3 -6
  231. package/lib/module/components/VideoCalls/VideoCallSession.js.map +1 -1
  232. package/lib/module/components/styled/AudioMessage.js +1 -2
  233. package/lib/module/components/styled/AudioMessage.js.map +1 -1
  234. package/lib/module/components/styled/DateLabel.js +10 -3
  235. package/lib/module/components/styled/DateLabel.js.map +1 -1
  236. package/lib/module/components/styled/MessageImage.js +9 -37
  237. package/lib/module/components/styled/MessageImage.js.map +1 -1
  238. package/lib/module/components/styled/NewMessageLabel.js +3 -1
  239. package/lib/module/components/styled/NewMessageLabel.js.map +1 -1
  240. package/lib/module/components/styled/SendInput.js +18 -87
  241. package/lib/module/components/styled/SendInput.js.map +1 -1
  242. package/lib/module/components/styled/StyledComponents.js +3 -9
  243. package/lib/module/components/styled/StyledComponents.js.map +1 -1
  244. package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js +4 -11
  245. package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
  246. package/lib/module/components/styled/UnsupportedType.js +4 -14
  247. package/lib/module/components/styled/UnsupportedType.js.map +1 -1
  248. package/lib/module/components/styled/VideoMessage.js +62 -120
  249. package/lib/module/components/styled/VideoMessage.js.map +1 -1
  250. package/lib/module/context/xmppProvider.js +55 -128
  251. package/lib/module/context/xmppProvider.js.map +1 -1
  252. package/lib/module/helpers/createMessageFromXml.js +1 -19
  253. package/lib/module/helpers/createMessageFromXml.js.map +1 -1
  254. package/lib/module/helpers/ensureScopedChatCache.js +2 -2
  255. package/lib/module/helpers/ensureScopedChatCache.js.map +1 -1
  256. package/lib/module/helpers/getDataFromXml.js +23 -1
  257. package/lib/module/helpers/getDataFromXml.js.map +1 -1
  258. package/lib/module/helpers/historyPreloadScheduler.js +3 -66
  259. package/lib/module/helpers/historyPreloadScheduler.js.map +1 -1
  260. package/lib/module/helpers/initXmppRooms.js +8 -14
  261. package/lib/module/helpers/initXmppRooms.js.map +1 -1
  262. package/lib/module/helpers/insertMessageWithDelimiter.js +13 -0
  263. package/lib/module/helpers/insertMessageWithDelimiter.js.map +1 -1
  264. package/lib/module/helpers/isUnresolvedSenderId.js +6 -1
  265. package/lib/module/helpers/isUnresolvedSenderId.js.map +1 -1
  266. package/lib/module/helpers/mimeToExtension.js +13 -6
  267. package/lib/module/helpers/mimeToExtension.js.map +1 -1
  268. package/lib/module/helpers/resolveInitBeforeLoadUser.js +16 -130
  269. package/lib/module/helpers/resolveInitBeforeLoadUser.js.map +1 -1
  270. package/lib/module/helpers/resolveLangSource.js +32 -0
  271. package/lib/module/helpers/resolveLangSource.js.map +1 -0
  272. package/lib/module/helpers/xmppUsername.js +35 -0
  273. package/lib/module/helpers/xmppUsername.js.map +1 -0
  274. package/lib/module/hooks/useChatRoomFocus.js +8 -17
  275. package/lib/module/hooks/useChatRoomFocus.js.map +1 -1
  276. package/lib/module/hooks/useChatWrapperInit.js +14 -32
  277. package/lib/module/hooks/useChatWrapperInit.js.map +1 -1
  278. package/lib/module/hooks/useComposing.js +1 -28
  279. package/lib/module/hooks/useComposing.js.map +1 -1
  280. package/lib/module/hooks/useLogout.js +7 -15
  281. package/lib/module/hooks/useLogout.js.map +1 -1
  282. package/lib/module/hooks/usePendingNotification.js +11 -8
  283. package/lib/module/hooks/usePendingNotification.js.map +1 -1
  284. package/lib/module/hooks/useSendMessage.js +16 -52
  285. package/lib/module/hooks/useSendMessage.js.map +1 -1
  286. package/lib/module/hooks/useUnreadMessagesCounter.js +1 -6
  287. package/lib/module/hooks/useUnreadMessagesCounter.js.map +1 -1
  288. package/lib/module/i18n/strings.js +133 -121
  289. package/lib/module/i18n/strings.js.map +1 -1
  290. package/lib/module/i18n/useT.js +1 -1
  291. package/lib/module/main.js +2 -14
  292. package/lib/module/main.js.map +1 -1
  293. package/lib/module/networking/api-requests/auth.api.js +59 -131
  294. package/lib/module/networking/api-requests/auth.api.js.map +1 -1
  295. package/lib/module/networking/api-requests/roomMembers.api.js +1 -1
  296. package/lib/module/networking/api-requests/roomMembers.api.js.map +1 -1
  297. package/lib/module/networking/api-requests/rooms.api.js +9 -9
  298. package/lib/module/networking/api-requests/rooms.api.js.map +1 -1
  299. package/lib/module/networking/api-requests/user.api.js +7 -64
  300. package/lib/module/networking/api-requests/user.api.js.map +1 -1
  301. package/lib/module/networking/apiClient.js +113 -61
  302. package/lib/module/networking/apiClient.js.map +1 -1
  303. package/lib/module/networking/stanzaHandlers.js +52 -94
  304. package/lib/module/networking/stanzaHandlers.js.map +1 -1
  305. package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js +8 -46
  306. package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
  307. package/lib/module/networking/xmpp/presenceInRoom.xmpp.js +1 -8
  308. package/lib/module/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
  309. package/lib/module/networking/xmpp/subscribeToRoomMessages.xmpp.js +1 -5
  310. package/lib/module/networking/xmpp/subscribeToRoomMessages.xmpp.js.map +1 -1
  311. package/lib/module/networking/xmppClient.js +8 -124
  312. package/lib/module/networking/xmppClient.js.map +1 -1
  313. package/lib/module/roomStore/chatSettingsSlice.js +7 -26
  314. package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
  315. package/lib/module/roomStore/index.js +4 -37
  316. package/lib/module/roomStore/index.js.map +1 -1
  317. package/lib/module/roomStore/persistence.js +38 -223
  318. package/lib/module/roomStore/persistence.js.map +1 -1
  319. package/lib/module/roomStore/roomsSlice.js +7 -86
  320. package/lib/module/roomStore/roomsSlice.js.map +1 -1
  321. package/lib/module/services/pushSubscriptionService.js +13 -15
  322. package/lib/module/services/pushSubscriptionService.js.map +1 -1
  323. package/lib/module/version.js +3 -1
  324. package/lib/module/version.js.map +1 -1
  325. package/lib/typescript/assets/icons.d.ts +0 -16
  326. package/lib/typescript/assets/icons.d.ts.map +1 -1
  327. package/lib/typescript/components/AuthForms/Login.d.ts.map +1 -1
  328. package/lib/typescript/components/Header/HeaderRoomList.d.ts.map +1 -1
  329. package/lib/typescript/components/MainComponents/ChatHeader.d.ts.map +1 -1
  330. package/lib/typescript/components/MainComponents/ChatRoom.d.ts.map +1 -1
  331. package/lib/typescript/components/MainComponents/ChatWrapper.d.ts.map +1 -1
  332. package/lib/typescript/components/MainComponents/LoginWrapper.d.ts.map +1 -1
  333. package/lib/typescript/components/MainComponents/MediaMessage.d.ts.map +1 -1
  334. package/lib/typescript/components/MainComponents/MessageContainer.d.ts.map +1 -1
  335. package/lib/typescript/components/MainComponents/MessageList.d.ts +1 -10
  336. package/lib/typescript/components/MainComponents/MessageList.d.ts.map +1 -1
  337. package/lib/typescript/components/MainComponents/ProfileImagePlaceholder.d.ts.map +1 -1
  338. package/lib/typescript/components/MainComponents/ReduxWrapper.d.ts.map +1 -1
  339. package/lib/typescript/components/MainComponents/RoomList.d.ts +0 -7
  340. package/lib/typescript/components/MainComponents/RoomList.d.ts.map +1 -1
  341. package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts +0 -3
  342. package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts.map +1 -1
  343. package/lib/typescript/components/MessageBubble/MessageTranslate.d.ts.map +1 -1
  344. package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts +0 -9
  345. package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts.map +1 -1
  346. package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts +0 -10
  347. package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
  348. package/lib/typescript/components/Modals/ChatProfileModal/DeleteChatModal.d.ts.map +1 -1
  349. package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts.map +1 -1
  350. package/lib/typescript/components/Modals/FilePreviewModal/PdfView.d.ts.map +1 -1
  351. package/lib/typescript/components/Modals/Modal/Modal.d.ts.map +1 -1
  352. package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts +2 -4
  353. package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts.map +1 -1
  354. package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts +1 -1
  355. package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts.map +1 -1
  356. package/lib/typescript/components/Modals/NewChatModal/UpdNewChatModal.d.ts.map +1 -1
  357. package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts +1 -6
  358. package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts.map +1 -1
  359. package/lib/typescript/components/Modals/UserProfileModal/EditUserModal.d.ts.map +1 -1
  360. package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts +0 -16
  361. package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
  362. package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts +0 -1
  363. package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts.map +1 -1
  364. package/lib/typescript/components/Modals/styledModalComponents.d.ts.map +1 -1
  365. package/lib/typescript/components/RoomComponents/ChatRoomItem.d.ts.map +1 -1
  366. package/lib/typescript/components/RoomComponents/styled/LastMessageFile.d.ts +1 -1
  367. package/lib/typescript/components/RoomComponents/styled/LastMessageFile.d.ts.map +1 -1
  368. package/lib/typescript/components/RoomComponents/styled/LastMessagePhoto.d.ts +1 -1
  369. package/lib/typescript/components/RoomComponents/styled/LastMessagePhoto.d.ts.map +1 -1
  370. package/lib/typescript/components/RoomComponents/styled/LastMessageVideo.d.ts +1 -1
  371. package/lib/typescript/components/RoomComponents/styled/LastMessageVideo.d.ts.map +1 -1
  372. package/lib/typescript/components/VideoCalls/VideoCallSession.d.ts.map +1 -1
  373. package/lib/typescript/components/styled/AudioMessage.d.ts.map +1 -1
  374. package/lib/typescript/components/styled/DateLabel.d.ts.map +1 -1
  375. package/lib/typescript/components/styled/MessageImage.d.ts +0 -14
  376. package/lib/typescript/components/styled/MessageImage.d.ts.map +1 -1
  377. package/lib/typescript/components/styled/NewMessageLabel.d.ts.map +1 -1
  378. package/lib/typescript/components/styled/SendInput.d.ts.map +1 -1
  379. package/lib/typescript/components/styled/StyledComponents.d.ts.map +1 -1
  380. package/lib/typescript/components/styled/StyledInputComponents/StyledInputComponents.d.ts.map +1 -1
  381. package/lib/typescript/components/styled/UnsupportedType.d.ts.map +1 -1
  382. package/lib/typescript/components/styled/VideoMessage.d.ts +0 -8
  383. package/lib/typescript/components/styled/VideoMessage.d.ts.map +1 -1
  384. package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
  385. package/lib/typescript/helpers/createMessageFromXml.d.ts.map +1 -1
  386. package/lib/typescript/helpers/getDataFromXml.d.ts.map +1 -1
  387. package/lib/typescript/helpers/historyPreloadScheduler.d.ts.map +1 -1
  388. package/lib/typescript/helpers/initXmppRooms.d.ts.map +1 -1
  389. package/lib/typescript/helpers/insertMessageWithDelimiter.d.ts.map +1 -1
  390. package/lib/typescript/helpers/isUnresolvedSenderId.d.ts.map +1 -1
  391. package/lib/typescript/helpers/mimeToExtension.d.ts +15 -0
  392. package/lib/typescript/helpers/mimeToExtension.d.ts.map +1 -1
  393. package/lib/typescript/helpers/resolveInitBeforeLoadUser.d.ts.map +1 -1
  394. package/lib/typescript/helpers/resolveLangSource.d.ts +30 -0
  395. package/lib/typescript/helpers/resolveLangSource.d.ts.map +1 -0
  396. package/lib/typescript/helpers/xmppUsername.d.ts +13 -0
  397. package/lib/typescript/helpers/xmppUsername.d.ts.map +1 -0
  398. package/lib/typescript/hooks/useChatRoomFocus.d.ts +1 -4
  399. package/lib/typescript/hooks/useChatRoomFocus.d.ts.map +1 -1
  400. package/lib/typescript/hooks/useChatWrapperInit.d.ts.map +1 -1
  401. package/lib/typescript/hooks/useComposing.d.ts.map +1 -1
  402. package/lib/typescript/hooks/useLogout.d.ts.map +1 -1
  403. package/lib/typescript/hooks/usePendingNotification.d.ts.map +1 -1
  404. package/lib/typescript/hooks/useSendMessage.d.ts.map +1 -1
  405. package/lib/typescript/hooks/useUnreadMessagesCounter.d.ts +0 -1
  406. package/lib/typescript/hooks/useUnreadMessagesCounter.d.ts.map +1 -1
  407. package/lib/typescript/i18n/strings.d.ts.map +1 -1
  408. package/lib/typescript/i18n/useT.d.ts +1 -1
  409. package/lib/typescript/main.d.ts +2 -9
  410. package/lib/typescript/main.d.ts.map +1 -1
  411. package/lib/typescript/networking/api-requests/auth.api.d.ts +1 -3
  412. package/lib/typescript/networking/api-requests/auth.api.d.ts.map +1 -1
  413. package/lib/typescript/networking/api-requests/user.api.d.ts +0 -27
  414. package/lib/typescript/networking/api-requests/user.api.d.ts.map +1 -1
  415. package/lib/typescript/networking/apiClient.d.ts +6 -12
  416. package/lib/typescript/networking/apiClient.d.ts.map +1 -1
  417. package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
  418. package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts +2 -10
  419. package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts.map +1 -1
  420. package/lib/typescript/networking/xmpp/presenceInRoom.xmpp.d.ts.map +1 -1
  421. package/lib/typescript/networking/xmpp/subscribeToRoomMessages.xmpp.d.ts.map +1 -1
  422. package/lib/typescript/networking/xmppClient.d.ts +0 -14
  423. package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
  424. package/lib/typescript/roomStore/chatSettingsSlice.d.ts +0 -16
  425. package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
  426. package/lib/typescript/roomStore/index.d.ts.map +1 -1
  427. package/lib/typescript/roomStore/persistence.d.ts +1 -18
  428. package/lib/typescript/roomStore/persistence.d.ts.map +1 -1
  429. package/lib/typescript/roomStore/roomsSlice.d.ts +1 -14
  430. package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
  431. package/lib/typescript/services/pushSubscriptionService.d.ts +1 -1
  432. package/lib/typescript/services/pushSubscriptionService.d.ts.map +1 -1
  433. package/lib/typescript/types/types.d.ts +5 -49
  434. package/lib/typescript/types/types.d.ts.map +1 -1
  435. package/lib/typescript/version.d.ts +1 -1
  436. package/lib/typescript/version.d.ts.map +1 -1
  437. package/package.json +29 -41
  438. package/src/assets/icons.tsx +9 -48
  439. package/src/components/AuthForms/Login.tsx +3 -3
  440. package/src/components/Header/HeaderRoomList.tsx +6 -24
  441. package/src/components/MainComponents/ChatHeader.tsx +3 -9
  442. package/src/components/MainComponents/ChatRoom.tsx +16 -111
  443. package/src/components/MainComponents/ChatWrapper.tsx +53 -36
  444. package/src/components/MainComponents/LoginWrapper.tsx +0 -1
  445. package/src/components/MainComponents/MediaMessage.tsx +8 -26
  446. package/src/components/MainComponents/MessageContainer.tsx +1 -5
  447. package/src/components/MainComponents/MessageList.tsx +4 -23
  448. package/src/components/MainComponents/ProfileImagePlaceholder.tsx +14 -21
  449. package/src/components/MainComponents/ReduxWrapper.tsx +18 -1
  450. package/src/components/MainComponents/RoomList.tsx +39 -236
  451. package/src/components/Menu/HeaderRoomListMenu.tsx +75 -328
  452. package/src/components/MessageBubble/MessageTranslate.tsx +17 -12
  453. package/src/components/Modals/AttachSheet/AttachSheet.tsx +99 -331
  454. package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +293 -611
  455. package/src/components/Modals/ChatProfileModal/DeleteChatModal.tsx +9 -7
  456. package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +38 -79
  457. package/src/components/Modals/FilePreviewModal/PdfView.tsx +1 -2
  458. package/src/components/Modals/Modal/Modal.tsx +0 -7
  459. package/src/components/Modals/NewChatModal/ModalContent.tsx +3 -6
  460. package/src/components/Modals/NewChatModal/NewChatModal.tsx +126 -223
  461. package/src/components/Modals/NewChatModal/UpdNewChatModal.tsx +1 -12
  462. package/src/components/Modals/SelectUsersModal/SelectUsersModal.tsx +4 -14
  463. package/src/components/Modals/UserProfileModal/EditUserModal.tsx +25 -9
  464. package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +307 -617
  465. package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +58 -75
  466. package/src/components/Modals/styledModalComponents.tsx +2 -9
  467. package/src/components/RoomComponents/ChatRoomItem.tsx +50 -21
  468. package/src/components/RoomComponents/styled/LastMessageFile.tsx +4 -28
  469. package/src/components/RoomComponents/styled/LastMessagePhoto.tsx +3 -18
  470. package/src/components/RoomComponents/styled/LastMessageVideo.tsx +3 -18
  471. package/src/components/VideoCalls/VideoCallSession.tsx +3 -8
  472. package/src/components/styled/AudioMessage.tsx +1 -2
  473. package/src/components/styled/DateLabel.tsx +10 -3
  474. package/src/components/styled/MessageImage.tsx +7 -53
  475. package/src/components/styled/NewMessageLabel.tsx +3 -1
  476. package/src/components/styled/SendInput.tsx +18 -91
  477. package/src/components/styled/StyledComponents.ts +3 -9
  478. package/src/components/styled/StyledInputComponents/StyledInputComponents.tsx +4 -11
  479. package/src/components/styled/UnsupportedType.tsx +4 -14
  480. package/src/components/styled/VideoMessage.tsx +54 -131
  481. package/src/context/xmppProvider.tsx +51 -134
  482. package/src/helpers/createMessageFromXml.ts +1 -20
  483. package/src/helpers/ensureScopedChatCache.ts +2 -2
  484. package/src/helpers/getDataFromXml.ts +25 -1
  485. package/src/helpers/historyPreloadScheduler.ts +3 -80
  486. package/src/helpers/initXmppRooms.tsx +10 -14
  487. package/src/helpers/insertMessageWithDelimiter.ts +13 -0
  488. package/src/helpers/isUnresolvedSenderId.ts +9 -1
  489. package/src/helpers/mimeToExtension.ts +22 -6
  490. package/src/helpers/resolveInitBeforeLoadUser.ts +18 -125
  491. package/src/helpers/resolveLangSource.ts +40 -0
  492. package/src/helpers/xmppUsername.ts +38 -0
  493. package/src/hooks/useChatRoomFocus.ts +5 -14
  494. package/src/hooks/useChatWrapperInit.ts +16 -32
  495. package/src/hooks/useComposing.tsx +1 -37
  496. package/src/hooks/useLogout.tsx +9 -15
  497. package/src/hooks/usePendingNotification.ts +11 -5
  498. package/src/hooks/useSendMessage.tsx +15 -60
  499. package/src/hooks/useUnreadMessagesCounter.ts +0 -11
  500. package/src/i18n/strings.ts +133 -121
  501. package/src/i18n/useT.ts +1 -1
  502. package/src/main.ts +2 -26
  503. package/src/networking/api-requests/auth.api.ts +48 -156
  504. package/src/networking/api-requests/roomMembers.api.ts +1 -1
  505. package/src/networking/api-requests/rooms.api.ts +9 -9
  506. package/src/networking/api-requests/user.api.ts +7 -79
  507. package/src/networking/apiClient.ts +123 -68
  508. package/src/networking/stanzaHandlers.ts +51 -92
  509. package/src/networking/xmpp/flushLastViewedToPrivateStore.ts +10 -71
  510. package/src/networking/xmpp/presenceInRoom.xmpp.ts +1 -6
  511. package/src/networking/xmpp/subscribeToRoomMessages.xmpp.ts +1 -12
  512. package/src/networking/xmppClient.ts +9 -141
  513. package/src/roomStore/chatSettingsSlice.ts +10 -34
  514. package/src/roomStore/index.ts +4 -40
  515. package/src/roomStore/persistence.ts +40 -234
  516. package/src/roomStore/roomsSlice.ts +7 -87
  517. package/src/services/pushSubscriptionService.ts +13 -18
  518. package/src/types/types.ts +5 -58
  519. package/src/version.ts +3 -1
  520. package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js +0 -226
  521. package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js.map +0 -1
  522. package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js +0 -556
  523. package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js.map +0 -1
  524. package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js +0 -210
  525. package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js.map +0 -1
  526. package/lib/commonjs/helpers/getChatBackground.js +0 -23
  527. package/lib/commonjs/helpers/getChatBackground.js.map +0 -1
  528. package/lib/commonjs/helpers/getDisplayFileName.js +0 -79
  529. package/lib/commonjs/helpers/getDisplayFileName.js.map +0 -1
  530. package/lib/commonjs/helpers/getServerReadTimestamp.js +0 -125
  531. package/lib/commonjs/helpers/getServerReadTimestamp.js.map +0 -1
  532. package/lib/commonjs/helpers/isOwnMessage.js +0 -75
  533. package/lib/commonjs/helpers/isOwnMessage.js.map +0 -1
  534. package/lib/commonjs/helpers/mediaLibraryRuntime.js +0 -31
  535. package/lib/commonjs/helpers/mediaLibraryRuntime.js.map +0 -1
  536. package/lib/commonjs/helpers/persistCrypto.js +0 -122
  537. package/lib/commonjs/helpers/persistCrypto.js.map +0 -1
  538. package/lib/commonjs/helpers/pickImageAsset.js +0 -68
  539. package/lib/commonjs/helpers/pickImageAsset.js.map +0 -1
  540. package/lib/commonjs/helpers/pushPayload.js +0 -71
  541. package/lib/commonjs/helpers/pushPayload.js.map +0 -1
  542. package/lib/commonjs/helpers/secureFileUrl.js +0 -101
  543. package/lib/commonjs/helpers/secureFileUrl.js.map +0 -1
  544. package/lib/commonjs/helpers/secureKeyValue.js +0 -83
  545. package/lib/commonjs/helpers/secureKeyValue.js.map +0 -1
  546. package/lib/commonjs/helpers/secureStoreRuntime.js +0 -59
  547. package/lib/commonjs/helpers/secureStoreRuntime.js.map +0 -1
  548. package/lib/commonjs/helpers/secureUserStorage.js +0 -75
  549. package/lib/commonjs/helpers/secureUserStorage.js.map +0 -1
  550. package/lib/commonjs/helpers/shallowEqual.js +0 -36
  551. package/lib/commonjs/helpers/shallowEqual.js.map +0 -1
  552. package/lib/commonjs/helpers/sheetGestures.js +0 -32
  553. package/lib/commonjs/helpers/sheetGestures.js.map +0 -1
  554. package/lib/commonjs/hooks/useFileToken.js +0 -10
  555. package/lib/commonjs/hooks/useFileToken.js.map +0 -1
  556. package/lib/commonjs/networking/authRefresh.js +0 -332
  557. package/lib/commonjs/networking/authRefresh.js.map +0 -1
  558. package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js +0 -223
  559. package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js.map +0 -1
  560. package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js +0 -548
  561. package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js.map +0 -1
  562. package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js +0 -205
  563. package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js.map +0 -1
  564. package/lib/module/helpers/getChatBackground.js +0 -18
  565. package/lib/module/helpers/getChatBackground.js.map +0 -1
  566. package/lib/module/helpers/getDisplayFileName.js +0 -73
  567. package/lib/module/helpers/getDisplayFileName.js.map +0 -1
  568. package/lib/module/helpers/getServerReadTimestamp.js +0 -120
  569. package/lib/module/helpers/getServerReadTimestamp.js.map +0 -1
  570. package/lib/module/helpers/isOwnMessage.js +0 -70
  571. package/lib/module/helpers/isOwnMessage.js.map +0 -1
  572. package/lib/module/helpers/mediaLibraryRuntime.js +0 -25
  573. package/lib/module/helpers/mediaLibraryRuntime.js.map +0 -1
  574. package/lib/module/helpers/persistCrypto.js +0 -115
  575. package/lib/module/helpers/persistCrypto.js.map +0 -1
  576. package/lib/module/helpers/pickImageAsset.js +0 -63
  577. package/lib/module/helpers/pickImageAsset.js.map +0 -1
  578. package/lib/module/helpers/pushPayload.js +0 -63
  579. package/lib/module/helpers/pushPayload.js.map +0 -1
  580. package/lib/module/helpers/secureFileUrl.js +0 -91
  581. package/lib/module/helpers/secureFileUrl.js.map +0 -1
  582. package/lib/module/helpers/secureKeyValue.js +0 -75
  583. package/lib/module/helpers/secureKeyValue.js.map +0 -1
  584. package/lib/module/helpers/secureStoreRuntime.js +0 -52
  585. package/lib/module/helpers/secureStoreRuntime.js.map +0 -1
  586. package/lib/module/helpers/secureUserStorage.js +0 -72
  587. package/lib/module/helpers/secureUserStorage.js.map +0 -1
  588. package/lib/module/helpers/shallowEqual.js +0 -31
  589. package/lib/module/helpers/shallowEqual.js.map +0 -1
  590. package/lib/module/helpers/sheetGestures.js +0 -26
  591. package/lib/module/helpers/sheetGestures.js.map +0 -1
  592. package/lib/module/hooks/useFileToken.js +0 -5
  593. package/lib/module/hooks/useFileToken.js.map +0 -1
  594. package/lib/module/networking/authRefresh.js +0 -321
  595. package/lib/module/networking/authRefresh.js.map +0 -1
  596. package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts +0 -9
  597. package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts.map +0 -1
  598. package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts +0 -75
  599. package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts.map +0 -1
  600. package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts +0 -25
  601. package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts.map +0 -1
  602. package/lib/typescript/helpers/getChatBackground.d.ts +0 -15
  603. package/lib/typescript/helpers/getChatBackground.d.ts.map +0 -1
  604. package/lib/typescript/helpers/getDisplayFileName.d.ts +0 -49
  605. package/lib/typescript/helpers/getDisplayFileName.d.ts.map +0 -1
  606. package/lib/typescript/helpers/getServerReadTimestamp.d.ts +0 -69
  607. package/lib/typescript/helpers/getServerReadTimestamp.d.ts.map +0 -1
  608. package/lib/typescript/helpers/isOwnMessage.d.ts +0 -36
  609. package/lib/typescript/helpers/isOwnMessage.d.ts.map +0 -1
  610. package/lib/typescript/helpers/mediaLibraryRuntime.d.ts +0 -3
  611. package/lib/typescript/helpers/mediaLibraryRuntime.d.ts.map +0 -1
  612. package/lib/typescript/helpers/persistCrypto.d.ts +0 -13
  613. package/lib/typescript/helpers/persistCrypto.d.ts.map +0 -1
  614. package/lib/typescript/helpers/pickImageAsset.d.ts +0 -27
  615. package/lib/typescript/helpers/pickImageAsset.d.ts.map +0 -1
  616. package/lib/typescript/helpers/pushPayload.d.ts +0 -7
  617. package/lib/typescript/helpers/pushPayload.d.ts.map +0 -1
  618. package/lib/typescript/helpers/secureFileUrl.d.ts +0 -7
  619. package/lib/typescript/helpers/secureFileUrl.d.ts.map +0 -1
  620. package/lib/typescript/helpers/secureKeyValue.d.ts +0 -13
  621. package/lib/typescript/helpers/secureKeyValue.d.ts.map +0 -1
  622. package/lib/typescript/helpers/secureStoreRuntime.d.ts +0 -29
  623. package/lib/typescript/helpers/secureStoreRuntime.d.ts.map +0 -1
  624. package/lib/typescript/helpers/secureUserStorage.d.ts +0 -23
  625. package/lib/typescript/helpers/secureUserStorage.d.ts.map +0 -1
  626. package/lib/typescript/helpers/shallowEqual.d.ts +0 -11
  627. package/lib/typescript/helpers/shallowEqual.d.ts.map +0 -1
  628. package/lib/typescript/helpers/sheetGestures.d.ts +0 -20
  629. package/lib/typescript/helpers/sheetGestures.d.ts.map +0 -1
  630. package/lib/typescript/hooks/useFileToken.d.ts +0 -2
  631. package/lib/typescript/hooks/useFileToken.d.ts.map +0 -1
  632. package/lib/typescript/networking/authRefresh.d.ts +0 -95
  633. package/lib/typescript/networking/authRefresh.d.ts.map +0 -1
  634. package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +0 -244
  635. package/src/components/Modals/ProfileHeader/ProfileHeader.tsx +0 -615
  636. package/src/components/Modals/ProfileHeader/ProfileMenu.tsx +0 -217
  637. package/src/helpers/getChatBackground.ts +0 -18
  638. package/src/helpers/getDisplayFileName.ts +0 -87
  639. package/src/helpers/getServerReadTimestamp.ts +0 -120
  640. package/src/helpers/isOwnMessage.ts +0 -90
  641. package/src/helpers/mediaLibraryRuntime.ts +0 -25
  642. package/src/helpers/persistCrypto.ts +0 -127
  643. package/src/helpers/pickImageAsset.ts +0 -68
  644. package/src/helpers/pushPayload.ts +0 -62
  645. package/src/helpers/secureFileUrl.ts +0 -103
  646. package/src/helpers/secureKeyValue.ts +0 -80
  647. package/src/helpers/secureStoreRuntime.ts +0 -62
  648. package/src/helpers/secureUserStorage.ts +0 -80
  649. package/src/helpers/shallowEqual.ts +0 -33
  650. package/src/helpers/sheetGestures.ts +0 -25
  651. package/src/hooks/useFileToken.ts +0 -7
  652. package/src/networking/authRefresh.ts +0 -451
@@ -1,78 +1,42 @@
1
- /** @format */
2
-
3
- import React, { useEffect, useMemo, useRef, useState } from 'react';
1
+ import React, { useEffect, useMemo, useState } from 'react';
4
2
  import {
5
- Alert,
6
- Animated,
7
- Keyboard,
8
- Linking,
9
- Pressable,
10
- StyleSheet,
11
- Text,
12
- TextInput,
13
- TouchableOpacity,
14
- View,
15
- } from 'react-native';
16
- import { useDispatch, useSelector } from 'react-redux';
17
- import * as ImagePicker from 'expo-image-picker';
18
- import { useFileToken } from '../../../hooks/useFileToken';
19
- import { appendFileToken } from '../../../helpers/secureFileUrl';
20
- import { ModalContainerFullScreen } from '../styledModalComponents';
3
+ CenterContainer,
4
+ UserInfo,
5
+ UserName,
6
+ UserStatus,
7
+ ModalContainerFullScreen,
8
+ Label,
9
+ BorderedContainer,
10
+ LabelData,
11
+ Viewider,
12
+ Divider,
13
+ } from '../styledModalComponents';
14
+ import { Pressable, View, Text, ScrollView, Alert, Linking } from 'react-native';
15
+ import ModalHeaderComponent from '../ModalHeaderComponent';
21
16
  import { ProfileImagePlaceholder } from '../../MainComponents/ProfileImagePlaceholder';
17
+ import { useDispatch, useSelector } from 'react-redux';
22
18
  import { RootState, getActiveRoom } from '../../../roomStore';
23
19
  import { uploadFile } from '../../../networking/api-requests/auth.api';
24
20
  import { useXmppClient } from '../../../context/xmppProvider';
25
- import { deleteRoom, updateRoom } from '../../../roomStore/roomsSlice';
21
+ import { updateRoom } from '../../../roomStore/roomsSlice';
22
+ import * as ImagePicker from 'expo-image-picker';
26
23
  import Loader from '../../styled/Loader';
27
- import {
28
- AddNewIcon,
29
- DeleteIcon,
30
- EditIcon,
31
- LeaveIcon,
32
- ReportIcon,
33
- SearchIcon,
34
- } from '../../../assets/icons';
24
+ import Button from '../../styled/Button';
25
+ import { DeleteIcon, MoreIcon, QrIcon } from '../../../assets/icons';
26
+ import Switch from '../../MainComponents/Switch';
35
27
  import { useChatSettingState } from '../../../hooks/useChatSettingState';
36
28
  import { chatTextStyle } from '../../../helpers/typography';
29
+ import { useT } from '../../../i18n/useT';
37
30
  import { getElementFont } from '../../../helpers/getElementFont';
38
- import { getIconColor } from '../../../helpers/getIconColor';
39
31
  import { deleteRoomMember } from '../../../networking/api-requests/rooms.api';
40
32
  import { RoomMember } from '../../../types/models/room.model';
41
33
  import { setActiveModal, setSelectedUser } from '../../../roomStore/chatSettingsSlice';
42
34
  import { MODAL_TYPES } from '../../../helpers/constants/MODAL_TYPES';
35
+ import DropdownMenu, { MenuOption } from '../../DropdownMenu/DropdownMenu';
43
36
  import SelectUsersModal from '../SelectUsersModal/SelectUsersModal';
44
37
  import { useToast } from '../../../context/ToastContext';
45
- import { useT } from '../../../i18n/useT';
46
38
  import DeleteChatModal from './DeleteChatModal';
47
- import ReportChatModal from './ReportChatModal';
48
- import {
49
- ProfileHero,
50
- ProfileTopBar,
51
- HeroAction,
52
- useHeaderMetrics,
53
- } from '../ProfileHeader/ProfileHeader';
54
- import ProfileMenu, { ProfileMenuItem } from '../ProfileHeader/ProfileMenu';
55
39
 
56
- /**
57
- * Where the header should sit when search opens: tucked away at the
58
- * collapsed offset when the picture is still expanded, and left exactly
59
- * where it is when the user already scrolled it away.
60
- */
61
- export const searchScrollTarget = (
62
- isCollapsed: boolean,
63
- collapseDistance: number
64
- ): number | null => (isCollapsed ? null : collapseDistance);
65
-
66
- /** Two uppercase letters for a chat without a picture, same rule the
67
- * avatar placeholder uses for people. */
68
- export const chatInitials = (name?: string | null): string => {
69
- const words = (name || '').trim().split(/\s+/).filter(Boolean);
70
- const letters = (words.length >= 2
71
- ? [words[0][0], words[1][0]]
72
- : [words[0]?.[0], words[0]?.[1]]
73
- ).filter((c) => !!c && /[\p{L}\p{N}]/u.test(c));
74
- return letters.join('').toUpperCase();
75
- };
76
40
 
77
41
  interface ChatProfileModalProps {
78
42
  handleCloseModal: any;
@@ -81,37 +45,32 @@ interface ChatProfileModalProps {
81
45
  const ChatProfileModal: React.FC<ChatProfileModalProps> = ({
82
46
  handleCloseModal,
83
47
  }) => {
84
- const t = useT();
85
48
  const [loading, setLoading] = useState<boolean>(false);
86
- const [isDeleteOpen, setIsDeleteOpen] = useState(false);
87
- const [isReportOpen, setIsReportOpen] = useState(false);
88
- const [memberQuery, setMemberQuery] = useState('');
89
- const [isSearchOpen, setIsSearchOpen] = useState(false);
90
- // Measured, not guessed: this screen renders inside whatever frame the
91
- // host gives it (the demo app keeps its own tab bar above), so the
92
- // window height would overshoot.
93
- const [viewportHeight, setViewportHeight] = useState(0);
49
+ const [visible, setVisible] = useState<boolean>(false);
50
+ const [isModalOpen, setIsModalOpen] = useState(false);
94
51
 
95
52
  const { showToast } = useToast();
53
+ const t = useT();
54
+
55
+ const chatMenuOptions = useMemo(
56
+ () => [
57
+ {
58
+ label: t('action.deleteChat'),
59
+ icon: <DeleteIcon />,
60
+ onClick: () => {
61
+ setIsModalOpen(true);
62
+ },
63
+ styles: { color: 'red' },
64
+ },
65
+ ],
66
+ [t]
67
+ );
68
+
96
69
  const dispatch = useDispatch();
70
+
97
71
  const { client } = useXmppClient();
98
72
  const { user: stateUser, config } = useChatSettingState();
99
73
  const activeRoom = useSelector((state: RootState) => getActiveRoom(state));
100
- const fileToken = useFileToken();
101
-
102
- // Drives both the hero's parallax and the collapsed bar's fade-in. One
103
- // shared value, written natively by the ScrollView.
104
- const scrollY = useRef(new Animated.Value(0)).current;
105
- const scrollRef = useRef<any>(null);
106
- const searchInputRef = useRef<TextInput>(null);
107
- const { collapseDistance } = useHeaderMetrics();
108
- // `scrollY` is driven natively, so its value can't be read back with
109
- // addListener. The Animated.event's `listener` still fires on the JS
110
- // side, which is enough to know which state the header is in.
111
- const [isCollapsed, setIsCollapsed] = useState(false);
112
- // Set when search collapsed the header itself, so only then does
113
- // dismissing search (or the keyboard) expand it again.
114
- const collapsedForSearchRef = useRef(false);
115
74
 
116
75
  // Pull live member list from the MUC when the modal opens — REST
117
76
  // hydration only fills the *count* (item.participants /
@@ -127,12 +86,6 @@ const ChatProfileModal: React.FC<ChatProfileModalProps> = ({
127
86
  }
128
87
  }, [client, activeRoom?.jid]);
129
88
 
130
- useEffect(() => {
131
- if (!activeRoom) {
132
- dispatch(setActiveModal(undefined));
133
- }
134
- }, [activeRoom, dispatch]);
135
-
136
89
  const onUpload = async () => {
137
90
  let loadingSet = false;
138
91
  try {
@@ -145,8 +98,8 @@ const ChatProfileModal: React.FC<ChatProfileModalProps> = ({
145
98
  const perm = await ImagePicker.requestMediaLibraryPermissionsAsync();
146
99
  if (!perm.granted) {
147
100
  Alert.alert(
148
- 'Permission required',
149
- 'Photo library permission is needed to select images.',
101
+ t('permission.requiredTitle'),
102
+ t('permission.photoLibrary'),
150
103
  [
151
104
  {
152
105
  text: t('action.cancel'),
@@ -154,7 +107,7 @@ const ChatProfileModal: React.FC<ChatProfileModalProps> = ({
154
107
  style: 'cancel',
155
108
  },
156
109
  {
157
- text: 'Open Settings',
110
+ text: t('action.openSettings'),
158
111
  onPress: () => Linking.openSettings(),
159
112
  },
160
113
  ]
@@ -193,8 +146,8 @@ const ChatProfileModal: React.FC<ChatProfileModalProps> = ({
193
146
 
194
147
  showToast({
195
148
  id: Date.now().toString(),
196
- title: 'Success',
197
- message: 'Room image updated successfully',
149
+ title: t('toast.successTitle'),
150
+ message: t('toast.roomImageUpdated'),
198
151
  type: 'success',
199
152
  });
200
153
  }
@@ -207,8 +160,8 @@ const ChatProfileModal: React.FC<ChatProfileModalProps> = ({
207
160
  console.error('File upload failed or location is missing:', error);
208
161
  showToast({
209
162
  id: Date.now().toString(),
210
- title: 'Error',
211
- message: 'Failed to upload image',
163
+ title: t('toast.error'),
164
+ message: t('toast.failedToUploadImage'),
212
165
  type: 'error',
213
166
  });
214
167
  } finally {
@@ -218,13 +171,7 @@ const ChatProfileModal: React.FC<ChatProfileModalProps> = ({
218
171
  }
219
172
  };
220
173
 
221
- const onRemoveIcon = () => {
222
- client?.setRoomImageStanza(activeRoom?.jid || '', '', 'icon', 'none');
223
- dispatch(updateRoom({ jid: activeRoom?.jid || '', updates: { icon: null } }));
224
- };
225
-
226
- const handleDeleteUser = async (user: RoomMember) => {
227
- const userId = user.xmppUsername;
174
+ const handleDeleteUser = async (userId: string) => {
228
175
  try {
229
176
  await deleteRoomMember({
230
177
  roomId: activeRoom?.jid?.split('@')[0] || '',
@@ -236,7 +183,7 @@ const ChatProfileModal: React.FC<ChatProfileModalProps> = ({
236
183
  jid: activeRoom?.jid || '',
237
184
  updates: {
238
185
  roomMembers: activeRoom?.roomMembers?.filter(
239
- (member) => member.xmppUsername !== userId
186
+ (user) => user.xmppUsername !== userId
240
187
  ),
241
188
  },
242
189
  })
@@ -244,34 +191,24 @@ const ChatProfileModal: React.FC<ChatProfileModalProps> = ({
244
191
 
245
192
  showToast({
246
193
  id: Date.now().toString(),
247
- title: 'Success',
248
- message: `${userId} has been removed from the room.`,
194
+ title: t('toast.successTitle'),
195
+ message: t('toast.userRemovedFromRoom', { userId }),
249
196
  type: 'success',
250
197
  });
251
198
  } catch (error) {
252
199
  console.error('Failed to delete user:', error);
253
200
  showToast({
254
201
  id: Date.now().toString(),
255
- title: 'Error',
256
- message: 'Failed to delete user.',
202
+ title: t('toast.error'),
203
+ message: t('toast.failedToDeleteUser'),
257
204
  type: 'error',
258
205
  });
259
206
  }
260
207
  };
261
208
 
262
- const confirmRemoveMember = (user: RoomMember) => {
263
- Alert.alert(
264
- t('modal.chatProfile.removeMember'),
265
- `${user.firstName} ${user.lastName}`.trim(),
266
- [
267
- { text: t('action.cancel'), style: 'cancel' },
268
- {
269
- text: t('action.delete'),
270
- style: 'destructive',
271
- onPress: () => handleDeleteUser(user),
272
- },
273
- ]
274
- );
209
+ const onRemoveClick = async () => {
210
+ client?.setRoomImageStanza(activeRoom?.jid || '', '', 'icon', 'none');
211
+ dispatch(updateRoom({ jid: activeRoom?.jid || '', updates: { icon: null } }));
275
212
  };
276
213
 
277
214
  const handleUserAvatarClick = (user: RoomMember): void => {
@@ -289,527 +226,272 @@ const ChatProfileModal: React.FC<ChatProfileModalProps> = ({
289
226
  );
290
227
  };
291
228
 
292
- // Leaving is XMPP-side (an unavailable presence to the MUC); dropping the
293
- // room from the store is what actually takes the user out of the chat in
294
- // the UI, and the `!activeRoom` effect above then closes this modal.
295
- const handleLeave = () => {
296
- Alert.alert(t('modal.leaveChat.title'), t('modal.leaveChat.description'), [
297
- { text: t('action.cancel'), style: 'cancel' },
229
+ const menuOptions = useMemo(
230
+ () => (userId: string) => [
298
231
  {
299
- text: t('action.leave'),
300
- style: 'destructive',
301
- onPress: () => {
302
- try {
303
- client?.leaveTheRoomStanza?.(activeRoom?.jid || '');
304
- } catch (error) {
305
- console.error('Failed to leave the room:', error);
306
- }
307
- dispatch(deleteRoom({ jid: activeRoom?.jid || '' }));
308
- handleCloseModal?.();
232
+ label: t('action.appointAsAdmin'),
233
+ icon: null,
234
+ onClick: () => {
235
+ dispatch(setActiveModal(MODAL_TYPES.PROFILE));
236
+ console.log('Profile clicked');
309
237
  },
310
238
  },
311
- ]);
312
- };
313
-
314
- const isModerator = activeRoom?.role === 'moderator';
315
- const canEditIcon =
316
- !config?.disableChatInfo?.disableIconEdit && activeRoom?.role !== 'participant';
317
- const canAddMembers = isModerator && activeRoom?.type === 'group';
318
- const canDeleteChat = isModerator && activeRoom?.type !== 'private';
319
- const hasIcon = !!activeRoom?.icon;
320
-
321
- const scrollHeaderTo = (y: number) =>
322
- scrollRef.current?.scrollTo?.({ y, animated: true });
323
-
324
- // Opening search from an expanded header tucks the picture away so the
325
- // results and the keyboard have room; from an already-collapsed header
326
- // it just opens the field. Whatever it collapsed, it puts back.
327
- const openMemberSearch = () => {
328
- const target = searchScrollTarget(isCollapsed, collapseDistance);
329
- if (target !== null) {
330
- collapsedForSearchRef.current = true;
331
- scrollHeaderTo(target);
332
- }
333
- setIsSearchOpen(true);
334
- setTimeout(() => searchInputRef.current?.focus(), 50);
335
- };
336
-
337
- const restoreHeader = () => {
338
- if (!collapsedForSearchRef.current) {return;}
339
- collapsedForSearchRef.current = false;
340
- scrollHeaderTo(0);
341
- };
342
-
343
- const closeMemberSearch = () => {
344
- setMemberQuery('');
345
- setIsSearchOpen(false);
346
- Keyboard.dismiss();
347
- restoreHeader();
348
- };
349
-
350
- // Putting the keyboard away is the other way out of search, so it
351
- // restores the header too — the field stays, results and all.
352
- useEffect(() => {
353
- if (!isSearchOpen) {return undefined;}
354
- const sub = Keyboard.addListener('keyboardDidHide', restoreHeader);
355
- return () => sub.remove();
356
- }, [isSearchOpen]); // eslint-disable-line react-hooks/exhaustive-deps
357
-
358
- const heroActions: HeroAction[] = useMemo(
359
- () => [
360
239
  {
361
- key: 'search',
362
- label: t('action.search'),
363
- icon: (color: string) => <SearchIcon color={color} />,
364
- onPress: openMemberSearch,
365
- },
366
- {
367
- key: 'leave',
368
- label: t('action.leave'),
369
- icon: (color: string) => <LeaveIcon color={color} />,
370
- onPress: handleLeave,
240
+ label: t('action.unban'),
241
+ icon: null,
242
+ onClick: () => {
243
+ dispatch(setActiveModal(MODAL_TYPES.SETTINGS));
244
+ console.log('Settings clicked');
245
+ },
371
246
  },
372
247
  {
373
- key: 'report',
374
- label: t('action.report'),
375
- icon: (color: string) => <ReportIcon color={color} />,
376
- onPress: () => setIsReportOpen(true),
248
+ label: t('action.delete'),
249
+ icon: null,
250
+ onClick: (e: any) => {
251
+ e?.preventDefault();
252
+ handleDeleteUser(userId);
253
+ },
377
254
  },
378
255
  ],
379
- [t, activeRoom?.jid] // eslint-disable-line react-hooks/exhaustive-deps
256
+ [t]
380
257
  );
381
258
 
382
- // "…" menu. Edit is the chat picture — the only chat detail this SDK can
383
- // actually change (there is no update-chat endpoint for title/description),
384
- // so it is only offered when the picture is editable.
385
- const menuItems: ProfileMenuItem[] = useMemo(() => {
386
- const items: ProfileMenuItem[] = [];
387
- if (canEditIcon) {
388
- items.push({
389
- key: 'edit',
390
- label: t('action.edit'),
391
- icon: <EditIcon color="#141414" width={18} height={18} />,
392
- onPress: onUpload,
393
- });
394
- if (hasIcon) {
395
- items.push({
396
- key: 'remove-photo',
397
- label: t('modal.chatProfile.removePhoto'),
398
- icon: <DeleteIcon width={18} height={18} />,
399
- onPress: onRemoveIcon,
400
- });
401
- }
402
- }
403
- // The hero's Search button is off-screen once collapsed, so the menu
404
- // carries it — the design's collapsed menu does the same.
405
- if (isCollapsed) {
406
- items.push({
407
- key: 'search',
408
- label: t('action.search'),
409
- icon: <SearchIcon color="#141414" width={18} height={18} />,
410
- onPress: openMemberSearch,
411
- });
412
- }
413
- items.push({
414
- key: 'report',
415
- label: t('action.report'),
416
- icon: <ReportIcon color="#141414" width={18} height={18} />,
417
- onPress: () => setIsReportOpen(true),
418
- });
419
- if (canDeleteChat) {
420
- items.push({
421
- key: 'delete-and-leave',
422
- label: t('action.deleteAndLeave'),
423
- icon: <DeleteIcon width={18} height={18} />,
424
- destructive: true,
425
- onPress: () => setIsDeleteOpen(true),
426
- });
259
+ useEffect(() => {
260
+ if (!activeRoom) {
261
+ dispatch(setActiveModal(undefined));
427
262
  }
428
- return items;
429
- }, [canEditIcon, canDeleteChat, hasIcon, isCollapsed, t]); // eslint-disable-line react-hooks/exhaustive-deps
263
+ }, [activeRoom, dispatch]);
430
264
 
431
265
  if (!activeRoom) {
432
266
  return null;
433
267
  }
434
268
 
435
- const title = activeRoom.title || activeRoom.name;
436
- const memberCount = activeRoom.usersCnt ?? 0;
437
- const subtitle = t(
438
- memberCount === 1
439
- ? 'modal.chatProfile.memberCountSingular'
440
- : 'modal.chatProfile.memberCountPlural',
441
- { count: memberCount }
442
- );
443
- const heroImage = appendFileToken(activeRoom.icon, fileToken) || null;
444
- // A single flat colour behind the initials — the config's avatar colour
445
- // when set, otherwise the primary. (The old per-name hash colour is what
446
- // made the header read as two different greens next to the members' own
447
- // avatars.)
448
- const heroColor = config?.colors?.avatar || getIconColor(config);
449
- const members = activeRoom.roomMembers ?? [];
450
- const query = memberQuery.trim().toLowerCase();
451
- const visibleMembers = query
452
- ? members.filter((user) =>
453
- `${user.firstName ?? ''} ${user.lastName ?? ''}`
454
- .toLowerCase()
455
- .includes(query)
456
- )
457
- : members;
458
-
459
269
  return (
460
- <ModalContainerFullScreen style={styles.screen}>
461
- <Animated.ScrollView
462
- ref={scrollRef}
463
- style={styles.scroll}
464
- // The collapsed state has to be reachable even when the member list
465
- // is short: without this the content was shorter than the viewport,
466
- // so the scroll had nowhere to go and simply bounced back.
467
- contentContainerStyle={[
468
- styles.scrollContent,
469
- viewportHeight > 0 && {
470
- minHeight: viewportHeight + collapseDistance,
471
- },
472
- ]}
473
- onLayout={(e) => setViewportHeight(e.nativeEvent.layout.height)}
474
- showsVerticalScrollIndicator={false}
475
- keyboardShouldPersistTaps="handled"
476
- scrollEventThrottle={16}
477
- onScroll={Animated.event(
478
- [{ nativeEvent: { contentOffset: { y: scrollY } } }],
479
- {
480
- useNativeDriver: true,
481
- listener: (e: any) => {
482
- const y = e?.nativeEvent?.contentOffset?.y ?? 0;
483
- setIsCollapsed(y >= collapseDistance - 8);
484
- },
485
- }
486
- )}
487
- >
488
- <ProfileHero
489
- title={title}
490
- subtitle={subtitle}
491
- imageUri={heroImage}
492
- fallbackColor={heroColor}
493
- initials={chatInitials(title)}
494
- scrollY={scrollY}
495
- actions={heroActions}
496
- titleStyle={chatTextStyle(config?.typography?.profile?.title)}
497
- subtitleStyle={getElementFont(config, 'profileStatus')}
498
- />
499
-
500
- <View style={styles.body}>
501
- {!config?.disableChatInfo?.disableDescription && (
502
- <View style={styles.card}>
503
- <Text style={[styles.cardLabel, getElementFont(config, 'profileSectionLabel')]}>
504
- {t('modal.chatProfile.description')}
505
- </Text>
506
- <Text style={styles.cardValue}>{activeRoom.description || '—'}</Text>
507
- </View>
508
- )}
509
-
510
- {!config?.disableChatInfo?.disableType && (
511
- <View style={styles.card}>
512
- <Text style={[styles.cardLabel, getElementFont(config, 'profileSectionLabel')]}>
513
- {t('modal.chatProfile.chatType')}
514
- </Text>
515
- <Text style={styles.cardValue}>{activeRoom.type || '—'}</Text>
516
- </View>
517
- )}
518
-
519
- {!config?.disableChatInfo?.hideMembers && (
520
- <View style={styles.card}>
521
- {canAddMembers && (
522
- <SelectUsersModal
523
- trigger={(open) => (
524
- <TouchableOpacity
525
- testID="chat-profile-add-members"
526
- activeOpacity={0.7}
527
- style={styles.addMembersRow}
528
- onPress={open}
529
- >
530
- <AddNewIcon color={getIconColor(config)} />
531
- <Text style={styles.addMembersLabel}>
532
- {t('modal.chatProfile.addMembers')}
533
- </Text>
534
- </TouchableOpacity>
535
- )}
270
+ <ModalContainerFullScreen style={{ position: 'relative' }}>
271
+ <ModalHeaderComponent
272
+ handleCloseModal={handleCloseModal}
273
+ headerTitle={t('modal.chatProfile.title')}
274
+ titleStyle={chatTextStyle(config?.typography?.profile?.screenTitle)}
275
+ rightMenu={
276
+ <>
277
+ {activeRoom?.type === 'public' && (
278
+ <Button EndIcon={<QrIcon />} onPress={() => setVisible(true)} />
279
+ )}
280
+ {activeRoom.role === 'moderator' &&
281
+ activeRoom.type !== 'private' && (
282
+ <DropdownMenu
283
+ position="right"
284
+ options={chatMenuOptions}
285
+ openButton={
286
+ <Button
287
+ style={{ padding: 8, height: 40 }}
288
+ EndIcon={<MoreIcon />}
289
+ unstyled
290
+ />
291
+ }
536
292
  />
537
293
  )}
538
-
539
- <Text
540
- style={[
541
- styles.cardLabel,
542
- getElementFont(config, 'profileSectionLabel'),
543
- ]}
544
- >
545
- {t('modal.chatProfile.membersLabel', { count: memberCount })}
546
- </Text>
547
-
548
- {isSearchOpen && (
549
- <View style={styles.searchRow}>
550
- <SearchIcon color="#8C8C8C" width={18} height={18} />
551
- <TextInput
552
- testID="chat-profile-member-search"
553
- ref={searchInputRef}
554
- style={styles.searchInput}
555
- value={memberQuery}
556
- onChangeText={setMemberQuery}
557
- placeholder={t('search.members')}
558
- placeholderTextColor="#8C8C8C"
559
- autoCorrect={false}
560
- returnKeyType="search"
561
- />
562
- <TouchableOpacity
563
- testID="chat-profile-search-close"
564
- activeOpacity={0.7}
565
- hitSlop={{ top: 8, bottom: 8, left: 8, right: 8 }}
566
- onPress={closeMemberSearch}
294
+ </>
295
+ }
296
+ />
297
+ <CenterContainer>
298
+ <ProfileImagePlaceholder
299
+ name={activeRoom.title || activeRoom.name}
300
+ icon={activeRoom.icon}
301
+ // Two gates control whether the icon is editable:
302
+ // 1. role — only non-participants could edit before.
303
+ // 2. NEW: `disableChatInfo.disableIconEdit` — hard kill from
304
+ // config so a consumer can make the icon read-only for
305
+ // everyone (e.g. branded rooms, patient-facing apps).
306
+ // Both must allow it for the picker/remove affordances to show.
307
+ upload={{
308
+ onUpload,
309
+ active:
310
+ !config?.disableChatInfo?.disableIconEdit &&
311
+ activeRoom?.role !== 'participant',
312
+ }}
313
+ remove={{
314
+ enabled: !config?.disableChatInfo?.disableIconEdit,
315
+ onRemoveClick,
316
+ }}
317
+ role={activeRoom?.role}
318
+ size={128}
319
+ />
320
+ <UserInfo>
321
+ <UserName
322
+ fontSize={config?.typography?.profile?.title?.fontSize}
323
+ fontWeight={config?.typography?.profile?.title?.fontWeight as any}
324
+ >
325
+ {activeRoom.title || activeRoom.name}
326
+ </UserName>
327
+ <UserStatus style={getElementFont(config, 'profileStatus')}>
328
+ {t(
329
+ activeRoom.usersCnt > 1
330
+ ? 'modal.chatProfile.memberCountPlural'
331
+ : 'modal.chatProfile.memberCountSingular',
332
+ { count: activeRoom.usersCnt }
333
+ )}
334
+ </UserStatus>
335
+ </UserInfo>
336
+ {activeRoom.role === 'moderator' && activeRoom.type === 'group' && (
337
+ <>
338
+ {/* <AddMembersModal /> */}
339
+ <SelectUsersModal />
340
+ </>
341
+ )}
342
+ {!config?.disableChatInfo?.disableDescription && (
343
+ <BorderedContainer>
344
+ <LabelData style={getElementFont(config, 'profileSectionLabel')}>
345
+ {t('modal.chatProfile.description')}
346
+ </LabelData>
347
+ <Label>{activeRoom?.description || '—'}</Label>
348
+ </BorderedContainer>
349
+ )}
350
+ {!config?.disableChatInfo?.disableType && (
351
+ <BorderedContainer>
352
+ <LabelData style={getElementFont(config, 'profileSectionLabel')}>
353
+ {t('modal.chatProfile.chatType')}
354
+ </LabelData>
355
+ <Label>{activeRoom.type || '—'}</Label>
356
+ </BorderedContainer>
357
+ )}
358
+ {/* <BorderedContainer
359
+ style={{
360
+ justifyContent: 'space-between',
361
+ flexDirection: 'row',
362
+ alignItems: 'center',
363
+ }}
364
+ >
365
+ <Label>Notifications</Label>
366
+ <Label>
367
+ <Switch
368
+ onToggle={function (isOn: boolean): void {
369
+ throw new Error('Function not implemented.');
370
+ }}
371
+ bgColor={config?.colors?.primary}
372
+ />
373
+ </Label>
374
+ </BorderedContainer> */}
375
+ {!config?.disableChatInfo?.hideMembers && (
376
+ <BorderedContainer style={{ paddingHorizontal: 16, paddingVertical: 8 }}>
377
+ {loading ? (
378
+ <Loader />
379
+ ) : (activeRoom?.roomMembers?.length ?? 0) === 0 ? (
380
+ <Label style={{ opacity: 0.6, textAlign: 'center', paddingVertical: 8 }}>
381
+ {t('modal.chatProfile.memberListUnavailable')}
382
+ </Label>
383
+ ) : (
384
+ <ScrollView
385
+ style={{ maxHeight: 400 }}
386
+ showsVerticalScrollIndicator={true}
387
+ nestedScrollEnabled={true}
388
+ >
389
+ {activeRoom?.roomMembers?.map((user, index) => (
390
+ <View
391
+ key={user.xmppUsername}
392
+ style={{
393
+ flexDirection: 'column',
394
+ alignItems: 'flex-start',
395
+ }}
396
+ >
397
+ <View
398
+ style={{
399
+ flexDirection: 'row',
400
+ justifyContent: 'flex-start',
401
+ paddingHorizontal: 8,
402
+ paddingVertical: 0,
403
+ alignItems: 'center',
404
+ width: '100%',
405
+ }}
567
406
  >
568
- <Text style={styles.searchClose}>×</Text>
569
- </TouchableOpacity>
570
- </View>
571
- )}
572
-
573
- {loading ? (
574
- <Loader />
575
- ) : visibleMembers.length === 0 ? (
576
- <Text testID="chat-profile-members-empty" style={styles.emptyMembers}>
577
- {members.length === 0
578
- ? t('modal.chatProfile.membersUnavailable')
579
- : t('search.noResults')}
580
- </Text>
581
- ) : (
582
- visibleMembers.map((user, index) => {
583
- const banned = user.ban_status === 'banned';
584
- const roleLabel =
585
- user.role && user.role !== 'none' && user.role !== 'participant'
586
- ? user.role
587
- : null;
588
- return (
589
- <View
590
- key={user.xmppUsername}
591
- style={[styles.memberRow, index > 0 && styles.memberDivider]}
407
+ <Pressable
408
+ style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', gap: 16 }}
409
+ // `disableChatInfo.disableMemberTap` blocks the
410
+ // tap entirely so the user-profile popup never
411
+ // opens. `disableMemberProfileActions` only hid
412
+ // the action buttons INSIDE that popup, leaving
413
+ // the popup itself to open on tap — this gate
414
+ // closes the door. Customer-reported #16.
415
+ onPress={
416
+ config?.disableChatInfo?.disableMemberTap
417
+ ? undefined
418
+ : () => handleUserAvatarClick(user)
419
+ }
420
+ disabled={!!config?.disableChatInfo?.disableMemberTap}
592
421
  >
593
- <Pressable
594
- style={styles.memberMain}
595
- // `disableChatInfo.disableMemberTap` blocks the tap
596
- // entirely so the user-profile popup never opens.
597
- // `disableMemberProfileActions` only hid the action
598
- // buttons INSIDE that popup, leaving the popup itself
599
- // to open on tap — this gate closes the door.
600
- // Customer-reported #16.
601
- onPress={
602
- config?.disableChatInfo?.disableMemberTap
603
- ? undefined
604
- : () => handleUserAvatarClick(user)
605
- }
606
- disabled={!!config?.disableChatInfo?.disableMemberTap}
422
+ <ProfileImagePlaceholder
423
+ name={`${user.firstName} ${user.lastName}`}
424
+ size={40}
425
+ />
426
+ <View
427
+ style={{
428
+ flexDirection: 'column',
429
+ gap: 2,
430
+ alignItems: 'flex-start',
431
+ justifyContent: 'center',
432
+ }}
607
433
  >
608
- <ProfileImagePlaceholder
609
- name={`${user.firstName} ${user.lastName}`}
610
- size={40}
611
- />
612
- <View style={styles.memberText}>
613
- <Text
614
- numberOfLines={1}
615
- style={[
616
- styles.memberName,
617
- chatTextStyle(config?.typography?.profile?.memberName),
618
- ]}
619
- >
620
- {user.firstName} {user.lastName}
621
- </Text>
622
- {!!user.last_active && (
623
- <Text
624
- numberOfLines={1}
625
- style={[
626
- styles.memberStatus,
627
- getElementFont(config, 'profileSectionLabel'),
628
- ]}
629
- >
630
- {new Date(user.last_active * 1000).toLocaleString()}
631
- </Text>
632
- )}
633
- </View>
634
- </Pressable>
635
-
636
- {(banned || roleLabel) && (
637
- <Text
638
- style={[styles.memberRole, banned && styles.memberBanned]}
434
+ <Label
435
+ style={[
436
+ { fontSize: 16, fontWeight: 600 },
437
+ chatTextStyle(config?.typography?.profile?.memberName),
438
+ ]}
639
439
  >
640
- {banned ? t('status.banned') : roleLabel}
641
- </Text>
642
- )}
643
-
644
- {isModerator &&
645
- activeRoom.type !== 'private' &&
646
- stateUser.xmppUsername !== user.xmppUsername && (
647
- <TouchableOpacity
648
- testID={`chat-profile-remove-${user.xmppUsername}`}
649
- activeOpacity={0.7}
650
- hitSlop={{ top: 8, bottom: 8, left: 8, right: 8 }}
651
- style={styles.memberRemove}
652
- onPress={() => confirmRemoveMember(user)}
653
- >
654
- <DeleteIcon width={20} height={20} />
655
- </TouchableOpacity>
440
+ {user.firstName} {user.lastName}
441
+ </Label>
442
+ {user.last_active && (
443
+ <LabelData style={getElementFont(config, 'profileSectionLabel')}>
444
+ {new Date(user.last_active * 1000).toLocaleString()}
445
+ </LabelData>
656
446
  )}
657
- </View>
658
- );
659
- })
660
- )}
661
- </View>
447
+ </View>
448
+ </Pressable>
449
+ {user.role && user.role !== 'none' && (
450
+ <Text
451
+ style={{
452
+ backgroundColor:
453
+ user.ban_status !== 'banned' ? '#F3F6FC' : '#FFEBEE',
454
+ color:
455
+ user.ban_status !== 'banned' ? '#0052CD' : '#F44336',
456
+ padding: 5,
457
+ borderRadius: 16,
458
+ fontSize: 12,
459
+ }}
460
+ >
461
+ {user.role}
462
+ </Text>
463
+ )}
464
+ {stateUser.xmppUsername !== user.xmppUsername &&
465
+ activeRoom.role === 'moderator' &&
466
+ activeRoom.type !== 'private' && (
467
+ <DropdownMenu
468
+ options={menuOptions(user.xmppUsername) as MenuOption[]}
469
+ openButton={
470
+ <Button
471
+ onPress={() => {}}
472
+ >
473
+ <Text>{t('action.moreOptions')}</Text>
474
+ </Button>
475
+ }
476
+ onClose={() => console.log('Dropdown closed')}
477
+ />
478
+ )}
479
+ </View>
480
+ {index < (activeRoom?.roomMembers?.length || 0) - 1 && <Divider />}
481
+ </View>
482
+ ))}
483
+ </ScrollView>
662
484
  )}
663
- </View>
664
- </Animated.ScrollView>
665
-
666
- <ProfileTopBar
667
- title={title}
668
- subtitle={subtitle}
669
- imageUri={heroImage}
670
- fallbackColor={heroColor}
671
- initials={chatInitials(title)}
672
- scrollY={scrollY}
673
- onBack={handleCloseModal}
674
- titleStyle={chatTextStyle(config?.typography?.profile?.screenTitle)}
675
- menu={<ProfileMenu items={menuItems} />}
676
- />
485
+ </BorderedContainer>
486
+ )}
487
+ </CenterContainer>
677
488
 
678
489
  <DeleteChatModal
679
- isModalOpen={isDeleteOpen}
680
- setIsModalOpen={setIsDeleteOpen}
681
- />
682
- <ReportChatModal
683
- visible={isReportOpen}
684
- onClose={() => setIsReportOpen(false)}
490
+ isModalOpen={isModalOpen}
491
+ setIsModalOpen={setIsModalOpen}
685
492
  />
686
493
  </ModalContainerFullScreen>
687
494
  );
688
495
  };
689
496
 
690
- const styles = StyleSheet.create({
691
- screen: {
692
- position: 'relative',
693
- backgroundColor: '#F2F3F5',
694
- },
695
- scroll: {
696
- width: '100%',
697
- flex: 1,
698
- },
699
- scrollContent: {
700
- paddingBottom: 32,
701
- },
702
- body: {
703
- padding: 12,
704
- gap: 12,
705
- },
706
- card: {
707
- backgroundColor: '#FFFFFF',
708
- borderRadius: 14,
709
- padding: 16,
710
- shadowColor: '#000',
711
- shadowOffset: { width: 0, height: 1 },
712
- shadowOpacity: 0.05,
713
- shadowRadius: 4,
714
- elevation: 1,
715
- },
716
- cardLabel: {
717
- color: '#8C8C8C',
718
- fontSize: 14,
719
- },
720
- cardValue: {
721
- color: '#141414',
722
- fontSize: 16,
723
- marginTop: 4,
724
- },
725
- addMembersRow: {
726
- flexDirection: 'row',
727
- alignItems: 'center',
728
- gap: 12,
729
- paddingBottom: 14,
730
- marginBottom: 10,
731
- borderBottomWidth: StyleSheet.hairlineWidth,
732
- borderBottomColor: '#EFEFF2',
733
- },
734
- addMembersLabel: {
735
- fontSize: 16,
736
- fontWeight: '500',
737
- color: '#141414',
738
- },
739
- searchRow: {
740
- flexDirection: 'row',
741
- alignItems: 'center',
742
- gap: 8,
743
- marginTop: 10,
744
- paddingHorizontal: 12,
745
- height: 40,
746
- borderRadius: 12,
747
- backgroundColor: '#F2F3F5',
748
- },
749
- searchInput: {
750
- flex: 1,
751
- fontSize: 15,
752
- color: '#141414',
753
- padding: 0,
754
- },
755
- searchClose: {
756
- fontSize: 22,
757
- lineHeight: 24,
758
- color: '#8C8C8C',
759
- },
760
- emptyMembers: {
761
- opacity: 0.6,
762
- textAlign: 'center',
763
- paddingVertical: 8,
764
- color: '#141414',
765
- },
766
- memberRow: {
767
- flexDirection: 'row',
768
- alignItems: 'center',
769
- paddingVertical: 10,
770
- },
771
- memberDivider: {
772
- borderTopWidth: StyleSheet.hairlineWidth,
773
- borderTopColor: '#EFEFF2',
774
- },
775
- memberMain: {
776
- flex: 1,
777
- flexDirection: 'row',
778
- alignItems: 'center',
779
- gap: 12,
780
- },
781
- memberText: {
782
- flex: 1,
783
- },
784
- memberName: {
785
- fontSize: 16,
786
- fontWeight: '600',
787
- color: '#141414',
788
- },
789
- memberStatus: {
790
- fontSize: 13,
791
- color: '#8C8C8C',
792
- marginTop: 2,
793
- },
794
- memberRole: {
795
- fontSize: 13,
796
- color: '#8C8C8C',
797
- marginLeft: 8,
798
- },
799
- memberBanned: {
800
- color: '#E53935',
801
- },
802
- memberRemove: {
803
- marginLeft: 12,
804
- },
805
- menuButton: {
806
- width: 40,
807
- height: 40,
808
- borderRadius: 20,
809
- backgroundColor: 'rgba(0,0,0,0.28)',
810
- alignItems: 'center',
811
- justifyContent: 'center',
812
- },
813
- });
814
-
815
497
  export default ChatProfileModal;