@ethora/chat-component-rn 26.7.9 → 26.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (652) hide show
  1. package/CHANGELOG.md +0 -93
  2. package/README.md +10 -33
  3. package/lib/commonjs/assets/icons.js +2 -7
  4. package/lib/commonjs/assets/icons.js.map +1 -1
  5. package/lib/commonjs/components/AuthForms/Login.js +4 -4
  6. package/lib/commonjs/components/AuthForms/Login.js.map +1 -1
  7. package/lib/commonjs/components/Header/HeaderRoomList.js +7 -26
  8. package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
  9. package/lib/commonjs/components/MainComponents/ChatHeader.js +3 -9
  10. package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
  11. package/lib/commonjs/components/MainComponents/ChatRoom.js +13 -101
  12. package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
  13. package/lib/commonjs/components/MainComponents/ChatWrapper.js +38 -34
  14. package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
  15. package/lib/commonjs/components/MainComponents/LoginWrapper.js +1 -2
  16. package/lib/commonjs/components/MainComponents/LoginWrapper.js.map +1 -1
  17. package/lib/commonjs/components/MainComponents/MediaMessage.js +9 -29
  18. package/lib/commonjs/components/MainComponents/MediaMessage.js.map +1 -1
  19. package/lib/commonjs/components/MainComponents/MessageContainer.js +1 -5
  20. package/lib/commonjs/components/MainComponents/MessageContainer.js.map +1 -1
  21. package/lib/commonjs/components/MainComponents/MessageList.js +5 -13
  22. package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
  23. package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js +13 -14
  24. package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
  25. package/lib/commonjs/components/MainComponents/ReduxWrapper.js +24 -3
  26. package/lib/commonjs/components/MainComponents/ReduxWrapper.js.map +1 -1
  27. package/lib/commonjs/components/MainComponents/RoomList.js +35 -208
  28. package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
  29. package/lib/commonjs/components/Menu/HeaderRoomListMenu.js +98 -317
  30. package/lib/commonjs/components/Menu/HeaderRoomListMenu.js.map +1 -1
  31. package/lib/commonjs/components/MessageBubble/MessageTranslate.js +16 -7
  32. package/lib/commonjs/components/MessageBubble/MessageTranslate.js.map +1 -1
  33. package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js +112 -320
  34. package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
  35. package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +215 -556
  36. package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
  37. package/lib/commonjs/components/Modals/ChatProfileModal/DeleteChatModal.js +9 -7
  38. package/lib/commonjs/components/Modals/ChatProfileModal/DeleteChatModal.js.map +1 -1
  39. package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +27 -69
  40. package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
  41. package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js +1 -2
  42. package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
  43. package/lib/commonjs/components/Modals/Modal/Modal.js +0 -8
  44. package/lib/commonjs/components/Modals/Modal/Modal.js.map +1 -1
  45. package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js +1 -2
  46. package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js.map +1 -1
  47. package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js +109 -205
  48. package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
  49. package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js +0 -8
  50. package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
  51. package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js +2 -4
  52. package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
  53. package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js +21 -7
  54. package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
  55. package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +244 -507
  56. package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
  57. package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +46 -74
  58. package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
  59. package/lib/commonjs/components/Modals/styledModalComponents.js +2 -9
  60. package/lib/commonjs/components/Modals/styledModalComponents.js.map +1 -1
  61. package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +39 -23
  62. package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
  63. package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js +3 -22
  64. package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
  65. package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js +3 -17
  66. package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
  67. package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js +3 -17
  68. package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
  69. package/lib/commonjs/components/VideoCalls/VideoCallSession.js +3 -6
  70. package/lib/commonjs/components/VideoCalls/VideoCallSession.js.map +1 -1
  71. package/lib/commonjs/components/styled/AudioMessage.js +1 -2
  72. package/lib/commonjs/components/styled/AudioMessage.js.map +1 -1
  73. package/lib/commonjs/components/styled/DateLabel.js +10 -3
  74. package/lib/commonjs/components/styled/DateLabel.js.map +1 -1
  75. package/lib/commonjs/components/styled/MessageImage.js +9 -37
  76. package/lib/commonjs/components/styled/MessageImage.js.map +1 -1
  77. package/lib/commonjs/components/styled/NewMessageLabel.js +3 -1
  78. package/lib/commonjs/components/styled/NewMessageLabel.js.map +1 -1
  79. package/lib/commonjs/components/styled/SendInput.js +17 -86
  80. package/lib/commonjs/components/styled/SendInput.js.map +1 -1
  81. package/lib/commonjs/components/styled/StyledComponents.js +3 -9
  82. package/lib/commonjs/components/styled/StyledComponents.js.map +1 -1
  83. package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js +4 -11
  84. package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
  85. package/lib/commonjs/components/styled/UnsupportedType.js +4 -14
  86. package/lib/commonjs/components/styled/UnsupportedType.js.map +1 -1
  87. package/lib/commonjs/components/styled/VideoMessage.js +61 -119
  88. package/lib/commonjs/components/styled/VideoMessage.js.map +1 -1
  89. package/lib/commonjs/context/xmppProvider.js +54 -128
  90. package/lib/commonjs/context/xmppProvider.js.map +1 -1
  91. package/lib/commonjs/helpers/createMessageFromXml.js +1 -19
  92. package/lib/commonjs/helpers/createMessageFromXml.js.map +1 -1
  93. package/lib/commonjs/helpers/ensureScopedChatCache.js +2 -2
  94. package/lib/commonjs/helpers/ensureScopedChatCache.js.map +1 -1
  95. package/lib/commonjs/helpers/getDataFromXml.js +24 -1
  96. package/lib/commonjs/helpers/getDataFromXml.js.map +1 -1
  97. package/lib/commonjs/helpers/historyPreloadScheduler.js +2 -65
  98. package/lib/commonjs/helpers/historyPreloadScheduler.js.map +1 -1
  99. package/lib/commonjs/helpers/initXmppRooms.js +8 -14
  100. package/lib/commonjs/helpers/initXmppRooms.js.map +1 -1
  101. package/lib/commonjs/helpers/insertMessageWithDelimiter.js +13 -0
  102. package/lib/commonjs/helpers/insertMessageWithDelimiter.js.map +1 -1
  103. package/lib/commonjs/helpers/isUnresolvedSenderId.js +6 -1
  104. package/lib/commonjs/helpers/isUnresolvedSenderId.js.map +1 -1
  105. package/lib/commonjs/helpers/mimeToExtension.js +14 -6
  106. package/lib/commonjs/helpers/mimeToExtension.js.map +1 -1
  107. package/lib/commonjs/helpers/resolveInitBeforeLoadUser.js +17 -130
  108. package/lib/commonjs/helpers/resolveInitBeforeLoadUser.js.map +1 -1
  109. package/lib/commonjs/helpers/resolveLangSource.js +38 -0
  110. package/lib/commonjs/helpers/resolveLangSource.js.map +1 -0
  111. package/lib/commonjs/helpers/xmppUsername.js +39 -0
  112. package/lib/commonjs/helpers/xmppUsername.js.map +1 -0
  113. package/lib/commonjs/hooks/useChatRoomFocus.js +8 -17
  114. package/lib/commonjs/hooks/useChatRoomFocus.js.map +1 -1
  115. package/lib/commonjs/hooks/useChatWrapperInit.js +14 -32
  116. package/lib/commonjs/hooks/useChatWrapperInit.js.map +1 -1
  117. package/lib/commonjs/hooks/useComposing.js +0 -27
  118. package/lib/commonjs/hooks/useComposing.js.map +1 -1
  119. package/lib/commonjs/hooks/useLogout.js +7 -15
  120. package/lib/commonjs/hooks/useLogout.js.map +1 -1
  121. package/lib/commonjs/hooks/usePendingNotification.js +11 -8
  122. package/lib/commonjs/hooks/usePendingNotification.js.map +1 -1
  123. package/lib/commonjs/hooks/useSendMessage.js +14 -50
  124. package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
  125. package/lib/commonjs/hooks/useUnreadMessagesCounter.js +1 -6
  126. package/lib/commonjs/hooks/useUnreadMessagesCounter.js.map +1 -1
  127. package/lib/commonjs/i18n/strings.js +133 -121
  128. package/lib/commonjs/i18n/strings.js.map +1 -1
  129. package/lib/commonjs/i18n/useT.js +1 -1
  130. package/lib/commonjs/main.js +0 -44
  131. package/lib/commonjs/main.js.map +1 -1
  132. package/lib/commonjs/networking/api-requests/auth.api.js +60 -134
  133. package/lib/commonjs/networking/api-requests/auth.api.js.map +1 -1
  134. package/lib/commonjs/networking/api-requests/roomMembers.api.js +1 -1
  135. package/lib/commonjs/networking/api-requests/roomMembers.api.js.map +1 -1
  136. package/lib/commonjs/networking/api-requests/rooms.api.js +9 -9
  137. package/lib/commonjs/networking/api-requests/rooms.api.js.map +1 -1
  138. package/lib/commonjs/networking/api-requests/user.api.js +9 -68
  139. package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
  140. package/lib/commonjs/networking/apiClient.js +112 -62
  141. package/lib/commonjs/networking/apiClient.js.map +1 -1
  142. package/lib/commonjs/networking/stanzaHandlers.js +51 -93
  143. package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
  144. package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js +8 -46
  145. package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
  146. package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js +1 -8
  147. package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
  148. package/lib/commonjs/networking/xmpp/subscribeToRoomMessages.xmpp.js +1 -5
  149. package/lib/commonjs/networking/xmpp/subscribeToRoomMessages.xmpp.js.map +1 -1
  150. package/lib/commonjs/networking/xmppClient.js +8 -124
  151. package/lib/commonjs/networking/xmppClient.js.map +1 -1
  152. package/lib/commonjs/roomStore/chatSettingsSlice.js +7 -26
  153. package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
  154. package/lib/commonjs/roomStore/index.js +2 -35
  155. package/lib/commonjs/roomStore/index.js.map +1 -1
  156. package/lib/commonjs/roomStore/persistence.js +39 -226
  157. package/lib/commonjs/roomStore/persistence.js.map +1 -1
  158. package/lib/commonjs/roomStore/roomsSlice.js +8 -87
  159. package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
  160. package/lib/commonjs/services/pushSubscriptionService.js +13 -15
  161. package/lib/commonjs/services/pushSubscriptionService.js.map +1 -1
  162. package/lib/commonjs/version.js +3 -1
  163. package/lib/commonjs/version.js.map +1 -1
  164. package/lib/module/assets/icons.js +1 -6
  165. package/lib/module/assets/icons.js.map +1 -1
  166. package/lib/module/components/AuthForms/Login.js +4 -4
  167. package/lib/module/components/AuthForms/Login.js.map +1 -1
  168. package/lib/module/components/Header/HeaderRoomList.js +7 -26
  169. package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
  170. package/lib/module/components/MainComponents/ChatHeader.js +3 -9
  171. package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
  172. package/lib/module/components/MainComponents/ChatRoom.js +14 -102
  173. package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
  174. package/lib/module/components/MainComponents/ChatWrapper.js +40 -36
  175. package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
  176. package/lib/module/components/MainComponents/LoginWrapper.js +1 -2
  177. package/lib/module/components/MainComponents/LoginWrapper.js.map +1 -1
  178. package/lib/module/components/MainComponents/MediaMessage.js +10 -30
  179. package/lib/module/components/MainComponents/MediaMessage.js.map +1 -1
  180. package/lib/module/components/MainComponents/MessageContainer.js +1 -5
  181. package/lib/module/components/MainComponents/MessageContainer.js.map +1 -1
  182. package/lib/module/components/MainComponents/MessageList.js +5 -13
  183. package/lib/module/components/MainComponents/MessageList.js.map +1 -1
  184. package/lib/module/components/MainComponents/ProfileImagePlaceholder.js +13 -14
  185. package/lib/module/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
  186. package/lib/module/components/MainComponents/ReduxWrapper.js +26 -5
  187. package/lib/module/components/MainComponents/ReduxWrapper.js.map +1 -1
  188. package/lib/module/components/MainComponents/RoomList.js +35 -207
  189. package/lib/module/components/MainComponents/RoomList.js.map +1 -1
  190. package/lib/module/components/Menu/HeaderRoomListMenu.js +101 -319
  191. package/lib/module/components/Menu/HeaderRoomListMenu.js.map +1 -1
  192. package/lib/module/components/MessageBubble/MessageTranslate.js +16 -7
  193. package/lib/module/components/MessageBubble/MessageTranslate.js.map +1 -1
  194. package/lib/module/components/Modals/AttachSheet/AttachSheet.js +115 -311
  195. package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
  196. package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +219 -559
  197. package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
  198. package/lib/module/components/Modals/ChatProfileModal/DeleteChatModal.js +9 -7
  199. package/lib/module/components/Modals/ChatProfileModal/DeleteChatModal.js.map +1 -1
  200. package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +28 -70
  201. package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
  202. package/lib/module/components/Modals/FilePreviewModal/PdfView.js +1 -2
  203. package/lib/module/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
  204. package/lib/module/components/Modals/Modal/Modal.js +1 -9
  205. package/lib/module/components/Modals/Modal/Modal.js.map +1 -1
  206. package/lib/module/components/Modals/NewChatModal/ModalContent.js +1 -2
  207. package/lib/module/components/Modals/NewChatModal/ModalContent.js.map +1 -1
  208. package/lib/module/components/Modals/NewChatModal/NewChatModal.js +111 -208
  209. package/lib/module/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
  210. package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js +0 -8
  211. package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
  212. package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js +2 -4
  213. package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
  214. package/lib/module/components/Modals/UserProfileModal/EditUserModal.js +23 -9
  215. package/lib/module/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
  216. package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +248 -509
  217. package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
  218. package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +48 -76
  219. package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
  220. package/lib/module/components/Modals/styledModalComponents.js +2 -9
  221. package/lib/module/components/Modals/styledModalComponents.js.map +1 -1
  222. package/lib/module/components/RoomComponents/ChatRoomItem.js +40 -24
  223. package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
  224. package/lib/module/components/RoomComponents/styled/LastMessageFile.js +3 -22
  225. package/lib/module/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
  226. package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js +3 -17
  227. package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
  228. package/lib/module/components/RoomComponents/styled/LastMessageVideo.js +3 -17
  229. package/lib/module/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
  230. package/lib/module/components/VideoCalls/VideoCallSession.js +3 -6
  231. package/lib/module/components/VideoCalls/VideoCallSession.js.map +1 -1
  232. package/lib/module/components/styled/AudioMessage.js +1 -2
  233. package/lib/module/components/styled/AudioMessage.js.map +1 -1
  234. package/lib/module/components/styled/DateLabel.js +10 -3
  235. package/lib/module/components/styled/DateLabel.js.map +1 -1
  236. package/lib/module/components/styled/MessageImage.js +9 -37
  237. package/lib/module/components/styled/MessageImage.js.map +1 -1
  238. package/lib/module/components/styled/NewMessageLabel.js +3 -1
  239. package/lib/module/components/styled/NewMessageLabel.js.map +1 -1
  240. package/lib/module/components/styled/SendInput.js +18 -87
  241. package/lib/module/components/styled/SendInput.js.map +1 -1
  242. package/lib/module/components/styled/StyledComponents.js +3 -9
  243. package/lib/module/components/styled/StyledComponents.js.map +1 -1
  244. package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js +4 -11
  245. package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
  246. package/lib/module/components/styled/UnsupportedType.js +4 -14
  247. package/lib/module/components/styled/UnsupportedType.js.map +1 -1
  248. package/lib/module/components/styled/VideoMessage.js +62 -120
  249. package/lib/module/components/styled/VideoMessage.js.map +1 -1
  250. package/lib/module/context/xmppProvider.js +55 -128
  251. package/lib/module/context/xmppProvider.js.map +1 -1
  252. package/lib/module/helpers/createMessageFromXml.js +1 -19
  253. package/lib/module/helpers/createMessageFromXml.js.map +1 -1
  254. package/lib/module/helpers/ensureScopedChatCache.js +2 -2
  255. package/lib/module/helpers/ensureScopedChatCache.js.map +1 -1
  256. package/lib/module/helpers/getDataFromXml.js +23 -1
  257. package/lib/module/helpers/getDataFromXml.js.map +1 -1
  258. package/lib/module/helpers/historyPreloadScheduler.js +3 -66
  259. package/lib/module/helpers/historyPreloadScheduler.js.map +1 -1
  260. package/lib/module/helpers/initXmppRooms.js +8 -14
  261. package/lib/module/helpers/initXmppRooms.js.map +1 -1
  262. package/lib/module/helpers/insertMessageWithDelimiter.js +13 -0
  263. package/lib/module/helpers/insertMessageWithDelimiter.js.map +1 -1
  264. package/lib/module/helpers/isUnresolvedSenderId.js +6 -1
  265. package/lib/module/helpers/isUnresolvedSenderId.js.map +1 -1
  266. package/lib/module/helpers/mimeToExtension.js +13 -6
  267. package/lib/module/helpers/mimeToExtension.js.map +1 -1
  268. package/lib/module/helpers/resolveInitBeforeLoadUser.js +16 -130
  269. package/lib/module/helpers/resolveInitBeforeLoadUser.js.map +1 -1
  270. package/lib/module/helpers/resolveLangSource.js +32 -0
  271. package/lib/module/helpers/resolveLangSource.js.map +1 -0
  272. package/lib/module/helpers/xmppUsername.js +35 -0
  273. package/lib/module/helpers/xmppUsername.js.map +1 -0
  274. package/lib/module/hooks/useChatRoomFocus.js +8 -17
  275. package/lib/module/hooks/useChatRoomFocus.js.map +1 -1
  276. package/lib/module/hooks/useChatWrapperInit.js +14 -32
  277. package/lib/module/hooks/useChatWrapperInit.js.map +1 -1
  278. package/lib/module/hooks/useComposing.js +1 -28
  279. package/lib/module/hooks/useComposing.js.map +1 -1
  280. package/lib/module/hooks/useLogout.js +7 -15
  281. package/lib/module/hooks/useLogout.js.map +1 -1
  282. package/lib/module/hooks/usePendingNotification.js +11 -8
  283. package/lib/module/hooks/usePendingNotification.js.map +1 -1
  284. package/lib/module/hooks/useSendMessage.js +16 -52
  285. package/lib/module/hooks/useSendMessage.js.map +1 -1
  286. package/lib/module/hooks/useUnreadMessagesCounter.js +1 -6
  287. package/lib/module/hooks/useUnreadMessagesCounter.js.map +1 -1
  288. package/lib/module/i18n/strings.js +133 -121
  289. package/lib/module/i18n/strings.js.map +1 -1
  290. package/lib/module/i18n/useT.js +1 -1
  291. package/lib/module/main.js +2 -14
  292. package/lib/module/main.js.map +1 -1
  293. package/lib/module/networking/api-requests/auth.api.js +59 -131
  294. package/lib/module/networking/api-requests/auth.api.js.map +1 -1
  295. package/lib/module/networking/api-requests/roomMembers.api.js +1 -1
  296. package/lib/module/networking/api-requests/roomMembers.api.js.map +1 -1
  297. package/lib/module/networking/api-requests/rooms.api.js +9 -9
  298. package/lib/module/networking/api-requests/rooms.api.js.map +1 -1
  299. package/lib/module/networking/api-requests/user.api.js +7 -64
  300. package/lib/module/networking/api-requests/user.api.js.map +1 -1
  301. package/lib/module/networking/apiClient.js +113 -61
  302. package/lib/module/networking/apiClient.js.map +1 -1
  303. package/lib/module/networking/stanzaHandlers.js +52 -94
  304. package/lib/module/networking/stanzaHandlers.js.map +1 -1
  305. package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js +8 -46
  306. package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
  307. package/lib/module/networking/xmpp/presenceInRoom.xmpp.js +1 -8
  308. package/lib/module/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
  309. package/lib/module/networking/xmpp/subscribeToRoomMessages.xmpp.js +1 -5
  310. package/lib/module/networking/xmpp/subscribeToRoomMessages.xmpp.js.map +1 -1
  311. package/lib/module/networking/xmppClient.js +8 -124
  312. package/lib/module/networking/xmppClient.js.map +1 -1
  313. package/lib/module/roomStore/chatSettingsSlice.js +7 -26
  314. package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
  315. package/lib/module/roomStore/index.js +4 -37
  316. package/lib/module/roomStore/index.js.map +1 -1
  317. package/lib/module/roomStore/persistence.js +38 -223
  318. package/lib/module/roomStore/persistence.js.map +1 -1
  319. package/lib/module/roomStore/roomsSlice.js +7 -86
  320. package/lib/module/roomStore/roomsSlice.js.map +1 -1
  321. package/lib/module/services/pushSubscriptionService.js +13 -15
  322. package/lib/module/services/pushSubscriptionService.js.map +1 -1
  323. package/lib/module/version.js +3 -1
  324. package/lib/module/version.js.map +1 -1
  325. package/lib/typescript/assets/icons.d.ts +0 -16
  326. package/lib/typescript/assets/icons.d.ts.map +1 -1
  327. package/lib/typescript/components/AuthForms/Login.d.ts.map +1 -1
  328. package/lib/typescript/components/Header/HeaderRoomList.d.ts.map +1 -1
  329. package/lib/typescript/components/MainComponents/ChatHeader.d.ts.map +1 -1
  330. package/lib/typescript/components/MainComponents/ChatRoom.d.ts.map +1 -1
  331. package/lib/typescript/components/MainComponents/ChatWrapper.d.ts.map +1 -1
  332. package/lib/typescript/components/MainComponents/LoginWrapper.d.ts.map +1 -1
  333. package/lib/typescript/components/MainComponents/MediaMessage.d.ts.map +1 -1
  334. package/lib/typescript/components/MainComponents/MessageContainer.d.ts.map +1 -1
  335. package/lib/typescript/components/MainComponents/MessageList.d.ts +1 -10
  336. package/lib/typescript/components/MainComponents/MessageList.d.ts.map +1 -1
  337. package/lib/typescript/components/MainComponents/ProfileImagePlaceholder.d.ts.map +1 -1
  338. package/lib/typescript/components/MainComponents/ReduxWrapper.d.ts.map +1 -1
  339. package/lib/typescript/components/MainComponents/RoomList.d.ts +0 -7
  340. package/lib/typescript/components/MainComponents/RoomList.d.ts.map +1 -1
  341. package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts +0 -3
  342. package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts.map +1 -1
  343. package/lib/typescript/components/MessageBubble/MessageTranslate.d.ts.map +1 -1
  344. package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts +0 -9
  345. package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts.map +1 -1
  346. package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts +0 -10
  347. package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
  348. package/lib/typescript/components/Modals/ChatProfileModal/DeleteChatModal.d.ts.map +1 -1
  349. package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts.map +1 -1
  350. package/lib/typescript/components/Modals/FilePreviewModal/PdfView.d.ts.map +1 -1
  351. package/lib/typescript/components/Modals/Modal/Modal.d.ts.map +1 -1
  352. package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts +2 -4
  353. package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts.map +1 -1
  354. package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts +1 -1
  355. package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts.map +1 -1
  356. package/lib/typescript/components/Modals/NewChatModal/UpdNewChatModal.d.ts.map +1 -1
  357. package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts +1 -6
  358. package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts.map +1 -1
  359. package/lib/typescript/components/Modals/UserProfileModal/EditUserModal.d.ts.map +1 -1
  360. package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts +0 -16
  361. package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
  362. package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts +0 -1
  363. package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts.map +1 -1
  364. package/lib/typescript/components/Modals/styledModalComponents.d.ts.map +1 -1
  365. package/lib/typescript/components/RoomComponents/ChatRoomItem.d.ts.map +1 -1
  366. package/lib/typescript/components/RoomComponents/styled/LastMessageFile.d.ts +1 -1
  367. package/lib/typescript/components/RoomComponents/styled/LastMessageFile.d.ts.map +1 -1
  368. package/lib/typescript/components/RoomComponents/styled/LastMessagePhoto.d.ts +1 -1
  369. package/lib/typescript/components/RoomComponents/styled/LastMessagePhoto.d.ts.map +1 -1
  370. package/lib/typescript/components/RoomComponents/styled/LastMessageVideo.d.ts +1 -1
  371. package/lib/typescript/components/RoomComponents/styled/LastMessageVideo.d.ts.map +1 -1
  372. package/lib/typescript/components/VideoCalls/VideoCallSession.d.ts.map +1 -1
  373. package/lib/typescript/components/styled/AudioMessage.d.ts.map +1 -1
  374. package/lib/typescript/components/styled/DateLabel.d.ts.map +1 -1
  375. package/lib/typescript/components/styled/MessageImage.d.ts +0 -14
  376. package/lib/typescript/components/styled/MessageImage.d.ts.map +1 -1
  377. package/lib/typescript/components/styled/NewMessageLabel.d.ts.map +1 -1
  378. package/lib/typescript/components/styled/SendInput.d.ts.map +1 -1
  379. package/lib/typescript/components/styled/StyledComponents.d.ts.map +1 -1
  380. package/lib/typescript/components/styled/StyledInputComponents/StyledInputComponents.d.ts.map +1 -1
  381. package/lib/typescript/components/styled/UnsupportedType.d.ts.map +1 -1
  382. package/lib/typescript/components/styled/VideoMessage.d.ts +0 -8
  383. package/lib/typescript/components/styled/VideoMessage.d.ts.map +1 -1
  384. package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
  385. package/lib/typescript/helpers/createMessageFromXml.d.ts.map +1 -1
  386. package/lib/typescript/helpers/getDataFromXml.d.ts.map +1 -1
  387. package/lib/typescript/helpers/historyPreloadScheduler.d.ts.map +1 -1
  388. package/lib/typescript/helpers/initXmppRooms.d.ts.map +1 -1
  389. package/lib/typescript/helpers/insertMessageWithDelimiter.d.ts.map +1 -1
  390. package/lib/typescript/helpers/isUnresolvedSenderId.d.ts.map +1 -1
  391. package/lib/typescript/helpers/mimeToExtension.d.ts +15 -0
  392. package/lib/typescript/helpers/mimeToExtension.d.ts.map +1 -1
  393. package/lib/typescript/helpers/resolveInitBeforeLoadUser.d.ts.map +1 -1
  394. package/lib/typescript/helpers/resolveLangSource.d.ts +30 -0
  395. package/lib/typescript/helpers/resolveLangSource.d.ts.map +1 -0
  396. package/lib/typescript/helpers/xmppUsername.d.ts +13 -0
  397. package/lib/typescript/helpers/xmppUsername.d.ts.map +1 -0
  398. package/lib/typescript/hooks/useChatRoomFocus.d.ts +1 -4
  399. package/lib/typescript/hooks/useChatRoomFocus.d.ts.map +1 -1
  400. package/lib/typescript/hooks/useChatWrapperInit.d.ts.map +1 -1
  401. package/lib/typescript/hooks/useComposing.d.ts.map +1 -1
  402. package/lib/typescript/hooks/useLogout.d.ts.map +1 -1
  403. package/lib/typescript/hooks/usePendingNotification.d.ts.map +1 -1
  404. package/lib/typescript/hooks/useSendMessage.d.ts.map +1 -1
  405. package/lib/typescript/hooks/useUnreadMessagesCounter.d.ts +0 -1
  406. package/lib/typescript/hooks/useUnreadMessagesCounter.d.ts.map +1 -1
  407. package/lib/typescript/i18n/strings.d.ts.map +1 -1
  408. package/lib/typescript/i18n/useT.d.ts +1 -1
  409. package/lib/typescript/main.d.ts +2 -9
  410. package/lib/typescript/main.d.ts.map +1 -1
  411. package/lib/typescript/networking/api-requests/auth.api.d.ts +1 -3
  412. package/lib/typescript/networking/api-requests/auth.api.d.ts.map +1 -1
  413. package/lib/typescript/networking/api-requests/user.api.d.ts +0 -27
  414. package/lib/typescript/networking/api-requests/user.api.d.ts.map +1 -1
  415. package/lib/typescript/networking/apiClient.d.ts +6 -12
  416. package/lib/typescript/networking/apiClient.d.ts.map +1 -1
  417. package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
  418. package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts +2 -10
  419. package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts.map +1 -1
  420. package/lib/typescript/networking/xmpp/presenceInRoom.xmpp.d.ts.map +1 -1
  421. package/lib/typescript/networking/xmpp/subscribeToRoomMessages.xmpp.d.ts.map +1 -1
  422. package/lib/typescript/networking/xmppClient.d.ts +0 -14
  423. package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
  424. package/lib/typescript/roomStore/chatSettingsSlice.d.ts +0 -16
  425. package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
  426. package/lib/typescript/roomStore/index.d.ts.map +1 -1
  427. package/lib/typescript/roomStore/persistence.d.ts +1 -18
  428. package/lib/typescript/roomStore/persistence.d.ts.map +1 -1
  429. package/lib/typescript/roomStore/roomsSlice.d.ts +1 -14
  430. package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
  431. package/lib/typescript/services/pushSubscriptionService.d.ts +1 -1
  432. package/lib/typescript/services/pushSubscriptionService.d.ts.map +1 -1
  433. package/lib/typescript/types/types.d.ts +5 -49
  434. package/lib/typescript/types/types.d.ts.map +1 -1
  435. package/lib/typescript/version.d.ts +1 -1
  436. package/lib/typescript/version.d.ts.map +1 -1
  437. package/package.json +29 -41
  438. package/src/assets/icons.tsx +9 -48
  439. package/src/components/AuthForms/Login.tsx +3 -3
  440. package/src/components/Header/HeaderRoomList.tsx +6 -24
  441. package/src/components/MainComponents/ChatHeader.tsx +3 -9
  442. package/src/components/MainComponents/ChatRoom.tsx +16 -111
  443. package/src/components/MainComponents/ChatWrapper.tsx +53 -36
  444. package/src/components/MainComponents/LoginWrapper.tsx +0 -1
  445. package/src/components/MainComponents/MediaMessage.tsx +8 -26
  446. package/src/components/MainComponents/MessageContainer.tsx +1 -5
  447. package/src/components/MainComponents/MessageList.tsx +4 -23
  448. package/src/components/MainComponents/ProfileImagePlaceholder.tsx +14 -21
  449. package/src/components/MainComponents/ReduxWrapper.tsx +18 -1
  450. package/src/components/MainComponents/RoomList.tsx +39 -236
  451. package/src/components/Menu/HeaderRoomListMenu.tsx +75 -328
  452. package/src/components/MessageBubble/MessageTranslate.tsx +17 -12
  453. package/src/components/Modals/AttachSheet/AttachSheet.tsx +99 -331
  454. package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +293 -611
  455. package/src/components/Modals/ChatProfileModal/DeleteChatModal.tsx +9 -7
  456. package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +38 -79
  457. package/src/components/Modals/FilePreviewModal/PdfView.tsx +1 -2
  458. package/src/components/Modals/Modal/Modal.tsx +0 -7
  459. package/src/components/Modals/NewChatModal/ModalContent.tsx +3 -6
  460. package/src/components/Modals/NewChatModal/NewChatModal.tsx +126 -223
  461. package/src/components/Modals/NewChatModal/UpdNewChatModal.tsx +1 -12
  462. package/src/components/Modals/SelectUsersModal/SelectUsersModal.tsx +4 -14
  463. package/src/components/Modals/UserProfileModal/EditUserModal.tsx +25 -9
  464. package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +307 -617
  465. package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +58 -75
  466. package/src/components/Modals/styledModalComponents.tsx +2 -9
  467. package/src/components/RoomComponents/ChatRoomItem.tsx +50 -21
  468. package/src/components/RoomComponents/styled/LastMessageFile.tsx +4 -28
  469. package/src/components/RoomComponents/styled/LastMessagePhoto.tsx +3 -18
  470. package/src/components/RoomComponents/styled/LastMessageVideo.tsx +3 -18
  471. package/src/components/VideoCalls/VideoCallSession.tsx +3 -8
  472. package/src/components/styled/AudioMessage.tsx +1 -2
  473. package/src/components/styled/DateLabel.tsx +10 -3
  474. package/src/components/styled/MessageImage.tsx +7 -53
  475. package/src/components/styled/NewMessageLabel.tsx +3 -1
  476. package/src/components/styled/SendInput.tsx +18 -91
  477. package/src/components/styled/StyledComponents.ts +3 -9
  478. package/src/components/styled/StyledInputComponents/StyledInputComponents.tsx +4 -11
  479. package/src/components/styled/UnsupportedType.tsx +4 -14
  480. package/src/components/styled/VideoMessage.tsx +54 -131
  481. package/src/context/xmppProvider.tsx +51 -134
  482. package/src/helpers/createMessageFromXml.ts +1 -20
  483. package/src/helpers/ensureScopedChatCache.ts +2 -2
  484. package/src/helpers/getDataFromXml.ts +25 -1
  485. package/src/helpers/historyPreloadScheduler.ts +3 -80
  486. package/src/helpers/initXmppRooms.tsx +10 -14
  487. package/src/helpers/insertMessageWithDelimiter.ts +13 -0
  488. package/src/helpers/isUnresolvedSenderId.ts +9 -1
  489. package/src/helpers/mimeToExtension.ts +22 -6
  490. package/src/helpers/resolveInitBeforeLoadUser.ts +18 -125
  491. package/src/helpers/resolveLangSource.ts +40 -0
  492. package/src/helpers/xmppUsername.ts +38 -0
  493. package/src/hooks/useChatRoomFocus.ts +5 -14
  494. package/src/hooks/useChatWrapperInit.ts +16 -32
  495. package/src/hooks/useComposing.tsx +1 -37
  496. package/src/hooks/useLogout.tsx +9 -15
  497. package/src/hooks/usePendingNotification.ts +11 -5
  498. package/src/hooks/useSendMessage.tsx +15 -60
  499. package/src/hooks/useUnreadMessagesCounter.ts +0 -11
  500. package/src/i18n/strings.ts +133 -121
  501. package/src/i18n/useT.ts +1 -1
  502. package/src/main.ts +2 -26
  503. package/src/networking/api-requests/auth.api.ts +48 -156
  504. package/src/networking/api-requests/roomMembers.api.ts +1 -1
  505. package/src/networking/api-requests/rooms.api.ts +9 -9
  506. package/src/networking/api-requests/user.api.ts +7 -79
  507. package/src/networking/apiClient.ts +123 -68
  508. package/src/networking/stanzaHandlers.ts +51 -92
  509. package/src/networking/xmpp/flushLastViewedToPrivateStore.ts +10 -71
  510. package/src/networking/xmpp/presenceInRoom.xmpp.ts +1 -6
  511. package/src/networking/xmpp/subscribeToRoomMessages.xmpp.ts +1 -12
  512. package/src/networking/xmppClient.ts +9 -141
  513. package/src/roomStore/chatSettingsSlice.ts +10 -34
  514. package/src/roomStore/index.ts +4 -40
  515. package/src/roomStore/persistence.ts +40 -234
  516. package/src/roomStore/roomsSlice.ts +7 -87
  517. package/src/services/pushSubscriptionService.ts +13 -18
  518. package/src/types/types.ts +5 -58
  519. package/src/version.ts +3 -1
  520. package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js +0 -226
  521. package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js.map +0 -1
  522. package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js +0 -556
  523. package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js.map +0 -1
  524. package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js +0 -210
  525. package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js.map +0 -1
  526. package/lib/commonjs/helpers/getChatBackground.js +0 -23
  527. package/lib/commonjs/helpers/getChatBackground.js.map +0 -1
  528. package/lib/commonjs/helpers/getDisplayFileName.js +0 -79
  529. package/lib/commonjs/helpers/getDisplayFileName.js.map +0 -1
  530. package/lib/commonjs/helpers/getServerReadTimestamp.js +0 -125
  531. package/lib/commonjs/helpers/getServerReadTimestamp.js.map +0 -1
  532. package/lib/commonjs/helpers/isOwnMessage.js +0 -75
  533. package/lib/commonjs/helpers/isOwnMessage.js.map +0 -1
  534. package/lib/commonjs/helpers/mediaLibraryRuntime.js +0 -31
  535. package/lib/commonjs/helpers/mediaLibraryRuntime.js.map +0 -1
  536. package/lib/commonjs/helpers/persistCrypto.js +0 -122
  537. package/lib/commonjs/helpers/persistCrypto.js.map +0 -1
  538. package/lib/commonjs/helpers/pickImageAsset.js +0 -68
  539. package/lib/commonjs/helpers/pickImageAsset.js.map +0 -1
  540. package/lib/commonjs/helpers/pushPayload.js +0 -71
  541. package/lib/commonjs/helpers/pushPayload.js.map +0 -1
  542. package/lib/commonjs/helpers/secureFileUrl.js +0 -101
  543. package/lib/commonjs/helpers/secureFileUrl.js.map +0 -1
  544. package/lib/commonjs/helpers/secureKeyValue.js +0 -83
  545. package/lib/commonjs/helpers/secureKeyValue.js.map +0 -1
  546. package/lib/commonjs/helpers/secureStoreRuntime.js +0 -59
  547. package/lib/commonjs/helpers/secureStoreRuntime.js.map +0 -1
  548. package/lib/commonjs/helpers/secureUserStorage.js +0 -75
  549. package/lib/commonjs/helpers/secureUserStorage.js.map +0 -1
  550. package/lib/commonjs/helpers/shallowEqual.js +0 -36
  551. package/lib/commonjs/helpers/shallowEqual.js.map +0 -1
  552. package/lib/commonjs/helpers/sheetGestures.js +0 -32
  553. package/lib/commonjs/helpers/sheetGestures.js.map +0 -1
  554. package/lib/commonjs/hooks/useFileToken.js +0 -10
  555. package/lib/commonjs/hooks/useFileToken.js.map +0 -1
  556. package/lib/commonjs/networking/authRefresh.js +0 -332
  557. package/lib/commonjs/networking/authRefresh.js.map +0 -1
  558. package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js +0 -223
  559. package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js.map +0 -1
  560. package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js +0 -548
  561. package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js.map +0 -1
  562. package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js +0 -205
  563. package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js.map +0 -1
  564. package/lib/module/helpers/getChatBackground.js +0 -18
  565. package/lib/module/helpers/getChatBackground.js.map +0 -1
  566. package/lib/module/helpers/getDisplayFileName.js +0 -73
  567. package/lib/module/helpers/getDisplayFileName.js.map +0 -1
  568. package/lib/module/helpers/getServerReadTimestamp.js +0 -120
  569. package/lib/module/helpers/getServerReadTimestamp.js.map +0 -1
  570. package/lib/module/helpers/isOwnMessage.js +0 -70
  571. package/lib/module/helpers/isOwnMessage.js.map +0 -1
  572. package/lib/module/helpers/mediaLibraryRuntime.js +0 -25
  573. package/lib/module/helpers/mediaLibraryRuntime.js.map +0 -1
  574. package/lib/module/helpers/persistCrypto.js +0 -115
  575. package/lib/module/helpers/persistCrypto.js.map +0 -1
  576. package/lib/module/helpers/pickImageAsset.js +0 -63
  577. package/lib/module/helpers/pickImageAsset.js.map +0 -1
  578. package/lib/module/helpers/pushPayload.js +0 -63
  579. package/lib/module/helpers/pushPayload.js.map +0 -1
  580. package/lib/module/helpers/secureFileUrl.js +0 -91
  581. package/lib/module/helpers/secureFileUrl.js.map +0 -1
  582. package/lib/module/helpers/secureKeyValue.js +0 -75
  583. package/lib/module/helpers/secureKeyValue.js.map +0 -1
  584. package/lib/module/helpers/secureStoreRuntime.js +0 -52
  585. package/lib/module/helpers/secureStoreRuntime.js.map +0 -1
  586. package/lib/module/helpers/secureUserStorage.js +0 -72
  587. package/lib/module/helpers/secureUserStorage.js.map +0 -1
  588. package/lib/module/helpers/shallowEqual.js +0 -31
  589. package/lib/module/helpers/shallowEqual.js.map +0 -1
  590. package/lib/module/helpers/sheetGestures.js +0 -26
  591. package/lib/module/helpers/sheetGestures.js.map +0 -1
  592. package/lib/module/hooks/useFileToken.js +0 -5
  593. package/lib/module/hooks/useFileToken.js.map +0 -1
  594. package/lib/module/networking/authRefresh.js +0 -321
  595. package/lib/module/networking/authRefresh.js.map +0 -1
  596. package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts +0 -9
  597. package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts.map +0 -1
  598. package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts +0 -75
  599. package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts.map +0 -1
  600. package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts +0 -25
  601. package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts.map +0 -1
  602. package/lib/typescript/helpers/getChatBackground.d.ts +0 -15
  603. package/lib/typescript/helpers/getChatBackground.d.ts.map +0 -1
  604. package/lib/typescript/helpers/getDisplayFileName.d.ts +0 -49
  605. package/lib/typescript/helpers/getDisplayFileName.d.ts.map +0 -1
  606. package/lib/typescript/helpers/getServerReadTimestamp.d.ts +0 -69
  607. package/lib/typescript/helpers/getServerReadTimestamp.d.ts.map +0 -1
  608. package/lib/typescript/helpers/isOwnMessage.d.ts +0 -36
  609. package/lib/typescript/helpers/isOwnMessage.d.ts.map +0 -1
  610. package/lib/typescript/helpers/mediaLibraryRuntime.d.ts +0 -3
  611. package/lib/typescript/helpers/mediaLibraryRuntime.d.ts.map +0 -1
  612. package/lib/typescript/helpers/persistCrypto.d.ts +0 -13
  613. package/lib/typescript/helpers/persistCrypto.d.ts.map +0 -1
  614. package/lib/typescript/helpers/pickImageAsset.d.ts +0 -27
  615. package/lib/typescript/helpers/pickImageAsset.d.ts.map +0 -1
  616. package/lib/typescript/helpers/pushPayload.d.ts +0 -7
  617. package/lib/typescript/helpers/pushPayload.d.ts.map +0 -1
  618. package/lib/typescript/helpers/secureFileUrl.d.ts +0 -7
  619. package/lib/typescript/helpers/secureFileUrl.d.ts.map +0 -1
  620. package/lib/typescript/helpers/secureKeyValue.d.ts +0 -13
  621. package/lib/typescript/helpers/secureKeyValue.d.ts.map +0 -1
  622. package/lib/typescript/helpers/secureStoreRuntime.d.ts +0 -29
  623. package/lib/typescript/helpers/secureStoreRuntime.d.ts.map +0 -1
  624. package/lib/typescript/helpers/secureUserStorage.d.ts +0 -23
  625. package/lib/typescript/helpers/secureUserStorage.d.ts.map +0 -1
  626. package/lib/typescript/helpers/shallowEqual.d.ts +0 -11
  627. package/lib/typescript/helpers/shallowEqual.d.ts.map +0 -1
  628. package/lib/typescript/helpers/sheetGestures.d.ts +0 -20
  629. package/lib/typescript/helpers/sheetGestures.d.ts.map +0 -1
  630. package/lib/typescript/hooks/useFileToken.d.ts +0 -2
  631. package/lib/typescript/hooks/useFileToken.d.ts.map +0 -1
  632. package/lib/typescript/networking/authRefresh.d.ts +0 -95
  633. package/lib/typescript/networking/authRefresh.d.ts.map +0 -1
  634. package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +0 -244
  635. package/src/components/Modals/ProfileHeader/ProfileHeader.tsx +0 -615
  636. package/src/components/Modals/ProfileHeader/ProfileMenu.tsx +0 -217
  637. package/src/helpers/getChatBackground.ts +0 -18
  638. package/src/helpers/getDisplayFileName.ts +0 -87
  639. package/src/helpers/getServerReadTimestamp.ts +0 -120
  640. package/src/helpers/isOwnMessage.ts +0 -90
  641. package/src/helpers/mediaLibraryRuntime.ts +0 -25
  642. package/src/helpers/persistCrypto.ts +0 -127
  643. package/src/helpers/pickImageAsset.ts +0 -68
  644. package/src/helpers/pushPayload.ts +0 -62
  645. package/src/helpers/secureFileUrl.ts +0 -103
  646. package/src/helpers/secureKeyValue.ts +0 -80
  647. package/src/helpers/secureStoreRuntime.ts +0 -62
  648. package/src/helpers/secureUserStorage.ts +0 -80
  649. package/src/helpers/shallowEqual.ts +0 -33
  650. package/src/helpers/sheetGestures.ts +0 -25
  651. package/src/hooks/useFileToken.ts +0 -7
  652. package/src/networking/authRefresh.ts +0 -451
