@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,20 +1,24 @@
1
- import React, { useState, useEffect, useMemo } from 'react';
2
- import Button from '../../styled/Button';
3
- import { AddNewIcon, AddPhotoIcon } from '../../../assets/icons';
1
+ import React, { useState, useMemo } from 'react';
2
+ import { CameraIcon } from '../../../assets/icons';
4
3
  import { RootState } from '../../../roomStore';
5
4
  import { useXmppClient } from '../../../context/xmppProvider';
6
- import {
7
- CloseButton,
8
- GroupContainer,
9
- ModalBackground,
10
- ModalContainer,
11
- ModalTitle,
12
- } from '../styledModalComponents';
13
5
  import { addRoomViaApi, setCurrentRoom, updateRoom } from '../../../roomStore/roomsSlice';
14
- import InputWithLabel from '../../styled/StyledInput';
15
6
  import { uploadFile } from '../../../networking/api-requests/auth.api';
16
- import { ProfileImagePlaceholder } from '../../MainComponents/ProfileImagePlaceholder';
17
- import { Text, Alert, Linking } from 'react-native';
7
+ import {
8
+ ActivityIndicator,
9
+ Alert,
10
+ Image,
11
+ Linking,
12
+ Modal,
13
+ Pressable,
14
+ StyleSheet,
15
+ Text,
16
+ TextInput,
17
+ TouchableOpacity,
18
+ View,
19
+ } from 'react-native';
20
+ import { getIconColor } from '../../../helpers/getIconColor';
21
+ import { useT } from '../../../i18n/useT';
18
22
  import * as ImagePicker from 'expo-image-picker';
19
23
  import { ApiRoom, ChatAccessOption, RoomMember } from '../../../types/models/room.model';
20
24
  import { createRoomFromApi } from '../../../helpers/createRoomFromApi';
@@ -24,16 +28,16 @@ import { useChatSettingState } from '../../../hooks/useChatSettingState';
24
28
  import { useToast } from '../../../context/ToastContext';
25
29
 
26
30
  interface NewChatModalProps {
27
- handleCloseModal?: any;
31
+ handleCloseModal?: () => void;
28
32
  }
29
33
 
