@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
@@ -13,8 +13,8 @@ import {
13
13
  FlatList,
14
14
  Pressable,
15
15
  Animated,
16
- Text,
17
- TouchableOpacity,
16
+ NativeScrollEvent,
17
+ NativeSyntheticEvent,
18
18
  } from 'react-native';
19
19
  import { IRoom } from '../../types/types';
20
20
  import { SearchInput } from '../InputComponents/Search';
@@ -35,6 +35,42 @@ interface RoomListProps {
35
35
  onRoomClick?: (chat: IRoom) => void;
36
36
  }
37
37
 
38
+ /** Page ground behind the room list, the search field and the header's
39
+ * rounded bottom corners. */
40
+ const LIST_BACKGROUND = '#E8EDF2';
41
+
42
+ /** A release that leaves the search strip in between is settled by
43
+ * scrolling to whichever end is nearer; this delay lets the platform tell
44
+ * us first whether the finger threw the list (momentum) or just let go. */
45
+ const SNAP_SETTLE_DELAY = 60;
46
+
47
+ const COLLAPSED_SCALE = 0.86;
48
+
49
+ const SEARCH_REST_GAP = 16;
50
+
51
+ export const searchRevealStyle = (
52
+ scrollY: Animated.Value,
53
+ hiddenOffset: number
54
+ ) => {
55
+ const travel = Math.max(hiddenOffset, 1);
56
+ return {
57
+ opacity: scrollY.interpolate({
58
+ inputRange: [0, travel * 0.85],
59
+ outputRange: [1, 0],
60
+ extrapolate: 'clamp' as const,
61
+ }),
62
+ transform: [
63
+ {
64
+ scale: scrollY.interpolate({
65
+ inputRange: [0, travel],
66
+ outputRange: [1, COLLAPSED_SCALE],
67
+ extrapolate: 'clamp' as const,
68
+ }),
69
+ },
70
+ ],
71
+ };
72
+ };
73
+
38
74
  const RoomList: React.FC<RoomListProps> = ({
39
75
  chats,
40
76
  burgerMenu = false,
@@ -47,9 +83,12 @@ const RoomList: React.FC<RoomListProps> = ({
47
83
  const [searchTerm, setSearchTerm] = useState('');
48
84
  const [isLongPress, setIsLongPress] = useState(false);
49
85
  const [isDrawerOpen, setDrawerOpen] = useState(false);
86
+ const [isSearchFocused, setSearchFocused] = useState(false);
50
87
 
51
88
  const pressTimer = useRef<NodeJS.Timeout | null>(null);
52
89
  const containerRef = useRef<View>(null);
90
+ const listRef = useRef<FlatList<IRoom> | null>(null);
91
+ const scrollY = useRef(new Animated.Value(0)).current;
53
92
 
54
93
  const drawerAnimation = useRef(new Animated.Value(0)).current;
55
94
  const overlayAnimation = useRef(new Animated.Value(0)).current;
@@ -120,6 +159,124 @@ const RoomList: React.FC<RoomListProps> = ({
120
159
  }
121
160
  }, [burgerMenu]);
122
161
 
162
+ // The search field is the list's own header rather than a bar pinned
163
+ // above it: it lives in the scrollable content, so the list opens
164
+ // already scrolled past it (rooms first, no search in sight) and
165
+ // dragging the content down brings it back with the finger — the way
166
+ // Telegram's chat list behaves. A pinned bar could not do this on
167
+ // Android, where a list sitting at offset 0 has nothing left to drag.
168
+ const searchBarHeight = useRef(0);
169
+ const [measuredBarHeight, setMeasuredBarHeight] = useState(0);
170
+ const listHeight = useRef(0);
171
+ const contentHeight = useRef(0);
172
+ /** The list starts hidden-search only once, and only before the user
173
+ * has touched it — chats arriving later must not yank the view. */
174
+ const didInitialHide = useRef(false);
175
+ const hasDragged = useRef(false);
176
+ const inMomentum = useRef(false);
177
+ const settleTimer = useRef<NodeJS.Timeout | null>(null);
178
+
179
+ // A search being typed in (or just focused) is never tucked away
180
+ // under the header, whichever way the list is then dragged.
181
+ const searchIsActive = useRef(false);
182
+ searchIsActive.current = isSearchFocused || searchTerm.length > 0;
183
+
184
+ /** How far the list can scroll — the strip can only be hidden fully
185
+ * when the rooms below it are tall enough to take its place. */
186
+ const maxOffset = () => contentHeight.current - listHeight.current;
187
+
188
+ const hiddenOffset = () =>
189
+ Math.max(searchBarHeight.current - SEARCH_REST_GAP, 0);
190
+
191
+ const hideSearchInitially = useCallback(() => {
192
+ if (didInitialHide.current || hasDragged.current) return;
193
+ const hidden = hiddenOffset();
194
+ if (!hidden || !listHeight.current || !contentHeight.current) return;
195
+ if (maxOffset() < hidden) return;
196
+ didInitialHide.current = true;
197
+ listRef.current?.scrollToOffset({ offset: hidden, animated: false });
198
+ }, []);
199
+
200
+ /** The magnet: a strip left half-way in or out settles to whichever
201
+ * end it is closer to. */
202
+ const snapSearch = useCallback((offset: number) => {
203
+ const hidden = hiddenOffset();
204
+ if (!hidden || maxOffset() < hidden) return;
205
+ if (offset <= 0 || offset >= hidden) return;
206
+ const hide = !searchIsActive.current && offset > hidden / 2;
207
+ listRef.current?.scrollToOffset({
208
+ offset: hide ? hidden : 0,
209
+ animated: true,
210
+ });
211
+ }, []);
212
+
213
+ const clearSettleTimer = () => {
214
+ if (settleTimer.current) {
215
+ clearTimeout(settleTimer.current);
216
+ settleTimer.current = null;
217
+ }
218
+ };
219
+
220
+ useEffect(() => clearSettleTimer, []);
221
+
222
+ const handleScroll = useMemo(
223
+ () =>
224
+ Animated.event([{ nativeEvent: { contentOffset: { y: scrollY } } }], {
225
+ useNativeDriver: true,
226
+ }),
227
+ [scrollY]
228
+ );
229
+
230
+ const revealStyle = useMemo(
231
+ () =>
232
+ searchRevealStyle(
233
+ scrollY,
234
+ Math.max(measuredBarHeight - SEARCH_REST_GAP, 0)
235
+ ),
236
+ [scrollY, measuredBarHeight]
237
+ );
238
+
239
+ const handleScrollBeginDrag = useCallback(() => {
240
+ hasDragged.current = true;
241
+ clearSettleTimer();
242
+ }, []);
243
+
244
+ const handleScrollEndDrag = useCallback(
245
+ (e: NativeSyntheticEvent<NativeScrollEvent>) => {
246
+ const offset = e.nativeEvent.contentOffset.y;
247
+ inMomentum.current = false;
248
+ clearSettleTimer();
249
+ // A flick keeps scrolling after the release; snapping now would
250
+ // fight it, so wait a beat and let momentum claim the gesture.
251
+ settleTimer.current = setTimeout(() => {
252
+ settleTimer.current = null;
253
+ if (!inMomentum.current) snapSearch(offset);
254
+ }, SNAP_SETTLE_DELAY);
255
+ },
256
+ [snapSearch]
257
+ );
258
+
259
+ const handleMomentumBegin = useCallback(() => {
260
+ inMomentum.current = true;
261
+ clearSettleTimer();
262
+ }, []);
263
+
264
+ const handleMomentumEnd = useCallback(
265
+ (e: NativeSyntheticEvent<NativeScrollEvent>) => {
266
+ inMomentum.current = false;
267
+ snapSearch(e.nativeEvent.contentOffset.y);
268
+ },
269
+ [snapSearch]
270
+ );
271
+
272
+ // Tapping the field pulls it fully into view even if it was caught
273
+ // half-way, so the caret never sits under the header.
274
+ useEffect(() => {
275
+ if (isSearchFocused) {
276
+ listRef.current?.scrollToOffset({ offset: 0, animated: true });
277
+ }
278
+ }, [isSearchFocused]);
279
+
123
280
  const toggleDrawer = () => {
124
281
  if (isDrawerOpen) {
125
282
  closeDrawer();
@@ -157,6 +314,33 @@ const RoomList: React.FC<RoomListProps> = ({
157
314
  });
158
315
  };
159
316
 
317
+ const searchHeader = (
318
+ <View
319
+ testID="room-list-search"
320
+ style={styles.searchBar}
321
+ onLayout={(e) => {
322
+ const height = e.nativeEvent.layout.height;
323
+ searchBarHeight.current = height;
324
+ setMeasuredBarHeight((prev) => (prev === height ? prev : height));
325
+ hideSearchInitially();
326
+ }}
327
+ >
328
+ <Animated.View
329
+ testID="room-list-search-field"
330
+ style={[styles.searchField, revealStyle]}
331
+ >
332
+ <SearchInput
333
+ icon={<SearchIcon height={20} />}
334
+ value={searchTerm}
335
+ onChangeText={handleSearchChange}
336
+ onFocus={() => setSearchFocused(true)}
337
+ onBlur={() => setSearchFocused(false)}
338
+ placeholder={t('search.placeholder')}
339
+ />
340
+ </Animated.View>
341
+ </View>
342
+ );
343
+
160
344
  return (
161
345
  <>
162
346
  {burgerMenu && !open && (
@@ -180,39 +364,46 @@ const RoomList: React.FC<RoomListProps> = ({
180
364
  <>
181
365
  <View style={styles.scrollContainer}>
182
366
  <HeaderRoomList setDrawerOpen={toggleDrawer} />
183
- {/* Search sits ABOVE the list rather than in its
184
- ListHeaderComponent. As a list header it was simply the
185
- first scrolling row, so the moment you scrolled the rooms
186
- it slid up and disappeared behind the opaque header band.
187
- Fixed here it stays reachable, which is the entire point
188
- of a search field over a long list. */}
189
- <View style={styles.searchBar}>
190
- <SearchInput
191
- icon={<SearchIcon height={20} />}
192
- value={searchTerm}
193
- onChangeText={handleSearchChange}
194
- placeholder={t('search.placeholder')}
367
+ <View style={styles.listArea}>
368
+ {/* Animated.FlatList, so the reveal runs on the native
369
+ thread off the very same scroll it follows. */}
370
+ <Animated.FlatList
371
+ ref={listRef}
372
+ data={filteredChats}
373
+ keyExtractor={(item) => item.jid}
374
+ ListHeaderComponent={searchHeader}
375
+ onLayout={(e) => {
376
+ listHeight.current = e.nativeEvent.layout.height;
377
+ hideSearchInitially();
378
+ }}
379
+ onContentSizeChange={(_w, h) => {
380
+ contentHeight.current = h;
381
+ hideSearchInitially();
382
+ }}
383
+ onScroll={handleScroll}
384
+ scrollEventThrottle={16}
385
+ onScrollBeginDrag={handleScrollBeginDrag}
386
+ onScrollEndDrag={handleScrollEndDrag}
387
+ onMomentumScrollBegin={handleMomentumBegin}
388
+ onMomentumScrollEnd={handleMomentumEnd}
389
+ keyboardShouldPersistTaps="handled"
390
+ renderItem={({ item }) => (
391
+ <Pressable
392
+ // Stable testID so e2e drivers can target a room
393
+ // row by its jid local-part (e.g. Main chat under
394
+ // app id `..._...759` → testID `room-...759`).
395
+ testID={`room-${(item.jid || '').split('@')[0]}`}
396
+ accessibilityLabel={`room-${item.title || item.name}`}
397
+ onPress={() => performClick(item)}
398
+ onPressIn={handlePressIn}
399
+ onPressOut={handlePressOut}
400
+ >
401
+ <ChatRoomItem chat={item} config={config} />
402
+ </Pressable>
403
+ )}
404
+ style={styles.chatList}
195
405
  />
196
406
  </View>
197
- <FlatList
198
- data={filteredChats}
199
- keyExtractor={(item) => item.jid}
200
- renderItem={({ item }) => (
201
- <Pressable
202
- // Stable testID so e2e drivers can target a room
203
- // row by its jid local-part (e.g. Main chat under
204
- // app id `..._...759` → testID `room-...759`).
205
- testID={`room-${(item.jid || '').split('@')[0]}`}
206
- accessibilityLabel={`room-${item.title || item.name}`}
207
- onPress={() => performClick(item)}
208
- onPressIn={handlePressIn}
209
- onPressOut={handlePressOut}
210
- >
211
- <ChatRoomItem chat={item} config={config} />
212
- </Pressable>
213
- )}
214
- style={styles.chatList}
215
- />
216
407
 
217
408
  <HeaderRoomListMenu
218
409
  closeDrawer={closeDrawer}
@@ -238,7 +429,7 @@ const styles = StyleSheet.create({
238
429
  width: '100%',
239
430
  height: '100%',
240
431
  flex: 1,
241
- backgroundColor: '#fff',
432
+ backgroundColor: LIST_BACKGROUND,
242
433
  },
243
434
  scrollContainer: {
244
435
  flexGrow: 1,
@@ -249,21 +440,27 @@ const styles = StyleSheet.create({
249
440
  padding: 16,
250
441
  justifyContent: 'space-between',
251
442
  },
443
+ listArea: {
444
+ flex: 1,
445
+ },
252
446
  searchBar: {
447
+ paddingBottom: 4,
253
448
  // `row` matters: SearchInputWrapper is `flex: 1` plus a fixed 44px
254
449
  // height. In a column parent that flex resolves VERTICALLY against a
255
450
  // parent with no height of its own and collapses the field to nothing
256
- // but its magnifier. As a row it resolves to width, which is what it
257
- // meant back when the field was a list-header child.
451
+ // but its magnifier. As a row it resolves to width.
258
452
  flexDirection: 'row',
259
453
  paddingTop: 8,
260
- paddingHorizontal: 16,
261
- backgroundColor: '#FAFAFA',
454
+ backgroundColor: 'transparent',
455
+ },
456
+ searchField: {
457
+ flexDirection: 'row',
458
+ flex: 1,
262
459
  },
263
460
  chatList: {
264
461
  flex: 1,
265
462
  paddingHorizontal: 16,
266
- backgroundColor: '#FAFAFA',
463
+ backgroundColor: LIST_BACKGROUND,
267
464
  },
268
465
  });
269
466