@@ -3,75 +3,34 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.userInitials = exports.profileTabs = exports.default = void 0;
6
+ exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
- var _reactNative = require("react-native");
9
8
  var _styledModalComponents = require("../styledModalComponents");
10
9
  var _icons = require("../../../assets/icons");
11
- var _hooks = require("../../../hooks/hooks");
12
- var _useChatSettingState = require("../../../hooks/useChatSettingState");
13
- var _xmppProvider = require("../../../context/xmppProvider");
14
- var _ToastContext = require("../../../context/ToastContext");
15
- var _useT = require("../../../i18n/useT");
16
- var _useFileToken = require("../../../hooks/useFileToken");
17
- var _secureFileUrl = require("../../../helpers/secureFileUrl");
18
- var _getIconColor = require("../../../helpers/getIconColor");
19
- var _typography = require("../../../helpers/typography");
20
- var _getElementFont = require("../../../helpers/getElementFont");
21
- var _LANGUAGE_OPTIONS = require("../../../helpers/constants/LANGUAGE_OPTIONS");
22
- var _MODAL_TYPES = require("../../../helpers/constants/MODAL_TYPES");
10
+ var _ModalHeaderComponent = _interopRequireDefault(require("../ModalHeaderComponent"));
11
+ var _ProfileImagePlaceholder = require("../../MainComponents/ProfileImagePlaceholder");
12
+ var _Button = _interopRequireDefault(require("../../styled/Button"));
13
+ var _DropdownMenu = _interopRequireDefault(require("../../DropdownMenu/DropdownMenu"));
23
14
  var _chatSettingsSlice = require("../../../roomStore/chatSettingsSlice");
