@droppii-org/chat-mobile 0.2.7 → 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 (323) 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/thread-card.utils.js +80 -4
  10. package/lib/module/components/ThreadCard/thread-card.utils.js.map +1 -1
  11. package/lib/module/components/messages/fileMessage/index.js +26 -0
  12. package/lib/module/components/messages/fileMessage/index.js.map +1 -0
  13. package/lib/module/components/messages/imageMessage/index.js +118 -0
  14. package/lib/module/components/messages/imageMessage/index.js.map +1 -0
  15. package/lib/module/components/messages/linkMessage/index.js +122 -0
  16. package/lib/module/components/messages/linkMessage/index.js.map +1 -0
  17. package/lib/module/components/messages/mergedMessage/index.js +37 -0
  18. package/lib/module/components/messages/mergedMessage/index.js.map +1 -0
  19. package/lib/module/components/messages/styles.js +41 -0
  20. package/lib/module/components/messages/styles.js.map +1 -0
  21. package/lib/module/components/messages/textMessage/index.js +38 -0
  22. package/lib/module/components/messages/textMessage/index.js.map +1 -0
  23. package/lib/module/components/messages/types.js +14 -0
  24. package/lib/module/components/messages/types.js.map +1 -0
  25. package/lib/module/components/messages/videoMessage/index.js +110 -0
  26. package/lib/module/components/messages/videoMessage/index.js.map +1 -0
  27. package/lib/module/config/api-endpoints.js +66 -0
  28. package/lib/module/config/api-endpoints.js.map +1 -0
  29. package/lib/module/config/attachment-priority.js +81 -0
  30. package/lib/module/config/attachment-priority.js.map +1 -0
  31. package/lib/module/config/configuration.js +50 -0
  32. package/lib/module/config/configuration.js.map +1 -0
  33. package/lib/module/config/index.js +22 -0
  34. package/lib/module/config/index.js.map +1 -0
  35. package/lib/module/core/index.js +19 -1
  36. package/lib/module/core/index.js.map +1 -1
  37. package/lib/module/core/useChatListener.js +0 -14
  38. package/lib/module/core/useChatListener.js.map +1 -1
  39. package/lib/module/hooks/message/useSendMessage.js +10 -5
  40. package/lib/module/hooks/message/useSendMessage.js.map +1 -1
  41. package/lib/module/hooks/useChatMessages.js +0 -3
  42. package/lib/module/hooks/useChatMessages.js.map +1 -1
  43. package/lib/module/hooks/useImageAttachment.js +263 -0
  44. package/lib/module/hooks/useImageAttachment.js.map +1 -0
  45. package/lib/module/hooks/useMediaViewer.js +24 -0
  46. package/lib/module/hooks/useMediaViewer.js.map +1 -0
  47. package/lib/module/hooks/useSendAttachment.js +182 -0
  48. package/lib/module/hooks/useSendAttachment.js.map +1 -0
  49. package/lib/module/hooks/useVideoAttachment.js +251 -0
  50. package/lib/module/hooks/useVideoAttachment.js.map +1 -0
  51. package/lib/module/index.js +13 -1
  52. package/lib/module/index.js.map +1 -1
  53. package/lib/module/screens/MediaView/VideoPlayer.js +177 -0
  54. package/lib/module/screens/MediaView/VideoPlayer.js.map +1 -0
  55. package/lib/module/screens/MediaView/index.js +264 -0
  56. package/lib/module/screens/MediaView/index.js.map +1 -0
  57. package/lib/module/screens/chat-detail/ChatComposer.js +190 -196
  58. package/lib/module/screens/chat-detail/ChatComposer.js.map +1 -1
  59. package/lib/module/screens/chat-detail/ChatDetail.js +94 -63
  60. package/lib/module/screens/chat-detail/ChatDetail.js.map +1 -1
  61. package/lib/module/screens/chat-detail/ChatListLegend.js +5 -13
  62. package/lib/module/screens/chat-detail/ChatListLegend.js.map +1 -1
  63. package/lib/module/screens/chat-detail/components/ChatInputActions.js +51 -0
  64. package/lib/module/screens/chat-detail/components/ChatInputActions.js.map +1 -0
  65. package/lib/module/screens/chat-detail/components/ChatMessageInput.js +93 -0
  66. package/lib/module/screens/chat-detail/components/ChatMessageInput.js.map +1 -0
  67. package/lib/module/screens/chat-detail/hooks/useAttachmentSendHandler.js +221 -0
  68. package/lib/module/screens/chat-detail/hooks/useAttachmentSendHandler.js.map +1 -0
  69. package/lib/module/screens/chat-detail/hooks/useChatComposerAnimation.js +114 -0
  70. package/lib/module/screens/chat-detail/hooks/useChatComposerAnimation.js.map +1 -0
  71. package/lib/module/screens/chat-detail/hooks/useChatComposerState.js +26 -0
  72. package/lib/module/screens/chat-detail/hooks/useChatComposerState.js.map +1 -0
  73. package/lib/module/screens/chat-detail/index.js +0 -1
  74. package/lib/module/screens/chat-detail/index.js.map +1 -1
  75. package/lib/module/screens/chat-detail/legend/LegendChatMessage.js +33 -13
  76. package/lib/module/screens/chat-detail/legend/LegendChatMessage.js.map +1 -1
  77. package/lib/module/screens/chat-detail/legend/messageTypes.js +15 -0
  78. package/lib/module/screens/chat-detail/legend/messageTypes.js.map +1 -0
  79. package/lib/module/screens/inbox/MessagesTab.js.map +1 -1
  80. package/lib/module/services/attachmentHandlers/fileAttachmentHandler.js +61 -0
  81. package/lib/module/services/attachmentHandlers/fileAttachmentHandler.js.map +1 -0
  82. package/lib/module/services/attachmentHandlers/imageAttachmentHandler.js +54 -0
  83. package/lib/module/services/attachmentHandlers/imageAttachmentHandler.js.map +1 -0
  84. package/lib/module/services/attachmentHandlers/index.js +12 -0
  85. package/lib/module/services/attachmentHandlers/index.js.map +1 -0
  86. package/lib/module/services/attachmentHandlers/videoAttachmentHandler.js +85 -0
  87. package/lib/module/services/attachmentHandlers/videoAttachmentHandler.js.map +1 -0
  88. package/lib/module/services/attachmentOrchestrator.js +225 -0
  89. package/lib/module/services/attachmentOrchestrator.js.map +1 -0
  90. package/lib/module/services/auth.js +35 -0
  91. package/lib/module/services/auth.js.map +1 -0
  92. package/lib/module/services/endpoints.js +20 -1
  93. package/lib/module/services/endpoints.js.map +1 -1
  94. package/lib/module/services/imageUpload.js +126 -0
  95. package/lib/module/services/imageUpload.js.map +1 -0
  96. package/lib/module/translation/resources/i18n.js +22 -8
  97. package/lib/module/translation/resources/i18n.js.map +1 -1
  98. package/lib/module/types/attachment.js +2 -0
  99. package/lib/module/types/attachment.js.map +1 -0
  100. package/lib/module/types/attachmentHandler.js +20 -0
  101. package/lib/module/types/attachmentHandler.js.map +1 -0
  102. package/lib/module/types/imageUpload.js +2 -0
  103. package/lib/module/types/imageUpload.js.map +1 -0
  104. package/lib/module/types/message.js +1 -0
  105. package/lib/module/types/message.js.map +1 -1
  106. package/lib/module/utils/chatImageDimens.js +148 -0
  107. package/lib/module/utils/chatImageDimens.js.map +1 -0
  108. package/lib/module/utils/device.js +65 -0
  109. package/lib/module/utils/device.js.map +1 -0
  110. package/lib/module/utils/imageUrlOptimizer.js +41 -0
  111. package/lib/module/utils/imageUrlOptimizer.js.map +1 -0
  112. package/lib/module/utils/imageUtils.js +69 -0
  113. package/lib/module/utils/imageUtils.js.map +1 -0
  114. package/lib/module/utils/resolveMessageType.js +3 -0
  115. package/lib/module/utils/resolveMessageType.js.map +1 -1
  116. package/lib/module/utils/ui.js +17 -0
  117. package/lib/module/utils/ui.js.map +1 -0
  118. package/lib/module/utils/url.js +1 -1
  119. package/lib/module/utils/url.js.map +1 -1
  120. package/lib/module/utils/videoThumbnail.js +62 -0
  121. package/lib/module/utils/videoThumbnail.js.map +1 -0
  122. package/lib/typescript/src/components/AttachmentPreview.d.ts +28 -0
  123. package/lib/typescript/src/components/AttachmentPreview.d.ts.map +1 -0
  124. package/lib/typescript/src/components/MediaViewer/index.d.ts +1 -0
  125. package/lib/typescript/src/components/MediaViewer/index.d.ts.map +1 -0
  126. package/lib/typescript/src/components/MediaViewerModal.d.ts +10 -0
  127. package/lib/typescript/src/components/MediaViewerModal.d.ts.map +1 -0
  128. package/lib/typescript/src/components/MergedImageGrid.d.ts +16 -0
  129. package/lib/typescript/src/components/MergedImageGrid.d.ts.map +1 -0
  130. package/lib/typescript/src/components/ThreadCard/thread-card.utils.d.ts.map +1 -1
  131. package/lib/typescript/src/components/messages/fileMessage/index.d.ts +3 -0
  132. package/lib/typescript/src/components/messages/fileMessage/index.d.ts.map +1 -0
  133. package/lib/typescript/src/components/messages/imageMessage/index.d.ts +3 -0
  134. package/lib/typescript/src/components/messages/imageMessage/index.d.ts.map +1 -0
  135. package/lib/typescript/src/components/messages/linkMessage/index.d.ts +9 -0
  136. package/lib/typescript/src/components/messages/linkMessage/index.d.ts.map +1 -0
  137. package/lib/typescript/src/components/messages/mergedMessage/index.d.ts +3 -0
  138. package/lib/typescript/src/components/messages/mergedMessage/index.d.ts.map +1 -0
  139. package/lib/typescript/src/components/messages/styles.d.ts +36 -0
  140. package/lib/typescript/src/components/messages/styles.d.ts.map +1 -0
  141. package/lib/typescript/src/components/messages/textMessage/index.d.ts +9 -0
  142. package/lib/typescript/src/components/messages/textMessage/index.d.ts.map +1 -0
  143. package/lib/typescript/src/components/messages/types.d.ts +10 -0
  144. package/lib/typescript/src/components/messages/types.d.ts.map +1 -0
  145. package/lib/typescript/src/components/messages/videoMessage/index.d.ts +3 -0
  146. package/lib/typescript/src/components/messages/videoMessage/index.d.ts.map +1 -0
  147. package/lib/typescript/src/config/api-endpoints.d.ts +40 -0
  148. package/lib/typescript/src/config/api-endpoints.d.ts.map +1 -0
  149. package/lib/typescript/src/config/attachment-priority.d.ts +31 -0
  150. package/lib/typescript/src/config/attachment-priority.d.ts.map +1 -0
  151. package/lib/typescript/src/config/configuration.d.ts +30 -0
  152. package/lib/typescript/src/config/configuration.d.ts.map +1 -0
  153. package/lib/typescript/src/config/index.d.ts +15 -0
  154. package/lib/typescript/src/config/index.d.ts.map +1 -0
  155. package/lib/typescript/src/core/index.d.ts +13 -1
  156. package/lib/typescript/src/core/index.d.ts.map +1 -1
  157. package/lib/typescript/src/core/useChatListener.d.ts.map +1 -1
  158. package/lib/typescript/src/hooks/message/useSendMessage.d.ts.map +1 -1
  159. package/lib/typescript/src/hooks/useChatMessages.d.ts.map +1 -1
  160. package/lib/typescript/src/hooks/useImageAttachment.d.ts +20 -0
  161. package/lib/typescript/src/hooks/useImageAttachment.d.ts.map +1 -0
  162. package/lib/typescript/src/hooks/useMediaViewer.d.ts +13 -0
  163. package/lib/typescript/src/hooks/useMediaViewer.d.ts.map +1 -0
  164. package/lib/typescript/src/hooks/useSendAttachment.d.ts +59 -0
  165. package/lib/typescript/src/hooks/useSendAttachment.d.ts.map +1 -0
  166. package/lib/typescript/src/hooks/useVideoAttachment.d.ts +29 -0
  167. package/lib/typescript/src/hooks/useVideoAttachment.d.ts.map +1 -0
  168. package/lib/typescript/src/index.d.ts +14 -1
  169. package/lib/typescript/src/index.d.ts.map +1 -1
  170. package/lib/typescript/src/screens/MediaView/VideoPlayer.d.ts +12 -0
  171. package/lib/typescript/src/screens/MediaView/VideoPlayer.d.ts.map +1 -0
  172. package/lib/typescript/src/screens/MediaView/index.d.ts +11 -0
  173. package/lib/typescript/src/screens/MediaView/index.d.ts.map +1 -0
  174. package/lib/typescript/src/screens/chat-detail/ChatComposer.d.ts +1 -1
  175. package/lib/typescript/src/screens/chat-detail/ChatComposer.d.ts.map +1 -1
  176. package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts +1 -1
  177. package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts.map +1 -1
  178. package/lib/typescript/src/screens/chat-detail/ChatListLegend.d.ts +1 -1
  179. package/lib/typescript/src/screens/chat-detail/ChatListLegend.d.ts.map +1 -1
  180. package/lib/typescript/src/screens/chat-detail/components/ChatInputActions.d.ts +8 -0
  181. package/lib/typescript/src/screens/chat-detail/components/ChatInputActions.d.ts.map +1 -0
  182. package/lib/typescript/src/screens/chat-detail/components/ChatMessageInput.d.ts +15 -0
  183. package/lib/typescript/src/screens/chat-detail/components/ChatMessageInput.d.ts.map +1 -0
  184. package/lib/typescript/src/screens/chat-detail/hooks/useAttachmentSendHandler.d.ts +23 -0
  185. package/lib/typescript/src/screens/chat-detail/hooks/useAttachmentSendHandler.d.ts.map +1 -0
  186. package/lib/typescript/src/screens/chat-detail/hooks/useChatComposerAnimation.d.ts +15 -0
  187. package/lib/typescript/src/screens/chat-detail/hooks/useChatComposerAnimation.d.ts.map +1 -0
  188. package/lib/typescript/src/screens/chat-detail/hooks/useChatComposerState.d.ts +13 -0
  189. package/lib/typescript/src/screens/chat-detail/hooks/useChatComposerState.d.ts.map +1 -0
  190. package/lib/typescript/src/screens/chat-detail/index.d.ts +0 -2
  191. package/lib/typescript/src/screens/chat-detail/index.d.ts.map +1 -1
  192. package/lib/typescript/src/screens/chat-detail/legend/LegendChatMessage.d.ts +3 -1
  193. package/lib/typescript/src/screens/chat-detail/legend/LegendChatMessage.d.ts.map +1 -1
  194. package/lib/typescript/src/screens/chat-detail/legend/messageTypes.d.ts +13 -0
  195. package/lib/typescript/src/screens/chat-detail/legend/messageTypes.d.ts.map +1 -0
  196. package/lib/typescript/src/screens/chat-detail/types.d.ts +4 -1
  197. package/lib/typescript/src/screens/chat-detail/types.d.ts.map +1 -1
  198. package/lib/typescript/src/services/attachmentHandlers/fileAttachmentHandler.d.ts +22 -0
  199. package/lib/typescript/src/services/attachmentHandlers/fileAttachmentHandler.d.ts.map +1 -0
  200. package/lib/typescript/src/services/attachmentHandlers/imageAttachmentHandler.d.ts +3 -0
  201. package/lib/typescript/src/services/attachmentHandlers/imageAttachmentHandler.d.ts.map +1 -0
  202. package/lib/typescript/src/services/attachmentHandlers/index.d.ts +5 -0
  203. package/lib/typescript/src/services/attachmentHandlers/index.d.ts.map +1 -0
  204. package/lib/typescript/src/services/attachmentHandlers/videoAttachmentHandler.d.ts +31 -0
  205. package/lib/typescript/src/services/attachmentHandlers/videoAttachmentHandler.d.ts.map +1 -0
  206. package/lib/typescript/src/services/attachmentOrchestrator.d.ts +5 -0
  207. package/lib/typescript/src/services/attachmentOrchestrator.d.ts.map +1 -0
  208. package/lib/typescript/src/services/auth.d.ts +19 -0
  209. package/lib/typescript/src/services/auth.d.ts.map +1 -0
  210. package/lib/typescript/src/services/endpoints.d.ts +11 -1
  211. package/lib/typescript/src/services/endpoints.d.ts.map +1 -1
  212. package/lib/typescript/src/services/imageUpload.d.ts +7 -0
  213. package/lib/typescript/src/services/imageUpload.d.ts.map +1 -0
  214. package/lib/typescript/src/translation/resources/i18n.d.ts.map +1 -1
  215. package/lib/typescript/src/types/attachment.d.ts +72 -0
  216. package/lib/typescript/src/types/attachment.d.ts.map +1 -0
  217. package/lib/typescript/src/types/attachmentHandler.d.ts +13 -0
  218. package/lib/typescript/src/types/attachmentHandler.d.ts.map +1 -0
  219. package/lib/typescript/src/types/imageUpload.d.ts +26 -0
  220. package/lib/typescript/src/types/imageUpload.d.ts.map +1 -0
  221. package/lib/typescript/src/types/message.d.ts +1 -0
  222. package/lib/typescript/src/types/message.d.ts.map +1 -1
  223. package/lib/typescript/src/utils/chatImageDimens.d.ts +34 -0
  224. package/lib/typescript/src/utils/chatImageDimens.d.ts.map +1 -0
  225. package/lib/typescript/src/utils/device.d.ts +7 -0
  226. package/lib/typescript/src/utils/device.d.ts.map +1 -0
  227. package/lib/typescript/src/utils/imageUrlOptimizer.d.ts +12 -0
  228. package/lib/typescript/src/utils/imageUrlOptimizer.d.ts.map +1 -0
  229. package/lib/typescript/src/utils/imageUtils.d.ts +9 -0
  230. package/lib/typescript/src/utils/imageUtils.d.ts.map +1 -0
  231. package/lib/typescript/src/utils/resolveMessageType.d.ts.map +1 -1
  232. package/lib/typescript/src/utils/ui.d.ts +13 -0
  233. package/lib/typescript/src/utils/ui.d.ts.map +1 -0
  234. package/lib/typescript/src/utils/videoThumbnail.d.ts +16 -0
  235. package/lib/typescript/src/utils/videoThumbnail.d.ts.map +1 -0
  236. package/package.json +15 -3
  237. package/src/components/AttachmentPreview.tsx +304 -0
  238. package/src/components/MediaViewer/index.tsx +0 -0
  239. package/src/components/MediaViewerModal.tsx +70 -0
  240. package/src/components/MergedImageGrid.tsx +238 -0
  241. package/src/components/ThreadCard/thread-card.utils.ts +95 -4
  242. package/src/components/messages/fileMessage/index.tsx +30 -0
  243. package/src/components/messages/imageMessage/index.tsx +137 -0
  244. package/src/components/messages/linkMessage/index.tsx +162 -0
  245. package/src/components/messages/mergedMessage/index.tsx +45 -0
  246. package/src/components/messages/styles.ts +39 -0
  247. package/src/components/messages/textMessage/index.tsx +53 -0
  248. package/src/components/messages/types.ts +22 -0
  249. package/src/components/messages/videoMessage/index.tsx +120 -0
  250. package/src/config/api-endpoints.ts +72 -0
  251. package/src/config/attachment-priority.ts +93 -0
  252. package/src/config/configuration.ts +50 -0
  253. package/src/config/index.ts +19 -0
  254. package/src/core/index.ts +25 -1
  255. package/src/core/useChatListener.ts +0 -21
  256. package/src/hooks/message/useSendMessage.ts +12 -5
  257. package/src/hooks/useChatMessages.ts +0 -4
  258. package/src/hooks/useImageAttachment.ts +348 -0
  259. package/src/hooks/useMediaViewer.ts +32 -0
  260. package/src/hooks/useSendAttachment.ts +295 -0
  261. package/src/hooks/useVideoAttachment.ts +334 -0
  262. package/src/index.tsx +13 -1
  263. package/src/screens/MediaView/VideoPlayer.tsx +211 -0
  264. package/src/screens/MediaView/index.tsx +327 -0
  265. package/src/screens/chat-detail/ChatComposer.tsx +206 -271
  266. package/src/screens/chat-detail/ChatDetail.tsx +142 -89
  267. package/src/screens/chat-detail/ChatListLegend.tsx +9 -11
  268. package/src/screens/chat-detail/components/ChatInputActions.tsx +71 -0
  269. package/src/screens/chat-detail/components/ChatMessageInput.tsx +127 -0
  270. package/src/screens/chat-detail/hooks/useAttachmentSendHandler.ts +291 -0
  271. package/src/screens/chat-detail/hooks/useChatComposerAnimation.ts +184 -0
  272. package/src/screens/chat-detail/hooks/useChatComposerState.ts +40 -0
  273. package/src/screens/chat-detail/index.ts +0 -2
  274. package/src/screens/chat-detail/legend/LegendChatMessage.tsx +47 -24
  275. package/src/screens/chat-detail/legend/messageTypes.tsx +13 -0
  276. package/src/screens/chat-detail/types.ts +5 -1
  277. package/src/screens/inbox/MessagesTab.tsx +1 -1
  278. package/src/services/attachmentHandlers/fileAttachmentHandler.ts +78 -0
  279. package/src/services/attachmentHandlers/imageAttachmentHandler.ts +54 -0
  280. package/src/services/attachmentHandlers/index.ts +10 -0
  281. package/src/services/attachmentHandlers/videoAttachmentHandler.ts +114 -0
  282. package/src/services/attachmentOrchestrator.ts +300 -0
  283. package/src/services/auth.ts +34 -0
  284. package/src/services/endpoints.ts +24 -1
  285. package/src/services/imageUpload.ts +162 -0
  286. package/src/translation/resources/i18n.ts +22 -8
  287. package/src/types/attachment.ts +85 -0
  288. package/src/types/attachmentHandler.ts +31 -0
  289. package/src/types/imageUpload.ts +28 -0
  290. package/src/types/message.ts +1 -0
  291. package/src/utils/chatImageDimens.ts +178 -0
  292. package/src/utils/device.ts +73 -0
  293. package/src/utils/imageUrlOptimizer.ts +56 -0
  294. package/src/utils/imageUtils.ts +76 -0
  295. package/src/utils/resolveMessageType.ts +2 -0
  296. package/src/utils/ui.ts +19 -0
  297. package/src/utils/url.ts +1 -1
  298. package/src/utils/videoThumbnail.ts +85 -0
  299. package/lib/module/screens/chat-detail/ChatList.js +0 -147
  300. package/lib/module/screens/chat-detail/ChatList.js.map +0 -1
  301. package/lib/module/screens/chat-detail/ChatTextBubble.js +0 -62
  302. package/lib/module/screens/chat-detail/ChatTextBubble.js.map +0 -1
  303. package/lib/module/screens/chat-detail/legend/message-types.js +0 -244
  304. package/lib/module/screens/chat-detail/legend/message-types.js.map +0 -1
  305. package/lib/module/screens/chat-detail/messages/ChatMessageBubble.js +0 -24
  306. package/lib/module/screens/chat-detail/messages/ChatMessageBubble.js.map +0 -1
  307. package/lib/module/screens/chat-detail/messages/types.js +0 -4
  308. package/lib/module/screens/chat-detail/messages/types.js.map +0 -1
  309. package/lib/typescript/src/screens/chat-detail/ChatList.d.ts +0 -3
  310. package/lib/typescript/src/screens/chat-detail/ChatList.d.ts.map +0 -1
  311. package/lib/typescript/src/screens/chat-detail/ChatTextBubble.d.ts +0 -3
  312. package/lib/typescript/src/screens/chat-detail/ChatTextBubble.d.ts.map +0 -1
  313. package/lib/typescript/src/screens/chat-detail/legend/message-types.d.ts +0 -13
  314. package/lib/typescript/src/screens/chat-detail/legend/message-types.d.ts.map +0 -1
  315. package/lib/typescript/src/screens/chat-detail/messages/ChatMessageBubble.d.ts +0 -3
  316. package/lib/typescript/src/screens/chat-detail/messages/ChatMessageBubble.d.ts.map +0 -1
  317. package/lib/typescript/src/screens/chat-detail/messages/types.d.ts +0 -13
  318. package/lib/typescript/src/screens/chat-detail/messages/types.d.ts.map +0 -1
  319. package/src/screens/chat-detail/ChatList.tsx +0 -190
  320. package/src/screens/chat-detail/ChatTextBubble.tsx +0 -73
  321. package/src/screens/chat-detail/legend/message-types.tsx +0 -304
  322. package/src/screens/chat-detail/messages/ChatMessageBubble.tsx +0 -23
  323. package/src/screens/chat-detail/messages/types.ts +0 -14
