@droppii-org/chat-sdk 0.0.31 → 0.0.33
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/chatBubble/ChatBubble.d.ts.map +1 -1
- package/dist/components/chatBubble/ChatBubble.js +1 -1
- package/dist/components/conversation/ConversationBySessionItem.d.ts +7 -0
- package/dist/components/conversation/ConversationBySessionItem.d.ts.map +1 -0
- package/dist/components/conversation/ConversationBySessionItem.js +97 -0
- package/dist/components/conversation/DeskConversationList.d.ts.map +1 -1
- package/dist/components/conversation/DeskConversationList.js +32 -102
- package/dist/components/mediaCollection/FileCollection.d.ts.map +1 -1
- package/dist/components/mediaCollection/FileCollection.js +3 -5
- package/dist/components/mediaCollection/ImageCollection.d.ts.map +1 -1
- package/dist/components/mediaCollection/ImageCollection.js +21 -7
- package/dist/components/mediaCollection/VideoCollection.d.ts.map +1 -1
- package/dist/components/mediaCollection/VideoCollection.js +2 -5
- package/dist/components/mediaCollection/index.d.ts +2 -1
- package/dist/components/mediaCollection/index.d.ts.map +1 -1
- package/dist/components/mediaCollection/index.js +17 -13
- package/dist/components/message/footer/ToolbarPlugin.d.ts.map +1 -1
- package/dist/components/message/footer/ToolbarPlugin.js +2 -5
- package/dist/components/searchConversation/SearchAll.d.ts +3 -0
- package/dist/components/searchConversation/SearchAll.d.ts.map +1 -0
- package/dist/components/searchConversation/SearchAll.js +8 -0
- package/dist/components/searchConversation/SearchConversationAsMessages.d.ts +3 -0
- package/dist/components/searchConversation/SearchConversationAsMessages.d.ts.map +1 -0
- package/dist/components/searchConversation/SearchConversationAsMessages.js +8 -0
- package/dist/components/searchConversation/SearchConversationAsUsers.d.ts +3 -0
- package/dist/components/searchConversation/SearchConversationAsUsers.d.ts.map +1 -0
- package/dist/components/searchConversation/SearchConversationAsUsers.js +8 -0
- package/dist/components/searchConversation/index.d.ts +8 -0
- package/dist/components/searchConversation/index.d.ts.map +1 -0
- package/dist/components/searchConversation/index.js +38 -0
- package/dist/components/session/DeskAssignedSession.d.ts +3 -0
- package/dist/components/session/DeskAssignedSession.d.ts.map +1 -0
- package/dist/components/session/DeskAssignedSession.js +118 -0
- package/dist/hooks/conversation/useConversation.js +1 -1
- package/dist/hooks/search/useSearchConversation.d.ts +2 -0
- package/dist/hooks/search/useSearchConversation.d.ts.map +1 -0
- package/dist/hooks/search/useSearchConversation.js +1 -0
- package/dist/hooks/session/useGetSessionByTagOrStatus.d.ts +220 -0
- package/dist/hooks/session/useGetSessionByTagOrStatus.d.ts.map +1 -0
- package/dist/hooks/session/useGetSessionByTagOrStatus.js +72 -0
- package/dist/hooks/session/useGetSessionSummary.d.ts +3 -0
- package/dist/hooks/session/useGetSessionSummary.d.ts.map +1 -0
- package/dist/hooks/session/useGetSessionSummary.js +14 -0
- package/dist/hooks/user/useAuth.d.ts.map +1 -1
- package/dist/hooks/user/useAuth.js +14 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -3
- package/dist/locales/vi/common.json +16 -1
- package/dist/screens/chatBubble/index.d.ts.map +1 -1
- package/dist/screens/chatBubble/index.js +16 -7
- package/dist/screens/deskMessage/index.js +2 -2
- package/dist/services/query.d.ts +2 -0
- package/dist/services/query.d.ts.map +1 -1
- package/dist/services/query.js +2 -0
- package/dist/services/routes.d.ts +1 -1
- package/dist/services/routes.js +1 -1
- package/dist/store/conversation.d.ts.map +1 -1
- package/dist/store/conversation.js +12 -11
- package/dist/store/session.d.ts +8 -0
- package/dist/store/session.d.ts.map +1 -0
- package/dist/store/session.js +10 -0
- package/dist/styles/global.css +1 -1
- package/dist/types/dto.d.ts +20 -0
- package/dist/types/dto.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatBubble.d.ts","sourceRoot":"","sources":["../../../src/components/chatBubble/ChatBubble.tsx"],"names":[],"mappings":"AAQA,UAAU,eAAe;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,UAAU,GAAI,eAAe,eAAe,
|
|
1
|
+
{"version":3,"file":"ChatBubble.d.ts","sourceRoot":"","sources":["../../../src/components/chatBubble/ChatBubble.tsx"],"names":[],"mappings":"AAQA,UAAU,eAAe;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,UAAU,GAAI,eAAe,eAAe,4CAmFjD,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -23,7 +23,7 @@ const ChatBubble = ({ className }) => {
|
|
|
23
23
|
body: { padding: 0 },
|
|
24
24
|
}, classNames: {
|
|
25
25
|
wrapper: "!z-[9999]",
|
|
26
|
-
}, width: "100%", children: _jsx(MessageList, { conversationId: selectedConversationId, className: "flex-1", onClose: () => setIsOpen(false) }) })] }));
|
|
26
|
+
}, width: "100%", push: false, children: _jsx(MessageList, { conversationId: selectedConversationId, className: "flex-1", onClose: () => setIsOpen(false) }) })] }));
|
|
27
27
|
}
|
|
28
28
|
return (_jsx(Popover, { placement: "topLeft", trigger: "click", open: isOpen, onOpenChange: setIsOpen, content: _jsx("div", { className: "w-[400px] h-[600px]", children: _jsx(MessageList, { conversationId: selectedConversationId, className: "flex-1", onClose: () => setIsOpen(false) }) }), styles: { body: { padding: 0 } }, children: _jsx(FloatButton, { icon: isOpen ? _jsx(CloseOutlined, {}) : _jsx(MessageOutlined, {}), type: "primary", style: {
|
|
29
29
|
right: 24,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ISessionByStatus } from "../../store/type";
|
|
2
|
+
interface ConversationBySessionItemProps {
|
|
3
|
+
sessionItem: ISessionByStatus;
|
|
4
|
+
}
|
|
5
|
+
declare const ConversationBySessionItem: ({ sessionItem, }: ConversationBySessionItemProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
+
export default ConversationBySessionItem;
|
|
7
|
+
//# sourceMappingURL=ConversationBySessionItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConversationBySessionItem.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/ConversationBySessionItem.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAQpD,UAAU,8BAA8B;IACtC,WAAW,EAAE,gBAAgB,CAAC;CAC/B;AAED,QAAA,MAAM,yBAAyB,GAAI,kBAEhC,8BAA8B,mDAwFhC,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { MessageType } from "@openim/wasm-client-sdk";
|
|
4
|
+
import { useTranslation } from "react-i18next";
|
|
5
|
+
import useConversationStore from "../../store/conversation";
|
|
6
|
+
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
|
7
|
+
import { Avatar, Badge } from "antd";
|
|
8
|
+
import { Icon } from "../icon";
|
|
9
|
+
import { useChatContext } from "../../context/ChatContext";
|
|
10
|
+
import { useConversationDisplayData } from "../../hooks/conversation/useConversation";
|
|
11
|
+
const ConversationBySessionItem = ({ sessionItem, }) => {
|
|
12
|
+
const { t } = useTranslation();
|
|
13
|
+
const { user } = useChatContext();
|
|
14
|
+
const conversation = useConversationStore((state) => state.conversationList.find((conv) => conv.conversationID === sessionItem.conversationId));
|
|
15
|
+
const isSelected = useConversationStore((state) => state.selectedConversationId === sessionItem.conversationId);
|
|
16
|
+
const router = useRouter();
|
|
17
|
+
const pathname = usePathname();
|
|
18
|
+
const searchParams = useSearchParams();
|
|
19
|
+
const setConversationData = useConversationStore((state) => state.setConversationData);
|
|
20
|
+
const setSelectedConversationId = useConversationStore((state) => state.setSelectedConversationId);
|
|
21
|
+
const handleConversationClick = (conversation) => {
|
|
22
|
+
setConversationData(conversation);
|
|
23
|
+
const newSearchParams = new URLSearchParams(searchParams);
|
|
24
|
+
newSearchParams.set("threadId", conversation.conversationID);
|
|
25
|
+
router.push(`${pathname}?${newSearchParams.toString()}`);
|
|
26
|
+
setSelectedConversationId(conversation.conversationID);
|
|
27
|
+
};
|
|
28
|
+
if (!conversation)
|
|
29
|
+
return null;
|
|
30
|
+
const { avatar, displayName = "" } = useConversationDisplayData(conversation);
|
|
31
|
+
return (_jsxs("div", { onClick: () => handleConversationClick(conversation), className: `relative p-3 border-b border-gray-100 hover:bg-gray-50 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, alt: displayName, children: displayName.charAt(0).toUpperCase() }) }) }), _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) })] }), _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) }), _jsx("div", { className: "flex items-center gap-1", children: conversation.unreadCount > 0 && (_jsx(Badge, { count: conversation.unreadCount })) })] })] }) })] })] }, conversation.conversationID));
|
|
32
|
+
};
|
|
33
|
+
export default ConversationBySessionItem;
|
|
34
|
+
const parseLatestMessage = (latestMsg, currentUserId) => {
|
|
35
|
+
var _a;
|
|
36
|
+
if (!latestMsg)
|
|
37
|
+
return "";
|
|
38
|
+
try {
|
|
39
|
+
const msgData = JSON.parse(latestMsg);
|
|
40
|
+
const contentType = msgData === null || msgData === void 0 ? void 0 : msgData.contentType;
|
|
41
|
+
const isMe = currentUserId && msgData.sendID === currentUserId;
|
|
42
|
+
const sender = isMe ? "Me" : (msgData === null || msgData === void 0 ? void 0 : msgData.senderNickname) || msgData.sendID;
|
|
43
|
+
switch (contentType) {
|
|
44
|
+
case MessageType.TextMessage:
|
|
45
|
+
if ((_a = msgData.textElem) === null || _a === void 0 ? void 0 : _a.content) {
|
|
46
|
+
return `${sender}: ${msgData.textElem.content}`;
|
|
47
|
+
}
|
|
48
|
+
break;
|
|
49
|
+
case MessageType.PictureMessage:
|
|
50
|
+
return (_jsxs("span", { children: [sender, ": ", _jsx(Icon, { icon: "image-o", size: 16, className: "mr-1" }), "H\u00ECnh \u1EA3nh"] }));
|
|
51
|
+
case MessageType.VoiceMessage:
|
|
52
|
+
return `${sender}: [Tin nhắn thoại]`;
|
|
53
|
+
case MessageType.VideoMessage:
|
|
54
|
+
return `${sender}: [Video]`;
|
|
55
|
+
case MessageType.FileMessage:
|
|
56
|
+
return `${sender}: [File đính kèm]`;
|
|
57
|
+
default:
|
|
58
|
+
return "Tin nhắn không khả dụng";
|
|
59
|
+
}
|
|
60
|
+
return "Tin nhắn không khả dụng";
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
console.error("Error parsing latest message:", error);
|
|
64
|
+
return "";
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const formatTimestamp = (timestamp) => {
|
|
68
|
+
if (!timestamp)
|
|
69
|
+
return "";
|
|
70
|
+
const date = new Date(timestamp);
|
|
71
|
+
const now = new Date();
|
|
72
|
+
const diffInMs = now.getTime() - date.getTime();
|
|
73
|
+
const diffInDays = Math.floor(diffInMs / (1000 * 60 * 60 * 24));
|
|
74
|
+
if (diffInDays === 0) {
|
|
75
|
+
// Today - show time
|
|
76
|
+
return date.toLocaleTimeString("vi-VN", {
|
|
77
|
+
hour: "2-digit",
|
|
78
|
+
minute: "2-digit",
|
|
79
|
+
hour12: false,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
else if (diffInDays === 1) {
|
|
83
|
+
// Yesterday
|
|
84
|
+
return "Hôm qua";
|
|
85
|
+
}
|
|
86
|
+
else if (diffInDays < 7) {
|
|
87
|
+
// This week - show day name
|
|
88
|
+
return date.toLocaleDateString("vi-VN", { weekday: "long" });
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
// Older - show date
|
|
92
|
+
return date.toLocaleDateString("vi-VN", {
|
|
93
|
+
day: "2-digit",
|
|
94
|
+
month: "2-digit",
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
};
|
|
@@ -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":"AAeA,QAAA,MAAM,oBAAoB,+CAkJzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,127 +1,57 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useState, useEffect,
|
|
3
|
+
import { useState, useEffect, useRef } from "react";
|
|
4
4
|
import { useRouter, useSearchParams, usePathname } from "next/navigation";
|
|
5
|
-
import { Input, Empty } from "antd";
|
|
6
|
-
import { MessageType } from "@openim/wasm-client-sdk";
|
|
5
|
+
import { Input, Empty, Drawer, Button, Spin } from "antd";
|
|
7
6
|
import { Icon } from "../icon";
|
|
8
|
-
import { useChatContext } from "../../context/ChatContext";
|
|
9
7
|
import useConversationStore from "../../store/conversation";
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const msgData = JSON.parse(latestMsg);
|
|
18
|
-
const contentType = msgData === null || msgData === void 0 ? void 0 : msgData.contentType;
|
|
19
|
-
const isMe = currentUserId && msgData.sendID === currentUserId;
|
|
20
|
-
const sender = isMe ? "Me" : (msgData === null || msgData === void 0 ? void 0 : msgData.senderNickname) || msgData.sendID;
|
|
21
|
-
switch (contentType) {
|
|
22
|
-
case MessageType.TextMessage:
|
|
23
|
-
if ((_a = msgData.textElem) === null || _a === void 0 ? void 0 : _a.content) {
|
|
24
|
-
return `${sender}: ${msgData.textElem.content}`;
|
|
25
|
-
}
|
|
26
|
-
break;
|
|
27
|
-
case MessageType.PictureMessage:
|
|
28
|
-
return (_jsxs("span", { children: [sender, ": ", _jsx(Icon, { icon: "image-b", size: 16, className: "mr-1" }), "H\u00ECnh \u1EA3nh"] }));
|
|
29
|
-
case MessageType.VoiceMessage:
|
|
30
|
-
return `${sender}: [Tin nhắn thoại]`;
|
|
31
|
-
case MessageType.VideoMessage:
|
|
32
|
-
return `${sender}: [Video]`;
|
|
33
|
-
case MessageType.FileMessage:
|
|
34
|
-
return `${sender}: [File đính kèm]`;
|
|
35
|
-
default:
|
|
36
|
-
return "Tin nhắn không khả dụng";
|
|
37
|
-
}
|
|
38
|
-
return "Tin nhắn không khả dụng";
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
console.error("Error parsing latest message:", error);
|
|
42
|
-
return "";
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
// Utility function to format timestamp
|
|
46
|
-
const formatTimestamp = (timestamp) => {
|
|
47
|
-
if (!timestamp)
|
|
48
|
-
return "";
|
|
49
|
-
const date = new Date(timestamp);
|
|
50
|
-
const now = new Date();
|
|
51
|
-
const diffInMs = now.getTime() - date.getTime();
|
|
52
|
-
const diffInDays = Math.floor(diffInMs / (1000 * 60 * 60 * 24));
|
|
53
|
-
if (diffInDays === 0) {
|
|
54
|
-
// Today - show time
|
|
55
|
-
return date.toLocaleTimeString("vi-VN", {
|
|
56
|
-
hour: "2-digit",
|
|
57
|
-
minute: "2-digit",
|
|
58
|
-
hour12: false,
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
else if (diffInDays === 1) {
|
|
62
|
-
// Yesterday
|
|
63
|
-
return "Hôm qua";
|
|
64
|
-
}
|
|
65
|
-
else if (diffInDays < 7) {
|
|
66
|
-
// This week - show day name
|
|
67
|
-
return date.toLocaleDateString("vi-VN", { weekday: "long" });
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
// Older - show date
|
|
71
|
-
return date.toLocaleDateString("vi-VN", {
|
|
72
|
-
day: "2-digit",
|
|
73
|
-
month: "2-digit",
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
// Transform API data to UI-friendly format
|
|
78
|
-
const transformConversationData = (apiData, currentUserId) => {
|
|
79
|
-
return apiData.map((conv) => (Object.assign(Object.assign({}, conv), { id: conv.conversationID, threadId: conv.conversationID, name: conv.showName || "Unknown User", username: conv.userID || conv.groupID || "", avatar: conv.faceURL || "", lastMessage: parseLatestMessage(conv.latestMsg, currentUserId), timestamp: formatTimestamp(conv.latestMsgSendTime), unreadCount: conv.unreadCount })));
|
|
80
|
-
};
|
|
8
|
+
import { useTranslation } from "react-i18next";
|
|
9
|
+
import { useBoolean, useDebounceFn } from "ahooks";
|
|
10
|
+
import SearchConversation from "../searchConversation";
|
|
11
|
+
import useSessionStore from "../../store/session";
|
|
12
|
+
import { useGetSessionByTagOrStatus } from "../../hooks/session/useGetSessionByTagOrStatus";
|
|
13
|
+
import InfiniteScroll from "react-infinite-scroll-component";
|
|
14
|
+
import ConversationBySessionItem from "./ConversationBySessionItem";
|
|
81
15
|
const DeskConversationList = () => {
|
|
82
|
-
const
|
|
83
|
-
const
|
|
16
|
+
const searchInputRef = useRef(null);
|
|
17
|
+
const { t } = useTranslation();
|
|
18
|
+
const [search, setSearch] = useState("");
|
|
19
|
+
const [showSearch, { setTrue: setShowSearchTrue, setFalse: setShowSearchFalse },] = useBoolean(false);
|
|
84
20
|
const router = useRouter();
|
|
85
21
|
const pathname = usePathname();
|
|
86
22
|
const searchParams = useSearchParams();
|
|
87
|
-
const { user } = useChatContext();
|
|
88
23
|
const setConversationData = useConversationStore((state) => state.setConversationData);
|
|
89
|
-
const selectedConversationId = useConversationStore((state) => state.selectedConversationId);
|
|
90
24
|
const setSelectedConversationId = useConversationStore((state) => state.setSelectedConversationId);
|
|
91
25
|
const conversationList = useConversationStore((state) => state.conversationList);
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}, [conversationList, conversationIdFromSession, user === null || user === void 0 ? void 0 : user.userID]);
|
|
98
|
-
useEffect(() => {
|
|
99
|
-
const conversationIds = assignedSessionList.map((session) => session.conversationId);
|
|
100
|
-
DChatSDK.getMultipleConversation(conversationIds).then(({ data }) => {
|
|
101
|
-
const extractConversationIDs = data.map((conv) => conv.conversationID);
|
|
102
|
-
setConversationIdFromSession(extractConversationIDs);
|
|
103
|
-
});
|
|
104
|
-
}, [assignedSessionList]);
|
|
105
|
-
console.log({ assignedSessionList });
|
|
26
|
+
const filterSummary = useSessionStore((state) => state.filterSummary);
|
|
27
|
+
const { dataFlatten: sessions, isLoading, error, hasNextPage, fetchNextPage, isFetchingNextPage, } = useGetSessionByTagOrStatus(filterSummary);
|
|
28
|
+
const { run: deboundSearch } = useDebounceFn((value) => {
|
|
29
|
+
setSearch(value);
|
|
30
|
+
}, { wait: 500 });
|
|
106
31
|
useEffect(() => {
|
|
107
32
|
const threadId = searchParams.get("threadId");
|
|
108
33
|
if (threadId) {
|
|
109
34
|
setSelectedConversationId(threadId);
|
|
110
|
-
const selectedConversation =
|
|
35
|
+
const selectedConversation = conversationList.find((conv) => conv.conversationID === threadId);
|
|
111
36
|
if (selectedConversation) {
|
|
112
37
|
setConversationData(selectedConversation);
|
|
113
38
|
}
|
|
114
39
|
}
|
|
115
|
-
else if (
|
|
116
|
-
setSelectedConversationId(
|
|
117
|
-
setConversationData(
|
|
40
|
+
else if (conversationList.length > 0) {
|
|
41
|
+
setSelectedConversationId(conversationList[0].conversationID);
|
|
42
|
+
setConversationData(conversationList[0]);
|
|
118
43
|
const newSearchParams = new URLSearchParams(searchParams);
|
|
119
|
-
newSearchParams.set("threadId",
|
|
44
|
+
newSearchParams.set("threadId", conversationList[0].conversationID);
|
|
120
45
|
router.replace(`${pathname}?${newSearchParams.toString()}`);
|
|
121
46
|
}
|
|
122
|
-
}, [searchParams,
|
|
123
|
-
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-
|
|
124
|
-
|
|
125
|
-
|
|
47
|
+
}, [searchParams, conversationList]);
|
|
48
|
+
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) => deboundSearch(e.target.value), className: "rounded-lg text-sm flex-1 h-[36px]", size: "large", allowClear: true, onClick: setShowSearchTrue }), showSearch && (_jsx(Button, { onClick: setShowSearchFalse, variant: "outlined", className: "p-0 w-[36px] h-[36px] text-gray-500", children: _jsx(Icon, { icon: "close-b", size: 22 }) }))] }) }), _jsx("div", { id: "scrollableDiv", style: {
|
|
49
|
+
height: "100%",
|
|
50
|
+
overflow: "auto",
|
|
51
|
+
}, children: _jsxs(InfiniteScroll, { dataLength: (sessions === null || sessions === void 0 ? void 0 : sessions.length) || 0, next: fetchNextPage, hasMore: hasNextPage, loader: _jsx("div", { className: "flex items-center justify-center py-2", children: _jsx(Spin, {}) }), scrollableTarget: "scrollableDiv", children: [(sessions === null || sessions === void 0 ? void 0 : sessions.length) === 0 && (_jsx("div", { className: "flex items-center justify-center py-12", children: _jsx(Empty, { image: _jsx(Icon, { icon: "chat-square-b", size: 80, className: "text-gray-300" }), description: t("no_conversation") }) })), sessions === null || sessions === void 0 ? void 0 : sessions.map((session) => (_jsx(ConversationBySessionItem, { sessionItem: session }, session.conversationId)))] }) }), _jsx(Drawer, { open: showSearch, mask: false, closeIcon: false, styles: {
|
|
52
|
+
body: {
|
|
53
|
+
padding: 0,
|
|
54
|
+
},
|
|
55
|
+
}, getContainer: false, width: "100%", children: _jsx(SearchConversation, {}) })] }));
|
|
126
56
|
};
|
|
127
57
|
export default DeskConversationList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileCollection.d.ts","sourceRoot":"","sources":["../../../src/components/mediaCollection/FileCollection.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FileCollection.d.ts","sourceRoot":"","sources":["../../../src/components/mediaCollection/FileCollection.tsx"],"names":[],"mappings":"AAcA,QAAA,MAAM,cAAc,+CA4GnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -10,6 +10,7 @@ import { useTranslation } from "react-i18next";
|
|
|
10
10
|
import { documentIcon } from "../../assets/svg";
|
|
11
11
|
import { shortenFileName } from "../message/footer/FilePreview";
|
|
12
12
|
import { renderFileSize } from "../../utils/common";
|
|
13
|
+
import { TOP_OFFSET } from ".";
|
|
13
14
|
const FileCollection = () => {
|
|
14
15
|
const { t } = useTranslation();
|
|
15
16
|
const selectedSourceId = useConversationStore((state) => state.selectedSourceId);
|
|
@@ -34,7 +35,7 @@ const FileCollection = () => {
|
|
|
34
35
|
link.remove();
|
|
35
36
|
};
|
|
36
37
|
const renderItem = useCallback((date, items) => {
|
|
37
|
-
return (_jsxs("div", { className: "px-3", children: [_jsx("span", { className: "text-sm font-medium text-gray-500", children: dayjs(date).format("DD
|
|
38
|
+
return (_jsxs("div", { className: "px-3", children: [_jsx("span", { className: "text-sm font-medium text-gray-500", children: dayjs(date).format("DD MMMM, YYYY") }), _jsx("div", { className: "flex flex-col gap-1 mt-2", children: items.map((item) => {
|
|
38
39
|
var _a, _b, _c;
|
|
39
40
|
const fileContent = JSON.parse(((_a = item === null || item === void 0 ? void 0 : item.chatLog) === null || _a === void 0 ? void 0 : _a.content) || "{}");
|
|
40
41
|
return (_jsxs("div", { className: "relative flex flex-row items-center gap-2 align-center bg-gray-100 rounded-md p-2 cursor-pointer", onClick: () => handleDownload((fileContent === null || fileContent === void 0 ? void 0 : fileContent.sourceUrl) || "", (fileContent === null || fileContent === void 0 ? void 0 : fileContent.fileName) || ""), children: [documentIcon, _jsxs("div", { className: "flex flex-col flex-1", children: [_jsx("span", { className: "text-sm font-medium", children: shortenFileName((fileContent === null || fileContent === void 0 ? void 0 : fileContent.fileName) || "", {
|
|
@@ -46,9 +47,6 @@ const FileCollection = () => {
|
|
|
46
47
|
return _jsx(Empty, { description: t("no_media_files") });
|
|
47
48
|
if (isLoading)
|
|
48
49
|
return (_jsx("div", { className: "flex items-center justify-center", children: _jsx(Spin, {}) }));
|
|
49
|
-
return (_jsx("div", { id: "scrollableFileDiv", style: {
|
|
50
|
-
height: "100%",
|
|
51
|
-
overflow: "auto",
|
|
52
|
-
}, children: _jsx(InfiniteScroll, { dataLength: Object.keys(groupedData).length, next: fetchNextPage, hasMore: hasNextPage, loader: _jsx("div", { className: "flex items-center justify-center py-2", children: _jsx(Spin, {}) }), scrollableTarget: "scrollableFileDiv", children: Object.entries(groupedData).map(([date, items]) => renderItem(date, items)) }) }));
|
|
50
|
+
return (_jsx("div", { id: "scrollableFileDiv", className: "h-full overflow-auto", style: { maxHeight: `calc(100vh - ${TOP_OFFSET}px)` }, children: _jsx(InfiniteScroll, { dataLength: Object.keys(groupedData).length, next: fetchNextPage, hasMore: hasNextPage, loader: _jsx("div", { className: "flex items-center justify-center py-2", children: _jsx(Spin, {}) }), scrollableTarget: "scrollableFileDiv", children: Object.entries(groupedData).map(([date, items]) => renderItem(date, items)) }) }));
|
|
53
51
|
};
|
|
54
52
|
export default FileCollection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageCollection.d.ts","sourceRoot":"","sources":["../../../src/components/mediaCollection/ImageCollection.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ImageCollection.d.ts","sourceRoot":"","sources":["../../../src/components/mediaCollection/ImageCollection.tsx"],"names":[],"mappings":"AAaA,QAAA,MAAM,eAAe,+CAoHpB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -2,12 +2,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { MessageType } from "@openim/wasm-client-sdk";
|
|
3
3
|
import { useMediaCollection } from "../../hooks/collection/useMediaCollection";
|
|
4
4
|
import InfiniteScroll from "react-infinite-scroll-component";
|
|
5
|
-
import { Empty, Image, Spin } from "antd";
|
|
5
|
+
import { Button, Empty, Image, Spin } from "antd";
|
|
6
6
|
import { useCallback } from "react";
|
|
7
7
|
import dayjs from "dayjs";
|
|
8
8
|
import useConversationStore from "../../store/conversation";
|
|
9
9
|
import { images } from "../../constants/images";
|
|
10
10
|
import { useTranslation } from "react-i18next";
|
|
11
|
+
import { TOP_OFFSET } from ".";
|
|
12
|
+
import { DownloadOutlined } from "@ant-design/icons";
|
|
11
13
|
const ImageCollection = () => {
|
|
12
14
|
const { t } = useTranslation();
|
|
13
15
|
const selectedSourceId = useConversationStore((state) => state.selectedSourceId);
|
|
@@ -15,8 +17,18 @@ const ImageCollection = () => {
|
|
|
15
17
|
recvID: selectedSourceId,
|
|
16
18
|
contentType: MessageType.PictureMessage,
|
|
17
19
|
});
|
|
20
|
+
const handleDownload = (imageUrl) => {
|
|
21
|
+
if (!imageUrl)
|
|
22
|
+
return;
|
|
23
|
+
const link = document.createElement("a");
|
|
24
|
+
link.href = imageUrl;
|
|
25
|
+
link.download = imageUrl.substring(imageUrl.lastIndexOf("/") + 1);
|
|
26
|
+
document.body.appendChild(link);
|
|
27
|
+
link.click();
|
|
28
|
+
document.body.removeChild(link);
|
|
29
|
+
};
|
|
18
30
|
const renderItem = useCallback((date, items) => {
|
|
19
|
-
return (_jsxs("div", { className: "mb-2", children: [_jsx("span", { className: "text-sm font-medium text-gray-500 px-3", children: dayjs(date).format("DD
|
|
31
|
+
return (_jsxs("div", { className: "mb-2", children: [_jsx("span", { className: "text-sm font-medium text-gray-500 px-3", children: dayjs(date).format("DD MMMM, YYYY") }), _jsx("div", { className: "grid grid-cols-3 justify-start gap-px py-2", children: items.map((item) => {
|
|
20
32
|
var _a, _b, _c, _d;
|
|
21
33
|
const imageContent = JSON.parse(((_a = item === null || item === void 0 ? void 0 : item.chatLog) === null || _a === void 0 ? void 0 : _a.content) || "{}");
|
|
22
34
|
const sourceUrl = ((_b = imageContent.sourcePicture) === null || _b === void 0 ? void 0 : _b.url) ||
|
|
@@ -28,10 +40,12 @@ const ImageCollection = () => {
|
|
|
28
40
|
return _jsx(Empty, { description: t("no_media_files") });
|
|
29
41
|
if (isLoading)
|
|
30
42
|
return (_jsx("div", { className: "flex items-center justify-center", children: _jsx(Spin, {}) }));
|
|
31
|
-
return (_jsx("div", { id: "scrollableImageDiv", style: {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
43
|
+
return (_jsx("div", { id: "scrollableImageDiv", className: "h-full overflow-auto", style: { maxHeight: `calc(100vh - ${TOP_OFFSET}px)` }, children: _jsx(Image.PreviewGroup, { preview: {
|
|
44
|
+
toolbarRender: (originalNode, info) => {
|
|
45
|
+
var _a;
|
|
46
|
+
const imageUrl = (_a = info === null || info === void 0 ? void 0 : info.image) === null || _a === void 0 ? void 0 : _a.url;
|
|
47
|
+
return (_jsxs("div", { className: "flex flex-col justify-center gap-2", children: [originalNode, imageUrl && (_jsx(Button, { type: "primary", icon: _jsx(DownloadOutlined, {}), className: "self-center", onClick: () => handleDownload(imageUrl), children: t("download") }))] }));
|
|
48
|
+
},
|
|
49
|
+
}, children: _jsx(InfiniteScroll, { dataLength: dataFlatten.length, next: fetchNextPage, hasMore: hasNextPage, loader: _jsx("div", { className: "flex items-center justify-center py-2", children: _jsx(Spin, {}) }), scrollableTarget: "scrollableImageDiv", children: Object.entries(groupedData).map(([date, items]) => renderItem(date, items)) }) }) }));
|
|
36
50
|
};
|
|
37
51
|
export default ImageCollection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoCollection.d.ts","sourceRoot":"","sources":["../../../src/components/mediaCollection/VideoCollection.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VideoCollection.d.ts","sourceRoot":"","sources":["../../../src/components/mediaCollection/VideoCollection.tsx"],"names":[],"mappings":"AAcA,QAAA,MAAM,eAAe,+CA8HpB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -10,6 +10,7 @@ import { useBoolean } from "ahooks";
|
|
|
10
10
|
import { images } from "../../constants/images";
|
|
11
11
|
import { Icon } from "../icon";
|
|
12
12
|
import { useTranslation } from "react-i18next";
|
|
13
|
+
import { TOP_OFFSET } from ".";
|
|
13
14
|
const VideoCollection = () => {
|
|
14
15
|
const { t } = useTranslation();
|
|
15
16
|
const selectedSourceId = useConversationStore((state) => state.selectedSourceId);
|
|
@@ -35,11 +36,7 @@ const VideoCollection = () => {
|
|
|
35
36
|
return _jsx(Empty, { description: t("no_media_files") });
|
|
36
37
|
if (isLoading)
|
|
37
38
|
return (_jsx("div", { className: "flex items-center justify-center", children: _jsx(Spin, {}) }));
|
|
38
|
-
return (_jsxs("div", { id: "scrollableVideoDiv", style: {
|
|
39
|
-
height: "100%",
|
|
40
|
-
overflow: "auto",
|
|
41
|
-
display: "flex",
|
|
42
|
-
}, children: [_jsx(InfiniteScroll, { dataLength: Object.keys(groupedData).length, next: fetchNextPage, hasMore: hasNextPage, loader: _jsx("div", { className: "flex items-center justify-center py-2", children: _jsx(Spin, {}) }), scrollableTarget: "scrollableVideoDiv", children: Object.entries(groupedData).map(([date, items]) => renderItem(date, items)) }), _jsx(Modal, { open: open, onCancel: setFalse, footer: null, centered: true, styles: {
|
|
39
|
+
return (_jsxs("div", { id: "scrollableVideoDiv", className: "h-full overflow-auto", style: { maxHeight: `calc(100vh - ${TOP_OFFSET}px)` }, children: [_jsx(InfiniteScroll, { dataLength: Object.keys(groupedData).length, next: fetchNextPage, hasMore: hasNextPage, loader: _jsx("div", { className: "flex items-center justify-center py-2", children: _jsx(Spin, {}) }), scrollableTarget: "scrollableVideoDiv", children: Object.entries(groupedData).map(([date, items]) => renderItem(date, items)) }), _jsx(Modal, { open: open, onCancel: setFalse, footer: null, centered: true, styles: {
|
|
43
40
|
content: {
|
|
44
41
|
padding: 0,
|
|
45
42
|
},
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export declare enum
|
|
1
|
+
export declare enum MediaCollectionTabKey {
|
|
2
2
|
Image = "image",
|
|
3
3
|
Video = "video",
|
|
4
4
|
File = "file",
|
|
5
5
|
Link = "link"
|
|
6
6
|
}
|
|
7
|
+
export declare const TOP_OFFSET = 128;
|
|
7
8
|
declare const MediaCollection: () => import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export default MediaCollection;
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/mediaCollection/index.tsx"],"names":[],"mappings":"AAaA,oBAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/mediaCollection/index.tsx"],"names":[],"mappings":"AAaA,oBAAY,qBAAqB;IAC/B,KAAK,UAAU;IACf,KAAK,UAAU;IACf,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,eAAO,MAAM,UAAU,MAAM,CAAC;AAE9B,QAAA,MAAM,eAAe,+CA8EpB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -10,45 +10,49 @@ import { useIsMobile } from "../../hooks/common/useIsMobile";
|
|
|
10
10
|
import { useMemo } from "react";
|
|
11
11
|
import FileCollection from "./FileCollection";
|
|
12
12
|
import LinkCollection from "./LinkCollection";
|
|
13
|
-
export var
|
|
14
|
-
(function (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
})(
|
|
13
|
+
export var MediaCollectionTabKey;
|
|
14
|
+
(function (MediaCollectionTabKey) {
|
|
15
|
+
MediaCollectionTabKey["Image"] = "image";
|
|
16
|
+
MediaCollectionTabKey["Video"] = "video";
|
|
17
|
+
MediaCollectionTabKey["File"] = "file";
|
|
18
|
+
MediaCollectionTabKey["Link"] = "link";
|
|
19
|
+
})(MediaCollectionTabKey || (MediaCollectionTabKey = {}));
|
|
20
|
+
export const TOP_OFFSET = 128; /// HEADER + TAB HEIGHT
|
|
20
21
|
const MediaCollection = () => {
|
|
21
22
|
const { t } = useTranslation();
|
|
22
23
|
const [isOpen, { toggle }] = useBoolean(false);
|
|
23
24
|
const isMobile = useIsMobile();
|
|
24
25
|
const items = useMemo(() => {
|
|
26
|
+
if (!isOpen)
|
|
27
|
+
return [];
|
|
25
28
|
return [
|
|
26
29
|
{
|
|
27
|
-
key:
|
|
30
|
+
key: MediaCollectionTabKey.Image,
|
|
28
31
|
label: "Ảnh",
|
|
29
32
|
children: _jsx(ImageCollection, {}),
|
|
30
33
|
},
|
|
31
34
|
{
|
|
32
|
-
key:
|
|
35
|
+
key: MediaCollectionTabKey.Video,
|
|
33
36
|
label: "Video",
|
|
34
37
|
children: _jsx(VideoCollection, {}),
|
|
35
38
|
},
|
|
36
39
|
{
|
|
37
|
-
key:
|
|
40
|
+
key: MediaCollectionTabKey.File,
|
|
38
41
|
label: "Tập tin",
|
|
39
42
|
children: _jsx(FileCollection, {}),
|
|
40
43
|
},
|
|
41
44
|
{
|
|
42
|
-
key:
|
|
45
|
+
key: MediaCollectionTabKey.Link,
|
|
43
46
|
label: "Liên kết",
|
|
44
47
|
children: _jsx(LinkCollection, {}),
|
|
45
48
|
},
|
|
46
49
|
];
|
|
47
|
-
}, []);
|
|
50
|
+
}, [isOpen]);
|
|
48
51
|
return (_jsxs(_Fragment, { children: [_jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0", onClick: toggle, children: _jsx(Icon, { icon: "folder-o", size: 22 }) }), _jsx(Drawer, { open: isOpen, onClose: toggle, mask: false, closeIcon: false, styles: {
|
|
49
52
|
body: {
|
|
50
53
|
padding: 0,
|
|
54
|
+
height: "100%",
|
|
51
55
|
},
|
|
52
|
-
}, getContainer: false, width: isMobile ? "100%" : 360, children: _jsxs("div", { children: [_jsxs("div", { className: "flex items-center justify-between p-3", children: [_jsx("span", { className: "text-lg font-medium", children: t("library") }), _jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0", onClick: toggle, children: _jsx(Icon, { icon: "close-b", size: 22 }) })] }), _jsx(Tabs, { defaultActiveKey:
|
|
56
|
+
}, getContainer: false, width: isMobile ? "100%" : 360, children: _jsxs("div", { className: "flex flex-col h-full", children: [_jsxs("div", { className: "flex items-center justify-between p-3", children: [_jsx("span", { className: "text-lg font-medium", children: t("library") }), _jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0", onClick: toggle, children: _jsx(Icon, { icon: "close-b", size: 22 }) })] }), _jsx("div", { className: "flex-1 overflow-hidden", children: _jsx(Tabs, { defaultActiveKey: MediaCollectionTabKey.Image, items: items, className: "h-full" }) })] }) })] }));
|
|
53
57
|
};
|
|
54
58
|
export default MediaCollection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarPlugin.d.ts","sourceRoot":"","sources":["../../../../src/components/message/footer/ToolbarPlugin.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ToolbarPlugin.d.ts","sourceRoot":"","sources":["../../../../src/components/message/footer/ToolbarPlugin.tsx"],"names":[],"mappings":"AA4DA,eAAO,MAAM,aAAa,+CAwNzB,CAAC"}
|
|
@@ -9,7 +9,6 @@ import { useCallback, useEffect, useMemo, useState } from "react";
|
|
|
9
9
|
import { BoldOutlined, ItalicOutlined, StrikethroughOutlined, OrderedListOutlined, UnorderedListOutlined, LinkOutlined, } 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
|
-
const codeIcon = (_jsxs("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M6.41925 6.07724C6.74925 6.40268 6.74925 6.93031 6.41925 7.25575L3.63676 9.99983L6.41925 12.7439C6.74925 13.0693 6.74925 13.597 6.41925 13.9224C6.08926 14.2479 5.55424 14.2479 5.22424 13.9224L1.96374 10.7069C1.56775 10.3164 1.56775 9.68325 1.96374 9.29272L5.22424 6.07724C5.55424 5.7518 6.08926 5.7518 6.41925 6.07724Z", fill: "currentColor" }), _jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M13.5809 6.07724C13.2509 6.40268 13.2509 6.93031 13.5809 7.25575L16.3634 9.99983L13.5809 12.7439C13.2509 13.0693 13.2509 13.597 13.5809 13.9224C13.9109 14.2479 14.4459 14.2479 14.7759 13.9224L18.0364 10.7069C18.4324 10.3164 18.4324 9.68325 18.0364 9.29272L14.7759 6.07724C14.4459 5.7518 13.9109 5.7518 13.5809 6.07724Z", fill: "currentColor" }), _jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M11.8957 3.36522C12.3382 3.49166 12.5945 3.9529 12.468 4.39543L9.13468 16.0621C9.00825 16.5046 8.54701 16.7609 8.10448 16.6344C7.66195 16.508 7.40571 16.0468 7.53214 15.6042L10.8655 3.93756C10.9919 3.49503 11.4532 3.23879 11.8957 3.36522Z", fill: "currentColor" })] }));
|
|
13
12
|
export const ToolbarPlugin = () => {
|
|
14
13
|
const [editor] = useLexicalComposerContext();
|
|
15
14
|
const [activeMarks, setActiveMarks] = useState([]);
|
|
@@ -121,10 +120,8 @@ export const ToolbarPlugin = () => {
|
|
|
121
120
|
marks.push("bold");
|
|
122
121
|
if (selection.hasFormat("italic"))
|
|
123
122
|
marks.push("italic");
|
|
124
|
-
if (selection.hasFormat("
|
|
125
|
-
marks.push("
|
|
126
|
-
if (selection.hasFormat("code"))
|
|
127
|
-
marks.push("code");
|
|
123
|
+
if (selection.hasFormat("strikethrough"))
|
|
124
|
+
marks.push("strikethrough");
|
|
128
125
|
// block
|
|
129
126
|
const anchorNode = selection.anchor.getNode();
|
|
130
127
|
const topLevelNode = anchorNode.getTopLevelElementOrThrow();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchAll.d.ts","sourceRoot":"","sources":["../../../src/components/searchConversation/SearchAll.tsx"],"names":[],"mappings":"AAGA,QAAA,MAAM,qBAAqB,+CAI1B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Empty } from "antd";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
const SearchConversationAll = () => {
|
|
5
|
+
const { t } = useTranslation();
|
|
6
|
+
return _jsx(Empty, { description: t("no_conversation") });
|
|
7
|
+
};
|
|
8
|
+
export default SearchConversationAll;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchConversationAsMessages.d.ts","sourceRoot":"","sources":["../../../src/components/searchConversation/SearchConversationAsMessages.tsx"],"names":[],"mappings":"AAGA,QAAA,MAAM,4BAA4B,+CAIjC,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Empty } from "antd";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
const SearchConversationAsMessages = () => {
|
|
5
|
+
const { t } = useTranslation();
|
|
6
|
+
return _jsx(Empty, { description: t("no_conversation") });
|
|
7
|
+
};
|
|
8
|
+
export default SearchConversationAsMessages;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchConversationAsUsers.d.ts","sourceRoot":"","sources":["../../../src/components/searchConversation/SearchConversationAsUsers.tsx"],"names":[],"mappings":"AAGA,QAAA,MAAM,yBAAyB,+CAI9B,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Empty } from "antd";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
const SearchConversationAsUsers = () => {
|
|
5
|
+
const { t } = useTranslation();
|
|
6
|
+
return _jsx(Empty, { description: t("no_conversation") });
|
|
7
|
+
};
|
|
8
|
+
export default SearchConversationAsUsers;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare enum SearchConversationTabKey {
|
|
2
|
+
All = "all",
|
|
3
|
+
Users = "users",
|
|
4
|
+
Messages = "messages"
|
|
5
|
+
}
|
|
6
|
+
declare const SearchConversation: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default SearchConversation;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/searchConversation/index.tsx"],"names":[],"mappings":"AASA,oBAAY,wBAAwB;IAClC,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,QAAQ,aAAa;CACtB;AAED,QAAA,MAAM,kBAAkB,+CA4BvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|