@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../../src/types/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../../src/types/chat.ts"],"names":[],"mappings":"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"}
|
|
@@ -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;
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../src/types/message.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB
|
|
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: (
|
|
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;
|
|
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
|
|
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,
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../src/utils/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAS1E,eAAO,MAAM,aAAa,GACxB,SAAS,YAAY,EAAE,EACvB,UAAU,YAAY,EAAE,KACvB,YAAY,EAad,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,SAAS,WAAW,GAAG,MAAM,KAC5B,WAYF,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,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,
|
|
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
|
|
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,
|
|
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.
|
|
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-
|
|
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-
|
|
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
|