24
15
  var _roomsSlice = require("../../../roomStore/roomsSlice");
25
- var _HeaderRoomListMenu = require("../../Menu/HeaderRoomListMenu");
26
- var _useLogout = require("../../../hooks/useLogout");
16
+ var _EditUserModal = _interopRequireDefault(require("./EditUserModal"));
17
+ var _walletUsername = require("../../../helpers/walletUsername");
18
+ var _xmppProvider = require("../../../context/xmppProvider");
19
+ var _Select = _interopRequireDefault(require("../../MainComponents/Select"));
20
+ var _hooks = require("../../../hooks/hooks");
21
+ var _reactNative = require("react-native");
27
22
  var _rooms = require("../../../networking/api-requests/rooms.api");
28
- var _user = require("../../../networking/api-requests/user.api");
29
23
  var _createRoomFromApi = require("../../../helpers/createRoomFromApi");
30
- var _walletUsername = require("../../../helpers/walletUsername");
31
- var _ProfileHeader = require("../ProfileHeader/ProfileHeader");
32
- var _ProfileMenu = _interopRequireDefault(require("../ProfileHeader/ProfileMenu"));
33
- var _EditUserModal = _interopRequireDefault(require("./EditUserModal"));
24
+ var _ToastContext = require("../../../context/ToastContext");
25
+ var _LANGUAGE_OPTIONS = require("../../../helpers/constants/LANGUAGE_OPTIONS");
26
+ var _user = require("../../../networking/api-requests/user.api");
27
+ var _useChatSettingState = require("../../../hooks/useChatSettingState");
34
28
  var _jsxRuntime = require("react/jsx-runtime");
