@ethora/chat-component-rn 26.8.1 → 26.8.2

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