@@ -1 +0,0 @@
1
- {"version":3,"names":["memo","Linking","StyleSheet","Text","KContainer","KImage","KLabel","KColors","KSpacingValue","getMessageText","CHAT_BUBBLE_COLORS","jsx","_jsx","jsxs","_jsxs","formatMessageTime","createdAt","date","Date","Number","isNaN","getTime","toLocaleTimeString","hour","minute","hour12","LegendTextMessage","message","isOutgoing","createdAtTime","messageText","timeLabel","trim","View","style","styles","wrapper","children","bubble","bubbleSent","bubbleReceived","typo","color","text","timestamp","marginL","displayName","LegendImageMessage","LegendVideoMessage","LegendFileMessage","fileName","fileElem","content","parseUrlMetadata","ex","undefined","JSON","parse","urlMetadata","renderTextWithLinks","urls","length","parts","remaining","url","idx","indexOf","push","slice","isUrl","map","part","i","urlText","onPress","openURL","LegendLinkMessage","urlTextElem","metadata","textRow","Touchable","card","image","Base","uri","cardThumb","resizeMode","cardBody","title","palette","gray","w900","numberOfLines","primary","w400","description","normal","create","maxWidth","paddingHorizontal","paddingVertical","borderRadius","backgroundColor","received","sent","fontWeight","borderWidth","borderColor","white","overflow","width","aspectRatio","gap"],"sourceRoot":"../../../../../src","sources":["screens/chat-detail/legend/message-types.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,OAAO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C4F,eAAe,EAAE5F,aAAa,CAAC,QAAQ,CAAC;IACxCwG,GAAG,EAAE;EACP;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- import { memo } from 'react';
4
- import { DChatMessageType } from "../../../types/message.js";
5
- import { ChatTextBubble } from "../ChatTextBubble.js";
6
- import { jsx as _jsx } from "react/jsx-runtime";
7
- const getMessageRenderers = () => ({
8
- [DChatMessageType.Text]: ChatTextBubble
9
- });
10
- export const ChatMessageBubble = /*#__PURE__*/memo(({
11
- message,
12
- position
13
- }) => {
14
- const Renderer = getMessageRenderers()[message.messageType];
15
- if (!Renderer) {
16
- return null;
17
- }
18
- return /*#__PURE__*/_jsx(Renderer, {
19
- message: message,
20
- position: position
21
- });
22
- });
23
- ChatMessageBubble.displayName = 'ChatMessageBubble';
24
- //# sourceMappingURL=ChatMessageBubble.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["memo","DChatMessageType","ChatTextBubble","jsx","_jsx","getMessageRenderers","Text","ChatMessageBubble","message","position","Renderer","messageType","displayName"],"sourceRoot":"../../../../../src","sources":["screens/chat-detail/messages/ChatMessageBubble.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,gBAAgB,QAAQ,2BAAwB;AACzD,SAASC,cAAc,QAAQ,sBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGnD,MAAMC,mBAAmB,GAAGA,CAAA,MAEtB;EACJ,CAACJ,gBAAgB,CAACK,IAAI,GAAGJ;AAC3B,CAAC,CAAC;AAEF,OAAO,MAAMK,iBAAiB,gBAAGP,IAAI,CACnC,CAAC;EAAEQ,OAAO;EAAEC;AAAiC,CAAC,KAAK;EACjD,MAAMC,QAAQ,GAAGL,mBAAmB,CAAC,CAAC,CAACG,OAAO,CAACG,WAAW,CAAC;EAC3D,IAAI,CAACD,QAAQ,EAAE;IACb,OAAO,IAAI;EACb;EAEA,oBAAON,IAAA,CAACM,QAAQ;IAACF,OAAO,EAAEA,OAAQ;IAACC,QAAQ,EAAEA;EAAS,CAAE,CAAC;AAC3D,CACF,CAAC;AAEDF,iBAAiB,CAACK,WAAW,GAAG,mBAAmB","ignoreList":[]}
@@ -1,4 +0,0 @@
1
- "use strict";
2
-
3
- export {};
4
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["screens/chat-detail/messages/types.ts"],"mappings":"","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import type { ChatListProps } from './types';
2
- export declare const ChatList: import("react").MemoExoticComponent<({ messages, currentUserId, renderChat, onLoadEarlier, isLoading, isLoadingEarlier, hasMoreEarlier, }: ChatListProps) => import("react").JSX.Element>;
3
- //# sourceMappingURL=ChatList.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChatList.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/ChatList.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAM7C,eAAO,MAAM,QAAQ,6IAWhB,aAAa,iCAsHjB,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { ChatMessageBubbleProps } from './messages/types';
2
- export declare const ChatTextBubble: import("react").MemoExoticComponent<({ message, position }: ChatMessageBubbleProps) => import("react").JSX.Element>;
3
- //# sourceMappingURL=ChatTextBubble.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChatTextBubble.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/ChatTextBubble.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAgB/D,eAAO,MAAM,cAAc,8DACD,sBAAsB,iCAiC/C,CAAC"}
@@ -1,13 +0,0 @@
1
- import type { DMessageItem } from '../../../types/chat';
2
- interface BaseLegendMessageProps {
3
- message: DMessageItem;
4
- isOutgoing: boolean;
5
- createdAtTime: number;
6
- }
7
- export declare const LegendTextMessage: import("react").MemoExoticComponent<({ message, isOutgoing, createdAtTime }: BaseLegendMessageProps) => import("react").JSX.Element>;
8
- export declare const LegendImageMessage: import("react").MemoExoticComponent<({ isOutgoing }: BaseLegendMessageProps) => import("react").JSX.Element>;
9
- export declare const LegendVideoMessage: import("react").MemoExoticComponent<({ isOutgoing }: BaseLegendMessageProps) => import("react").JSX.Element>;
10
- export declare const LegendFileMessage: import("react").MemoExoticComponent<({ message, isOutgoing }: BaseLegendMessageProps) => import("react").JSX.Element>;
11
- export declare const LegendLinkMessage: import("react").MemoExoticComponent<({ message, isOutgoing, createdAtTime }: BaseLegendMessageProps) => import("react").JSX.Element>;
12
- export {};
13
- //# sourceMappingURL=message-types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"message-types.d.ts","sourceRoot":"","sources":["../../../../../../src/screens/chat-detail/legend/message-types.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAkB,MAAM,qBAAqB,CAAC;AAKxE,UAAU,sBAAsB;IAC9B,OAAO,EAAE,YAAY,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB;AAaD,eAAO,MAAM,iBAAiB,+EACa,sBAAsB,iCAiChE,CAAC;AAIF,eAAO,MAAM,kBAAkB,uDACZ,sBAAsB,iCAgBxC,CAAC;AAIF,eAAO,MAAM,kBAAkB,uDACZ,sBAAsB,iCAgBxC,CAAC;AAIF,eAAO,MAAM,iBAAiB,gEACF,sBAAsB,iCAkBjD,CAAC;AAsDF,eAAO,MAAM,iBAAiB,+EACa,sBAAsB,iCA6EhE,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { ChatMessageBubbleProps } from './types';
2
- export declare const ChatMessageBubble: import("react").MemoExoticComponent<({ message, position }: ChatMessageBubbleProps) => import("react").JSX.Element>;
3
- //# sourceMappingURL=ChatMessageBubble.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChatMessageBubble.d.ts","sourceRoot":"","sources":["../../../../../../src/screens/chat-detail/messages/ChatMessageBubble.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAuB,MAAM,SAAS,CAAC;AAQ3E,eAAO,MAAM,iBAAiB,8DACJ,sBAAsB,iCAQ/C,CAAC"}
@@ -1,13 +0,0 @@
1
- import type { ComponentType } from 'react';
2
- import type { IMessage } from 'react-native-gifted-chat';
3
- import type { DMessageItem } from '../../../types/chat';
4
- import type { DChatMessageType } from '../../../types/message';
5
- export type ChatMessageBubbleProps = {
6
- message: IMessage & {
7
- openIMMessage: DMessageItem;
8
- messageType: DChatMessageType;
9
- };
10
- position: 'left' | 'right';
11
- };
12
- export type ChatMessageRenderer = ComponentType<ChatMessageBubbleProps>;
13
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/screens/chat-detail/messages/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,QAAQ,GAAG;QAClB,aAAa,EAAE,YAAY,CAAC;QAC5B,WAAW,EAAE,gBAAgB,CAAC;KAC/B,CAAC;IACF,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,aAAa,CAAC,sBAAsB,CAAC,CAAC"}
@@ -1,190 +0,0 @@
1
- import { memo, useCallback, useMemo, useRef } from 'react';
2
- import { ActivityIndicator, StyleSheet } from 'react-native';
3
- import {
4
- GiftedChat,
5
- type DayProps,
6
- type LoadEarlierMessagesProps,
7
- type MessageProps,
8
- } from 'react-native-gifted-chat';
9
- import { KContainer, KColors, KSpacingValue } from '@droppii/libs';
10
- import { mapOpenIMMessagesToGiftedChat } from '../../utils/giftedChatMessage';
11
- import type { DGiftedChatMessage } from '../../utils/giftedChatMessage';
12
-
13
- import type { ChatListProps } from './types';
14
- import { ChatDay } from './ChatDay';
15
- import { ChatLoadEarlier } from './ChatLoadEarlier';
16
- import { ChatScrollToBottom } from './ChatScrollToBottom';
17
- import { ChatMessageBubble } from './messages/ChatMessageBubble';
18
-
19
- export const ChatList = memo(
20
- ({
21
- messages = [],
22
- currentUserId = '',
23
- renderChat,
24
- onLoadEarlier,
25
- isLoading,
26
- isLoadingEarlier,
27
- hasMoreEarlier,
28
- // Note: onLoadNewer, isLoadingNewer, hasMoreNewer are not used in GiftedChat
29
- // as it has its own pagination mechanism. They're kept for API compatibility.
30
- }: ChatListProps) => {
31
- const giftedMessages = useMemo(
32
- () => mapOpenIMMessagesToGiftedChat(messages),
33
- [messages]
34
- );
35
-
36
- const user = useMemo(
37
- () => ({ _id: String(currentUserId) }),
38
- [currentUserId]
39
- );
40
-
41
- const renderMessage = useCallback(
42
- (props: MessageProps<DGiftedChatMessage>) => {
43
- const currentMessage = props.currentMessage;
44
-
45
- if (!currentMessage) {
46
- return <KContainer.View />;
47
- }
48
-
49
- const isOutgoing = props.position === 'right';
50
-
51
- return (
52
- <KContainer.View
53
- style={[
54
- styles.messageRow,
55
- isOutgoing ? styles.messageRowRight : styles.messageRowLeft,
56
- ]}
57
- >
58
- {renderChat ? (
59
- renderChat(currentMessage.openIMMessage)
60
- ) : (
61
- <ChatMessageBubble
62
- message={currentMessage}
63
- position={props.position}
64
- />
65
- )}
66
- </KContainer.View>
67
- );
68
- },
69
- [renderChat]
70
- );
71
-
72
- const renderDay = useCallback(
73
- (props: DayProps) => <ChatDay {...props} />,
74
- []
75
- );
76
-
77
- const renderLoadEarlier = useCallback(
78
- (props: LoadEarlierMessagesProps) => <ChatLoadEarlier {...props} />,
79
- []
80
- );
81
-
82
- const onLoadEarlierRef = useRef(onLoadEarlier);
83
- onLoadEarlierRef.current = onLoadEarlier;
84
-
85
- const handleLoadEarlier = useCallback(() => {
86
- onLoadEarlierRef.current?.();
87
- }, []);
88
-
89
- const loadEarlierMessagesProps = useMemo(
90
- () =>
91
- onLoadEarlier
92
- ? {
93
- isAvailable: !!hasMoreEarlier,
94
- isInfiniteScrollEnabled: true,
95
- onPress: handleLoadEarlier,
96
- isLoading: isLoadingEarlier ?? false,
97
- }
98
- : undefined,
99
- [hasMoreEarlier, isLoadingEarlier, onLoadEarlier, handleLoadEarlier]
100
- );
101
-
102
- const renderScrollToBottom = useCallback(() => <ChatScrollToBottom />, []);
103
-
104
- return (
105
- <KContainer.View flex background={KColors.white}>
106
- {isLoading ? (
107
- <KContainer.View flex center>
108
- <ActivityIndicator
109
- color={KColors.palette.primary.w400}
110
- size="small"
111
- />
112
- </KContainer.View>
113
- ) : (
114
- <GiftedChat
115
- messages={giftedMessages}
116
- user={user}
117
- renderInputToolbar={() => null}
118
- renderAvatar={() => null}
119
- renderMessage={renderMessage}
120
- renderDay={renderDay}
121
- renderLoadEarlier={onLoadEarlier ? renderLoadEarlier : undefined}
122
- isDayAnimationEnabled={false}
123
- keyboardAvoidingViewProps={{ enabled: false }}
124
- messagesContainerStyle={styles.messagesContainer}
125
- minInputToolbarHeight={0}
126
- loadEarlierMessagesProps={loadEarlierMessagesProps}
127
- listProps={{
128
- showsVerticalScrollIndicator: false,
129
- keyboardShouldPersistTaps: 'handled',
130
- contentContainerStyle: styles.content,
131
- onEndReachedThreshold: 0.5,
132
- }}
133
- reply={{
134
- swipe: {
135
- isEnabled: true,
136
- direction: 'left',
137
- },
138
- }}
139
- isScrollToBottomEnabled
140
- scrollToBottomComponent={renderScrollToBottom}
141
- scrollToBottomStyle={styles.scrollToBottom}
142
- scrollToBottomContentStyle={styles.scrollToBottomContent}
143
- />
144
- )}
145
- </KContainer.View>
146
- );
147
- }
148
- );
149
-
150
- ChatList.displayName = 'ChatList';
151
-
152
- const styles = StyleSheet.create({
153
- messagesContainer: {
154
- backgroundColor: KColors.white,
155
- },
156
- content: {
157
- paddingVertical: KSpacingValue['0.75rem'],
158
- flexGrow: 1,
159
- },
160
- messageRow: {
161
- width: '100%',
162
- paddingHorizontal: KSpacingValue['0.75rem'],
163
- marginBottom: KSpacingValue['0.25rem'],
164
- },
165
- messageRowLeft: {
166
- alignItems: 'flex-start',
167
- },
168
- messageRowRight: {
169
- alignItems: 'flex-end',
170
- },
171
- scrollToBottom: {
172
- position: 'absolute',
173
- bottom: 20,
174
- right: 16,
175
- zIndex: 999,
176
- },
177
- scrollToBottomContent: {
178
- backgroundColor: KColors.white,
179
- width: 32,
180
- height: 32,
181
- borderRadius: 16,
182
- shadowColor: KColors.black,
183
- shadowOffset: { width: 0, height: 1 },
184
- shadowOpacity: 0.16,
185
- shadowRadius: 8,
186
- elevation: 8,
187
- justifyContent: 'center',
188
- alignItems: 'center',
189
- },
190
- });
@@ -1,73 +0,0 @@
1
- import { memo } from 'react';
2
- import { StyleSheet } from 'react-native';
3
- import { KContainer, KLabel, KSpacingValue } from '@droppii/libs';
4
- import type { ChatMessageBubbleProps } from './messages/types';
5
- import { CHAT_BUBBLE_COLORS } from './constants';
6
-
7
- const formatMessageTime = (createdAt: Date | number) => {
8
- const date = new Date(createdAt);
9
- if (Number.isNaN(date.getTime())) {
10
- return '';
11
- }
12
-
13
- return date.toLocaleTimeString('vi-VN', {
14
- hour: '2-digit',
15
- minute: '2-digit',
16
- hour12: false,
17
- });
18
- };
19
-
20
- export const ChatTextBubble = memo(
21
- ({ message, position }: ChatMessageBubbleProps) => {
22
- const isOutgoing = position === 'right';
23
- const timeLabel = formatMessageTime(message.createdAt);
24
-
25
- if (!message.text?.trim()) {
26
- return null;
27
- }
28
-
29
- return (
30
- <KContainer.View style={styles.wrapper}>
31
- <KContainer.View
32
- style={[
33
- styles.bubble,
34
- isOutgoing ? styles.bubbleSent : styles.bubbleReceived,
35
- ]}
36
- >
37
- <KLabel.Text typo="TextMdNormal" color={CHAT_BUBBLE_COLORS.text}>
38
- {message.text}
39
- </KLabel.Text>
40
- </KContainer.View>
41
-
42
- {!isOutgoing && timeLabel ? (
43
- <KLabel.Text
44
- typo="TextXsNormal"
45
- color={CHAT_BUBBLE_COLORS.timestamp}
46
- marginL={'0.25rem'}
47
- >
48
- {timeLabel}
49
- </KLabel.Text>
50
- ) : null}
51
- </KContainer.View>
52
- );
53
- }
54
- );
55
-
56
- ChatTextBubble.displayName = 'ChatTextBubble';
57
-
58
- const styles = StyleSheet.create({
59
- wrapper: {
60
- maxWidth: '80%',
61
- },
62
- bubble: {
63
- paddingHorizontal: KSpacingValue['0.75rem'],
64
- paddingVertical: KSpacingValue['0.5rem'],
65
- borderRadius: KSpacingValue['1.25rem'],
66
- },
67
- bubbleReceived: {
68
- backgroundColor: CHAT_BUBBLE_COLORS.received,
69
- },
70
- bubbleSent: {
71
- backgroundColor: CHAT_BUBBLE_COLORS.sent,
72
- },
73
- });