@droppii-org/chat-mobile 0.2.6 → 0.2.8

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 (398) hide show
  1. package/lib/module/components/AttachmentPreview.js +250 -0
  2. package/lib/module/components/AttachmentPreview.js.map +1 -0
  3. package/lib/module/components/MediaViewer/index.js +2 -0
  4. package/lib/module/components/MediaViewer/index.js.map +1 -0
  5. package/lib/module/components/MediaViewerModal.js +57 -0
  6. package/lib/module/components/MediaViewerModal.js.map +1 -0
  7. package/lib/module/components/MergedImageGrid.js +173 -0
  8. package/lib/module/components/MergedImageGrid.js.map +1 -0
  9. package/lib/module/components/ThreadCard/AvatarSection.js +4 -4
  10. package/lib/module/components/ThreadCard/AvatarSection.js.map +1 -1
  11. package/lib/module/components/ThreadCard/NamePrefixIcon.js +13 -16
  12. package/lib/module/components/ThreadCard/NamePrefixIcon.js.map +1 -1
  13. package/lib/module/components/ThreadCard/ThreadCard.js +13 -33
  14. package/lib/module/components/ThreadCard/ThreadCard.js.map +1 -1
  15. package/lib/module/components/ThreadCard/thread-card.utils.js +80 -4
  16. package/lib/module/components/ThreadCard/thread-card.utils.js.map +1 -1
  17. package/lib/module/components/messages/fileMessage/index.js +26 -0
  18. package/lib/module/components/messages/fileMessage/index.js.map +1 -0
  19. package/lib/module/components/messages/imageMessage/index.js +118 -0
  20. package/lib/module/components/messages/imageMessage/index.js.map +1 -0
  21. package/lib/module/components/messages/linkMessage/index.js +122 -0
  22. package/lib/module/components/messages/linkMessage/index.js.map +1 -0
  23. package/lib/module/components/messages/mergedMessage/index.js +37 -0
  24. package/lib/module/components/messages/mergedMessage/index.js.map +1 -0
  25. package/lib/module/components/messages/styles.js +41 -0
  26. package/lib/module/components/messages/styles.js.map +1 -0
  27. package/lib/module/components/messages/textMessage/index.js +38 -0
  28. package/lib/module/components/messages/textMessage/index.js.map +1 -0
  29. package/lib/module/components/messages/types.js +14 -0
  30. package/lib/module/components/messages/types.js.map +1 -0
  31. package/lib/module/components/messages/videoMessage/index.js +110 -0
  32. package/lib/module/components/messages/videoMessage/index.js.map +1 -0
  33. package/lib/module/config/api-endpoints.js +66 -0
  34. package/lib/module/config/api-endpoints.js.map +1 -0
  35. package/lib/module/config/attachment-priority.js +81 -0
  36. package/lib/module/config/attachment-priority.js.map +1 -0
  37. package/lib/module/config/configuration.js +50 -0
  38. package/lib/module/config/configuration.js.map +1 -0
  39. package/lib/module/config/index.js +22 -0
  40. package/lib/module/config/index.js.map +1 -0
  41. package/lib/module/context/ChatContext.js +7 -6
  42. package/lib/module/context/ChatContext.js.map +1 -1
  43. package/lib/module/core/index.js +19 -1
  44. package/lib/module/core/index.js.map +1 -1
  45. package/lib/module/core/useChatListener.js +0 -14
  46. package/lib/module/core/useChatListener.js.map +1 -1
  47. package/lib/module/hooks/message/useSendMessage.js +106 -0
  48. package/lib/module/hooks/message/useSendMessage.js.map +1 -0
  49. package/lib/module/hooks/useChatMessages.js +36 -121
  50. package/lib/module/hooks/useChatMessages.js.map +1 -1
  51. package/lib/module/hooks/useConversationList.js +29 -17
  52. package/lib/module/hooks/useConversationList.js.map +1 -1
  53. package/lib/module/hooks/useImageAttachment.js +263 -0
  54. package/lib/module/hooks/useImageAttachment.js.map +1 -0
  55. package/lib/module/hooks/useLinkPreview/useLinkPreview.js +3 -2
  56. package/lib/module/hooks/useLinkPreview/useLinkPreview.js.map +1 -1
  57. package/lib/module/hooks/useMediaViewer.js +24 -0
  58. package/lib/module/hooks/useMediaViewer.js.map +1 -0
  59. package/lib/module/hooks/useSendAttachment.js +182 -0
  60. package/lib/module/hooks/useSendAttachment.js.map +1 -0
  61. package/lib/module/hooks/useVideoAttachment.js +251 -0
  62. package/lib/module/hooks/useVideoAttachment.js.map +1 -0
  63. package/lib/module/index.js +13 -1
  64. package/lib/module/index.js.map +1 -1
  65. package/lib/module/screens/MediaView/VideoPlayer.js +177 -0
  66. package/lib/module/screens/MediaView/VideoPlayer.js.map +1 -0
  67. package/lib/module/screens/MediaView/index.js +264 -0
  68. package/lib/module/screens/MediaView/index.js.map +1 -0
  69. package/lib/module/screens/chat-detail/ChatComposer.js +190 -196
  70. package/lib/module/screens/chat-detail/ChatComposer.js.map +1 -1
  71. package/lib/module/screens/chat-detail/ChatDetail.js +106 -71
  72. package/lib/module/screens/chat-detail/ChatDetail.js.map +1 -1
  73. package/lib/module/screens/chat-detail/ChatDetailHeader.js +5 -8
  74. package/lib/module/screens/chat-detail/ChatDetailHeader.js.map +1 -1
  75. package/lib/module/screens/chat-detail/ChatLinkPreview.js +1 -1
  76. package/lib/module/screens/chat-detail/ChatLinkPreview.js.map +1 -1
  77. package/lib/module/screens/chat-detail/ChatListLegend.js +5 -15
  78. package/lib/module/screens/chat-detail/ChatListLegend.js.map +1 -1
  79. package/lib/module/screens/chat-detail/components/ChatInputActions.js +51 -0
  80. package/lib/module/screens/chat-detail/components/ChatInputActions.js.map +1 -0
  81. package/lib/module/screens/chat-detail/components/ChatMessageInput.js +93 -0
  82. package/lib/module/screens/chat-detail/components/ChatMessageInput.js.map +1 -0
  83. package/lib/module/screens/chat-detail/conversationHeader.utils.js +7 -9
  84. package/lib/module/screens/chat-detail/conversationHeader.utils.js.map +1 -1
  85. package/lib/module/screens/chat-detail/hooks/useAttachmentSendHandler.js +221 -0
  86. package/lib/module/screens/chat-detail/hooks/useAttachmentSendHandler.js.map +1 -0
  87. package/lib/module/screens/chat-detail/hooks/useChatComposerAnimation.js +114 -0
  88. package/lib/module/screens/chat-detail/hooks/useChatComposerAnimation.js.map +1 -0
  89. package/lib/module/screens/chat-detail/hooks/useChatComposerState.js +26 -0
  90. package/lib/module/screens/chat-detail/hooks/useChatComposerState.js.map +1 -0
  91. package/lib/module/screens/chat-detail/index.js +0 -1
  92. package/lib/module/screens/chat-detail/index.js.map +1 -1
  93. package/lib/module/screens/chat-detail/legend/LegendChatMessage.js +32 -25
  94. package/lib/module/screens/chat-detail/legend/LegendChatMessage.js.map +1 -1
  95. package/lib/module/screens/chat-detail/legend/messageTypes.js +15 -0
  96. package/lib/module/screens/chat-detail/legend/messageTypes.js.map +1 -0
  97. package/lib/module/screens/inbox/MessagesTab.js.map +1 -1
  98. package/lib/module/services/attachmentHandlers/fileAttachmentHandler.js +61 -0
  99. package/lib/module/services/attachmentHandlers/fileAttachmentHandler.js.map +1 -0
  100. package/lib/module/services/attachmentHandlers/imageAttachmentHandler.js +54 -0
  101. package/lib/module/services/attachmentHandlers/imageAttachmentHandler.js.map +1 -0
  102. package/lib/module/services/attachmentHandlers/index.js +12 -0
  103. package/lib/module/services/attachmentHandlers/index.js.map +1 -0
  104. package/lib/module/services/attachmentHandlers/videoAttachmentHandler.js +85 -0
  105. package/lib/module/services/attachmentHandlers/videoAttachmentHandler.js.map +1 -0
  106. package/lib/module/services/attachmentOrchestrator.js +225 -0
  107. package/lib/module/services/attachmentOrchestrator.js.map +1 -0
  108. package/lib/module/services/auth.js +35 -0
  109. package/lib/module/services/auth.js.map +1 -0
  110. package/lib/module/services/endpoints.js +20 -1
  111. package/lib/module/services/endpoints.js.map +1 -1
  112. package/lib/module/services/imageUpload.js +126 -0
  113. package/lib/module/services/imageUpload.js.map +1 -0
  114. package/lib/module/store/conversation.js +1 -1
  115. package/lib/module/store/conversation.js.map +1 -1
  116. package/lib/module/store/message.js +45 -0
  117. package/lib/module/store/message.js.map +1 -0
  118. package/lib/module/translation/resources/i18n.js +22 -2
  119. package/lib/module/translation/resources/i18n.js.map +1 -1
  120. package/lib/module/types/attachment.js +2 -0
  121. package/lib/module/types/attachment.js.map +1 -0
  122. package/lib/module/types/attachmentHandler.js +20 -0
  123. package/lib/module/types/attachmentHandler.js.map +1 -0
  124. package/lib/module/types/chat.js +2 -7
  125. package/lib/module/types/chat.js.map +1 -1
  126. package/lib/module/types/imageUpload.js +2 -0
  127. package/lib/module/types/imageUpload.js.map +1 -0
  128. package/lib/module/types/message.js +1 -0
  129. package/lib/module/types/message.js.map +1 -1
  130. package/lib/module/utils/chatImageDimens.js +148 -0
  131. package/lib/module/utils/chatImageDimens.js.map +1 -0
  132. package/lib/module/utils/conversation.js +34 -13
  133. package/lib/module/utils/conversation.js.map +1 -1
  134. package/lib/module/utils/device.js +65 -0
  135. package/lib/module/utils/device.js.map +1 -0
  136. package/lib/module/utils/imageUrlOptimizer.js +41 -0
  137. package/lib/module/utils/imageUrlOptimizer.js.map +1 -0
  138. package/lib/module/utils/imageUtils.js +69 -0
  139. package/lib/module/utils/imageUtils.js.map +1 -0
  140. package/lib/module/utils/legendListMessage.js +0 -3
  141. package/lib/module/utils/legendListMessage.js.map +1 -1
  142. package/lib/module/utils/message.js +5 -8
  143. package/lib/module/utils/message.js.map +1 -1
  144. package/lib/module/utils/resolveMessageType.js +3 -0
  145. package/lib/module/utils/resolveMessageType.js.map +1 -1
  146. package/lib/module/utils/ui.js +17 -0
  147. package/lib/module/utils/ui.js.map +1 -0
  148. package/lib/module/utils/url.js +3 -3
  149. package/lib/module/utils/url.js.map +1 -1
  150. package/lib/module/utils/videoThumbnail.js +62 -0
  151. package/lib/module/utils/videoThumbnail.js.map +1 -0
  152. package/lib/typescript/src/components/AttachmentPreview.d.ts +28 -0
  153. package/lib/typescript/src/components/AttachmentPreview.d.ts.map +1 -0
  154. package/lib/typescript/src/components/MediaViewer/index.d.ts +1 -0
  155. package/lib/typescript/src/components/MediaViewer/index.d.ts.map +1 -0
  156. package/lib/typescript/src/components/MediaViewerModal.d.ts +10 -0
  157. package/lib/typescript/src/components/MediaViewerModal.d.ts.map +1 -0
  158. package/lib/typescript/src/components/MergedImageGrid.d.ts +16 -0
  159. package/lib/typescript/src/components/MergedImageGrid.d.ts.map +1 -0
  160. package/lib/typescript/src/components/ThreadCard/AvatarSection.d.ts +2 -2
  161. package/lib/typescript/src/components/ThreadCard/AvatarSection.d.ts.map +1 -1
  162. package/lib/typescript/src/components/ThreadCard/NamePrefixIcon.d.ts +3 -4
  163. package/lib/typescript/src/components/ThreadCard/NamePrefixIcon.d.ts.map +1 -1
  164. package/lib/typescript/src/components/ThreadCard/ThreadCard.d.ts.map +1 -1
  165. package/lib/typescript/src/components/ThreadCard/thread-card.utils.d.ts.map +1 -1
  166. package/lib/typescript/src/components/messages/fileMessage/index.d.ts +3 -0
  167. package/lib/typescript/src/components/messages/fileMessage/index.d.ts.map +1 -0
  168. package/lib/typescript/src/components/messages/imageMessage/index.d.ts +3 -0
  169. package/lib/typescript/src/components/messages/imageMessage/index.d.ts.map +1 -0
  170. package/lib/typescript/src/components/messages/linkMessage/index.d.ts +9 -0
  171. package/lib/typescript/src/components/messages/linkMessage/index.d.ts.map +1 -0
  172. package/lib/typescript/src/components/messages/mergedMessage/index.d.ts +3 -0
  173. package/lib/typescript/src/components/messages/mergedMessage/index.d.ts.map +1 -0
  174. package/lib/typescript/src/components/messages/styles.d.ts +36 -0
  175. package/lib/typescript/src/components/messages/styles.d.ts.map +1 -0
  176. package/lib/typescript/src/components/messages/textMessage/index.d.ts +9 -0
  177. package/lib/typescript/src/components/messages/textMessage/index.d.ts.map +1 -0
  178. package/lib/typescript/src/components/messages/types.d.ts +10 -0
  179. package/lib/typescript/src/components/messages/types.d.ts.map +1 -0
  180. package/lib/typescript/src/components/messages/videoMessage/index.d.ts +3 -0
  181. package/lib/typescript/src/components/messages/videoMessage/index.d.ts.map +1 -0
  182. package/lib/typescript/src/config/api-endpoints.d.ts +40 -0
  183. package/lib/typescript/src/config/api-endpoints.d.ts.map +1 -0
  184. package/lib/typescript/src/config/attachment-priority.d.ts +31 -0
  185. package/lib/typescript/src/config/attachment-priority.d.ts.map +1 -0
  186. package/lib/typescript/src/config/configuration.d.ts +30 -0
  187. package/lib/typescript/src/config/configuration.d.ts.map +1 -0
  188. package/lib/typescript/src/config/index.d.ts +15 -0
  189. package/lib/typescript/src/config/index.d.ts.map +1 -0
  190. package/lib/typescript/src/context/ChatContext.d.ts +1 -1
  191. package/lib/typescript/src/context/ChatContext.d.ts.map +1 -1
  192. package/lib/typescript/src/core/index.d.ts +13 -1
  193. package/lib/typescript/src/core/index.d.ts.map +1 -1
  194. package/lib/typescript/src/core/useChatListener.d.ts.map +1 -1
  195. package/lib/typescript/src/hooks/message/useSendMessage.d.ts +12 -0
  196. package/lib/typescript/src/hooks/message/useSendMessage.d.ts.map +1 -0
  197. package/lib/typescript/src/hooks/useChatMessages.d.ts +0 -1
  198. package/lib/typescript/src/hooks/useChatMessages.d.ts.map +1 -1
  199. package/lib/typescript/src/hooks/useConversationList.d.ts +2 -1
  200. package/lib/typescript/src/hooks/useConversationList.d.ts.map +1 -1
  201. package/lib/typescript/src/hooks/useImageAttachment.d.ts +20 -0
  202. package/lib/typescript/src/hooks/useImageAttachment.d.ts.map +1 -0
  203. package/lib/typescript/src/hooks/useLinkPreview/useLinkPreview.d.ts.map +1 -1
  204. package/lib/typescript/src/hooks/useMediaViewer.d.ts +13 -0
  205. package/lib/typescript/src/hooks/useMediaViewer.d.ts.map +1 -0
  206. package/lib/typescript/src/hooks/useSendAttachment.d.ts +59 -0
  207. package/lib/typescript/src/hooks/useSendAttachment.d.ts.map +1 -0
  208. package/lib/typescript/src/hooks/useVideoAttachment.d.ts +29 -0
  209. package/lib/typescript/src/hooks/useVideoAttachment.d.ts.map +1 -0
  210. package/lib/typescript/src/index.d.ts +14 -1
  211. package/lib/typescript/src/index.d.ts.map +1 -1
  212. package/lib/typescript/src/screens/MediaView/VideoPlayer.d.ts +12 -0
  213. package/lib/typescript/src/screens/MediaView/VideoPlayer.d.ts.map +1 -0
  214. package/lib/typescript/src/screens/MediaView/index.d.ts +11 -0
  215. package/lib/typescript/src/screens/MediaView/index.d.ts.map +1 -0
  216. package/lib/typescript/src/screens/chat-detail/ChatComposer.d.ts +1 -1
  217. package/lib/typescript/src/screens/chat-detail/ChatComposer.d.ts.map +1 -1
  218. package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts +1 -1
  219. package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts.map +1 -1
  220. package/lib/typescript/src/screens/chat-detail/ChatDetailHeader.d.ts +1 -1
  221. package/lib/typescript/src/screens/chat-detail/ChatDetailHeader.d.ts.map +1 -1
  222. package/lib/typescript/src/screens/chat-detail/ChatListLegend.d.ts +1 -1
  223. package/lib/typescript/src/screens/chat-detail/ChatListLegend.d.ts.map +1 -1
  224. package/lib/typescript/src/screens/chat-detail/components/ChatInputActions.d.ts +8 -0
  225. package/lib/typescript/src/screens/chat-detail/components/ChatInputActions.d.ts.map +1 -0
  226. package/lib/typescript/src/screens/chat-detail/components/ChatMessageInput.d.ts +15 -0
  227. package/lib/typescript/src/screens/chat-detail/components/ChatMessageInput.d.ts.map +1 -0
  228. package/lib/typescript/src/screens/chat-detail/conversationHeader.utils.d.ts +1 -1
  229. package/lib/typescript/src/screens/chat-detail/conversationHeader.utils.d.ts.map +1 -1
  230. package/lib/typescript/src/screens/chat-detail/hooks/useAttachmentSendHandler.d.ts +23 -0
  231. package/lib/typescript/src/screens/chat-detail/hooks/useAttachmentSendHandler.d.ts.map +1 -0
  232. package/lib/typescript/src/screens/chat-detail/hooks/useChatComposerAnimation.d.ts +15 -0
  233. package/lib/typescript/src/screens/chat-detail/hooks/useChatComposerAnimation.d.ts.map +1 -0
  234. package/lib/typescript/src/screens/chat-detail/hooks/useChatComposerState.d.ts +13 -0
  235. package/lib/typescript/src/screens/chat-detail/hooks/useChatComposerState.d.ts.map +1 -0
  236. package/lib/typescript/src/screens/chat-detail/index.d.ts +0 -2
  237. package/lib/typescript/src/screens/chat-detail/index.d.ts.map +1 -1
  238. package/lib/typescript/src/screens/chat-detail/legend/LegendChatMessage.d.ts +3 -3
  239. package/lib/typescript/src/screens/chat-detail/legend/LegendChatMessage.d.ts.map +1 -1
  240. package/lib/typescript/src/screens/chat-detail/legend/messageTypes.d.ts +13 -0
  241. package/lib/typescript/src/screens/chat-detail/legend/messageTypes.d.ts.map +1 -0
  242. package/lib/typescript/src/screens/chat-detail/types.d.ts +10 -8
  243. package/lib/typescript/src/screens/chat-detail/types.d.ts.map +1 -1
  244. package/lib/typescript/src/services/attachmentHandlers/fileAttachmentHandler.d.ts +22 -0
  245. package/lib/typescript/src/services/attachmentHandlers/fileAttachmentHandler.d.ts.map +1 -0
  246. package/lib/typescript/src/services/attachmentHandlers/imageAttachmentHandler.d.ts +3 -0
  247. package/lib/typescript/src/services/attachmentHandlers/imageAttachmentHandler.d.ts.map +1 -0
  248. package/lib/typescript/src/services/attachmentHandlers/index.d.ts +5 -0
  249. package/lib/typescript/src/services/attachmentHandlers/index.d.ts.map +1 -0
  250. package/lib/typescript/src/services/attachmentHandlers/videoAttachmentHandler.d.ts +31 -0
  251. package/lib/typescript/src/services/attachmentHandlers/videoAttachmentHandler.d.ts.map +1 -0
  252. package/lib/typescript/src/services/attachmentOrchestrator.d.ts +5 -0
  253. package/lib/typescript/src/services/attachmentOrchestrator.d.ts.map +1 -0
  254. package/lib/typescript/src/services/auth.d.ts +19 -0
  255. package/lib/typescript/src/services/auth.d.ts.map +1 -0
  256. package/lib/typescript/src/services/endpoints.d.ts +11 -1
  257. package/lib/typescript/src/services/endpoints.d.ts.map +1 -1
  258. package/lib/typescript/src/services/imageUpload.d.ts +7 -0
  259. package/lib/typescript/src/services/imageUpload.d.ts.map +1 -0
  260. package/lib/typescript/src/store/message.d.ts +3 -0
  261. package/lib/typescript/src/store/message.d.ts.map +1 -0
  262. package/lib/typescript/src/translation/resources/i18n.d.ts.map +1 -1
  263. package/lib/typescript/src/types/attachment.d.ts +72 -0
  264. package/lib/typescript/src/types/attachment.d.ts.map +1 -0
  265. package/lib/typescript/src/types/attachmentHandler.d.ts +13 -0
  266. package/lib/typescript/src/types/attachmentHandler.d.ts.map +1 -0
  267. package/lib/typescript/src/types/chat.d.ts +28 -27
  268. package/lib/typescript/src/types/chat.d.ts.map +1 -1
  269. package/lib/typescript/src/types/common.d.ts +1 -0
  270. package/lib/typescript/src/types/common.d.ts.map +1 -1
  271. package/lib/typescript/src/types/imageUpload.d.ts +26 -0
  272. package/lib/typescript/src/types/imageUpload.d.ts.map +1 -0
  273. package/lib/typescript/src/types/message.d.ts +1 -0
  274. package/lib/typescript/src/types/message.d.ts.map +1 -1
  275. package/lib/typescript/src/utils/chatImageDimens.d.ts +34 -0
  276. package/lib/typescript/src/utils/chatImageDimens.d.ts.map +1 -0
  277. package/lib/typescript/src/utils/conversation.d.ts +3 -2
  278. package/lib/typescript/src/utils/conversation.d.ts.map +1 -1
  279. package/lib/typescript/src/utils/device.d.ts +7 -0
  280. package/lib/typescript/src/utils/device.d.ts.map +1 -0
  281. package/lib/typescript/src/utils/imageUrlOptimizer.d.ts +12 -0
  282. package/lib/typescript/src/utils/imageUrlOptimizer.d.ts.map +1 -0
  283. package/lib/typescript/src/utils/imageUtils.d.ts +9 -0
  284. package/lib/typescript/src/utils/imageUtils.d.ts.map +1 -0
  285. package/lib/typescript/src/utils/legendListMessage.d.ts +0 -2
  286. package/lib/typescript/src/utils/legendListMessage.d.ts.map +1 -1
  287. package/lib/typescript/src/utils/message.d.ts.map +1 -1
  288. package/lib/typescript/src/utils/resolveMessageType.d.ts.map +1 -1
  289. package/lib/typescript/src/utils/ui.d.ts +13 -0
  290. package/lib/typescript/src/utils/ui.d.ts.map +1 -0
  291. package/lib/typescript/src/utils/url.d.ts +1 -1
  292. package/lib/typescript/src/utils/url.d.ts.map +1 -1
  293. package/lib/typescript/src/utils/videoThumbnail.d.ts +16 -0
  294. package/lib/typescript/src/utils/videoThumbnail.d.ts.map +1 -0
  295. package/package.json +15 -3
  296. package/src/components/AttachmentPreview.tsx +304 -0
  297. package/src/components/MediaViewer/index.tsx +0 -0
  298. package/src/components/MediaViewerModal.tsx +70 -0
  299. package/src/components/MergedImageGrid.tsx +238 -0
  300. package/src/components/ThreadCard/AvatarSection.tsx +5 -8
  301. package/src/components/ThreadCard/NamePrefixIcon.tsx +27 -38
  302. package/src/components/ThreadCard/ThreadCard.tsx +16 -30
  303. package/src/components/ThreadCard/thread-card.utils.ts +95 -4
  304. package/src/components/messages/fileMessage/index.tsx +30 -0
  305. package/src/components/messages/imageMessage/index.tsx +137 -0
  306. package/src/components/messages/linkMessage/index.tsx +162 -0
  307. package/src/components/messages/mergedMessage/index.tsx +45 -0
  308. package/src/components/messages/styles.ts +39 -0
  309. package/src/components/messages/textMessage/index.tsx +53 -0
  310. package/src/components/messages/types.ts +22 -0
  311. package/src/components/messages/videoMessage/index.tsx +120 -0
  312. package/src/config/api-endpoints.ts +72 -0
  313. package/src/config/attachment-priority.ts +93 -0
  314. package/src/config/configuration.ts +50 -0
  315. package/src/config/index.ts +19 -0
  316. package/src/context/ChatContext.tsx +12 -4
  317. package/src/core/index.ts +25 -1
  318. package/src/core/useChatListener.ts +0 -21
  319. package/src/hooks/message/useSendMessage.ts +143 -0
  320. package/src/hooks/useChatMessages.ts +69 -161
  321. package/src/hooks/useConversationList.ts +34 -16
  322. package/src/hooks/useImageAttachment.ts +348 -0
  323. package/src/hooks/useLinkPreview/useLinkPreview.ts +3 -2
  324. package/src/hooks/useMediaViewer.ts +32 -0
  325. package/src/hooks/useSendAttachment.ts +295 -0
  326. package/src/hooks/useVideoAttachment.ts +334 -0
  327. package/src/index.tsx +13 -1
  328. package/src/screens/MediaView/VideoPlayer.tsx +211 -0
  329. package/src/screens/MediaView/index.tsx +327 -0
  330. package/src/screens/chat-detail/ChatComposer.tsx +206 -271
  331. package/src/screens/chat-detail/ChatDetail.tsx +164 -104
  332. package/src/screens/chat-detail/ChatDetailHeader.tsx +4 -10
  333. package/src/screens/chat-detail/ChatLinkPreview.tsx +1 -1
  334. package/src/screens/chat-detail/ChatListLegend.tsx +10 -13
  335. package/src/screens/chat-detail/components/ChatInputActions.tsx +71 -0
  336. package/src/screens/chat-detail/components/ChatMessageInput.tsx +127 -0
  337. package/src/screens/chat-detail/conversationHeader.utils.ts +11 -14
  338. package/src/screens/chat-detail/hooks/useAttachmentSendHandler.ts +291 -0
  339. package/src/screens/chat-detail/hooks/useChatComposerAnimation.ts +184 -0
  340. package/src/screens/chat-detail/hooks/useChatComposerState.ts +40 -0
  341. package/src/screens/chat-detail/index.ts +0 -2
  342. package/src/screens/chat-detail/legend/LegendChatMessage.tsx +44 -39
  343. package/src/screens/chat-detail/legend/messageTypes.tsx +13 -0
  344. package/src/screens/chat-detail/types.ts +11 -9
  345. package/src/screens/inbox/MessagesTab.tsx +1 -1
  346. package/src/services/attachmentHandlers/fileAttachmentHandler.ts +78 -0
  347. package/src/services/attachmentHandlers/imageAttachmentHandler.ts +54 -0
  348. package/src/services/attachmentHandlers/index.ts +10 -0
  349. package/src/services/attachmentHandlers/videoAttachmentHandler.ts +114 -0
  350. package/src/services/attachmentOrchestrator.ts +300 -0
  351. package/src/services/auth.ts +34 -0
  352. package/src/services/endpoints.ts +24 -1
  353. package/src/services/imageUpload.ts +162 -0
  354. package/src/store/conversation.ts +1 -1
  355. package/src/store/message.ts +44 -0
  356. package/src/translation/resources/i18n.ts +22 -2
  357. package/src/types/attachment.ts +85 -0
  358. package/src/types/attachmentHandler.ts +31 -0
  359. package/src/types/chat.ts +31 -30
  360. package/src/types/common.ts +1 -0
  361. package/src/types/imageUpload.ts +28 -0
  362. package/src/types/message.ts +1 -0
  363. package/src/utils/chatImageDimens.ts +178 -0
  364. package/src/utils/conversation.ts +44 -17
  365. package/src/utils/device.ts +73 -0
  366. package/src/utils/imageUrlOptimizer.ts +56 -0
  367. package/src/utils/imageUtils.ts +76 -0
  368. package/src/utils/legendListMessage.ts +0 -5
  369. package/src/utils/message.ts +10 -12
  370. package/src/utils/resolveMessageType.ts +2 -0
  371. package/src/utils/ui.ts +19 -0
  372. package/src/utils/url.ts +3 -3
  373. package/src/utils/videoThumbnail.ts +85 -0
  374. package/lib/module/screens/chat-detail/ChatList.js +0 -147
  375. package/lib/module/screens/chat-detail/ChatList.js.map +0 -1
  376. package/lib/module/screens/chat-detail/ChatTextBubble.js +0 -62
  377. package/lib/module/screens/chat-detail/ChatTextBubble.js.map +0 -1
  378. package/lib/module/screens/chat-detail/legend/message-types.js +0 -122
  379. package/lib/module/screens/chat-detail/legend/message-types.js.map +0 -1
  380. package/lib/module/screens/chat-detail/messages/ChatMessageBubble.js +0 -24
  381. package/lib/module/screens/chat-detail/messages/ChatMessageBubble.js.map +0 -1
  382. package/lib/module/screens/chat-detail/messages/types.js +0 -4
  383. package/lib/module/screens/chat-detail/messages/types.js.map +0 -1
  384. package/lib/typescript/src/screens/chat-detail/ChatList.d.ts +0 -3
  385. package/lib/typescript/src/screens/chat-detail/ChatList.d.ts.map +0 -1
  386. package/lib/typescript/src/screens/chat-detail/ChatTextBubble.d.ts +0 -3
  387. package/lib/typescript/src/screens/chat-detail/ChatTextBubble.d.ts.map +0 -1
  388. package/lib/typescript/src/screens/chat-detail/legend/message-types.d.ts +0 -12
  389. package/lib/typescript/src/screens/chat-detail/legend/message-types.d.ts.map +0 -1
  390. package/lib/typescript/src/screens/chat-detail/messages/ChatMessageBubble.d.ts +0 -3
  391. package/lib/typescript/src/screens/chat-detail/messages/ChatMessageBubble.d.ts.map +0 -1
  392. package/lib/typescript/src/screens/chat-detail/messages/types.d.ts +0 -13
  393. package/lib/typescript/src/screens/chat-detail/messages/types.d.ts.map +0 -1
  394. package/src/screens/chat-detail/ChatList.tsx +0 -190
  395. package/src/screens/chat-detail/ChatTextBubble.tsx +0 -73
  396. package/src/screens/chat-detail/legend/message-types.tsx +0 -149
  397. package/src/screens/chat-detail/messages/ChatMessageBubble.tsx +0 -23
  398. package/src/screens/chat-detail/messages/types.ts +0 -14
