@ethora/chat-component-rn 26.5.5 → 26.5.10

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 (420) hide show
  1. package/CHANGELOG.md +177 -0
  2. package/README.md +67 -10
  3. package/index.js +24 -0
  4. package/lib/commonjs/assets/icons.js +5 -1
  5. package/lib/commonjs/assets/icons.js.map +1 -1
  6. package/lib/commonjs/components/ContextMenu/ContextMenuComponents.js +11 -5
  7. package/lib/commonjs/components/ContextMenu/ContextMenuComponents.js.map +1 -1
  8. package/lib/commonjs/components/MainComponents/ChatHeader.js +7 -1
  9. package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
  10. package/lib/commonjs/components/MainComponents/ChatRoom.js +66 -34
  11. package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
  12. package/lib/commonjs/components/MainComponents/ChatWrapper.js +59 -14
  13. package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
  14. package/lib/commonjs/components/MainComponents/MediaMessage.js +15 -7
  15. package/lib/commonjs/components/MainComponents/MediaMessage.js.map +1 -1
  16. package/lib/commonjs/components/MainComponents/MessageContainer.js +2 -2
  17. package/lib/commonjs/components/MainComponents/MessageContainer.js.map +1 -1
  18. package/lib/commonjs/components/MainComponents/MessageList.js +175 -30
  19. package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
  20. package/lib/commonjs/components/MainComponents/ReduxWrapper.js +17 -8
  21. package/lib/commonjs/components/MainComponents/ReduxWrapper.js.map +1 -1
  22. package/lib/commonjs/components/MainComponents/SystemMessage.js +34 -22
  23. package/lib/commonjs/components/MainComponents/SystemMessage.js.map +1 -1
  24. package/lib/commonjs/components/MessageBubble/Message.js +117 -19
  25. package/lib/commonjs/components/MessageBubble/Message.js.map +1 -1
  26. package/lib/commonjs/components/MessageBubble/MessageInteractions.js +82 -22
  27. package/lib/commonjs/components/MessageBubble/MessageInteractions.js.map +1 -1
  28. package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js +16 -4
  29. package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
  30. package/lib/commonjs/components/Modals/FilePreviewModal/DocumentViewer.js +104 -0
  31. package/lib/commonjs/components/Modals/FilePreviewModal/DocumentViewer.js.map +1 -0
  32. package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +175 -40
  33. package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
  34. package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js +29 -1
  35. package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
  36. package/lib/commonjs/components/Modals/Modal/Modal.js +5 -1
  37. package/lib/commonjs/components/Modals/Modal/Modal.js.map +1 -1
  38. package/lib/commonjs/components/Modals/ModalWrapper/ModalWrapper.js +78 -39
  39. package/lib/commonjs/components/Modals/ModalWrapper/ModalWrapper.js.map +1 -1
  40. package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +3 -3
  41. package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
  42. package/lib/commonjs/components/Modals/styledModalComponents.js +4 -9
  43. package/lib/commonjs/components/Modals/styledModalComponents.js.map +1 -1
  44. package/lib/commonjs/components/styled/MediaFilePreview.js +115 -5
  45. package/lib/commonjs/components/styled/MediaFilePreview.js.map +1 -1
  46. package/lib/commonjs/components/styled/MessageImage.js +49 -10
  47. package/lib/commonjs/components/styled/MessageImage.js.map +1 -1
  48. package/lib/commonjs/components/styled/NewMessageLabel.js +8 -6
  49. package/lib/commonjs/components/styled/NewMessageLabel.js.map +1 -1
  50. package/lib/commonjs/components/styled/SendInput.js +53 -29
  51. package/lib/commonjs/components/styled/SendInput.js.map +1 -1
  52. package/lib/commonjs/components/styled/StyledInputComponents/MediaComponents.js +14 -4
  53. package/lib/commonjs/components/styled/StyledInputComponents/MediaComponents.js.map +1 -1
  54. package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js +7 -2
  55. package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
  56. package/lib/commonjs/components/styled/UnsupportedType.js +5 -1
  57. package/lib/commonjs/components/styled/UnsupportedType.js.map +1 -1
  58. package/lib/commonjs/components/styled/VideoMessage.js +60 -22
  59. package/lib/commonjs/components/styled/VideoMessage.js.map +1 -1
  60. package/lib/commonjs/context/MessageNotificationContext.js +7 -7
  61. package/lib/commonjs/context/MessageNotificationContext.js.map +1 -1
  62. package/lib/commonjs/context/xmppProvider.js +315 -34
  63. package/lib/commonjs/context/xmppProvider.js.map +1 -1
  64. package/lib/commonjs/helpers/chatAutoEnterer.js +2 -7
  65. package/lib/commonjs/helpers/chatAutoEnterer.js.map +1 -1
  66. package/lib/commonjs/helpers/historyPreloadScheduler.js +4 -1
  67. package/lib/commonjs/helpers/historyPreloadScheduler.js.map +1 -1
  68. package/lib/commonjs/helpers/insertMessageWithDelimiter.js +15 -5
  69. package/lib/commonjs/helpers/insertMessageWithDelimiter.js.map +1 -1
  70. package/lib/commonjs/helpers/keyboardLayout.js +18 -0
  71. package/lib/commonjs/helpers/keyboardLayout.js.map +1 -0
  72. package/lib/commonjs/helpers/mediaDimensions.js +51 -0
  73. package/lib/commonjs/helpers/mediaDimensions.js.map +1 -0
  74. package/lib/commonjs/helpers/mimeToExtension.js +131 -0
  75. package/lib/commonjs/helpers/mimeToExtension.js.map +1 -0
  76. package/lib/commonjs/helpers/normalizeRoomJid.js +20 -0
  77. package/lib/commonjs/helpers/normalizeRoomJid.js.map +1 -0
  78. package/lib/commonjs/helpers/resolveInitBeforeLoadUser.js +73 -1
  79. package/lib/commonjs/helpers/resolveInitBeforeLoadUser.js.map +1 -1
  80. package/lib/commonjs/hooks/useChatRoomFocus.js +87 -0
  81. package/lib/commonjs/hooks/useChatRoomFocus.js.map +1 -0
  82. package/lib/commonjs/hooks/useChatWrapperInit.js +22 -10
  83. package/lib/commonjs/hooks/useChatWrapperInit.js.map +1 -1
  84. package/lib/commonjs/hooks/useEventHandlers.js +9 -1
  85. package/lib/commonjs/hooks/useEventHandlers.js.map +1 -1
  86. package/lib/commonjs/hooks/useHeapSender.js +1 -1
  87. package/lib/commonjs/hooks/useHeapSender.js.map +1 -1
  88. package/lib/commonjs/hooks/useLogout.js +3 -3
  89. package/lib/commonjs/hooks/useLogout.js.map +1 -1
  90. package/lib/commonjs/hooks/useMessageHeapState.js +6 -2
  91. package/lib/commonjs/hooks/useMessageHeapState.js.map +1 -1
  92. package/lib/commonjs/hooks/usePushNotifications.js +6 -2
  93. package/lib/commonjs/hooks/usePushNotifications.js.map +1 -1
  94. package/lib/commonjs/hooks/useRoomState.js +2 -0
  95. package/lib/commonjs/hooks/useRoomState.js.map +1 -1
  96. package/lib/commonjs/hooks/useSendMessage.js +249 -14
  97. package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
  98. package/lib/commonjs/hooks/useUnreadMessagesCounter.js +12 -14
  99. package/lib/commonjs/hooks/useUnreadMessagesCounter.js.map +1 -1
  100. package/lib/commonjs/main.js +7 -0
  101. package/lib/commonjs/main.js.map +1 -1
  102. package/lib/commonjs/networking/api-requests/auth.api.js +74 -1
  103. package/lib/commonjs/networking/api-requests/auth.api.js.map +1 -1
  104. package/lib/commonjs/networking/apiClient.js +2 -1
  105. package/lib/commonjs/networking/apiClient.js.map +1 -1
  106. package/lib/commonjs/networking/outboundQueue.js +92 -0
  107. package/lib/commonjs/networking/outboundQueue.js.map +1 -0
  108. package/lib/commonjs/networking/xmpp/createTimeoutPromise.xmpp.js +4 -1
  109. package/lib/commonjs/networking/xmpp/createTimeoutPromise.xmpp.js.map +1 -1
  110. package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js +7 -8
  111. package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
  112. package/lib/commonjs/networking/xmpp/getRoomsPaged.xmpp.js +26 -3
  113. package/lib/commonjs/networking/xmpp/getRoomsPaged.xmpp.js.map +1 -1
  114. package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js +26 -8
  115. package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
  116. package/lib/commonjs/networking/xmpp/sendTextMessage.xmpp.js +2 -1
  117. package/lib/commonjs/networking/xmpp/sendTextMessage.xmpp.js.map +1 -1
  118. package/lib/commonjs/networking/xmppClient.js +371 -26
  119. package/lib/commonjs/networking/xmppClient.js.map +1 -1
  120. package/lib/commonjs/roomStore/Middleware/unreadMidlleware.js +22 -6
  121. package/lib/commonjs/roomStore/Middleware/unreadMidlleware.js.map +1 -1
  122. package/lib/commonjs/roomStore/roomHeapSlice.js +26 -8
  123. package/lib/commonjs/roomStore/roomHeapSlice.js.map +1 -1
  124. package/lib/commonjs/roomStore/roomsSlice.js +157 -23
  125. package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
  126. package/lib/commonjs/utils/installPromiseRejectionTracker.js +83 -0
  127. package/lib/commonjs/utils/installPromiseRejectionTracker.js.map +1 -0
  128. package/lib/commonjs/utils/resendMessage.js +1 -1
  129. package/lib/commonjs/utils/resendMessage.js.map +1 -1
  130. package/lib/module/assets/icons.js +5 -1
  131. package/lib/module/assets/icons.js.map +1 -1
  132. package/lib/module/components/ContextMenu/ContextMenuComponents.js +11 -5
  133. package/lib/module/components/ContextMenu/ContextMenuComponents.js.map +1 -1
  134. package/lib/module/components/MainComponents/ChatHeader.js +7 -1
  135. package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
  136. package/lib/module/components/MainComponents/ChatRoom.js +67 -35
  137. package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
  138. package/lib/module/components/MainComponents/ChatWrapper.js +59 -14
  139. package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
  140. package/lib/module/components/MainComponents/MediaMessage.js +15 -7
  141. package/lib/module/components/MainComponents/MediaMessage.js.map +1 -1
  142. package/lib/module/components/MainComponents/MessageContainer.js +2 -2
  143. package/lib/module/components/MainComponents/MessageContainer.js.map +1 -1
  144. package/lib/module/components/MainComponents/MessageList.js +176 -31
  145. package/lib/module/components/MainComponents/MessageList.js.map +1 -1
  146. package/lib/module/components/MainComponents/ReduxWrapper.js +18 -8
  147. package/lib/module/components/MainComponents/ReduxWrapper.js.map +1 -1
  148. package/lib/module/components/MainComponents/SystemMessage.js +33 -21
  149. package/lib/module/components/MainComponents/SystemMessage.js.map +1 -1
  150. package/lib/module/components/MessageBubble/Message.js +118 -20
  151. package/lib/module/components/MessageBubble/Message.js.map +1 -1
  152. package/lib/module/components/MessageBubble/MessageInteractions.js +84 -24
  153. package/lib/module/components/MessageBubble/MessageInteractions.js.map +1 -1
  154. package/lib/module/components/Modals/AttachSheet/AttachSheet.js +15 -3
  155. package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
  156. package/lib/module/components/Modals/FilePreviewModal/DocumentViewer.js +99 -0
  157. package/lib/module/components/Modals/FilePreviewModal/DocumentViewer.js.map +1 -0
  158. package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +179 -42
  159. package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
  160. package/lib/module/components/Modals/FilePreviewModal/PdfView.js +31 -3
  161. package/lib/module/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
  162. package/lib/module/components/Modals/Modal/Modal.js +5 -1
  163. package/lib/module/components/Modals/Modal/Modal.js.map +1 -1
  164. package/lib/module/components/Modals/ModalWrapper/ModalWrapper.js +80 -41
  165. package/lib/module/components/Modals/ModalWrapper/ModalWrapper.js.map +1 -1
  166. package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +3 -3
  167. package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
  168. package/lib/module/components/Modals/styledModalComponents.js +4 -9
  169. package/lib/module/components/Modals/styledModalComponents.js.map +1 -1
  170. package/lib/module/components/styled/MediaFilePreview.js +116 -6
  171. package/lib/module/components/styled/MediaFilePreview.js.map +1 -1
  172. package/lib/module/components/styled/MessageImage.js +51 -12
  173. package/lib/module/components/styled/MessageImage.js.map +1 -1
  174. package/lib/module/components/styled/NewMessageLabel.js +8 -6
  175. package/lib/module/components/styled/NewMessageLabel.js.map +1 -1
  176. package/lib/module/components/styled/SendInput.js +54 -30
  177. package/lib/module/components/styled/SendInput.js.map +1 -1
  178. package/lib/module/components/styled/StyledInputComponents/MediaComponents.js +14 -4
  179. package/lib/module/components/styled/StyledInputComponents/MediaComponents.js.map +1 -1
  180. package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js +7 -2
  181. package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
  182. package/lib/module/components/styled/UnsupportedType.js +5 -1
  183. package/lib/module/components/styled/UnsupportedType.js.map +1 -1
  184. package/lib/module/components/styled/VideoMessage.js +61 -23
  185. package/lib/module/components/styled/VideoMessage.js.map +1 -1
  186. package/lib/module/context/MessageNotificationContext.js +7 -7
  187. package/lib/module/context/MessageNotificationContext.js.map +1 -1
  188. package/lib/module/context/xmppProvider.js +319 -37
  189. package/lib/module/context/xmppProvider.js.map +1 -1
  190. package/lib/module/helpers/chatAutoEnterer.js +2 -7
  191. package/lib/module/helpers/chatAutoEnterer.js.map +1 -1
  192. package/lib/module/helpers/historyPreloadScheduler.js +4 -1
  193. package/lib/module/helpers/historyPreloadScheduler.js.map +1 -1
  194. package/lib/module/helpers/insertMessageWithDelimiter.js +15 -5
  195. package/lib/module/helpers/insertMessageWithDelimiter.js.map +1 -1
  196. package/lib/module/helpers/keyboardLayout.js +12 -0
  197. package/lib/module/helpers/keyboardLayout.js.map +1 -0
  198. package/lib/module/helpers/mediaDimensions.js +46 -0
  199. package/lib/module/helpers/mediaDimensions.js.map +1 -0
  200. package/lib/module/helpers/mimeToExtension.js +124 -0
  201. package/lib/module/helpers/mimeToExtension.js.map +1 -0
  202. package/lib/module/helpers/normalizeRoomJid.js +15 -0
  203. package/lib/module/helpers/normalizeRoomJid.js.map +1 -0
  204. package/lib/module/helpers/resolveInitBeforeLoadUser.js +71 -0
  205. package/lib/module/helpers/resolveInitBeforeLoadUser.js.map +1 -1
  206. package/lib/module/hooks/useChatRoomFocus.js +82 -0
  207. package/lib/module/hooks/useChatRoomFocus.js.map +1 -0
  208. package/lib/module/hooks/useChatWrapperInit.js +22 -10
  209. package/lib/module/hooks/useChatWrapperInit.js.map +1 -1
  210. package/lib/module/hooks/useEventHandlers.js +9 -1
  211. package/lib/module/hooks/useEventHandlers.js.map +1 -1
  212. package/lib/module/hooks/useHeapSender.js +1 -1
  213. package/lib/module/hooks/useHeapSender.js.map +1 -1
  214. package/lib/module/hooks/useLogout.js +3 -3
  215. package/lib/module/hooks/useLogout.js.map +1 -1
  216. package/lib/module/hooks/useMessageHeapState.js +6 -2
  217. package/lib/module/hooks/useMessageHeapState.js.map +1 -1
  218. package/lib/module/hooks/usePushNotifications.js +6 -2
  219. package/lib/module/hooks/usePushNotifications.js.map +1 -1
  220. package/lib/module/hooks/useRoomState.js +2 -0
  221. package/lib/module/hooks/useRoomState.js.map +1 -1
  222. package/lib/module/hooks/useSendMessage.js +252 -17
  223. package/lib/module/hooks/useSendMessage.js.map +1 -1
  224. package/lib/module/hooks/useUnreadMessagesCounter.js +12 -14
  225. package/lib/module/hooks/useUnreadMessagesCounter.js.map +1 -1
  226. package/lib/module/main.js +1 -0
  227. package/lib/module/main.js.map +1 -1
  228. package/lib/module/networking/api-requests/auth.api.js +74 -2
  229. package/lib/module/networking/api-requests/auth.api.js.map +1 -1
  230. package/lib/module/networking/apiClient.js +2 -1
  231. package/lib/module/networking/apiClient.js.map +1 -1
  232. package/lib/module/networking/outboundQueue.js +84 -0
  233. package/lib/module/networking/outboundQueue.js.map +1 -0
  234. package/lib/module/networking/xmpp/createTimeoutPromise.xmpp.js +4 -1
  235. package/lib/module/networking/xmpp/createTimeoutPromise.xmpp.js.map +1 -1
  236. package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js +7 -8
  237. package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
  238. package/lib/module/networking/xmpp/getRoomsPaged.xmpp.js +26 -3
  239. package/lib/module/networking/xmpp/getRoomsPaged.xmpp.js.map +1 -1
  240. package/lib/module/networking/xmpp/presenceInRoom.xmpp.js +26 -8
  241. package/lib/module/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
  242. package/lib/module/networking/xmpp/sendTextMessage.xmpp.js +2 -1
  243. package/lib/module/networking/xmpp/sendTextMessage.xmpp.js.map +1 -1
  244. package/lib/module/networking/xmppClient.js +371 -26
  245. package/lib/module/networking/xmppClient.js.map +1 -1
  246. package/lib/module/roomStore/Middleware/unreadMidlleware.js +22 -6
  247. package/lib/module/roomStore/Middleware/unreadMidlleware.js.map +1 -1
  248. package/lib/module/roomStore/roomHeapSlice.js +24 -7
  249. package/lib/module/roomStore/roomHeapSlice.js.map +1 -1
  250. package/lib/module/roomStore/roomsSlice.js +154 -22
  251. package/lib/module/roomStore/roomsSlice.js.map +1 -1
  252. package/lib/module/utils/installPromiseRejectionTracker.js +78 -0
  253. package/lib/module/utils/installPromiseRejectionTracker.js.map +1 -0
  254. package/lib/module/utils/resendMessage.js +1 -1
  255. package/lib/module/utils/resendMessage.js.map +1 -1
  256. package/lib/typescript/assets/icons.d.ts +8 -4
  257. package/lib/typescript/assets/icons.d.ts.map +1 -1
  258. package/lib/typescript/components/ContextMenu/ContextMenuComponents.d.ts.map +1 -1
  259. package/lib/typescript/components/MainComponents/ChatHeader.d.ts.map +1 -1
  260. package/lib/typescript/components/MainComponents/ChatRoom.d.ts.map +1 -1
  261. package/lib/typescript/components/MainComponents/ChatWrapper.d.ts.map +1 -1
  262. package/lib/typescript/components/MainComponents/MediaMessage.d.ts +1 -0
  263. package/lib/typescript/components/MainComponents/MediaMessage.d.ts.map +1 -1
  264. package/lib/typescript/components/MainComponents/MessageContainer.d.ts.map +1 -1
  265. package/lib/typescript/components/MainComponents/MessageList.d.ts.map +1 -1
  266. package/lib/typescript/components/MainComponents/ReduxWrapper.d.ts +1 -0
  267. package/lib/typescript/components/MainComponents/ReduxWrapper.d.ts.map +1 -1
  268. package/lib/typescript/components/MainComponents/SystemMessage.d.ts +0 -7
  269. package/lib/typescript/components/MainComponents/SystemMessage.d.ts.map +1 -1
  270. package/lib/typescript/components/MessageBubble/Message.d.ts.map +1 -1
  271. package/lib/typescript/components/MessageBubble/MessageInteractions.d.ts +4 -2
  272. package/lib/typescript/components/MessageBubble/MessageInteractions.d.ts.map +1 -1
  273. package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts.map +1 -1
  274. package/lib/typescript/components/Modals/FilePreviewModal/DocumentViewer.d.ts +29 -0
  275. package/lib/typescript/components/Modals/FilePreviewModal/DocumentViewer.d.ts.map +1 -0
  276. package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts +0 -1
  277. package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts.map +1 -1
  278. package/lib/typescript/components/Modals/FilePreviewModal/PdfView.d.ts.map +1 -1
  279. package/lib/typescript/components/Modals/Modal/Modal.d.ts.map +1 -1
  280. package/lib/typescript/components/Modals/ModalWrapper/ModalWrapper.d.ts +6 -0
  281. package/lib/typescript/components/Modals/ModalWrapper/ModalWrapper.d.ts.map +1 -1
  282. package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
  283. package/lib/typescript/components/Modals/styledModalComponents.d.ts.map +1 -1
  284. package/lib/typescript/components/styled/MediaFilePreview.d.ts.map +1 -1
  285. package/lib/typescript/components/styled/MessageImage.d.ts.map +1 -1
  286. package/lib/typescript/components/styled/NewMessageLabel.d.ts +1 -5
  287. package/lib/typescript/components/styled/NewMessageLabel.d.ts.map +1 -1
  288. package/lib/typescript/components/styled/SendInput.d.ts.map +1 -1
  289. package/lib/typescript/components/styled/StyledInputComponents/MediaComponents.d.ts +9 -1
  290. package/lib/typescript/components/styled/StyledInputComponents/MediaComponents.d.ts.map +1 -1
  291. package/lib/typescript/components/styled/StyledInputComponents/StyledInputComponents.d.ts.map +1 -1
  292. package/lib/typescript/components/styled/UnsupportedType.d.ts +1 -0
  293. package/lib/typescript/components/styled/UnsupportedType.d.ts.map +1 -1
  294. package/lib/typescript/components/styled/VideoMessage.d.ts.map +1 -1
  295. package/lib/typescript/context/xmppProvider.d.ts +1 -0
  296. package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
  297. package/lib/typescript/helpers/chatAutoEnterer.d.ts.map +1 -1
  298. package/lib/typescript/helpers/historyPreloadScheduler.d.ts.map +1 -1
  299. package/lib/typescript/helpers/insertMessageWithDelimiter.d.ts.map +1 -1
  300. package/lib/typescript/helpers/keyboardLayout.d.ts +9 -0
  301. package/lib/typescript/helpers/keyboardLayout.d.ts.map +1 -0
  302. package/lib/typescript/helpers/mediaDimensions.d.ts +9 -0
  303. package/lib/typescript/helpers/mediaDimensions.d.ts.map +1 -0
  304. package/lib/typescript/helpers/mimeToExtension.d.ts +37 -0
  305. package/lib/typescript/helpers/mimeToExtension.d.ts.map +1 -0
  306. package/lib/typescript/helpers/normalizeRoomJid.d.ts +2 -0
  307. package/lib/typescript/helpers/normalizeRoomJid.d.ts.map +1 -0
  308. package/lib/typescript/helpers/resolveInitBeforeLoadUser.d.ts +18 -0
  309. package/lib/typescript/helpers/resolveInitBeforeLoadUser.d.ts.map +1 -1
  310. package/lib/typescript/hooks/useChatRoomFocus.d.ts +42 -0
  311. package/lib/typescript/hooks/useChatRoomFocus.d.ts.map +1 -0
  312. package/lib/typescript/hooks/useChatWrapperInit.d.ts.map +1 -1
  313. package/lib/typescript/hooks/useEventHandlers.d.ts +6 -0
  314. package/lib/typescript/hooks/useEventHandlers.d.ts.map +1 -1
  315. package/lib/typescript/hooks/useHeapSender.d.ts.map +1 -1
  316. package/lib/typescript/hooks/useMessageHeapState.d.ts +2 -0
  317. package/lib/typescript/hooks/useMessageHeapState.d.ts.map +1 -1
  318. package/lib/typescript/hooks/usePushNotifications.d.ts.map +1 -1
  319. package/lib/typescript/hooks/useRoomState.d.ts +1 -0
  320. package/lib/typescript/hooks/useRoomState.d.ts.map +1 -1
  321. package/lib/typescript/hooks/useSendMessage.d.ts +2 -1
  322. package/lib/typescript/hooks/useSendMessage.d.ts.map +1 -1
  323. package/lib/typescript/hooks/useUnreadMessagesCounter.d.ts.map +1 -1
  324. package/lib/typescript/main.d.ts +1 -0
  325. package/lib/typescript/main.d.ts.map +1 -1
  326. package/lib/typescript/networking/api-requests/auth.api.d.ts +3 -0
  327. package/lib/typescript/networking/api-requests/auth.api.d.ts.map +1 -1
  328. package/lib/typescript/networking/apiClient.d.ts.map +1 -1
  329. package/lib/typescript/networking/outboundQueue.d.ts +57 -0
  330. package/lib/typescript/networking/outboundQueue.d.ts.map +1 -0
  331. package/lib/typescript/networking/xmpp/createTimeoutPromise.xmpp.d.ts.map +1 -1
  332. package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts +1 -1
  333. package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts.map +1 -1
  334. package/lib/typescript/networking/xmpp/getRoomsPaged.xmpp.d.ts +1 -1
  335. package/lib/typescript/networking/xmpp/getRoomsPaged.xmpp.d.ts.map +1 -1
  336. package/lib/typescript/networking/xmpp/presenceInRoom.xmpp.d.ts.map +1 -1
  337. package/lib/typescript/networking/xmpp/sendTextMessage.xmpp.d.ts.map +1 -1
  338. package/lib/typescript/networking/xmppClient.d.ts +58 -5
  339. package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
  340. package/lib/typescript/roomStore/Middleware/unreadMidlleware.d.ts.map +1 -1
  341. package/lib/typescript/roomStore/roomHeapSlice.d.ts +22 -1
  342. package/lib/typescript/roomStore/roomHeapSlice.d.ts.map +1 -1
  343. package/lib/typescript/roomStore/roomsSlice.d.ts +8 -1
  344. package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
  345. package/lib/typescript/types/models/media.model.d.ts +1 -0
  346. package/lib/typescript/types/models/media.model.d.ts.map +1 -1
  347. package/lib/typescript/types/models/xmpp.model.d.ts +1 -1
  348. package/lib/typescript/types/models/xmpp.model.d.ts.map +1 -1
  349. package/lib/typescript/types/types.d.ts +10 -0
  350. package/lib/typescript/types/types.d.ts.map +1 -1
  351. package/lib/typescript/utils/installPromiseRejectionTracker.d.ts +20 -0
  352. package/lib/typescript/utils/installPromiseRejectionTracker.d.ts.map +1 -0
  353. package/lib/typescript/utils/resendMessage.d.ts.map +1 -1
  354. package/package.json +18 -2
  355. package/src/assets/icons.tsx +23 -14
  356. package/src/components/ContextMenu/ContextMenuComponents.tsx +10 -5
  357. package/src/components/MainComponents/ChatHeader.tsx +5 -1
  358. package/src/components/MainComponents/ChatRoom.tsx +81 -61
  359. package/src/components/MainComponents/ChatWrapper.tsx +100 -21
  360. package/src/components/MainComponents/MediaMessage.tsx +18 -8
  361. package/src/components/MainComponents/MessageContainer.tsx +4 -2
  362. package/src/components/MainComponents/MessageList.tsx +185 -31
  363. package/src/components/MainComponents/ReduxWrapper.tsx +19 -9
  364. package/src/components/MainComponents/SystemMessage.tsx +38 -26
  365. package/src/components/MessageBubble/Message.tsx +110 -27
  366. package/src/components/MessageBubble/MessageInteractions.tsx +98 -29
  367. package/src/components/Modals/AttachSheet/AttachSheet.tsx +17 -3
  368. package/src/components/Modals/FilePreviewModal/DocumentViewer.tsx +93 -0
  369. package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +182 -37
  370. package/src/components/Modals/FilePreviewModal/PdfView.tsx +32 -4
  371. package/src/components/Modals/Modal/Modal.tsx +4 -1
  372. package/src/components/Modals/ModalWrapper/ModalWrapper.tsx +77 -44
  373. package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +19 -15
  374. package/src/components/Modals/styledModalComponents.tsx +4 -9
  375. package/src/components/styled/MediaFilePreview.tsx +111 -5
  376. package/src/components/styled/MessageImage.tsx +58 -14
  377. package/src/components/styled/NewMessageLabel.tsx +8 -5
  378. package/src/components/styled/SendInput.tsx +67 -29
  379. package/src/components/styled/StyledInputComponents/MediaComponents.tsx +15 -5
  380. package/src/components/styled/StyledInputComponents/StyledInputComponents.tsx +7 -2
  381. package/src/components/styled/UnsupportedType.tsx +7 -1
  382. package/src/components/styled/VideoMessage.tsx +59 -18
  383. package/src/context/MessageNotificationContext.tsx +8 -8
  384. package/src/context/xmppProvider.tsx +337 -32
  385. package/src/helpers/chatAutoEnterer.ts +2 -8
  386. package/src/helpers/historyPreloadScheduler.ts +4 -1
  387. package/src/helpers/insertMessageWithDelimiter.ts +22 -15
  388. package/src/helpers/keyboardLayout.ts +18 -0
  389. package/src/helpers/mediaDimensions.ts +47 -0
  390. package/src/helpers/mimeToExtension.ts +135 -0
  391. package/src/helpers/normalizeRoomJid.ts +6 -0
  392. package/src/helpers/resolveInitBeforeLoadUser.ts +79 -0
  393. package/src/hooks/useChatRoomFocus.ts +95 -0
  394. package/src/hooks/useChatWrapperInit.ts +51 -46
  395. package/src/hooks/useEventHandlers.tsx +24 -1
  396. package/src/hooks/useHeapSender.tsx +2 -1
  397. package/src/hooks/useLogout.tsx +3 -3
  398. package/src/hooks/useMessageHeapState.tsx +6 -2
  399. package/src/hooks/usePushNotifications.ts +21 -8
  400. package/src/hooks/useRoomState.tsx +4 -0
  401. package/src/hooks/useSendMessage.tsx +333 -17
  402. package/src/hooks/useUnreadMessagesCounter.ts +13 -16
  403. package/src/main.ts +1 -0
  404. package/src/networking/api-requests/auth.api.ts +60 -2
  405. package/src/networking/apiClient.ts +2 -1
  406. package/src/networking/outboundQueue.ts +98 -0
  407. package/src/networking/xmpp/createTimeoutPromise.xmpp.ts +5 -1
  408. package/src/networking/xmpp/flushLastViewedToPrivateStore.ts +11 -13
  409. package/src/networking/xmpp/getRoomsPaged.xmpp.ts +27 -3
  410. package/src/networking/xmpp/presenceInRoom.xmpp.ts +24 -9
  411. package/src/networking/xmpp/sendTextMessage.xmpp.ts +2 -1
  412. package/src/networking/xmppClient.ts +399 -31
  413. package/src/roomStore/Middleware/unreadMidlleware.tsx +23 -5
  414. package/src/roomStore/roomHeapSlice.ts +47 -4
  415. package/src/roomStore/roomsSlice.ts +177 -27
  416. package/src/types/models/media.model.ts +3 -0
  417. package/src/types/models/xmpp.model.ts +2 -1
  418. package/src/types/types.ts +25 -0
  419. package/src/utils/installPromiseRejectionTracker.ts +91 -0
  420. package/src/utils/resendMessage.ts +2 -1
