@ethora/chat-component-rn 26.7.5 → 26.7.7

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