30
34
  const NewChatModal: React.FC<NewChatModalProps> = ({
31
35
  // Some call sites mount `<NewChatModal />` with no props (e.g. the
32
- // empty-state in ChatRoom when roomsList is empty). Default to a noop
33
- // so the Close/Cancel buttons don't throw "handleClose is not a
34
- // function".
35
- handleCloseModal: handleClose = () => {},
36
+ // empty-state in ChatRoom when roomsList is empty). There is nothing to
37
+ // dismiss back to there, so Cancel just resets the form.
38
+ handleCloseModal: handleClose,
36
39
  }) => {
40
+ const t = useT();
37
41
  const config = useAppSelector(
38
42
  (state: RootState) => state.chatSettingStore.config
39
43
  );
@@ -43,9 +47,7 @@ const NewChatModal: React.FC<NewChatModalProps> = ({
43
47
  const { user } = useChatSettingState();
44
48
  const { showToast } = useToast();
45
49
 
46
- const [isModalOpen, setIsModalOpen] = useState<boolean>(false);
47
50
  const [loading, setLoading] = useState<boolean>(false);
48
- const [activeTab, setActiveTab] = useState<'0' | '1' | null>('0');
49
51
 
50
52
  const [roomName, setRoomName] = useState<string>('');
51
53
  const [roomDescription, setRoomDescription] = useState<string>('');
@@ -65,7 +67,7 @@ const NewChatModal: React.FC<NewChatModalProps> = ({
65
67
 
66
68
  const validateRoomName = (name: string) => {
67
69
  if (name.trim().length < 3) {
68
- return 'Room name must be at least 3 characters.';
70
+ return t('modal.newChat.nameTooShort');
69
71
  }
70
72
  return '';
71
73
  };
@@ -97,13 +99,17 @@ const NewChatModal: React.FC<NewChatModalProps> = ({
97
99
  }));
98
100
  };
99
101
 
100
- const handleOpenModal = () => setIsModalOpen(true);
101
- const handleCloseModal = () => {
102
- handleClose();
103
- setActiveTab('0');
104
- setIsModalOpen(false);
102
+ const resetForm = () => {
105
103
  setRoomName('');
104
+ setRoomDescription('');
105
+ setProfileImage(null);
106
106
  setSelectedUsers([]);
107
+ setErrors({ name: '', description: '' });
108
+ };
109
+
110
+ const handleCloseModal = () => {
111
+ resetForm();
112
+ handleClose?.();
107
113
  };
108
114
 
109
115
  const onUpload = async () => {
@@ -129,7 +135,7 @@ const NewChatModal: React.FC<NewChatModalProps> = ({
129
135
  quality: 0.8,
130
136
  });
131
137
 
132
- if (result.canceled) return;
138
+ if (result.canceled) {return;}
133
139
 
134
140
  const asset = result.assets[0];
135
141
  const originalName = asset.uri.split('/').pop();
@@ -161,7 +167,7 @@ const NewChatModal: React.FC<NewChatModalProps> = ({
161
167
  usersArrayLength
162
168
  );
163
169
 
164
- if (!normalizedChat || !client) return;
170
+ if (!normalizedChat || !client) {return;}
165
171
 
166
172
  dispatch(
167
173
  addRoomViaApi({
@@ -261,103 +267,199 @@ const NewChatModal: React.FC<NewChatModalProps> = ({
261
267
  }
262
268
  }
263
269
 
264
- setIsModalOpen(false);
265
- setErrors({ name: '', description: '' });
266
- setProfileImage(null);
267
- setRoomName('');
268
- setRoomDescription('');
270
+ resetForm();
269
271
  setLoading(false);
270
272
  }
271
273
  };
272
274
 
275
+ const primary = getIconColor(config);
276
+ const pickedUri =
277
+ profileImage && typeof profileImage === 'object' && 'uri' in profileImage
278
+ ? profileImage.uri
279
+ : typeof profileImage === 'string'
280
+ ? profileImage
281
+ : null;
282
+
273
283
  return (
274
- <>
275
- {/* <Button
276
- style={{
277
- padding: 8,
278
- borderRadius: 16,
279
- backgroundColor: "transparent",
280
- }}
281
- color="black"
282
- unstyled
283
- EndIcon={<AddNewIcon color={config?.colors?.primary} />}
284
- onPress={handleOpenModal}
285
- /> */}
286
-
287
- <ModalBackground
288
- // visible={isModalOpen}
289
- // transparent={true}
290
- // animationType="fade"
291
- // onRequestClose={handleCloseModal}
292
- >
293
- <ModalContainer>
294
- <CloseButton onPress={handleCloseModal}>
295
- <Text style={{ fontSize: 24, padding: 5 }}>&times;</Text>
296
- </CloseButton>
297
- <ModalTitle>Create New Chat</ModalTitle>
298
- <ProfileImagePlaceholder
299
- size={120}
300
- upload={{ active: true, onUpload }}
301
- remove={{ enabled: true, onRemoveClick }}
302
- placeholderIcon={<AddPhotoIcon color="#0052CD" />}
303
- icon={
304
- profileImage && typeof profileImage === 'object' && 'uri' in profileImage
305
- ? { uri: profileImage.uri }
306
- : profileImage
307
- }
308
- disableOverlay={!profileImage}
309
- role="user"
310
- />
311
- <GroupContainer
312
- style={{
313
- flexDirection: 'column',
314
- position: 'relative',
315
- width: '100%',
316
- }}
284
+ // A real <Modal> rather than an in-tree overlay: the SDK renders inside
285
+ // whatever frame the host gives it, so an in-tree backdrop stopped at
286
+ // the component's edge and left the host's own chrome (tab bars and
287
+ // such) lit. This one dims the whole window.
288
+ <Modal
289
+ transparent
290
+ visible
291
+ animationType="fade"
292
+ statusBarTranslucent
293
+ onRequestClose={handleCloseModal}
294
+ >
295
+ <View style={styles.backdrop}>
296
+ <Pressable
297
+ testID="new-chat-backdrop"
298
+ style={StyleSheet.absoluteFill}
299
+ onPress={handleCloseModal}
300
+ />
301
+ <View style={styles.card}>
302
+ <Text style={styles.title}>{t('modal.newChat.title')}</Text>
303
+
304
+ <TouchableOpacity
305
+ testID="new-chat-picture"
306
+ activeOpacity={0.8}
307
+ onPress={onUpload}
308
+ onLongPress={pickedUri ? onRemoveClick : undefined}
309
+ style={[styles.picture, { backgroundColor: primary }]}
317
310
  >
318
- <InputWithLabel
319
- color="#F5F7F9"
320
- id="roomName"
321
- value={roomName}
322
- onChangeText={handleRoomNameChange}
323
- placeholder="Enter Room Name"
324
- helperText={errors.name}
325
- error={!!errors.name}
326
- />
327
- <InputWithLabel
328
- color="#F5F7F9"
329
- id="roomDescription"
330
- value={roomDescription}
331
- onChangeText={handleRoomDescriptionChange}
332
- placeholder="Enter Description"
333
- helperText={errors.description}
334
- error={!!errors.description}
335
- />
336
- </GroupContainer>
337
-
338
- <GroupContainer>
339
- <Button
340
- onPress={handleCreateRoom}
341
- text={'Create'}
342
- style={{ width: '100%' }}
343
- unstyled
344
- variant="filled"
345
- disabled={!isValid}
346
- color="#fff"
347
- />
348
- <Button
311
+ {pickedUri ? (
312
+ <Image source={{ uri: pickedUri }} style={styles.pictureImage} />
313
+ ) : (
314
+ <CameraIcon color="#FFFFFF" width={26} height={26} />
315
+ )}
316
+ </TouchableOpacity>
317
+
318
+ <TextInput
319
+ testID="new-chat-name"
320
+ style={styles.input}
321
+ value={roomName}
322
+ onChangeText={handleRoomNameChange}
323
+ placeholder={t('modal.newChat.roomNamePlaceholder')}
324
+ placeholderTextColor="#8C8C8C"
325
+ returnKeyType="next"
326
+ />
327
+ {!!errors.name && roomName.length > 0 && (
328
+ <Text testID="new-chat-name-error" style={styles.error}>
329
+ {errors.name}
330
+ </Text>
331
+ )}
332
+
333
+ <TextInput
334
+ testID="new-chat-description"
335
+ style={[styles.input, styles.textArea]}
336
+ value={roomDescription}
337
+ onChangeText={handleRoomDescriptionChange}
338
+ placeholder={t('modal.newChat.descriptionPlaceholder')}
339
+ placeholderTextColor="#8C8C8C"
340
+ multiline
341
+ />
342
+
343
+ <View style={styles.buttons}>
344
+ <TouchableOpacity
345
+ testID="new-chat-cancel"
346
+ activeOpacity={0.7}
347
+ style={[styles.button, styles.cancel]}
349
348
  onPress={handleCloseModal}
350
- text={'Cancel'}
351
- style={{ width: '100%' }}
352
- unstyled
353
- variant="outlined"
354
- color="#0052CD"
355
- />
356
- </GroupContainer>
357
- </ModalContainer>
358
- </ModalBackground>
359
- </>
349
+ >
350
+ <Text style={styles.cancelLabel}>{t('action.cancel')}</Text>
351
+ </TouchableOpacity>
352
+ <TouchableOpacity
353
+ testID="new-chat-submit"
354
+ activeOpacity={0.7}
355
+ disabled={!isValid || loading}
356
+ style={[
357
+ styles.button,
358
+ { backgroundColor: primary, opacity: !isValid || loading ? 0.5 : 1 },
359
+ ]}
360
+ onPress={handleCreateRoom}
361
+ >
362
+ {loading ? (
363
+ <ActivityIndicator color="#FFFFFF" />
364
+ ) : (
365
+ <Text style={styles.submitLabel}>
366
+ {t('modal.newChat.createButton')}
367
+ </Text>
368
+ )}
369
+ </TouchableOpacity>
370
+ </View>
371
+ </View>
372
+ </View>
373
+ </Modal>
360
374
  );
361
375
  };
362
376
 
377
+ const styles = StyleSheet.create({
378
+ backdrop: {
379
+ flex: 1,
380
+ // Opaque, per the design: the chat list behind stays hidden rather
381
+ // than showing through a translucent dim.
382
+ backgroundColor: '#E9EDF2',
383
+ alignItems: 'center',
384
+ justifyContent: 'center',
385
+ padding: 24,
386
+ },
387
+ card: {
388
+ width: '100%',
389
+ maxWidth: 380,
390
+ borderRadius: 20,
391
+ backgroundColor: '#FFFFFF',
392
+ padding: 20,
393
+ shadowColor: '#121219',
394
+ shadowOffset: { width: 0, height: 8 },
395
+ shadowOpacity: 0.08,
396
+ shadowRadius: 24,
397
+ elevation: 6,
398
+ },
399
+ title: {
400
+ fontSize: 17,
401
+ fontWeight: '700',
402
+ color: '#141414',
403
+ textAlign: 'center',
404
+ },
405
+ picture: {
406
+ alignSelf: 'center',
407
+ width: 72,
408
+ height: 72,
409
+ borderRadius: 36,
410
+ marginVertical: 18,
411
+ alignItems: 'center',
412
+ justifyContent: 'center',
413
+ overflow: 'hidden',
414
+ },
415
+ pictureImage: {
416
+ width: '100%',
417
+ height: '100%',
418
+ },
419
+ input: {
420
+ borderRadius: 12,
421
+ backgroundColor: '#F4F5F7',
422
+ paddingHorizontal: 14,
423
+ paddingVertical: 12,
424
+ fontSize: 15,
425
+ color: '#141414',
426
+ marginTop: 10,
427
+ },
428
+ textArea: {
429
+ minHeight: 84,
430
+ textAlignVertical: 'top',
431
+ },
432
+ error: {
433
+ color: '#E53935',
434
+ fontSize: 12,
435
+ marginTop: 6,
436
+ marginLeft: 4,
437
+ },
438
+ buttons: {
439
+ flexDirection: 'row',
440
+ gap: 12,
441
+ marginTop: 20,
442
+ },
443
+ button: {
444
+ flex: 1,
445
+ height: 44,
446
+ borderRadius: 12,
447
+ alignItems: 'center',
448
+ justifyContent: 'center',
449
+ },
450
+ cancel: {
451
+ backgroundColor: '#E7E8EA',
452
+ },
453
+ cancelLabel: {
454
+ fontSize: 15,
455
+ fontWeight: '500',
456
+ color: '#8C8C8C',
457
+ },
458
+ submitLabel: {
459
+ fontSize: 15,
460
+ fontWeight: '600',
461
+ color: '#FFFFFF',
462
+ },
463
+ });
464
+
363
465
  export default NewChatModal;
@@ -1,4 +1,5 @@
1
1
  import React, { useState, useMemo } from 'react';
2
+ import { pickImageAsset, PickedImage } from '../../../helpers/pickImageAsset';
2
3
  import Button from '../../styled/Button';
3
4
  import { AddNewIcon } from '../../../assets/icons';
4
5
  import { useDispatch, useSelector } from 'react-redux';
@@ -29,7 +30,16 @@ const NewChatModal: React.FC = () => {
29
30
  name: 'Public',
30
31
  id: 'public',
31
32
  });
32
- const [profileImage, setProfileImage] = useState<string | File | null>(null);
33
+ const [profileImage, setProfileImage] = useState<
34
+ string | PickedImage | null
35
+ >(null);
36
+
37
+ const handleUploadImage = async () => {
38
+ const picked = await pickImageAsset();
39
+ if (picked) {
40
+ setProfileImage(picked);
41
+ }
42
+ };
33
43
  const [errors, setErrors] = useState({ name: '', description: '' });
34
44
  const [selectedUsers, setSelectedUsers] = useState<RoomMember[]>([]);
35
45
 
@@ -119,6 +129,7 @@ const NewChatModal: React.FC = () => {
119
129
  setRoomDescription={setRoomDescription}
120
130
  setChatType={setChatType}
121
131
  setProfileImage={setProfileImage}
132
+ onUploadImage={handleUploadImage}
122
133
  selectedUsers={selectedUsers}
123
134
  setSelectedUsers={setSelectedUsers}
124
135
  handleCreateRoom={handleCreateRoom}