@droppii-org/chat-sdk 0.1.54 → 0.1.56
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/biz-inbox/BizThreadAvatar.d.ts +3 -3
- package/dist/components/biz-inbox/BizThreadAvatar.d.ts.map +1 -1
- package/dist/components/biz-inbox/BizThreadAvatar.js +5 -5
- package/dist/components/biz-inbox/BizThreadCard.d.ts +3 -3
- package/dist/components/biz-inbox/BizThreadCard.d.ts.map +1 -1
- package/dist/components/biz-inbox/BizThreadCard.js +7 -8
- package/dist/components/biz-inbox/BizThreadList.d.ts +3 -3
- package/dist/components/biz-inbox/BizThreadList.d.ts.map +1 -1
- package/dist/components/biz-inbox/BizThreadList.js +4 -8
- package/dist/components/biz-inbox/BizThreadTitle.d.ts +3 -3
- package/dist/components/biz-inbox/BizThreadTitle.d.ts.map +1 -1
- package/dist/components/biz-inbox/BizThreadTitle.js +5 -5
- package/dist/components/biz-thread-detail/BizMessageList.d.ts +5 -1
- package/dist/components/biz-thread-detail/BizMessageList.d.ts.map +1 -1
- package/dist/components/biz-thread-detail/BizMessageList.js +7 -23
- package/dist/components/biz-thread-detail/BizThreadDetailHeader.d.ts +2 -2
- package/dist/components/biz-thread-detail/BizThreadDetailHeader.d.ts.map +1 -1
- package/dist/components/biz-thread-detail/BizThreadDetailHeader.js +7 -5
- package/dist/components/biz-thread-detail/BizThreadDetailInput.d.ts.map +1 -1
- package/dist/components/biz-thread-detail/BizThreadDetailInput.js +8 -13
- package/dist/components/biz-thread-detail/bot/BotButtonMessage.d.ts +8 -1
- package/dist/components/biz-thread-detail/bot/BotButtonMessage.d.ts.map +1 -1
- package/dist/components/biz-thread-detail/bot/BotButtonMessage.js +5 -4
- package/dist/components/biz-thread-detail/bot/index.d.ts +1 -2
- package/dist/components/biz-thread-detail/bot/index.d.ts.map +1 -1
- package/dist/components/biz-thread-detail/bot/index.js +0 -1
- package/dist/components/conversation-detail/ConversationDetailHeader.d.ts +8 -0
- package/dist/components/conversation-detail/ConversationDetailHeader.d.ts.map +1 -0
- package/dist/components/conversation-detail/ConversationDetailHeader.js +18 -0
- package/dist/components/conversation-detail/ConversationDetailInput.d.ts +8 -0
- package/dist/components/conversation-detail/ConversationDetailInput.d.ts.map +1 -0
- package/dist/components/conversation-detail/ConversationDetailInput.js +258 -0
- package/dist/components/conversation-detail/ConversationMessageList.d.ts +7 -0
- package/dist/components/conversation-detail/ConversationMessageList.d.ts.map +1 -0
- package/dist/components/conversation-detail/ConversationMessageList.js +35 -0
- package/dist/components/conversation-detail/ConversationMoreOptionItem.d.ts +8 -0
- package/dist/components/conversation-detail/ConversationMoreOptionItem.d.ts.map +1 -0
- package/dist/components/conversation-detail/ConversationMoreOptionItem.js +19 -0
- package/dist/components/conversation-detail/ConversationMoreOptionPanel.d.ts +10 -0
- package/dist/components/conversation-detail/ConversationMoreOptionPanel.d.ts.map +1 -0
- package/dist/components/conversation-detail/ConversationMoreOptionPanel.js +20 -0
- package/dist/components/conversation-detail/bot/BotButtonMessage.d.ts +10 -0
- package/dist/components/conversation-detail/bot/BotButtonMessage.d.ts.map +1 -0
- package/dist/components/conversation-detail/bot/BotButtonMessage.js +30 -0
- package/dist/components/conversation-detail/bot/BotStartButton.d.ts +8 -0
- package/dist/components/conversation-detail/bot/BotStartButton.d.ts.map +1 -0
- package/dist/components/conversation-detail/bot/BotStartButton.js +11 -0
- package/dist/components/conversation-detail/bot/BotSuggest.d.ts +7 -0
- package/dist/components/conversation-detail/bot/BotSuggest.d.ts.map +1 -0
- package/dist/components/conversation-detail/bot/BotSuggest.js +11 -0
- package/dist/components/conversation-detail/bot/index.d.ts +7 -0
- package/dist/components/conversation-detail/bot/index.d.ts.map +1 -0
- package/dist/components/conversation-detail/bot/index.js +3 -0
- package/dist/components/conversation-detail/index.d.ts +10 -0
- package/dist/components/conversation-detail/index.d.ts.map +1 -0
- package/dist/components/conversation-detail/index.js +5 -0
- package/dist/components/conversation-inbox/ConversationInboxHeader.d.ts +3 -0
- package/dist/components/conversation-inbox/ConversationInboxHeader.d.ts.map +1 -0
- package/dist/components/conversation-inbox/ConversationInboxHeader.js +8 -0
- package/dist/components/conversation-inbox/ConversationInboxItem.d.ts +8 -0
- package/dist/components/conversation-inbox/ConversationInboxItem.d.ts.map +1 -0
- package/dist/components/conversation-inbox/ConversationInboxItem.js +30 -0
- package/dist/components/conversation-inbox/ConversationInboxList.d.ts +12 -0
- package/dist/components/conversation-inbox/ConversationInboxList.d.ts.map +1 -0
- package/dist/components/conversation-inbox/ConversationInboxList.js +36 -0
- package/dist/components/conversation-inbox/ConversationInboxTitle.d.ts +9 -0
- package/dist/components/conversation-inbox/ConversationInboxTitle.d.ts.map +1 -0
- package/dist/components/conversation-inbox/ConversationInboxTitle.js +7 -0
- package/dist/components/conversation-inbox/ConversationPeerAvatar.d.ts +10 -0
- package/dist/components/conversation-inbox/ConversationPeerAvatar.d.ts.map +1 -0
- package/dist/components/conversation-inbox/ConversationPeerAvatar.js +10 -0
- package/dist/components/conversation-inbox/index.d.ts +10 -0
- package/dist/components/conversation-inbox/index.d.ts.map +1 -0
- package/dist/components/conversation-inbox/index.js +5 -0
- package/dist/components/message/footer/LinkInputPreview.js +1 -1
- package/dist/components/message/item/ImageMessage.js +1 -1
- package/dist/components/message/item/LinkCard.js +1 -1
- package/dist/components/message/item/LinkText.js +1 -1
- package/dist/components/message/item/VideoMessage.js +1 -1
- package/dist/components/message/item/index.d.ts +2 -1
- package/dist/components/message/item/index.d.ts.map +1 -1
- package/dist/components/message/item/index.js +2 -7
- package/dist/components/message/item/mediaSize.d.ts.map +1 -1
- package/dist/components/message/item/mediaSize.js +8 -8
- package/dist/constants/botFlow.d.ts +0 -5
- package/dist/constants/botFlow.d.ts.map +1 -1
- package/dist/constants/botFlow.js +0 -11
- package/dist/constants/moreOption.d.ts +9 -0
- package/dist/constants/moreOption.d.ts.map +1 -0
- package/dist/constants/moreOption.js +37 -0
- package/dist/hooks/biz/useBotFlow.d.ts +3 -2
- package/dist/hooks/biz/useBotFlow.d.ts.map +1 -1
- package/dist/hooks/biz/useBotFlow.js +61 -2
- package/dist/hooks/biz/useRunBotFlow.d.ts +3 -2
- package/dist/hooks/biz/useRunBotFlow.d.ts.map +1 -1
- package/dist/hooks/conversation/useActiveConversation.d.ts +3 -0
- package/dist/hooks/conversation/useActiveConversation.d.ts.map +1 -0
- package/dist/hooks/conversation/useActiveConversation.js +31 -0
- package/dist/hooks/conversation/useBotConversationDetail.d.ts +3 -0
- package/dist/hooks/conversation/useBotConversationDetail.d.ts.map +1 -0
- package/dist/hooks/conversation/useBotConversationDetail.js +18 -0
- package/dist/hooks/conversation/useBotFlow.d.ts +18 -0
- package/dist/hooks/conversation/useBotFlow.d.ts.map +1 -0
- package/dist/hooks/conversation/useBotFlow.js +150 -0
- package/dist/hooks/conversation/useConversationList.d.ts +15 -0
- package/dist/hooks/conversation/useConversationList.d.ts.map +1 -0
- package/dist/hooks/conversation/useConversationList.js +70 -0
- package/dist/hooks/conversation/useCreateConversation.d.ts +8 -0
- package/dist/hooks/conversation/useCreateConversation.d.ts.map +1 -0
- package/dist/hooks/conversation/useCreateConversation.js +15 -0
- package/dist/hooks/conversation/useResetBotFlow.d.ts +3 -0
- package/dist/hooks/conversation/useResetBotFlow.d.ts.map +1 -0
- package/dist/hooks/conversation/useResetBotFlow.js +14 -0
- package/dist/hooks/conversation/useRunBotFlow.d.ts +7 -0
- package/dist/hooks/conversation/useRunBotFlow.d.ts.map +1 -0
- package/dist/hooks/conversation/useRunBotFlow.js +14 -0
- package/dist/hooks/global/useGlobalEvent.d.ts.map +1 -1
- package/dist/hooks/global/useGlobalEvent.js +15 -7
- package/dist/hooks/message/useMessage.d.ts.map +1 -1
- package/dist/hooks/message/useMessage.js +0 -2
- package/dist/hooks/message/useSendMessage.d.ts +6 -4
- package/dist/hooks/message/useSendMessage.d.ts.map +1 -1
- package/dist/hooks/message/useSendMessage.js +6 -2
- package/dist/hooks/user/useAuth.js +2 -2
- package/dist/index.d.ts +12 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -6
- package/dist/locales/i18n.js +3 -3
- package/dist/locales/i18n.ts +3 -3
- package/dist/locales/vi/biz-inbox.json +39 -39
- package/dist/locales/vi/conversation-inbox.json +39 -0
- package/dist/screens/biz-message/index.d.ts +3 -4
- package/dist/screens/biz-message/index.d.ts.map +1 -1
- package/dist/screens/biz-message/index.js +5 -9
- package/dist/screens/biz-thread-detail/index.d.ts.map +1 -1
- package/dist/screens/biz-thread-detail/index.js +10 -14
- package/dist/screens/conversation-detail/index.d.ts +9 -0
- package/dist/screens/conversation-detail/index.d.ts.map +1 -0
- package/dist/screens/conversation-detail/index.js +53 -0
- package/dist/screens/conversation-inbox/index.d.ts +8 -0
- package/dist/screens/conversation-inbox/index.d.ts.map +1 -0
- package/dist/screens/conversation-inbox/index.js +30 -0
- 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/services/routes.d.ts +0 -1
- package/dist/services/routes.d.ts.map +1 -1
- package/dist/services/routes.js +0 -1
- package/dist/store/conversation.d.ts.map +1 -1
- package/dist/store/conversation.js +14 -5
- package/dist/store/messageDraft.d.ts +9 -0
- package/dist/store/messageDraft.d.ts.map +1 -0
- package/dist/store/messageDraft.js +35 -0
- package/dist/store/type.d.ts +6 -1
- package/dist/store/type.d.ts.map +1 -1
- package/dist/styles/global.css +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/biz.d.ts +1 -5
- package/dist/types/biz.d.ts.map +1 -1
- package/dist/types/chat.d.ts +6 -0
- package/dist/types/chat.d.ts.map +1 -1
- package/dist/types/conversation.d.ts +116 -0
- package/dist/types/conversation.d.ts.map +1 -0
- package/dist/types/conversation.js +33 -0
- package/dist/utils/common.d.ts +1 -1
- package/dist/utils/common.d.ts.map +1 -1
- package/dist/utils/common.js +5 -3
- package/dist/utils/conversation.d.ts +12 -0
- package/dist/utils/conversation.d.ts.map +1 -0
- package/dist/utils/conversation.js +53 -0
- package/dist/utils/events.d.ts +1 -1
- package/dist/utils/events.d.ts.map +1 -1
- package/dist/utils/fileValidation.d.ts +2 -1
- package/dist/utils/fileValidation.d.ts.map +1 -1
- package/dist/utils/fileValidation.js +10 -1
- package/dist/utils/imCommon.d.ts +1 -0
- package/dist/utils/imCommon.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"tabs": {
|
|
3
|
+
"messages": "Tin nhắn"
|
|
4
|
+
},
|
|
5
|
+
"empty": {
|
|
6
|
+
"no_conversations": "Chưa có cuộc trò chuyện",
|
|
7
|
+
"no_messages": "Chưa có tin nhắn"
|
|
8
|
+
},
|
|
9
|
+
"thread_card": {
|
|
10
|
+
"fallback_name": "Người dùng",
|
|
11
|
+
"bot_crm_name": "Droppii Hỗ Trợ",
|
|
12
|
+
"badge": {
|
|
13
|
+
"mall": "Mall",
|
|
14
|
+
"bot": "Bot"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"thread_detail": {
|
|
18
|
+
"profile_hint": "Nhấn để xem thông tin",
|
|
19
|
+
"input_placeholder": "Nhập tin nhắn...",
|
|
20
|
+
"more_option": {
|
|
21
|
+
"toggle": "Tùy chọn khác",
|
|
22
|
+
"media": "Ảnh/Video",
|
|
23
|
+
"camera": "Chụp ảnh",
|
|
24
|
+
"document": "Tài liệu",
|
|
25
|
+
"order": "Gửi đơn hàng",
|
|
26
|
+
"product": "Gửi sản phẩm",
|
|
27
|
+
"appointment": "Tạo lịch hẹn"
|
|
28
|
+
},
|
|
29
|
+
"bot": {
|
|
30
|
+
"start": "Bắt đầu",
|
|
31
|
+
"restart": "Bắt đầu lại"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"link_preview": {
|
|
35
|
+
"loading": "Đang tải xem trước liên kết...",
|
|
36
|
+
"remove": "Xóa xem trước liên kết"
|
|
37
|
+
},
|
|
38
|
+
"link_open_error": "Không thể mở liên kết. Vui lòng thử lại."
|
|
39
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tabs": {
|
|
3
|
+
"messages": "Tin nhắn"
|
|
4
|
+
},
|
|
5
|
+
"empty": {
|
|
6
|
+
"no_conversations": "Chưa có cuộc trò chuyện",
|
|
7
|
+
"no_messages": "Chưa có tin nhắn"
|
|
8
|
+
},
|
|
9
|
+
"thread_card": {
|
|
10
|
+
"fallback_name": "Người dùng",
|
|
11
|
+
"bot_crm_name": "Droppii Hỗ Trợ",
|
|
12
|
+
"badge": {
|
|
13
|
+
"mall": "Mall",
|
|
14
|
+
"bot": "Bot"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"thread_detail": {
|
|
18
|
+
"profile_hint": "Nhấn để xem thông tin",
|
|
19
|
+
"input_placeholder": "Nhập tin nhắn...",
|
|
20
|
+
"more_option": {
|
|
21
|
+
"toggle": "Tùy chọn khác",
|
|
22
|
+
"media": "Ảnh/Video",
|
|
23
|
+
"camera": "Chụp ảnh",
|
|
24
|
+
"document": "Tài liệu",
|
|
25
|
+
"order": "Gửi đơn hàng",
|
|
26
|
+
"product": "Gửi sản phẩm",
|
|
27
|
+
"appointment": "Tạo lịch hẹn"
|
|
28
|
+
},
|
|
29
|
+
"bot": {
|
|
30
|
+
"start": "Bắt đầu",
|
|
31
|
+
"restart": "Bắt đầu lại"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"link_preview": {
|
|
35
|
+
"loading": "Đang tải xem trước liên kết...",
|
|
36
|
+
"remove": "Xóa xem trước liên kết"
|
|
37
|
+
},
|
|
38
|
+
"link_open_error": "Không thể mở liên kết. Vui lòng thử lại."
|
|
39
|
+
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ConversationListItem } from "../../types/conversation";
|
|
2
2
|
export interface DChatBizInboxProps {
|
|
3
|
-
|
|
4
|
-
onSelectThread?: (conversation: BizConversationItem) => void;
|
|
3
|
+
onSelectThread?: (conversation: ConversationListItem) => void;
|
|
5
4
|
className?: string;
|
|
6
5
|
}
|
|
7
|
-
declare const DChatBizInbox: ({
|
|
6
|
+
declare const DChatBizInbox: ({ onSelectThread, className, }: DChatBizInboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export default DChatBizInbox;
|
|
9
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/biz-message/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/biz-message/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAGjE,MAAM,WAAW,kBAAkB;IACjC,cAAc,CAAC,EAAE,CAAC,YAAY,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,aAAa,GAAI,gCAGpB,kBAAkB,4CA+CpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -5,27 +5,23 @@ import { useTranslation } from "react-i18next";
|
|
|
5
5
|
import { Empty } from "antd";
|
|
6
6
|
import clsx from "clsx";
|
|
7
7
|
import useAuthStore from "../../store/auth";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { useBizActiveConversation } from "../../hooks/biz/useBizActiveConversation";
|
|
8
|
+
import { useConversationList } from "../../hooks/conversation/useConversationList";
|
|
9
|
+
import { useActiveConversation } from "../../hooks/conversation/useActiveConversation";
|
|
11
10
|
import { BizInboxHeader } from "../../components/biz-inbox";
|
|
12
11
|
import BizThreadList from "../../components/biz-inbox/BizThreadList";
|
|
13
12
|
import DChatBizThreadDetail from "../../screens/biz-thread-detail";
|
|
14
|
-
import { PAGE_SIZE } from "../../constants";
|
|
15
13
|
import { DChatApplicationType } from "../../types/chat";
|
|
16
14
|
import { Icon } from "../../components/icon";
|
|
17
|
-
const DChatBizInbox = ({
|
|
15
|
+
const DChatBizInbox = ({ onSelectThread, className, }) => {
|
|
18
16
|
const { t } = useTranslation("biz-inbox");
|
|
19
17
|
const searchParams = useSearchParams();
|
|
20
18
|
const threadId = searchParams.get("threadId");
|
|
21
19
|
const applicationType = useAuthStore((state) => state.applicationType);
|
|
22
20
|
const isApplicationTypeValid = Object.values(DChatApplicationType).includes(applicationType);
|
|
23
|
-
|
|
24
|
-
const conversationList = useBizConversationList({
|
|
21
|
+
const conversationList = useConversationList({
|
|
25
22
|
enabled: isApplicationTypeValid,
|
|
26
|
-
pageSize,
|
|
27
23
|
});
|
|
28
|
-
|
|
24
|
+
useActiveConversation(conversationList.items);
|
|
29
25
|
if (threadId) {
|
|
30
26
|
return _jsx(DChatBizThreadDetail, { className: className });
|
|
31
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/biz-thread-detail/index.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAQhF,MAAM,WAAW,yBAA0B,SAAQ,yBAAyB;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,oBAAoB,GAAI,gDAK3B,yBAAyB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/biz-thread-detail/index.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAQhF,MAAM,WAAW,yBAA0B,SAAQ,yBAAyB;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,oBAAoB,GAAI,gDAK3B,yBAAyB,mDAmE3B,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -14,22 +14,22 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
|
15
15
|
import { useTranslation } from "react-i18next";
|
|
16
16
|
import clsx from "clsx";
|
|
17
|
-
import
|
|
17
|
+
import useConversationStore from "../../store/conversation";
|
|
18
18
|
import { BizMessageList, BizThreadDetailHeader, BizThreadDetailInput, } from "../../components/biz-thread-detail";
|
|
19
|
-
import {
|
|
20
|
-
import { useBotFlow } from "../../hooks/
|
|
21
|
-
import {
|
|
19
|
+
import { BotButtonMessage, BotStartButton, } from "../../components/biz-thread-detail/bot";
|
|
20
|
+
import { useBotFlow } from "../../hooks/conversation/useBotFlow";
|
|
21
|
+
import { isBotCrmChat } from "../../utils/conversation";
|
|
22
22
|
const DChatBizThreadDetail = (_a) => {
|
|
23
|
-
var _b
|
|
23
|
+
var _b;
|
|
24
24
|
var { className, children, onBack } = _a, inputProps = __rest(_a, ["className", "children", "onBack"]);
|
|
25
25
|
const { t } = useTranslation("biz-inbox");
|
|
26
26
|
const router = useRouter();
|
|
27
27
|
const pathname = usePathname();
|
|
28
28
|
const searchParams = useSearchParams();
|
|
29
|
-
const conversation =
|
|
30
|
-
const isBotThread = conversation ?
|
|
29
|
+
const conversation = useConversationStore((state) => state.conversationData);
|
|
30
|
+
const isBotThread = conversation ? isBotCrmChat(conversation) : false;
|
|
31
31
|
const botFlow = useBotFlow({
|
|
32
|
-
conversationId: (_b = conversation === null || conversation === void 0 ? void 0 : conversation.
|
|
32
|
+
conversationId: (_b = conversation === null || conversation === void 0 ? void 0 : conversation.conversationID) !== null && _b !== void 0 ? _b : "",
|
|
33
33
|
isBotThread,
|
|
34
34
|
});
|
|
35
35
|
const handleBack = () => {
|
|
@@ -44,11 +44,7 @@ const DChatBizThreadDetail = (_a) => {
|
|
|
44
44
|
}
|
|
45
45
|
const isBotNotStarted = isBotThread && botFlow.status === "not_started";
|
|
46
46
|
const footer = isBotNotStarted ? (_jsx("div", { className: "bg-white p-6", children: _jsx(BotStartButton, { label: t("thread_detail.bot.start"), onClick: botFlow.start, disabled: botFlow.isProcessing }) })) : (_jsx(BizThreadDetailInput, Object.assign({}, inputProps)));
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
disabled: botFlow.isProcessing,
|
|
50
|
-
onSelect: botFlow.selectButton,
|
|
51
|
-
onRestart: botFlow.restart,
|
|
52
|
-
}, children: _jsxs("div", { "data-testid": "biz-thread-detail-root", className: clsx("relative flex h-full w-full flex-col overflow-hidden bg-white", className), children: [_jsx(BizThreadDetailHeader, { conversation: conversation, onBack: handleBack }), _jsx("div", { className: "flex min-h-0 flex-1 flex-col", children: children !== null && children !== void 0 ? children : _jsx(BizMessageList, {}) }), footer] }) }));
|
|
47
|
+
const botButtonsSlot = isBotThread && botFlow.shouldShowButtons && botFlow.currentButtonsBlock ? (_jsx(BotButtonMessage, { buttons: botFlow.currentButtonsBlock.data.buttons, disabled: botFlow.isProcessing, onSelect: botFlow.selectButton, onRestart: botFlow.restart })) : null;
|
|
48
|
+
return (_jsxs("div", { "data-testid": "biz-thread-detail-root", className: clsx("relative flex h-full w-full flex-col overflow-hidden bg-white", className), children: [_jsx(BizThreadDetailHeader, { conversation: conversation, onBack: handleBack }), _jsx("div", { className: "flex min-h-0 flex-1 flex-col", children: children !== null && children !== void 0 ? children : _jsx(BizMessageList, { bottomSlot: botButtonsSlot }) }), footer] }));
|
|
53
49
|
};
|
|
54
50
|
export default DChatBizThreadDetail;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ConversationDetailInputProps } from "../../components/conversation-detail";
|
|
2
|
+
export interface DChatConversationDetailProps extends ConversationDetailInputProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
onBack?: () => void;
|
|
6
|
+
}
|
|
7
|
+
declare const DChatConversationDetail: ({ className, children, onBack, ...inputProps }: DChatConversationDetailProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export default DChatConversationDetail;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation-detail/index.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AASrF,MAAM,WAAW,4BAA6B,SAAQ,4BAA4B;IAChF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,uBAAuB,GAAI,gDAK9B,4BAA4B,mDA8E9B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
|
15
|
+
import { useTranslation } from "react-i18next";
|
|
16
|
+
import clsx from "clsx";
|
|
17
|
+
import useConversationStore from "../../store/conversation";
|
|
18
|
+
import { ConversationMessageList, ConversationDetailHeader, ConversationDetailInput, } from "../../components/conversation-detail";
|
|
19
|
+
import { BotButtonMessage, BotStartButton, BotSuggest, } from "../../components/conversation-detail/bot";
|
|
20
|
+
import { useBotFlow } from "../../hooks/conversation/useBotFlow";
|
|
21
|
+
import { isBotPeer } from "../../utils/conversation";
|
|
22
|
+
const DChatConversationDetail = (_a) => {
|
|
23
|
+
var _b;
|
|
24
|
+
var { className, children, onBack } = _a, inputProps = __rest(_a, ["className", "children", "onBack"]);
|
|
25
|
+
const { t } = useTranslation("conversation-inbox");
|
|
26
|
+
const router = useRouter();
|
|
27
|
+
const pathname = usePathname();
|
|
28
|
+
const searchParams = useSearchParams();
|
|
29
|
+
const conversation = useConversationStore((state) => state.conversationData);
|
|
30
|
+
const isBotThread = conversation ? isBotPeer(conversation) : false;
|
|
31
|
+
const botFlow = useBotFlow({
|
|
32
|
+
conversationId: (_b = conversation === null || conversation === void 0 ? void 0 : conversation.conversationID) !== null && _b !== void 0 ? _b : "",
|
|
33
|
+
isBotThread,
|
|
34
|
+
});
|
|
35
|
+
const handleBack = () => {
|
|
36
|
+
const newSearchParams = new URLSearchParams(searchParams);
|
|
37
|
+
newSearchParams.delete("threadId");
|
|
38
|
+
const query = newSearchParams.toString();
|
|
39
|
+
router.replace(query ? `${pathname}?${query}` : pathname);
|
|
40
|
+
onBack === null || onBack === void 0 ? void 0 : onBack();
|
|
41
|
+
};
|
|
42
|
+
if (!conversation) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
const isBotNotStarted = isBotThread && botFlow.status === "not_started";
|
|
46
|
+
const footer = isBotNotStarted ? (_jsx("div", { className: "bg-white p-6", children: _jsx(BotStartButton, { label: t("thread_detail.bot.start"), onClick: botFlow.start, disabled: botFlow.isProcessing }) })) : (_jsxs(_Fragment, { children: [isBotThread && (_jsx(BotSuggest, { disabled: botFlow.isProcessing, onRestart: botFlow.restart })), _jsx(ConversationDetailInput, Object.assign({}, inputProps))] }));
|
|
47
|
+
const botButtonsSlot = isBotThread &&
|
|
48
|
+
!botFlow.flowIsEnd &&
|
|
49
|
+
botFlow.shouldShowButtons &&
|
|
50
|
+
botFlow.currentButtonsBlock ? (_jsx(BotButtonMessage, { buttons: botFlow.currentButtonsBlock.data.buttons, disabled: botFlow.isProcessing, onSelect: botFlow.selectButton, onRestart: botFlow.restart })) : null;
|
|
51
|
+
return (_jsxs("div", { "data-testid": "conversation-detail-root", className: clsx("relative flex h-full w-full flex-col overflow-hidden bg-white", className), children: [_jsx(ConversationDetailHeader, { conversation: conversation, onBack: handleBack }), _jsx("div", { className: "flex min-h-0 flex-1 flex-col", children: children !== null && children !== void 0 ? children : _jsx(ConversationMessageList, { bottomSlot: botButtonsSlot }) }), footer] }));
|
|
52
|
+
};
|
|
53
|
+
export default DChatConversationDetail;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ConversationListItem } from "../../types/conversation";
|
|
2
|
+
export interface DChatConversationInboxProps {
|
|
3
|
+
onSelectThread?: (conversation: ConversationListItem) => void;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const DChatConversationInbox: ({ onSelectThread, className, }: DChatConversationInboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default DChatConversationInbox;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation-inbox/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAGjE,MAAM,WAAW,2BAA2B;IAC1C,cAAc,CAAC,EAAE,CAAC,YAAY,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,sBAAsB,GAAI,gCAG7B,2BAA2B,4CA+C7B,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useSearchParams } from "next/navigation";
|
|
4
|
+
import { useTranslation } from "react-i18next";
|
|
5
|
+
import { Empty } from "antd";
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import useAuthStore from "../../store/auth";
|
|
8
|
+
import { useConversationList } from "../../hooks/conversation/useConversationList";
|
|
9
|
+
import { useActiveConversation } from "../../hooks/conversation/useActiveConversation";
|
|
10
|
+
import { ConversationInboxHeader } from "../../components/conversation-inbox";
|
|
11
|
+
import ConversationInboxList from "../../components/conversation-inbox/ConversationInboxList";
|
|
12
|
+
import DChatConversationDetail from "../../screens/conversation-detail";
|
|
13
|
+
import { DChatApplicationType } from "../../types/chat";
|
|
14
|
+
import { Icon } from "../../components/icon";
|
|
15
|
+
const DChatConversationInbox = ({ onSelectThread, className, }) => {
|
|
16
|
+
const { t } = useTranslation("conversation-inbox");
|
|
17
|
+
const searchParams = useSearchParams();
|
|
18
|
+
const threadId = searchParams.get("threadId");
|
|
19
|
+
const applicationType = useAuthStore((state) => state.applicationType);
|
|
20
|
+
const isApplicationTypeValid = Object.values(DChatApplicationType).includes(applicationType);
|
|
21
|
+
const conversationList = useConversationList({
|
|
22
|
+
enabled: isApplicationTypeValid,
|
|
23
|
+
});
|
|
24
|
+
useActiveConversation(conversationList.items);
|
|
25
|
+
if (threadId) {
|
|
26
|
+
return _jsx(DChatConversationDetail, { className: className });
|
|
27
|
+
}
|
|
28
|
+
return (_jsxs("div", { "data-testid": "conversation-inbox-root", className: clsx("flex h-full w-full flex-col bg-white", className), children: [_jsx(ConversationInboxHeader, {}), !isApplicationTypeValid ? (_jsx("div", { className: "flex flex-1 items-center justify-center py-12", children: _jsx(Empty, { image: _jsx(Icon, { icon: "chat-square-b", size: 80, className: "text-gray-300" }), description: t("empty.no_conversations") }) })) : (_jsx(ConversationInboxList, { items: conversationList.items, isLoading: conversationList.isLoading, isFetchingNextPage: conversationList.isFetchingNextPage, hasNextPage: conversationList.hasNextPage, onLoadMore: conversationList.fetchNextPage, onSelectThread: onSelectThread }))] }));
|
|
29
|
+
};
|
|
30
|
+
export default DChatConversationInbox;
|
package/dist/services/query.d.ts
CHANGED
|
@@ -24,7 +24,6 @@ export declare const QUERY_KEYS: {
|
|
|
24
24
|
JOIN_SESSION: string;
|
|
25
25
|
PULL_SESSION_MESSAGES: string;
|
|
26
26
|
GET_CONVERSATIONS_IM_DETAIL: string;
|
|
27
|
-
GET_BIZ_CONVERSATIONS: string;
|
|
28
27
|
CREATE_BIZ_CONVERSATION: string;
|
|
29
28
|
GET_BIZ_CONVERSATION_DETAIL: string;
|
|
30
29
|
RUN_BOT_FLOW: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/services/query.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/services/query.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCtB,CAAC"}
|
package/dist/services/query.js
CHANGED
|
@@ -24,7 +24,6 @@ export const QUERY_KEYS = {
|
|
|
24
24
|
JOIN_SESSION: "JOIN_SESSION",
|
|
25
25
|
PULL_SESSION_MESSAGES: "PULL_SESSION_MESSAGES",
|
|
26
26
|
GET_CONVERSATIONS_IM_DETAIL: "GET_CONVERSATIONS_IM_DETAIL",
|
|
27
|
-
GET_BIZ_CONVERSATIONS: "GET_BIZ_CONVERSATIONS",
|
|
28
27
|
CREATE_BIZ_CONVERSATION: "CREATE_BIZ_CONVERSATION",
|
|
29
28
|
GET_BIZ_CONVERSATION_DETAIL: "GET_BIZ_CONVERSATION_DETAIL",
|
|
30
29
|
RUN_BOT_FLOW: "RUN_BOT_FLOW",
|
|
@@ -27,7 +27,6 @@ export declare const ENDPOINTS: {
|
|
|
27
27
|
leaveConversation: (conversationId: string) => string;
|
|
28
28
|
pullSessionMessages: string;
|
|
29
29
|
getConversationsImDetail: string;
|
|
30
|
-
getBizConversations: string;
|
|
31
30
|
createBizConversation: string;
|
|
32
31
|
getBizConversationDetail: (conversationId: string) => string;
|
|
33
32
|
runBotFlow: (conversationId: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/services/routes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;;mCAMS,MAAM;;0CAGC,MAAM,UAAU,MAAM;6BAEnC,MAAM;;oDAEiB,MAAM;uCAEnB,MAAM;kCAEX,MAAM;;oCAGJ,MAAM;mCAEP,MAAM;uCAEF,MAAM;;;;;;;;iCASZ,MAAM;4CAEK,MAAM
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/services/routes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;;mCAMS,MAAM;;0CAGC,MAAM,UAAU,MAAM;6BAEnC,MAAM;;oDAEiB,MAAM;uCAEnB,MAAM;kCAEX,MAAM;;oCAGJ,MAAM;mCAEP,MAAM;uCAEF,MAAM;;;;;;;;iCASZ,MAAM;4CAEK,MAAM;;;;mDAKC,MAAM;qCAEpB,MAAM;uCAEJ,MAAM;;;;;;;;;CAUxC,CAAC"}
|
package/dist/services/routes.js
CHANGED
|
@@ -27,7 +27,6 @@ export const ENDPOINTS = {
|
|
|
27
27
|
leaveConversation: (conversationId) => `chat-service/v1/crm/conversations/${conversationId}/leave`,
|
|
28
28
|
pullSessionMessages: "/chat-service/v1/messages/session/pull",
|
|
29
29
|
getConversationsImDetail: "/chat-service/v1/crm/conversations/im-detail",
|
|
30
|
-
getBizConversations: "/chat-service/v1/app/conversations/query",
|
|
31
30
|
createBizConversation: "/chat-service/v1/app/conversations",
|
|
32
31
|
getBizConversationDetail: (conversationId) => `/chat-service/v1/app/conversations/${conversationId}`,
|
|
33
32
|
runBotFlow: (conversationId) => `/chat-service/v1/app/conversations/${conversationId}/bot-flows/run`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../src/store/conversation.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAM3C,QAAA,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../src/store/conversation.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAM3C,QAAA,MAAM,oBAAoB,gFAsMvB,CAAC;AAEJ,eAAe,oBAAoB,CAAC"}
|
|
@@ -24,13 +24,22 @@ const useConversationStore = create((set, get) => ({
|
|
|
24
24
|
currentConversation: undefined,
|
|
25
25
|
currentGroupInfo: undefined,
|
|
26
26
|
currentMemberInGroup: undefined,
|
|
27
|
-
getConversationListByReq: async (isOffset) => {
|
|
27
|
+
getConversationListByReq: async (isOffset, appParams) => {
|
|
28
|
+
var _a;
|
|
28
29
|
let tmpConversationList = [];
|
|
30
|
+
const offset = isOffset ? get().conversationList.length : 0;
|
|
29
31
|
try {
|
|
30
|
-
const { data } =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
const { data } = appParams
|
|
33
|
+
? await DChatSDK.getConversationListSplitApp({
|
|
34
|
+
offset,
|
|
35
|
+
count: CONVERSATION_SPLIT_COUNT,
|
|
36
|
+
applicationType: appParams.applicationType,
|
|
37
|
+
chatCategory: (_a = appParams.chatCategory) !== null && _a !== void 0 ? _a : "",
|
|
38
|
+
})
|
|
39
|
+
: await DChatSDK.getConversationListSplit({
|
|
40
|
+
offset,
|
|
41
|
+
count: CONVERSATION_SPLIT_COUNT,
|
|
42
|
+
});
|
|
34
43
|
tmpConversationList = data;
|
|
35
44
|
}
|
|
36
45
|
catch (error) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface MessageDraftStore {
|
|
2
|
+
drafts: Record<string, string>;
|
|
3
|
+
setDraft: (userId: string, conversationId: string, text: string) => void;
|
|
4
|
+
clearDraft: (userId: string, conversationId: string) => void;
|
|
5
|
+
clearAllDrafts: () => void;
|
|
6
|
+
}
|
|
7
|
+
declare const useMessageDraftStore: import("zustand").UseBoundStore<import("zustand").StoreApi<MessageDraftStore>>;
|
|
8
|
+
export default useMessageDraftStore;
|
|
9
|
+
//# sourceMappingURL=messageDraft.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messageDraft.d.ts","sourceRoot":"","sources":["../../src/store/messageDraft.ts"],"names":[],"mappings":"AAKA,UAAU,iBAAiB;IACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACzE,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,QAAA,MAAM,oBAAoB,gFAkBvB,CAAC;AAEJ,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 useMessageDraftStore = 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 useMessageDraftStore;
|
package/dist/store/type.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { GroupItem, GroupMemberItem, ConversationItem, PublicUserItem, MessageItem } from "@openim/wasm-client-sdk";
|
|
2
2
|
import { DChatApplicationType, DChatPlatform, SessionStatus, SessionTag } from "../types/chat";
|
|
3
|
+
import { ChatCategory } from "../types/conversation";
|
|
4
|
+
export interface ConversationListAppParams {
|
|
5
|
+
applicationType: DChatApplicationType;
|
|
6
|
+
chatCategory?: ChatCategory;
|
|
7
|
+
}
|
|
3
8
|
export type ConversationListUpdateType = "push" | "filter";
|
|
4
9
|
export interface SessionStatusItem {
|
|
5
10
|
type: SessionStatus;
|
|
@@ -48,7 +53,7 @@ export interface ConversationStore {
|
|
|
48
53
|
currentConversation?: ConversationItem;
|
|
49
54
|
currentGroupInfo?: GroupItem;
|
|
50
55
|
currentMemberInGroup?: GroupMemberItem;
|
|
51
|
-
getConversationListByReq: (isOffset?: boolean) => Promise<boolean>;
|
|
56
|
+
getConversationListByReq: (isOffset?: boolean, appParams?: ConversationListAppParams) => Promise<boolean>;
|
|
52
57
|
updateConversationList: (list: ConversationItem[], type: ConversationListUpdateType) => void;
|
|
53
58
|
updateCurrentConversation: (conversation?: ConversationItem) => Promise<void>;
|
|
54
59
|
getCurrentGroupInfoByReq: (groupID: string) => Promise<void>;
|
package/dist/store/type.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/store/type.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,WAAW,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,aAAa,EACb,UAAU,EACX,MA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