@@ -1,4 +1,4 @@
1
- import React, { useMemo } from 'react';
1
+ import React, { useEffect, useState } from 'react';
2
2
  import styled from 'styled-components/native';
3
3
  import {
4
4
  CenterContainer,
@@ -11,18 +11,94 @@ import Button from '../../styled/Button';
11
11
  import { RootState } from '../../../roomStore';
12
12
  import { FullScreenImage } from '../../styled/StyledInputComponents/MediaComponents';
13
13
  import { setActiveFile } from '../../../roomStore/chatSettingsSlice';
14
- import { Alert, Text, View, Platform } from 'react-native';
15
- import { Video, ResizeMode } from 'expo-av';
14
+ import {
15
+ Alert,
16
+ Text,
17
+ View,
18
+ Platform,
19
+ TouchableOpacity,
20
+ StyleSheet,
21
+ } from 'react-native';
22
+ import { useVideoPlayer, VideoView } from 'expo-video';
23
+ import { PlayIcon } from '../../../assets/icons';
16
24
  import * as FileSystem from 'expo-file-system/legacy';
17
25
  import * as MediaLibrary from 'expo-media-library';
18
26
  import { useToast } from '../../../context/ToastContext';
19
27
  import PdfViewer from './PdfView';
28
+ import DocumentViewer from './DocumentViewer';
29
+ import AudioMessage from '../../styled/AudioMessage';
30
+ import { ensureFilenameHasExtension } from '../../../helpers/mimeToExtension';
31
+
32
+ // MIME types Google's gview embed renders reliably. Everything else
33
+ // falls through to the info-card so the user can still download.
34
+ const GVIEW_PREVIEWABLE = new Set<string>([
35
+ 'application/msword',
36
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
37
+ 'application/vnd.ms-excel',
38
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
39
+ 'application/vnd.ms-powerpoint',
40
+ 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
41
+ 'text/plain',
42
+ 'text/csv',
43
+ 'application/rtf',
44
+ ]);
45
+ const isGviewPreviewable = (mime: string | undefined | null) => {
46
+ if (!mime) {return false;}
47
+ return GVIEW_PREVIEWABLE.has(mime.toLowerCase().split(';')[0]!.trim());
48
+ };
49
+
50
+ // Full-screen video preview on expo-video (expo-av <Video> is deprecated
51
+ // and rendered blank on Android). `contentFit: contain` fits the clip to
52
+ // the area with the surrounding letterbox painted as the view's own
53
+ // (transparent → theme) background, NOT black. `textureView` so the play
54
+ // overlay composites on top and nothing is clipped on Android.
55
+ const ModalVideo: React.FC<{ uri: string }> = ({ uri }) => {
56
+ const [showPlay, setShowPlay] = useState(true);
20
57
 
21
- export const FullScreenVideo = styled.View`
22
- width: 100%;
23
- height: 100%;
24
- object-fit: contain;
25
- `;
58
+ const player = useVideoPlayer(uri, (p) => {
59
+ p.muted = false;
60
+ });
61
+
62
+ useEffect(() => {
63
+ const sub = player.addListener('playingChange', ({ isPlaying }) => {
64
+ if (isPlaying) {setShowPlay(false);}
65
+ });
66
+ return () => sub.remove();
67
+ }, [player]);
68
+
69
+ const handlePlay = () => {
70
+ setShowPlay(false);
71
+ player.play();
72
+ };
73
+
74
+ return (
75
+ <View style={{ flex: 1, width: '100%' }}>
76
+ <VideoView
77
+ player={player}
78
+ style={{ flex: 1, backgroundColor: 'transparent' }}
79
+ contentFit="contain"
80
+ nativeControls
81
+ surfaceType="textureView"
82
+ allowsFullscreen
83
+ />
84
+ {/* Play affordance shown immediately on open; tapping starts
85
+ playback and the native controls take over. */}
86
+ {showPlay && (
87
+ <TouchableOpacity
88
+ activeOpacity={0.8}
89
+ onPress={handlePlay}
90
+ style={StyleSheet.absoluteFillObject}
91
+ >
92
+ <View style={styles.playOverlay}>
93
+ <View style={styles.playButton}>
94
+ <PlayIcon width={28} height={28} />
95
+ </View>
96
+ </View>
97
+ </TouchableOpacity>
98
+ )}
99
+ </View>
100
+ );
101
+ };
26
102
 
27
103
  interface FilePreviewModalProps {
28
104
  handleCloseModal: any;
@@ -38,7 +114,7 @@ const FilePreviewModal: React.FC<FilePreviewModalProps> = ({
38
114
  (state: RootState) => state.chatSettingStore
39
115
  );
40
116
 
41
- if (!activeFile) {return;}
117
+ if (!activeFile) {return null;}
42
118
 
43
119
  const requestStoragePermission = async () => {
44
120
  try {
@@ -61,10 +137,10 @@ const FilePreviewModal: React.FC<FilePreviewModalProps> = ({
61
137
  }
62
138
 
63
139
  try {
64
- let fileName = activeFile.fileName || `media_${Date.now()}`;
65
- if (!fileName.includes('.')) {
66
- fileName += activeFile.mimetype.startsWith('image/') ? '.jpg' : '.mp4';
67
- }
140
+ const fileName = ensureFilenameHasExtension(
141
+ activeFile.fileName,
142
+ activeFile.mimetype
143
+ );
68
144
 
69
145
  const filePath = FileSystem.cacheDirectory + fileName;
70
146
  const download = await FileSystem.downloadAsync(activeFile.fileURL, filePath);
@@ -87,7 +163,14 @@ const FilePreviewModal: React.FC<FilePreviewModalProps> = ({
87
163
 
88
164
  const saveFileToDownloads = async () => {
89
165
  try {
90
- const fileName = activeFile.fileName || `file_${Date.now()}`;
166
+ // Always include a valid extension on the cache filename. expo-media-
167
+ // library's createAssetAsync inspects the URI's extension and throws
168
+ // "Could not get the file's extension" when missing — see bug #9 in
169
+ // sdk-bug-tracker.md.
170
+ const fileName = ensureFilenameHasExtension(
171
+ activeFile.fileName,
172
+ activeFile.mimetype
173
+ );
91
174
  const filePath = FileSystem.cacheDirectory + fileName;
92
175
  const download = await FileSystem.downloadAsync(activeFile.fileURL, filePath);
93
176
 
@@ -135,52 +218,93 @@ const FilePreviewModal: React.FC<FilePreviewModalProps> = ({
135
218
  handleCloseModal?.();
136
219
  };
137
220
 
138
- const getMediaComponent = useMemo(() => {
221
+ // NOTE: plain computed value, NOT useMemo. It sits AFTER the
222
+ // `if (!activeFile) return` guard above, so as a hook it would run
223
+ // conditionally (skipped when activeFile is null) — changing the hook
224
+ // count between renders and throwing "rendered more hooks than during
225
+ // the previous render", which crashed the modal the instant you tapped
226
+ // a video/image to open it. Recomputing this on each render is cheap.
227
+ const getMediaComponent: React.ReactNode = (() => {
139
228
  switch (true) {
140
229
  case activeFile.mimetype.startsWith('image/'):
141
230
  return (
142
231
  <FullScreenImage
143
- src={
144
- activeFile.fileURL ||
145
- 'https://as2.ftcdn.net/v2/jpg/02/51/95/53/1000_F_251955356_FAQH0U1y1TZw3ZcdPGybwUkH90a3VAhb.jpg'
146
- }
147
- alt={activeFile.fileName}
232
+ source={{
233
+ uri:
234
+ activeFile.fileURL ||
235
+ 'https://as2.ftcdn.net/v2/jpg/02/51/95/53/1000_F_251955356_FAQH0U1y1TZw3ZcdPGybwUkH90a3VAhb.jpg',
236
+ }}
237
+ resizeMode="contain"
238
+ accessibilityLabel={activeFile.fileName}
148
239
  />
149
240
  );
150
241
  case activeFile.mimetype.startsWith('video/'):
242
+ return <ModalVideo uri={activeFile.fileURL} />;
243
+ case activeFile.mimetype.startsWith('audio/'):
151
244
  return (
152
- <Video
245
+ <View
153
246
  style={{
154
247
  width: '100%',
155
- height: '100%',
248
+ padding: 20,
249
+ gap: 12,
250
+ backgroundColor: '#FFF8ED',
251
+ borderRadius: 16,
156
252
  }}
157
- source={{ uri: activeFile.fileURL }}
158
- useNativeControls
159
- resizeMode={ResizeMode.CONTAIN}
160
- shouldPlay={false}
161
- />
253
+ >
254
+ <Text style={{ fontSize: 16, fontWeight: '600' }}>
255
+ {ensureFilenameHasExtension(
256
+ activeFile.fileName,
257
+ activeFile.mimetype
258
+ )}
259
+ </Text>
260
+ <AudioMessage src={activeFile.fileURL} />
261
+ </View>
162
262
  );
163
263
  case activeFile.mimetype === 'application/pdf':
164
264
  return <PdfViewer pdfUrl={activeFile.fileURL} />;
165
- default:
265
+ default: {
266
+ const displayName = ensureFilenameHasExtension(
267
+ activeFile.fileName,
268
+ activeFile.mimetype
269
+ );
270
+ // Office docs (.docx / .xlsx / .pptx / .doc / .xls / .ppt /
271
+ // .txt / .csv / .rtf) → render inline via Google's gview embed
272
+ // — fixes the "blank preview" complaint for docs (bug #9).
273
+ if (isGviewPreviewable(activeFile.mimetype)) {
274
+ return (
275
+ <DocumentViewer
276
+ url={activeFile.fileURL}
277
+ fileName={displayName}
278
+ />
279
+ );
280
+ }
281
+ // True last-resort fallback for genuinely unrenderable types
282
+ // (binary blobs, exotic MIMEs). Friendly info card with the
283
+ // filename so the user can still download.
166
284
  return (
167
285
  <View
168
286
  style={{
169
287
  backgroundColor: '#FFF8ED',
170
288
  borderRadius: 16,
171
- display: 'flex',
172
- padding: 16,
289
+ padding: 20,
290
+ gap: 8,
173
291
  }}
174
292
  >
175
- <Text>
176
- Unable to open the uploaded document. The file format is not
177
- supported by the system. Please upload a file in a compatible
178
- format. You still can download this file.
293
+ <Text style={{ fontSize: 16, fontWeight: '600' }}>
294
+ {displayName}
295
+ </Text>
296
+ <Text style={{ color: '#666' }}>
297
+ {activeFile.mimetype || 'unknown type'}
298
+ </Text>
299
+ <Text style={{ marginTop: 8 }}>
300
+ This file format can't be previewed inline. Tap the save icon
301
+ above to download it.
179
302
  </Text>
180
303
  </View>
181
304
  );
305
+ }
182
306
  }
183
- }, [activeFile]);
307
+ })();
184
308
 
185
309
  return (
186
310
  <ModalContainerFullScreen>
@@ -199,10 +323,15 @@ const FilePreviewModal: React.FC<FilePreviewModalProps> = ({
199
323
  <CenterContainer
200
324
  style={{
201
325
  display: 'flex',
202
- height: '100%',
326
+ flex: 1,
203
327
  justifyContent: 'center',
204
- overflow: 'hidden',
328
+ // NOTE: do NOT set overflow:'hidden' here — on Android it clips
329
+ // hardware-accelerated children (expo-av Video TextureView and
330
+ // react-native-webview) to nothing, so video/PDF/doc previews
331
+ // render blank while plain <Image> survives.
332
+ overflow: 'visible',
205
333
  padding: 16,
334
+ paddingBottom: 48,
206
335
  }}
207
336
  >
208
337
  {getMediaComponent}
@@ -212,4 +341,20 @@ const FilePreviewModal: React.FC<FilePreviewModalProps> = ({
212
341
  );
213
342
  };
214
343
 
344
+ const styles = StyleSheet.create({
345
+ playOverlay: {
346
+ ...StyleSheet.absoluteFillObject,
347
+ justifyContent: 'center',
348
+ alignItems: 'center',
349
+ },
350
+ playButton: {
351
+ width: 64,
352
+ height: 64,
353
+ borderRadius: 32,
354
+ backgroundColor: 'rgba(0, 0, 0, 0.55)',
355
+ justifyContent: 'center',
356
+ alignItems: 'center',
357
+ },
358
+ });
359
+
215
360
  export default FilePreviewModal;
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { ActivityIndicator, StyleSheet, Text, View } from 'react-native';
2
+ import { ActivityIndicator, Platform, StyleSheet, Text, View } from 'react-native';
3
3
  import { WebView } from 'react-native-webview';
4
4
  import * as FileSystem from 'expo-file-system/legacy';
5
5
 
@@ -10,13 +10,20 @@ interface PdfViewerProps {
10
10
  const PdfViewer: React.FC<PdfViewerProps> = ({ pdfUrl }) => {
11
11
  const [localUri, setLocalUri] = useState<string | null>(null);
12
12
  const [error, setError] = useState<string | null>(null);
13
+ // Android's WebView has NO native PDF renderer, so a file:// (or direct)
14
+ // PDF loads blank. Route it through Google's gview embed using the
15
+ // (public) remote URL — same approach as DocumentViewer for office docs.
16
+ // iOS WKWebView renders PDFs natively, so we download + show the file.
17
+ const isAndroid = Platform.OS === 'android';
13
18
 
14
19
  useEffect(() => {
20
+ if (isAndroid) {
21
+ return;
22
+ }
15
23
  let cancelled = false;
16
24
  const run = async () => {
17
25
  try {
18
- const target =
19
- FileSystem.cacheDirectory + `pdf-${Date.now()}.pdf`;
26
+ const target = FileSystem.cacheDirectory + `pdf-${Date.now()}.pdf`;
20
27
  const result = await FileSystem.downloadAsync(pdfUrl, target);
21
28
  if (cancelled) {return;}
22
29
  setLocalUri(result.uri);
@@ -30,7 +37,28 @@ const PdfViewer: React.FC<PdfViewerProps> = ({ pdfUrl }) => {
30
37
  return () => {
31
38
  cancelled = true;
32
39
  };
33
- }, [pdfUrl]);
40
+ }, [pdfUrl, isAndroid]);
41
+
42
+ if (isAndroid) {
43
+ const gviewUrl = `https://docs.google.com/gview?embedded=true&url=${encodeURIComponent(
44
+ pdfUrl
45
+ )}`;
46
+ return (
47
+ <View style={styles.container}>
48
+ <WebView
49
+ source={{ uri: gviewUrl }}
50
+ style={styles.webview}
51
+ originWhitelist={['*']}
52
+ startInLoadingState
53
+ renderLoading={() => (
54
+ <View style={styles.center}>
55
+ <ActivityIndicator size="large" />
56
+ </View>
57
+ )}
58
+ />
59
+ </View>
60
+ );
61
+ }
34
62
 
35
63
  if (error) {
36
64
  return (
@@ -39,7 +39,10 @@ const Modal: React.FC<ModalProps> = ({ children, modal, setOpenModal }) => {
39
39
  };
40
40
  return (
41
41
  modal && (
42
- <ModalBackground id="modal-background" style={{ position: 'absolute' }}>
42
+ <ModalBackground
43
+ id="modal-background"
44
+ style={{ position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 }}
45
+ >
43
46
  {renderModalContent()}
44
47
  {children}
45
48
  </ModalBackground>
@@ -9,7 +9,7 @@ import {
9
9
  } from '../styledModalComponents';
10
10
  import { TextareaInput } from '../../styled/StyledInputComponents/StyledInputComponents';
11
11
  import Button from '../../styled/Button';
12
- import { Modal, Text, TextInput } from 'react-native';
12
+ import { Modal, Text, TextInput, View, StyleSheet } from 'react-native';
13
13
 
14
14
  interface ModalWrapperProps {
15
15
  iconTitle?: any;
@@ -22,6 +22,12 @@ interface ModalWrapperProps {
22
22
  setTextarea?: (value: string) => void;
23
23
  handleCloseModal: () => void;
24
24
  handleClick: () => void;
25
+ /**
26
+ * When true, render a small centered dialog instead of the default
27
+ * full-screen container. Used for confirm-style modals (Delete, Leave
28
+ * room) where edge-to-edge feels too heavy.
29
+ */
30
+ compact?: boolean;
25
31
  }
26
32
 
27
33
  export const ModalWrapper: FC<ModalWrapperProps> = ({
@@ -35,6 +41,7 @@ export const ModalWrapper: FC<ModalWrapperProps> = ({
35
41
  setTextarea,
36
42
  handleCloseModal,
37
43
  handleClick,
44
+ compact = false,
38
45
  }) => {
39
46
  const textareaRef = useRef<TextInput>(null);
40
47
 
@@ -46,6 +53,47 @@ export const ModalWrapper: FC<ModalWrapperProps> = ({
46
53
  // }
47
54
  // };
48
55
 
56
+ const inner = (
57
+ <>
58
+ <CloseButton onPress={handleCloseModal}>
59
+ <Text style={{ fontSize: 24 }}>&times;</Text>
60
+ </CloseButton>
61
+ {IconTitle ? <IconTitle /> : <ModalTitle>{title}</ModalTitle>}
62
+ {description && <ModalDescription>{description}</ModalDescription>}
63
+ {isTextarea && (
64
+ <GroupContainer
65
+ style={{ flexDirection: 'column', position: 'relative' }}
66
+ />
67
+ )}
68
+ {!buttonText && <GroupContainer />}
69
+ <GroupContainer>
70
+ <Button
71
+ onPress={handleCloseModal}
72
+ text={'Cancel'}
73
+ style={{ width: '100%' }}
74
+ unstyled
75
+ variant="outlined"
76
+ />
77
+ {buttonText && (
78
+ <Button
79
+ onPress={handleClick}
80
+ text={buttonText}
81
+ // White label on the filled (e.g. red Delete) button. Button
82
+ // applies an inline `color: color || 'black'` that overrides
83
+ // the filled-variant white, so pass it explicitly.
84
+ color="#FFFFFF"
85
+ style={{
86
+ width: '100%',
87
+ backgroundColor: backgroundColorButton,
88
+ }}
89
+ unstyled
90
+ variant="filled"
91
+ />
92
+ )}
93
+ </GroupContainer>
94
+ </>
95
+ );
96
+
49
97
  return (
50
98
  <Modal
51
99
  transparent
@@ -54,50 +102,35 @@ export const ModalWrapper: FC<ModalWrapperProps> = ({
54
102
  onRequestClose={handleCloseModal}
55
103
  >
56
104
  <ModalBackground>
57
- <ModalContainer style={{ maxWidth: 640 }}>
58
- <CloseButton onPress={handleCloseModal}>
59
- <Text style={{ fontSize: 24 }}>&times;</Text>
60
- </CloseButton>
61
- {IconTitle ? <IconTitle /> : <ModalTitle>{title}</ModalTitle>}
62
- {description && <ModalDescription>{description}</ModalDescription>}
63
- {isTextarea && (
64
- <GroupContainer
65
- style={{ flexDirection: 'column', position: 'relative' }}
66
- >
67
- {/* <TextareaInput
68
- ref={textareaRef}
69
- onInput={handleInput}
70
- id="additionalDetails"
71
- value={textarea}
72
- onChangeText={(text) => setTextarea(text)}
73
- placeholder="Additional Details"
74
- /> */}
75
- </GroupContainer>
76
- )}
77
- {!buttonText && <GroupContainer />}
78
- <GroupContainer>
79
- <Button
80
- onPress={handleCloseModal}
81
- text={'Cancel'}
82
- style={{ width: '100%' }}
83
- unstyled
84
- variant="outlined"
85
- />
86
- {buttonText && (
87
- <Button
88
- onPress={handleClick}
89
- text={buttonText}
90
- style={{
91
- width: '100%',
92
- backgroundColor: backgroundColorButton,
93
- }}
94
- unstyled
95
- variant="filled"
96
- />
97
- )}
98
- </GroupContainer>
99
- </ModalContainer>
105
+ {compact ? (
106
+ // Dedicated small centered dialog. The base ModalContainer is
107
+ // flex:1 / width:100% / height:100% (full-screen); style-merge
108
+ // overrides proved unreliable, so confirm-style modals render in
109
+ // their own bounded View instead — never full-screen (#14).
110
+ // (Upstream also shrank this modal; this keeps that intent while
111
+ // adding the white filled-button label via `inner` below.)
112
+ <View style={styles.compactDialog}>{inner}</View>
113
+ ) : (
114
+ <ModalContainer style={{ maxWidth: 640 }}>{inner}</ModalContainer>
115
+ )}
100
116
  </ModalBackground>
101
117
  </Modal>
102
118
  );
103
119
  };
120
+
121
+ const styles = StyleSheet.create({
122
+ compactDialog: {
123
+ width: '85%',
124
+ maxWidth: 360,
125
+ alignSelf: 'center',
126
+ backgroundColor: '#fff',
127
+ borderRadius: 16,
128
+ padding: 24,
129
+ gap: 16,
130
+ shadowColor: '#000',
131
+ shadowOffset: { width: 0, height: 4 },
132
+ shadowOpacity: 0.2,
133
+ shadowRadius: 12,
134
+ elevation: 8,
135
+ },
136
+ });
@@ -285,22 +285,26 @@ const UserProfileModal: React.FC<UserProfileModalProps> = ({
285
285
  </LabelData>
286
286
  </BorderedContainer>
287
287
 
288
- {selectedUser && (
288
+ {selectedUser && !config?.disableMemberProfileActions && (
289
289
  <>
290
- <ActionButton
291
- StartIcon={<ChatIcon />}
292
- onPress={handlePrivateMessage}
293
- variant="filled"
294
- >
295
- <Text style={{ color: '#ffffff' }}>Message</Text>
296
- </ActionButton>
297
- <ActionButton
298
- onPress={() => {}}
299
- // onPress={() => handleCopyClick(selectedUser.id)}
300
- variant="filled"
301
- >
302
- <Text style={{ color: '#ffffff' }}>Copy User Id</Text>
303
- </ActionButton>
290
+ {!config?.hideMemberSendMessageAction && (
291
+ <ActionButton
292
+ StartIcon={<ChatIcon />}
293
+ onPress={handlePrivateMessage}
294
+ variant="filled"
295
+ >
296
+ <Text style={{ color: '#ffffff' }}>Message</Text>
297
+ </ActionButton>
298
+ )}
299
+ {!config?.hideMemberCopyIdAction && (
300
+ <ActionButton
301
+ onPress={() => {}}
302
+ // onPress={() => handleCopyClick(selectedUser.id)}
303
+ variant="filled"
304
+ >
305
+ <Text style={{ color: '#ffffff' }}>Copy User Id</Text>
306
+ </ActionButton>
307
+ )}
304
308
  </>
305
309
  )}
306
310
 
@@ -21,17 +21,12 @@ export const CloseButton = styled.TouchableOpacity`
21
21
  font-size: 20px;
22
22
  cursor: pointer;
23
23
  color: #888;
24
-
25
- &:hover {
26
- color: #555;
27
- background-color: #dddddd;
28
- }
29
24
  `;
30
25
 
31
26
  export const ModalContainer = styled.View`
32
- flex: 1;
33
- width: 100%;
34
- height: 100%;
27
+ // flex: 1;
28
+ // width: 100%;
29
+ // height: 100%;
35
30
  background: white;
36
31
  padding: 32px 64px;
37
32
  box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.2);
@@ -57,7 +52,7 @@ export const ModalDescription = styled.Text`
57
52
 
58
53
  export const GroupContainer = styled.View`
59
54
  display: flex;
60
- gap: 32px;
55
+ gap: 16px;
61
56
  width: 100%;
62
57
  padding: 0;
63
58
  `;