@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,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for attachment sending priority order
|
|
3
|
+
* AC2: Send mixed media with configurable priority
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export type AttachmentType = 'image' | 'video' | 'file' | 'text';
|
|
7
|
+
|
|
8
|
+
export interface AttachmentPriorityConfig {
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
order: AttachmentType[];
|
|
11
|
+
mergeStrategy: {
|
|
12
|
+
images: 'merge' | 'individual';
|
|
13
|
+
videos: 'merge' | 'individual';
|
|
14
|
+
files: 'merge' | 'individual';
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Default AC2 configuration
|
|
19
|
+
export const DEFAULT_ATTACHMENT_PRIORITY: AttachmentPriorityConfig = {
|
|
20
|
+
enabled: true,
|
|
21
|
+
order: ['image', 'video', 'file', 'text'],
|
|
22
|
+
mergeStrategy: {
|
|
23
|
+
images: 'merge', // Multiple images merged into one message
|
|
24
|
+
videos: 'individual', // Videos always sent individually (never merged)
|
|
25
|
+
files: 'merge', // Multiple files merged into one message
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// Alternative configurations
|
|
30
|
+
export const ATTACHMENT_PRIORITY_PRESETS = {
|
|
31
|
+
// Send everything individually (no merging)
|
|
32
|
+
INDIVIDUAL: {
|
|
33
|
+
enabled: true,
|
|
34
|
+
order: ['image', 'video', 'file', 'text'],
|
|
35
|
+
mergeStrategy: {
|
|
36
|
+
images: 'individual',
|
|
37
|
+
videos: 'individual',
|
|
38
|
+
files: 'individual',
|
|
39
|
+
},
|
|
40
|
+
} as AttachmentPriorityConfig,
|
|
41
|
+
|
|
42
|
+
// Send videos first, then everything else
|
|
43
|
+
VIDEOS_FIRST: {
|
|
44
|
+
enabled: true,
|
|
45
|
+
order: ['video', 'image', 'file', 'text'],
|
|
46
|
+
mergeStrategy: {
|
|
47
|
+
images: 'merge',
|
|
48
|
+
videos: 'individual',
|
|
49
|
+
files: 'merge',
|
|
50
|
+
},
|
|
51
|
+
} as AttachmentPriorityConfig,
|
|
52
|
+
|
|
53
|
+
// Group by type - all media first, then text
|
|
54
|
+
MEDIA_FIRST: {
|
|
55
|
+
enabled: true,
|
|
56
|
+
order: ['image', 'video', 'file', 'text'],
|
|
57
|
+
mergeStrategy: {
|
|
58
|
+
images: 'merge',
|
|
59
|
+
videos: 'individual',
|
|
60
|
+
files: 'merge',
|
|
61
|
+
},
|
|
62
|
+
} as AttachmentPriorityConfig,
|
|
63
|
+
|
|
64
|
+
// Disabled - use original behavior
|
|
65
|
+
DISABLED: {
|
|
66
|
+
enabled: false,
|
|
67
|
+
order: [],
|
|
68
|
+
mergeStrategy: {
|
|
69
|
+
images: 'merge',
|
|
70
|
+
videos: 'individual',
|
|
71
|
+
files: 'merge',
|
|
72
|
+
},
|
|
73
|
+
} as AttachmentPriorityConfig,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Get attachment priority config
|
|
78
|
+
* Can be overridden via environment variable or per-user settings
|
|
79
|
+
*/
|
|
80
|
+
export function getAttachmentPriorityConfig(): AttachmentPriorityConfig {
|
|
81
|
+
// Can be extended to read from environment or user preferences
|
|
82
|
+
return DEFAULT_ATTACHMENT_PRIORITY;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Validate and normalize priority order
|
|
87
|
+
*/
|
|
88
|
+
export function validatePriorityOrder(
|
|
89
|
+
order: AttachmentType[]
|
|
90
|
+
): AttachmentType[] {
|
|
91
|
+
const validTypes: AttachmentType[] = ['image', 'video', 'file', 'text'];
|
|
92
|
+
return order.filter((type) => validTypes.includes(type));
|
|
93
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized Configuration
|
|
3
|
+
*
|
|
4
|
+
* Manages all API configuration in one place. Different services may use
|
|
5
|
+
* different protocols (axios, native HTTP), but they should all derive
|
|
6
|
+
* from the same base URL configuration.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export interface AppConfig {
|
|
10
|
+
apiBaseUrl: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let config: AppConfig = {
|
|
14
|
+
apiBaseUrl: '',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Initialize the base URL configuration
|
|
19
|
+
* This should be called during app startup before any API calls
|
|
20
|
+
*
|
|
21
|
+
* @param apiBaseUrl - The base URL for all API services (e.g., 'https://api.example.com')
|
|
22
|
+
*/
|
|
23
|
+
export const initBaseUrl = (apiBaseUrl: string): void => {
|
|
24
|
+
if (!apiBaseUrl) {
|
|
25
|
+
if (__DEV__)
|
|
26
|
+
console.warn('[Configuration] Initializing with empty apiBaseUrl');
|
|
27
|
+
}
|
|
28
|
+
config.apiBaseUrl = apiBaseUrl;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get the configured base URL
|
|
33
|
+
*/
|
|
34
|
+
export const getBaseUrl = (): string => {
|
|
35
|
+
return config.apiBaseUrl;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Reset configuration (useful for testing)
|
|
40
|
+
*/
|
|
41
|
+
export const resetBaseUrl = (): void => {
|
|
42
|
+
config = { apiBaseUrl: '' };
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Check if base URL is configured
|
|
47
|
+
*/
|
|
48
|
+
export const isBaseUrlConfigured = (): boolean => {
|
|
49
|
+
return !!config.apiBaseUrl;
|
|
50
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Library Configuration
|
|
3
|
+
* Provides convenient access to library configuration values
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { getBaseUrl } from './configuration';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Library Config object for easy access to configuration values
|
|
10
|
+
*/
|
|
11
|
+
export const Config = {
|
|
12
|
+
/**
|
|
13
|
+
* Get the configured API base URL
|
|
14
|
+
* @returns The base URL (e.g., 'https://api.example.com')
|
|
15
|
+
*/
|
|
16
|
+
get BASE_URL(): string {
|
|
17
|
+
return getBaseUrl();
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -13,11 +13,19 @@ export const useChatContext = (): ChatContextType => {
|
|
|
13
13
|
return context;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
const ChatProviderInner = ({
|
|
17
|
-
|
|
16
|
+
const ChatProviderInner = ({
|
|
17
|
+
logGA,
|
|
18
|
+
children,
|
|
19
|
+
applicationType,
|
|
20
|
+
}: ChatProviderProps) => {
|
|
21
|
+
const value = useMemo(
|
|
22
|
+
() => ({ logGA, applicationType }),
|
|
23
|
+
[logGA, applicationType]
|
|
24
|
+
);
|
|
18
25
|
|
|
19
26
|
return <ChatContext.Provider value={value}>{children}</ChatContext.Provider>;
|
|
20
27
|
};
|
|
21
28
|
|
|
22
|
-
export const ChatProvider = ({
|
|
23
|
-
|
|
29
|
+
export const ChatProvider = ({ ...props }: ChatProviderProps) => (
|
|
30
|
+
<ChatProviderInner {...props} />
|
|
31
|
+
);
|
package/src/core/index.ts
CHANGED
|
@@ -1,8 +1,32 @@
|
|
|
1
1
|
import OpenIMSDK from '@droppii/openim-rn-client-sdk';
|
|
2
|
+
import type { InitOptions } from '@droppii/openim-rn-client-sdk';
|
|
3
|
+
import { initBaseUrl } from '../config/configuration';
|
|
2
4
|
import { useUserListener } from './useUserListener';
|
|
3
5
|
import { useChatListener } from './useChatListener';
|
|
4
6
|
|
|
5
|
-
export
|
|
7
|
+
export interface InitChatSdkOptions extends InitOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Base URL for API services (image uploads, etc.)
|
|
10
|
+
* Will be set as the centralized configuration
|
|
11
|
+
*/
|
|
12
|
+
apiBaseUrl?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Initialize the chat SDK with optional base URL
|
|
17
|
+
* @param options - SDK initialization options + apiBaseUrl for centralized config
|
|
18
|
+
*/
|
|
19
|
+
export const initChatSdk = (options: InitChatSdkOptions) => {
|
|
20
|
+
const { apiBaseUrl, ...sdkOptions } = options;
|
|
21
|
+
|
|
22
|
+
// Initialize OpenIM SDK
|
|
23
|
+
OpenIMSDK.initSDK(sdkOptions);
|
|
24
|
+
|
|
25
|
+
// Initialize centralized base URL config for all services
|
|
26
|
+
if (apiBaseUrl) {
|
|
27
|
+
initBaseUrl(apiBaseUrl);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
6
30
|
|
|
7
31
|
export const useChatSdk = () => {
|
|
8
32
|
useUserListener();
|
|
@@ -2,21 +2,11 @@ import OpenIMSDK, {
|
|
|
2
2
|
OpenIMEvent,
|
|
3
3
|
type ConversationItem,
|
|
4
4
|
type GroupMemberItem,
|
|
5
|
-
type MessageItem,
|
|
6
|
-
type RevokedInfo,
|
|
7
5
|
} from '@droppii/openim-rn-client-sdk';
|
|
8
6
|
import { useCallback, useEffect } from 'react';
|
|
9
7
|
import { useConversationStore } from '../store/conversation';
|
|
10
8
|
|
|
11
9
|
export const useChatListener = () => {
|
|
12
|
-
const onRecvNewMessages = useCallback((messages: MessageItem[]) => {
|
|
13
|
-
console.log('onRecvNewMessages', messages);
|
|
14
|
-
}, []);
|
|
15
|
-
|
|
16
|
-
const onNewRecvMessageRevoked = useCallback((revokedInfo: RevokedInfo) => {
|
|
17
|
-
console.log('onNewRecvMessageRevoked', revokedInfo);
|
|
18
|
-
}, []);
|
|
19
|
-
|
|
20
10
|
const onConversationChanged = useCallback(
|
|
21
11
|
(conversations: ConversationItem[]) => {
|
|
22
12
|
console.log('onConversationChanged', conversations);
|
|
@@ -41,10 +31,6 @@ export const useChatListener = () => {
|
|
|
41
31
|
}, []);
|
|
42
32
|
|
|
43
33
|
useEffect(() => {
|
|
44
|
-
// Message
|
|
45
|
-
OpenIMSDK.on(OpenIMEvent.OnRecvNewMessages, onRecvNewMessages);
|
|
46
|
-
OpenIMSDK.on(OpenIMEvent.OnNewRecvMessageRevoked, onNewRecvMessageRevoked);
|
|
47
|
-
|
|
48
34
|
// Conversation
|
|
49
35
|
OpenIMSDK.on(OpenIMEvent.OnConversationChanged, onConversationChanged);
|
|
50
36
|
OpenIMSDK.on(OpenIMEvent.OnNewConversation, onNewConversation);
|
|
@@ -54,13 +40,6 @@ export const useChatListener = () => {
|
|
|
54
40
|
OpenIMSDK.on(OpenIMEvent.OnGroupMemberDeleted, onGroupMemberDeleted);
|
|
55
41
|
|
|
56
42
|
return () => {
|
|
57
|
-
// Message
|
|
58
|
-
OpenIMSDK.off(OpenIMEvent.OnRecvNewMessages, onRecvNewMessages);
|
|
59
|
-
OpenIMSDK.off(
|
|
60
|
-
OpenIMEvent.OnNewRecvMessageRevoked,
|
|
61
|
-
onNewRecvMessageRevoked
|
|
62
|
-
);
|
|
63
|
-
|
|
64
43
|
// Conversation
|
|
65
44
|
OpenIMSDK.off(OpenIMEvent.OnConversationChanged, onConversationChanged);
|
|
66
45
|
OpenIMSDK.off(OpenIMEvent.OnNewConversation, onNewConversation);
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import type { UploadFileItem } from 'react-native-fs';
|
|
3
|
+
import { useConversationStore } from '../../store';
|
|
4
|
+
import type {
|
|
5
|
+
MessageItem,
|
|
6
|
+
MessageType,
|
|
7
|
+
OfflinePush,
|
|
8
|
+
} from '@droppii/openim-rn-client-sdk';
|
|
9
|
+
import { extractUrls } from '../../utils/url';
|
|
10
|
+
import OpenIMSDK from '@droppii/openim-rn-client-sdk';
|
|
11
|
+
import type { IMessageItemEx } from '../../types/chat';
|
|
12
|
+
import { useChatContext } from '../../context';
|
|
13
|
+
import { generateContentBasedOnMessageType } from '../../utils/conversation';
|
|
14
|
+
import { useMessageStore } from '../../store/message';
|
|
15
|
+
import type { IUrlMetadata } from '../../types/common';
|
|
16
|
+
|
|
17
|
+
export const useSendMessage = () => {
|
|
18
|
+
const applicationType = useChatContext().applicationType;
|
|
19
|
+
const pushNewMessage = useMessageStore((state) => state.pushNewMessage);
|
|
20
|
+
|
|
21
|
+
const sendMessage = useCallback(
|
|
22
|
+
async ({
|
|
23
|
+
plainText,
|
|
24
|
+
files,
|
|
25
|
+
urlMetadata,
|
|
26
|
+
}: {
|
|
27
|
+
plainText?: string;
|
|
28
|
+
files?: UploadFileItem[]; //TODO
|
|
29
|
+
urlMetadata?: IUrlMetadata;
|
|
30
|
+
}) => {
|
|
31
|
+
const { userID: recvID, groupID } =
|
|
32
|
+
useConversationStore.getState().getCurrentConversation() || {};
|
|
33
|
+
if (!recvID && !groupID) return;
|
|
34
|
+
|
|
35
|
+
const messageList: MessageItem[] = [];
|
|
36
|
+
|
|
37
|
+
for (const file of files || []) {
|
|
38
|
+
if (!file) continue;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Allow empty text if urlMetadata (preview link) is present
|
|
42
|
+
const hasText = !!plainText && plainText.trim() !== '';
|
|
43
|
+
const hasPreview = !!urlMetadata?.url;
|
|
44
|
+
|
|
45
|
+
if (hasText || hasPreview) {
|
|
46
|
+
const urls = hasText ? extractUrls(plainText) : [];
|
|
47
|
+
const isUrlMessage = urls.length > 0 || hasPreview;
|
|
48
|
+
let message: MessageItem | null = null;
|
|
49
|
+
|
|
50
|
+
if (isUrlMessage) {
|
|
51
|
+
// Create URL message even with empty text if preview exists
|
|
52
|
+
message = await createUrlTextMessage(plainText || '', urls);
|
|
53
|
+
} else if (hasText) {
|
|
54
|
+
message = await createTextMessage(plainText);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (!message) return;
|
|
58
|
+
messageList.push(message);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
for (const message of messageList) {
|
|
62
|
+
const extendMessageInfo: IMessageItemEx = {
|
|
63
|
+
applicationType,
|
|
64
|
+
urlMetadata,
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const successMessage = await OpenIMSDK.sendMessage({
|
|
68
|
+
groupID: groupID || '',
|
|
69
|
+
recvID: recvID || '',
|
|
70
|
+
message: {
|
|
71
|
+
...message,
|
|
72
|
+
ex: JSON.stringify(extendMessageInfo) || '{}',
|
|
73
|
+
},
|
|
74
|
+
offlinePushInfo: generateOfflinePushInfo(
|
|
75
|
+
message.contentType,
|
|
76
|
+
plainText || ''
|
|
77
|
+
),
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
pushNewMessage(successMessage);
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
[applicationType, pushNewMessage]
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
return {
|
|
87
|
+
sendMessage,
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const generateOfflinePushInfo = (
|
|
92
|
+
contentType: MessageType,
|
|
93
|
+
plainText: string
|
|
94
|
+
) => {
|
|
95
|
+
const conversationData = useConversationStore
|
|
96
|
+
?.getState?.()
|
|
97
|
+
?.getCurrentConversation();
|
|
98
|
+
const title = conversationData?.showName || 'Droppii';
|
|
99
|
+
const desc = generateContentBasedOnMessageType(contentType, plainText);
|
|
100
|
+
return {
|
|
101
|
+
title,
|
|
102
|
+
desc,
|
|
103
|
+
ex: JSON.stringify({
|
|
104
|
+
icon: conversationData?.faceURL || '',
|
|
105
|
+
conversationId: conversationData?.conversationId || '',
|
|
106
|
+
title,
|
|
107
|
+
desc,
|
|
108
|
+
}),
|
|
109
|
+
iOSPushSound: 'default',
|
|
110
|
+
iOSBadgeCount: true,
|
|
111
|
+
} as OfflinePush;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export const createTextMessage = async (text: string) => {
|
|
115
|
+
let textMessage = await OpenIMSDK.createTextMessage(
|
|
116
|
+
text,
|
|
117
|
+
new Date().getTime().toString()
|
|
118
|
+
)
|
|
119
|
+
.then((data) => {
|
|
120
|
+
return data;
|
|
121
|
+
})
|
|
122
|
+
.catch(({ errCode, errMsg }) => {
|
|
123
|
+
console.error('createTextMessage', errCode, errMsg);
|
|
124
|
+
return null;
|
|
125
|
+
});
|
|
126
|
+
return textMessage;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export const createUrlTextMessage = async (text: string, urls: string[]) => {
|
|
130
|
+
let urlTextMessage = await OpenIMSDK.createUrlTextMessage(
|
|
131
|
+
text,
|
|
132
|
+
urls,
|
|
133
|
+
new Date().getTime().toString()
|
|
134
|
+
)
|
|
135
|
+
.then((data) => {
|
|
136
|
+
return data;
|
|
137
|
+
})
|
|
138
|
+
.catch(({ errCode, errMsg }) => {
|
|
139
|
+
console.error('createUrlTextMessage', errCode, errMsg);
|
|
140
|
+
return null;
|
|
141
|
+
});
|
|
142
|
+
return urlTextMessage;
|
|
143
|
+
};
|