@droppii-org/chat-sdk 0.1.74 → 0.1.78

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 (53) hide show
  1. package/dist/assets/droppiiFontSelection.json +24523 -24523
  2. package/dist/assets/sdk/sql-wasm.wasm +0 -0
  3. package/dist/assets/svg/canned-response.tsx +48 -48
  4. package/dist/assets/svg/document.tsx +37 -37
  5. package/dist/assets/svg/index.ts +1 -1
  6. package/dist/components/conversation-detail/ConversationDetailInput.d.ts +2 -1
  7. package/dist/components/conversation-detail/ConversationDetailInput.d.ts.map +1 -1
  8. package/dist/components/conversation-detail/ConversationDetailInput.js +2 -2
  9. package/dist/components/conversation-detail/bot/BotMenuSheet.d.ts +11 -0
  10. package/dist/components/conversation-detail/bot/BotMenuSheet.d.ts.map +1 -0
  11. package/dist/components/conversation-detail/bot/BotMenuSheet.js +24 -0
  12. package/dist/components/conversation-detail/bot/BotSuggest.d.ts +3 -1
  13. package/dist/components/conversation-detail/bot/BotSuggest.d.ts.map +1 -1
  14. package/dist/components/conversation-detail/bot/BotSuggest.js +3 -2
  15. package/dist/components/conversation-detail/bot/CsSessionConfirmModal.d.ts +9 -0
  16. package/dist/components/conversation-detail/bot/CsSessionConfirmModal.d.ts.map +1 -0
  17. package/dist/components/conversation-detail/bot/CsSessionConfirmModal.js +12 -0
  18. package/dist/components/conversation-detail/bot/index.d.ts +4 -0
  19. package/dist/components/conversation-detail/bot/index.d.ts.map +1 -1
  20. package/dist/components/conversation-detail/bot/index.js +2 -0
  21. package/dist/components/session/sessionMenuItems.d.ts.map +1 -1
  22. package/dist/components/session/sessionMenuItems.js +1 -0
  23. package/dist/hooks/conversation/useBotFlow.d.ts +7 -1
  24. package/dist/hooks/conversation/useBotFlow.d.ts.map +1 -1
  25. package/dist/hooks/conversation/useBotFlow.js +59 -3
  26. package/dist/hooks/conversation/useBotMainMenu.d.ts +1 -0
  27. package/dist/hooks/conversation/useBotMainMenu.d.ts.map +1 -1
  28. package/dist/hooks/conversation/useBotMainMenu.js +9 -0
  29. package/dist/hooks/conversation/useCloseBotSession.d.ts +2 -0
  30. package/dist/hooks/conversation/useCloseBotSession.d.ts.map +1 -0
  31. package/dist/hooks/conversation/useCloseBotSession.js +13 -0
  32. package/dist/hooks/init/useChatToken.d.ts.map +1 -1
  33. package/dist/hooks/init/useChatToken.js +4 -1
  34. package/dist/hooks/message/useSendMessage.d.ts.map +1 -1
  35. package/dist/hooks/message/useSendMessage.js +5 -0
  36. package/dist/locales/i18n.ts +19 -19
  37. package/dist/locales/vi/common.json +161 -161
  38. package/dist/locales/vi/conversation-inbox.json +52 -40
  39. package/dist/screens/conversation-detail/index.d.ts.map +1 -1
  40. package/dist/screens/conversation-detail/index.js +6 -3
  41. package/dist/services/query.d.ts +2 -0
  42. package/dist/services/query.d.ts.map +1 -1
  43. package/dist/services/query.js +2 -0
  44. package/dist/services/routes.d.ts +1 -0
  45. package/dist/services/routes.d.ts.map +1 -1
  46. package/dist/services/routes.js +1 -0
  47. package/dist/styles/global.css +1 -1
  48. package/dist/types/conversation.d.ts +1 -4
  49. package/dist/types/conversation.d.ts.map +1 -1
  50. package/dist/utils/botFlow.d.ts +6 -3
  51. package/dist/utils/botFlow.d.ts.map +1 -1
  52. package/package.json +132 -127
  53. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -16,6 +16,7 @@ import { extractLinkUrls } from "../../utils/link";
16
16
  import { SessionStatus, SessionTag } from "../../types/chat";
17
17
  import { updateSession } from "../../hooks/session/useUpdateSession";
18
18
  import { invalidateSessionQueries } from "../../utils/queryHelpers";
19
+ import { resolveConversationBotId } from "../../utils/conversation";
19
20
  const messageFileStore = new Map();