35
29
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
36
30
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
37
- /** @format */
38
-
39
- const PREFIX = 'user-profile';
40
- /** Two uppercase letters for a person without a picture. */
41
- const userInitials = name => {
42
- const words = (name || '').trim().split(/\s+/).filter(Boolean);
43
- 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));
44
- return letters.join('').toUpperCase();
45
- };
46
-
47
- /**
48
- * Which tabs a profile shows. Only the signed-in user has tabs at all:
49
- * `GET /v2/files/` returns the JWT owner's files, so there is nothing to
50
- * put under Media/Documents for anybody else, and the language picker is
51
- * a personal setting.
52
- */
53
- exports.userInitials = userInitials;
54
- const profileTabs = opts => {
55
- if (!opts.isOwnProfile) {
56
- return [];
57
- }
58
- const tabs = [];
59
- if (opts.translatesEnabled) {
60
- tabs.push('language');
61
- }
62
- if (opts.hasMedia) {
63
- tabs.push('media');
64
- }
65
- if (opts.hasDocuments) {
66
- tabs.push('documents');
67
- }
68
- return tabs;
69
- };
70
- exports.profileTabs = profileTabs;
71
31
  const UserProfileModal = ({
72
32
  handleCloseModal
73
33
  }) => {
74
- const t = (0, _useT.useT)();
75
34
  const dispatch = (0, _hooks.useAppDispatch)();
76
35
  const {
77
36
  client
@@ -85,99 +44,75 @@ const UserProfileModal = ({
85
44
  selectedUser,
86
45
  langSource
87
46
  } = (0, _useChatSettingState.useChatSettingState)();
88
- const fileToken = (0, _useFileToken.useFileToken)();
89
47
  const [isEditing, setIsEditing] = (0, _react.useState)(false);
90
- const [files, setFiles] = (0, _react.useState)([]);
91
- const [loadingFiles, setLoadingFiles] = (0, _react.useState)(false);
92
- const [activeTab, setActiveTab] = (0, _react.useState)(null);
93
- const scrollY = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
94
- const scrollRef = (0, _react.useRef)(null);
95
- const {
96
- collapseDistance
97
- } = (0, _ProfileHeader.useHeaderMetrics)();
98
- const [viewportHeight, setViewportHeight] = (0, _react.useState)(0);
99
- // `scrollY` is driven natively, so its value can't be read back with
100
- // addListener; the Animated.event's JS `listener` still fires, which is
101
- // enough to know which state the header is in.
102
- const [isCollapsed, setIsCollapsed] = (0, _react.useState)(false);
103
- const isOwnProfile = !selectedUser;
104
- const profileUser = selectedUser ?? user;
105
- const media = (0, _react.useMemo)(() => files.filter(_user.isMediaFile), [files]);
106
- const documents = (0, _react.useMemo)(() => files.filter(file => !(0, _user.isMediaFile)(file)), [files]);
107
- const tabs = (0, _react.useMemo)(() => profileTabs({
108
- isOwnProfile,
109
- translatesEnabled: !!config?.translates?.enabled,
110
- hasMedia: media.length > 0,
111
- hasDocuments: documents.length > 0
112
- }), [isOwnProfile, config?.translates?.enabled, media.length, documents.length]);
113
-
114
- // Keep the selected tab valid as the lists load in.
115
- (0, _react.useEffect)(() => {
116
- if (tabs.length === 0) {
117
- setActiveTab(null);
118
- return;
48
+ const [documents, setDocuments] = (0, _react.useState)([]);
49
+ const [deleteDocumentId, setDeleteDocumentId] = (0, _react.useState)('');
50
+ const [showDelete, setShowDelete] = (0, _react.useState)(false);
51
+ const handleDeleteDocument = async () => {
52
+ try {
53
+ await (0, _user.deleteDocument)(deleteDocumentId);
54
+ setDocuments(documents.filter(doc => doc._id !== deleteDocumentId));
55
+ showToast({
56
+ id: Date.now().toString(),
57
+ title: 'Success',
58
+ message: 'Document deleted successfully',
59
+ type: 'success'
60
+ });
61
+ // handleGetDocs();
62
+ } catch (error) {
63
+ console.error('Error deleting document', error);
64
+ showToast({
65
+ id: Date.now().toString(),
66
+ title: 'Error',
67
+ message: 'Failed to delete document',
68
+ type: 'error'
69
+ });
70
+ } finally {
71
+ setShowDelete(false);
119
72
  }
120
- setActiveTab(current => current && tabs.includes(current) ? current : tabs[0]);
121
- }, [tabs]);
122
-
123
- // One request per visit, and only for one's own profile — the endpoint
124
- // is scoped to the JWT owner, so it would return *our* files while
125
- // looking at somebody else's page.
126
- (0, _react.useEffect)(() => {
127
- if (!isOwnProfile) {
128
- setFiles([]);
129
- return;
73
+ };
74
+ const handleGetDocs = async () => {
75
+ try {
76
+ const {
77
+ data
78
+ } = await (0, _user.getDocuments)(user?.defaultWallet?.walletAddress);
79
+ const items = data.results.filter(el => el.locations[0]);
80
+ setDocuments(items);
81
+ } catch (error) {
82
+ console.error('Error getting docs', error);
130
83
  }
131
- let cancelled = false;
132
- setLoadingFiles(true);
133
- (0, _user.getUserFiles)().then(rows => {
134
- if (!cancelled) {
135
- setFiles(rows);
136
- }
137
- }).catch(error => {
138
- console.warn('Could not load user files:', error);
139
- if (!cancelled) {
140
- setFiles([]);
141
- }
142
- }).finally(() => {
143
- if (!cancelled) {
144
- setLoadingFiles(false);
145
- }
146
- });
147
- return () => {
148
- cancelled = true;
149
- };
150
- }, [isOwnProfile, user?.token]);
84
+ };
85
+ (0, _react.useEffect)(() => {
86
+ handleGetDocs();
87
+ }, []);
151
88
  const handleBackClick = (0, _react.useCallback)(() => {
152
89
  dispatch((0, _chatSettingsSlice.setSelectedUser)(undefined));
153
90
  handleCloseModal();
154
- }, [dispatch, handleCloseModal]);
155
-
156
- // Same teardown the room-list menu runs (XMPP, redux, persisted slices,
157
- // AsyncStorage), including the host's confirm copy and callbacks.
158
- const performLogout = (0, _useLogout.useLogout)();
91
+ }, []);
159
92
  const handleLogout = (0, _react.useCallback)(() => {
160
- (0, _HeaderRoomListMenu.runLogoutFlow)(config?.logout ?? {
161
- enabled: true
162
- }, performLogout).catch(() => {});
163
- }, [config?.logout, performLogout]);
164
- const handleShare = (0, _react.useCallback)(async () => {
165
- const name = profileUser?.name || `${profileUser?.firstName ?? ''} ${profileUser?.lastName ?? ''}`.trim();
166
- const id = profileUser?.userJID || profileUser?.defaultWallet?.walletAddress || profileUser?.id || '';
167
- try {
168
- await _reactNative.Share.share({
169
- message: id ? `${name}\n${id}` : name
170
- });
171
- } catch (error) {
172
- console.warn('Could not share the profile:', error);
93
+ dispatch((0, _chatSettingsSlice.logout)());
94
+ dispatch((0, _roomsSlice.setLogoutState)());
95
+ }, []);
96
+ const menuOptions = (0, _react.useMemo)(() => [{
97
+ label: 'Log Out',
98
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.LeaveIcon, {}),
99
+ onClick: () => {
100
+ handleLogout();
101
+ },
102
+ styles: {
103
+ color: 'red'
173
104
  }
174
- }, [profileUser]);
105
+ }], []);
106
+ const handleSelect = selected => {
107
+ dispatch((0, _chatSettingsSlice.setLangSource)(selected.id));
108
+ };
109
+ const EditClick = (0, _react.useCallback)(() => {
110
+ setIsEditing(true);
111
+ }, []);
175
112
  const handleRoomCreation = async (newChat, usersArrayLength) => {
176
113
  try {
177
114
  const normalizedChat = (0, _createRoomFromApi.createRoomFromApi)(newChat, config?.xmppSettings?.conference, usersArrayLength);
178
- if (!normalizedChat || !client) {
179
- return;
180
- }
115
+ if (!normalizedChat || !client) return;
181
116
  dispatch((0, _roomsSlice.addRoomViaApi)({
182
117
  room: normalizedChat,
183
118
  xmpp: client
@@ -204,400 +139,202 @@ const UserProfileModal = ({
204
139
  type: 'info',
205
140
  duration: 3000
206
141
  });
142
+ let newRoomJid = '';
207
143
  if (config?.newArch) {
208
144
  const newRoom = await (0, _rooms.postPrivateRoom)(selectedUser?.userJID ?? (selectedUser?.id || ''));
209
145
  handleRoomCreation(newRoom, 2);
146
+ newRoomJid = newRoom.name;
210
147
  } else {
211
148
  const selectedUserUsername = (0, _walletUsername.walletToUsername)(selectedUser?.id || '');
212
149
  const myUsername = (0, _walletUsername.walletToUsername)(user.defaultWallet.walletAddress);
213
- const roomJid = [myUsername, selectedUserUsername].sort().join('.').toLowerCase();
150
+ const combinedWalletAddress = [myUsername, selectedUserUsername].sort().join('.');
151
+ const roomJid = combinedWalletAddress.toLowerCase();
214
152
  const combinedUsersName = [user.firstName, selectedUser?.name?.split(' ')?.[0] || ''].sort().join(' and ');
215
- const newRoomJid = (await client?.createPrivateRoomStanza(combinedUsersName, `Private chat ${combinedUsersName}`, roomJid)) || '';
153
+ newRoomJid = (await client?.createPrivateRoomStanza(combinedUsersName, `Private chat ${combinedUsersName}`, roomJid)) || '';
216
154
  if (newRoomJid) {
217
155
  await client?.inviteRoomRequestStanza(selectedUserUsername, newRoomJid);
218
156
  await client?.getRoomsStanza();
219
157
  }
220
158
  }
221
159
  dispatch((0, _chatSettingsSlice.setActiveModal)(undefined));
222
- }, [selectedUser]); // eslint-disable-line react-hooks/exhaustive-deps
223
-
224
- const openFile = file => {
225
- dispatch((0, _chatSettingsSlice.setActiveFile)({
226
- fileName: file.name,
227
- fileURL: file.url,
228
- mimetype: file.mimetype
229
- }));
230
- dispatch((0, _chatSettingsSlice.setActiveModal)(_MODAL_TYPES.MODAL_TYPES.FILE_PREVIEW));
160
+ }, [selectedUser]);
161
+ const modalUser = selectedUser ?? user;
162
+ const findLanguage = () => {
163
+ if (!langSource) {
164
+ return null;
165
+ }
166
+ const language = _LANGUAGE_OPTIONS.LANGUAGE_OPTIONS.find(lang => lang.id === langSource);
167
+ return language || null;
231
168
  };
232
- const heroActions = (0, _react.useMemo)(() => isOwnProfile ? [{
233
- key: 'account',
234
- label: t('action.account'),
235
- icon: color => /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.ProfileIcon, {
236
- color: color
237
- }),
238
- onPress: () => dispatch((0, _chatSettingsSlice.setActiveModal)(_MODAL_TYPES.MODAL_TYPES.SETTINGS))
239
- }, {
240
- key: 'share',
241
- label: t('action.share'),
242
- icon: color => /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.ShareIcon, {
243
- color: color
244
- }),
245
- onPress: handleShare
246
- }, {
247
- key: 'edit',
248
- label: t('action.edit'),
249
- icon: color => /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.EditIcon, {
250
- color: color
251
- }),
252
- onPress: () => setIsEditing(true)
253
- }, {
254
- key: 'logout',
255
- label: t('action.logOut'),
256
- icon: color => /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.LogoutIcon, {
257
- color: color
258
- }),
259
- onPress: handleLogout
260
- }] : [...(config?.hideMemberSendMessageAction ? [] : [{
261
- key: 'message',
262
- label: t('action.message'),
263
- icon: color => /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.ChatIcon, {
264
- color: color
265
- }),
266
- onPress: handlePrivateMessage
267
- }]), {
268
- key: 'share',
269
- label: t('action.share'),
270
- icon: color => /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.ShareIcon, {
271
- color: color
272
- }),
273
- onPress: handleShare
274
- }], [isOwnProfile, t, handleShare, handlePrivateMessage, handleLogout] // eslint-disable-line react-hooks/exhaustive-deps
275
- );
276
-
277
- // Collapsed, the hero's round buttons are gone — the "…" menu carries
278
- // exactly the same actions so nothing becomes unreachable.
279
- const menuItems = (0, _react.useMemo)(() => isCollapsed ? heroActions.map(action => ({
280
- key: action.key,
281
- label: action.label,
282
- icon: action.icon('#141414'),
283
- destructive: action.key === 'logout',
284
- onPress: action.onPress
285
- })) : [], [isCollapsed, heroActions]);
286
- if (isEditing) {
287
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.ModalContainerFullScreen, {
288
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_EditUserModal.default, {
289
- setIsEditing: setIsEditing,
290
- modalUser: profileUser,
291
- config: config
169
+ const showDeleteModal = docId => {
170
+ setDeleteDocumentId(docId);
171
+ setShowDelete(true);
172
+ };
173
+ const DefaultBody = (0, _react.useMemo)(() => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
174
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ModalHeaderComponent.default, {
175
+ handleCloseModal: handleBackClick,
176
+ headerTitle: 'Profile',
177
+ rightMenu: !selectedUser && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
178
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
179
+ onPress: EditClick,
180
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.EditIcon, {
181
+ color: "#8C8C8C"
182
+ })
183
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_DropdownMenu.default, {
184
+ options: menuOptions,
185
+ position: "right",
186
+ menuIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.MoreIcon, {})
187
+ })]
292
188
  })