@@ -1 +1 @@
1
- {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../../src/types/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EACjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,KAAK,KAAK,GAAG,CACX,KAAK,EAAE,MAAM,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M,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,SAAS,CAAC;IACxB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,cAAc;IAC7B,eAAe,EAAE,oBAAoB,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE;QACZ,IAAI,EAAE,cAAc,CAAC;QACrB,IAAI,EAAE,WAAW,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,WAAW,CAAC,EAAE,YAAY,CAAC;CAC5B;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAClE,cAAc,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,gBAAgB,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IACjD,gBAAgB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB"}
@@ -2,5 +2,6 @@ export interface IUrlMetadata {
2
2
  title?: string;
3
3
  description?: string;
4
4
  image?: string;
5
+ url?: string;
5
6
  }
6
7
  //# sourceMappingURL=common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/types/common.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/types/common.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd"}
@@ -0,0 +1,26 @@
1
+ export interface ImageFile {
2
+ path: string;
3
+ filename: string;
4
+ size: number;
5
+ width: number;
6
+ height: number;
7
+ mime: string;
8
+ }
9
+ export interface UploadedImage {
10
+ url: string;
11
+ name: string;
12
+ width: number;
13
+ height: number;
14
+ size: number;
15
+ }
16
+ export interface ImageUploadConfig {
17
+ maxConcurrent?: number;
18
+ timeout?: number;
19
+ retryAttempts?: number;
20
+ }
21
+ export interface UploadProgress {
22
+ completed: number;
23
+ total: number;
24
+ percentage: number;
25
+ }
26
+ //# sourceMappingURL=imageUpload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"imageUpload.d.ts","sourceRoot":"","sources":["../../../../src/types/imageUpload.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB"}
@@ -4,6 +4,7 @@ export declare const DChatMessageType: {
4
4
  readonly Image: "IMAGE";
5
5
  readonly Video: "VIDEO";
6
6
  readonly File: "FILE";
7
+ readonly Merged: "MERGED";
7
8
  readonly Order: "ORDER";
8
9
  readonly Unsupported: "UNSUPPORTED";
9
10
  };
@@ -1 +1 @@
1
- {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../src/types/message.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;;;;;CAQnB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAE3D,eAAO,MAAM,wBAAwB;;;CAG3B,CAAC"}
1
+ {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../src/types/message.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;;;;;;CASnB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAE3D,eAAO,MAAM,wBAAwB;;;CAG3B,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Chat-specific image dimensions for optimal display and memory usage
3
+ * Responsive to device type (tablet/mobile) and pixel ratio
4
+ */
5
+ export declare enum CHAT_IMAGE_VIEW_SOURCE {
6
+ MessageListThumbnail = "MessageListThumbnail",
7
+ MessageDetailBubble = "MessageDetailBubble",
8
+ ImagePreviewSmall = "ImagePreviewSmall",
9
+ ImagePreviewMedium = "ImagePreviewMedium",
10
+ ImagePreviewLarge = "ImagePreviewLarge"
11
+ }
12
+ interface ImageDimension {
13
+ width: number;
14
+ height: number;
15
+ }
16
+ declare class ChatImageDimens {
17
+ private static instance;
18
+ private static factor;
19
+ private static regexCDN;
20
+ private static dimens;
21
+ constructor(factor: number);
22
+ private calculateDimensions;
23
+ static getInstance(): ChatImageDimens;
24
+ static updateFactor(factor: number): void;
25
+ static getDimensions(source: CHAT_IMAGE_VIEW_SOURCE): ImageDimension;
26
+ static getOptimizedImageUrl(url: string | undefined, source: CHAT_IMAGE_VIEW_SOURCE): string;
27
+ /**
28
+ * Get optimized image URL with custom dimensions (generic approach)
29
+ * Useful for dynamic sizing based on actual content
30
+ */
31
+ static getOptimizedImageUrlWithDimensions(url: string | undefined, width: number, height: number): string;
32
+ }
33
+ export default ChatImageDimens;
34
+ //# sourceMappingURL=chatImageDimens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chatImageDimens.d.ts","sourceRoot":"","sources":["../../../../src/utils/chatImageDimens.ts"],"names":[],"mappings":"AAGA;;;GAGG;AAEH,oBAAY,sBAAsB;IAChC,oBAAoB,yBAAyB;IAC7C,mBAAmB,wBAAwB;IAC3C,iBAAiB,sBAAsB;IACvC,kBAAkB,uBAAuB;IACzC,iBAAiB,sBAAsB;CACxC;AAED,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAsDD,cAAM,eAAe;IACnB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAkB;IACzC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAa;IAClC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAuC;IAC9D,OAAO,CAAC,MAAM,CAAC,MAAM,CAE4B;gBAErC,MAAM,EAAE,MAAM;IAK1B,OAAO,CAAC,mBAAmB;WAeb,WAAW;WAOX,YAAY,CAAC,MAAM,EAAE,MAAM;WAO3B,aAAa,CAAC,MAAM,EAAE,sBAAsB,GAAG,cAAc;WAO7D,oBAAoB,CAChC,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,MAAM,EAAE,sBAAsB,GAC7B,MAAM;IAaT;;;OAGG;WACW,kCAAkC,CAC9C,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,MAAM;CA6BV;AAED,eAAe,eAAe,CAAC"}
@@ -1,11 +1,12 @@
1
- import { SessionType, type ConversationItem } from '@droppii/openim-rn-client-sdk';
1
+ import { MessageType, SessionType, type ConversationItem } from '@droppii/openim-rn-client-sdk';
2
2
  import { type DConversationItem } from '../types/chat';
3
3
  export declare const conversationCompare: (a: ConversationItem, b: ConversationItem) => number;
4
4
  export declare const dConversationCompare: (a: DConversationItem, b: DConversationItem) => number;
5
- export declare const mergeOpenIMIntoConversation: (droppii: DConversationItem, openim: ConversationItem) => DConversationItem;
5
+ export declare const mergeOpenIMIntoConversation: (existing: DConversationItem, openim: ConversationItem) => DConversationItem;
6
6
  export declare const getConversationID: (sessionType: SessionType, senderID?: string, receiverID?: string) => string;
7
7
  export declare const sortConversation: (map: Record<string, DConversationItem>) => {
8
8
  map: Record<string, DConversationItem>;
9
9
  list: string[];
10
10
  };
11
+ export declare const generateContentBasedOnMessageType: (contentType: MessageType, plainText?: string) => string;
11
12
  //# sourceMappingURL=conversation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../src/utils/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,KAAK,gBAAgB,EACtB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,KAAK,iBAAiB,EAAqB,MAAM,eAAe,CAAC;AAE1E,eAAO,MAAM,mBAAmB,GAC9B,GAAG,gBAAgB,EACnB,GAAG,gBAAgB,WAcpB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,GAAG,iBAAiB,EACpB,GAAG,iBAAiB,WAWrB,CAAC;AAEF,eAAO,MAAM,2BAA2B,GACtC,SAAS,iBAAiB,EAC1B,QAAQ,gBAAgB,KACvB,iBAkBF,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,aAAa,WAAW,EACxB,WAAW,MAAM,EACjB,aAAa,MAAM,WAUpB,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,KAAK,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC;;;CAKtE,CAAC"}
1
+ {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../src/utils/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,WAAW,EACX,KAAK,gBAAgB,EACtB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,KAAK,iBAAiB,EAAqB,MAAM,eAAe,CAAC;AAG1E,eAAO,MAAM,mBAAmB,GAC9B,GAAG,gBAAgB,EACnB,GAAG,gBAAgB,WAcpB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,GAAG,iBAAiB,EACpB,GAAG,iBAAiB,WAcrB,CAAC;AAEF,eAAO,MAAM,2BAA2B,GACtC,UAAU,iBAAiB,EAC3B,QAAQ,gBAAgB,KACvB,iBAcF,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,aAAa,WAAW,EACxB,WAAW,MAAM,EACjB,aAAa,MAAM,WAUpB,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,KAAK,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC;;;CAKtE,CAAC;AAEF,eAAO,MAAM,iCAAiC,GAC5C,aAAa,WAAW,EACxB,YAAY,MAAM,WAsBnB,CAAC"}
@@ -0,0 +1,7 @@
1
+ declare const DeviceUtils: {
2
+ openImagePicker: (multiple?: boolean) => Promise<(import("react-native-image-crop-picker").Image & any[]) | (import("react-native-image-crop-picker").Video & any[]) | import("react-native-image-crop-picker").ImageOrVideo[]>;
3
+ openVideoPicker: (multiple?: boolean) => Promise<(import("react-native-image-crop-picker").Video & any[]) | import("react-native-image-crop-picker").Video[]>;
4
+ };
5
+ export default DeviceUtils;
6
+ export { DeviceUtils };
7
+ //# sourceMappingURL=device.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../../../src/utils/device.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,WAAW;iCACmB,OAAO;iCAkCP,OAAO;CAgC1C,CAAC;AAEF,eAAe,WAAW,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Optimize image URLs for chat by resizing and converting to WebP
3
+ * Reduces memory usage and improves loading performance
4
+ */
5
+ interface OptimizeImageUrlOptions {
6
+ width?: number;
7
+ height?: number;
8
+ convertToWebp?: boolean;
9
+ }
10
+ export declare const optimizeImageUrl: (url: string | undefined, options?: OptimizeImageUrlOptions) => string;
11
+ export default optimizeImageUrl;
12
+ //# sourceMappingURL=imageUrlOptimizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"imageUrlOptimizer.d.ts","sourceRoot":"","sources":["../../../../src/utils/imageUrlOptimizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,UAAU,uBAAuB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAOD,eAAO,MAAM,gBAAgB,GAC3B,KAAK,MAAM,GAAG,SAAS,EACvB,UAAS,uBAA4B,KACpC,MAkCF,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { ImageFile } from '../types/imageUpload';
2
+ export declare const generateUUID: () => string;
3
+ export declare const isVideoFile: (filename: string | undefined) => boolean;
4
+ export declare const isVideoFromPicker: (pickedItem: any) => boolean;
5
+ export declare const getMimeType: (fileName: string) => string;
6
+ export declare const formatFileSize: (bytes: number) => string;
7
+ export declare const validateImageFile: (file: ImageFile) => string | null;
8
+ export declare const getImageUploadEndpoint: (baseUrl: string) => string;
9
+ //# sourceMappingURL=imageUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"imageUtils.d.ts","sourceRoot":"","sources":["../../../../src/utils/imageUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,eAAO,MAAM,YAAY,QAAO,MAE/B,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,GAAG,SAAS,KAAG,OAI1D,CAAC;AAGF,eAAO,MAAM,iBAAiB,GAAI,YAAY,GAAG,KAAG,OAInD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,KAAG,MA6B9C,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,KAAG,MAM9C,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,MAAM,SAAS,KAAG,MAAM,GAAG,IAa5D,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,SAAS,MAAM,KAAG,MAExD,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import type { DMessageItem } from '../types/chat';
2
- import type { DChatMessageType } from '../types/message';
3
2
  /**
4
3
  * Extract message text based on content type
5
4
  */
@@ -7,7 +6,6 @@ export declare const getMessageText: (message: DMessageItem) => string;
7
6
  export interface PrecomputedMessageData {
8
7
  messageId: string;
9
8
  dayStart: boolean;
10
- messageType: DChatMessageType;
11
9
  createdAt: number;
12
10
  }
13
11
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"legendListMessage.d.ts","sourceRoot":"","sources":["../../../../src/utils/legendListMessage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,SAAS,YAAY,KAAG,MA8BtD,CAAC;AAEF,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,gBAAgB,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GACnC,UAAU,YAAY,EAAE,KACvB,GAAG,CAAC,MAAM,EAAE,sBAAsB,CA0BpC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAC3B,UAAU,YAAY,EAAE,KACvB,GAAG,CAAC,MAAM,EAAE,OAAO,CAYrB,CAAC"}
1
+ {"version":3,"file":"legendListMessage.d.ts","sourceRoot":"","sources":["../../../../src/utils/legendListMessage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,SAAS,YAAY,KAAG,MA8BtD,CAAC;AAEF,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GACnC,UAAU,YAAY,EAAE,KACvB,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAwBpC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAC3B,UAAU,YAAY,EAAE,KACvB,GAAG,CAAC,MAAM,EAAE,OAAO,CAYrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../src/utils/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAClB,MA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,eAAO,MAAM,wBAAwB,GACnC,SAAS;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,EAChC,kBAAkB,YAAY,KAC7B,MAMF,CAAC;AAEF,eAAO,MAAM,0BAA0B,GACrC,UAAU,YAAY,EAAE,KACvB,uBAAuB,GAAG,IAkB5B,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,SAAS,YAAY,EAAE,EACvB,UAAU,YAAY,EAAE,KACvB,OASF,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,SAAS,WAAW,EACpB,gBAAgB,MAAM,KACrB,OAuBF,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,eAAe,iBAAiB;;;CAW7D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"resolveMessageType.d.ts","sourceRoot":"","sources":["../../../../src/utils/resolveMessageType.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAA4B,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAgB9E,eAAO,MAAM,sBAAsB,GACjC,SAAS,YAAY,KACpB,gBA4BF,CAAC"}
1
+ {"version":3,"file":"resolveMessageType.d.ts","sourceRoot":"","sources":["../../../../src/utils/resolveMessageType.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAA4B,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAgB9E,eAAO,MAAM,sBAAsB,GACjC,SAAS,YAAY,KACpB,gBA8BF,CAAC"}
@@ -0,0 +1,13 @@
1
+ interface ToastConfig {
2
+ title?: string;
3
+ message?: string;
4
+ theme?: 'success' | 'danger' | 'warning' | 'info';
5
+ }
6
+ declare const UIUtils: {
7
+ toast: {
8
+ open: (config: ToastConfig) => void;
9
+ };
10
+ };
11
+ export default UIUtils;
12
+ export { UIUtils };
13
+ //# sourceMappingURL=ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../../src/utils/ui.ts"],"names":[],"mappings":"AAEA,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;CACnD;AAED,QAAA,MAAM,OAAO;;uBAEM,WAAW;;CAK7B,CAAC;AAEF,eAAe,OAAO,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare function extractFirstUrl(text: string): string | undefined;
1
+ export declare function extractUrls(text: string): string[];
2
2
  //# sourceMappingURL=url.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../../src/utils/url.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEhE"}
1
+ {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../../src/utils/url.ts"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAElD"}
@@ -0,0 +1,16 @@
1
+ interface ThumbnailOptions {
2
+ time?: number;
3
+ quality?: number;
4
+ }
5
+ interface ThumbnailResult {
6
+ path: string;
7
+ width: number;
8
+ height: number;
9
+ }
10
+ export declare const VideoThumbnailUtil: {
11
+ generateThumbnail: (videoPath: string, options?: ThumbnailOptions) => Promise<ThumbnailResult | null>;
12
+ cleanupThumbnail: (thumbnailPath: string) => Promise<void>;
13
+ batchGenerateThumbnails: (videoPaths: string[], options?: ThumbnailOptions) => Promise<ThumbnailResult[]>;
14
+ };
15
+ export default VideoThumbnailUtil;
16
+ //# sourceMappingURL=videoThumbnail.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"videoThumbnail.d.ts","sourceRoot":"","sources":["../../../../src/utils/videoThumbnail.ts"],"names":[],"mappings":"AAGA,UAAU,gBAAgB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,kBAAkB;mCAEhB,MAAM,YACR,gBAAgB,KACxB,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;sCAoCM,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;0CAWhD,MAAM,EAAE,YACX,gBAAgB,KACxB,OAAO,CAAC,eAAe,EAAE,CAAC;CAe9B,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@droppii-org/chat-mobile",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "description": "Droppii chat mobile",
5
5
  "keywords": [
6
6
  "react-native",
@@ -59,6 +59,7 @@
59
59
  "example": "yarn workspace @droppii-org/chat-mobile-example",
60
60
  "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
61
61
  "prepare": "bob build",
62
+ "postinstall": "patch-package",
62
63
  "typecheck": "tsc -p tsconfig.build.json 2>&1 | grep -E 'src/.*error' || echo 'Typecheck passed (external dependency warnings ignored)'",
63
64
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
64
65
  "test": "jest",
@@ -67,14 +68,21 @@
67
68
  "build:web": "vite build"
68
69
  },
69
70
  "dependencies": {
70
- "@droppii/openim-rn-client-sdk": "git+ssh://git@github.com/droppii/open-im-sdk-reactnative.git#v1.0.0-rc7",
71
+ "@droppii/openim-rn-client-sdk": "git+ssh://git@github.com/droppii/open-im-sdk-reactnative.git#v1.0.0-rc8",
71
72
  "@legendapp/list": "^3.0.6",
72
73
  "axios": "^1.16.1",
73
74
  "lodash": "^4.18.1",
75
+ "react-native-blob-util": "^0.24.10",
76
+ "react-native-create-thumbnail": "^2.2.0",
74
77
  "react-native-fs": "^2.20.0",
75
78
  "react-native-gifted-chat": "^3.3.3",
79
+ "react-native-image-crop-picker": "^0.51.1",
76
80
  "react-native-permissions": "^5.6.0",
77
- "react-native-tab-view": "^4.3.1"
81
+ "react-native-photo-view": "git+ssh://git@github.com/droppii/react-native-photo-view.git",
82
+ "react-native-snap-carousel": "3.9.0",
83
+ "react-native-tab-view": "^4.3.1",
84
+ "react-native-video": "6.19.2",
85
+ "uuid": "^9.0.0"
78
86
  },
79
87
  "devDependencies": {
80
88
  "@commitlint/config-conventional": "^20.5.0",
@@ -93,15 +101,19 @@
93
101
  "@types/lodash": "^4",
94
102
  "@types/react": "^19.2.0",
95
103
  "@types/react-native": "^0.73.0",
104
+ "@types/react-native-photo-view": "^1.5.4",
105
+ "@types/react-native-snap-carousel": "^3.8.5",
96
106
  "@types/react-query": "^1.2.9",
97
107
  "commitlint": "^20.5.0",
98
108
  "del-cli": "^7.0.0",
109
+ "deprecated-react-native-prop-types": "5.0.0",
99
110
  "eslint": "^9.39.4",
100
111
  "eslint-config-prettier": "^10.1.8",
101
112
  "eslint-plugin-ft-flow": "^3.0.11",
102
113
  "eslint-plugin-prettier": "^5.5.5",
103
114
  "jest": "^30.3.0",
104
115
  "lefthook": "^2.1.4",
116
+ "patch-package": "^8.0.1",
105
117
  "prettier": "^3.8.1",
106
118
  "react-native": "^0.86.0",
107
119
  "react-native-builder-bob": "^0.41.0",
@@ -0,0 +1,304 @@
1
+ import { memo } from 'react';
2
+ import { ScrollView, StyleSheet } from 'react-native';
3
+ import { KContainer, KImage, KColors, KLabel } from '@droppii/libs';
4
+
5
+ type AttachmentType = 'image' | 'video' | 'audio' | 'document' | 'file';
6
+
7
+ interface AttachmentMetadata {
8
+ path: string;
9
+ filename?: string;
10
+ size?: number;
11
+ duration?: number;
12
+ mimeType?: string;
13
+ width?: number;
14
+ height?: number;
15
+ }
16
+
17
+ interface AttachmentItem {
18
+ metadata: AttachmentMetadata;
19
+ uploadProgress: number;
20
+ error: string | null;
21
+ isUploading: boolean;
22
+ uploadedUrl?: string;
23
+ thumbnailUrl?: string;
24
+ }
25
+
26
+ interface AttachmentPreviewProps {
27
+ visible: boolean;
28
+ attachments?: Array<AttachmentItem & { type: AttachmentType }>;
29
+ onRemove: (type: AttachmentType, index: number) => void;
30
+ }
31
+
32
+ const formatDuration = (seconds: number): string => {
33
+ const mins = Math.floor(seconds / 60);
34
+ const secs = seconds % 60;
35
+ return `${mins}:${secs.toString().padStart(2, '0')}`;
36
+ };
37
+
38
+ const getAttachmentIcon = (type: AttachmentType): string => {
39
+ switch (type) {
40
+ case 'image':
41
+ return 'image';
42
+ case 'video':
43
+ return 'play-circle';
44
+ case 'audio':
45
+ return 'music';
46
+ case 'document':
47
+ return 'file-document';
48
+ case 'file':
49
+ default:
50
+ return 'file';
51
+ }
52
+ };
53
+
54
+ export const AttachmentPreview = memo(
55
+ ({ visible, attachments, onRemove }: AttachmentPreviewProps) => {
56
+ if (!visible || !attachments?.length) {
57
+ return null;
58
+ }
59
+
60
+ return (
61
+ <KContainer.View
62
+ paddingH="0.75rem"
63
+ // paddingV="0.75rem"
64
+ brW={1}
65
+ brC={KColors.palette.gray.w100}
66
+ background={KColors.white}
67
+ style={styles.container}
68
+ >
69
+ <KContainer.View row alignItems minH={70}>
70
+ <KContainer.View flex>
71
+ <ScrollView
72
+ horizontal
73
+ showsHorizontalScrollIndicator={false}
74
+ scrollEventThrottle={16}
75
+ contentContainerStyle={{ alignItems: 'center' }}
76
+ >
77
+ {attachments.map((item, index) => {
78
+ const {
79
+ type,
80
+ metadata,
81
+ uploadProgress,
82
+ error,
83
+ isUploading,
84
+ thumbnailUrl,
85
+ } = item;
86
+
87
+ const isImage = type === 'image';
88
+ const isVideo = type === 'video';
89
+ const hasPreview = isImage || isVideo;
90
+
91
+ return (
92
+ <KContainer.View key={`${type}-${index}`}>
93
+ <KContainer.View style={styles.thumbnail} center>
94
+ {/* Video thumbnail */}
95
+ {isVideo && thumbnailUrl && (
96
+ <KImage.Base
97
+ uri={thumbnailUrl}
98
+ width={48}
99
+ height={48}
100
+ resizeMode="cover"
101
+ />
102
+ )}
103
+
104
+ {/* Video placeholder (no thumbnail yet) */}
105
+ {isVideo && !thumbnailUrl && (
106
+ <KContainer.View
107
+ style={[styles.videoBg, styles.videoThumbnail]}
108
+ />
109
+ )}
110
+
111
+ {/* Image preview */}
112
+ {isImage && (
113
+ <KImage.Base
114
+ uri={`file://${metadata.path}`}
115
+ width={48}
116
+ height={48}
117
+ />
118
+ )}
119
+
120
+ {/* Show icon overlay for non-media files */}
121
+ {!hasPreview && (
122
+ <KContainer.View
123
+ style={styles.iconOverlay}
124
+ center
125
+ background={KColors.palette.gray.w100}
126
+ >
127
+ <KImage.VectorIcons
128
+ name={getAttachmentIcon(type)}
129
+ provider="MaterialCommunityIcons"
130
+ size={24}
131
+ color={KColors.palette.primary.w400}
132
+ />
133
+ </KContainer.View>
134
+ )}
135
+
136
+ {/* Video duration badge */}
137
+ {isVideo && metadata.duration && (
138
+ <KContainer.View style={styles.durationBadge} center>
139
+ <KLabel.Text
140
+ typo="TextXsNormal"
141
+ color={KColors.white}
142
+ style={styles.durationText}
143
+ >
144
+ {formatDuration(metadata.duration / 1000)}
145
+ </KLabel.Text>
146
+ </KContainer.View>
147
+ )}
148
+
149
+ {/* Type icon for non-preview items */}
150
+ {!hasPreview && (
151
+ <KContainer.View style={styles.typeIcon} center>
152
+ <KImage.VectorIcons
153
+ name={getAttachmentIcon(type)}
154
+ provider="MaterialCommunityIcons"
155
+ size={14}
156
+ color={KColors.white}
157
+ />
158
+ </KContainer.View>
159
+ )}
160
+
161
+ {/* Error state */}
162
+ {error && (
163
+ <KContainer.View style={styles.errorOverlay} center>
164
+ <KImage.VectorIcons
165
+ name="close-circle"
166
+ provider="MaterialCommunityIcons"
167
+ size={28}
168
+ color={KColors.white}
169
+ />
170
+ </KContainer.View>
171
+ )}
172
+
173
+ {/* Progress overlay */}
174
+ {isUploading && (
175
+ <KContainer.View style={styles.progressOverlay} center>
176
+ <KLabel.Text
177
+ typo="TextSmNormal"
178
+ color={KColors.white}
179
+ >
180
+ {uploadProgress}%
181
+ </KLabel.Text>
182
+ </KContainer.View>
183
+ )}
184
+ </KContainer.View>
185
+ {/* Remove button */}
186
+ <KContainer.Touchable
187
+ style={styles.removeButton}
188
+ center
189
+ br="round"
190
+ background={KColors.black}
191
+ onPress={() => onRemove(type, index)}
192
+ disabled={isUploading}
193
+ hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
194
+ >
195
+ <KImage.VectorIcons
196
+ name="close"
197
+ provider="MaterialCommunityIcons"
198
+ size={14}
199
+ color={KColors.white}
200
+ />
201
+ </KContainer.Touchable>
202
+ </KContainer.View>
203
+ );
204
+ })}
205
+ </ScrollView>
206
+ </KContainer.View>
207
+ </KContainer.View>
208
+ </KContainer.View>
209
+ );
210
+ }
211
+ );
212
+
213
+ AttachmentPreview.displayName = 'AttachmentPreview';
214
+
215
+ const styles = StyleSheet.create({
216
+ container: {
217
+ // minHeight: 80,
218
+ },
219
+ thumbnail: {
220
+ position: 'relative',
221
+ width: 48,
222
+ height: 48,
223
+ borderRadius: 4,
224
+ overflow: 'hidden',
225
+ marginRight: 8,
226
+ backgroundColor: KColors.palette.gray.w50,
227
+ },
228
+ durationBadge: {
229
+ position: 'absolute',
230
+ bottom: 4,
231
+ right: 4,
232
+ backgroundColor: 'rgba(0, 0, 0, 0.8)',
233
+ borderRadius: 3,
234
+ paddingVertical: 2,
235
+ paddingHorizontal: 4,
236
+ },
237
+ durationText: {
238
+ fontSize: 11,
239
+ fontWeight: '600',
240
+ },
241
+ iconOverlay: {
242
+ width: 48,
243
+ height: 48,
244
+ borderRadius: 4,
245
+ },
246
+ videoIcon: {
247
+ position: 'absolute',
248
+ top: 2,
249
+ right: 2,
250
+ backgroundColor: 'rgba(0, 0, 0, 0.6)',
251
+ borderRadius: 8,
252
+ width: 20,
253
+ height: 20,
254
+ },
255
+ typeIcon: {
256
+ position: 'absolute',
257
+ bottom: 2,
258
+ right: 2,
259
+ backgroundColor: 'rgba(0, 0, 0, 0.7)',
260
+ borderRadius: 6,
261
+ width: 16,
262
+ height: 16,
263
+ },
264
+ videoBg: {
265
+ width: 48,
266
+ height: 48,
267
+ borderRadius: 4,
268
+ },
269
+ videoThumbnail: {
270
+ backgroundColor: KColors.black,
271
+ },
272
+ progressOverlay: {
273
+ position: 'absolute',
274
+ top: 0,
275
+ left: 0,
276
+ right: 0,
277
+ bottom: 0,
278
+ backgroundColor: 'rgba(0, 0, 0, 0.6)',
279
+ },
280
+ errorOverlay: {
281
+ position: 'absolute',
282
+ top: 0,
283
+ left: 0,
284
+ right: 0,
285
+ bottom: 0,
286
+ backgroundColor: 'rgba(255, 59, 48, 0.8)',
287
+ },
288
+ removeButton: {
289
+ position: 'absolute',
290
+ top: -8,
291
+ right: 2,
292
+ width: 22,
293
+ height: 22,
294
+ shadowColor: '#000',
295
+ shadowOffset: { width: 0, height: 1 },
296
+ shadowOpacity: 0.2,
297
+ shadowRadius: 2,
298
+ elevation: 3,
299
+ },
300
+ sendButton: {
301
+ width: 48,
302
+ height: 48,
303
+ },
304
+ });
File without changes