@droppii-org/chat-sdk 0.0.35 → 0.0.37
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/ConversationBySessionItem.js +2 -1
- package/dist/components/conversation/DeskConversationList.d.ts.map +1 -1
- package/dist/components/conversation/DeskConversationList.js +15 -1
- package/dist/components/message/MessageHeader.d.ts +9 -0
- package/dist/components/message/MessageHeader.d.ts.map +1 -1
- package/dist/components/message/MessageHeader.js +122 -2
- package/dist/components/message/SelectSession.d.ts +9 -0
- package/dist/components/message/SelectSession.d.ts.map +1 -0
- package/dist/components/message/SelectSession.js +21 -0
- package/dist/components/message/footer/ToolbarPlugin.js +7 -7
- package/dist/components/message/item/TextMessage.js +2 -2
- package/dist/components/message/item/index.d.ts.map +1 -1
- package/dist/components/message/item/index.js +3 -5
- package/dist/components/session/DeskAssignedSession.d.ts.map +1 -1
- package/dist/components/session/DeskAssignedSession.js +38 -26
- package/dist/constants/index.d.ts +1 -12
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +1 -12
- package/dist/context/ChatContext.d.ts.map +1 -1
- package/dist/context/ChatContext.js +2 -1
- package/dist/hooks/global/useGlobalEvent.d.ts.map +1 -1
- package/dist/hooks/global/useGlobalEvent.js +15 -1
- package/dist/hooks/message/useMessage.d.ts.map +1 -1
- package/dist/hooks/message/useMessage.js +19 -5
- package/dist/hooks/message/useSendMessage.d.ts.map +1 -1
- package/dist/hooks/message/useSendMessage.js +14 -1
- package/dist/hooks/session/useGetSession.d.ts.map +1 -1
- package/dist/hooks/session/useGetSession.js +1 -0
- package/dist/hooks/session/useUpdateSession.d.ts +10 -0
- package/dist/hooks/session/useUpdateSession.d.ts.map +1 -0
- package/dist/hooks/session/useUpdateSession.js +19 -0
- package/dist/hooks/user/useAuth.d.ts.map +1 -1
- package/dist/hooks/user/useAuth.js +13 -10
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/index.js +0 -2
- package/dist/locales/vi/common.json +10 -2
- package/dist/services/query.d.ts +1 -0
- package/dist/services/query.d.ts.map +1 -1
- package/dist/services/query.js +1 -0
- package/dist/services/routes.d.ts +1 -0
- package/dist/services/routes.d.ts.map +1 -1
- package/dist/services/routes.js +1 -0
- package/dist/store/session.js +2 -2
- package/dist/styles/global.css +1 -1
- package/dist/types/chat.d.ts +20 -1
- package/dist/types/chat.d.ts.map +1 -1
- package/dist/types/chat.js +22 -0
- package/dist/types/dto.d.ts +20 -3
- package/dist/types/dto.d.ts.map +1 -1
- package/dist/utils/common.d.ts +2 -1
- package/dist/utils/common.d.ts.map +1 -1
- package/dist/utils/common.js +7 -2
- package/dist/utils/events.d.ts +2 -0
- package/dist/utils/events.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ import { useChatContext } from "../../context/ChatContext";
|
|
|
8
8
|
import { useConversationDisplayData } from "../../hooks/conversation/useConversation";
|
|
9
9
|
import { formatTimestamp, parseLatestMessage } from "../../utils/common";
|
|
10
10
|
const ConversationBySessionItem = ({ sessionItem, }) => {
|
|
11
|
+
var _a;
|
|
11
12
|
const { t } = useTranslation();
|
|
12
13
|
const { user } = useChatContext();
|
|
13
14
|
const isSelected = useConversationStore((state) => { var _a; return state.selectedConversationId === ((_a = sessionItem === null || sessionItem === void 0 ? void 0 : sessionItem.conversation) === null || _a === void 0 ? void 0 : _a.conversationID); });
|
|
@@ -27,7 +28,7 @@ const ConversationBySessionItem = ({ sessionItem, }) => {
|
|
|
27
28
|
const { avatar, displayName = "" } = useConversationDisplayData(conversation || null);
|
|
28
29
|
if (!conversation)
|
|
29
30
|
return null;
|
|
30
|
-
return (_jsxs("div", { onClick: () => handleConversationClick(conversation), className: `relative p-3 border-b border-gray-100 hover:bg-gray-100 cursor-pointer transition-colors ${isSelected ? "bg-blue-50" : "bg-white"}`, children: [isSelected && (_jsx("div", { className: "absolute left-0 top-0 bottom-0 w-1 bg-blue-500" })), _jsxs("div", { className: "flex items-start gap-3", children: [_jsx("div", { className: "relative flex-shrink-0", children: _jsx(Badge, { dot: true, status: "success", offset: [-2, 36], children: _jsx(Avatar, { size: 48, src: avatar,
|
|
31
|
+
return (_jsxs("div", { onClick: () => handleConversationClick(conversation), className: `relative p-3 border-b border-gray-100 hover:bg-gray-100 cursor-pointer transition-colors ${isSelected ? "bg-blue-50" : "bg-white"}`, children: [isSelected && (_jsx("div", { className: "absolute left-0 top-0 bottom-0 w-1 bg-blue-500" })), _jsxs("div", { className: "flex items-start gap-3", children: [_jsx("div", { className: "relative flex-shrink-0", children: _jsx(Badge, { dot: true, status: "success", offset: [-2, 36], children: _jsx(Avatar, { size: 48, src: avatar, children: ((_a = displayName === null || displayName === void 0 ? void 0 : displayName.charAt) === null || _a === void 0 ? void 0 : _a.call(displayName, 0)) || "A" }) }) }), _jsx("div", { className: "flex-1 min-w-0", children: _jsxs("div", { className: "flex items-start justify-between", children: [_jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("h3", { className: "font-semibold text-gray-900 text-sm truncate", children: displayName }), _jsx("p", { className: "text-xs text-gray-500 truncate mt-0.5", children: parseLatestMessage(conversation.latestMsg, user === null || user === void 0 ? void 0 : user.userID, t) })] }), _jsxs("div", { className: "flex flex-col items-end gap-1 ml-2", children: [_jsx("span", { className: "text-xs text-gray-400", children: formatTimestamp(conversation.latestMsgSendTime, {
|
|
31
32
|
hasTime: false,
|
|
32
33
|
}) }), _jsx("div", { className: "flex items-center gap-1", children: conversation.unreadCount > 0 && (_jsx(Badge, { count: conversation.unreadCount })) })] })] }) })] })] }, conversation.conversationID));
|
|
33
34
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeskConversationList.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/DeskConversationList.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DeskConversationList.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/DeskConversationList.tsx"],"names":[],"mappings":"AAkBA,QAAA,MAAM,oBAAoB,+CAsLzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -13,6 +13,7 @@ import InfiniteScroll from "react-infinite-scroll-component";
|
|
|
13
13
|
import ConversationBySessionItem from "./ConversationBySessionItem";
|
|
14
14
|
import { useGetSession } from "../../hooks/session/useGetSession";
|
|
15
15
|
import { DChatSDK } from "../../constants/sdk";
|
|
16
|
+
import emitter from "../../utils/events";
|
|
16
17
|
const DeskConversationList = () => {
|
|
17
18
|
var _a;
|
|
18
19
|
const searchInputRef = useRef(null);
|
|
@@ -25,7 +26,7 @@ const DeskConversationList = () => {
|
|
|
25
26
|
const conversationList = useConversationStore((state) => state.conversationList);
|
|
26
27
|
const updateConversationList = useConversationStore((state) => state.updateConversationList);
|
|
27
28
|
const filterSummary = useSessionStore((state) => state.filterSummary);
|
|
28
|
-
const { dataFlatten: sessions, hasNextPage, fetchNextPage, } = useGetSession(filterSummary);
|
|
29
|
+
const { dataFlatten: sessions, hasNextPage, fetchNextPage, refetch, } = useGetSession(filterSummary);
|
|
29
30
|
const debouncedSearch = useDebounce(search, { wait: 500 });
|
|
30
31
|
const onCloseSearch = () => {
|
|
31
32
|
setSearch("");
|
|
@@ -61,6 +62,19 @@ const DeskConversationList = () => {
|
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
64
|
}, [searchParams, conversationList]);
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
emitter.on("UPDATE_SESSION", (sessionUpdated) => {
|
|
67
|
+
if (sessionUpdated.status !== filterSummary.status ||
|
|
68
|
+
sessionUpdated.tag !== filterSummary.tag) {
|
|
69
|
+
refetch();
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
return () => {
|
|
73
|
+
emitter.off("UPDATE_SESSION", () => {
|
|
74
|
+
refetch();
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
}, [filterSummary]);
|
|
64
78
|
return (_jsxs("div", { className: `flex flex-col h-full bg-white border-r border-gray-200 w-[320px]`, children: [_jsx("div", { className: "p-3 border-b border-gray-100", children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Input, { ref: searchInputRef, placeholder: t("search"), prefix: _jsx(Icon, { icon: "search-o", size: 18, className: "text-gray-400" }), onChange: (e) => {
|
|
65
79
|
if (!showSearch && e.target.value) {
|
|
66
80
|
setShowSearchTrue();
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
import { SessionStatus, SessionTag } from "../../types/chat";
|
|
1
2
|
interface MessageHeaderProps {
|
|
2
3
|
onClose?: () => void;
|
|
3
4
|
}
|
|
5
|
+
type SelectSessionValueType = SessionStatus | SessionTag;
|
|
6
|
+
export interface SelectSessionOption {
|
|
7
|
+
label: string;
|
|
8
|
+
value: SelectSessionValueType;
|
|
9
|
+
tintColorClassname: string;
|
|
10
|
+
tintColorClassnameBg: string;
|
|
11
|
+
bgTintColorClassname: string;
|
|
12
|
+
}
|
|
4
13
|
declare const MessageHeader: ({ onClose }: MessageHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
14
|
export default MessageHeader;
|
|
6
15
|
//# sourceMappingURL=MessageHeader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageHeader.d.ts","sourceRoot":"","sources":["../../../src/components/message/MessageHeader.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MessageHeader.d.ts","sourceRoot":"","sources":["../../../src/components/message/MessageHeader.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAQ7D,UAAU,kBAAkB;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,KAAK,sBAAsB,GAAG,aAAa,GAAG,UAAU,CAAC;AAEzD,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,sBAAsB,CAAC;IAC9B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,QAAA,MAAM,aAAa,GAAI,aAAa,kBAAkB,4CA2LrD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,14 +1,134 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Avatar, Button } from "antd";
|
|
3
|
+
import { Avatar, Button, message } from "antd";
|
|
4
4
|
import { Icon } from "../icon";
|
|
5
5
|
import { useConversationDisplayData } from "../../hooks/conversation/useConversation";
|
|
6
6
|
import useConversationStore from "../../store/conversation";
|
|
7
7
|
import MediaCollection from "../mediaCollection";
|
|
8
|
+
import { useGetSession } from "../../hooks/session/useGetSession";
|
|
9
|
+
import { useEffect, useMemo, useState } from "react";
|
|
10
|
+
import { useTranslation } from "react-i18next";
|
|
11
|
+
import { SessionStatus, SessionTag } from "../../types/chat";
|
|
12
|
+
import SelectSession from "./SelectSession";
|
|
13
|
+
import { useUpdateSession } from "../../hooks/session/useUpdateSession";
|
|
14
|
+
import emitter from "../../utils/events";
|
|
15
|
+
import { useChatContext } from "../../context/ChatContext";
|
|
16
|
+
import { adminUserId } from "../../constants";
|
|
8
17
|
const MessageHeader = ({ onClose }) => {
|
|
9
18
|
var _a;
|
|
19
|
+
const { t } = useTranslation();
|
|
20
|
+
const { user } = useChatContext();
|
|
10
21
|
const conversationData = useConversationStore((state) => state.conversationData);
|
|
22
|
+
const { dataFlatten: sessions, refetch: refetchSession } = useGetSession({
|
|
23
|
+
conversationIds: (conversationData === null || conversationData === void 0 ? void 0 : conversationData.conversationID)
|
|
24
|
+
? [conversationData.conversationID]
|
|
25
|
+
: [],
|
|
26
|
+
});
|
|
27
|
+
const { mutate: updateSession } = useUpdateSession();
|
|
11
28
|
const { avatar, displayName } = useConversationDisplayData(conversationData);
|
|
12
|
-
|
|
29
|
+
const [currentSessionStatus, setCurrentSessionStatus] = useState(SessionStatus.UNASSIGNED);
|
|
30
|
+
const [currentSessionTag, setCurrentSessionTag] = useState(SessionTag.NONE);
|
|
31
|
+
const currentSession = useMemo(() => {
|
|
32
|
+
return sessions === null || sessions === void 0 ? void 0 : sessions.find((session) => session.conversationId === (conversationData === null || conversationData === void 0 ? void 0 : conversationData.conversationID));
|
|
33
|
+
}, [sessions, conversationData]);
|
|
34
|
+
const statusOptions = useMemo(() => {
|
|
35
|
+
return [
|
|
36
|
+
{
|
|
37
|
+
label: t("unassigned"),
|
|
38
|
+
value: SessionStatus.UNASSIGNED,
|
|
39
|
+
tintColorClassname: "text-amber-500",
|
|
40
|
+
tintColorClassnameBg: "bg-amber-500",
|
|
41
|
+
bgTintColorClassname: "bg-amber-100",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: t("waiting_process"),
|
|
45
|
+
value: SessionStatus.WAITING_PROCESS,
|
|
46
|
+
tintColorClassname: "text-orange-500",
|
|
47
|
+
tintColorClassnameBg: "bg-orange-500",
|
|
48
|
+
bgTintColorClassname: "bg-orange-100",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: t("in_process"),
|
|
52
|
+
value: SessionStatus.IN_PROCESS,
|
|
53
|
+
tintColorClassname: "text-blue-500",
|
|
54
|
+
tintColorClassnameBg: "bg-blue-500",
|
|
55
|
+
bgTintColorClassname: "bg-blue-100",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: t("completed"),
|
|
59
|
+
value: SessionStatus.COMPLETED,
|
|
60
|
+
tintColorClassname: "text-green-500",
|
|
61
|
+
tintColorClassnameBg: "bg-green-500",
|
|
62
|
+
bgTintColorClassname: "bg-green-100",
|
|
63
|
+
},
|
|
64
|
+
];
|
|
65
|
+
}, [t]);
|
|
66
|
+
const tagOptions = useMemo(() => {
|
|
67
|
+
return [
|
|
68
|
+
{
|
|
69
|
+
label: t("awaiting_reply"),
|
|
70
|
+
value: SessionTag.AWAITING_REPLY,
|
|
71
|
+
tintColorClassname: "text-purple-500",
|
|
72
|
+
tintColorClassnameBg: "bg-purple-500",
|
|
73
|
+
bgTintColorClassname: "bg-purple-100",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
label: t("slow_processing"),
|
|
77
|
+
value: SessionTag.SLOW_PROCESSING,
|
|
78
|
+
tintColorClassname: "text-red-500",
|
|
79
|
+
tintColorClassnameBg: "bg-red-500",
|
|
80
|
+
bgTintColorClassname: "bg-red-100",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
label: t("temporarily_paused"),
|
|
84
|
+
value: SessionTag.TEMPORARILY_PAUSED,
|
|
85
|
+
tintColorClassname: "text-gray-500",
|
|
86
|
+
tintColorClassnameBg: "bg-gray-500",
|
|
87
|
+
bgTintColorClassname: "bg-gray-100",
|
|
88
|
+
},
|
|
89
|
+
];
|
|
90
|
+
}, [t]);
|
|
91
|
+
const handleUpdateSession = (value, type) => {
|
|
92
|
+
if (currentSession) {
|
|
93
|
+
updateSession({
|
|
94
|
+
sessionId: currentSession.id,
|
|
95
|
+
[type]: value,
|
|
96
|
+
}, {
|
|
97
|
+
onError(error) {
|
|
98
|
+
var _a, _b;
|
|
99
|
+
message.error(((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.message) ||
|
|
100
|
+
t(`update_session_${type}_failed`));
|
|
101
|
+
},
|
|
102
|
+
onSuccess() {
|
|
103
|
+
if (type === "status") {
|
|
104
|
+
setCurrentSessionStatus(value);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
setCurrentSessionTag(value);
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
useEffect(() => {
|
|
114
|
+
if (currentSession) {
|
|
115
|
+
setCurrentSessionTag(currentSession.tag);
|
|
116
|
+
setCurrentSessionStatus(currentSession.status);
|
|
117
|
+
}
|
|
118
|
+
}, [currentSession]);
|
|
119
|
+
useEffect(() => {
|
|
120
|
+
emitter.on("UPDATE_SESSION", (sessionUpdated) => {
|
|
121
|
+
if (sessionUpdated.conversationId === (conversationData === null || conversationData === void 0 ? void 0 : conversationData.conversationID)) {
|
|
122
|
+
refetchSession();
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
return () => {
|
|
126
|
+
emitter.off("UPDATE_SESSION", () => {
|
|
127
|
+
refetchSession();
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
}, [conversationData === null || conversationData === void 0 ? void 0 : conversationData.conversationID]);
|
|
131
|
+
return (_jsxs("div", { className: "px-4 py-3 flex items-center border-b gap-3 bg-white no-transform", children: [_jsx(Avatar, { src: avatar, size: "large", children: ((_a = displayName === null || displayName === void 0 ? void 0 : displayName.charAt) === null || _a === void 0 ? void 0 : _a.call(displayName, 0)) || "A" }), _jsxs("div", { className: "flex flex-col", children: [_jsx("p", { className: "text-base truncate", children: displayName || "" }), _jsx("p", { className: "text-xs text-gray-500", children: "2 thành viên" })] }), _jsxs("div", { className: "flex items-center gap-2 flex-1 justify-end", children: [currentSessionTag !== SessionTag.NONE &&
|
|
132
|
+
(user === null || user === void 0 ? void 0 : user.userID) === adminUserId && (_jsx(SelectSession, { options: tagOptions, value: currentSessionTag, onChange: (value) => handleUpdateSession(value, "tag") })), (user === null || user === void 0 ? void 0 : user.userID) === adminUserId && (_jsx(SelectSession, { options: statusOptions, value: currentSessionStatus, onChange: (value) => handleUpdateSession(value, "status") })), _jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0", children: _jsx(Icon, { icon: "search-o", size: 22 }) }), _jsx(MediaCollection, {}), _jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0", children: _jsx(Icon, { icon: "align-justify-o", size: 22 }) }), !!onClose && (_jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0", onClick: onClose, children: _jsx(Icon, { icon: "close-b", size: 22 }) }))] })] }));
|
|
13
133
|
};
|
|
14
134
|
export default MessageHeader;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SelectSessionOption } from "./MessageHeader";
|
|
2
|
+
interface SelectSessionProps {
|
|
3
|
+
options: SelectSessionOption[];
|
|
4
|
+
value: SelectSessionOption["value"];
|
|
5
|
+
onChange: (value: SelectSessionOption["value"]) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const SelectSession: ({ options, value, onChange }: SelectSessionProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default SelectSession;
|
|
9
|
+
//# sourceMappingURL=SelectSession.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectSession.d.ts","sourceRoot":"","sources":["../../../src/components/message/SelectSession.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAMtD,UAAU,kBAAkB;IAC1B,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC/B,KAAK,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACpC,QAAQ,EAAE,CAAC,KAAK,EAAE,mBAAmB,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;CACzD;AAED,QAAA,MAAM,aAAa,GAAI,8BAA8B,kBAAkB,4CAqEtE,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Modal } from "antd";
|
|
4
|
+
import { useBoolean } from "ahooks";
|
|
5
|
+
import { Icon } from "../icon";
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import { useTranslation } from "react-i18next";
|
|
8
|
+
const SelectSession = ({ options, value, onChange }) => {
|
|
9
|
+
const { t } = useTranslation();
|
|
10
|
+
const [open, { toggle }] = useBoolean(false);
|
|
11
|
+
const selectedOption = options.find((option) => option.value === value);
|
|
12
|
+
const handleSelect = (value) => {
|
|
13
|
+
onChange(value);
|
|
14
|
+
toggle();
|
|
15
|
+
};
|
|
16
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: clsx("flex items-center gap-2 px-3 py-1 rounded-sm min-w-[64px] cursor-pointer", selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.bgTintColorClassname, selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.tintColorClassname), onClick: toggle, children: [_jsx("span", { className: "text-xs font-medium truncate", children: (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) || "" }), _jsx(Icon, { icon: "angle-down-o", size: 14 })] }), _jsx(Modal, { title: t("update_session_status_title"), closable: { "aria-label": "Custom Close Button" }, open: open, onOk: toggle, onCancel: toggle, width: 300, styles: { content: { padding: 12 } }, footer: null, children: _jsx("div", { className: "flex flex-col gap-1", children: options.map((option) => {
|
|
17
|
+
const isSelected = option.value === value;
|
|
18
|
+
return (_jsxs("div", { className: "flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-gray-100 rounded-sm", onClick: () => onChange(option.value), onClickCapture: () => handleSelect(option.value), children: [_jsx("div", { className: clsx("w-2 h-2 rounded-full", option.tintColorClassnameBg) }), _jsx("span", { className: clsx("text-xs truncate flex-1", isSelected && "font-bold"), children: option.label }), isSelected && (_jsx(Icon, { icon: "check-b", size: 18, className: "text-blue-500" }))] }, option.value));
|
|
19
|
+
}) }) })] }));
|
|
20
|
+
};
|
|
21
|
+
export default SelectSession;
|
|
@@ -6,7 +6,7 @@ import { $isListNode, INSERT_ORDERED_LIST_COMMAND, INSERT_UNORDERED_LIST_COMMAND
|
|
|
6
6
|
import { $createQuoteNode, $isQuoteNode } from "@lexical/rich-text";
|
|
7
7
|
import { TOGGLE_LINK_COMMAND } from "@lexical/link";
|
|
8
8
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
9
|
-
import { BoldOutlined, ItalicOutlined, StrikethroughOutlined, OrderedListOutlined, UnorderedListOutlined,
|
|
9
|
+
import { BoldOutlined, ItalicOutlined, StrikethroughOutlined, OrderedListOutlined, UnorderedListOutlined, } from "@ant-design/icons";
|
|
10
10
|
import { Button } from "antd";
|
|
11
11
|
const quoteIcon = (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M5.24615 10.5714C4.5616 10.5714 3.99078 10.5715 3.53762 10.5105C3.0593 10.4462 2.62745 10.3047 2.28042 9.95769C1.9334 9.61072 1.79194 9.17887 1.72763 8.70055C1.6667 8.24737 1.66673 7.67654 1.66675 6.99199V6.91274C1.66673 6.22819 1.6667 5.65734 1.72763 5.20419C1.79194 4.72586 1.9334 4.29401 2.28043 3.94699C2.62746 3.59997 3.0593 3.4585 3.53762 3.3942C3.99078 3.33327 4.56161 3.33329 5.24615 3.33331H5.32541C6.00995 3.33329 6.5808 3.33327 7.03397 3.3942C7.51228 3.4585 7.94413 3.59997 8.29116 3.94699C8.63817 4.29401 8.77966 4.72586 8.84396 5.20419C8.90491 5.65734 8.90484 6.22817 8.90484 6.91272V6.99198C8.90484 7.67652 8.90491 8.24737 8.84396 8.70055C8.77966 9.17887 8.63817 9.61072 8.29116 9.95769C7.94413 10.3047 7.51228 10.4462 7.03397 10.5105C6.5808 10.5715 6.00998 10.5714 5.32544 10.5714H5.24615Z", fill: "currentColor" }), _jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M2.84403 16.1313C2.71884 15.7295 2.94301 15.3023 3.34474 15.1772C5.71249 14.4393 7.38095 12.3426 7.38095 9.914V6.76172C7.38095 6.34094 7.72207 5.99982 8.14286 5.99982C8.56366 5.99982 8.90476 6.34094 8.90476 6.76172V9.914C8.90476 13.0731 6.73976 15.7152 3.79812 16.6319C3.39638 16.7572 2.96923 16.533 2.84403 16.1313Z", fill: "currentColor" }), _jsx("path", { d: "M14.389 10.5714C13.7044 10.5714 13.1336 10.5715 12.6804 10.5105C12.2021 10.4462 11.7703 10.3047 11.4233 9.95769C11.0762 9.61072 10.9348 9.17887 10.8704 8.70055C10.8095 8.24737 10.8096 7.67654 10.8096 6.99199V6.91274C10.8096 6.22819 10.8095 5.65734 10.8704 5.20419C10.9348 4.72586 11.0762 4.29401 11.4233 3.94699C11.7703 3.59997 12.2021 3.4585 12.6804 3.3942C13.1336 3.33327 13.7044 3.33329 14.389 3.33331H14.4682C15.1528 3.33329 15.7236 3.33327 16.1768 3.3942C16.6551 3.4585 17.087 3.59997 17.4339 3.94699C17.781 4.29401 17.9225 4.72586 17.9868 5.20419C18.0477 5.65734 18.0477 6.22817 18.0477 6.91272V6.99198C18.0477 7.67652 18.0477 8.24737 17.9868 8.70055C17.9225 9.17887 17.781 9.61072 17.4339 9.95769C17.087 10.3047 16.6551 10.4462 16.1768 10.5105C15.7236 10.5715 15.1528 10.5714 14.4682 10.5714H14.389Z", fill: "currentColor" }), _jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M11.9869 16.1313C11.8617 15.7295 12.0858 15.3023 12.4876 15.1772C14.8553 14.4393 16.5238 12.3426 16.5238 9.914V6.76172C16.5238 6.34094 16.8649 5.99982 17.2857 5.99982C17.7065 5.99982 18.0476 6.34094 18.0476 6.76172V9.914C18.0476 13.0731 15.8825 15.7152 12.9409 16.6319C12.5392 16.7572 12.112 16.533 11.9869 16.1313Z", fill: "currentColor" })] }));
|
|
12
12
|
export const ToolbarPlugin = () => {
|
|
@@ -52,12 +52,12 @@ export const ToolbarPlugin = () => {
|
|
|
52
52
|
}, [activeMarks]);
|
|
53
53
|
const otherButtons = useMemo(() => {
|
|
54
54
|
return [
|
|
55
|
-
{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
},
|
|
55
|
+
// {
|
|
56
|
+
// key: "link",
|
|
57
|
+
// icon: <LinkOutlined size={22} />,
|
|
58
|
+
// onPress: () => insertLink(),
|
|
59
|
+
// isActive: activeMarks.includes("link"),
|
|
60
|
+
// },
|
|
61
61
|
{
|
|
62
62
|
key: "quote",
|
|
63
63
|
icon: quoteIcon,
|
|
@@ -14,8 +14,8 @@ const TextMessageItem = (props) => {
|
|
|
14
14
|
if (Object.keys(extendMessageInfo).length > 0 &&
|
|
15
15
|
(extendMessageInfo === null || extendMessageInfo === void 0 ? void 0 : extendMessageInfo.messageInfo)) {
|
|
16
16
|
const htmlContent = ((_b = (_a = extendMessageInfo === null || extendMessageInfo === void 0 ? void 0 : extendMessageInfo.messageInfo) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.content) || "";
|
|
17
|
-
return (_jsx("div", { className: "!text-sm sm:text-base break-words whitespace-pre-line flex-1", dangerouslySetInnerHTML: { __html: htmlContent } }));
|
|
17
|
+
return (_jsx("div", { className: "!text-sm sm:text-base break-words whitespace-pre-line flex-1 break-all", dangerouslySetInnerHTML: { __html: htmlContent } }));
|
|
18
18
|
}
|
|
19
|
-
return (_jsx("span", { className: "!text-sm sm:text-base whitespace-pre-wrap", children: ((_c = message === null || message === void 0 ? void 0 : message.textElem) === null || _c === void 0 ? void 0 : _c.content) || "" }));
|
|
19
|
+
return (_jsx("span", { className: "!text-sm sm:text-base whitespace-pre-wrap break-all", children: ((_c = message === null || message === void 0 ? void 0 : message.textElem) === null || _c === void 0 ? void 0 : _c.content) || "" }));
|
|
20
20
|
};
|
|
21
21
|
export default TextMessageItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EACL,WAAW,IAAI,eAAe,EAE/B,MAAM,yBAAyB,CAAC;AAYjC,UAAU,gBAAgB;IACxB,OAAO,EAAE,eAAe,CAAC;IACzB,WAAW,EAAE,eAAe,EAAE,CAAC;CAChC;AAID,QAAA,MAAM,WAAW,GAAI,0BAA0B,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EACL,WAAW,IAAI,eAAe,EAE/B,MAAM,yBAAyB,CAAC;AAYjC,UAAU,gBAAgB;IACxB,OAAO,EAAE,eAAe,CAAC;IACzB,WAAW,EAAE,eAAe,EAAE,CAAC;CAChC;AAID,QAAA,MAAM,WAAW,GAAI,0BAA0B,gBAAgB,mDA+G9D,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -40,12 +40,10 @@ const MessageItem = ({ message, allMessages }) => {
|
|
|
40
40
|
const prevTimeBreak = !previousMessage ||
|
|
41
41
|
dayjs(message.sendTime).diff(previousMessage.sendTime, "minute") >
|
|
42
42
|
BREAK_TIME;
|
|
43
|
-
const nextTimeBreak = !nextMessage ||
|
|
44
|
-
dayjs(nextMessage.sendTime).diff(message.sendTime, "minute") > BREAK_TIME;
|
|
45
43
|
const showTimeBreak = prevTimeBreak;
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
return (_jsxs("div", { className: "flex flex-col gap-2 py-1 px-3 sm:p x-4", id: `${MSG_ITEM_PREFIX}${message === null || message === void 0 ? void 0 : message.clientMsgID}`, children: [showTimeBreak && (_jsx("div", { className: "flex justify-center", children: _jsx("span", { className: "text-xs text-gray-600 text-center bg-neutral-100 px-2 py-1 rounded-full", children: formatTimestamp(message.sendTime) }) })), _jsx("div", { className: clsx("flex", isMine ? "justify-end" : "justify-start"), children: _jsxs("div", { className: clsx("flex flex-1 items-end gap-2", isMine ? "justify-end" : "justify-start"), children: [!isMine && (_jsx("div", { className: "flex items-center justify-center w-[32px] h-[32px]", children:
|
|
44
|
+
const showSenderAvatar = !nextSameUser;
|
|
45
|
+
const showSenderName = !prevSameUser && !isMine;
|
|
46
|
+
return (_jsxs("div", { className: "flex flex-col gap-2 py-1 px-3 sm:p x-4", id: `${MSG_ITEM_PREFIX}${message === null || message === void 0 ? void 0 : message.clientMsgID}`, children: [showTimeBreak && (_jsx("div", { className: "flex justify-center", children: _jsx("span", { className: "text-xs text-gray-600 text-center bg-neutral-100 px-2 py-1 rounded-full", children: formatTimestamp(message.sendTime) }) })), _jsx("div", { className: clsx("flex", isMine ? "justify-end" : "justify-start"), children: _jsxs("div", { className: clsx("flex flex-1 items-end gap-2", isMine ? "justify-end" : "justify-start"), children: [!isMine && (_jsx("div", { className: "flex items-center justify-center w-[32px] h-[32px]", children: showSenderAvatar && (_jsx(Avatar, { src: message === null || message === void 0 ? void 0 : message.senderFaceUrl, children: ((_b = (_a = message === null || message === void 0 ? void 0 : message.senderNickname) === null || _a === void 0 ? void 0 : _a.charAt) === null || _b === void 0 ? void 0 : _b.call(_a, 0)) || "A" })) })), _jsxs("div", { className: clsx("flex flex-col flex-[0.8]", isMine ? "items-end" : "items-start"), children: [showSenderName && (_jsx("span", { className: "text-xs text-gray-500 mb-1 px-3", children: message === null || message === void 0 ? void 0 : message.senderNickname })), _jsxs("div", { className: clsx("px-3 py-2 rounded-2xl max-w-full break-words flex flex-col flex-1 text-gray-900 gap-1", isMine ? "bg-blue-100" : "bg-white"), id: `${MSG_ITEM_CONTENT_PREFIX}${message === null || message === void 0 ? void 0 : message.clientMsgID}`, children: [(message === null || message === void 0 ? void 0 : message.contentType) === MessageType.MergeMessage ? (_jsxs("div", { children: [(_d = (_c = message === null || message === void 0 ? void 0 : message.mergeElem) === null || _c === void 0 ? void 0 : _c.multiMessage) === null || _d === void 0 ? void 0 : _d.map((item) => {
|
|
49
47
|
return renderMessageByType(item);
|
|
50
48
|
}), (message === null || message === void 0 ? void 0 : message.textElem) && _jsx(TextMessageItem, { message: message })] })) : (renderMessageByType(message)), _jsx("span", { className: clsx("text-xs text-gray-500 text-right text-gray-500"), children: dayjs(message === null || message === void 0 ? void 0 : message.sendTime).format("HH:mm") })] })] })] }) }, message === null || message === void 0 ? void 0 : message.clientMsgID)] }, message === null || message === void 0 ? void 0 : message.clientMsgID));
|
|
51
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeskAssignedSession.d.ts","sourceRoot":"","sources":["../../../src/components/session/DeskAssignedSession.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DeskAssignedSession.d.ts","sourceRoot":"","sources":["../../../src/components/session/DeskAssignedSession.tsx"],"names":[],"mappings":"AAgBA,QAAA,MAAM,mBAAmB,+CA+NxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -2,19 +2,20 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useBoolean } from "ahooks";
|
|
4
4
|
import { Button, Layout, Menu } from "antd";
|
|
5
|
-
import { useMemo } from "react";
|
|
5
|
+
import { useEffect, useMemo } from "react";
|
|
6
6
|
import { useTranslation } from "react-i18next";
|
|
7
|
-
import { SESSION_STATUS_ENUM, TAG_ENUM } from "../../constants";
|
|
8
7
|
import { Icon } from "../icon";
|
|
9
8
|
import { useGetSessionSummary } from "../../hooks/session/useGetSessionSummary";
|
|
10
9
|
import useSessionStore from "../../store/session";
|
|
11
10
|
import clsx from "clsx";
|
|
11
|
+
import { SessionStatus, SessionTag } from "../../types/chat";
|
|
12
|
+
import emitter from "../../utils/events";
|
|
12
13
|
const { Sider } = Layout;
|
|
13
14
|
const DeskAssignedSession = () => {
|
|
14
15
|
const { t } = useTranslation();
|
|
15
16
|
const [collapsed, { toggle }] = useBoolean(false);
|
|
16
17
|
const setFilterSummary = useSessionStore((state) => state.setFilterSummary);
|
|
17
|
-
const { data: sessionSummary } = useGetSessionSummary();
|
|
18
|
+
const { data: sessionSummary, refetch } = useGetSessionSummary();
|
|
18
19
|
const menuItems = useMemo(() => {
|
|
19
20
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
20
21
|
return [
|
|
@@ -25,92 +26,103 @@ const DeskAssignedSession = () => {
|
|
|
25
26
|
children: [
|
|
26
27
|
{
|
|
27
28
|
label: t("unassigned"),
|
|
28
|
-
key:
|
|
29
|
+
key: SessionStatus.UNASSIGNED,
|
|
29
30
|
icon: (_jsx(Icon, { icon: "user-del-o", size: 18, className: "!text-amber-500" })),
|
|
30
31
|
onClick: () => {
|
|
31
32
|
setFilterSummary({
|
|
32
|
-
status:
|
|
33
|
+
status: SessionStatus.UNASSIGNED,
|
|
33
34
|
tag: undefined,
|
|
34
35
|
});
|
|
35
36
|
},
|
|
36
|
-
|
|
37
|
+
itemIcon: !collapsed && (_jsx("span", { className: "text-xs text-gray-500 ", children: ((_b = (_a = sessionSummary === null || sessionSummary === void 0 ? void 0 : sessionSummary.sessionStatuses) === null || _a === void 0 ? void 0 : _a.find((s) => s.type === SessionStatus.UNASSIGNED)) === null || _b === void 0 ? void 0 : _b.count) || "" })),
|
|
37
38
|
},
|
|
38
39
|
{
|
|
39
40
|
label: t("slow_processing"),
|
|
40
|
-
key:
|
|
41
|
+
key: SessionTag.SLOW_PROCESSING,
|
|
41
42
|
icon: (_jsx(Icon, { icon: "warning-square-o", size: 18, className: "!text-red-500" })),
|
|
42
43
|
onClick: () => {
|
|
43
44
|
setFilterSummary({
|
|
44
45
|
status: undefined,
|
|
45
|
-
tag:
|
|
46
|
+
tag: SessionTag.SLOW_PROCESSING,
|
|
46
47
|
});
|
|
47
48
|
},
|
|
48
|
-
|
|
49
|
+
itemIcon: !collapsed && (_jsx("span", { className: "text-xs text-gray-500", children: ((_d = (_c = sessionSummary === null || sessionSummary === void 0 ? void 0 : sessionSummary.tagCounts) === null || _c === void 0 ? void 0 : _c.find((s) => s.type === SessionTag.SLOW_PROCESSING)) === null || _d === void 0 ? void 0 : _d.count) || "" })),
|
|
49
50
|
},
|
|
50
51
|
{
|
|
51
52
|
label: t("waiting_process"),
|
|
52
|
-
key:
|
|
53
|
+
key: SessionStatus.WAITING_PROCESS,
|
|
53
54
|
icon: (_jsx(Icon, { icon: "time-circle-o", size: 18, className: "!text-orange-400" })),
|
|
54
55
|
onClick: () => {
|
|
55
56
|
setFilterSummary({
|
|
56
|
-
status:
|
|
57
|
+
status: SessionStatus.WAITING_PROCESS,
|
|
57
58
|
tag: undefined,
|
|
58
59
|
});
|
|
59
60
|
},
|
|
60
|
-
|
|
61
|
+
itemIcon: !collapsed && (_jsx("span", { className: "text-xs text-gray-500", children: ((_f = (_e = sessionSummary === null || sessionSummary === void 0 ? void 0 : sessionSummary.sessionStatuses) === null || _e === void 0 ? void 0 : _e.find((s) => s.type === SessionStatus.WAITING_PROCESS)) === null || _f === void 0 ? void 0 : _f.count) || "" })),
|
|
61
62
|
},
|
|
62
63
|
{
|
|
63
64
|
label: t("awaiting_reply"),
|
|
64
|
-
key:
|
|
65
|
+
key: SessionTag.AWAITING_REPLY,
|
|
65
66
|
icon: (_jsx(Icon, { icon: "arrow-reply-o", size: 18, className: "!text-purple-500" })),
|
|
66
67
|
onClick: () => {
|
|
67
68
|
setFilterSummary({
|
|
68
69
|
status: undefined,
|
|
69
|
-
tag:
|
|
70
|
+
tag: SessionTag.AWAITING_REPLY,
|
|
70
71
|
});
|
|
71
72
|
},
|
|
72
|
-
|
|
73
|
+
itemIcon: !collapsed && (_jsx("span", { className: "text-xs text-gray-500", children: ((_h = (_g = sessionSummary === null || sessionSummary === void 0 ? void 0 : sessionSummary.tagCounts) === null || _g === void 0 ? void 0 : _g.find((s) => s.type === SessionTag.AWAITING_REPLY)) === null || _h === void 0 ? void 0 : _h.count) || "" })),
|
|
73
74
|
},
|
|
74
75
|
{
|
|
75
76
|
label: t("in_process"),
|
|
76
|
-
key:
|
|
77
|
+
key: SessionStatus.IN_PROCESS,
|
|
77
78
|
icon: _jsx(Icon, { icon: "play-circle-o", size: 18 }),
|
|
78
79
|
onClick: () => {
|
|
79
80
|
setFilterSummary({
|
|
80
|
-
status:
|
|
81
|
+
status: SessionStatus.IN_PROCESS,
|
|
81
82
|
tag: undefined,
|
|
82
83
|
});
|
|
83
84
|
},
|
|
84
|
-
|
|
85
|
+
itemIcon: !collapsed && (_jsx("span", { className: "text-xs text-gray-500", children: ((_k = (_j = sessionSummary === null || sessionSummary === void 0 ? void 0 : sessionSummary.sessionStatuses) === null || _j === void 0 ? void 0 : _j.find((s) => s.type === SessionStatus.IN_PROCESS)) === null || _k === void 0 ? void 0 : _k.count) || "" })),
|
|
85
86
|
},
|
|
86
87
|
{
|
|
87
88
|
label: t("temporarily_paused"),
|
|
88
|
-
key:
|
|
89
|
+
key: SessionTag.TEMPORARILY_PAUSED,
|
|
89
90
|
icon: _jsx(Icon, { icon: "pause-o", size: 18 }),
|
|
90
91
|
onClick: () => {
|
|
91
92
|
setFilterSummary({
|
|
92
93
|
status: undefined,
|
|
93
|
-
tag:
|
|
94
|
+
tag: SessionTag.TEMPORARILY_PAUSED,
|
|
94
95
|
});
|
|
95
96
|
},
|
|
96
|
-
|
|
97
|
+
itemIcon: !collapsed && (_jsx("span", { className: "text-xs text-gray-500", children: ((_m = (_l = sessionSummary === null || sessionSummary === void 0 ? void 0 : sessionSummary.tagCounts) === null || _l === void 0 ? void 0 : _l.find((s) => s.type === SessionTag.TEMPORARILY_PAUSED)) === null || _m === void 0 ? void 0 : _m.count) || "" })),
|
|
97
98
|
},
|
|
98
99
|
],
|
|
99
|
-
|
|
100
|
+
itemIcon: !collapsed && (_jsx("span", { className: "text-xs text-gray-500", children: ((_p = (_o = sessionSummary === null || sessionSummary === void 0 ? void 0 : sessionSummary.sessionStatuses) === null || _o === void 0 ? void 0 : _o.find((s) => s.type === SessionStatus.IN_PROCESS)) === null || _p === void 0 ? void 0 : _p.count) || "" })),
|
|
100
101
|
},
|
|
101
102
|
{
|
|
102
|
-
label:
|
|
103
|
+
label: t("closed_sessions"),
|
|
103
104
|
key: "CLOSED_SESSIONS",
|
|
104
105
|
icon: _jsx(Icon, { icon: "check-square-o", size: 20 }),
|
|
105
106
|
onClick: () => {
|
|
106
107
|
setFilterSummary({
|
|
107
|
-
status:
|
|
108
|
+
status: SessionStatus.COMPLETED,
|
|
108
109
|
tag: undefined,
|
|
109
110
|
});
|
|
110
111
|
},
|
|
112
|
+
itemIcon: !collapsed && (_jsx("span", { className: "text-xs text-gray-500", children: (sessionSummary === null || sessionSummary === void 0 ? void 0 : sessionSummary.completedSessionCount) || "" })),
|
|
111
113
|
},
|
|
112
114
|
];
|
|
113
|
-
}, [sessionSummary]);
|
|
114
|
-
|
|
115
|
+
}, [sessionSummary, t, collapsed]);
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
emitter.on("UPDATE_SESSION", () => {
|
|
118
|
+
refetch();
|
|
119
|
+
});
|
|
120
|
+
return () => {
|
|
121
|
+
emitter.off("UPDATE_SESSION", () => {
|
|
122
|
+
refetch();
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
}, []);
|
|
126
|
+
return (_jsxs(Sider, { collapsible: true, collapsed: collapsed, onCollapse: toggle, width: 220, className: "bg-white h-full border-r border-gray-200", trigger: null, children: [_jsxs("div", { className: clsx("flex items-center p-4 border-b", collapsed ? "justify-center" : "justify-between"), children: [!collapsed && (_jsx("span", { className: "text-md font-semibold flex-1 truncate", children: "Droppii Staging" })), _jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0", onClick: toggle, children: _jsx(Icon, { icon: collapsed ? "angle-right-o" : "angle-left-o", size: 22 }) })] }), _jsx(Menu, { defaultSelectedKeys: [SessionStatus.IN_PROCESS], defaultOpenKeys: ["ACTIVE_SESSIONS"], mode: "inline", items: menuItems, inlineIndent: 12, expandIcon: _jsx("span", { className: "text-xs text-gray-500", children: sessionSummary === null || sessionSummary === void 0 ? void 0 : sessionSummary.activeSessionCount }) })] }));
|
|
115
127
|
};
|
|
116
128
|
export default DeskAssignedSession;
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
export declare const coreWasmPath = "https://droppiistg.blob.core.windows.net/droppii-stg-public/3315964d-11d5-4d27-8af7-d2ec2354994f.wasm";
|
|
2
|
-
export declare const SESSION_STATUS_ENUM: {
|
|
3
|
-
UNASSIGNED: string;
|
|
4
|
-
WAITING_PROCESS: string;
|
|
5
|
-
IN_PROCESS: string;
|
|
6
|
-
COMPLETED: string;
|
|
7
|
-
};
|
|
8
|
-
export declare const TAG_ENUM: {
|
|
9
|
-
NONE: string;
|
|
10
|
-
AWAITING_REPLY: string;
|
|
11
|
-
SLOW_PROCESSING: string;
|
|
12
|
-
TEMPORARILY_PAUSED: string;
|
|
13
|
-
};
|
|
14
2
|
export declare const PAGE_SIZE = 50;
|
|
15
3
|
export declare const MSG_ITEM_PREFIX = "msg-item-";
|
|
16
4
|
export declare const MSG_ITEM_CONTENT_PREFIX = "msg-item-content-";
|
|
5
|
+
export declare const adminUserId = "2c0388c5-787d-453c-830c-603d17b85393";
|
|
17
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,0GACgF,CAAC;AAE1G,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,0GACgF,CAAC;AAE1G,eAAO,MAAM,SAAS,KAAK,CAAC;AAE5B,eAAO,MAAM,eAAe,cAAc,CAAC;AAC3C,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAE3D,eAAO,MAAM,WAAW,yCAAyC,CAAC"}
|
package/dist/constants/index.js
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
export const coreWasmPath = "https://droppiistg.blob.core.windows.net/droppii-stg-public/3315964d-11d5-4d27-8af7-d2ec2354994f.wasm";
|
|
2
|
-
export const SESSION_STATUS_ENUM = {
|
|
3
|
-
UNASSIGNED: "UNASSIGNED",
|
|
4
|
-
WAITING_PROCESS: "WAITING_PROCESS",
|
|
5
|
-
IN_PROCESS: "IN_PROCESS",
|
|
6
|
-
COMPLETED: "COMPLETED",
|
|
7
|
-
};
|
|
8
|
-
export const TAG_ENUM = {
|
|
9
|
-
NONE: "NONE",
|
|
10
|
-
AWAITING_REPLY: "AWAITING_REPLY",
|
|
11
|
-
SLOW_PROCESSING: "SLOW_PROCESSING",
|
|
12
|
-
TEMPORARILY_PAUSED: "TEMPORARILY_PAUSED",
|
|
13
|
-
};
|
|
14
2
|
export const PAGE_SIZE = 50;
|
|
15
3
|
export const MSG_ITEM_PREFIX = "msg-item-";
|
|
16
4
|
export const MSG_ITEM_CONTENT_PREFIX = "msg-item-content-";
|
|
5
|
+
export const adminUserId = "2c0388c5-787d-453c-830c-603d17b85393";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatContext.d.ts","sourceRoot":"","sources":["../../src/context/ChatContext.tsx"],"names":[],"mappings":"AAEA,OAAO,sBAAsB,CAAC;AAG9B,OAAO,EACL,eAAe,EACf,iBAAiB,EAGlB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatContext.d.ts","sourceRoot":"","sources":["../../src/context/ChatContext.tsx"],"names":[],"mappings":"AAEA,OAAO,sBAAsB,CAAC;AAG9B,OAAO,EACL,eAAe,EACf,iBAAiB,EAGlB,MAAM,eAAe,CAAC;AASvB,eAAO,MAAM,WAAW,0CAOtB,CAAC;AAEH,eAAO,MAAM,cAAc,uBAAgC,CAAC;AAE5D,eAAO,MAAM,YAAY,GAAI,sBAAsB,iBAAiB,4CAyDnE,CAAC"}
|
|
@@ -7,6 +7,7 @@ import { DChatSDK } from "../constants/sdk";
|
|
|
7
7
|
import MainLayout from "../layout";
|
|
8
8
|
import useAuthStore from "../store/auth";
|
|
9
9
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
10
|
+
import { ConfigProvider } from "antd";
|
|
10
11
|
const queryClient = new QueryClient();
|
|
11
12
|
export const ChatContext = createContext({
|
|
12
13
|
user: null,
|
|
@@ -56,5 +57,5 @@ export const ChatProvider = ({ children, config }) => {
|
|
|
56
57
|
getSelfUserInfo,
|
|
57
58
|
updateConnectStatus,
|
|
58
59
|
updateSyncStatus,
|
|
59
|
-
}, children: _jsx(QueryClientProvider, { client: queryClient, children: _jsx(MainLayout, { children: children }) }) }));
|
|
60
|
+
}, children: _jsx(ConfigProvider, { getPopupContainer: (triggerNode) => document.body, children: _jsx(QueryClientProvider, { client: queryClient, children: _jsx(MainLayout, { children: children }) }) }) }));
|
|
60
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGlobalEvent.d.ts","sourceRoot":"","sources":["../../../src/hooks/global/useGlobalEvent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useGlobalEvent.d.ts","sourceRoot":"","sources":["../../../src/hooks/global/useGlobalEvent.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,cAAc,YAkP1B,CAAC"}
|