20
21
  const MEDIA_CONTENT_TYPES = new Set([
21
22
  MessageType.PictureMessage,
@@ -129,6 +130,7 @@ export const useSendMessage = (options) => {
129
130
  const conversationData = useConversationStore((state) => state.conversationData);
130
131
  const quotedMessage = useConversationStore((state) => state.quotedMessage);
131
132
  const setQuotedMessage = useConversationStore((state) => state.setQuotedMessage);
133
+ const userId = useAuthStore((state) => state.userID);
132
134
  const { userID: recvID, groupID } = conversationData || {};
133
135
  const scrollEvent = (_a = options === null || options === void 0 ? void 0 : options.scrollEvent) !== null && _a !== void 0 ? _a : "CHAT_LIST_SCROLL_TO_BOTTOM";
134
136
  const syncSessionAfterPublicMessage = useCallback(async (currentSession) => {
@@ -179,6 +181,9 @@ export const useSendMessage = (options) => {
179
181
  icon: pushMeta.icon,
180
182
  conversationId: pushMeta.conversationId,
181
183
  title: pushMeta.title,
184
+ userId: userId,
185
+ groupId: groupID,
186
+ botId: conversationData ? resolveConversationBotId(conversationData) : '',
182
187
  desc,
183
188
  }),
184
189
  iOSPushSound: "default",
@@ -1,19 +1,19 @@
1
- import i18n from "i18next";
2
- import { initReactI18next } from "react-i18next";
3
- import vi from "./vi/common.json";
4
- import viConversationInbox from "./vi/conversation-inbox.json";
5
-
6
- if (!i18n.isInitialized) {
7
- i18n.use(initReactI18next).init({
8
- resources: {
9
- vi: { common: vi, "conversation-inbox": viConversationInbox },
10
- },
11
- lng: "vi",
12
- fallbackLng: "vi",
13
- interpolation: { escapeValue: false },
14
- ns: ["common", "conversation-inbox"],
15
- defaultNS: "common",
16
- });
17
- }
18
-
19
- export default i18n;
1
+ import i18n from "i18next";
2
+ import { initReactI18next } from "react-i18next";
3
+ import vi from "./vi/common.json";
4
+ import viConversationInbox from "./vi/conversation-inbox.json";
5
+
6
+ if (!i18n.isInitialized) {
7
+ i18n.use(initReactI18next).init({
8
+ resources: {
9
+ vi: { common: vi, "conversation-inbox": viConversationInbox },
10
+ },
11
+ lng: "vi",
12
+ fallbackLng: "vi",
13
+ interpolation: { escapeValue: false },
14
+ ns: ["common", "conversation-inbox"],
15
+ defaultNS: "common",
16
+ });
17
+ }
18
+
19
+ export default i18n;
@@ -1,162 +1,162 @@
1
- {
2
- "library": "Thư viện",
3
- "image": "Ảnh",
4
- "video": "Video",
5
- "file": "Tập tin",
6
- "link": "Liên kết",
7
- "no_conversation_data": "Vui lòng chọn một cuộc trò chuyện",
8
- "no_media_files": "Không có tập tin phương tiện",
9
- "search": "Tìm kiếm",
10
- "all": "Tất cả",
11
- "users": "Người dùng",
12
- "messages": "Tin nhắn",
13
- "no_conversation": "Không tìm thấy cuộc trò chuyện",
14
- "download": "Tải xuống",
15
- "active_sessions": "Đang mở",
16
- "closed_sessions": "Đã đóng",
17
- "unassigned": "Chưa phân công",
18
- "waiting_process": "Chờ xử lý",
19
- "in_process": "Đang xử lý",
20
- "completed": "Hoàn thành",
21
- "awaiting_reply": "Chưa trả lời",
22
- "slow_processing": "Chậm xử lý",
23
- "temporarily_paused": "Tạm chờ",
24
- "see_more": "Xem thêm",
25
- "err_get_conversation": "Lỗi khi lấy thông tin cuộc trò chuyện",
26
- "enter_message": "Nhập tin nhắn",
27
- "enter_internal_message": "Tin nhắn nội bộ chỉ hiển thị với bạn và các thành viên trong nhóm.",
28
- "reply": "Reply",
29
- "internal": "Internal",
30
- "canned_response_hint": "Gõ # và nhấn Enter để chèn câu trả lời nhanh",
31
- "update_session_status_title": "Cập nhật status",
32
- "update_session_tag_title": "Cập nhật tag",
33
- "cancel": "Hủy",
34
- "update": "Cập nhật",
35
- "update_session_status_failed": "Cập nhật status không thành công",
36
- "update_session_tag_failed": "Cập nhật tag không thành công",
37
- "customer": "Khách hàng",
38
- "you": "Bạn",
39
- "current_account": "(tôi)",
40
- "message_sender_unnamed": "Thành viên",
41
- "select_tag": "Chọn tag",
42
- "search_message": "Tìm kiếm tin nhắn",
43
- "no_result": "Không có kết quả",
44
- "no_search_text": "Nhập từ khoá tìm kiếm",
45
- "add_note": "Thêm ghi chú",
46
- "note_created": "Đã tạo ghi chú",
47
- "note_updated": "Đã cập nhật ghi chú",
48
- "create_note_failed": "Thêm ghi chú thất bại",
49
- "update_note_failed": "Cập nhật ghi chú thất bại",
50
- "copied_to_clipboard": "Đã sao chép",
51
- "message_send_failed": "Gửi tin nhắn thất bại, bạn vui lòng <bold>nhấn để gửi lại</bold>",
52
- "message_send_failed_no_retry": "Gửi tin nhắn thất bại",
53
- "context_menu_reply": "Trả lời",
54
- "context_menu_pin": "Ghim",
55
- "context_menu_unpin": "Bỏ ghim",
56
- "context_menu_view_original": "Xem tin nhắn gốc",
57
- "pinned_panel_title": "Tin nhắn đã ghim",
58
- "pinned_panel_hint": "Nhấn giữ tin nhắn để chọn \"Bỏ ghim\" hoặc \"Xem tin nhắn gốc\"",
59
- "pin_message_success": "Đã ghim tin nhắn",
60
- "pin_message_failed": "Ghim tin nhắn thất bại",
61
- "unpin_message_success": "Đã bỏ ghim tin nhắn",
62
- "unpin_message_failed": "Bỏ ghim tin nhắn thất bại",
63
- "pinned_from_text": "Tin nhắn từ {{name}}",
64
- "pinned_from_link": "Từ {{name}}",
65
- "pinned_from_image": "Hình ảnh từ {{name}}",
66
- "pinned_from_video": "Video từ {{name}}",
67
- "pinned_from_file": "Tài liệu từ {{name}}",
68
- "pin_limit_modal_title": "Không thể ghim thêm tin nhắn",
69
- "pin_limit_modal_description": "Chỉ được ghim tối đa {{max}} tin nhắn. Vui lòng bỏ ghim một tin nhắn hiện có trước khi ghim tin nhắn mới.",
70
- "pin_limit_modal_confirm": "Đã hiểu",
71
- "context_menu_copy_message": "Sao chép tin nhắn",
72
- "copy_message_success": "Sao chép tin nhắn thành công",
73
- "context_menu_revoke": "Thu hồi",
74
- "revoke_message_confirm_title": "Thu hồi tin nhắn?",
75
- "revoke_message_confirm_message": "Bạn có chắc chắn muốn thu hồi tin nhắn này?",
76
- "revoke": "Thu hồi",
77
- "revoked": "Đã thu hồi tin nhắn",
78
- "revoked_with_sender": "{{name}} đã thu hồi tin nhắn",
79
- "revoke_message_success": "Đã thu hồi tin nhắn",
80
- "revoke_message_failed": "Thu hồi tin nhắn thất bại",
81
- "manual_assign_search_placeholder": "Tìm kiếm",
82
- "manual_assign_no_results": "Không có kết quả phù hợp",
83
- "manual_assign_confirm_question": "Phân công lại cho <bold>{{name}}</bold>?",
84
- "manual_assign_button_reassign": "Phân công lại",
85
- "manual_assign_button_auto_reassign": "Auto reassign",
86
- "manual_assign_success": "Phân công thành công",
87
- "auto_assign_success": "Tự động phân công thành công",
88
- "auto_assign_failed": "Không có nhân viên phù hợp để phân công",
89
- "manual_assign_failed": "Phân công thất bại",
90
- "assign_to_me": "Phân công cho tôi",
91
- "assign_to_others": "Phân công cho người khác",
92
- "unassigned_thread_notice": "Phiên này chưa được phân công cho ai",
93
- "video_limit_exceeded": "Chỉ được phép tải lên 1 video duy nhất",
94
- "select_status": "Chọn trạng thái",
95
- "invalid_file_format": "{{fileName}} không đúng định dạng JPG, JPEG, PNG hoặc VIDEO",
96
- "file_size_exceeded": "{{fileName}} có kích thước tập tin vượt quá {{maxSize}}MB",
97
- "file_processing_error": "Đã xảy ra lỗi khi xử lý tệp",
98
- "invalid_document_format": "{{fileName}} không đúng định dạng (chỉ hỗ trợ PDF, DOC, DOCX)",
99
- "view_message": "Xem tin nhắn",
100
- "search_message_title": "Tìm kiếm tin nhắn",
101
- "msg_type_image": "[Hình ảnh]",
102
- "msg_type_voice": "[Tin nhắn thoại]",
103
- "msg_type_file": "[File]",
104
- "msg_type_video": "[Video]",
105
- "msg_type_unsupported": "Tin nhắn không khả dụng",
106
- "msg_type_order": "[Đơn hàng] {{orderCode}}",
107
- "invalid_message": "Tin nhắn không hợp lệ",
108
- "session_started": "Phiên chat đã bắt đầu",
109
- "session_ended": "Phiên chat đã kết thúc",
110
- "new_message": "Bạn có tin nhắn mới",
111
- "close_session_success": "Đóng phiên chat thành công",
112
- "close_session_failed": "Đóng phiên chat thất bại",
113
- "session_active": "Đang hoạt động",
114
- "session_add_tag_placeholder": "Thêm thẻ...",
115
- "session_issue_detail_placeholder": "Vấn đề cụ thể...",
116
- "session_note_placeholder": "Ghi chú...",
117
- "session_close_button": "Đóng",
118
- "member_count": "{{count}} thành viên",
119
- "members": "Thành viên",
120
- "no_group_members": "Không có thành viên",
121
- "load_group_member_list_failed": "Không thể tải danh sách thành viên",
122
- "group_creator": "Người tạo nhóm",
123
- "group_owner": "Chủ nhóm",
124
- "group_admin": "Quản trị viên",
125
- "group_member": "Thành viên",
126
- "leave_group": "Rời khỏi nhóm",
127
- "choose_emoji": "Chọn biểu tượng cảm xúc",
128
- "emoji_smileys": "Mặt cười",
129
- "emoji_nature": "Động vật",
130
- "emoji_food": "Đồ ăn",
131
- "emoji_activities": "Hoạt động",
132
- "session_label": "Phiên {{order}}",
133
- "sessions_heading": "PHIÊN HỖ TRỢ",
134
- "reply_to": "Trả lời {{name}}",
135
- "your_self": "bạn",
136
- "canned_responses": "Câu trả lời nhanh",
137
- "team": "Team",
138
- "personal": "Cá nhân",
139
- "no_canned_response": "Không tìm thấy kết quả phù hợp",
140
- "add_canned_response": "Thêm câu trả lời nhanh",
141
- "canned_response_quick_search_placeholder": "Câu trả lời nhanh phù hợp với",
142
- "replied_yourself": "đã trả lời chính mình",
143
- "replied_you": "đã trả lời bạn",
144
- "replied": "đã trả lời",
145
- "my_messages": "Tin nhắn của tôi",
146
- "my_inbox_tab": "My inbox",
147
- "team_messages": "Tin nhắn nhóm",
148
- "join_group_required": "Bạn phải là thành viên để gửi tin nhắn",
149
- "join_group": "Tham gia",
150
- "join_group_success": "Tham gia nhóm thành công",
151
- "join_group_failed": "Tham gia nhóm thất bại",
152
- "leave_group_confirm_title": "Rời khỏi nhóm?",
153
- "leave_group_confirm_message": "Bạn có chắc chắn muốn rời khỏi nhóm này không?",
154
- "leave_group_success": "Rời khỏi nhóm thành công",
155
- "leave_group_failed": "Rời khỏi nhóm thất bại",
156
- "leave_group_assignee_error": "Bạn đang là người được phân công cho phiên chat đang xử lý, không thể rời nhóm",
157
- "session_closed_modal_title": "Session đã đóng!",
158
- "session_closed_modal_description": "Hãy tạo mới hoặc mở lại session để tiếp tục gửi tin nhắn!",
159
- "session_closed_modal_reopen": "Mở lại",
160
- "session_closed_modal_create_new": "Tạo mới",
161
- "session_action_error": "Không thể thực hiện tác vụ này"
1
+ {
2
+ "library": "Thư viện",
3
+ "image": "Ảnh",
4
+ "video": "Video",
5
+ "file": "Tập tin",
6
+ "link": "Liên kết",
7
+ "no_conversation_data": "Vui lòng chọn một cuộc trò chuyện",
8
+ "no_media_files": "Không có tập tin phương tiện",
9
+ "search": "Tìm kiếm",
10
+ "all": "Tất cả",
11
+ "users": "Người dùng",
12
+ "messages": "Tin nhắn",
13
+ "no_conversation": "Không tìm thấy cuộc trò chuyện",
14
+ "download": "Tải xuống",
15
+ "active_sessions": "Đang mở",
16
+ "closed_sessions": "Đã đóng",
17
+ "unassigned": "Chưa phân công",
18
+ "waiting_process": "Chờ xử lý",
19
+ "in_process": "Đang xử lý",
20
+ "completed": "Hoàn thành",
21
+ "awaiting_reply": "Chưa trả lời",
22
+ "slow_processing": "Chậm xử lý",
23
+ "temporarily_paused": "Tạm chờ",
24
+ "see_more": "Xem thêm",
25
+ "err_get_conversation": "Lỗi khi lấy thông tin cuộc trò chuyện",
26
+ "enter_message": "Nhập tin nhắn",
27
+ "enter_internal_message": "Tin nhắn nội bộ chỉ hiển thị với bạn và các thành viên trong nhóm.",
28
+ "reply": "Reply",
29
+ "internal": "Internal",
30
+ "canned_response_hint": "Gõ # và nhấn Enter để chèn câu trả lời nhanh",
31
+ "update_session_status_title": "Cập nhật status",
32
+ "update_session_tag_title": "Cập nhật tag",
33
+ "cancel": "Hủy",
34
+ "update": "Cập nhật",
35
+ "update_session_status_failed": "Cập nhật status không thành công",
36
+ "update_session_tag_failed": "Cập nhật tag không thành công",
37
+ "customer": "Khách hàng",
38
+ "you": "Bạn",
39
+ "current_account": "(tôi)",
40
+ "message_sender_unnamed": "Thành viên",
41
+ "select_tag": "Chọn tag",
42
+ "search_message": "Tìm kiếm tin nhắn",
43
+ "no_result": "Không có kết quả",
44
+ "no_search_text": "Nhập từ khoá tìm kiếm",
45
+ "add_note": "Thêm ghi chú",
46
+ "note_created": "Đã tạo ghi chú",
47
+ "note_updated": "Đã cập nhật ghi chú",
48
+ "create_note_failed": "Thêm ghi chú thất bại",
49
+ "update_note_failed": "Cập nhật ghi chú thất bại",
50
+ "copied_to_clipboard": "Đã sao chép",
51
+ "message_send_failed": "Gửi tin nhắn thất bại, bạn vui lòng <bold>nhấn để gửi lại</bold>",
52
+ "message_send_failed_no_retry": "Gửi tin nhắn thất bại",
53
+ "context_menu_reply": "Trả lời",
54
+ "context_menu_pin": "Ghim",
55
+ "context_menu_unpin": "Bỏ ghim",
56
+ "context_menu_view_original": "Xem tin nhắn gốc",
57
+ "pinned_panel_title": "Tin nhắn đã ghim",
58
+ "pinned_panel_hint": "Nhấn giữ tin nhắn để chọn \"Bỏ ghim\" hoặc \"Xem tin nhắn gốc\"",
59
+ "pin_message_success": "Đã ghim tin nhắn",
60
+ "pin_message_failed": "Ghim tin nhắn thất bại",
61
+ "unpin_message_success": "Đã bỏ ghim tin nhắn",
62
+ "unpin_message_failed": "Bỏ ghim tin nhắn thất bại",
63
+ "pinned_from_text": "Tin nhắn từ {{name}}",
64
+ "pinned_from_link": "Từ {{name}}",
65
+ "pinned_from_image": "Hình ảnh từ {{name}}",
66
+ "pinned_from_video": "Video từ {{name}}",
67
+ "pinned_from_file": "Tài liệu từ {{name}}",
68
+ "pin_limit_modal_title": "Không thể ghim thêm tin nhắn",
69
+ "pin_limit_modal_description": "Chỉ được ghim tối đa {{max}} tin nhắn. Vui lòng bỏ ghim một tin nhắn hiện có trước khi ghim tin nhắn mới.",
70
+ "pin_limit_modal_confirm": "Đã hiểu",
71
+ "context_menu_copy_message": "Sao chép tin nhắn",
72
+ "copy_message_success": "Sao chép tin nhắn thành công",
73
+ "context_menu_revoke": "Thu hồi",
74
+ "revoke_message_confirm_title": "Thu hồi tin nhắn?",
75
+ "revoke_message_confirm_message": "Bạn có chắc chắn muốn thu hồi tin nhắn này?",
76
+ "revoke": "Thu hồi",
77
+ "revoked": "Đã thu hồi tin nhắn",
78
+ "revoked_with_sender": "{{name}} đã thu hồi tin nhắn",
79
+ "revoke_message_success": "Đã thu hồi tin nhắn",
80
+ "revoke_message_failed": "Thu hồi tin nhắn thất bại",
81
+ "manual_assign_search_placeholder": "Tìm kiếm",
82
+ "manual_assign_no_results": "Không có kết quả phù hợp",
83
+ "manual_assign_confirm_question": "Phân công lại cho <bold>{{name}}</bold>?",
84
+ "manual_assign_button_reassign": "Phân công lại",
85
+ "manual_assign_button_auto_reassign": "Auto reassign",
86
+ "manual_assign_success": "Phân công thành công",
87
+ "auto_assign_success": "Tự động phân công thành công",
88
+ "auto_assign_failed": "Không có nhân viên phù hợp để phân công",
89
+ "manual_assign_failed": "Phân công thất bại",
90
+ "assign_to_me": "Phân công cho tôi",
91
+ "assign_to_others": "Phân công cho người khác",
92
+ "unassigned_thread_notice": "Phiên này chưa được phân công cho ai",
93
+ "video_limit_exceeded": "Chỉ được phép tải lên 1 video duy nhất",
94
+ "select_status": "Chọn trạng thái",
95
+ "invalid_file_format": "{{fileName}} không đúng định dạng JPG, JPEG, PNG hoặc VIDEO",
96
+ "file_size_exceeded": "{{fileName}} có kích thước tập tin vượt quá {{maxSize}}MB",
97
+ "file_processing_error": "Đã xảy ra lỗi khi xử lý tệp",
98
+ "invalid_document_format": "{{fileName}} không đúng định dạng (chỉ hỗ trợ PDF, DOC, DOCX)",
99
+ "view_message": "Xem tin nhắn",
100
+ "search_message_title": "Tìm kiếm tin nhắn",
101
+ "msg_type_image": "[Hình ảnh]",
102
+ "msg_type_voice": "[Tin nhắn thoại]",
103
+ "msg_type_file": "[File]",
104
+ "msg_type_video": "[Video]",
105
+ "msg_type_unsupported": "Tin nhắn không khả dụng",
106
+ "msg_type_order": "[Đơn hàng] {{orderCode}}",
107
+ "invalid_message": "Tin nhắn không hợp lệ",
108
+ "session_started": "Phiên chat đã bắt đầu",
109
+ "session_ended": "Phiên chat đã kết thúc",
110
+ "new_message": "Bạn có tin nhắn mới",
111
+ "close_session_success": "Đóng phiên chat thành công",
112
+ "close_session_failed": "Đóng phiên chat thất bại",
113
+ "session_active": "Đang hoạt động",
114
+ "session_add_tag_placeholder": "Thêm thẻ...",
115
+ "session_issue_detail_placeholder": "Vấn đề cụ thể...",
116
+ "session_note_placeholder": "Ghi chú...",
117
+ "session_close_button": "Đóng",
118
+ "member_count": "{{count}} thành viên",
119
+ "members": "Thành viên",
120
+ "no_group_members": "Không có thành viên",
121
+ "load_group_member_list_failed": "Không thể tải danh sách thành viên",
122
+ "group_creator": "Người tạo nhóm",
123
+ "group_owner": "Chủ nhóm",
124
+ "group_admin": "Quản trị viên",
125
+ "group_member": "Thành viên",
126
+ "leave_group": "Rời khỏi nhóm",
127
+ "choose_emoji": "Chọn biểu tượng cảm xúc",
128
+ "emoji_smileys": "Mặt cười",
129
+ "emoji_nature": "Động vật",
130
+ "emoji_food": "Đồ ăn",
131
+ "emoji_activities": "Hoạt động",
132
+ "session_label": "Phiên {{order}}",
133
+ "sessions_heading": "PHIÊN HỖ TRỢ",
134
+ "reply_to": "Trả lời {{name}}",
135
+ "your_self": "bạn",
136
+ "canned_responses": "Câu trả lời nhanh",
137
+ "team": "Team",
138
+ "personal": "Cá nhân",
139
+ "no_canned_response": "Không tìm thấy kết quả phù hợp",
140
+ "add_canned_response": "Thêm câu trả lời nhanh",
141
+ "canned_response_quick_search_placeholder": "Câu trả lời nhanh phù hợp với",
142
+ "replied_yourself": "đã trả lời chính mình",
143
+ "replied_you": "đã trả lời bạn",
144
+ "replied": "đã trả lời",
145
+ "my_messages": "Tin nhắn của tôi",
146
+ "my_inbox_tab": "My inbox",
147
+ "team_messages": "Tin nhắn nhóm",
148
+ "join_group_required": "Bạn phải là thành viên để gửi tin nhắn",
149
+ "join_group": "Tham gia",
150
+ "join_group_success": "Tham gia nhóm thành công",
151
+ "join_group_failed": "Tham gia nhóm thất bại",
152
+ "leave_group_confirm_title": "Rời khỏi nhóm?",
153
+ "leave_group_confirm_message": "Bạn có chắc chắn muốn rời khỏi nhóm này không?",
154
+ "leave_group_success": "Rời khỏi nhóm thành công",
155
+ "leave_group_failed": "Rời khỏi nhóm thất bại",
156
+ "leave_group_assignee_error": "Bạn đang là người được phân công cho phiên chat đang xử lý, không thể rời nhóm",
157
+ "session_closed_modal_title": "Session đã đóng!",
158
+ "session_closed_modal_description": "Hãy tạo mới hoặc mở lại session để tiếp tục gửi tin nhắn!",
159
+ "session_closed_modal_reopen": "Mở lại",
160
+ "session_closed_modal_create_new": "Tạo mới",
161
+ "session_action_error": "Không thể thực hiện tác vụ này"
162
162
  }
@@ -1,41 +1,53 @@
1
- {
2
- "tabs": {
3
- "messages": "Tin nhắn"
4
- },
5
- "empty": {
6
- "no_conversations": "Chưa có cuộc trò chuyện",
7
- "no_messages": "Chưa có tin nhắn"
8
- },
9
- "thread_card": {
10
- "fallback_name": "Người dùng",
11
- "bot_crm_name": "Droppii Hỗ Trợ",
12
- "badge": {
13
- "mall": "Mall",
14
- "bot": "Bot"
15
- }
16
- },
17
- "thread_detail": {
18
- "profile_hint": "Nhấn để xem thông tin",
19
- "input_placeholder": "Nhập tin nhắn...",
20
- "resolve_failed": "Không thể mở cuộc trò chuyện",
21
- "more_option": {
22
- "toggle": "Tùy chọn khác",
23
- "media": "Ảnh/Video",
24
- "camera": "Chụp ảnh",
25
- "document": "Tài liệu",
26
- "order": "Gửi đơn hàng",
27
- "product": "Gửi sản phẩm",
28
- "appointment": "Tạo lịch hẹn"
29
- },
30
- "bot": {
31
- "start": "Bắt đầu",
32
- "restart": "Bắt đầu lại",
33
- "inactive_notice": "Người dùng này không còn khả dụng"
34
- }
35
- },
36
- "link_preview": {
37
- "loading": "Đang tải xem trước liên kết...",
38
- "remove": "Xóa xem trước liên kết"
39
- },
40
- "link_open_error": "Không thể mở liên kết. Vui lòng thử lại."
1
+ {
2
+ "tabs": {
3
+ "messages": "Tin nhắn"
4
+ },
5
+ "empty": {
6
+ "no_conversations": "Chưa có cuộc trò chuyện",
7
+ "no_messages": "Chưa có tin nhắn"
8
+ },
9
+ "thread_card": {
10
+ "fallback_name": "Người dùng",
11
+ "bot_crm_name": "Droppii Hỗ Trợ",
12
+ "badge": {
13
+ "mall": "Mall",
14
+ "bot": "Bot"
15
+ }
16
+ },
17
+ "thread_detail": {
18
+ "profile_hint": "Nhấn để xem thông tin",
19
+ "input_placeholder": "Nhập tin nhắn...",
20
+ "resolve_failed": "Không thể mở cuộc trò chuyện",
21
+ "more_option": {
22
+ "toggle": "Tùy chọn khác",
23
+ "media": "Ảnh/Video",
24
+ "camera": "Chụp ảnh",
25
+ "document": "Tài liệu",
26
+ "order": "Gửi đơn hàng",
27
+ "product": "Gửi sản phẩm",
28
+ "appointment": "Tạo lịch hẹn"
29
+ },
30
+ "bot": {
31
+ "start": "Bắt đầu",
32
+ "restart": "Bắt đầu lại",
33
+ "inactive_notice": "Người dùng này không còn khả dụng",
34
+ "menu": {
35
+ "title": "Gợi ý",
36
+ "trigger": "Gợi ý khác",
37
+ "open_menu": "Xem gợi ý khác"
38
+ },
39
+ "cs_confirm": {
40
+ "title": "Kết thúc phiên hỗ trợ",
41
+ "body": "Bạn đang trong phiên hỗ trợ với hỗ trợ viên, bạn có muốn <bold>kết thúc phiên hỗ trợ</bold> ngay bây giờ?",
42
+ "confirm": "Kết thúc",
43
+ "cancel": "Tiếp tục",
44
+ "close_failed": "Không thể kết thúc phiên hỗ trợ. Vui lòng thử lại."
45
+ }
46
+ }
47
+ },
48
+ "link_preview": {
49
+ "loading": "Đang tải xem trước liên kết...",
50
+ "remove": "Xóa xem trước liên kết"
51
+ },
52
+ "link_open_error": "Không thể mở liên kết. Vui lòng thử lại."
41
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation-detail/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAQrF,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,6CAA6C,CAAC;AAGrD,MAAM,WAAW,4BACf,SAAQ,4BAA4B,EAClC,4BAA4B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,uBAAuB,GAAI,wFAS9B,4BAA4B,mDA2G9B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation-detail/index.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAUrF,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,6CAA6C,CAAC;AAGrD,MAAM,WAAW,4BACf,SAAQ,4BAA4B,EAClC,4BAA4B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,uBAAuB,GAAI,wFAS9B,4BAA4B,mDAwI9B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
@@ -13,11 +13,12 @@ var __rest = (this && this.__rest) || function (s, e) {
13
13
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
14
14
  import { usePathname, useRouter, useSearchParams } from "next/navigation";
15
15
  import { useTranslation } from "react-i18next";
16
+ import { useBoolean } from "ahooks";
16
17
  import clsx from "clsx";
17
18
  import { Empty, Spin } from "antd";
18
19
  import useConversationStore from "../../store/conversation";
19
20
  import { ConversationMessageList, ConversationDetailHeader, ConversationDetailInput, PinnedMessageBar, } from "../../components/conversation-detail";
20
- import { BotButtonMessage, BotInactiveNotice, BotStartButton, BotSuggest, } from "../../components/conversation-detail/bot";
21
+ import { BotButtonMessage, BotInactiveNotice, BotMenuSheet, BotStartButton, BotSuggest, CsSessionConfirmModal, } from "../../components/conversation-detail/bot";
21
22
  import { useBotFlow } from "../../hooks/conversation/useBotFlow";
22
23
  import { useResolveConversation, } from "../../hooks/conversation/useResolveConversation";
23
24
  import { isBotPeer } from "../../utils/conversation";
@@ -40,6 +41,8 @@ const DChatConversationDetail = (_a) => {
40
41
  conversationId: (_b = conversation === null || conversation === void 0 ? void 0 : conversation.conversationID) !== null && _b !== void 0 ? _b : "",
41
42
  isBotThread,
42
43
  });
44
+ const [isMenuOpen, { setTrue: openMenu, setFalse: closeMenu }] = useBoolean(false);
45
+ const hasMenuItems = botFlow.menuItems.length > 0;
43
46
  const handleBack = () => {
44
47
  const newSearchParams = new URLSearchParams(searchParams);
45
48
  newSearchParams.delete("threadId");
@@ -58,12 +61,12 @@ const DChatConversationDetail = (_a) => {
58
61
  }
59
62
  const isBotInactive = isBotThread && botFlow.isBotInactive;
60
63
  const isBotNotStarted = isBotThread && botFlow.status === "not_started";
61
- const footer = isBotInactive ? (_jsx(BotInactiveNotice, {})) : isBotNotStarted ? (_jsx("div", { className: "bg-white p-6", children: _jsx(BotStartButton, { label: t("thread_detail.bot.start"), onClick: botFlow.start, disabled: botFlow.isProcessing }) })) : (_jsxs(_Fragment, { children: [isBotThread && (_jsx(BotSuggest, { disabled: botFlow.isProcessing, onRestart: botFlow.restart })), _jsx(ConversationDetailInput, Object.assign({}, inputProps))] }));
64
+ const footer = isBotInactive ? (_jsx(BotInactiveNotice, {})) : isBotNotStarted ? (_jsx("div", { className: "bg-white p-6", children: _jsx(BotStartButton, { label: t("thread_detail.bot.start"), onClick: botFlow.start, disabled: botFlow.isProcessing }) })) : (_jsxs(_Fragment, { children: [isBotThread && (_jsx(BotSuggest, { disabled: botFlow.isProcessing, showMenuTrigger: hasMenuItems, onRestart: botFlow.restart, onOpenMenu: openMenu })), _jsx(ConversationDetailInput, Object.assign({}, inputProps, { onOpenBotMenu: isBotThread && hasMenuItems ? openMenu : undefined }))] }));
62
65
  const botButtonsSlot = isBotThread &&
63
66
  !isBotInactive &&
64
67
  !botFlow.flowIsEnd &&
65
68
  botFlow.shouldShowButtons &&
66
69
  botFlow.currentButtonsBlock ? (_jsx(BotButtonMessage, { buttons: botFlow.currentButtonsBlock.data.buttons, disabled: botFlow.isProcessing, onSelect: botFlow.selectButton, onRestart: botFlow.restart })) : null;
67
- return (_jsxs("div", { "data-testid": "conversation-detail-root", className: clsx("relative flex h-full w-full flex-col overflow-hidden bg-white", className), children: [_jsx(ConversationDetailHeader, { conversation: conversation, onBack: handleBack }), _jsx(PinnedMessageBar, {}), _jsx("div", { className: "flex min-h-0 flex-1 flex-col", children: children !== null && children !== void 0 ? children : _jsx(ConversationMessageList, { bottomSlot: botButtonsSlot }) }), footer] }));
70
+ return (_jsxs("div", { "data-testid": "conversation-detail-root", className: clsx("relative flex h-full w-full flex-col overflow-hidden bg-white", className), children: [_jsx(ConversationDetailHeader, { conversation: conversation, onBack: handleBack }), _jsx(PinnedMessageBar, {}), _jsx("div", { className: "flex min-h-0 flex-1 flex-col", children: children !== null && children !== void 0 ? children : _jsx(ConversationMessageList, { bottomSlot: botButtonsSlot }) }), footer, isBotThread && (_jsxs(_Fragment, { children: [_jsx(BotMenuSheet, { open: isMenuOpen, items: botFlow.menuItems, disabled: botFlow.isProcessing, onClose: closeMenu, onSelect: botFlow.selectMenuOption }), _jsx(CsSessionConfirmModal, { open: !!botFlow.pendingMenuOption, loading: botFlow.isProcessing, onCancel: botFlow.cancelMenuOption, onConfirm: botFlow.confirmEndCsSession })] }))] }));
68
71
  };
69
72
  export default DChatConversationDetail;
@@ -28,6 +28,8 @@ export declare const QUERY_KEYS: {
28
28
  GET_CONVERSATION_DETAIL: string;
29
29
  RUN_BOT_FLOW: string;
30
30
  RESET_BOT_FLOW: string;
31
+ CLOSE_BOT_SESSION: string;
32
+ GET_BOT_MAIN_MENU: string;
31
33
  GET_BOT_DETAIL: string;
32
34
  GET_CONVERSATION_BY_BOT_ID: string;
33
35
  LEAVE_CONVERSATION: string;
@@ -1 +1 @@
1
- {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/services/query.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCtB,CAAC"}
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/services/query.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCtB,CAAC"}
@@ -28,6 +28,8 @@ export const QUERY_KEYS = {
28
28
  GET_CONVERSATION_DETAIL: "GET_CONVERSATION_DETAIL",
29
29
  RUN_BOT_FLOW: "RUN_BOT_FLOW",
30
30
  RESET_BOT_FLOW: "RESET_BOT_FLOW",
31
+ CLOSE_BOT_SESSION: "CLOSE_BOT_SESSION",
32
+ GET_BOT_MAIN_MENU: "GET_BOT_MAIN_MENU",
31
33
  GET_BOT_DETAIL: "GET_BOT_DETAIL",
32
34
  GET_CONVERSATION_BY_BOT_ID: "GET_CONVERSATION_BY_BOT_ID",
33
35
  LEAVE_CONVERSATION: "LEAVE_CONVERSATION",
@@ -31,6 +31,7 @@ export declare const ENDPOINTS: {
31
31
  getConversationDetail: (conversationId: string) => string;
32
32
  runBotFlow: (conversationId: string) => string;
33
33
  resetBotFlow: (conversationId: string) => string;
34
+ closeBotSession: (conversationId: string) => string;
34
35
  getBotMainMenu: (conversationId: string) => string;
35
36
  getBotDetail: (botId: string) => string;
36
37
  getConversationByBotId: (botId: string) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/services/routes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;;mCAMS,MAAM;;0CAGC,MAAM,UAAU,MAAM;6BAEnC,MAAM;;oDAEiB,MAAM;uCAEnB,MAAM;kCAEX,MAAM;;oCAGJ,MAAM;mCAEP,MAAM;uCAEF,MAAM;;;;;;;;iCASZ,MAAM;4CAEK,MAAM;;;;gDAKF,MAAM;qCAEjB,MAAM;uCAEJ,MAAM;yCAEJ,MAAM;8BAEjB,MAAM;wCACI,MAAM;;;;;;;;;CAUzC,CAAC"}
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/services/routes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;;mCAMS,MAAM;;0CAGC,MAAM,UAAU,MAAM;6BAEnC,MAAM;;oDAEiB,MAAM;uCAEnB,MAAM;kCAEX,MAAM;;oCAGJ,MAAM;mCAEP,MAAM;uCAEF,MAAM;;;;;;;;iCASZ,MAAM;4CAEK,MAAM;;;;gDAKF,MAAM;qCAEjB,MAAM;uCAEJ,MAAM;0CAEH,MAAM;yCAEP,MAAM;8BAEjB,MAAM;wCACI,MAAM;;;;;;;;;CAUzC,CAAC"}
@@ -31,6 +31,7 @@ export const ENDPOINTS = {
31
31
  getConversationDetail: (conversationId) => `/chat-service/v1/app/conversations/${conversationId}`,
32
32
  runBotFlow: (conversationId) => `/chat-service/v1/app/conversations/${conversationId}/bot-flows/run`,
33
33
  resetBotFlow: (conversationId) => `/chat-service/v1/app/conversations/${conversationId}/bot-flows/reset`,
34
+ closeBotSession: (conversationId) => `/chat-service/v1/app/conversations/${conversationId}/session/close`,
34
35
  getBotMainMenu: (conversationId) => `/chat-service/v1/app/conversations/${conversationId}/bot-flows/main-menu`,
35
36
  getBotDetail: (botId) => `/chat-service/v1/app/bots/${botId}`,
36
37
  getConversationByBotId: (botId) => `/chat-service/v1/app/bots/${botId}/conversation`,