293
- });
294
- }
295
- const displayName = profileUser?.name || `${profileUser?.firstName ?? ''} ${profileUser?.lastName ?? ''}`.trim() || t('modal.profile.title');
296
- const heroImage = (0, _secureFileUrl.appendFileToken)(profileUser?.profileImage, fileToken) || null;
297
- const heroColor = config?.colors?.avatar || (0, _getIconColor.getIconColor)(config);
298
- const description = profileUser?.description;
299
- const renderTabBody = () => {
300
- if (activeTab === 'language') {
301
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
302
- children: _LANGUAGE_OPTIONS.LANGUAGE_OPTIONS.map(option => {
303
- const selected = langSource === option.id;
304
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
305
- testID: `${PREFIX}-language-${option.id}`,
306
- activeOpacity: 0.7,
307
- style: styles.languageRow,
308
- onPress: () => dispatch((0, _chatSettingsSlice.setLangSource)(option.id)),
309
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
310
- style: styles.languageLabel,
311
- children: option.name
312
- }), selected && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
313
- style: [styles.check, {
314
- color: (0, _getIconColor.getIconColor)(config)
315
- }],
316
- children: "\u2713"
317
- })]
318
- }, option.id);
189
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styledModalComponents.CenterContainer, {
190
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ProfileImagePlaceholder.ProfileImagePlaceholder, {
191
+ icon: modalUser?.profileImage ?? null,
192
+ name: modalUser?.name ?? modalUser?.firstName,
193
+ size: 120
194
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.UserInfo, {
195
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.UserName, {
196
+ children: modalUser?.name ? `${modalUser?.name}` : `${modalUser?.firstName} ${modalUser?.lastName}`
319
197
  })
320
- });
321
- }
322
- if (activeTab === 'media') {
323
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
324
- style: styles.mediaGrid,
325
- children: media.map(file => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
326
- testID: `${PREFIX}-media-${file.id}`,
327
- activeOpacity: 0.8,
328
- style: styles.mediaTile,
329
- onPress: () => openFile(file),
330
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
331
- source: {
332
- uri: (0, _secureFileUrl.appendFileToken)(file.url, fileToken) || file.url
198
+ }), !selectedUser && config?.translates?.enabled && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.BorderedContainer, {
199
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
200
+ options: _LANGUAGE_OPTIONS.LANGUAGE_OPTIONS,
201
+ placeholder: 'Select your language',
202
+ onSelect: handleSelect,
203
+ accentColor: config?.colors?.primary,
204
+ selectedValue: findLanguage()
205
+ })
206
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styledModalComponents.BorderedContainer, {
207
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.Label, {
208
+ children: "About"
209
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.LabelData, {
210
+ children: modalUser?.description && modalUser?.description?.length > 4 ? modalUser.description : 'No description'
211
+ })]
212
+ }), selectedUser && !config?.disableMemberProfileActions && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
213
+ children: [!config?.hideMemberSendMessageAction && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.ActionButton, {
214
+ StartIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.ChatIcon, {}),
215
+ onPress: handlePrivateMessage,
216
+ variant: "filled",
217
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
218
+ style: {
219
+ color: '#ffffff'
333
220
  },
334
- style: styles.mediaImage,
335
- resizeMode: "cover"
221
+ children: "Message"
222
+ })
223
+ }), !config?.hideMemberCopyIdAction && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.ActionButton, {
224
+ onPress: () => {}
225
+ // onPress={() => handleCopyClick(selectedUser.id)}
226
+ ,
227
+ variant: "filled",
228
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
229
+ style: {
230
+ color: '#ffffff'
231
+ },
232
+ children: "Copy User Id"
336
233
  })
