@droppii-org/chat-sdk 0.1.72 → 0.1.74
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/dist/components/conversation-detail/ConversationDetailInput.d.ts.map +1 -1
- package/dist/components/conversation-detail/ConversationDetailInput.js +6 -2
- package/dist/components/conversation-detail/PinnedMessageBar.d.ts.map +1 -1
- package/dist/components/conversation-detail/PinnedMessageBar.js +23 -20
- package/dist/components/conversation-detail/PinnedMessageItem.d.ts.map +1 -1
- package/dist/components/conversation-detail/PinnedMessageItem.js +1 -5
- package/dist/hooks/conversation/useBotMainMenu.d.ts +0 -1
- package/dist/hooks/conversation/useBotMainMenu.d.ts.map +1 -1
- package/dist/hooks/conversation/useBotMainMenu.js +0 -10
- package/dist/hooks/conversation/useSwitchToCsTeam.d.ts +6 -1
- package/dist/hooks/conversation/useSwitchToCsTeam.d.ts.map +1 -1
- package/dist/hooks/conversation/useSwitchToCsTeam.js +9 -4
- package/dist/hooks/message/useMessage.d.ts.map +1 -1
- package/dist/hooks/message/useMessage.js +21 -5
- package/dist/index.d.ts +5 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/services/query.d.ts +0 -1
- package/dist/services/query.d.ts.map +1 -1
- package/dist/services/query.js +0 -1
- package/dist/styles/global.css +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +127 -126
- package/dist/assets/svg/cannedResponse.d.ts +0 -7
- package/dist/assets/svg/cannedResponse.d.ts.map +0 -1
- package/dist/assets/svg/cannedResponse.js +0 -3
- package/dist/assets/svg/cannedResponse.tsx +0 -48
- package/dist/assets/svg/expand.d.ts +0 -7
- package/dist/assets/svg/expand.d.ts.map +0 -1
- package/dist/assets/svg/expand.js +0 -2
- package/dist/assets/svg/expand.tsx +0 -44
- package/dist/components/biz-inbox/BizInboxHeader.d.ts +0 -3
- package/dist/components/biz-inbox/BizInboxHeader.d.ts.map +0 -1
- package/dist/components/biz-inbox/BizInboxHeader.js +0 -8
- package/dist/components/biz-inbox/BizThreadAvatar.d.ts +0 -11
- package/dist/components/biz-inbox/BizThreadAvatar.d.ts.map +0 -1
- package/dist/components/biz-inbox/BizThreadAvatar.js +0 -12
- package/dist/components/biz-inbox/BizThreadCard.d.ts +0 -8
- package/dist/components/biz-inbox/BizThreadCard.d.ts.map +0 -1
- package/dist/components/biz-inbox/BizThreadCard.js +0 -30
- package/dist/components/biz-inbox/BizThreadList.d.ts +0 -12
- package/dist/components/biz-inbox/BizThreadList.d.ts.map +0 -1
- package/dist/components/biz-inbox/BizThreadList.js +0 -36
- package/dist/components/biz-inbox/BizThreadTitle.d.ts +0 -10
- package/dist/components/biz-inbox/BizThreadTitle.d.ts.map +0 -1
- package/dist/components/biz-inbox/BizThreadTitle.js +0 -10
- package/dist/components/biz-inbox/index.d.ts +0 -10
- package/dist/components/biz-inbox/index.d.ts.map +0 -1
- package/dist/components/biz-inbox/index.js +0 -5
- package/dist/components/biz-thread-detail/BizAttachmentPreview.d.ts +0 -9
- package/dist/components/biz-thread-detail/BizAttachmentPreview.d.ts.map +0 -1
- package/dist/components/biz-thread-detail/BizAttachmentPreview.js +0 -70
- package/dist/components/biz-thread-detail/BizImagePreview.d.ts +0 -9
- package/dist/components/biz-thread-detail/BizImagePreview.d.ts.map +0 -1
- package/dist/components/biz-thread-detail/BizImagePreview.js +0 -39
- package/dist/components/biz-thread-detail/BizImageViewer.d.ts +0 -8
- package/dist/components/biz-thread-detail/BizImageViewer.d.ts.map +0 -1
- package/dist/components/biz-thread-detail/BizImageViewer.js +0 -35
- package/dist/components/biz-thread-detail/BizLinkInputPreview.d.ts +0 -7
- package/dist/components/biz-thread-detail/BizLinkInputPreview.d.ts.map +0 -1
- package/dist/components/biz-thread-detail/BizLinkInputPreview.js +0 -16
- package/dist/components/biz-thread-detail/BizLinkMessageCard.d.ts +0 -7
- package/dist/components/biz-thread-detail/BizLinkMessageCard.d.ts.map +0 -1
- package/dist/components/biz-thread-detail/BizLinkMessageCard.js +0 -17
- package/dist/components/biz-thread-detail/BizLinkTextContent.d.ts +0 -6
- package/dist/components/biz-thread-detail/BizLinkTextContent.d.ts.map +0 -1
- package/dist/components/biz-thread-detail/BizLinkTextContent.js +0 -11
- package/dist/components/biz-thread-detail/BizMessageBubble.d.ts +0 -11
- package/dist/components/biz-thread-detail/BizMessageBubble.d.ts.map +0 -1
- package/dist/components/biz-thread-detail/BizMessageBubble.js +0 -15
- package/dist/components/biz-thread-detail/BizMessageContent.d.ts +0 -7
- package/dist/components/biz-thread-detail/BizMessageContent.d.ts.map +0 -1
- package/dist/components/biz-thread-detail/BizMessageContent.js +0 -125
- package/dist/components/biz-thread-detail/BizMessageList.d.ts +0 -7
- package/dist/components/biz-thread-detail/BizMessageList.d.ts.map +0 -1
- package/dist/components/biz-thread-detail/BizMessageList.js +0 -35
- package/dist/components/biz-thread-detail/BizMoreOptionItem.d.ts +0 -8
- package/dist/components/biz-thread-detail/BizMoreOptionItem.d.ts.map +0 -1
- package/dist/components/biz-thread-detail/BizMoreOptionItem.js +0 -19
- package/dist/components/biz-thread-detail/BizMoreOptionPanel.d.ts +0 -10
- package/dist/components/biz-thread-detail/BizMoreOptionPanel.d.ts.map +0 -1
- package/dist/components/biz-thread-detail/BizMoreOptionPanel.js +0 -20
- package/dist/components/biz-thread-detail/BizThreadDetailHeader.d.ts +0 -8
- package/dist/components/biz-thread-detail/BizThreadDetailHeader.d.ts.map +0 -1
- package/dist/components/biz-thread-detail/BizThreadDetailHeader.js +0 -19
- package/dist/components/biz-thread-detail/BizThreadDetailInput.d.ts +0 -8
- package/dist/components/biz-thread-detail/BizThreadDetailInput.d.ts.map +0 -1
- package/dist/components/biz-thread-detail/BizThreadDetailInput.js +0 -251
- package/dist/components/biz-thread-detail/BizVideoViewer.d.ts +0 -8
- package/dist/components/biz-thread-detail/BizVideoViewer.d.ts.map +0 -1
- package/dist/components/biz-thread-detail/BizVideoViewer.js +0 -103
- package/dist/components/biz-thread-detail/bot/BotButtonMessage.d.ts +0 -10
- package/dist/components/biz-thread-detail/bot/BotButtonMessage.d.ts.map +0 -1
- package/dist/components/biz-thread-detail/bot/BotButtonMessage.js +0 -30
- package/dist/components/biz-thread-detail/bot/BotFlowContext.d.ts +0 -10
- package/dist/components/biz-thread-detail/bot/BotFlowContext.d.ts.map +0 -1
- package/dist/components/biz-thread-detail/bot/BotFlowContext.js +0 -11
- package/dist/components/biz-thread-detail/bot/BotStartButton.d.ts +0 -8
- package/dist/components/biz-thread-detail/bot/BotStartButton.d.ts.map +0 -1
- package/dist/components/biz-thread-detail/bot/BotStartButton.js +0 -11
- package/dist/components/biz-thread-detail/bot/index.d.ts +0 -5
- package/dist/components/biz-thread-detail/bot/index.d.ts.map +0 -1
- package/dist/components/biz-thread-detail/bot/index.js +0 -2
- package/dist/components/biz-thread-detail/index.d.ts +0 -10
- package/dist/components/biz-thread-detail/index.d.ts.map +0 -1
- package/dist/components/biz-thread-detail/index.js +0 -5
- package/dist/components/biz-thread-detail/item/BizMessageItem.d.ts +0 -9
- package/dist/components/biz-thread-detail/item/BizMessageItem.d.ts.map +0 -1
- package/dist/components/biz-thread-detail/item/BizMessageItem.js +0 -27
- package/dist/components/bizInbox/BizCommunityTabPlaceholder.d.ts +0 -3
- package/dist/components/bizInbox/BizCommunityTabPlaceholder.d.ts.map +0 -1
- package/dist/components/bizInbox/BizCommunityTabPlaceholder.js +0 -10
- package/dist/components/bizInbox/BizContactListSkeleton.d.ts +0 -6
- package/dist/components/bizInbox/BizContactListSkeleton.d.ts.map +0 -1
- package/dist/components/bizInbox/BizContactListSkeleton.js +0 -8
- package/dist/components/bizInbox/BizCreateGroupButton.d.ts +0 -7
- package/dist/components/bizInbox/BizCreateGroupButton.d.ts.map +0 -1
- package/dist/components/bizInbox/BizCreateGroupButton.js +0 -11
- package/dist/components/bizInbox/BizInboxHeader.d.ts +0 -3
- package/dist/components/bizInbox/BizInboxHeader.d.ts.map +0 -1
- package/dist/components/bizInbox/BizInboxHeader.js +0 -8
- package/dist/components/bizInbox/BizInboxTabs.d.ts +0 -8
- package/dist/components/bizInbox/BizInboxTabs.d.ts.map +0 -1
- package/dist/components/bizInbox/BizInboxTabs.js +0 -27
- package/dist/components/bizInbox/BizSearchInput.d.ts +0 -9
- package/dist/components/bizInbox/BizSearchInput.d.ts.map +0 -1
- package/dist/components/bizInbox/BizSearchInput.js +0 -24
- package/dist/components/bizInbox/BizThreadAvatar.d.ts +0 -10
- package/dist/components/bizInbox/BizThreadAvatar.d.ts.map +0 -1
- package/dist/components/bizInbox/BizThreadAvatar.js +0 -8
- package/dist/components/bizInbox/BizThreadCard.d.ts +0 -8
- package/dist/components/bizInbox/BizThreadCard.d.ts.map +0 -1
- package/dist/components/bizInbox/BizThreadCard.js +0 -25
- package/dist/components/bizInbox/BizThreadList.d.ts +0 -11
- package/dist/components/bizInbox/BizThreadList.d.ts.map +0 -1
- package/dist/components/bizInbox/BizThreadList.js +0 -35
- package/dist/components/bizInbox/BizThreadTitle.d.ts +0 -8
- package/dist/components/bizInbox/BizThreadTitle.d.ts.map +0 -1
- package/dist/components/bizInbox/BizThreadTitle.js +0 -6
- package/dist/components/bizInbox/index.d.ts +0 -10
- package/dist/components/bizInbox/index.d.ts.map +0 -1
- package/dist/components/bizInbox/index.js +0 -5
- package/dist/components/bizInbox/states/BizThreadListEmpty.d.ts +0 -7
- package/dist/components/bizInbox/states/BizThreadListEmpty.d.ts.map +0 -1
- package/dist/components/bizInbox/states/BizThreadListEmpty.js +0 -15
- package/dist/components/bizInbox/states/BizThreadListError.d.ts +0 -6
- package/dist/components/bizInbox/states/BizThreadListError.d.ts.map +0 -1
- package/dist/components/bizInbox/states/BizThreadListError.js +0 -11
- package/dist/components/bizInbox/states/BizThreadListLoading.d.ts +0 -6
- package/dist/components/bizInbox/states/BizThreadListLoading.d.ts.map +0 -1
- package/dist/components/bizInbox/states/BizThreadListLoading.js +0 -8
- package/dist/components/bizThreadDetail/BizMessageBubble.d.ts +0 -10
- package/dist/components/bizThreadDetail/BizMessageBubble.d.ts.map +0 -1
- package/dist/components/bizThreadDetail/BizMessageBubble.js +0 -15
- package/dist/components/bizThreadDetail/BizMessageList.d.ts +0 -3
- package/dist/components/bizThreadDetail/BizMessageList.d.ts.map +0 -1
- package/dist/components/bizThreadDetail/BizMessageList.js +0 -28
- package/dist/components/bizThreadDetail/BizThreadDetailHeader.d.ts +0 -8
- package/dist/components/bizThreadDetail/BizThreadDetailHeader.d.ts.map +0 -1
- package/dist/components/bizThreadDetail/BizThreadDetailHeader.js +0 -18
- package/dist/components/bizThreadDetail/BizThreadDetailInput.d.ts +0 -8
- package/dist/components/bizThreadDetail/BizThreadDetailInput.d.ts.map +0 -1
- package/dist/components/bizThreadDetail/BizThreadDetailInput.js +0 -147
- package/dist/components/bizThreadDetail/index.d.ts +0 -8
- package/dist/components/bizThreadDetail/index.d.ts.map +0 -1
- package/dist/components/bizThreadDetail/index.js +0 -4
- package/dist/components/bizThreadDetail/item/BizMessageItem.d.ts +0 -8
- package/dist/components/bizThreadDetail/item/BizMessageItem.d.ts.map +0 -1
- package/dist/components/bizThreadDetail/item/BizMessageItem.js +0 -20
- package/dist/components/cannedResponse/CannedResponseBody.d.ts +0 -8
- package/dist/components/cannedResponse/CannedResponseBody.d.ts.map +0 -1
- package/dist/components/cannedResponse/CannedResponseBody.js +0 -109
- package/dist/components/cannedResponse/CannedResponseFooter.d.ts +0 -6
- package/dist/components/cannedResponse/CannedResponseFooter.d.ts.map +0 -1
- package/dist/components/cannedResponse/CannedResponseFooter.js +0 -8
- package/dist/components/cannedResponse/CannedResponseHeader.d.ts +0 -8
- package/dist/components/cannedResponse/CannedResponseHeader.d.ts.map +0 -1
- package/dist/components/cannedResponse/CannedResponseHeader.js +0 -11
- package/dist/components/cannedResponse/index.d.ts +0 -8
- package/dist/components/cannedResponse/index.d.ts.map +0 -1
- package/dist/components/cannedResponse/index.js +0 -34
- package/dist/components/cannedResponse/team/TeamItem.d.ts +0 -11
- package/dist/components/cannedResponse/team/TeamItem.d.ts.map +0 -1
- package/dist/components/cannedResponse/team/TeamItem.js +0 -31
- package/dist/components/chatBubble/ChatBubble.d.ts +0 -6
- package/dist/components/chatBubble/ChatBubble.d.ts.map +0 -1
- package/dist/components/chatBubble/ChatBubble.js +0 -35
- package/dist/components/mediaCollection/FileCollection.d.ts +0 -3
- package/dist/components/mediaCollection/FileCollection.d.ts.map +0 -1
- package/dist/components/mediaCollection/FileCollection.js +0 -53
- package/dist/components/mediaCollection/ImageCollection.d.ts +0 -3
- package/dist/components/mediaCollection/ImageCollection.d.ts.map +0 -1
- package/dist/components/mediaCollection/ImageCollection.js +0 -52
- package/dist/components/mediaCollection/LinkCollection.d.ts +0 -5
- package/dist/components/mediaCollection/LinkCollection.d.ts.map +0 -1
- package/dist/components/mediaCollection/LinkCollection.js +0 -92
- package/dist/components/mediaCollection/VideoCollection.d.ts +0 -3
- package/dist/components/mediaCollection/VideoCollection.d.ts.map +0 -1
- package/dist/components/mediaCollection/VideoCollection.js +0 -51
- package/dist/components/mediaCollection/index.d.ts +0 -9
- package/dist/components/mediaCollection/index.d.ts.map +0 -1
- package/dist/components/mediaCollection/index.js +0 -57
- package/dist/components/message/footer/QuotedMessage.d.ts +0 -2
- package/dist/components/message/footer/QuotedMessage.d.ts.map +0 -1
- package/dist/components/message/footer/QuotedMessage.js +0 -24
- package/dist/components/richTextEditor/RichTextEditor.d.ts +0 -12
- package/dist/components/richTextEditor/RichTextEditor.d.ts.map +0 -1
- package/dist/components/richTextEditor/RichTextEditor.js +0 -62
- package/dist/components/searchConversation/SearchAll.d.ts +0 -8
- package/dist/components/searchConversation/SearchAll.d.ts.map +0 -1
- package/dist/components/searchConversation/SearchAll.js +0 -37
- package/dist/components/searchConversation/SearchConversationAsMessages.d.ts +0 -6
- package/dist/components/searchConversation/SearchConversationAsMessages.d.ts.map +0 -1
- package/dist/components/searchConversation/SearchConversationAsMessages.js +0 -23
- package/dist/components/searchConversation/SearchConversationAsUsers.d.ts +0 -6
- package/dist/components/searchConversation/SearchConversationAsUsers.d.ts.map +0 -1
- package/dist/components/searchConversation/SearchConversationAsUsers.js +0 -21
- package/dist/components/searchConversation/SearchConversationMyInbox.d.ts +0 -6
- package/dist/components/searchConversation/SearchConversationMyInbox.d.ts.map +0 -1
- package/dist/components/searchConversation/SearchConversationMyInbox.js +0 -24
- package/dist/components/searchConversation/SearchDrawer.d.ts +0 -3
- package/dist/components/searchConversation/SearchDrawer.d.ts.map +0 -1
- package/dist/components/searchConversation/SearchDrawer.js +0 -33
- package/dist/components/searchConversation/SearchMessageOnCurrentConversation.d.ts +0 -7
- package/dist/components/searchConversation/SearchMessageOnCurrentConversation.d.ts.map +0 -1
- package/dist/components/searchConversation/SearchMessageOnCurrentConversation.js +0 -28
- package/dist/components/searchConversation/index.d.ts +0 -12
- package/dist/components/searchConversation/index.d.ts.map +0 -1
- package/dist/components/searchConversation/index.js +0 -46
- package/dist/components/searchConversation/item/SearchItemAsMessage.d.ts +0 -12
- package/dist/components/searchConversation/item/SearchItemAsMessage.d.ts.map +0 -1
- package/dist/components/searchConversation/item/SearchItemAsMessage.js +0 -72
- package/dist/components/searchConversation/item/SearchItemAsUser.d.ts +0 -8
- package/dist/components/searchConversation/item/SearchItemAsUser.d.ts.map +0 -1
- package/dist/components/searchConversation/item/SearchItemAsUser.js +0 -25
- package/dist/constants/bizInbox.d.ts +0 -37
- package/dist/constants/bizInbox.d.ts.map +0 -1
- package/dist/constants/bizInbox.js +0 -35
- package/dist/constants/bizMoreOption.d.ts +0 -9
- package/dist/constants/bizMoreOption.d.ts.map +0 -1
- package/dist/constants/bizMoreOption.js +0 -37
- package/dist/hooks/biz/index.d.ts +0 -8
- package/dist/hooks/biz/index.d.ts.map +0 -1
- package/dist/hooks/biz/index.js +0 -5
- package/dist/hooks/biz/useBizActiveConversation.d.ts +0 -3
- package/dist/hooks/biz/useBizActiveConversation.d.ts.map +0 -1
- package/dist/hooks/biz/useBizActiveConversation.js +0 -38
- package/dist/hooks/biz/useBizConversationList.d.ts +0 -15
- package/dist/hooks/biz/useBizConversationList.d.ts.map +0 -1
- package/dist/hooks/biz/useBizConversationList.js +0 -48
- package/dist/hooks/biz/useBizConversationListItems.d.ts +0 -8
- package/dist/hooks/biz/useBizConversationListItems.d.ts.map +0 -1
- package/dist/hooks/biz/useBizConversationListItems.js +0 -14
- package/dist/hooks/biz/useBizGlobalEvent.d.ts +0 -2
- package/dist/hooks/biz/useBizGlobalEvent.d.ts.map +0 -1
- package/dist/hooks/biz/useBizGlobalEvent.js +0 -72
- package/dist/hooks/biz/useBizSendMessage.d.ts +0 -4
- package/dist/hooks/biz/useBizSendMessage.d.ts.map +0 -1
- package/dist/hooks/biz/useBizSendMessage.js +0 -70
- package/dist/hooks/biz/useBotFlow.d.ts +0 -17
- package/dist/hooks/biz/useBotFlow.d.ts.map +0 -1
- package/dist/hooks/biz/useBotFlow.js +0 -127
- package/dist/hooks/biz/useConversationDetail.d.ts +0 -3
- package/dist/hooks/biz/useConversationDetail.d.ts.map +0 -1
- package/dist/hooks/biz/useConversationDetail.js +0 -18
- package/dist/hooks/biz/useCreateBizConversation.d.ts +0 -8
- package/dist/hooks/biz/useCreateBizConversation.d.ts.map +0 -1
- package/dist/hooks/biz/useCreateBizConversation.js +0 -15
- package/dist/hooks/biz/useResetBotFlow.d.ts +0 -3
- package/dist/hooks/biz/useResetBotFlow.d.ts.map +0 -1
- package/dist/hooks/biz/useResetBotFlow.js +0 -14
- package/dist/hooks/biz/useRunBotFlow.d.ts +0 -7
- package/dist/hooks/biz/useRunBotFlow.d.ts.map +0 -1
- package/dist/hooks/biz/useRunBotFlow.js +0 -14
- package/dist/hooks/cannedResponse/useFetchCannedCategories.d.ts +0 -3
- package/dist/hooks/cannedResponse/useFetchCannedCategories.d.ts.map +0 -1
- package/dist/hooks/cannedResponse/useFetchCannedCategories.js +0 -13
- package/dist/hooks/cannedResponse/useFetchCannedResponse.d.ts +0 -219
- package/dist/hooks/cannedResponse/useFetchCannedResponse.d.ts.map +0 -1
- package/dist/hooks/cannedResponse/useFetchCannedResponse.js +0 -55
- package/dist/hooks/common/useFetchExternalLink.d.ts +0 -2
- package/dist/hooks/common/useFetchExternalLink.d.ts.map +0 -1
- package/dist/hooks/common/useFetchExternalLink.js +0 -18
- package/dist/hooks/common/useIsSdkMessageReady.d.ts +0 -2
- package/dist/hooks/common/useIsSdkMessageReady.d.ts.map +0 -1
- package/dist/hooks/common/useIsSdkMessageReady.js +0 -7
- package/dist/hooks/conversation/useConversationPreview.d.ts +0 -12
- package/dist/hooks/conversation/useConversationPreview.d.ts.map +0 -1
- package/dist/hooks/conversation/useConversationPreview.js +0 -22
- package/dist/hooks/message/useSendCustomMessage.d.ts +0 -7
- package/dist/hooks/message/useSendCustomMessage.d.ts.map +0 -1
- package/dist/hooks/message/useSendCustomMessage.js +0 -5
- package/dist/locales/en/bizInbox.json +0 -41
- package/dist/locales/vi/biz-inbox.json +0 -39
- package/dist/locales/vi/bizInbox.json +0 -19
- package/dist/screens/biz-message/index.d.ts +0 -8
- package/dist/screens/biz-message/index.d.ts.map +0 -1
- package/dist/screens/biz-message/index.js +0 -30
- package/dist/screens/biz-thread-detail/index.d.ts +0 -9
- package/dist/screens/biz-thread-detail/index.d.ts.map +0 -1
- package/dist/screens/biz-thread-detail/index.js +0 -50
- package/dist/screens/bizMessage/index.d.ts +0 -9
- package/dist/screens/bizMessage/index.d.ts.map +0 -1
- package/dist/screens/bizMessage/index.js +0 -55
- package/dist/screens/bizThreadDetail/index.d.ts +0 -9
- package/dist/screens/bizThreadDetail/index.d.ts.map +0 -1
- package/dist/screens/bizThreadDetail/index.js +0 -36
- package/dist/screens/chatBubble/index.d.ts +0 -7
- package/dist/screens/chatBubble/index.d.ts.map +0 -1
- package/dist/screens/chatBubble/index.js +0 -41
- package/dist/screens/deskMessage/index.d.ts +0 -6
- package/dist/screens/deskMessage/index.d.ts.map +0 -1
- package/dist/screens/deskMessage/index.js +0 -17
- package/dist/services/biz/conversationService.d.ts +0 -3
- package/dist/services/biz/conversationService.d.ts.map +0 -1
- package/dist/services/biz/conversationService.js +0 -10
- package/dist/store/bizConversation.d.ts +0 -18
- package/dist/store/bizConversation.d.ts.map +0 -1
- package/dist/store/bizConversation.js +0 -35
- package/dist/store/bizMessageDraft.d.ts +0 -9
- package/dist/store/bizMessageDraft.d.ts.map +0 -1
- package/dist/store/bizMessageDraft.js +0 -35
- package/dist/store/pinnedMessage.d.ts +0 -4
- package/dist/store/pinnedMessage.d.ts.map +0 -1
- package/dist/store/pinnedMessage.js +0 -17
- package/dist/types/biz.d.ts +0 -128
- package/dist/types/biz.d.ts.map +0 -1
- package/dist/types/biz.js +0 -34
- package/dist/utils/bizConversation.d.ts +0 -15
- package/dist/utils/bizConversation.d.ts.map +0 -1
- package/dist/utils/bizConversation.js +0 -96
- package/dist/utils/bizLink.d.ts +0 -13
- package/dist/utils/bizLink.d.ts.map +0 -1
- package/dist/utils/bizLink.js +0 -77
- package/dist/utils/bizMessage.d.ts +0 -15
- package/dist/utils/bizMessage.d.ts.map +0 -1
- package/dist/utils/bizMessage.js +0 -93
- package/dist/utils/messageEx.d.ts +0 -5
- package/dist/utils/messageEx.d.ts.map +0 -1
- package/dist/utils/messageEx.js +0 -11
- package/dist/utils/openBizLink.d.ts +0 -3
- package/dist/utils/openBizLink.d.ts.map +0 -1
- package/dist/utils/openBizLink.js +0 -19
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { create } from "zustand";
|
|
13
|
-
const createDraftKey = (userId, conversationId) => `${userId}:${conversationId}`;
|
|
14
|
-
const useBizMessageDraftStore = create((set) => ({
|
|
15
|
-
drafts: {},
|
|
16
|
-
setDraft: (userId, conversationId, text) => {
|
|
17
|
-
if (!userId || !conversationId)
|
|
18
|
-
return;
|
|
19
|
-
const key = createDraftKey(userId, conversationId);
|
|
20
|
-
set((state) => ({
|
|
21
|
-
drafts: Object.assign(Object.assign({}, state.drafts), { [key]: text }),
|
|
22
|
-
}));
|
|
23
|
-
},
|
|
24
|
-
clearDraft: (userId, conversationId) => {
|
|
25
|
-
if (!userId || !conversationId)
|
|
26
|
-
return;
|
|
27
|
-
const key = createDraftKey(userId, conversationId);
|
|
28
|
-
set((state) => {
|
|
29
|
-
const _a = state.drafts, _b = key, _ = _a[_b], drafts = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
|
|
30
|
-
return { drafts };
|
|
31
|
-
});
|
|
32
|
-
},
|
|
33
|
-
clearAllDrafts: () => set({ drafts: {} }),
|
|
34
|
-
}));
|
|
35
|
-
export default useBizMessageDraftStore;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pinnedMessage.d.ts","sourceRoot":"","sources":["../../src/store/pinnedMessage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAE5C,QAAA,MAAM,qBAAqB,iFAgBxB,CAAC;AAEJ,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { create } from "zustand";
|
|
2
|
-
const usePinnedMessageStore = create((set) => ({
|
|
3
|
-
pinnedMessageList: [],
|
|
4
|
-
pinnedTotalCount: 0,
|
|
5
|
-
pinnedListIsEnd: false,
|
|
6
|
-
setPinnedMessageData: (messageList, totalCount, isEnd) => set({
|
|
7
|
-
pinnedMessageList: messageList,
|
|
8
|
-
pinnedTotalCount: totalCount,
|
|
9
|
-
pinnedListIsEnd: isEnd,
|
|
10
|
-
}),
|
|
11
|
-
resetPinnedMessageStore: () => set({
|
|
12
|
-
pinnedMessageList: [],
|
|
13
|
-
pinnedTotalCount: 0,
|
|
14
|
-
pinnedListIsEnd: false,
|
|
15
|
-
}),
|
|
16
|
-
}));
|
|
17
|
-
export default usePinnedMessageStore;
|
package/dist/types/biz.d.ts
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { DChatApplicationType } from "./chat";
|
|
2
|
-
import type { IPulledRawMessage } from "./dto";
|
|
3
|
-
export declare enum BizChatType {
|
|
4
|
-
SINGLE = "SINGLE",
|
|
5
|
-
GROUP = "GROUP"
|
|
6
|
-
}
|
|
7
|
-
export declare enum BizChatCategory {
|
|
8
|
-
BIZ_BIZ = "BIZ_BIZ",
|
|
9
|
-
BIZ_MALL = "BIZ_MALL",
|
|
10
|
-
GROUP = "GROUP",
|
|
11
|
-
BIZ_BOT_PDP = "BIZ_BOT_PDP",
|
|
12
|
-
BIZ_BOT_CRM = "BIZ_BOT_CRM"
|
|
13
|
-
}
|
|
14
|
-
export declare enum BizPeerType {
|
|
15
|
-
USER = "USER",
|
|
16
|
-
GROUP = "GROUP",
|
|
17
|
-
BOT = "BOT",
|
|
18
|
-
CUSTOMER = "CUSTOMER",
|
|
19
|
-
STAFF = "STAFF"
|
|
20
|
-
}
|
|
21
|
-
export interface BizConversationPeer {
|
|
22
|
-
id: string | null;
|
|
23
|
-
username: string | null;
|
|
24
|
-
fullName: string | null;
|
|
25
|
-
avatar: string | null;
|
|
26
|
-
botName?: string | null;
|
|
27
|
-
type: BizPeerType;
|
|
28
|
-
}
|
|
29
|
-
export interface BizConversationItem {
|
|
30
|
-
conversationId: string;
|
|
31
|
-
chatCategory: BizChatCategory;
|
|
32
|
-
chatType: BizChatType;
|
|
33
|
-
applicationType: DChatApplicationType;
|
|
34
|
-
memberRole: string;
|
|
35
|
-
pinnedAt: string | null;
|
|
36
|
-
isMuted: boolean;
|
|
37
|
-
peer: BizConversationPeer;
|
|
38
|
-
lastMessage: IPulledRawMessage | null;
|
|
39
|
-
}
|
|
40
|
-
export interface BizConversationMember {
|
|
41
|
-
userId: string;
|
|
42
|
-
memberRole: string;
|
|
43
|
-
}
|
|
44
|
-
export interface BizCreateConversationData {
|
|
45
|
-
conversationId: string;
|
|
46
|
-
groupId: string;
|
|
47
|
-
groupName: string;
|
|
48
|
-
chatCategory: BizChatCategory;
|
|
49
|
-
chatType: BizChatType;
|
|
50
|
-
applicationType: DChatApplicationType;
|
|
51
|
-
members: BizConversationMember[];
|
|
52
|
-
}
|
|
53
|
-
export declare enum BotFlowNodeType {
|
|
54
|
-
Start = "start",
|
|
55
|
-
Group = "group"
|
|
56
|
-
}
|
|
57
|
-
export declare enum BotBlockType {
|
|
58
|
-
BubbleText = "bubble-text",
|
|
59
|
-
BubbleImage = "bubble-image",
|
|
60
|
-
InputButtons = "input-buttons",
|
|
61
|
-
InputText = "input-text",
|
|
62
|
-
LogicCsTeam = "logic-cs-team"
|
|
63
|
-
}
|
|
64
|
-
export interface BotButtonOption {
|
|
65
|
-
id: string;
|
|
66
|
-
label: string;
|
|
67
|
-
}
|
|
68
|
-
interface BotBlockBase {
|
|
69
|
-
id: string;
|
|
70
|
-
parentId?: string;
|
|
71
|
-
}
|
|
72
|
-
export interface BotBubbleTextBlock extends BotBlockBase {
|
|
73
|
-
type: BotBlockType.BubbleText;
|
|
74
|
-
data: {
|
|
75
|
-
content: string;
|
|
76
|
-
plainText: string;
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
export interface BotBubbleImageBlock extends BotBlockBase {
|
|
80
|
-
type: BotBlockType.BubbleImage;
|
|
81
|
-
data: {
|
|
82
|
-
url: string;
|
|
83
|
-
sourceType: string;
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
export interface BotInputButtonsBlock extends BotBlockBase {
|
|
87
|
-
type: BotBlockType.InputButtons;
|
|
88
|
-
data: {
|
|
89
|
-
buttons: BotButtonOption[];
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
export interface BotInputTextBlock extends BotBlockBase {
|
|
93
|
-
type: BotBlockType.InputText;
|
|
94
|
-
data: {
|
|
95
|
-
longText: boolean;
|
|
96
|
-
buttonLabel: string;
|
|
97
|
-
placeholder: string;
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
export interface BotLogicCsTeamBlock extends BotBlockBase {
|
|
101
|
-
type: BotBlockType.LogicCsTeam;
|
|
102
|
-
data: {
|
|
103
|
-
csTeamId: string;
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
export type BotBlock = BotBubbleTextBlock | BotBubbleImageBlock | BotInputButtonsBlock | BotInputTextBlock | BotLogicCsTeamBlock;
|
|
107
|
-
export interface BotFlowNode {
|
|
108
|
-
id: string;
|
|
109
|
-
type: BotFlowNodeType;
|
|
110
|
-
data: {
|
|
111
|
-
label: string | null;
|
|
112
|
-
children: BotBlock[];
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
export interface BizBotConversationDetail {
|
|
116
|
-
conversationId: string;
|
|
117
|
-
chatCategory: BizChatCategory;
|
|
118
|
-
chatType: BizChatType;
|
|
119
|
-
applicationType: DChatApplicationType;
|
|
120
|
-
flowCurrentStep: BotFlowNode;
|
|
121
|
-
}
|
|
122
|
-
export interface RunBotFlowResponse {
|
|
123
|
-
flowNextStep: BotFlowNode;
|
|
124
|
-
isEnd: boolean;
|
|
125
|
-
havingBotMessage: boolean;
|
|
126
|
-
}
|
|
127
|
-
export {};
|
|
128
|
-
//# sourceMappingURL=biz.d.ts.map
|
package/dist/types/biz.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"biz.d.ts","sourceRoot":"","sources":["../../src/types/biz.ts"],"names":[],"mappings":"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"}
|
package/dist/types/biz.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export var BizChatType;
|
|
2
|
-
(function (BizChatType) {
|
|
3
|
-
BizChatType["SINGLE"] = "SINGLE";
|
|
4
|
-
BizChatType["GROUP"] = "GROUP";
|
|
5
|
-
})(BizChatType || (BizChatType = {}));
|
|
6
|
-
export var BizChatCategory;
|
|
7
|
-
(function (BizChatCategory) {
|
|
8
|
-
BizChatCategory["BIZ_BIZ"] = "BIZ_BIZ";
|
|
9
|
-
BizChatCategory["BIZ_MALL"] = "BIZ_MALL";
|
|
10
|
-
BizChatCategory["GROUP"] = "GROUP";
|
|
11
|
-
BizChatCategory["BIZ_BOT_PDP"] = "BIZ_BOT_PDP";
|
|
12
|
-
BizChatCategory["BIZ_BOT_CRM"] = "BIZ_BOT_CRM";
|
|
13
|
-
})(BizChatCategory || (BizChatCategory = {}));
|
|
14
|
-
export var BizPeerType;
|
|
15
|
-
(function (BizPeerType) {
|
|
16
|
-
BizPeerType["USER"] = "USER";
|
|
17
|
-
BizPeerType["GROUP"] = "GROUP";
|
|
18
|
-
BizPeerType["BOT"] = "BOT";
|
|
19
|
-
BizPeerType["CUSTOMER"] = "CUSTOMER";
|
|
20
|
-
BizPeerType["STAFF"] = "STAFF";
|
|
21
|
-
})(BizPeerType || (BizPeerType = {}));
|
|
22
|
-
export var BotFlowNodeType;
|
|
23
|
-
(function (BotFlowNodeType) {
|
|
24
|
-
BotFlowNodeType["Start"] = "start";
|
|
25
|
-
BotFlowNodeType["Group"] = "group";
|
|
26
|
-
})(BotFlowNodeType || (BotFlowNodeType = {}));
|
|
27
|
-
export var BotBlockType;
|
|
28
|
-
(function (BotBlockType) {
|
|
29
|
-
BotBlockType["BubbleText"] = "bubble-text";
|
|
30
|
-
BotBlockType["BubbleImage"] = "bubble-image";
|
|
31
|
-
BotBlockType["InputButtons"] = "input-buttons";
|
|
32
|
-
BotBlockType["InputText"] = "input-text";
|
|
33
|
-
BotBlockType["LogicCsTeam"] = "logic-cs-team";
|
|
34
|
-
})(BotBlockType || (BotBlockType = {}));
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ConversationItem, MessageItem } from "@openim/wasm-client-sdk";
|
|
2
|
-
import { BizPeerType, type BizConversationItem } from "../types/biz";
|
|
3
|
-
export declare const isBizBotPeer: (item: Pick<BizConversationItem, "peer">) => boolean;
|
|
4
|
-
export declare const isBizCustomerPeer: (item: Pick<BizConversationItem, "peer">) => boolean;
|
|
5
|
-
export declare const isBizBotCrmChat: (item: Pick<BizConversationItem, "peer" | "chatCategory">) => boolean;
|
|
6
|
-
export declare const isBizBotPdpChat: (item: Pick<BizConversationItem, "peer" | "chatCategory">) => boolean;
|
|
7
|
-
export declare const resolveBizDisplayName: (item: BizConversationItem, t: (key: string) => string) => string;
|
|
8
|
-
export declare const resolveBizAvatarUrl: (item: BizConversationItem) => string | null;
|
|
9
|
-
export declare const resolveBizBadgeLabel: (peerType: BizPeerType, t: (key: string) => string) => string;
|
|
10
|
-
export declare const resolveBizBadgeColor: (peerType: BizPeerType) => "" | "bg-orange-900" | "bg-blue-300";
|
|
11
|
-
export declare const isBizGroupMessageTarget: (item: BizConversationItem) => boolean;
|
|
12
|
-
export declare const isBizGroupChat: (item: BizConversationItem) => boolean;
|
|
13
|
-
export declare const resolveBizConversationIdFromMessage: (message: MessageItem, currentUserId: string) => string | null;
|
|
14
|
-
export declare const buildBizSdkConversation: (item: BizConversationItem) => ConversationItem;
|
|
15
|
-
//# sourceMappingURL=bizConversation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bizConversation.d.ts","sourceRoot":"","sources":["../../src/utils/bizConversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAe,MAAM,yBAAyB,CAAC;AAErF,OAAO,EAGL,WAAW,EACX,KAAK,mBAAmB,EACzB,MAAM,aAAa,CAAC;AAIrB,eAAO,MAAM,YAAY,GAAI,MAAM,IAAI,CAAC,mBAAmB,EAAE,MAAM,CAAC,YAChC,CAAC;AAErC,eAAO,MAAM,iBAAiB,GAAI,MAAM,IAAI,CAAC,mBAAmB,EAAE,MAAM,CAAC,YAChC,CAAC;AAE1C,eAAO,MAAM,eAAe,GAC1B,MAAM,IAAI,CAAC,mBAAmB,EAAE,MAAM,GAAG,cAAc,CAAC,YACkB,CAAC;AAE7E,eAAO,MAAM,eAAe,GAC1B,MAAM,IAAI,CAAC,mBAAmB,EAAE,MAAM,GAAG,cAAc,CAAC,YACkB,CAAC;AAE7E,eAAO,MAAM,qBAAqB,GAChC,MAAM,mBAAmB,EACzB,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,KACzB,MAgBF,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,MAAM,mBAAmB,KAAG,MAAM,GAAG,IAGxE,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,UAAU,WAAW,EACrB,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,KACzB,MAUF,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,UAAU,WAAW,yCAIzD,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,MAAM,mBAAmB,YAG3B,CAAC;AAEvC,eAAO,MAAM,cAAc,GAAI,MAAM,mBAAmB,YACC,CAAC;AAE1D,eAAO,MAAM,mCAAmC,GAC9C,SAAS,WAAW,EACpB,eAAe,MAAM,KACpB,MAAM,GAAG,IAiBX,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,MAAM,mBAAmB,KACxB,gBA0BF,CAAC"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { SessionType } from "@openim/wasm-client-sdk";
|
|
2
|
-
import useBizConversationStore from "../store/bizConversation";
|
|
3
|
-
import { BizChatCategory, BizChatType, BizPeerType, } from "../types/biz";
|
|
4
|
-
const BIZ_GROUP_CONVERSATION_PREFIX = "sg_";
|
|
5
|
-
export const isBizBotPeer = (item) => item.peer.type === BizPeerType.BOT;
|
|
6
|
-
export const isBizCustomerPeer = (item) => item.peer.type === BizPeerType.CUSTOMER;
|
|
7
|
-
export const isBizBotCrmChat = (item) => isBizBotPeer(item) && item.chatCategory === BizChatCategory.BIZ_BOT_CRM;
|
|
8
|
-
export const isBizBotPdpChat = (item) => isBizBotPeer(item) && item.chatCategory === BizChatCategory.BIZ_BOT_PDP;
|
|
9
|
-
export const resolveBizDisplayName = (item, t) => {
|
|
10
|
-
var _a, _b, _c, _d, _e;
|
|
11
|
-
if (isBizBotPeer(item)) {
|
|
12
|
-
const fullName = (_a = item.peer.fullName) === null || _a === void 0 ? void 0 : _a.trim();
|
|
13
|
-
if (fullName)
|
|
14
|
-
return fullName;
|
|
15
|
-
const username = (_b = item.peer.username) === null || _b === void 0 ? void 0 : _b.trim();
|
|
16
|
-
if (username)
|
|
17
|
-
return username;
|
|
18
|
-
const botName = (_c = item.peer.botName) === null || _c === void 0 ? void 0 : _c.trim();
|
|
19
|
-
if (botName)
|
|
20
|
-
return botName;
|
|
21
|
-
return t("thread_card.bot_crm_name");
|
|
22
|
-
}
|
|
23
|
-
const fullName = (_d = item.peer.fullName) === null || _d === void 0 ? void 0 : _d.trim();
|
|
24
|
-
if (fullName)
|
|
25
|
-
return fullName;
|
|
26
|
-
const username = (_e = item.peer.username) === null || _e === void 0 ? void 0 : _e.trim();
|
|
27
|
-
if (username)
|
|
28
|
-
return username;
|
|
29
|
-
return t("thread_card.fallback_name");
|
|
30
|
-
};
|
|
31
|
-
export const resolveBizAvatarUrl = (item) => {
|
|
32
|
-
var _a;
|
|
33
|
-
const avatar = (_a = item.peer.avatar) === null || _a === void 0 ? void 0 : _a.trim();
|
|
34
|
-
return avatar || null;
|
|
35
|
-
};
|
|
36
|
-
export const resolveBizBadgeLabel = (peerType, t) => {
|
|
37
|
-
if (peerType === BizPeerType.CUSTOMER) {
|
|
38
|
-
return t("thread_card.badge.mall");
|
|
39
|
-
}
|
|
40
|
-
if (peerType === BizPeerType.BOT) {
|
|
41
|
-
return t("thread_card.badge.bot");
|
|
42
|
-
}
|
|
43
|
-
return "";
|
|
44
|
-
};
|
|
45
|
-
export const resolveBizBadgeColor = (peerType) => {
|
|
46
|
-
if (peerType === BizPeerType.CUSTOMER)
|
|
47
|
-
return "bg-orange-900";
|
|
48
|
-
if (peerType === BizPeerType.BOT)
|
|
49
|
-
return "bg-blue-300";
|
|
50
|
-
return "";
|
|
51
|
-
};
|
|
52
|
-
export const isBizGroupMessageTarget = (item) => item.chatCategory === BizChatCategory.GROUP ||
|
|
53
|
-
item.chatType === BizChatType.GROUP ||
|
|
54
|
-
item.peer.type === BizPeerType.GROUP;
|
|
55
|
-
export const isBizGroupChat = (item) => isBizGroupMessageTarget(item) && !isBizBotCrmChat(item);
|
|
56
|
-
export const resolveBizConversationIdFromMessage = (message, currentUserId) => {
|
|
57
|
-
if (message.groupID) {
|
|
58
|
-
return `${BIZ_GROUP_CONVERSATION_PREFIX}${message.groupID}`;
|
|
59
|
-
}
|
|
60
|
-
const peerUserId = message.sendID === currentUserId ? message.recvID : message.sendID;
|
|
61
|
-
if (!peerUserId)
|
|
62
|
-
return null;
|
|
63
|
-
const sdkConversations = useBizConversationStore.getState().sdkConversations;
|
|
64
|
-
const matched = Object.values(sdkConversations).find((conversation) => conversation.userID === peerUserId);
|
|
65
|
-
if (matched)
|
|
66
|
-
return matched.conversationID;
|
|
67
|
-
const [firstUserId, secondUserId] = [currentUserId, peerUserId].sort();
|
|
68
|
-
return `si_${firstUserId}_${secondUserId}`;
|
|
69
|
-
};
|
|
70
|
-
export const buildBizSdkConversation = (item) => {
|
|
71
|
-
var _a, _b, _c, _d;
|
|
72
|
-
const isGroup = item.conversationId.startsWith(BIZ_GROUP_CONVERSATION_PREFIX);
|
|
73
|
-
return {
|
|
74
|
-
conversationID: item.conversationId,
|
|
75
|
-
conversationType: isGroup ? SessionType.Group : SessionType.Single,
|
|
76
|
-
userID: isGroup ? "" : (_a = item.peer.id) !== null && _a !== void 0 ? _a : "",
|
|
77
|
-
groupID: isGroup
|
|
78
|
-
? item.conversationId.slice(BIZ_GROUP_CONVERSATION_PREFIX.length)
|
|
79
|
-
: "",
|
|
80
|
-
showName: (_c = (_b = item.peer.fullName) !== null && _b !== void 0 ? _b : item.peer.username) !== null && _c !== void 0 ? _c : "",
|
|
81
|
-
faceURL: (_d = item.peer.avatar) !== null && _d !== void 0 ? _d : "",
|
|
82
|
-
unreadCount: 0,
|
|
83
|
-
latestMsg: "",
|
|
84
|
-
latestMsgSendTime: 0,
|
|
85
|
-
draftText: "",
|
|
86
|
-
draftTextTime: 0,
|
|
87
|
-
burnDuration: 0,
|
|
88
|
-
msgDestructTime: 0,
|
|
89
|
-
isPinned: false,
|
|
90
|
-
isNotInGroup: false,
|
|
91
|
-
isPrivateChat: false,
|
|
92
|
-
isMsgDestruct: false,
|
|
93
|
-
attachedInfo: "",
|
|
94
|
-
ex: "",
|
|
95
|
-
};
|
|
96
|
-
};
|
package/dist/utils/bizLink.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const normalizeBizLinkUrl: (link: string) => string;
|
|
2
|
-
export declare const extractBizLinkUrls: (text: string) => string[];
|
|
3
|
-
export type BizTextSegment = {
|
|
4
|
-
type: "text";
|
|
5
|
-
value: string;
|
|
6
|
-
} | {
|
|
7
|
-
type: "link";
|
|
8
|
-
value: string;
|
|
9
|
-
url: string;
|
|
10
|
-
};
|
|
11
|
-
export declare const parseBizTextWithLinks: (text: string) => BizTextSegment[];
|
|
12
|
-
export declare const getHostLabel: (url: string) => string;
|
|
13
|
-
//# sourceMappingURL=bizLink.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bizLink.d.ts","sourceRoot":"","sources":["../../src/utils/bizLink.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,mBAAmB,GAAI,MAAM,MAAM,KAAG,MAKlD,CAAC;AA+BF,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,KAAG,MAAM,EAYvD,CAAC;AAEF,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjD,eAAO,MAAM,qBAAqB,GAAI,MAAM,MAAM,KAAG,cAAc,EAwBlE,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,MAM1C,CAAC"}
|
package/dist/utils/bizLink.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
const PROTOCOL_URL_REGEX = /\bhttps?:\/\/[^\s<>"']*[^\s<>"',.!?()[\]{}]/gi;
|
|
2
|
-
const BARE_DOMAIN_REGEX = /\b(?!(?:https?:\/\/))(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z][a-z0-9-]{0,62}(?:\/[^\s<>"',.!?()[\]{}]*)?\b/gi;
|
|
3
|
-
export const normalizeBizLinkUrl = (link) => {
|
|
4
|
-
const trimmed = link.trim();
|
|
5
|
-
if (!trimmed)
|
|
6
|
-
return trimmed;
|
|
7
|
-
if (/^https?:\/\//i.test(trimmed))
|
|
8
|
-
return trimmed;
|
|
9
|
-
return `https://${trimmed}`;
|
|
10
|
-
};
|
|
11
|
-
const findLinkRanges = (text) => {
|
|
12
|
-
const ranges = [];
|
|
13
|
-
const addMatches = (regex) => {
|
|
14
|
-
const re = new RegExp(regex.source, regex.flags);
|
|
15
|
-
let match;
|
|
16
|
-
while ((match = re.exec(text)) !== null) {
|
|
17
|
-
ranges.push({
|
|
18
|
-
text: match[0],
|
|
19
|
-
start: match.index,
|
|
20
|
-
end: match.index + match[0].length,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
addMatches(PROTOCOL_URL_REGEX);
|
|
25
|
-
addMatches(BARE_DOMAIN_REGEX);
|
|
26
|
-
ranges.sort((a, b) => a.start - b.start);
|
|
27
|
-
const deduped = [];
|
|
28
|
-
for (const range of ranges) {
|
|
29
|
-
if (deduped.some((r) => range.start < r.end && r.start < range.end))
|
|
30
|
-
continue;
|
|
31
|
-
deduped.push(range);
|
|
32
|
-
}
|
|
33
|
-
return deduped;
|
|
34
|
-
};
|
|
35
|
-
export const extractBizLinkUrls = (text) => {
|
|
36
|
-
const seen = new Set();
|
|
37
|
-
const urls = [];
|
|
38
|
-
for (const { text: raw } of findLinkRanges(text)) {
|
|
39
|
-
const url = normalizeBizLinkUrl(raw);
|
|
40
|
-
if (seen.has(url))
|
|
41
|
-
continue;
|
|
42
|
-
seen.add(url);
|
|
43
|
-
urls.push(url);
|
|
44
|
-
}
|
|
45
|
-
return urls;
|
|
46
|
-
};
|
|
47
|
-
export const parseBizTextWithLinks = (text) => {
|
|
48
|
-
const ranges = findLinkRanges(text);
|
|
49
|
-
if (!ranges.length)
|
|
50
|
-
return [{ type: "text", value: text }];
|
|
51
|
-
const segments = [];
|
|
52
|
-
let cursor = 0;
|
|
53
|
-
for (const { text: raw, start, end } of ranges) {
|
|
54
|
-
if (start > cursor) {
|
|
55
|
-
segments.push({ type: "text", value: text.slice(cursor, start) });
|
|
56
|
-
}
|
|
57
|
-
segments.push({
|
|
58
|
-
type: "link",
|
|
59
|
-
value: raw,
|
|
60
|
-
url: normalizeBizLinkUrl(raw),
|
|
61
|
-
});
|
|
62
|
-
cursor = end;
|
|
63
|
-
}
|
|
64
|
-
if (cursor < text.length) {
|
|
65
|
-
segments.push({ type: "text", value: text.slice(cursor) });
|
|
66
|
-
}
|
|
67
|
-
return segments;
|
|
68
|
-
};
|
|
69
|
-
export const getHostLabel = (url) => {
|
|
70
|
-
var _a;
|
|
71
|
-
try {
|
|
72
|
-
return new URL(normalizeBizLinkUrl(url)).host;
|
|
73
|
-
}
|
|
74
|
-
catch (_b) {
|
|
75
|
-
return (_a = url.replace(/^https?:\/\//i, "").split("/")[0]) !== null && _a !== void 0 ? _a : url;
|
|
76
|
-
}
|
|
77
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ConversationItem, MessageType } from "@openim/wasm-client-sdk";
|
|
2
|
-
import type { TFunction } from "i18next";
|
|
3
|
-
import type { IPulledRawMessage } from "../types/dto";
|
|
4
|
-
export declare const shouldHideBizMessage: (message: {
|
|
5
|
-
contentType?: MessageType;
|
|
6
|
-
isInternal?: boolean;
|
|
7
|
-
}) => boolean;
|
|
8
|
-
export declare const isBizLatestMessageHidden: (latestMsg: string) => boolean;
|
|
9
|
-
export declare const toBizLatestMsgPreview: (lastMessage: IPulledRawMessage | null) => string;
|
|
10
|
-
export declare const resolveBizLatestPreview: (lastMessage: IPulledRawMessage | null, sdkConversation: ConversationItem | undefined, useRealtimeSdk: boolean) => {
|
|
11
|
-
latestMsg: string;
|
|
12
|
-
latestMsgSendTime: number;
|
|
13
|
-
};
|
|
14
|
-
export declare const parseBizLatestMessage: (latestMsg: string, currentUserId: string | undefined, t: TFunction, peerFullName?: string | null) => string;
|
|
15
|
-
//# sourceMappingURL=bizMessage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bizMessage.d.ts","sourceRoot":"","sources":["../../src/utils/bizMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAe,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAarD,eAAO,MAAM,oBAAoB,GAAI,SAAS;IAC5C,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,YAKA,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,WAAW,MAAM,KAAG,OAQ5D,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,aAAa,iBAAiB,GAAG,IAAI,KACpC,MAGF,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,aAAa,iBAAiB,GAAG,IAAI,EACrC,iBAAiB,gBAAgB,GAAG,SAAS,EAC7C,gBAAgB,OAAO;;;CAoBxB,CAAC;AAgDF,eAAO,MAAM,qBAAqB,GAChC,WAAW,MAAM,EACjB,eAAe,MAAM,GAAG,SAAS,EACjC,GAAG,SAAS,EACZ,eAAe,MAAM,GAAG,IAAI,WAe7B,CAAC"}
|
package/dist/utils/bizMessage.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { MessageType } from "@openim/wasm-client-sdk";
|
|
2
|
-
import { generateContentBasedOnMessageType } from "./common";
|
|
3
|
-
import { isSystemLogMessageType } from "./messageLog";
|
|
4
|
-
import { transformPulledMessage } from "./messageTransform";
|
|
5
|
-
export const shouldHideBizMessage = (message) => {
|
|
6
|
-
if (message.isInternal)
|
|
7
|
-
return true;
|
|
8
|
-
if (isSystemLogMessageType(message.contentType))
|
|
9
|
-
return true;
|
|
10
|
-
if (message.contentType === MessageType.CustomMessage)
|
|
11
|
-
return true;
|
|
12
|
-
return false;
|
|
13
|
-
};
|
|
14
|
-
export const isBizLatestMessageHidden = (latestMsg) => {
|
|
15
|
-
if (!latestMsg)
|
|
16
|
-
return true;
|
|
17
|
-
try {
|
|
18
|
-
return shouldHideBizMessage(JSON.parse(latestMsg));
|
|
19
|
-
}
|
|
20
|
-
catch (_a) {
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
export const toBizLatestMsgPreview = (lastMessage) => {
|
|
25
|
-
if (!lastMessage)
|
|
26
|
-
return "";
|
|
27
|
-
return JSON.stringify(transformPulledMessage(lastMessage));
|
|
28
|
-
};
|
|
29
|
-
export const resolveBizLatestPreview = (lastMessage, sdkConversation, useRealtimeSdk) => {
|
|
30
|
-
var _a;
|
|
31
|
-
const apiPreview = {
|
|
32
|
-
latestMsg: toBizLatestMsgPreview(lastMessage),
|
|
33
|
-
latestMsgSendTime: (_a = lastMessage === null || lastMessage === void 0 ? void 0 : lastMessage.sendTime) !== null && _a !== void 0 ? _a : 0,
|
|
34
|
-
};
|
|
35
|
-
if (!useRealtimeSdk || !(sdkConversation === null || sdkConversation === void 0 ? void 0 : sdkConversation.latestMsg)) {
|
|
36
|
-
return apiPreview;
|
|
37
|
-
}
|
|
38
|
-
if (isBizLatestMessageHidden(sdkConversation.latestMsg)) {
|
|
39
|
-
return apiPreview;
|
|
40
|
-
}
|
|
41
|
-
return {
|
|
42
|
-
latestMsg: sdkConversation.latestMsg,
|
|
43
|
-
latestMsgSendTime: sdkConversation.latestMsgSendTime,
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
const getSenderLabel = (msgData, currentUserId, t, peerFullName) => {
|
|
47
|
-
var _a;
|
|
48
|
-
if (currentUserId && msgData.sendID === currentUserId) {
|
|
49
|
-
return String(t("you"));
|
|
50
|
-
}
|
|
51
|
-
const name = (_a = msgData.senderNickname) === null || _a === void 0 ? void 0 : _a.trim();
|
|
52
|
-
if (name)
|
|
53
|
-
return name;
|
|
54
|
-
const peerName = peerFullName === null || peerFullName === void 0 ? void 0 : peerFullName.trim();
|
|
55
|
-
if (peerName)
|
|
56
|
-
return peerName;
|
|
57
|
-
return String(t("message_sender_unnamed"));
|
|
58
|
-
};
|
|
59
|
-
const getBizPreviewContent = (msgData, t) => {
|
|
60
|
-
var _a, _b, _c;
|
|
61
|
-
switch (msgData.contentType) {
|
|
62
|
-
case MessageType.TextMessage:
|
|
63
|
-
case MessageType.QuoteMessage:
|
|
64
|
-
return generateContentBasedOnMessageType(msgData.contentType, ((_a = msgData.textElem) === null || _a === void 0 ? void 0 : _a.content) || ((_b = msgData.quoteElem) === null || _b === void 0 ? void 0 : _b.text) || "", t);
|
|
65
|
-
case MessageType.UrlTextMessage:
|
|
66
|
-
return generateContentBasedOnMessageType(MessageType.TextMessage, ((_c = msgData.urlTextElem) === null || _c === void 0 ? void 0 : _c.content) || "", t);
|
|
67
|
-
case MessageType.PictureMessage:
|
|
68
|
-
case MessageType.MergeMessage:
|
|
69
|
-
case MessageType.VoiceMessage:
|
|
70
|
-
case MessageType.VideoMessage:
|
|
71
|
-
case MessageType.FileMessage:
|
|
72
|
-
case MessageType.RevokeMessage:
|
|
73
|
-
return generateContentBasedOnMessageType(msgData.contentType, undefined, t);
|
|
74
|
-
default:
|
|
75
|
-
return "";
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
export const parseBizLatestMessage = (latestMsg, currentUserId, t, peerFullName) => {
|
|
79
|
-
if (!latestMsg || !t)
|
|
80
|
-
return "";
|
|
81
|
-
try {
|
|
82
|
-
const msgData = JSON.parse(latestMsg);
|
|
83
|
-
if (shouldHideBizMessage(msgData))
|
|
84
|
-
return "";
|
|
85
|
-
const content = getBizPreviewContent(msgData, t);
|
|
86
|
-
if (!content)
|
|
87
|
-
return "";
|
|
88
|
-
return `${getSenderLabel(msgData, currentUserId, t, peerFullName)}: ${content}`;
|
|
89
|
-
}
|
|
90
|
-
catch (_a) {
|
|
91
|
-
return "";
|
|
92
|
-
}
|
|
93
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { MessageItem } from "@openim/wasm-client-sdk";
|
|
2
|
-
import { ExtendMessageInfo } from "../types/chat";
|
|
3
|
-
export declare const parseMessageEx: (value?: string | null) => Partial<ExtendMessageInfo>;
|
|
4
|
-
export declare const getMessageIsInternal: (message?: Pick<MessageItem, "ex"> | null) => boolean;
|
|
5
|
-
//# sourceMappingURL=messageEx.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messageEx.d.ts","sourceRoot":"","sources":["../../src/utils/messageEx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,eAAO,MAAM,cAAc,GACzB,QAAQ,MAAM,GAAG,IAAI,KACpB,OAAO,CAAC,iBAAiB,CAQ3B,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,UAAU,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,GAAG,IAAI,KACvC,OAA0D,CAAC"}
|
package/dist/utils/messageEx.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export const parseMessageEx = (value) => {
|
|
2
|
-
if (!value)
|
|
3
|
-
return {};
|
|
4
|
-
try {
|
|
5
|
-
return JSON.parse(value);
|
|
6
|
-
}
|
|
7
|
-
catch (_a) {
|
|
8
|
-
return {};
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
export const getMessageIsInternal = (message) => Boolean(parseMessageEx(message === null || message === void 0 ? void 0 : message.ex).isInternal);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"openBizLink.d.ts","sourceRoot":"","sources":["../../src/utils/openBizLink.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,GAAG,SAAS,KAAG,OAevD,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { message as antdMessage } from "antd";
|
|
2
|
-
import { normalizeBizLinkUrl } from "./bizLink";
|
|
3
|
-
export const openBizLink = (url, t) => {
|
|
4
|
-
if (!url || typeof window === "undefined")
|
|
5
|
-
return false;
|
|
6
|
-
try {
|
|
7
|
-
const opened = window.open(normalizeBizLinkUrl(url), "_blank");
|
|
8
|
-
if (!opened) {
|
|
9
|
-
antdMessage.error(t("link_open_error"));
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
opened.opener = null;
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
catch (_a) {
|
|
16
|
-
antdMessage.error(t("link_open_error"));
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
};
|