@droppii-org/chat-mobile 0.2.11 → 0.2.13
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/lib/module/components/ThreadCard/AvatarSection.js +2 -3
- package/lib/module/components/ThreadCard/AvatarSection.js.map +1 -1
- package/lib/module/components/flows/inputButtons/index.js +77 -0
- package/lib/module/components/flows/inputButtons/index.js.map +1 -0
- package/lib/module/components/messages/linkMessage/index.js +35 -7
- package/lib/module/components/messages/linkMessage/index.js.map +1 -1
- package/lib/module/config/api-endpoints.js +1 -0
- package/lib/module/config/api-endpoints.js.map +1 -1
- package/lib/module/context/ChatDetailContext.js +57 -0
- package/lib/module/context/ChatDetailContext.js.map +1 -0
- package/lib/module/hooks/flows/useCurrentConversationFlow.js +9 -0
- package/lib/module/hooks/flows/useCurrentConversationFlow.js.map +1 -0
- package/lib/module/hooks/flows/useFlow.js +57 -0
- package/lib/module/hooks/flows/useFlow.js.map +1 -0
- package/lib/module/hooks/message/useSendMessage.js +4 -2
- package/lib/module/hooks/message/useSendMessage.js.map +1 -1
- package/lib/module/hooks/query-keys.js +4 -1
- package/lib/module/hooks/query-keys.js.map +1 -1
- package/lib/module/hooks/useConversationList.js +1 -1
- package/lib/module/hooks/useConversationList.js.map +1 -1
- package/lib/module/hooks/useLinkPreview/useFetchUrlMetadata.js +6 -4
- package/lib/module/hooks/useLinkPreview/useFetchUrlMetadata.js.map +1 -1
- package/lib/module/hooks/useLinkPreview/useLinkPreview.js +2 -2
- package/lib/module/hooks/useLinkPreview/useLinkPreview.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatComposer.js +41 -3
- package/lib/module/screens/chat-detail/ChatComposer.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatDetail.js +65 -60
- package/lib/module/screens/chat-detail/ChatDetail.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatListLegend.js +45 -10
- package/lib/module/screens/chat-detail/ChatListLegend.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatQuickActions.js +12 -3
- package/lib/module/screens/chat-detail/ChatQuickActions.js.map +1 -1
- package/lib/module/screens/chat-detail/conversationHeader.utils.js +1 -1
- package/lib/module/screens/chat-detail/conversationHeader.utils.js.map +1 -1
- package/lib/module/screens/chat-detail/legend/LegendChatMessage.js +6 -1
- package/lib/module/screens/chat-detail/legend/LegendChatMessage.js.map +1 -1
- package/lib/module/screens/inbox/Inbox.js +1 -3
- package/lib/module/screens/inbox/Inbox.js.map +1 -1
- package/lib/module/screens/inbox/MessagesTab.js +2 -1
- package/lib/module/screens/inbox/MessagesTab.js.map +1 -1
- package/lib/module/services/endpoints.js +4 -1
- package/lib/module/services/endpoints.js.map +1 -1
- package/lib/module/translation/resources/i18n.js +3 -1
- package/lib/module/translation/resources/i18n.js.map +1 -1
- package/lib/module/types/chat.js.map +1 -1
- package/lib/module/types/flows.js +17 -0
- package/lib/module/types/flows.js.map +1 -0
- package/lib/module/utils/flows.js +11 -0
- package/lib/module/utils/flows.js.map +1 -0
- package/lib/module/utils/url.js +12 -1
- package/lib/module/utils/url.js.map +1 -1
- package/lib/typescript/src/components/ThreadCard/AvatarSection.d.ts +1 -1
- package/lib/typescript/src/components/ThreadCard/AvatarSection.d.ts.map +1 -1
- package/lib/typescript/src/components/flows/inputButtons/index.d.ts +9 -0
- package/lib/typescript/src/components/flows/inputButtons/index.d.ts.map +1 -0
- package/lib/typescript/src/components/messages/linkMessage/index.d.ts +2 -1
- package/lib/typescript/src/components/messages/linkMessage/index.d.ts.map +1 -1
- package/lib/typescript/src/config/api-endpoints.d.ts +1 -0
- package/lib/typescript/src/config/api-endpoints.d.ts.map +1 -1
- package/lib/typescript/src/context/ChatDetailContext.d.ts +5 -0
- package/lib/typescript/src/context/ChatDetailContext.d.ts.map +1 -0
- package/lib/typescript/src/hooks/flows/useCurrentConversationFlow.d.ts +3 -0
- package/lib/typescript/src/hooks/flows/useCurrentConversationFlow.d.ts.map +1 -0
- package/lib/typescript/src/hooks/flows/useFlow.d.ts +4 -0
- package/lib/typescript/src/hooks/flows/useFlow.d.ts.map +1 -0
- package/lib/typescript/src/hooks/message/useSendMessage.d.ts +3 -1
- package/lib/typescript/src/hooks/message/useSendMessage.d.ts.map +1 -1
- package/lib/typescript/src/hooks/query-keys.d.ts +3 -0
- package/lib/typescript/src/hooks/query-keys.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useConversationList.d.ts +2 -2
- package/lib/typescript/src/hooks/useConversationList.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useLinkPreview/useFetchUrlMetadata.d.ts +6 -2
- package/lib/typescript/src/hooks/useLinkPreview/useFetchUrlMetadata.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useLinkPreview/useLinkPreview.d.ts +6 -1
- package/lib/typescript/src/hooks/useLinkPreview/useLinkPreview.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatComposer.d.ts +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatComposer.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatListLegend.d.ts +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatListLegend.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatQuickActions.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/conversationHeader.utils.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/legend/LegendChatMessage.d.ts +2 -1
- package/lib/typescript/src/screens/chat-detail/legend/LegendChatMessage.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/types.d.ts +5 -10
- package/lib/typescript/src/screens/chat-detail/types.d.ts.map +1 -1
- package/lib/typescript/src/screens/inbox/Inbox.d.ts +1 -2
- package/lib/typescript/src/screens/inbox/Inbox.d.ts.map +1 -1
- package/lib/typescript/src/screens/inbox/MessagesTab.d.ts +1 -2
- package/lib/typescript/src/screens/inbox/MessagesTab.d.ts.map +1 -1
- package/lib/typescript/src/services/endpoints.d.ts +3 -0
- package/lib/typescript/src/services/endpoints.d.ts.map +1 -1
- package/lib/typescript/src/translation/resources/i18n.d.ts.map +1 -1
- package/lib/typescript/src/types/chat.d.ts +11 -1
- package/lib/typescript/src/types/chat.d.ts.map +1 -1
- package/lib/typescript/src/types/flows.d.ts +82 -0
- package/lib/typescript/src/types/flows.d.ts.map +1 -0
- package/lib/typescript/src/utils/flows.d.ts +4 -0
- package/lib/typescript/src/utils/flows.d.ts.map +1 -0
- package/lib/typescript/src/utils/url.d.ts.map +1 -1
- package/package.json +6 -4
- package/src/components/ThreadCard/AvatarSection.tsx +2 -2
- package/src/components/flows/inputButtons/index.tsx +105 -0
- package/src/components/messages/linkMessage/index.tsx +48 -8
- package/src/config/api-endpoints.ts +2 -0
- package/src/context/ChatDetailContext.tsx +85 -0
- package/src/hooks/flows/useCurrentConversationFlow.ts +11 -0
- package/src/hooks/flows/useFlow.ts +63 -0
- package/src/hooks/message/useSendMessage.ts +4 -0
- package/src/hooks/query-keys.ts +6 -0
- package/src/hooks/useConversationList.ts +15 -7
- package/src/hooks/useLinkPreview/useFetchUrlMetadata.ts +7 -3
- package/src/hooks/useLinkPreview/useLinkPreview.ts +2 -2
- package/src/index.tsx +1 -0
- package/src/screens/chat-detail/ChatComposer.tsx +41 -2
- package/src/screens/chat-detail/ChatDetail.tsx +81 -74
- package/src/screens/chat-detail/ChatListLegend.tsx +57 -3
- package/src/screens/chat-detail/ChatQuickActions.tsx +10 -3
- package/src/screens/chat-detail/conversationHeader.utils.ts +1 -4
- package/src/screens/chat-detail/legend/LegendChatMessage.tsx +7 -0
- package/src/screens/chat-detail/types.ts +9 -10
- package/src/screens/inbox/Inbox.tsx +3 -15
- package/src/screens/inbox/MessagesTab.tsx +48 -49
- package/src/services/endpoints.ts +6 -0
- package/src/translation/resources/i18n.ts +2 -0
- package/src/types/chat.ts +16 -1
- package/src/types/flows.ts +102 -0
- package/src/utils/flows.ts +18 -0
- package/src/utils/url.ts +30 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { MediaItem } from '../../hooks/useMediaViewer';
|
|
3
|
-
import type { DConversationItem, DMessageItem } from '../../types/chat';
|
|
3
|
+
import type { DChatApplicationType, DConversationItem, DMessageItem } from '../../types/chat';
|
|
4
4
|
import type { IUrlMetadata } from '../../types/common';
|
|
5
5
|
import type { PeerType } from '@droppii/openim-rn-client-sdk';
|
|
6
6
|
export type DChatActionIconProvider = 'MaterialCommunityIcons' | 'DroppiiNew';
|
|
@@ -63,6 +63,7 @@ export interface ChatComposerProps {
|
|
|
63
63
|
renderQuickActions?: ChatQuickActionsProps['renderQuickActions'];
|
|
64
64
|
renderAttachmentAction?: ChatAttachmentPanelProps['renderAction'];
|
|
65
65
|
attachmentColumns?: number;
|
|
66
|
+
isEmptyMessage: boolean;
|
|
66
67
|
}
|
|
67
68
|
export interface ChatListProps {
|
|
68
69
|
messages?: DMessageItem[];
|
|
@@ -76,6 +77,7 @@ export interface ChatListProps {
|
|
|
76
77
|
isLoadingNewer?: boolean;
|
|
77
78
|
hasMoreNewer?: boolean;
|
|
78
79
|
onMediaPress?: (items: MediaItem[], index?: number) => void;
|
|
80
|
+
onPressUrl?: (url: string) => void;
|
|
79
81
|
}
|
|
80
82
|
export interface ChatDetailProps extends Omit<ChatDetailHeaderProps, 'title' | 'subtitle' | 'avatarUri' | 'avatarFullName' | 'peerType' | 'applicationType' | 'showAddMember'> {
|
|
81
83
|
conversationId: string;
|
|
@@ -85,23 +87,15 @@ export interface ChatDetailProps extends Omit<ChatDetailHeaderProps, 'title' | '
|
|
|
85
87
|
avatarUri?: string | null;
|
|
86
88
|
avatarFullName?: string;
|
|
87
89
|
peerType?: PeerType;
|
|
88
|
-
applicationType?:
|
|
90
|
+
applicationType?: DChatApplicationType;
|
|
89
91
|
showAddMember?: boolean;
|
|
90
92
|
getSubtitle?: (conversation: DConversationItem) => string | undefined;
|
|
91
93
|
renderChat?: (item: DMessageItem) => ReactNode;
|
|
92
94
|
showQuickActions?: boolean;
|
|
93
95
|
showAttachmentActions?: boolean;
|
|
94
|
-
onLoadEarlier?: () => void;
|
|
95
|
-
isLoading?: boolean;
|
|
96
|
-
isLoadingEarlier?: boolean;
|
|
97
|
-
hasMoreEarlier?: boolean;
|
|
98
|
-
onLoadNewer?: () => void;
|
|
99
|
-
isLoadingNewer?: boolean;
|
|
100
|
-
hasMoreNewer?: boolean;
|
|
101
96
|
quickActions?: DChatQuickAction[];
|
|
102
97
|
getQuickActions?: (conversation: DConversationItem) => DChatQuickAction[] | undefined;
|
|
103
98
|
attachmentActions?: DChatAttachmentAction[];
|
|
104
|
-
inputValue?: string;
|
|
105
99
|
inputPlaceholder?: string;
|
|
106
100
|
onChangeInput?: (text: string) => void;
|
|
107
101
|
onSend?: () => void;
|
|
@@ -113,5 +107,6 @@ export interface ChatDetailProps extends Omit<ChatDetailHeaderProps, 'title' | '
|
|
|
113
107
|
renderQuickActions?: ChatQuickActionsProps['renderQuickActions'];
|
|
114
108
|
renderAttachmentAction?: ChatAttachmentPanelProps['renderAction'];
|
|
115
109
|
attachmentColumns?: number;
|
|
110
|
+
onPressUrl?: (url: string) => void;
|
|
116
111
|
}
|
|
117
112
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/types.ts"],"names":[],"mappings":"AA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,CAAC;IAC1D,kBAAkB,CAAC,EAAE,qBAAqB,CAAC,oBAAoB,CAAC,CAAC;IACjE,sBAAsB,CAAC,EAAE,wBAAwB,CAAC,cAAc,CAAC,CAAC;IAClE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
interface InboxProps {
|
|
2
|
-
applicationType: string;
|
|
3
2
|
onPressThread?: (item: string) => void;
|
|
4
3
|
onPressSearch?: () => void;
|
|
5
4
|
onPressEdit?: () => void;
|
|
6
5
|
onPressGroup?: () => void;
|
|
7
6
|
}
|
|
8
|
-
declare const Inbox: import("react").MemoExoticComponent<({
|
|
7
|
+
declare const Inbox: import("react").MemoExoticComponent<({ onPressThread, onPressSearch, onPressEdit, onPressGroup }: InboxProps) => import("react").JSX.Element>;
|
|
9
8
|
export default Inbox;
|
|
10
9
|
//# sourceMappingURL=Inbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Inbox.d.ts","sourceRoot":"","sources":["../../../../../src/screens/inbox/Inbox.tsx"],"names":[],"mappings":"AAMA,UAAU,UAAU;IAClB,
|
|
1
|
+
{"version":3,"file":"Inbox.d.ts","sourceRoot":"","sources":["../../../../../src/screens/inbox/Inbox.tsx"],"names":[],"mappings":"AAMA,UAAU,UAAU;IAClB,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAID,QAAA,MAAM,KAAK,oGACqD,UAAU,iCA0GzE,CAAC;AAIF,eAAe,KAAK,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
interface MessagesTabProps {
|
|
2
|
-
applicationType: string;
|
|
3
2
|
onPressThread?: (item: string) => void;
|
|
4
3
|
}
|
|
5
|
-
export declare const MessagesTab: import("react").MemoExoticComponent<({
|
|
4
|
+
export declare const MessagesTab: import("react").MemoExoticComponent<({ onPressThread }: MessagesTabProps) => import("react").JSX.Element>;
|
|
6
5
|
export {};
|
|
7
6
|
//# sourceMappingURL=MessagesTab.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessagesTab.d.ts","sourceRoot":"","sources":["../../../../../src/screens/inbox/MessagesTab.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MessagesTab.d.ts","sourceRoot":"","sources":["../../../../../src/screens/inbox/MessagesTab.tsx"],"names":[],"mappings":"AAQA,UAAU,gBAAgB;IACxB,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAKD,eAAO,MAAM,WAAW,0DAA4B,gBAAgB,iCAqDlE,CAAC"}
|
|
@@ -7,6 +7,9 @@ import { getApiEndpoint, setApiEndpoint, getAllApiEndpoints } from '../config/ap
|
|
|
7
7
|
export declare const ENDPOINTS: {
|
|
8
8
|
chatService: {
|
|
9
9
|
readonly urlMetadata: string;
|
|
10
|
+
conversationFlow: (id: string) => string;
|
|
11
|
+
resetConversationFlow: (id: string) => string;
|
|
12
|
+
runConversationFlow: (id: string) => string;
|
|
10
13
|
};
|
|
11
14
|
uploaderService: {
|
|
12
15
|
readonly uploadImage: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../../../src/services/endpoints.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,cAAc,EACd,cAAc,EACd,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AAGjC,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../../../src/services/endpoints.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,cAAc,EACd,cAAc,EACd,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AAGjC,eAAO,MAAM,SAAS;;;+BAKK,MAAM;oCAED,MAAM;kCAER,MAAM;;;;;CAQnC,CAAC;AAGF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../../src/translation/resources/i18n.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../../src/translation/resources/i18n.ts"],"names":[],"mappings":";;;AA2BA,wBAEE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type MessageItem, type ConversationItem, PeerType } from '@droppii/openim-rn-client-sdk';
|
|
2
2
|
import type { PropsWithChildren } from 'react';
|
|
3
3
|
import type { IUrlMetadata } from './common';
|
|
4
|
+
import type { IConversationFlow, IConversationFlowStep, IRunConversationFlowPayload } from './flows';
|
|
4
5
|
export declare const EventProvider: {
|
|
5
6
|
readonly ga: "ga";
|
|
6
7
|
readonly appsflyer: "appsflyer";
|
|
@@ -47,7 +48,7 @@ export interface DConversationItem extends ConversationItem {
|
|
|
47
48
|
conversationId: string;
|
|
48
49
|
chatCategory: DChatCategory;
|
|
49
50
|
chatType: PeerType;
|
|
50
|
-
applicationType:
|
|
51
|
+
applicationType: DChatApplicationType;
|
|
51
52
|
memberRole: DMemberRole;
|
|
52
53
|
pinnedAt: string | null;
|
|
53
54
|
isMuted: boolean;
|
|
@@ -97,6 +98,7 @@ export interface IMessageItemEx {
|
|
|
97
98
|
content: string;
|
|
98
99
|
};
|
|
99
100
|
urlMetadata?: IUrlMetadata;
|
|
101
|
+
flow?: IRunConversationFlowPayload;
|
|
100
102
|
}
|
|
101
103
|
export interface MessageStore {
|
|
102
104
|
messages: DMessageItem[];
|
|
@@ -108,5 +110,13 @@ export interface MessageStore {
|
|
|
108
110
|
deleteOneMessage: (clientMsgID: string) => void;
|
|
109
111
|
reset: () => void;
|
|
110
112
|
}
|
|
113
|
+
export interface ChatDetailContextType {
|
|
114
|
+
conversationFlow?: IConversationFlow;
|
|
115
|
+
refetchConversationFlow: () => void;
|
|
116
|
+
isBotConversation: boolean;
|
|
117
|
+
setConverationFlowStep: (step: IConversationFlowStep) => void;
|
|
118
|
+
}
|
|
119
|
+
export interface ChatDetailProviderProps extends PropsWithChildren {
|
|
120
|
+
}
|
|
111
121
|
export {};
|
|
112
122
|
//# sourceMappingURL=chat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../../src/types/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,QAAQ,EACT,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../../src/types/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,QAAQ,EACT,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,KAAK,KAAK,GAAG,CACX,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,GAAG,EACZ,QAAQ,CAAC,EAAE,GAAG,MAAM,OAAO,aAAa,E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AAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAClE,cAAc,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,gBAAgB,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IACjD,gBAAgB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IACrC,uBAAuB,EAAE,MAAM,IAAI,CAAC;IACpC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,sBAAsB,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;CAC/D;AAED,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;CAAG"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { PeerType } from '@droppii/openim-rn-client-sdk';
|
|
2
|
+
import type { DChatApplicationType, DChatCategory } from './chat';
|
|
3
|
+
/** START NODE TYPE */
|
|
4
|
+
export declare const NodeTypes: {
|
|
5
|
+
readonly BubbleText: "bubble-text";
|
|
6
|
+
readonly BubbleImage: "bubble-image";
|
|
7
|
+
readonly InputText: "input-text";
|
|
8
|
+
readonly InputButtons: "input-buttons";
|
|
9
|
+
readonly LogicCsTeam: "logic-cs-team";
|
|
10
|
+
};
|
|
11
|
+
export type NodeTypes = (typeof NodeTypes)[keyof typeof NodeTypes];
|
|
12
|
+
export declare const ReactFlowsNodeTypes: {
|
|
13
|
+
readonly Group: "group";
|
|
14
|
+
readonly Start: "start";
|
|
15
|
+
};
|
|
16
|
+
export type ReactFlowsNodeTypes = (typeof ReactFlowsNodeTypes)[keyof typeof ReactFlowsNodeTypes];
|
|
17
|
+
export interface BaseNodeData {
|
|
18
|
+
id: string;
|
|
19
|
+
type: NodeTypes;
|
|
20
|
+
parentId: string;
|
|
21
|
+
}
|
|
22
|
+
export interface BubbleTextNodeData {
|
|
23
|
+
content?: string;
|
|
24
|
+
plainText?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface BubbleImageNodeData {
|
|
27
|
+
sourceType: 'link' | 'upload' | 'giphy' | 'unsplash' | 'icon';
|
|
28
|
+
url?: string;
|
|
29
|
+
onClickLink?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface InputButtonItem {
|
|
32
|
+
id: string;
|
|
33
|
+
label: string;
|
|
34
|
+
}
|
|
35
|
+
export interface LogicCsTeamNodeData {
|
|
36
|
+
csTeamId?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface InputButtonsNodeData {
|
|
39
|
+
buttons?: InputButtonItem[];
|
|
40
|
+
}
|
|
41
|
+
export interface InputTextNodeData {
|
|
42
|
+
longText?: boolean;
|
|
43
|
+
placeholder?: string;
|
|
44
|
+
buttonLabel?: string;
|
|
45
|
+
}
|
|
46
|
+
export type NodeDataMap = {
|
|
47
|
+
[NodeTypes.BubbleText]: BubbleTextNodeData;
|
|
48
|
+
[NodeTypes.BubbleImage]: BubbleImageNodeData;
|
|
49
|
+
[NodeTypes.InputText]: InputTextNodeData;
|
|
50
|
+
[NodeTypes.InputButtons]: InputButtonsNodeData;
|
|
51
|
+
[NodeTypes.LogicCsTeam]: LogicCsTeamNodeData;
|
|
52
|
+
};
|
|
53
|
+
export type GroupChild<T extends NodeTypes = NodeTypes> = {
|
|
54
|
+
data: NodeDataMap[T];
|
|
55
|
+
} & BaseNodeData;
|
|
56
|
+
export interface GroupNodeData {
|
|
57
|
+
label: string;
|
|
58
|
+
children: GroupChild[];
|
|
59
|
+
}
|
|
60
|
+
/** END NODE TYPE */
|
|
61
|
+
export interface IConversationFlowStep {
|
|
62
|
+
id: string;
|
|
63
|
+
type: ReactFlowsNodeTypes;
|
|
64
|
+
data: GroupNodeData;
|
|
65
|
+
}
|
|
66
|
+
export interface IConversationFlow {
|
|
67
|
+
conversationId: string;
|
|
68
|
+
chatCategory: DChatCategory;
|
|
69
|
+
chatType: PeerType;
|
|
70
|
+
applicationType: DChatApplicationType;
|
|
71
|
+
flowCurrentStep: IConversationFlowStep | null;
|
|
72
|
+
}
|
|
73
|
+
export interface IRunConversationFlowResponse {
|
|
74
|
+
flowNextStep: IConversationFlowStep | null;
|
|
75
|
+
}
|
|
76
|
+
export interface IRunConversationFlowPayload {
|
|
77
|
+
groupId: string;
|
|
78
|
+
childId: string | null;
|
|
79
|
+
actionId: string | null;
|
|
80
|
+
plainText?: string;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=flows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../../../src/types/flows.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAElE,sBAAsB;AACtB,eAAO,MAAM,SAAS;;;;;;CAMZ,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAEnE,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAC7B,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAEjE,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,GAAG,QAAQ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Ac,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,aAAa,CAAC;IAC5B,QAAQ,EAAE,QAAQ,CAAC;IACnB,eAAe,EAAE,oBAAoB,CAAC;IACtC,eAAe,EAAE,qBAAqB,GAAG,IAAI,CAAC;CAC/C;AAED,MAAM,WAAW,4BAA4B;IAC3C,YAAY,EAAE,qBAAqB,GAAG,IAAI,CAAC;CAC5C;AAED,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type GroupChild, type IConversationFlowStep } from '../types/flows';
|
|
2
|
+
export declare const getFlowInputButtonsNode: (step?: IConversationFlowStep | null) => GroupChild<"input-buttons">;
|
|
3
|
+
export declare const DEFAULT_BUTTON_ID = "default-item-button";
|
|
4
|
+
//# sourceMappingURL=flows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../../../src/utils/flows.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC3B,MAAM,gBAAgB,CAAC;AAExB,eAAO,MAAM,uBAAuB,GAClC,OAAO,qBAAqB,GAAG,IAAI,gCAQpC,CAAC;AAEF,eAAO,MAAM,iBAAiB,wBAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../../src/utils/url.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../../src/utils/url.ts"],"names":[],"mappings":"AA+BA,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAElD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@droppii-org/chat-mobile",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.13",
|
|
4
4
|
"description": "Droppii chat mobile",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -53,7 +53,8 @@
|
|
|
53
53
|
"!**/.*"
|
|
54
54
|
],
|
|
55
55
|
"workspaces": [
|
|
56
|
-
"example"
|
|
56
|
+
"example",
|
|
57
|
+
"exampleLegacy"
|
|
57
58
|
],
|
|
58
59
|
"scripts": {
|
|
59
60
|
"example": "yarn workspace @droppii-org/chat-mobile-example",
|
|
@@ -64,10 +65,11 @@
|
|
|
64
65
|
"test": "jest",
|
|
65
66
|
"release": "release-it --no-git --ci --no-increment",
|
|
66
67
|
"web": "vite",
|
|
67
|
-
"build:web": "vite build"
|
|
68
|
+
"build:web": "vite build",
|
|
69
|
+
"example-legacy": "yarn workspace @droppii-org/chat-mobile-example-legacy"
|
|
68
70
|
},
|
|
69
71
|
"dependencies": {
|
|
70
|
-
"@droppii/openim-rn-client-sdk": "git+ssh://git@github.com/droppii/open-im-sdk-reactnative.git#v1.0.0-
|
|
72
|
+
"@droppii/openim-rn-client-sdk": "git+ssh://git@github.com/droppii/open-im-sdk-reactnative.git#v1.0.0-rc9",
|
|
71
73
|
"@legendapp/list": "^3.0.6",
|
|
72
74
|
"axios": "^1.16.1",
|
|
73
75
|
"lodash": "^4.18.1",
|
|
@@ -11,7 +11,7 @@ interface AvatarSectionProps extends Partial<
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export const AvatarSection = memo(
|
|
14
|
-
({ avatar, fullName, peerType
|
|
14
|
+
({ avatar, fullName, peerType }: AvatarSectionProps) => {
|
|
15
15
|
if (peerType === PeerType.Bot) {
|
|
16
16
|
return (
|
|
17
17
|
<Avatar
|
|
@@ -22,7 +22,7 @@ export const AvatarSection = memo(
|
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
if (peerType === PeerType.Customer
|
|
25
|
+
if (peerType === PeerType.Customer) {
|
|
26
26
|
return (
|
|
27
27
|
<Avatar
|
|
28
28
|
source={avatar}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import {
|
|
2
|
+
KColors,
|
|
3
|
+
KContainer,
|
|
4
|
+
KImage,
|
|
5
|
+
KLabel,
|
|
6
|
+
KRadiusValue,
|
|
7
|
+
KSpacingValue,
|
|
8
|
+
} from '@droppii/libs';
|
|
9
|
+
import { memo, useCallback } from 'react';
|
|
10
|
+
import { StyleSheet } from 'react-native';
|
|
11
|
+
import { messageStyles } from '../../messages/styles';
|
|
12
|
+
import type {
|
|
13
|
+
GroupChild,
|
|
14
|
+
InputButtonItem,
|
|
15
|
+
IRunConversationFlowPayload,
|
|
16
|
+
} from '../../../types/flows';
|
|
17
|
+
import { DEFAULT_BUTTON_ID } from '../../../utils/flows';
|
|
18
|
+
import { trans } from '../../../translation';
|
|
19
|
+
|
|
20
|
+
interface IInputButtonFlow {
|
|
21
|
+
nodeData: GroupChild<'input-buttons'> | null;
|
|
22
|
+
onResetFlow: () => void;
|
|
23
|
+
onRunFlow: (payload: IRunConversationFlowPayload) => void;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const InputButtonFlow = memo((props: IInputButtonFlow) => {
|
|
27
|
+
const { nodeData, onResetFlow, onRunFlow } = props || {};
|
|
28
|
+
|
|
29
|
+
const onPressItem = useCallback(
|
|
30
|
+
(item: InputButtonItem) => {
|
|
31
|
+
if (item.id === DEFAULT_BUTTON_ID) {
|
|
32
|
+
onResetFlow?.();
|
|
33
|
+
} else {
|
|
34
|
+
onRunFlow?.({
|
|
35
|
+
actionId: item.id,
|
|
36
|
+
groupId: nodeData?.parentId || '',
|
|
37
|
+
childId: nodeData?.id || '',
|
|
38
|
+
plainText: item?.label || '',
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
[onRunFlow, onResetFlow, nodeData]
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
const renderButtonItem = useCallback(
|
|
46
|
+
(item: InputButtonItem) => {
|
|
47
|
+
return (
|
|
48
|
+
<KContainer.Touchable
|
|
49
|
+
key={item.id}
|
|
50
|
+
style={styles.buttonItem}
|
|
51
|
+
onPress={() => onPressItem(item)}
|
|
52
|
+
>
|
|
53
|
+
<KLabel.Text typo="TextMdMedium">
|
|
54
|
+
{item?.id === DEFAULT_BUTTON_ID
|
|
55
|
+
? trans('restart')
|
|
56
|
+
: item?.label || ''}
|
|
57
|
+
</KLabel.Text>
|
|
58
|
+
<KImage.VectorIcons
|
|
59
|
+
name="angle-right-o"
|
|
60
|
+
size={20}
|
|
61
|
+
color={KColors.gray.light}
|
|
62
|
+
/>
|
|
63
|
+
</KContainer.Touchable>
|
|
64
|
+
);
|
|
65
|
+
},
|
|
66
|
+
[onPressItem]
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
if (!nodeData) return null;
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<KContainer.View style={messageStyles.wrapper}>
|
|
73
|
+
<KContainer.View style={styles.bubble}>
|
|
74
|
+
<KContainer.View style={styles.buttonsContainer}>
|
|
75
|
+
{nodeData?.data?.buttons?.map((item) => renderButtonItem(item))}
|
|
76
|
+
</KContainer.View>
|
|
77
|
+
</KContainer.View>
|
|
78
|
+
</KContainer.View>
|
|
79
|
+
);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
InputButtonFlow.displayName = 'InputButtonFlow';
|
|
83
|
+
|
|
84
|
+
const styles = StyleSheet.create({
|
|
85
|
+
bubble: {
|
|
86
|
+
padding: KSpacingValue['0.5rem'],
|
|
87
|
+
borderRadius: KSpacingValue['1.25rem'],
|
|
88
|
+
...messageStyles.bubbleReceived,
|
|
89
|
+
marginVertical: KSpacingValue['0.5rem'],
|
|
90
|
+
},
|
|
91
|
+
buttonsContainer: {
|
|
92
|
+
backgroundColor: KColors.white,
|
|
93
|
+
borderRadius: KRadiusValue['3x'],
|
|
94
|
+
paddingHorizontal: KSpacingValue['0.75rem'],
|
|
95
|
+
},
|
|
96
|
+
buttonItem: {
|
|
97
|
+
flexDirection: 'row',
|
|
98
|
+
justifyContent: 'space-between',
|
|
99
|
+
alignItems: 'center',
|
|
100
|
+
gap: KSpacingValue['1rem'],
|
|
101
|
+
borderBottomWidth: 1,
|
|
102
|
+
borderBottomColor: KColors.border.light,
|
|
103
|
+
paddingVertical: KSpacingValue['0.5rem'],
|
|
104
|
+
},
|
|
105
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { memo } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
3
|
import {
|
|
4
4
|
KContainer,
|
|
5
5
|
KImage,
|
|
@@ -16,6 +16,7 @@ interface BaseLegendMessageProps {
|
|
|
16
16
|
message: DMessageItem;
|
|
17
17
|
isOutgoing: boolean;
|
|
18
18
|
createdAtTime: number;
|
|
19
|
+
onPressUrl?: (url: string) => void;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
const parseUrlMetadata = (ex?: string): IUrlMetadata | undefined => {
|
|
@@ -23,26 +24,65 @@ const parseUrlMetadata = (ex?: string): IUrlMetadata | undefined => {
|
|
|
23
24
|
try {
|
|
24
25
|
const parsed = JSON.parse(ex) as any;
|
|
25
26
|
// Handle nested urlMetadata structure
|
|
26
|
-
return parsed
|
|
27
|
+
return parsed?.urlMetadata || undefined;
|
|
27
28
|
} catch {
|
|
28
29
|
return undefined;
|
|
29
30
|
}
|
|
30
31
|
};
|
|
31
32
|
|
|
32
|
-
const renderTextWithLinks = (
|
|
33
|
+
const renderTextWithLinks = (
|
|
34
|
+
content: string,
|
|
35
|
+
urls: string[],
|
|
36
|
+
onPressUrl?: (url: string) => void
|
|
37
|
+
) => {
|
|
33
38
|
if (!urls.length) {
|
|
34
|
-
return
|
|
39
|
+
return (
|
|
40
|
+
<KLabel.Text typo="TextMdNormal" color={CHAT_BUBBLE_COLORS.text}>
|
|
41
|
+
{content}
|
|
42
|
+
</KLabel.Text>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const parts: { text: string; isUrl: boolean }[] = [];
|
|
47
|
+
let remaining = content;
|
|
48
|
+
|
|
49
|
+
for (const url of urls) {
|
|
50
|
+
const idx = remaining.indexOf(url);
|
|
51
|
+
if (idx === -1) continue;
|
|
52
|
+
if (idx > 0) parts.push({ text: remaining.slice(0, idx), isUrl: false });
|
|
53
|
+
parts.push({ text: url, isUrl: true });
|
|
54
|
+
remaining = remaining.slice(idx + url.length);
|
|
35
55
|
}
|
|
36
56
|
|
|
57
|
+
if (remaining) parts.push({ text: remaining, isUrl: false });
|
|
58
|
+
|
|
37
59
|
return (
|
|
38
60
|
<KLabel.Text typo="TextMdNormal" color={CHAT_BUBBLE_COLORS.text}>
|
|
39
|
-
{
|
|
61
|
+
{parts.map((part, i) =>
|
|
62
|
+
part.isUrl ? (
|
|
63
|
+
<KLabel.Text
|
|
64
|
+
key={i}
|
|
65
|
+
onPress={() => onPressUrl?.(part.text)}
|
|
66
|
+
color={KColors.primary.normal}
|
|
67
|
+
typo="TextMdMedium"
|
|
68
|
+
>
|
|
69
|
+
{part.text}
|
|
70
|
+
</KLabel.Text>
|
|
71
|
+
) : (
|
|
72
|
+
<KLabel.Text key={i}>{part.text}</KLabel.Text>
|
|
73
|
+
)
|
|
74
|
+
)}
|
|
40
75
|
</KLabel.Text>
|
|
41
76
|
);
|
|
42
77
|
};
|
|
43
78
|
|
|
44
79
|
export const LinkMessage = memo(
|
|
45
|
-
({
|
|
80
|
+
({
|
|
81
|
+
message,
|
|
82
|
+
isOutgoing,
|
|
83
|
+
createdAtTime,
|
|
84
|
+
onPressUrl,
|
|
85
|
+
}: BaseLegendMessageProps) => {
|
|
46
86
|
const content = message?.urlTextElem?.content;
|
|
47
87
|
const urls = message?.urlTextElem?.urls ?? [];
|
|
48
88
|
const metadata = parseUrlMetadata(message.ex);
|
|
@@ -62,10 +102,10 @@ export const LinkMessage = memo(
|
|
|
62
102
|
</KContainer.View>
|
|
63
103
|
)}
|
|
64
104
|
|
|
65
|
-
{metadata && (
|
|
105
|
+
{!!metadata && (
|
|
66
106
|
<KContainer.Touchable
|
|
67
107
|
style={styles.card}
|
|
68
|
-
onPress={() => metadata.url &&
|
|
108
|
+
onPress={() => metadata.url && onPressUrl?.(metadata.url)}
|
|
69
109
|
>
|
|
70
110
|
{!!metadata.image && (
|
|
71
111
|
<KContainer.View style={styles.cardThumb}>
|
|
@@ -12,12 +12,14 @@
|
|
|
12
12
|
export interface ApiEndpoints {
|
|
13
13
|
// Chat service (relative paths - used with axios baseURL)
|
|
14
14
|
urlMetadata: string;
|
|
15
|
+
conversationFlow: string;
|
|
15
16
|
// Image upload service (relative path - full URL constructed in imageUpload service)
|
|
16
17
|
imageUpload: string;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
const DEFAULT_ENDPOINTS: ApiEndpoints = {
|
|
20
21
|
urlMetadata: '/chat-service/v1/utils/url-metadata',
|
|
22
|
+
conversationFlow: '/chat-service/v1/app/conversations',
|
|
21
23
|
imageUpload: '/uploader-service/v1/uploader/permanently',
|
|
22
24
|
};
|
|
23
25
|
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createContext,
|
|
3
|
+
useCallback,
|
|
4
|
+
useContext,
|
|
5
|
+
useEffect,
|
|
6
|
+
useMemo,
|
|
7
|
+
useState,
|
|
8
|
+
} from 'react';
|
|
9
|
+
import type {
|
|
10
|
+
ChatDetailContextType,
|
|
11
|
+
ChatDetailProviderProps,
|
|
12
|
+
} from '../types/chat';
|
|
13
|
+
import { fechtCurrentConversationFlow } from '../hooks/flows/useCurrentConversationFlow';
|
|
14
|
+
import { useConversationStore } from '../store';
|
|
15
|
+
import { PeerType } from '@droppii/openim-rn-client-sdk';
|
|
16
|
+
import type { IConversationFlow, IConversationFlowStep } from '../types/flows';
|
|
17
|
+
|
|
18
|
+
export const ChatDetailContext = createContext<ChatDetailContextType>({
|
|
19
|
+
isBotConversation: false,
|
|
20
|
+
conversationFlow: undefined,
|
|
21
|
+
refetchConversationFlow: () => {},
|
|
22
|
+
setConverationFlowStep: () => {},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const useChatDetailContext = (): ChatDetailContextType => {
|
|
26
|
+
const context = useContext(ChatDetailContext);
|
|
27
|
+
if (!context) {
|
|
28
|
+
throw new Error(
|
|
29
|
+
'useChatDetailContext must be used within ChatDetailProvider'
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
return context;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const ChatDetailProvider = ({ children }: ChatDetailProviderProps) => {
|
|
36
|
+
const conversationId = useConversationStore(
|
|
37
|
+
(state) => state.currentConversationId || ''
|
|
38
|
+
);
|
|
39
|
+
const conversation = useConversationStore(
|
|
40
|
+
(state) => state.map[conversationId]
|
|
41
|
+
);
|
|
42
|
+
const [conversationFlow, setConverationFlow] = useState<
|
|
43
|
+
IConversationFlow | undefined
|
|
44
|
+
>(undefined);
|
|
45
|
+
|
|
46
|
+
const isBotConversation = useMemo(() => {
|
|
47
|
+
return conversation?.peerType === PeerType.Bot;
|
|
48
|
+
}, [conversation]);
|
|
49
|
+
|
|
50
|
+
const setConverationFlowStep = useCallback((step: IConversationFlowStep) => {
|
|
51
|
+
setConverationFlow(
|
|
52
|
+
(prev) =>
|
|
53
|
+
({
|
|
54
|
+
...prev,
|
|
55
|
+
flowCurrentStep: step,
|
|
56
|
+
}) as IConversationFlow
|
|
57
|
+
);
|
|
58
|
+
}, []);
|
|
59
|
+
|
|
60
|
+
const getConversationFlow = useCallback(async () => {
|
|
61
|
+
const res = await fechtCurrentConversationFlow(conversationId);
|
|
62
|
+
if (res) {
|
|
63
|
+
setConverationFlow(res);
|
|
64
|
+
}
|
|
65
|
+
}, [conversationId]);
|
|
66
|
+
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
if (!!conversationId && !!isBotConversation) {
|
|
69
|
+
getConversationFlow();
|
|
70
|
+
}
|
|
71
|
+
}, [conversationId, isBotConversation, getConversationFlow]);
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<ChatDetailContext.Provider
|
|
75
|
+
value={{
|
|
76
|
+
conversationFlow,
|
|
77
|
+
refetchConversationFlow: () => {},
|
|
78
|
+
setConverationFlowStep,
|
|
79
|
+
isBotConversation,
|
|
80
|
+
}}
|
|
81
|
+
>
|
|
82
|
+
{children}
|
|
83
|
+
</ChatDetailContext.Provider>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ENDPOINTS } from '../../services/endpoints';
|
|
2
|
+
import type { BaseResponse } from '../../types/auth';
|
|
3
|
+
import { apiInstance } from '../../services/apis';
|
|
4
|
+
import type { IConversationFlow } from '../../types/flows';
|
|
5
|
+
|
|
6
|
+
export const fechtCurrentConversationFlow = async (conversationId: string) => {
|
|
7
|
+
const res = await apiInstance?.get<BaseResponse<IConversationFlow>>(
|
|
8
|
+
ENDPOINTS.chatService.conversationFlow(conversationId)
|
|
9
|
+
);
|
|
10
|
+
return res?.data?.data || undefined;
|
|
11
|
+
};
|