337
- }, file.id))
338
- });
339
- }
340
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
341
- children: documents.map(file => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
342
- testID: `${PREFIX}-document-${file.id}`,
343
- activeOpacity: 0.7,
344
- style: styles.documentRow,
345
- onPress: () => openFile(file),
346
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.IconDoc, {}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
347
- style: styles.documentText,
348
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
349
- numberOfLines: 1,
350
- style: styles.documentName,
351
- children: file.name
352
- }), !!file.createdAt && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
353
- style: styles.documentDate,
354
- children: new Date(file.createdAt).toLocaleDateString()
355
- })]
356
234
  })]
357
- }, file.id))
358
- });
359
- };
360
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styledModalComponents.ModalContainerFullScreen, {
361
- style: styles.screen,
362
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.ScrollView, {
363
- ref: scrollRef,
364
- style: styles.scroll,
365
- contentContainerStyle: [styles.scrollContent, viewportHeight > 0 && {
366
- minHeight: viewportHeight + collapseDistance
367
- }],
368
- onLayout: e => setViewportHeight(e.nativeEvent.layout.height),
369
- showsVerticalScrollIndicator: false,
370
- scrollEventThrottle: 16,
371
- onScroll: _reactNative.Animated.event([{
372
- nativeEvent: {
373
- contentOffset: {
374
- y: scrollY
375
- }
376
- }
377
- }], {
378
- useNativeDriver: true,
379
- listener: e => {
380
- const y = e?.nativeEvent?.contentOffset?.y ?? 0;
381
- setIsCollapsed(y >= collapseDistance - 8);
382
- }
383
- }),
384
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ProfileHeader.ProfileHero, {
385
- testIDPrefix: PREFIX,
386
- title: displayName,
387
- imageUri: heroImage,
388
- fallbackColor: heroColor,
389
- initials: userInitials(displayName),
390
- scrollY: scrollY,
391
- actions: heroActions,
392
- titleStyle: (0, _typography.chatTextStyle)(config?.typography?.profile?.title),
393
- titleAccessory: isOwnProfile ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
394
- testID: `${PREFIX}-logout`,
395
- activeOpacity: 0.7,
396
- style: styles.leaveButton,
397
- onPress: handleLogout,
398
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.LeaveIcon, {
399
- color: "#FFFFFF",
400
- width: 18,
401
- height: 18
402
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
403
- style: styles.leaveLabel,
404
- children: t('action.leave')
405
- })]
406
- }) : undefined
407
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
408
- style: styles.body,
409
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
410
- style: styles.card,
411
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
412
- style: [styles.cardLabel, (0, _getElementFont.getElementFont)(config, 'profileSectionLabel')],
413
- children: t('modal.profile.about')
414
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
415
- style: styles.cardValue,
416
- children: description && description.length > 4 ? description : t('modal.profile.noDescription')
417
- })]
418
- }), tabs.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
419
- style: styles.card,
420
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
421
- style: styles.tabsRow,
422
- children: tabs.map(tab => {
423
- const active = tab === activeTab;
424
- const count = tab === 'media' ? media.length : tab === 'documents' ? documents.length : 0;
425
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
426
- testID: `${PREFIX}-tab-${tab}`,
427
- activeOpacity: 0.7,
428
- style: [styles.tab, active && {
429
- borderBottomColor: (0, _getIconColor.getIconColor)(config)
430
- }],
431
- onPress: () => setActiveTab(tab),
432
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
433
- style: [styles.tabLabel, active && {
434
- color: (0, _getIconColor.getIconColor)(config)
435
- }],
436
- children: t(`modal.profile.${tab}`)
437
- }), count > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
438
- style: [styles.tabBadge, {
439
- backgroundColor: (0, _getIconColor.getIconColor)(config)
440
- }],
441
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
442
- style: styles.tabBadgeText,
443
- children: count
235
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.BorderedContainer, {
236
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
237
+ style: {
238
+ maxHeight: 400
239
+ },
240
+ showsVerticalScrollIndicator: true,
241
+ nestedScrollEnabled: true,
242
+ children: documents.map(doc => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
243
+ style: {
244
+ flexDirection: 'row',
245
+ alignItems: 'center',
246
+ justifyContent: 'space-between',
247
+ gap: 24,
248
+ backgroundColor: '#F3F6FC',
249
+ marginBottom: 8,
250
+ paddingVertical: 8,
251
+ paddingHorizontal: 16,
252
+ borderRadius: 8
253
+ },
254
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
255
+ style: {
256
+ flexDirection: 'row',
257
+ alignItems: 'center',
258
+ gap: 24
259
+ },
260
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
261
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.IconDoc, {})
262
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
263
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.Label, {
264
+ style: {
265
+ paddingBottom: 4
266
+ },
267
+ children: doc.documentName
268
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.LabelData, {
269
+ children: new Date(doc.createdAt).toLocaleDateString('en-GB', {
270
+ day: '2-digit',
271
+ month: 'short',
272
+ year: 'numeric'
273
+ }) + ' ' + new Date(doc.createdAt).toLocaleTimeString('en-GB', {
274
+ hour: '2-digit',
275
+ minute: '2-digit'
444
276
  })
445
277
  })]
