@droppii-org/chat-mobile 0.2.28 → 0.2.30

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 (182) hide show
  1. package/lib/module/components/ThreadCard/MuteThread.js +86 -0
  2. package/lib/module/components/ThreadCard/MuteThread.js.map +1 -0
  3. package/lib/module/components/ThreadCard/ThreadCard.js +93 -73
  4. package/lib/module/components/ThreadCard/ThreadCard.js.map +1 -1
  5. package/lib/module/components/flows/inputButtons/index.js +6 -3
  6. package/lib/module/components/flows/inputButtons/index.js.map +1 -1
  7. package/lib/module/config/api-endpoints.js +2 -1
  8. package/lib/module/config/api-endpoints.js.map +1 -1
  9. package/lib/module/config/uploadLimits.js +1 -1
  10. package/lib/module/context/ChatDetailContext.js +35 -2
  11. package/lib/module/context/ChatDetailContext.js.map +1 -1
  12. package/lib/module/context/index.js +1 -0
  13. package/lib/module/context/index.js.map +1 -1
  14. package/lib/module/hooks/conversation/useGetConversationDetail.js +58 -0
  15. package/lib/module/hooks/conversation/useGetConversationDetail.js.map +1 -0
  16. package/lib/module/hooks/flows/useFlow.js +1 -1
  17. package/lib/module/hooks/flows/useFlow.js.map +1 -1
  18. package/lib/module/hooks/flows/useGetConversationFlowMainMenu.js +17 -0
  19. package/lib/module/hooks/flows/useGetConversationFlowMainMenu.js.map +1 -0
  20. package/lib/module/hooks/message/useSendMessage.js +32 -7
  21. package/lib/module/hooks/message/useSendMessage.js.map +1 -1
  22. package/lib/module/hooks/query-keys.js +4 -1
  23. package/lib/module/hooks/query-keys.js.map +1 -1
  24. package/lib/module/hooks/useChatCompose.js +0 -1
  25. package/lib/module/hooks/useChatCompose.js.map +1 -1
  26. package/lib/module/hooks/useMuteConversation.js +34 -0
  27. package/lib/module/hooks/useMuteConversation.js.map +1 -0
  28. package/lib/module/index.js +4 -2
  29. package/lib/module/index.js.map +1 -1
  30. package/lib/module/screens/chat-detail/ChatAttachmentPanel.js +4 -14
  31. package/lib/module/screens/chat-detail/ChatAttachmentPanel.js.map +1 -1
  32. package/lib/module/screens/chat-detail/ChatComposer.js +26 -15
  33. package/lib/module/screens/chat-detail/ChatComposer.js.map +1 -1
  34. package/lib/module/screens/chat-detail/ChatDetail.js +58 -71
  35. package/lib/module/screens/chat-detail/ChatDetail.js.map +1 -1
  36. package/lib/module/screens/chat-detail/ChatDetailHeader.js +7 -10
  37. package/lib/module/screens/chat-detail/ChatDetailHeader.js.map +1 -1
  38. package/lib/module/screens/chat-detail/ChatListLegend.js +1 -1
  39. package/lib/module/screens/chat-detail/ChatListLegend.js.map +1 -1
  40. package/lib/module/screens/chat-detail/ChatLoadEarlier.js.map +1 -1
  41. package/lib/module/screens/chat-detail/ChatQuickActions.js +2 -1
  42. package/lib/module/screens/chat-detail/ChatQuickActions.js.map +1 -1
  43. package/lib/module/screens/chat-detail/constants.js +30 -24
  44. package/lib/module/screens/chat-detail/constants.js.map +1 -1
  45. package/lib/module/screens/chat-detail/index.js +2 -2
  46. package/lib/module/screens/chat-detail/index.js.map +1 -1
  47. package/lib/module/screens/chat-detail/messageToolbox/MessageToolboxMenu.js +3 -4
  48. package/lib/module/screens/chat-detail/messageToolbox/MessageToolboxMenu.js.map +1 -1
  49. package/lib/module/screens/chat-detail/messageToolbox/messageToolbox.utils.js +5 -3
  50. package/lib/module/screens/chat-detail/messageToolbox/messageToolbox.utils.js.map +1 -1
  51. package/lib/module/screens/chat-detail/types.js +15 -1
  52. package/lib/module/screens/chat-detail/types.js.map +1 -1
  53. package/lib/module/services/attachmentHandlers/imageAttachmentHandler.js +2 -2
  54. package/lib/module/services/attachmentHandlers/imageAttachmentHandler.js.map +1 -1
  55. package/lib/module/services/endpoints.js +3 -1
  56. package/lib/module/services/endpoints.js.map +1 -1
  57. package/lib/module/translation/resources/i18n.js +15 -1
  58. package/lib/module/translation/resources/i18n.js.map +1 -1
  59. package/lib/module/types/chat.js +9 -0
  60. package/lib/module/types/chat.js.map +1 -1
  61. package/lib/module/types/flows.js +5 -0
  62. package/lib/module/types/flows.js.map +1 -1
  63. package/lib/module/utils/device.js +1 -1
  64. package/lib/module/utils/device.js.map +1 -1
  65. package/lib/module/utils/flows.js +5 -0
  66. package/lib/module/utils/flows.js.map +1 -1
  67. package/lib/module/utils/imageUtils.js +0 -3
  68. package/lib/module/utils/imageUtils.js.map +1 -1
  69. package/lib/module/utils/messageUtils.js +5 -19
  70. package/lib/module/utils/messageUtils.js.map +1 -1
  71. package/lib/typescript/src/components/ThreadCard/MuteThread.d.ts +10 -0
  72. package/lib/typescript/src/components/ThreadCard/MuteThread.d.ts.map +1 -0
  73. package/lib/typescript/src/components/ThreadCard/ThreadCard.d.ts.map +1 -1
  74. package/lib/typescript/src/components/flows/inputButtons/index.d.ts.map +1 -1
  75. package/lib/typescript/src/config/api-endpoints.d.ts +1 -0
  76. package/lib/typescript/src/config/api-endpoints.d.ts.map +1 -1
  77. package/lib/typescript/src/context/ChatDetailContext.d.ts +1 -1
  78. package/lib/typescript/src/context/ChatDetailContext.d.ts.map +1 -1
  79. package/lib/typescript/src/context/index.d.ts +1 -0
  80. package/lib/typescript/src/context/index.d.ts.map +1 -1
  81. package/lib/typescript/src/hooks/conversation/useGetConversationDetail.d.ts +17 -0
  82. package/lib/typescript/src/hooks/conversation/useGetConversationDetail.d.ts.map +1 -0
  83. package/lib/typescript/src/hooks/flows/useGetConversationFlowMainMenu.d.ts +3 -0
  84. package/lib/typescript/src/hooks/flows/useGetConversationFlowMainMenu.d.ts.map +1 -0
  85. package/lib/typescript/src/hooks/message/useSendMessage.d.ts +5 -4
  86. package/lib/typescript/src/hooks/message/useSendMessage.d.ts.map +1 -1
  87. package/lib/typescript/src/hooks/query-keys.d.ts +3 -0
  88. package/lib/typescript/src/hooks/query-keys.d.ts.map +1 -1
  89. package/lib/typescript/src/hooks/useMuteConversation.d.ts +6 -0
  90. package/lib/typescript/src/hooks/useMuteConversation.d.ts.map +1 -0
  91. package/lib/typescript/src/index.d.ts +6 -4
  92. package/lib/typescript/src/index.d.ts.map +1 -1
  93. package/lib/typescript/src/screens/chat-detail/ChatAttachmentPanel.d.ts +2 -2
  94. package/lib/typescript/src/screens/chat-detail/ChatAttachmentPanel.d.ts.map +1 -1
  95. package/lib/typescript/src/screens/chat-detail/ChatComposer.d.ts +3 -1
  96. package/lib/typescript/src/screens/chat-detail/ChatComposer.d.ts.map +1 -1
  97. package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts +1 -1
  98. package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts.map +1 -1
  99. package/lib/typescript/src/screens/chat-detail/ChatDetailHeader.d.ts +1 -1
  100. package/lib/typescript/src/screens/chat-detail/ChatDetailHeader.d.ts.map +1 -1
  101. package/lib/typescript/src/screens/chat-detail/ChatLoadEarlier.d.ts +3 -2
  102. package/lib/typescript/src/screens/chat-detail/ChatLoadEarlier.d.ts.map +1 -1
  103. package/lib/typescript/src/screens/chat-detail/ChatQuickActions.d.ts +1 -1
  104. package/lib/typescript/src/screens/chat-detail/ChatQuickActions.d.ts.map +1 -1
  105. package/lib/typescript/src/screens/chat-detail/constants.d.ts +3 -3
  106. package/lib/typescript/src/screens/chat-detail/constants.d.ts.map +1 -1
  107. package/lib/typescript/src/screens/chat-detail/index.d.ts +3 -3
  108. package/lib/typescript/src/screens/chat-detail/index.d.ts.map +1 -1
  109. package/lib/typescript/src/screens/chat-detail/messageToolbox/MessageToolboxMenu.d.ts +1 -1
  110. package/lib/typescript/src/screens/chat-detail/messageToolbox/MessageToolboxMenu.d.ts.map +1 -1
  111. package/lib/typescript/src/screens/chat-detail/messageToolbox/messageToolbox.utils.d.ts +0 -2
  112. package/lib/typescript/src/screens/chat-detail/messageToolbox/messageToolbox.utils.d.ts.map +1 -1
  113. package/lib/typescript/src/screens/chat-detail/types.d.ts +28 -19
  114. package/lib/typescript/src/screens/chat-detail/types.d.ts.map +1 -1
  115. package/lib/typescript/src/services/endpoints.d.ts +2 -0
  116. package/lib/typescript/src/services/endpoints.d.ts.map +1 -1
  117. package/lib/typescript/src/store/conversation.d.ts +1 -1
  118. package/lib/typescript/src/store/conversation.d.ts.map +1 -1
  119. package/lib/typescript/src/translation/resources/i18n.d.ts.map +1 -1
  120. package/lib/typescript/src/types/chat.d.ts +26 -2
  121. package/lib/typescript/src/types/chat.d.ts.map +1 -1
  122. package/lib/typescript/src/types/flows.d.ts +3 -0
  123. package/lib/typescript/src/types/flows.d.ts.map +1 -1
  124. package/lib/typescript/src/utils/flows.d.ts +2 -0
  125. package/lib/typescript/src/utils/flows.d.ts.map +1 -1
  126. package/lib/typescript/src/utils/imageUtils.d.ts +0 -1
  127. package/lib/typescript/src/utils/imageUtils.d.ts.map +1 -1
  128. package/lib/typescript/src/utils/messageUtils.d.ts +1 -1
  129. package/lib/typescript/src/utils/messageUtils.d.ts.map +1 -1
  130. package/package.json +3 -5
  131. package/src/components/ThreadCard/MuteThread.tsx +100 -0
  132. package/src/components/ThreadCard/ThreadCard.tsx +104 -71
  133. package/src/components/flows/inputButtons/index.tsx +11 -3
  134. package/src/config/api-endpoints.ts +2 -0
  135. package/src/config/uploadLimits.ts +1 -1
  136. package/src/context/ChatDetailContext.tsx +57 -4
  137. package/src/context/index.ts +1 -0
  138. package/src/hooks/conversation/useGetConversationDetail.ts +78 -0
  139. package/src/hooks/flows/useFlow.ts +1 -1
  140. package/src/hooks/flows/useGetConversationFlowMainMenu.ts +19 -0
  141. package/src/hooks/message/useSendMessage.ts +43 -14
  142. package/src/hooks/query-keys.ts +6 -0
  143. package/src/hooks/useChatCompose.ts +1 -1
  144. package/src/hooks/useMuteConversation.ts +44 -0
  145. package/src/index.tsx +15 -6
  146. package/src/screens/chat-detail/ChatAttachmentPanel.tsx +8 -25
  147. package/src/screens/chat-detail/ChatComposer.tsx +26 -21
  148. package/src/screens/chat-detail/ChatDetail.tsx +61 -77
  149. package/src/screens/chat-detail/ChatDetailHeader.tsx +7 -18
  150. package/src/screens/chat-detail/ChatListLegend.tsx +1 -1
  151. package/src/screens/chat-detail/ChatLoadEarlier.tsx +1 -2
  152. package/src/screens/chat-detail/ChatQuickActions.tsx +6 -2
  153. package/src/screens/chat-detail/constants.ts +33 -27
  154. package/src/screens/chat-detail/index.ts +5 -8
  155. package/src/screens/chat-detail/messageToolbox/MessageToolboxMenu.tsx +2 -2
  156. package/src/screens/chat-detail/messageToolbox/messageToolbox.utils.ts +4 -4
  157. package/src/screens/chat-detail/types.ts +30 -28
  158. package/src/services/attachmentHandlers/imageAttachmentHandler.ts +2 -2
  159. package/src/services/endpoints.ts +4 -0
  160. package/src/store/conversation.ts +1 -1
  161. package/src/translation/resources/i18n.ts +15 -0
  162. package/src/types/chat.ts +31 -1
  163. package/src/types/flows.ts +4 -0
  164. package/src/utils/device.ts +1 -1
  165. package/src/utils/flows.ts +7 -0
  166. package/src/utils/imageUtils.ts +0 -4
  167. package/src/utils/messageUtils.ts +7 -22
  168. package/lib/module/screens/chat-detail/ChatDay.js +0 -65
  169. package/lib/module/screens/chat-detail/ChatDay.js.map +0 -1
  170. package/lib/module/types/message.js +0 -17
  171. package/lib/module/types/message.js.map +0 -1
  172. package/lib/module/utils/resolveMessageType.js +0 -47
  173. package/lib/module/utils/resolveMessageType.js.map +0 -1
  174. package/lib/typescript/src/screens/chat-detail/ChatDay.d.ts +0 -3
  175. package/lib/typescript/src/screens/chat-detail/ChatDay.d.ts.map +0 -1
  176. package/lib/typescript/src/types/message.d.ts +0 -16
  177. package/lib/typescript/src/types/message.d.ts.map +0 -1
  178. package/lib/typescript/src/utils/resolveMessageType.d.ts +0 -4
  179. package/lib/typescript/src/utils/resolveMessageType.d.ts.map +0 -1
  180. package/src/screens/chat-detail/ChatDay.tsx +0 -73
  181. package/src/types/message.ts +0 -18
  182. package/src/utils/resolveMessageType.ts +0 -51
