@droppii-org/chat-sdk 0.0.48 → 0.0.50

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.
Files changed (60) hide show
  1. package/dist/components/conversation/DeskConversationList.js +1 -1
  2. package/dist/components/mediaCollection/LinkCollection.d.ts +3 -1
  3. package/dist/components/mediaCollection/LinkCollection.d.ts.map +1 -1
  4. package/dist/components/mediaCollection/LinkCollection.js +35 -4
  5. package/dist/components/mediaCollection/index.js +1 -1
  6. package/dist/components/message/MessageHeader.d.ts.map +1 -1
  7. package/dist/components/message/MessageHeader.js +27 -27
  8. package/dist/components/message/MessageList.d.ts.map +1 -1
  9. package/dist/components/message/MessageList.js +9 -0
  10. package/dist/components/message/SelectSession.d.ts +3 -2
  11. package/dist/components/message/SelectSession.d.ts.map +1 -1
  12. package/dist/components/message/SelectSession.js +14 -13
  13. package/dist/components/searchConversation/item/SearchItemAsUser.d.ts.map +1 -1
  14. package/dist/components/searchConversation/item/SearchItemAsUser.js +14 -3
  15. package/dist/constants/index.d.ts +1 -1
  16. package/dist/constants/index.d.ts.map +1 -1
  17. package/dist/constants/index.js +1 -1
  18. package/dist/hooks/message/useMessage.d.ts.map +1 -1
  19. package/dist/hooks/message/useMessage.js +0 -1
  20. package/dist/hooks/message/useSendMessage.d.ts.map +1 -1
  21. package/dist/hooks/message/useSendMessage.js +4 -2
  22. package/dist/hooks/user/useUpdateFcmToken.d.ts.map +1 -1
  23. package/dist/index.d.ts +2 -1
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +2 -1
  26. package/dist/styles/global.css +1 -1
  27. package/dist/utils/common.js +1 -1
  28. package/package.json +1 -1
  29. package/dist/assets/openIM.wasm +0 -0
  30. package/dist/assets/sql-wasm.wasm +0 -0
  31. package/dist/assets/version +0 -1
  32. package/dist/assets/wasm_exec.js +0 -575
  33. package/dist/components/ChatBubble.d.ts +0 -10
  34. package/dist/components/ChatBubble.d.ts.map +0 -1
  35. package/dist/components/ChatBubble.js +0 -28
  36. package/dist/components/conversation/ConversationItemList.d.ts +0 -7
  37. package/dist/components/conversation/ConversationItemList.d.ts.map +0 -1
  38. package/dist/components/conversation/ConversationItemList.js +0 -20
  39. package/dist/components/message/MessageItem.d.ts +0 -7
  40. package/dist/components/message/MessageItem.d.ts.map +0 -1
  41. package/dist/components/message/MessageItem.js +0 -21
  42. package/dist/components/message/footer/BottomSection.d.ts +0 -3
  43. package/dist/components/message/footer/BottomSection.d.ts.map +0 -1
  44. package/dist/components/message/footer/BottomSection.js +0 -6
  45. package/dist/components/session/AssignedSessionFilter.d.ts +0 -7
  46. package/dist/components/session/AssignedSessionFilter.d.ts.map +0 -1
  47. package/dist/components/session/AssignedSessionFilter.js +0 -152
  48. package/dist/hooks/conversation/useConversationStore.d.ts +0 -11
  49. package/dist/hooks/conversation/useConversationStore.d.ts.map +0 -1
  50. package/dist/hooks/conversation/useConversationStore.js +0 -10
  51. package/dist/screens/desk-message/index.d.ts +0 -3
  52. package/dist/screens/desk-message/index.d.ts.map +0 -1
  53. package/dist/screens/desk-message/index.js +0 -15
  54. package/dist/tsconfig.tsbuildinfo +0 -1
  55. package/dist/types/index.d.ts +0 -1
  56. package/dist/types/index.d.ts.map +0 -1
  57. package/dist/types/index.js +0 -1
  58. package/dist/types/sdk.d.ts +0 -1
  59. package/dist/types/sdk.d.ts.map +0 -1
  60. package/dist/types/sdk.js +0 -1