446
- }, tab);
447
- })
448
- }), renderTabBody()]
449
- }), isOwnProfile && loadingFiles && files.length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
450
- testID: `${PREFIX}-files-loading`
451
- })]
278
+ })]
279
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
280
+ onPress: () => showDeleteModal(doc._id),
281
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.DeleteIcon, {})
282
+ })]
283
+ }, doc._id))
284
+ })
452
285
  })]
453
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProfileHeader.ProfileTopBar, {
454
- testIDPrefix: PREFIX,
455
- title: displayName,
456
- imageUri: heroImage,
457
- fallbackColor: heroColor,
458
- initials: userInitials(displayName),
459
- scrollY: scrollY,
460
- onBack: handleBackClick,
461
- titleStyle: (0, _typography.chatTextStyle)(config?.typography?.profile?.screenTitle),
462
- menu: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProfileMenu.default, {
463
- testIDPrefix: PREFIX,
464
- items: menuItems
286
+ })]
287
+ }), [modalUser, documents]);
288
+ const EditingBody = (0, _react.useMemo)(() => /*#__PURE__*/(0, _jsxRuntime.jsx)(_EditUserModal.default, {
289
+ setIsEditing: setIsEditing,
290
+ modalUser: modalUser,
291
+ config: config
292
+ }), [modalUser]);
293
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
294
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.ModalContainerFullScreen, {
295
+ children: !isEditing ? DefaultBody : EditingBody
296
+ }), showDelete && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.ModalBackground, {
297
+ style: {
298
+ position: 'absolute',
299
+ zIndex: 9999
300
+ },
301
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styledModalComponents.ModalContainer, {
302
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.CloseButton, {
303
+ onPress: () => setShowDelete(false),
304
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
305
+ style: {
306
+ fontSize: 24
307
+ },
308
+ children: "\xD7"
309
+ })
310
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledModalComponents.ModalTitle, {
311
+ children: "Delete this document?"
312
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styledModalComponents.GroupContainer, {
313
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
314
+ onPress: () => setShowDelete(false),
315
+ text: 'Cancel',
316
+ style: {
317
+ width: '100%'
318
+ },
319
+ unstyled: true,
320
+ variant: "filled",
321
+ color: "white"
322
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
323
+ onPress: handleDeleteDocument,
324
+ text: 'Delete',
325
+ style: {
326
+ width: '100%',
327
+ borderWidth: 1,
328
+ borderColor: 'red'
329
+ },
330
+ color: "red",
331
+ unstyled: true,
332
+ variant: "outlined"
333
+ })]
334
+ })]
465
335
  })
