@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.
- package/lib/module/components/AttachmentPreview.js +250 -0
- package/lib/module/components/AttachmentPreview.js.map +1 -0
- package/lib/module/components/MediaViewer/index.js +2 -0
- package/lib/module/components/MediaViewer/index.js.map +1 -0
- package/lib/module/components/MediaViewerModal.js +57 -0
- package/lib/module/components/MediaViewerModal.js.map +1 -0
- package/lib/module/components/MergedImageGrid.js +173 -0
- package/lib/module/components/MergedImageGrid.js.map +1 -0
- package/lib/module/components/ThreadCard/AvatarSection.js +4 -4
- package/lib/module/components/ThreadCard/AvatarSection.js.map +1 -1
- package/lib/module/components/ThreadCard/NamePrefixIcon.js +13 -16
- package/lib/module/components/ThreadCard/NamePrefixIcon.js.map +1 -1
- package/lib/module/components/ThreadCard/ThreadCard.js +13 -33
- package/lib/module/components/ThreadCard/ThreadCard.js.map +1 -1
- package/lib/module/components/ThreadCard/thread-card.utils.js +80 -4
- package/lib/module/components/ThreadCard/thread-card.utils.js.map +1 -1
- package/lib/module/components/messages/fileMessage/index.js +26 -0
- package/lib/module/components/messages/fileMessage/index.js.map +1 -0
- package/lib/module/components/messages/imageMessage/index.js +118 -0
- package/lib/module/components/messages/imageMessage/index.js.map +1 -0
- package/lib/module/components/messages/linkMessage/index.js +122 -0
- package/lib/module/components/messages/linkMessage/index.js.map +1 -0
- package/lib/module/components/messages/mergedMessage/index.js +37 -0
- package/lib/module/components/messages/mergedMessage/index.js.map +1 -0
- package/lib/module/components/messages/styles.js +41 -0
- package/lib/module/components/messages/styles.js.map +1 -0
- package/lib/module/components/messages/textMessage/index.js +38 -0
- package/lib/module/components/messages/textMessage/index.js.map +1 -0
- package/lib/module/components/messages/types.js +14 -0
- package/lib/module/components/messages/types.js.map +1 -0
- package/lib/module/components/messages/videoMessage/index.js +110 -0
- package/lib/module/components/messages/videoMessage/index.js.map +1 -0
- package/lib/module/config/api-endpoints.js +66 -0
- package/lib/module/config/api-endpoints.js.map +1 -0
- package/lib/module/config/attachment-priority.js +81 -0
- package/lib/module/config/attachment-priority.js.map +1 -0
- package/lib/module/config/configuration.js +50 -0
- package/lib/module/config/configuration.js.map +1 -0
- package/lib/module/config/index.js +22 -0
- package/lib/module/config/index.js.map +1 -0
- package/lib/module/context/ChatContext.js +7 -6
- package/lib/module/context/ChatContext.js.map +1 -1
- package/lib/module/core/index.js +19 -1
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/core/useChatListener.js +0 -14
- package/lib/module/core/useChatListener.js.map +1 -1
- package/lib/module/hooks/message/useSendMessage.js +106 -0
- package/lib/module/hooks/message/useSendMessage.js.map +1 -0
- package/lib/module/hooks/useChatMessages.js +36 -121
- package/lib/module/hooks/useChatMessages.js.map +1 -1
- package/lib/module/hooks/useConversationList.js +29 -17
- package/lib/module/hooks/useConversationList.js.map +1 -1
- package/lib/module/hooks/useImageAttachment.js +263 -0
- package/lib/module/hooks/useImageAttachment.js.map +1 -0
- package/lib/module/hooks/useLinkPreview/useLinkPreview.js +3 -2
- package/lib/module/hooks/useLinkPreview/useLinkPreview.js.map +1 -1
- package/lib/module/hooks/useMediaViewer.js +24 -0
- package/lib/module/hooks/useMediaViewer.js.map +1 -0
- package/lib/module/hooks/useSendAttachment.js +182 -0
- package/lib/module/hooks/useSendAttachment.js.map +1 -0
- package/lib/module/hooks/useVideoAttachment.js +251 -0
- package/lib/module/hooks/useVideoAttachment.js.map +1 -0
- package/lib/module/index.js +13 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/screens/MediaView/VideoPlayer.js +177 -0
- package/lib/module/screens/MediaView/VideoPlayer.js.map +1 -0
- package/lib/module/screens/MediaView/index.js +264 -0
- package/lib/module/screens/MediaView/index.js.map +1 -0
- package/lib/module/screens/chat-detail/ChatComposer.js +190 -196
- package/lib/module/screens/chat-detail/ChatComposer.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatDetail.js +106 -71
- package/lib/module/screens/chat-detail/ChatDetail.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatDetailHeader.js +5 -8
- package/lib/module/screens/chat-detail/ChatDetailHeader.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatLinkPreview.js +1 -1
- package/lib/module/screens/chat-detail/ChatLinkPreview.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatListLegend.js +5 -15
- package/lib/module/screens/chat-detail/ChatListLegend.js.map +1 -1
- package/lib/module/screens/chat-detail/components/ChatInputActions.js +51 -0
- package/lib/module/screens/chat-detail/components/ChatInputActions.js.map +1 -0
- package/lib/module/screens/chat-detail/components/ChatMessageInput.js +93 -0
- package/lib/module/screens/chat-detail/components/ChatMessageInput.js.map +1 -0
- package/lib/module/screens/chat-detail/conversationHeader.utils.js +7 -9
- package/lib/module/screens/chat-detail/conversationHeader.utils.js.map +1 -1
- package/lib/module/screens/chat-detail/hooks/useAttachmentSendHandler.js +221 -0
- package/lib/module/screens/chat-detail/hooks/useAttachmentSendHandler.js.map +1 -0
- package/lib/module/screens/chat-detail/hooks/useChatComposerAnimation.js +114 -0
- package/lib/module/screens/chat-detail/hooks/useChatComposerAnimation.js.map +1 -0
- package/lib/module/screens/chat-detail/hooks/useChatComposerState.js +26 -0
- package/lib/module/screens/chat-detail/hooks/useChatComposerState.js.map +1 -0
- package/lib/module/screens/chat-detail/index.js +0 -1
- package/lib/module/screens/chat-detail/index.js.map +1 -1
- package/lib/module/screens/chat-detail/legend/LegendChatMessage.js +32 -25
- package/lib/module/screens/chat-detail/legend/LegendChatMessage.js.map +1 -1
- package/lib/module/screens/chat-detail/legend/messageTypes.js +15 -0
- package/lib/module/screens/chat-detail/legend/messageTypes.js.map +1 -0
- package/lib/module/screens/inbox/MessagesTab.js.map +1 -1
- package/lib/module/services/attachmentHandlers/fileAttachmentHandler.js +61 -0
- package/lib/module/services/attachmentHandlers/fileAttachmentHandler.js.map +1 -0
- package/lib/module/services/attachmentHandlers/imageAttachmentHandler.js +54 -0
- package/lib/module/services/attachmentHandlers/imageAttachmentHandler.js.map +1 -0
- package/lib/module/services/attachmentHandlers/index.js +12 -0
- package/lib/module/services/attachmentHandlers/index.js.map +1 -0
- package/lib/module/services/attachmentHandlers/videoAttachmentHandler.js +85 -0
- package/lib/module/services/attachmentHandlers/videoAttachmentHandler.js.map +1 -0
- package/lib/module/services/attachmentOrchestrator.js +225 -0
- package/lib/module/services/attachmentOrchestrator.js.map +1 -0
- package/lib/module/services/auth.js +35 -0
- package/lib/module/services/auth.js.map +1 -0
- package/lib/module/services/endpoints.js +20 -1
- package/lib/module/services/endpoints.js.map +1 -1
- package/lib/module/services/imageUpload.js +126 -0
- package/lib/module/services/imageUpload.js.map +1 -0
- package/lib/module/store/conversation.js +1 -1
- package/lib/module/store/conversation.js.map +1 -1
- package/lib/module/store/message.js +45 -0
- package/lib/module/store/message.js.map +1 -0
- package/lib/module/translation/resources/i18n.js +22 -2
- package/lib/module/translation/resources/i18n.js.map +1 -1
- package/lib/module/types/attachment.js +2 -0
- package/lib/module/types/attachment.js.map +1 -0
- package/lib/module/types/attachmentHandler.js +20 -0
- package/lib/module/types/attachmentHandler.js.map +1 -0
- package/lib/module/types/chat.js +2 -7
- package/lib/module/types/chat.js.map +1 -1
- package/lib/module/types/imageUpload.js +2 -0
- package/lib/module/types/imageUpload.js.map +1 -0
- package/lib/module/types/message.js +1 -0
- package/lib/module/types/message.js.map +1 -1
- package/lib/module/utils/chatImageDimens.js +148 -0
- package/lib/module/utils/chatImageDimens.js.map +1 -0
- package/lib/module/utils/conversation.js +34 -13
- package/lib/module/utils/conversation.js.map +1 -1
- package/lib/module/utils/device.js +65 -0
- package/lib/module/utils/device.js.map +1 -0
- package/lib/module/utils/imageUrlOptimizer.js +41 -0
- package/lib/module/utils/imageUrlOptimizer.js.map +1 -0
- package/lib/module/utils/imageUtils.js +69 -0
- package/lib/module/utils/imageUtils.js.map +1 -0
- package/lib/module/utils/legendListMessage.js +0 -3
- package/lib/module/utils/legendListMessage.js.map +1 -1
- package/lib/module/utils/message.js +5 -8
- package/lib/module/utils/message.js.map +1 -1
- package/lib/module/utils/resolveMessageType.js +3 -0
- package/lib/module/utils/resolveMessageType.js.map +1 -1
- package/lib/module/utils/ui.js +17 -0
- package/lib/module/utils/ui.js.map +1 -0
- package/lib/module/utils/url.js +3 -3
- package/lib/module/utils/url.js.map +1 -1
- package/lib/module/utils/videoThumbnail.js +62 -0
- package/lib/module/utils/videoThumbnail.js.map +1 -0
- package/lib/typescript/src/components/AttachmentPreview.d.ts +28 -0
- package/lib/typescript/src/components/AttachmentPreview.d.ts.map +1 -0
- package/lib/typescript/src/components/MediaViewer/index.d.ts +1 -0
- package/lib/typescript/src/components/MediaViewer/index.d.ts.map +1 -0
- package/lib/typescript/src/components/MediaViewerModal.d.ts +10 -0
- package/lib/typescript/src/components/MediaViewerModal.d.ts.map +1 -0
- package/lib/typescript/src/components/MergedImageGrid.d.ts +16 -0
- package/lib/typescript/src/components/MergedImageGrid.d.ts.map +1 -0
- package/lib/typescript/src/components/ThreadCard/AvatarSection.d.ts +2 -2
- package/lib/typescript/src/components/ThreadCard/AvatarSection.d.ts.map +1 -1
- package/lib/typescript/src/components/ThreadCard/NamePrefixIcon.d.ts +3 -4
- package/lib/typescript/src/components/ThreadCard/NamePrefixIcon.d.ts.map +1 -1
- package/lib/typescript/src/components/ThreadCard/ThreadCard.d.ts.map +1 -1
- package/lib/typescript/src/components/ThreadCard/thread-card.utils.d.ts.map +1 -1
- package/lib/typescript/src/components/messages/fileMessage/index.d.ts +3 -0
- package/lib/typescript/src/components/messages/fileMessage/index.d.ts.map +1 -0
- package/lib/typescript/src/components/messages/imageMessage/index.d.ts +3 -0
- package/lib/typescript/src/components/messages/imageMessage/index.d.ts.map +1 -0
- package/lib/typescript/src/components/messages/linkMessage/index.d.ts +9 -0
- package/lib/typescript/src/components/messages/linkMessage/index.d.ts.map +1 -0
- package/lib/typescript/src/components/messages/mergedMessage/index.d.ts +3 -0
- package/lib/typescript/src/components/messages/mergedMessage/index.d.ts.map +1 -0
- package/lib/typescript/src/components/messages/styles.d.ts +36 -0
- package/lib/typescript/src/components/messages/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/messages/textMessage/index.d.ts +9 -0
- package/lib/typescript/src/components/messages/textMessage/index.d.ts.map +1 -0
- package/lib/typescript/src/components/messages/types.d.ts +10 -0
- package/lib/typescript/src/components/messages/types.d.ts.map +1 -0
- package/lib/typescript/src/components/messages/videoMessage/index.d.ts +3 -0
- package/lib/typescript/src/components/messages/videoMessage/index.d.ts.map +1 -0
- package/lib/typescript/src/config/api-endpoints.d.ts +40 -0
- package/lib/typescript/src/config/api-endpoints.d.ts.map +1 -0
- package/lib/typescript/src/config/attachment-priority.d.ts +31 -0
- package/lib/typescript/src/config/attachment-priority.d.ts.map +1 -0
- package/lib/typescript/src/config/configuration.d.ts +30 -0
- package/lib/typescript/src/config/configuration.d.ts.map +1 -0
- package/lib/typescript/src/config/index.d.ts +15 -0
- package/lib/typescript/src/config/index.d.ts.map +1 -0
- package/lib/typescript/src/context/ChatContext.d.ts +1 -1
- package/lib/typescript/src/context/ChatContext.d.ts.map +1 -1
- package/lib/typescript/src/core/index.d.ts +13 -1
- package/lib/typescript/src/core/index.d.ts.map +1 -1
- package/lib/typescript/src/core/useChatListener.d.ts.map +1 -1
- package/lib/typescript/src/hooks/message/useSendMessage.d.ts +12 -0
- package/lib/typescript/src/hooks/message/useSendMessage.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useChatMessages.d.ts +0 -1
- package/lib/typescript/src/hooks/useChatMessages.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useConversationList.d.ts +2 -1
- package/lib/typescript/src/hooks/useConversationList.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useImageAttachment.d.ts +20 -0
- package/lib/typescript/src/hooks/useImageAttachment.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useLinkPreview/useLinkPreview.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useMediaViewer.d.ts +13 -0
- package/lib/typescript/src/hooks/useMediaViewer.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useSendAttachment.d.ts +59 -0
- package/lib/typescript/src/hooks/useSendAttachment.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useVideoAttachment.d.ts +29 -0
- package/lib/typescript/src/hooks/useVideoAttachment.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +14 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/screens/MediaView/VideoPlayer.d.ts +12 -0
- package/lib/typescript/src/screens/MediaView/VideoPlayer.d.ts.map +1 -0
- package/lib/typescript/src/screens/MediaView/index.d.ts +11 -0
- package/lib/typescript/src/screens/MediaView/index.d.ts.map +1 -0
- package/lib/typescript/src/screens/chat-detail/ChatComposer.d.ts +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatComposer.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatDetailHeader.d.ts +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatDetailHeader.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatListLegend.d.ts +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatListLegend.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/components/ChatInputActions.d.ts +8 -0
- package/lib/typescript/src/screens/chat-detail/components/ChatInputActions.d.ts.map +1 -0
- package/lib/typescript/src/screens/chat-detail/components/ChatMessageInput.d.ts +15 -0
- package/lib/typescript/src/screens/chat-detail/components/ChatMessageInput.d.ts.map +1 -0
- package/lib/typescript/src/screens/chat-detail/conversationHeader.utils.d.ts +1 -1
- package/lib/typescript/src/screens/chat-detail/conversationHeader.utils.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/hooks/useAttachmentSendHandler.d.ts +23 -0
- package/lib/typescript/src/screens/chat-detail/hooks/useAttachmentSendHandler.d.ts.map +1 -0
- package/lib/typescript/src/screens/chat-detail/hooks/useChatComposerAnimation.d.ts +15 -0
- package/lib/typescript/src/screens/chat-detail/hooks/useChatComposerAnimation.d.ts.map +1 -0
- package/lib/typescript/src/screens/chat-detail/hooks/useChatComposerState.d.ts +13 -0
- package/lib/typescript/src/screens/chat-detail/hooks/useChatComposerState.d.ts.map +1 -0
- package/lib/typescript/src/screens/chat-detail/index.d.ts +0 -2
- package/lib/typescript/src/screens/chat-detail/index.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/legend/LegendChatMessage.d.ts +3 -3
- package/lib/typescript/src/screens/chat-detail/legend/LegendChatMessage.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/legend/messageTypes.d.ts +13 -0
- package/lib/typescript/src/screens/chat-detail/legend/messageTypes.d.ts.map +1 -0
- package/lib/typescript/src/screens/chat-detail/types.d.ts +10 -8
- package/lib/typescript/src/screens/chat-detail/types.d.ts.map +1 -1
- package/lib/typescript/src/services/attachmentHandlers/fileAttachmentHandler.d.ts +22 -0
- package/lib/typescript/src/services/attachmentHandlers/fileAttachmentHandler.d.ts.map +1 -0
- package/lib/typescript/src/services/attachmentHandlers/imageAttachmentHandler.d.ts +3 -0
- package/lib/typescript/src/services/attachmentHandlers/imageAttachmentHandler.d.ts.map +1 -0
- package/lib/typescript/src/services/attachmentHandlers/index.d.ts +5 -0
- package/lib/typescript/src/services/attachmentHandlers/index.d.ts.map +1 -0
- package/lib/typescript/src/services/attachmentHandlers/videoAttachmentHandler.d.ts +31 -0
- package/lib/typescript/src/services/attachmentHandlers/videoAttachmentHandler.d.ts.map +1 -0
- package/lib/typescript/src/services/attachmentOrchestrator.d.ts +5 -0
- package/lib/typescript/src/services/attachmentOrchestrator.d.ts.map +1 -0
- package/lib/typescript/src/services/auth.d.ts +19 -0
- package/lib/typescript/src/services/auth.d.ts.map +1 -0
- package/lib/typescript/src/services/endpoints.d.ts +11 -1
- package/lib/typescript/src/services/endpoints.d.ts.map +1 -1
- package/lib/typescript/src/services/imageUpload.d.ts +7 -0
- package/lib/typescript/src/services/imageUpload.d.ts.map +1 -0
- package/lib/typescript/src/store/message.d.ts +3 -0
- package/lib/typescript/src/store/message.d.ts.map +1 -0
- package/lib/typescript/src/translation/resources/i18n.d.ts.map +1 -1
- package/lib/typescript/src/types/attachment.d.ts +72 -0
- package/lib/typescript/src/types/attachment.d.ts.map +1 -0
- package/lib/typescript/src/types/attachmentHandler.d.ts +13 -0
- package/lib/typescript/src/types/attachmentHandler.d.ts.map +1 -0
- package/lib/typescript/src/types/chat.d.ts +28 -27
- package/lib/typescript/src/types/chat.d.ts.map +1 -1
- package/lib/typescript/src/types/common.d.ts +1 -0
- package/lib/typescript/src/types/common.d.ts.map +1 -1
- package/lib/typescript/src/types/imageUpload.d.ts +26 -0
- package/lib/typescript/src/types/imageUpload.d.ts.map +1 -0
- package/lib/typescript/src/types/message.d.ts +1 -0
- package/lib/typescript/src/types/message.d.ts.map +1 -1
- package/lib/typescript/src/utils/chatImageDimens.d.ts +34 -0
- package/lib/typescript/src/utils/chatImageDimens.d.ts.map +1 -0
- package/lib/typescript/src/utils/conversation.d.ts +3 -2
- package/lib/typescript/src/utils/conversation.d.ts.map +1 -1
- package/lib/typescript/src/utils/device.d.ts +7 -0
- package/lib/typescript/src/utils/device.d.ts.map +1 -0
- package/lib/typescript/src/utils/imageUrlOptimizer.d.ts +12 -0
- package/lib/typescript/src/utils/imageUrlOptimizer.d.ts.map +1 -0
- package/lib/typescript/src/utils/imageUtils.d.ts +9 -0
- package/lib/typescript/src/utils/imageUtils.d.ts.map +1 -0
- package/lib/typescript/src/utils/legendListMessage.d.ts +0 -2
- package/lib/typescript/src/utils/legendListMessage.d.ts.map +1 -1
- package/lib/typescript/src/utils/message.d.ts.map +1 -1
- package/lib/typescript/src/utils/resolveMessageType.d.ts.map +1 -1
- package/lib/typescript/src/utils/ui.d.ts +13 -0
- package/lib/typescript/src/utils/ui.d.ts.map +1 -0
- package/lib/typescript/src/utils/url.d.ts +1 -1
- package/lib/typescript/src/utils/url.d.ts.map +1 -1
- package/lib/typescript/src/utils/videoThumbnail.d.ts +16 -0
- package/lib/typescript/src/utils/videoThumbnail.d.ts.map +1 -0
- package/package.json +15 -3
- package/src/components/AttachmentPreview.tsx +304 -0
- package/src/components/MediaViewer/index.tsx +0 -0
- package/src/components/MediaViewerModal.tsx +70 -0
- package/src/components/MergedImageGrid.tsx +238 -0
- package/src/components/ThreadCard/AvatarSection.tsx +5 -8
- package/src/components/ThreadCard/NamePrefixIcon.tsx +27 -38
- package/src/components/ThreadCard/ThreadCard.tsx +16 -30
- package/src/components/ThreadCard/thread-card.utils.ts +95 -4
- package/src/components/messages/fileMessage/index.tsx +30 -0
- package/src/components/messages/imageMessage/index.tsx +137 -0
- package/src/components/messages/linkMessage/index.tsx +162 -0
- package/src/components/messages/mergedMessage/index.tsx +45 -0
- package/src/components/messages/styles.ts +39 -0
- package/src/components/messages/textMessage/index.tsx +53 -0
- package/src/components/messages/types.ts +22 -0
- package/src/components/messages/videoMessage/index.tsx +120 -0
- package/src/config/api-endpoints.ts +72 -0
- package/src/config/attachment-priority.ts +93 -0
- package/src/config/configuration.ts +50 -0
- package/src/config/index.ts +19 -0
- package/src/context/ChatContext.tsx +12 -4
- package/src/core/index.ts +25 -1
- package/src/core/useChatListener.ts +0 -21
- package/src/hooks/message/useSendMessage.ts +143 -0
- package/src/hooks/useChatMessages.ts +69 -161
- package/src/hooks/useConversationList.ts +34 -16
- package/src/hooks/useImageAttachment.ts +348 -0
- package/src/hooks/useLinkPreview/useLinkPreview.ts +3 -2
- package/src/hooks/useMediaViewer.ts +32 -0
- package/src/hooks/useSendAttachment.ts +295 -0
- package/src/hooks/useVideoAttachment.ts +334 -0
- package/src/index.tsx +13 -1
- package/src/screens/MediaView/VideoPlayer.tsx +211 -0
- package/src/screens/MediaView/index.tsx +327 -0
- package/src/screens/chat-detail/ChatComposer.tsx +206 -271
- package/src/screens/chat-detail/ChatDetail.tsx +164 -104
- package/src/screens/chat-detail/ChatDetailHeader.tsx +4 -10
- package/src/screens/chat-detail/ChatLinkPreview.tsx +1 -1
- package/src/screens/chat-detail/ChatListLegend.tsx +10 -13
- package/src/screens/chat-detail/components/ChatInputActions.tsx +71 -0
- package/src/screens/chat-detail/components/ChatMessageInput.tsx +127 -0
- package/src/screens/chat-detail/conversationHeader.utils.ts +11 -14
- package/src/screens/chat-detail/hooks/useAttachmentSendHandler.ts +291 -0
- package/src/screens/chat-detail/hooks/useChatComposerAnimation.ts +184 -0
- package/src/screens/chat-detail/hooks/useChatComposerState.ts +40 -0
- package/src/screens/chat-detail/index.ts +0 -2
- package/src/screens/chat-detail/legend/LegendChatMessage.tsx +44 -39
- package/src/screens/chat-detail/legend/messageTypes.tsx +13 -0
- package/src/screens/chat-detail/types.ts +11 -9
- package/src/screens/inbox/MessagesTab.tsx +1 -1
- package/src/services/attachmentHandlers/fileAttachmentHandler.ts +78 -0
- package/src/services/attachmentHandlers/imageAttachmentHandler.ts +54 -0
- package/src/services/attachmentHandlers/index.ts +10 -0
- package/src/services/attachmentHandlers/videoAttachmentHandler.ts +114 -0
- package/src/services/attachmentOrchestrator.ts +300 -0
- package/src/services/auth.ts +34 -0
- package/src/services/endpoints.ts +24 -1
- package/src/services/imageUpload.ts +162 -0
- package/src/store/conversation.ts +1 -1
- package/src/store/message.ts +44 -0
- package/src/translation/resources/i18n.ts +22 -2
- package/src/types/attachment.ts +85 -0
- package/src/types/attachmentHandler.ts +31 -0
- package/src/types/chat.ts +31 -30
- package/src/types/common.ts +1 -0
- package/src/types/imageUpload.ts +28 -0
- package/src/types/message.ts +1 -0
- package/src/utils/chatImageDimens.ts +178 -0
- package/src/utils/conversation.ts +44 -17
- package/src/utils/device.ts +73 -0
- package/src/utils/imageUrlOptimizer.ts +56 -0
- package/src/utils/imageUtils.ts +76 -0
- package/src/utils/legendListMessage.ts +0 -5
- package/src/utils/message.ts +10 -12
- package/src/utils/resolveMessageType.ts +2 -0
- package/src/utils/ui.ts +19 -0
- package/src/utils/url.ts +3 -3
- package/src/utils/videoThumbnail.ts +85 -0
- package/lib/module/screens/chat-detail/ChatList.js +0 -147
- package/lib/module/screens/chat-detail/ChatList.js.map +0 -1
- package/lib/module/screens/chat-detail/ChatTextBubble.js +0 -62
- package/lib/module/screens/chat-detail/ChatTextBubble.js.map +0 -1
- package/lib/module/screens/chat-detail/legend/message-types.js +0 -122
- package/lib/module/screens/chat-detail/legend/message-types.js.map +0 -1
- package/lib/module/screens/chat-detail/messages/ChatMessageBubble.js +0 -24
- package/lib/module/screens/chat-detail/messages/ChatMessageBubble.js.map +0 -1
- package/lib/module/screens/chat-detail/messages/types.js +0 -4
- package/lib/module/screens/chat-detail/messages/types.js.map +0 -1
- package/lib/typescript/src/screens/chat-detail/ChatList.d.ts +0 -3
- package/lib/typescript/src/screens/chat-detail/ChatList.d.ts.map +0 -1
- package/lib/typescript/src/screens/chat-detail/ChatTextBubble.d.ts +0 -3
- package/lib/typescript/src/screens/chat-detail/ChatTextBubble.d.ts.map +0 -1
- package/lib/typescript/src/screens/chat-detail/legend/message-types.d.ts +0 -12
- package/lib/typescript/src/screens/chat-detail/legend/message-types.d.ts.map +0 -1
- package/lib/typescript/src/screens/chat-detail/messages/ChatMessageBubble.d.ts +0 -3
- package/lib/typescript/src/screens/chat-detail/messages/ChatMessageBubble.d.ts.map +0 -1
- package/lib/typescript/src/screens/chat-detail/messages/types.d.ts +0 -13
- package/lib/typescript/src/screens/chat-detail/messages/types.d.ts.map +0 -1
- package/src/screens/chat-detail/ChatList.tsx +0 -190
- package/src/screens/chat-detail/ChatTextBubble.tsx +0 -73
- package/src/screens/chat-detail/legend/message-types.tsx +0 -149
- package/src/screens/chat-detail/messages/ChatMessageBubble.tsx +0 -23
- package/src/screens/chat-detail/messages/types.ts +0 -14
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState, useMemo } from 'react';
|
|
2
|
+
import type { ComponentType } from 'react';
|
|
3
|
+
import {
|
|
4
|
+
BackHandler,
|
|
5
|
+
Platform,
|
|
6
|
+
StyleSheet,
|
|
7
|
+
FlatList,
|
|
8
|
+
type ListRenderItemInfo,
|
|
9
|
+
type ViewToken,
|
|
10
|
+
} from 'react-native';
|
|
11
|
+
|
|
12
|
+
import LinearGradient from 'react-native-linear-gradient';
|
|
13
|
+
import Animated, {
|
|
14
|
+
FadeIn,
|
|
15
|
+
FadeOut,
|
|
16
|
+
SlideInDown,
|
|
17
|
+
SlideOutDown,
|
|
18
|
+
} from 'react-native-reanimated';
|
|
19
|
+
import { Pagination } from 'react-native-snap-carousel';
|
|
20
|
+
import PhotoView from 'react-native-photo-view';
|
|
21
|
+
import {
|
|
22
|
+
KColors,
|
|
23
|
+
KContainer,
|
|
24
|
+
KDims,
|
|
25
|
+
KImage,
|
|
26
|
+
KLabel,
|
|
27
|
+
KRadiusValue,
|
|
28
|
+
KSpacingValue,
|
|
29
|
+
} from '@droppii/libs';
|
|
30
|
+
import VideoPlayer from './VideoPlayer';
|
|
31
|
+
|
|
32
|
+
interface MediaViewerParams {
|
|
33
|
+
images: any[];
|
|
34
|
+
initIndex?: number;
|
|
35
|
+
download?: boolean;
|
|
36
|
+
pagination?: boolean;
|
|
37
|
+
logParams?: any;
|
|
38
|
+
onDismiss: () => void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const MediaViewerScreen = (props: MediaViewerParams) => {
|
|
42
|
+
const {
|
|
43
|
+
images = [],
|
|
44
|
+
initIndex = 0,
|
|
45
|
+
download,
|
|
46
|
+
pagination,
|
|
47
|
+
|
|
48
|
+
onDismiss,
|
|
49
|
+
} = props;
|
|
50
|
+
|
|
51
|
+
const listRef = useRef<FlatList>(null);
|
|
52
|
+
const [index, setIndex] = useState(initIndex);
|
|
53
|
+
const [isScrolling, setIsScrolling] = useState(false);
|
|
54
|
+
|
|
55
|
+
const dismiss = useCallback(() => {
|
|
56
|
+
onDismiss?.();
|
|
57
|
+
}, [onDismiss]);
|
|
58
|
+
|
|
59
|
+
const onDownload = useCallback(() => {}, []);
|
|
60
|
+
|
|
61
|
+
// useEffect(() => {
|
|
62
|
+
// StatusBar.setHidden(true);
|
|
63
|
+
// return () => {
|
|
64
|
+
// StatusBar.setHidden(false);
|
|
65
|
+
// };
|
|
66
|
+
// }, []);
|
|
67
|
+
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
if (Platform.OS === 'android') {
|
|
70
|
+
const sub = BackHandler.addEventListener('hardwareBackPress', () => {
|
|
71
|
+
dismiss();
|
|
72
|
+
return true;
|
|
73
|
+
});
|
|
74
|
+
return () => sub.remove();
|
|
75
|
+
}
|
|
76
|
+
}, [dismiss]);
|
|
77
|
+
|
|
78
|
+
const onMomentumScrollBegin = useCallback(() => setIsScrolling(true), []);
|
|
79
|
+
const onMomentumScrollEnd = useCallback(() => setIsScrolling(false), []);
|
|
80
|
+
|
|
81
|
+
const onScrollToIndexFailed = useCallback(
|
|
82
|
+
(info: any) => {
|
|
83
|
+
const len = images.length;
|
|
84
|
+
const wait = new Promise((resolve) => setTimeout(() => resolve(true), 0));
|
|
85
|
+
wait.then(() => {
|
|
86
|
+
if (info.index > -1 && info.index < len) {
|
|
87
|
+
listRef.current?.scrollToIndex({
|
|
88
|
+
index: info.index,
|
|
89
|
+
animated: false,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
[images]
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
const onViewableItemsChanged = useRef(
|
|
98
|
+
({ viewableItems }: { viewableItems: ViewToken[] }) => {
|
|
99
|
+
const i = viewableItems[0]?.index;
|
|
100
|
+
setIndex(i || 0);
|
|
101
|
+
}
|
|
102
|
+
).current;
|
|
103
|
+
|
|
104
|
+
const keyEx = useCallback((item: any, i: number) => `${item.url}-${i}`, []);
|
|
105
|
+
|
|
106
|
+
const renderItem = useCallback(
|
|
107
|
+
({ item, index: itemIndex }: ListRenderItemInfo<any>) => (
|
|
108
|
+
<KContainer.Touchable center activeOpacity={1}>
|
|
109
|
+
<KContainer.VisibleView visible={!!item.isVideo}>
|
|
110
|
+
<VideoPlayer
|
|
111
|
+
url={item?.url || ''}
|
|
112
|
+
isActive={itemIndex === index && !isScrolling}
|
|
113
|
+
showCustomControls={false}
|
|
114
|
+
/>
|
|
115
|
+
</KContainer.VisibleView>
|
|
116
|
+
<KContainer.VisibleView visible={!item.isVideo}>
|
|
117
|
+
<PhotoView
|
|
118
|
+
source={{ uri: item.url }}
|
|
119
|
+
minimumZoomScale={1}
|
|
120
|
+
maximumZoomScale={3}
|
|
121
|
+
scale={1}
|
|
122
|
+
androidScaleType="fitCenter"
|
|
123
|
+
style={styles.img}
|
|
124
|
+
/>
|
|
125
|
+
</KContainer.VisibleView>
|
|
126
|
+
</KContainer.Touchable>
|
|
127
|
+
),
|
|
128
|
+
[index, isScrolling]
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
const renderFooter = useMemo(() => {
|
|
132
|
+
if (pagination === false) return null;
|
|
133
|
+
return (
|
|
134
|
+
<KContainer.View style={styles.footer}>
|
|
135
|
+
<KLabel.Text
|
|
136
|
+
typo="TextNmNormal"
|
|
137
|
+
color={KColors.white}
|
|
138
|
+
style={styles.counterText}
|
|
139
|
+
>
|
|
140
|
+
{index + 1}/{images.length}
|
|
141
|
+
</KLabel.Text>
|
|
142
|
+
<Pagination
|
|
143
|
+
dotContainerStyle={styles.dotContainerStyle}
|
|
144
|
+
dotStyle={styles.dot}
|
|
145
|
+
inactiveDotStyle={styles.inactiveDot}
|
|
146
|
+
inactiveDotScale={0.6}
|
|
147
|
+
dotsLength={images.length > 1 ? images.length : 3}
|
|
148
|
+
activeDotIndex={images.length > 1 ? index : 1}
|
|
149
|
+
inactiveDotOpacity={images.length > 1 ? 0.5 : 0}
|
|
150
|
+
/>
|
|
151
|
+
</KContainer.View>
|
|
152
|
+
);
|
|
153
|
+
}, [pagination, images.length, index]);
|
|
154
|
+
return (
|
|
155
|
+
<Animated.View
|
|
156
|
+
style={styles.wrapper}
|
|
157
|
+
entering={SlideInDown}
|
|
158
|
+
exiting={SlideOutDown}
|
|
159
|
+
>
|
|
160
|
+
<Animated.View
|
|
161
|
+
entering={FadeIn.stiffness(300)}
|
|
162
|
+
exiting={FadeOut.stiffness(300)}
|
|
163
|
+
style={styles.flex}
|
|
164
|
+
>
|
|
165
|
+
{/* Top gradient overlay */}
|
|
166
|
+
<LinearGradient
|
|
167
|
+
colors={['rgba(0,0,0,0.9)', 'rgba(0,0,0,0)']}
|
|
168
|
+
style={[styles.topOverlay]}
|
|
169
|
+
pointerEvents="box-none"
|
|
170
|
+
>
|
|
171
|
+
{/* Header first row — matches Figma: [close] [flex-1 spacer] [action-group] */}
|
|
172
|
+
<KContainer.View style={styles.headerRow}>
|
|
173
|
+
{/* Close — shrink-0, padding 8, borderRadius 128 */}
|
|
174
|
+
<KContainer.Touchable style={styles.headerBtn} onPress={dismiss}>
|
|
175
|
+
<KImage.VectorIcons
|
|
176
|
+
name="close-o"
|
|
177
|
+
size={24}
|
|
178
|
+
color={KColors.white}
|
|
179
|
+
/>
|
|
180
|
+
</KContainer.Touchable>
|
|
181
|
+
|
|
182
|
+
{/* Flex-1 spacer (empty, same as Figma Header-Text) */}
|
|
183
|
+
<KContainer.View flex />
|
|
184
|
+
|
|
185
|
+
{/* Download button */}
|
|
186
|
+
{download && (
|
|
187
|
+
<KContainer.Touchable
|
|
188
|
+
style={styles.headerBtn}
|
|
189
|
+
onPress={onDownload}
|
|
190
|
+
>
|
|
191
|
+
<KImage.VectorIcons
|
|
192
|
+
name="download-o"
|
|
193
|
+
size={24}
|
|
194
|
+
color={KColors.white}
|
|
195
|
+
/>
|
|
196
|
+
</KContainer.Touchable>
|
|
197
|
+
)}
|
|
198
|
+
</KContainer.View>
|
|
199
|
+
</LinearGradient>
|
|
200
|
+
{/* Media content */}
|
|
201
|
+
<FlatList
|
|
202
|
+
ref={listRef}
|
|
203
|
+
initialScrollIndex={
|
|
204
|
+
initIndex >= images?.length ? images?.length - 1 : initIndex
|
|
205
|
+
}
|
|
206
|
+
data={images}
|
|
207
|
+
renderItem={renderItem}
|
|
208
|
+
keyExtractor={keyEx}
|
|
209
|
+
pagingEnabled
|
|
210
|
+
horizontal
|
|
211
|
+
showsHorizontalScrollIndicator={false}
|
|
212
|
+
onViewableItemsChanged={onViewableItemsChanged}
|
|
213
|
+
viewabilityConfig={{ itemVisiblePercentThreshold: 50 }}
|
|
214
|
+
onScrollToIndexFailed={onScrollToIndexFailed}
|
|
215
|
+
onMomentumScrollBegin={onMomentumScrollBegin}
|
|
216
|
+
onMomentumScrollEnd={onMomentumScrollEnd}
|
|
217
|
+
removeClippedSubviews
|
|
218
|
+
maxToRenderPerBatch={2}
|
|
219
|
+
windowSize={3}
|
|
220
|
+
style={styles.flex}
|
|
221
|
+
/>
|
|
222
|
+
|
|
223
|
+
{renderFooter}
|
|
224
|
+
</Animated.View>
|
|
225
|
+
</Animated.View>
|
|
226
|
+
);
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
(MediaViewerScreen as ComponentType<any>).displayName = 'Screen.MediaViewer';
|
|
230
|
+
|
|
231
|
+
export default MediaViewerScreen;
|
|
232
|
+
|
|
233
|
+
const styles = StyleSheet.create({
|
|
234
|
+
wrapper: {
|
|
235
|
+
flex: 1,
|
|
236
|
+
backgroundColor: KColors.black,
|
|
237
|
+
},
|
|
238
|
+
flex: {
|
|
239
|
+
flex: 1,
|
|
240
|
+
},
|
|
241
|
+
img: {
|
|
242
|
+
width: KDims.width,
|
|
243
|
+
height: KDims.height,
|
|
244
|
+
},
|
|
245
|
+
topOverlay: {
|
|
246
|
+
// position: 'absolute',
|
|
247
|
+
top: 0,
|
|
248
|
+
left: 0,
|
|
249
|
+
right: 0,
|
|
250
|
+
zIndex: 100,
|
|
251
|
+
minHeight: 100,
|
|
252
|
+
paddingTop: 20,
|
|
253
|
+
},
|
|
254
|
+
// Figma: Header-First-Row — flex row, padding 8, alignItems center
|
|
255
|
+
headerRow: {
|
|
256
|
+
flexDirection: 'row',
|
|
257
|
+
alignItems: 'center',
|
|
258
|
+
padding: 8,
|
|
259
|
+
},
|
|
260
|
+
// Figma: Header-Back — padding 8, borderRadius 128 (fully round)
|
|
261
|
+
headerBtn: {
|
|
262
|
+
padding: 8,
|
|
263
|
+
borderRadius: 128,
|
|
264
|
+
justifyContent: 'center',
|
|
265
|
+
alignItems: 'center',
|
|
266
|
+
},
|
|
267
|
+
// Figma: Header-Action-Group — flex row, gap 8, alignItems center
|
|
268
|
+
actionGroup: {
|
|
269
|
+
flexDirection: 'row',
|
|
270
|
+
alignItems: 'center',
|
|
271
|
+
gap: 8,
|
|
272
|
+
},
|
|
273
|
+
// Figma: Number — absolute, left 50%, top 17, translateX -50%
|
|
274
|
+
counterWrapper: {
|
|
275
|
+
position: 'absolute',
|
|
276
|
+
left: 0,
|
|
277
|
+
right: 0,
|
|
278
|
+
top: 17,
|
|
279
|
+
alignItems: 'center',
|
|
280
|
+
},
|
|
281
|
+
counterText: {
|
|
282
|
+
letterSpacing: 0.14,
|
|
283
|
+
},
|
|
284
|
+
cartIconStyle: {
|
|
285
|
+
color: KColors.white,
|
|
286
|
+
},
|
|
287
|
+
selectToDownloadWrapper: {
|
|
288
|
+
alignItems: 'center',
|
|
289
|
+
marginTop: KSpacingValue['0.5rem'],
|
|
290
|
+
},
|
|
291
|
+
selectToDownloadBtn: {
|
|
292
|
+
flexDirection: 'row',
|
|
293
|
+
alignItems: 'center',
|
|
294
|
+
height: 28,
|
|
295
|
+
paddingHorizontal: KSpacingValue['0.75rem'],
|
|
296
|
+
borderRadius: KRadiusValue['2x'],
|
|
297
|
+
borderWidth: 1,
|
|
298
|
+
borderColor: KColors.white,
|
|
299
|
+
gap: KSpacingValue['0.25rem'],
|
|
300
|
+
},
|
|
301
|
+
selectToDownloadText: {
|
|
302
|
+
letterSpacing: 0.12,
|
|
303
|
+
},
|
|
304
|
+
footer: {
|
|
305
|
+
position: 'absolute',
|
|
306
|
+
bottom:
|
|
307
|
+
KDims.bottomSafeHeight > 0
|
|
308
|
+
? KDims.bottomSafeHeight + KSpacingValue['0.5rem']
|
|
309
|
+
: KSpacingValue['2rem'],
|
|
310
|
+
alignSelf: 'center',
|
|
311
|
+
alignItems: 'center',
|
|
312
|
+
zIndex: 10,
|
|
313
|
+
},
|
|
314
|
+
dotContainerStyle: {
|
|
315
|
+
marginHorizontal: 0,
|
|
316
|
+
},
|
|
317
|
+
dot: {
|
|
318
|
+
backgroundColor: KColors.white,
|
|
319
|
+
width: 8,
|
|
320
|
+
height: 8,
|
|
321
|
+
borderRadius: 8,
|
|
322
|
+
marginHorizontal: 2,
|
|
323
|
+
},
|
|
324
|
+
inactiveDot: {
|
|
325
|
+
backgroundColor: KColors.gray.light,
|
|
326
|
+
},
|
|
327
|
+
});
|