@@ -18,6 +18,7 @@ interface MessageToolboxMenuProps {
18
18
  export const MessageToolboxMenu = memo(
19
19
  ({
20
20
  showCopyMessage,
21
+ showCopyMessageLink,
21
22
  showRetryMessage,
22
23
  showRevokeMessage,
23
24
  onCopyMessage,
@@ -39,8 +40,7 @@ export const MessageToolboxMenu = memo(
39
40
  icon="link-o"
40
41
  color={KColors.gray.dark}
41
42
  label={trans('chat:copy_message_link')}
42
- // visible={showCopyMessageLink}
43
- visible={false}
43
+ visible={showCopyMessageLink}
44
44
  onPress={onCopyMessageLink}
45
45
  />
46
46
 
@@ -24,8 +24,8 @@ const isCopyMessageSupported = (message: DMessageItem): boolean =>
24
24
  COPYABLE_TEXT_TYPES.includes(message.contentType);
25
25
 
26
26
  // All message types are supported, as long as the message is eligible.
27
- const isCopyMessageLinkSupported = (message: DMessageItem): boolean =>
28
- isEligibleForToolbox(message);
27
+ // const isCopyMessageLinkSupported = (message: DMessageItem): boolean =>
28
+ // isEligibleForToolbox(message);
29
29
 
30
30
  const isRetrySupported = (message: DMessageItem): boolean =>
31
31
  message.status === MessageStatus.Failed;
@@ -60,13 +60,13 @@ export const getMessageToolboxItems = (
60
60
  }
61
61
 
62
62
  const showCopyMessage = isCopyMessageSupported(message);
63
- const showCopyMessageLink = isCopyMessageLinkSupported(message);
63
+ // const showCopyMessageLink = isCopyMessageLinkSupported(message);
64
64
  const showRetryMessage = isRetrySupported(message);
65
65
  const showRevokeMessage = isRevokeMessageSupported(message, currentUserId);
66
66
 
67
67
  return {
68
68
  showCopyMessage,
69
- showCopyMessageLink,
69
+ // showCopyMessageLink,
70
70
  showRetryMessage,
71
71
  showRevokeMessage,
72
72
  };
@@ -1,13 +1,27 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { MediaItem } from '../../hooks/useMediaViewer';
3
3
  import type { DMessageItem } from '../../types/chat';
4
- import type { ConversationItem } from '@droppii/openim-rn-client-sdk';
5
4
  import type { MeasuredRect } from './messageToolbox/types';
6
5
 
7
6
  export type DChatActionIconProvider = 'MaterialCommunityIcons' | 'DroppiiNew';
8
7
 
8
+ export enum DChatPannelActionItemType {
9
+ Gallery = 'Gallery',
10
+ Camera = 'Camera',
11
+ Documents = 'Documents',
12
+ SendOrder = 'SendOrder',
13
+ SendProduct = 'SendProduct',
14
+ CreateAppointment = 'CreateAppointment',
15
+ }
16
+
17
+ export enum DChatQuickActionItemType {
18
+ Restart = 'Restart',
19
+ SendOrder = 'SendOrder',
20
+ ScamWarning = 'ScamWarning',
21
+ }
22
+
9
23
  export interface DChatActionItem {
10
- id: string;
24
+ id: DChatQuickActionItemType | DChatPannelActionItemType;
11
25
  label: string;
12
26
  iconName: string;
13
27
  iconProvider?: DChatActionIconProvider;
@@ -16,14 +30,14 @@ export interface DChatActionItem {
16
30
  meta?: Record<string, unknown>;
17
31
  }
18
32
 
19
- export type DChatQuickAction = DChatActionItem;
20
- export type DChatAttachmentAction = DChatActionItem;
33
+ export interface DChatQuickAction extends DChatActionItem {
34
+ id: DChatQuickActionItemType;
35
+ }
36
+ export interface DChatPannelAction extends DChatActionItem {
37
+ id: DChatPannelActionItemType;
38
+ }
21
39
 
22
40
  export interface ChatDetailHeaderProps {
23
- title: string;
24
- subtitle?: string;
25
- avatarUri?: string | null;
26
- avatarFullName?: string;
27
41
  showAddMember?: boolean;
28
42
  onBack?: () => void;
29
43
  onPressSearch?: () => void;
@@ -46,14 +60,9 @@ export interface ChatQuickActionsProps {
46
60
  renderQuickActions?: (params: ChatQuickActionsRenderParams) => ReactNode;
47
61
  }
48
62
 
49
- export interface ChatAttachmentPanelProps {
50
- actions?: DChatAttachmentAction[];
63
+ export interface ChatPanelProps {
64
+ actions?: DChatPannelAction[];
51
65
  columns?: number;
52
- onActionPress?: (action: DChatAttachmentAction) => void;
53
- renderAction?: (
54
- action: DChatAttachmentAction,
55
- onPress: () => void
56
- ) => ReactNode;
57
66
  }
58
67
 
59
68
  export interface ChatComposerProps {
@@ -78,22 +87,15 @@ export interface ChatListProps {
78
87
 
79
88
  export interface ChatDetailProps extends Omit<
80
89
  ChatDetailHeaderProps,
81
- | 'title'
82
- | 'subtitle'
83
- | 'avatarUri'
84
- | 'avatarFullName'
85
- | 'applicationType'
86
- | 'showAddMember'
87
- | 'conversationId'
90
+ 'showAddMember' | 'conversationId'
88
91
  > {
89
- conversationId: string;
92
+ targetConversationId?: string;
93
+ targetUserId?: string;
94
+ targetGroupId?: string;
95
+ targetBotId?: string;
90
96
  enabled?: boolean;
91
- title?: string;
92
- subtitle?: string;
93
- avatarUri?: string | null;
94
- avatarFullName?: string;
95
97
  showAddMember?: boolean;
96
- getSubtitle?: (conversation: ConversationItem) => string | undefined;
97
98
  onPressUrl?: (url: string) => void;
98
99
  customMessageItemFactory?: (item: DMessageItem) => ReactNode;
100
+ pannelActions?: DChatPannelAction[];
99
101
  }
@@ -1,7 +1,7 @@
1
1
  import type { ImageAttachment } from '../../types/attachment';
2
2
  import type { IAttachmentHandler } from '../../types/attachmentHandler';
3
- import { generateUUID } from '../../utils/imageUtils';
4
3
  import { UPLOAD_LIMITS } from '../../config/uploadLimits';
4
+ import uuid from 'react-native-uuid';
5
5
 
6
6
  export const ImageAttachmentHandler: IAttachmentHandler = {
7
7
  validate(attachment: ImageAttachment) {
@@ -42,7 +42,7 @@ export const ImageAttachmentHandler: IAttachmentHandler = {
42
42
  });
43
43
 
44
44
  const picInfo = {
45
- uuid: generateUUID(),
45
+ uuid: uuid.v4(),
46
46
  type: attachment.sourceFile.mimeType,
47
47
  size: attachment.sourceFile.size,
48
48
  width: attachment.metadata.width,
@@ -22,6 +22,10 @@ export const ENDPOINTS = {
22
22
  `${getApiEndpoint('conversationFlow')}/${id}/bot-flows/reset`,
23
23
  runConversationFlow: (id: string) =>
24
24
  `${getApiEndpoint('conversationFlow')}/${id}/bot-flows/run`,
25
+ getConversationByBotId: (botId: string) =>
26
+ `${getApiEndpoint('bot')}/${botId}/conversation`,
27
+ conversationFlowMainMenu: (id: string) =>
28
+ `${getApiEndpoint('conversationFlow')}/${id}/bot-flows/main-menu`,
25
29
  },
26
30
  uploaderService: {
27
31
  get uploadImage() {
@@ -6,7 +6,7 @@ type ConversationID = string;
6
6
 
7
7
  export interface ConversationStore {
8
8
  currentConversationId?: ConversationID;
9
- setCurrentConversation(id: ConversationID): void;
9
+ setCurrentConversation(id?: ConversationID): void;
10
10
  getCurrentConversation(): ConversationItem | undefined;
11
11
  list: ConversationID[];
12
12
  map: Record<ConversationID, ConversationItem>;
@@ -41,8 +41,23 @@ const i18nKey: Record<string, string> = {
41
41
  'msg_type_link': '[Liên kết]',
42
42
  'msg_type_revoke': 'Đã thu hồi tin nhắn',
43
43
  'chat:revoked_by_sender': '{{sender}} đã thu hồi tin nhắn',
44
+ 'chat:mute_action': 'Tắt thông báo',
45
+ 'chat:unmute_action': 'Bật thông báo',
46
+ 'chat:mute_confirm_title': 'Tắt thông báo',
47
+ 'chat:mute_confirm_desc':
48
+ 'Bạn có thể bỏ lỡ tin nhắn quan trọng nếu tắt thông báo! Bạn có chắc chắn muốn tắt thông báo?',
49
+ 'chat:mute_confirm_primary': 'Tắt thông báo',
50
+ 'chat:mute_confirm_secondary': 'Quay lại',
51
+ 'chat:mute_toast_success': 'Đã tắt thông báo',
52
+ 'chat:unmute_toast_success': 'Đã bật thông báo',
44
53
  'start': 'Bắt đầu',
45
54
  'restart': 'Bắt đầu lại',
55
+ 'gallery': 'Ảnh/Video',
56
+ 'camera': 'Chụp ảnh',
57
+ 'documents': 'Tài liệu',
58
+ 'send_order': 'Gửi đơn hàng',
59
+ 'send_product': 'Gửi sản phẩm',
60
+ 'create_appointment': 'Tạo lịch hẹn',
46
61
  };
47
62
 
48
63
  export default {
package/src/types/chat.ts CHANGED
@@ -1,7 +1,11 @@
1
- import { type MessageItem } from '@droppii/openim-rn-client-sdk';
1
+ import {
2
+ type ConversationItem,
3
+ type MessageItem,
4
+ } from '@droppii/openim-rn-client-sdk';
2
5
  import type { PropsWithChildren } from 'react';
3
6
  import type { IUrlMetadata } from './common';
4
7
  import type {
8
+ DFlowContext,
5
9
  IConversationFlow,
6
10
  IConversationFlowStep,
7
11
  IRunConversationFlowPayload,
@@ -55,6 +59,11 @@ export enum DMemberRole {
55
59
  MEMBER = 'MEMBER',
56
60
  }
57
61
 
62
+ export enum DFlowState {
63
+ BOT = 1,
64
+ CS = 2,
65
+ }
66
+
58
67
  export interface DConversationPeerUser {
59
68
  id: string;
60
69
  username?: string;
@@ -139,6 +148,9 @@ export interface ChatDetailContextType {
139
148
  refetchConversationFlow: () => void;
140
149
  isBotConversation: boolean;
141
150
  setConverationFlowStep: (step?: IConversationFlowStep) => void;
151
+ flowState?: DFlowState;
152
+ runButtonContext: (stringContext: DFlowContext) => Promise<boolean>;
153
+ conversation?: ConversationItem;
142
154
  }
143
155
 
144
156
  export interface ChatDetailProviderProps extends PropsWithChildren {}
@@ -154,3 +166,21 @@ export interface IConversationItemEx {
154
166
  };
155
167
  chatCategory: DChatCategory;
156
168
  }
169
+
170
+ export const CustomMessageType = {
171
+ Order: 'Order',
172
+ Product: 'Product',
173
+ } as const;
174
+
175
+ export type CustomMessageType =
176
+ (typeof CustomMessageType)[keyof typeof CustomMessageType];
177
+
178
+ export type CustomElemOrderData = {
179
+ id: string;
180
+ orderCode: string;
181
+ timestamp: number;
182
+ };
183
+
184
+ export type CustomMessagePayload =
185
+ | { type: typeof CustomMessageType.Order; data: CustomElemOrderData }
186
+ | { type: typeof CustomMessageType.Product; data: Record<string, unknown> };
@@ -1,6 +1,10 @@
1
1
  import type { PeerType } from '@droppii/openim-rn-client-sdk';
2
2
  import type { DChatApplicationType, DChatCategory } from './chat';
3
3
 
4
+ export enum DFlowContext {
5
+ CHAT_WITH_CS = 'chat_with_cs',
6
+ }
7
+
4
8
  /** START NODE TYPE */
5
9
  export const NodeTypes = {
6
10
  BubbleText: 'bubble-text',
@@ -61,7 +61,7 @@ const DeviceUtils = {
61
61
  const result = await ImagePicker.openPicker({
62
62
  // cropping: true,
63
63
  mediaType: 'any',
64
- compressImageQuality: 0.8,
64
+ compressImageQuality: 1,
65
65
  multiple,
66
66
  forceJpg: true,
67
67
  });
@@ -16,3 +16,10 @@ export const getFlowInputButtonsNode = (
16
16
  };
17
17
 
18
18
  export const DEFAULT_BUTTON_ID = 'default-item-button';
19
+
20
+ export const CONTEXT_BUTTON_PREFIX = 'context:';
21
+
22
+ export const isContextButton = (label: string) => {
23
+ if (!label) return false;
24
+ return label?.trim?.()?.startsWith?.(CONTEXT_BUTTON_PREFIX) || false;
25
+ };
@@ -2,10 +2,6 @@ import type { ImageFile } from '../types/imageUpload';
2
2
  import Images from '../assets/images';
3
3
  import { UPLOAD_LIMITS } from '../config/uploadLimits';
4
4
 
5
- export const generateUUID = (): string => {
6
- return `${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
7
- };
8
-
9
5
  export const isVideoFile = (filename: string | undefined): boolean => {
10
6
  if (!filename) return false;
11
7
  const mimeType = getMimeType(filename);
@@ -7,8 +7,7 @@ import {
7
7
  PeerType,
8
8
  type ConversationItem,
9
9
  } from '@droppii/openim-rn-client-sdk';
10
- import type { DMessageItem } from '../types/chat';
11
- import { DChatMessageType } from '../types/message';
10
+ import { type DMessageItem } from '../types/chat';
12
11
  import { formatDuration } from './dateTimeUtils';
13
12
  import { trans } from '../translation';
14
13
 
@@ -26,26 +25,6 @@ export const extractTextContent = (message: DMessageItem): string => {
26
25
  };
27
26
 
28
27
  export const getMessagePreview = (message: DMessageItem): string => {
29
- // Check custom message type first
30
- if (message.contentType === MessageType.CustomMessage) {
31
- try {
32
- const data = JSON.parse(message.content);
33
- const dataType = data.dataType || data.type;
34
-
35
- if (dataType === DChatMessageType.Link) {
36
- const linkText = data.content || data.title || 'Link';
37
- return linkText;
38
- }
39
-
40
- if (dataType === DChatMessageType.Order) {
41
- const orderCode = data.orderCode || data.code || '';
42
- return `[Đơn hàng] ${orderCode}`;
43
- }
44
- } catch {
45
- // Fall through to default
46
- }
47
- }
48
-
49
28
  // Handle standard message types
50
29
  switch (message.contentType) {
51
30
  case MessageType.TextMessage:
@@ -103,6 +82,12 @@ export const getMessagePreview = (message: DMessageItem): string => {
103
82
  case MessageType.RevokeMessage:
104
83
  return trans('msg_type_revoke');
105
84
 
85
+ case MessageType.CustomMessage:
86
+ if (message?.customElem?.description) {
87
+ return message?.customElem?.description;
88
+ }
89
+ break;
90
+
106
91
  default:
107
92
  return '[Tin nhắn không được hỗ trợ]';
108
93
  }
@@ -1,65 +0,0 @@
1
- "use strict";
2
-
3
- import { memo, useMemo } from 'react';
4
- import { KContainer, KLabel } from '@droppii/libs';
5
- import { CHAT_BUBBLE_COLORS } from "./constants.js";
6
- import { jsx as _jsx } from "react/jsx-runtime";
7
- const formatTime = date => date.toLocaleTimeString('vi-VN', {
8
- hour: '2-digit',
9
- minute: '2-digit',
10
- hour12: false
11
- });
12
- const formatDayLabel = createdAt => {
13
- const date = new Date(createdAt);
14
- if (Number.isNaN(date.getTime())) {
15
- return null;
16
- }
17
- const today = new Date();
18
- today.setHours(0, 0, 0, 0);
19
- const messageDay = new Date(date);
20
- messageDay.setHours(0, 0, 0, 0);
21
- if (messageDay.getTime() === today.getTime()) {
22
- return `${formatTime(date)} Hôm nay`;
23
- }
24
- const yesterday = new Date(today);
25
- yesterday.setDate(yesterday.getDate() - 1);
26
- if (messageDay.getTime() === yesterday.getTime()) {
27
- return `${formatTime(date)} Hôm qua`;
28
- }
29
- if (messageDay.getFullYear() === today.getFullYear()) {
30
- return `${formatTime(date)} ${date.toLocaleDateString('vi-VN', {
31
- day: 'numeric',
32
- month: 'long'
33
- })}`;
34
- }
35
- return `${formatTime(date)} ${date.toLocaleDateString('vi-VN', {
36
- day: 'numeric',
37
- month: 'long',
38
- year: 'numeric'
39
- })}`;
40
- };
41
- export const ChatDay = /*#__PURE__*/memo(({
42
- createdAt,
43
- containerStyle,
44
- wrapperStyle
45
- }) => {
46
- const dateStr = useMemo(() => createdAt == null ? null : formatDayLabel(createdAt), [createdAt]);
47
- if (!dateStr) {
48
- return null;
49
- }
50
- return /*#__PURE__*/_jsx(KContainer.View, {
51
- center: true,
52
- marginV: "0.5rem",
53
- style: containerStyle,
54
- children: /*#__PURE__*/_jsx(KContainer.View, {
55
- style: wrapperStyle,
56
- children: /*#__PURE__*/_jsx(KLabel.Text, {
57
- typo: "TextXsNormal",
58
- color: CHAT_BUBBLE_COLORS.dayLabel,
59
- children: dateStr
60
- })
61
- })
62
- });
63
- });
64
- ChatDay.displayName = 'ChatDay';
65
- //# sourceMappingURL=ChatDay.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["memo","useMemo","KContainer","KLabel","CHAT_BUBBLE_COLORS","jsx","_jsx","formatTime","date","toLocaleTimeString","hour","minute","hour12","formatDayLabel","createdAt","Date","Number","isNaN","getTime","today","setHours","messageDay","yesterday","setDate","getDate","getFullYear","toLocaleDateString","day","month","year","ChatDay","containerStyle","wrapperStyle","dateStr","View","center","marginV","style","children","Text","typo","color","dayLabel","displayName"],"sourceRoot":"../../../../src","sources":["screens/chat-detail/ChatDay.tsx"],"mappings":"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","ignoreList":[]}
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- export const DChatMessageType = {
4
- Text: 'TEXT',
5
- Link: 'LINK',
6
- Image: 'IMAGE',
7
- Video: 'VIDEO',
8
- File: 'FILE',
9
- Merged: 'MERGED',
10
- Order: 'ORDER',
11
- Unsupported: 'UNSUPPORTED'
12
- };
13
- export const CUSTOM_MESSAGE_DATA_TYPE = {
14
- LINK: 'LINK',
15
- ORDER: 'ORDER'
16
- };
17
- //# sourceMappingURL=message.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["DChatMessageType","Text","Link","Image","Video","File","Merged","Order","Unsupported","CUSTOM_MESSAGE_DATA_TYPE","LINK","ORDER"],"sourceRoot":"../../../src","sources":["types/message.ts"],"mappings":";;AAAA,OAAO,MAAMA,gBAAgB,GAAG;EAC9BC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE,OAAO;EACdC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE,OAAO;EACdC,WAAW,EAAE;AACf,CAAU;AAKV,OAAO,MAAMC,wBAAwB,GAAG;EACtCC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE;AACT,CAAU","ignoreList":[]}
@@ -1,47 +0,0 @@
1
- "use strict";
2
-
3
- import { MessageType } from '@droppii/openim-rn-client-sdk';
4
- import { CUSTOM_MESSAGE_DATA_TYPE, DChatMessageType } from "../types/message.js";
5
- const parseCustomDataType = message => {
6
- const data = message.customElem?.data;
7
- if (!data) {
8
- return undefined;
9
- }
10
- try {
11
- const parsed = JSON.parse(data);
12
- return parsed.type ?? parsed.messageType;
13
- } catch {
14
- return undefined;
15
- }
16
- };
17
- export const resolveChatMessageType = message => {
18
- switch (message.contentType) {
19
- case MessageType.TextMessage:
20
- case MessageType.AtTextMessage:
21
- case MessageType.QuoteMessage:
22
- return DChatMessageType.Text;
23
- case MessageType.PictureMessage:
24
- return DChatMessageType.Image;
25
- case MessageType.VideoMessage:
26
- return DChatMessageType.Video;
27
- case MessageType.FileMessage:
28
- return DChatMessageType.File;
29
- case 107:
30
- // MergerMessage (merged/grouped messages)
31
- return DChatMessageType.Merged;
32
- case MessageType.CustomMessage:
33
- {
34
- const customType = parseCustomDataType(message);
35
- if (customType === CUSTOM_MESSAGE_DATA_TYPE.ORDER) {
36
- return DChatMessageType.Order;
37
- }
38
- if (customType === CUSTOM_MESSAGE_DATA_TYPE.LINK) {
39
- return DChatMessageType.Link;
40
- }
41
- return DChatMessageType.Unsupported;
42
- }
43
- default:
44
- return DChatMessageType.Unsupported;
45
- }
46
- };
47
- //# sourceMappingURL=resolveMessageType.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["MessageType","CUSTOM_MESSAGE_DATA_TYPE","DChatMessageType","parseCustomDataType","message","data","customElem","undefined","parsed","JSON","parse","type","messageType","resolveChatMessageType","contentType","TextMessage","AtTextMessage","QuoteMessage","Text","PictureMessage","Image","VideoMessage","Video","FileMessage","File","Merged","CustomMessage","customType","ORDER","Order","LINK","Link","Unsupported"],"sourceRoot":"../../../src","sources":["utils/resolveMessageType.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,+BAA+B;AAE3D,SAASC,wBAAwB,EAAEC,gBAAgB,QAAQ,qBAAkB;AAE7E,MAAMC,mBAAmB,GAAIC,OAAqB,IAAyB;EACzE,MAAMC,IAAI,GAAGD,OAAO,CAACE,UAAU,EAAED,IAAI;EACrC,IAAI,CAACA,IAAI,EAAE;IACT,OAAOE,SAAS;EAClB;EAEA,IAAI;IACF,MAAMC,MAAM,GAAGC,IAAI,CAACC,KAAK,CAACL,IAAI,CAA4C;IAC1E,OAAOG,MAAM,CAACG,IAAI,IAAIH,MAAM,CAACI,WAAW;EAC1C,CAAC,CAAC,MAAM;IACN,OAAOL,SAAS;EAClB;AACF,CAAC;AAED,OAAO,MAAMM,sBAAsB,GACjCT,OAAqB,IACA;EACrB,QAAQA,OAAO,CAACU,WAAW;IACzB,KAAKd,WAAW,CAACe,WAAW;IAC5B,KAAKf,WAAW,CAACgB,aAAa;IAC9B,KAAKhB,WAAW,CAACiB,YAAY;MAC3B,OAAOf,gBAAgB,CAACgB,IAAI;IAC9B,KAAKlB,WAAW,CAACmB,cAAc;MAC7B,OAAOjB,gBAAgB,CAACkB,KAAK;IAC/B,KAAKpB,WAAW,CAACqB,YAAY;MAC3B,OAAOnB,gBAAgB,CAACoB,KAAK;IAC/B,KAAKtB,WAAW,CAACuB,WAAW;MAC1B,OAAOrB,gBAAgB,CAACsB,IAAI;IAC9B,KAAK,GAAG;MAAE;MACR,OAAOtB,gBAAgB,CAACuB,MAAM;IAChC,KAAKzB,WAAW,CAAC0B,aAAa;MAAE;QAC9B,MAAMC,UAAU,GAAGxB,mBAAmB,CAACC,OAAO,CAAC;QAE/C,IAAIuB,UAAU,KAAK1B,wBAAwB,CAAC2B,KAAK,EAAE;UACjD,OAAO1B,gBAAgB,CAAC2B,KAAK;QAC/B;QAEA,IAAIF,UAAU,KAAK1B,wBAAwB,CAAC6B,IAAI,EAAE;UAChD,OAAO5B,gBAAgB,CAAC6B,IAAI;QAC9B;QAEA,OAAO7B,gBAAgB,CAAC8B,WAAW;MACrC;IACA;MACE,OAAO9B,gBAAgB,CAAC8B,WAAW;EACvC;AACF,CAAC","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import type { DayProps } from 'react-native-gifted-chat';
2
- export declare const ChatDay: import("react").MemoExoticComponent<({ createdAt, containerStyle, wrapperStyle }: DayProps) => import("react").JSX.Element>;
3
- //# sourceMappingURL=ChatDay.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChatDay.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/ChatDay.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AA+CzD,eAAO,MAAM,OAAO,oFAC4B,QAAQ,iCAoBvD,CAAC"}
@@ -1,16 +0,0 @@
1
- export declare const DChatMessageType: {
2
- readonly Text: "TEXT";
3
- readonly Link: "LINK";
4
- readonly Image: "IMAGE";
5
- readonly Video: "VIDEO";
6
- readonly File: "FILE";
7
- readonly Merged: "MERGED";
8
- readonly Order: "ORDER";
9
- readonly Unsupported: "UNSUPPORTED";
10
- };
11
- export type DChatMessageType = (typeof DChatMessageType)[keyof typeof DChatMessageType];
12
- export declare const CUSTOM_MESSAGE_DATA_TYPE: {
13
- readonly LINK: "LINK";
14
- readonly ORDER: "ORDER";
15
- };
16
- //# sourceMappingURL=message.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../src/types/message.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;;;;;;CASnB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAE3D,eAAO,MAAM,wBAAwB;;;CAG3B,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { DMessageItem } from '../types/chat';
2
- import { DChatMessageType } from '../types/message';
3
- export declare const resolveChatMessageType: (message: DMessageItem) => DChatMessageType;
4
- //# sourceMappingURL=resolveMessageType.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolveMessageType.d.ts","sourceRoot":"","sources":["../../../../src/utils/resolveMessageType.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAA4B,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAgB9E,eAAO,MAAM,sBAAsB,GACjC,SAAS,YAAY,KACpB,gBA8BF,CAAC"}
@@ -1,73 +0,0 @@
1
- import { memo, useMemo } from 'react';
2
- import { KContainer, KLabel } from '@droppii/libs';
3
- import type { DayProps } from 'react-native-gifted-chat';
4
- import { CHAT_BUBBLE_COLORS } from './constants';
5
-
6
- const formatTime = (date: Date) =>
7
- date.toLocaleTimeString('vi-VN', {
8
- hour: '2-digit',
9
- minute: '2-digit',
10
- hour12: false,
11
- });
12
-
13
- const formatDayLabel = (createdAt: Date | number): string | null => {
14
- const date = new Date(createdAt);
15
- if (Number.isNaN(date.getTime())) {
16
- return null;
17
- }
18
-
19
- const today = new Date();
20
- today.setHours(0, 0, 0, 0);
21
-
22
- const messageDay = new Date(date);
23
- messageDay.setHours(0, 0, 0, 0);
24
-
25
- if (messageDay.getTime() === today.getTime()) {
26
- return `${formatTime(date)} Hôm nay`;
27
- }
28
-
29
- const yesterday = new Date(today);
30
- yesterday.setDate(yesterday.getDate() - 1);
31
-
32
- if (messageDay.getTime() === yesterday.getTime()) {
33
- return `${formatTime(date)} Hôm qua`;
34
- }
35
-
36
- if (messageDay.getFullYear() === today.getFullYear()) {
37
- return `${formatTime(date)} ${date.toLocaleDateString('vi-VN', {
38
- day: 'numeric',
39
- month: 'long',
40
- })}`;
41
- }
42
-
43
- return `${formatTime(date)} ${date.toLocaleDateString('vi-VN', {
44
- day: 'numeric',
45
- month: 'long',
46
- year: 'numeric',
47
- })}`;
48
- };
49
-
50
- export const ChatDay = memo(
51
- ({ createdAt, containerStyle, wrapperStyle }: DayProps) => {
52
- const dateStr = useMemo(
53
- () => (createdAt == null ? null : formatDayLabel(createdAt)),
54
- [createdAt]
55
- );
56
-
57
- if (!dateStr) {
58
- return null;
59
- }
60
-
61
- return (
62
- <KContainer.View center marginV="0.5rem" style={containerStyle}>
63
- <KContainer.View style={wrapperStyle}>
64
- <KLabel.Text typo="TextXsNormal" color={CHAT_BUBBLE_COLORS.dayLabel}>
65
- {dateStr}
66
- </KLabel.Text>
67
- </KContainer.View>
68
- </KContainer.View>
69
- );
70
- }
71
- );
72
-
73
- ChatDay.displayName = 'ChatDay';
@@ -1,18 +0,0 @@
1
- export const DChatMessageType = {
2
- Text: 'TEXT',
3
- Link: 'LINK',
4
- Image: 'IMAGE',
5
- Video: 'VIDEO',
6
- File: 'FILE',
7
- Merged: 'MERGED',
8
- Order: 'ORDER',
9
- Unsupported: 'UNSUPPORTED',
10
- } as const;
11
-
12
- export type DChatMessageType =
13
- (typeof DChatMessageType)[keyof typeof DChatMessageType];
14
-
15
- export const CUSTOM_MESSAGE_DATA_TYPE = {
16
- LINK: 'LINK',
17
- ORDER: 'ORDER',
18
- } as const;