466
336
  })]
467
337
  });
468
338
  };
469
- const styles = _reactNative.StyleSheet.create({
470
- screen: {
471
- position: 'relative',
472
- backgroundColor: '#F2F3F5'
473
- },
474
- scroll: {
475
- width: '100%',
476
- flex: 1
477
- },
478
- scrollContent: {
479
- paddingBottom: 32
480
- },
481
- body: {
482
- padding: 12,
483
- gap: 12
484
- },
485
- card: {
486
- backgroundColor: '#FFFFFF',
487
- borderRadius: 14,
488
- padding: 16,
489
- shadowColor: '#000',
490
- shadowOffset: {
491
- width: 0,
492
- height: 1
493
- },
494
- shadowOpacity: 0.05,
495
- shadowRadius: 4,
496
- elevation: 1
497
- },
498
- cardLabel: {
499
- color: '#8C8C8C',
500
- fontSize: 14
501
- },
502
- cardValue: {
503
- color: '#141414',
504
- fontSize: 16,
505
- marginTop: 4
506
- },
507
- leaveButton: {
508
- flexDirection: 'row',
509
- alignItems: 'center',
510
- gap: 6,
511
- paddingHorizontal: 12,
512
- paddingVertical: 7,
513
- borderRadius: 18,
514
- backgroundColor: 'rgba(0,0,0,0.35)'
515
- },
516
- leaveLabel: {
517
- color: '#FFFFFF',
518
- fontSize: 14,
519
- fontWeight: '500'
520
- },
521
- tabsRow: {
522
- flexDirection: 'row',
523
- gap: 20,
524
- borderBottomWidth: _reactNative.StyleSheet.hairlineWidth,
525
- borderBottomColor: '#EFEFF2',
526
- marginBottom: 12
527
- },
528
- tab: {
529
- flexDirection: 'row',
530
- alignItems: 'center',
531
- gap: 6,
532
- paddingBottom: 10,
533
- borderBottomWidth: 2,
534
- borderBottomColor: 'transparent'
535
- },
536
- tabLabel: {
537
- fontSize: 15,
538
- fontWeight: '500',
539
- color: '#8C8C8C'
540
- },
541
- tabBadge: {
542
- minWidth: 20,
543
- paddingHorizontal: 5,
544
- paddingVertical: 1,
545
- borderRadius: 10,
546
- alignItems: 'center'
547
- },
548
- tabBadgeText: {
549
- color: '#FFFFFF',
550
- fontSize: 11,
551
- fontWeight: '600'
552
- },
553
- languageRow: {
554
- flexDirection: 'row',
555
- alignItems: 'center',
556
- justifyContent: 'space-between',
557
- paddingVertical: 12
558
- },
559
- languageLabel: {
560
- fontSize: 16,
561
- color: '#141414'
562
- },
563
- check: {
564
- fontSize: 16,
565
- fontWeight: '700'
566
- },
567
- mediaGrid: {
568
- flexDirection: 'row',
569
- flexWrap: 'wrap',
570
- gap: 6
571
- },
572
- mediaTile: {
573
- width: '31.8%',
574
- aspectRatio: 1,
575
- borderRadius: 10,
576
- overflow: 'hidden',
577
- backgroundColor: '#EFEFF2'
578
- },
579
- mediaImage: {
580
- width: '100%',
581
- height: '100%'
582
- },
583
- documentRow: {
584
- flexDirection: 'row',
585
- alignItems: 'center',
586
- gap: 14,
587
- paddingVertical: 12
588
- },
589
- documentText: {
590
- flex: 1
591
- },
592
- documentName: {
593
- fontSize: 16,
594
- color: '#141414'
595
- },
596
- documentDate: {
597
- fontSize: 13,
598
- color: '#8C8C8C',
599
- marginTop: 2
600
- }
601
- });
602
339
  var _default = exports.default = UserProfileModal;
603
340
  //# sourceMappingURL=UserProfileModal.js.map