@@ -1,3 +0,0 @@
1
- declare const FooterBottomSection: () => import("react/jsx-runtime").JSX.Element;
2
- export default FooterBottomSection;
3
- //# sourceMappingURL=BottomSection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BottomSection.d.ts","sourceRoot":"","sources":["../../../../src/components/message/footer/BottomSection.tsx"],"names":[],"mappings":"AAEA,QAAA,MAAM,mBAAmB,+CAMxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -1,6 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- const FooterBottomSection = () => {
4
- return (_jsx("div", { className: "flex items-center gap-2", children: _jsx("div", {}) }));
5
- };
6
- export default FooterBottomSection;
@@ -1,7 +0,0 @@
1
- interface AssignedSessionFilterProps {
2
- onFilterChange?: (categoryId: string, subCategoryId?: string) => void;
3
- className?: string;
4
- }
5
- declare const AssignedSessionFilter: ({ onFilterChange, className, }: AssignedSessionFilterProps) => import("react/jsx-runtime").JSX.Element;
6
- export default AssignedSessionFilter;
7
- //# sourceMappingURL=AssignedSessionFilter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AssignedSessionFilter.d.ts","sourceRoot":"","sources":["../../../src/components/session/AssignedSessionFilter.tsx"],"names":[],"mappings":"AA2BA,UAAU,0BAA0B;IAClC,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,qBAAqB,GAAI,gCAG5B,0BAA0B,4CAwQ5B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -1,152 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useMemo, useState } from "react";
4
- import { Icon } from "../icon";
5
- import useConversationStore from "../../store/conversation";
6
- import { SESSION_STATUS_ENUM, TAG_ENUM } from "../../constants";
7
- const AssignedSessionFilter = ({ onFilterChange, className = "", }) => {
8
- const [expandedCategories, setExpandedCategories] = useState(new Set([0]));
9
- const [selectedFilter, setSelectedFilter] = useState(SESSION_STATUS_ENUM.UNASSIGNED);
10
- const summary = useConversationStore((state) => state.summary);
11
- const setFilterSummary = useConversationStore((state) => state.setFilterSummary);
12
- const messageCategories = useMemo(() => {
13
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
14
- return [
15
- {
16
- icon: "chat-square-b",
17
- label: "Đang mở",
18
- key: "ALL",
19
- count: (summary === null || summary === void 0 ? void 0 : summary.activeSessionCount) || 0,
20
- color: "text-gray-600",
21
- query: {
22
- status: undefined,
23
- tag: undefined,
24
- },
25
- subCategories: [
26
- {
27
- icon: "user-del-o",
28
- label: "Chưa phân công",
29
- key: SESSION_STATUS_ENUM.UNASSIGNED,
30
- count: ((_b = (_a = summary === null || summary === void 0 ? void 0 : summary.sessionStatuses) === null || _a === void 0 ? void 0 : _a.find((status) => status.type === SESSION_STATUS_ENUM.UNASSIGNED)) === null || _b === void 0 ? void 0 : _b.count) || 0,
31
- color: "text-orange-500",
32
- query: {
33
- status: SESSION_STATUS_ENUM.UNASSIGNED,
34
- tag: undefined,
35
- },
36
- },
37
- {
38
- icon: "warning-square-o",
39
- label: "Chậm xử lý",
40
- key: TAG_ENUM.SLOW_PROCESSING,
41
- count: ((_d = (_c = summary === null || summary === void 0 ? void 0 : summary.tagCounts) === null || _c === void 0 ? void 0 : _c.find((status) => status.type === TAG_ENUM.SLOW_PROCESSING)) === null || _d === void 0 ? void 0 : _d.count) || 0,
42
- color: "text-red-500",
43
- query: {
44
- status: undefined,
45
- tag: TAG_ENUM.SLOW_PROCESSING,
46
- },
47
- },
48
- {
49
- icon: "time-circle-o",
50
- label: "Chờ xử lý",
51
- key: SESSION_STATUS_ENUM.WAITING_PROCESS,
52
- count: ((_f = (_e = summary === null || summary === void 0 ? void 0 : summary.sessionStatuses) === null || _e === void 0 ? void 0 : _e.find((status) => status.type === SESSION_STATUS_ENUM.WAITING_PROCESS)) === null || _f === void 0 ? void 0 : _f.count) || 0,
53
- color: "text-orange-400",
54
- query: {
55
- status: SESSION_STATUS_ENUM.WAITING_PROCESS,
56
- tag: undefined,
57
- },
58
- },
59
- {
60
- icon: "arrow-reply-o",
61
- label: "Chưa trả lời",
62
- key: TAG_ENUM.AWAITING_REPLY,
63
- count: ((_h = (_g = summary === null || summary === void 0 ? void 0 : summary.tagCounts) === null || _g === void 0 ? void 0 : _g.find((status) => status.type === TAG_ENUM.AWAITING_REPLY)) === null || _h === void 0 ? void 0 : _h.count) || 0,
64
- color: "text-purple-500",
65
- query: {
66
- status: undefined,
67
- tag: TAG_ENUM.AWAITING_REPLY,
68
- },
69
- },
70
- {
71
- icon: "play-b",
72
- label: "Đang xử lý",
73
- key: SESSION_STATUS_ENUM.IN_PROCESS,
74
- count: ((_k = (_j = summary === null || summary === void 0 ? void 0 : summary.sessionStatuses) === null || _j === void 0 ? void 0 : _j.find((status) => status.type === SESSION_STATUS_ENUM.IN_PROCESS)) === null || _k === void 0 ? void 0 : _k.count) || 0,
75
- color: "text-gray-600",
76
- query: {
77
- status: SESSION_STATUS_ENUM.IN_PROCESS,
78
- tag: undefined,
79
- },
80
- },
81
- {
82
- icon: "pause-b",
83
- label: "Tạm chờ",
84
- key: TAG_ENUM.TEMPORARILY_PAUSED,
85
- count: ((_m = (_l = summary === null || summary === void 0 ? void 0 : summary.sessionStatuses) === null || _l === void 0 ? void 0 : _l.find((status) => status.type === TAG_ENUM.TEMPORARILY_PAUSED)) === null || _m === void 0 ? void 0 : _m.count) || 0,
86
- color: "text-gray-600",
87
- query: {
88
- status: undefined,
89
- tag: TAG_ENUM.TEMPORARILY_PAUSED,
90
- },
91
- },
92
- ],
93
- },
94
- {
95
- icon: "check-b",
96
- label: "Đã đóng",
97
- key: SESSION_STATUS_ENUM.COMPLETED,
98
- count: ((_p = (_o = summary === null || summary === void 0 ? void 0 : summary.sessionStatuses) === null || _o === void 0 ? void 0 : _o.find((status) => status.type === SESSION_STATUS_ENUM.COMPLETED)) === null || _p === void 0 ? void 0 : _p.count) || 0,
99
- color: "text-green-600",
100
- query: {
101
- status: SESSION_STATUS_ENUM.COMPLETED,
102
- tag: undefined,
103
- },
104
- },
105
- ];
106
- }, []);
107
- const toggleCategory = (index) => {
108
- const newExpanded = new Set(expandedCategories);
109
- if (newExpanded.has(index)) {
110
- newExpanded.delete(index);
111
- }
112
- else {
113
- newExpanded.add(index);
114
- }
115
- setExpandedCategories(newExpanded);
116
- };
117
- const handleFilterSelect = (categoryKey, subCategoryKey) => {
118
- const filterKey = subCategoryKey || categoryKey;
119
- setSelectedFilter(filterKey);
120
- // Find the selected category and subcategory by key
121
- const category = messageCategories.find((cat) => cat.key === categoryKey);
122
- let query;
123
- if (category) {
124
- if (subCategoryKey && category.subCategories) {
125
- const subCategory = category.subCategories.find((sub) => sub.key === subCategoryKey);
126
- query = subCategory === null || subCategory === void 0 ? void 0 : subCategory.query;
127
- }
128
- else {
129
- query = category.query;
130
- }
131
- }
132
- if (query) {
133
- setFilterSummary(query);
134
- }
135
- onFilterChange === null || onFilterChange === void 0 ? void 0 : onFilterChange(categoryKey, subCategoryKey);
136
- };
137
- return (_jsxs("div", { className: `w-64 bg-white border-r border-gray-200 flex flex-col ${className}`, children: [_jsx("div", { className: "p-4 border-b border-gray-200", children: _jsx("h2", { className: "text-lg font-semibold text-gray-800", children: "TIN NH\u1EAEN C\u1EE6A T\u00D4I" }) }), _jsx("div", { className: "flex-1 overflow-y-auto", children: _jsx("ul", { className: "py-2", children: messageCategories.map((category, index) => (_jsxs("li", { children: [_jsxs("button", { onClick: () => {
138
- if (category.subCategories) {
139
- toggleCategory(index);
140
- }
141
- else {
142
- handleFilterSelect(category.key);
143
- }
144
- }, className: `w-full flex items-center justify-between px-4 py-3 hover:bg-gray-50 transition-colors group ${selectedFilter === category.key && !category.subCategories
145
- ? "bg-blue-50 border-r-2 border-blue-500"
146
- : ""}`, children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [category.subCategories && (_jsx(Icon, { icon: expandedCategories.has(index)
147
- ? "chevron-down-b"
148
- : "chevron-right-b", size: 14, className: "text-gray-400" })), _jsx(Icon, { icon: category.icon, size: 20, className: category.color })] }), _jsx("span", { className: "font-medium text-gray-800 text-left", children: category.label })] }), _jsx("span", { className: "text-sm font-medium text-gray-500 min-w-0", children: category.count })] }), category.subCategories && expandedCategories.has(index) && (_jsx("ul", { className: "ml-4 border-l border-gray-200", children: category.subCategories.map((subCategory, subIndex) => (_jsx("li", { children: _jsxs("button", { onClick: () => handleFilterSelect(category.key, subCategory.key), className: `w-full flex items-center justify-between px-4 py-2 hover:bg-gray-50 transition-colors group ${selectedFilter === subCategory.key
149
- ? "bg-blue-50 border-r-2 border-blue-500"
150
- : ""}`, children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "flex-shrink-0 ml-4", children: _jsx(Icon, { icon: subCategory.icon, size: 18, className: subCategory.color }) }), _jsx("span", { className: "text-sm font-medium text-gray-700 text-left", children: subCategory.label })] }), _jsx("span", { className: "text-xs font-medium text-gray-500 min-w-0", children: subCategory.count })] }) }, subIndex))) }))] }, index))) }) })] }));
151
- };
152
- export default AssignedSessionFilter;
@@ -1,11 +0,0 @@
1
- interface ConversationStore {
2
- conversationData: any;
3
- setConversationData: (data: any) => void;
4
- selectedThreadId: string;
5
- selectedSourceId: string;
6
- setSelectedThreadId: (threadId: string) => void;
7
- setSelectedSourceId: (sourceId: string) => void;
8
- }
9
- declare const useConversationStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ConversationStore>>;
10
- export default useConversationStore;
11
- //# sourceMappingURL=useConversationStore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useConversationStore.d.ts","sourceRoot":"","sources":["../../../src/hooks/conversation/useConversationStore.ts"],"names":[],"mappings":"AAEA,UAAU,iBAAiB;IACzB,gBAAgB,EAAE,GAAG,CAAC;IACtB,mBAAmB,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IACzC,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,mBAAmB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACjD;AAED,QAAA,MAAM,oBAAoB,gFAOvB,CAAC;AAEJ,eAAe,oBAAoB,CAAC"}
@@ -1,10 +0,0 @@
1
- import { create } from "zustand";
2
- const useConversationStore = create((set) => ({
3
- conversationData: null,
4
- setConversationData: (data) => set({ conversationData: data }),
5
- selectedThreadId: "",
6
- setSelectedThreadId: (threadId) => set({ selectedThreadId: threadId }),
7
- selectedSourceId: "",
8
- setSelectedSourceId: (sourceId) => set({ selectedSourceId: sourceId }),
9
- }));
10
- export default useConversationStore;
@@ -1,3 +0,0 @@
1
- declare const DChatDeskMessage: () => import("react/jsx-runtime").JSX.Element;
2
- export default DChatDeskMessage;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/desk-message/index.tsx"],"names":[],"mappings":"AAQA,QAAA,MAAM,gBAAgB,+CAerB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1,15 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { SessionType } from "@openim/wasm-client-sdk";
4
- import MessageList from "../../components/message/MessageList";
5
- import DeskConversationList from "../../components/conversation/DeskConversationList";
6
- import { useConversationDetail } from "../../hooks/conversation/useConversation";
7
- import AssignedSessionFilter from "../../components/session/AssignedSessionFilter";
8
- const DChatDeskMessage = () => {
9
- const { conversationDetail } = useConversationDetail({
10
- sourceID: "123-123",
11
- sessionType: SessionType.Group,
12
- });
13
- return (_jsxs("div", { className: "flex flex-1 flex-row h-screen bg-gray-50", children: [_jsx(AssignedSessionFilter, {}), _jsx(DeskConversationList, {}), _jsx(MessageList, { conversationId: "sg_123-123", conversationData: conversationDetail })] }));
14
- };
15
- export default DChatDeskMessage;