@droppii-org/chat-sdk 0.1.26 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/svg/canned-response.d.ts +7 -0
- package/dist/assets/svg/canned-response.d.ts.map +1 -0
- package/dist/assets/svg/canned-response.js +3 -0
- package/dist/assets/svg/canned-response.tsx +48 -0
- package/dist/assets/svg/index.d.ts +1 -1
- package/dist/assets/svg/index.d.ts.map +1 -1
- package/dist/assets/svg/index.js +1 -1
- package/dist/assets/svg/index.ts +1 -1
- package/dist/components/biz-thread-detail/BizMessageBubble.d.ts +10 -0
- package/dist/components/biz-thread-detail/BizMessageBubble.d.ts.map +1 -0
- package/dist/components/biz-thread-detail/BizMessageBubble.js +15 -0
- package/dist/components/biz-thread-detail/BizMessageList.d.ts +3 -0
- package/dist/components/biz-thread-detail/BizMessageList.d.ts.map +1 -0
- package/dist/components/biz-thread-detail/BizMessageList.js +28 -0
- package/dist/components/biz-thread-detail/BizThreadDetailHeader.d.ts +8 -0
- package/dist/components/biz-thread-detail/BizThreadDetailHeader.d.ts.map +1 -0
- package/dist/components/biz-thread-detail/BizThreadDetailHeader.js +18 -0
- package/dist/components/biz-thread-detail/BizThreadDetailInput.d.ts +8 -0
- package/dist/components/biz-thread-detail/BizThreadDetailInput.d.ts.map +1 -0
- package/dist/components/biz-thread-detail/BizThreadDetailInput.js +147 -0
- package/dist/components/biz-thread-detail/index.d.ts +8 -0
- package/dist/components/biz-thread-detail/index.d.ts.map +1 -0
- package/dist/components/biz-thread-detail/index.js +4 -0
- package/dist/components/biz-thread-detail/item/BizMessageItem.d.ts +8 -0
- package/dist/components/biz-thread-detail/item/BizMessageItem.d.ts.map +1 -0
- package/dist/components/biz-thread-detail/item/BizMessageItem.js +20 -0
- package/dist/components/canned-response/CannedResponseBody.d.ts +8 -0
- package/dist/components/canned-response/CannedResponseBody.d.ts.map +1 -0
- package/dist/components/canned-response/CannedResponseBody.js +109 -0
- package/dist/components/canned-response/CannedResponseFooter.d.ts +6 -0
- package/dist/components/canned-response/CannedResponseFooter.d.ts.map +1 -0
- package/dist/components/canned-response/CannedResponseFooter.js +8 -0
- package/dist/components/canned-response/CannedResponseHeader.d.ts +8 -0
- package/dist/components/canned-response/CannedResponseHeader.d.ts.map +1 -0
- package/dist/components/canned-response/CannedResponseHeader.js +11 -0
- package/dist/components/canned-response/index.d.ts +8 -0
- package/dist/components/canned-response/index.d.ts.map +1 -0
- package/dist/components/canned-response/index.js +34 -0
- package/dist/components/canned-response/team/TeamItem.d.ts +11 -0
- package/dist/components/canned-response/team/TeamItem.d.ts.map +1 -0
- package/dist/components/canned-response/team/TeamItem.js +31 -0
- package/dist/components/chat-bubble/ChatBubble.d.ts +6 -0
- package/dist/components/chat-bubble/ChatBubble.d.ts.map +1 -0
- package/dist/components/chat-bubble/ChatBubble.js +35 -0
- package/dist/components/conversation/DeskConversationList.js +1 -1
- package/dist/components/media-collection/FileCollection.d.ts +3 -0
- package/dist/components/media-collection/FileCollection.d.ts.map +1 -0
- package/dist/components/media-collection/FileCollection.js +53 -0
- package/dist/components/media-collection/ImageCollection.d.ts +3 -0
- package/dist/components/media-collection/ImageCollection.d.ts.map +1 -0
- package/dist/components/media-collection/ImageCollection.js +52 -0
- package/dist/components/media-collection/LinkCollection.d.ts +5 -0
- package/dist/components/media-collection/LinkCollection.d.ts.map +1 -0
- package/dist/components/media-collection/LinkCollection.js +92 -0
- package/dist/components/media-collection/VideoCollection.d.ts +3 -0
- package/dist/components/media-collection/VideoCollection.d.ts.map +1 -0
- package/dist/components/media-collection/VideoCollection.js +51 -0
- package/dist/components/media-collection/index.d.ts +9 -0
- package/dist/components/media-collection/index.d.ts.map +1 -0
- package/dist/components/media-collection/index.js +57 -0
- package/dist/components/message/MessageHeader.js +2 -2
- package/dist/components/message/footer/MediaActions.js +1 -1
- package/dist/components/message/footer/index.js +1 -1
- package/dist/components/rich-text-editor/RichTextEditor.d.ts +12 -0
- package/dist/components/rich-text-editor/RichTextEditor.d.ts.map +1 -0
- package/dist/components/rich-text-editor/RichTextEditor.js +62 -0
- package/dist/components/search-conversation/SearchAll.d.ts +8 -0
- package/dist/components/search-conversation/SearchAll.d.ts.map +1 -0
- package/dist/components/search-conversation/SearchAll.js +37 -0
- package/dist/components/search-conversation/SearchConversationAsMessages.d.ts +6 -0
- package/dist/components/search-conversation/SearchConversationAsMessages.d.ts.map +1 -0
- package/dist/components/search-conversation/SearchConversationAsMessages.js +23 -0
- package/dist/components/search-conversation/SearchConversationAsUsers.d.ts +6 -0
- package/dist/components/search-conversation/SearchConversationAsUsers.d.ts.map +1 -0
- package/dist/components/search-conversation/SearchConversationAsUsers.js +21 -0
- package/dist/components/search-conversation/SearchConversationMyInbox.d.ts +6 -0
- package/dist/components/search-conversation/SearchConversationMyInbox.d.ts.map +1 -0
- package/dist/components/search-conversation/SearchConversationMyInbox.js +24 -0
- package/dist/components/search-conversation/SearchDrawer.d.ts +3 -0
- package/dist/components/search-conversation/SearchDrawer.d.ts.map +1 -0
- package/dist/components/search-conversation/SearchDrawer.js +33 -0
- package/dist/components/search-conversation/SearchMessageOnCurrentConversation.d.ts +7 -0
- package/dist/components/search-conversation/SearchMessageOnCurrentConversation.d.ts.map +1 -0
- package/dist/components/search-conversation/SearchMessageOnCurrentConversation.js +28 -0
- package/dist/components/search-conversation/index.d.ts +12 -0
- package/dist/components/search-conversation/index.d.ts.map +1 -0
- package/dist/components/search-conversation/index.js +46 -0
- package/dist/components/search-conversation/item/SearchItemAsMessage.d.ts +12 -0
- package/dist/components/search-conversation/item/SearchItemAsMessage.d.ts.map +1 -0
- package/dist/components/search-conversation/item/SearchItemAsMessage.js +72 -0
- package/dist/components/search-conversation/item/SearchItemAsUser.d.ts +8 -0
- package/dist/components/search-conversation/item/SearchItemAsUser.d.ts.map +1 -0
- package/dist/components/search-conversation/item/SearchItemAsUser.js +25 -0
- package/dist/hooks/biz/useBizSendMessage.d.ts.map +1 -1
- package/dist/hooks/biz/useBizSendMessage.js +4 -0
- package/dist/hooks/canned-response/useFetchCannedCategories.d.ts +3 -0
- package/dist/hooks/canned-response/useFetchCannedCategories.d.ts.map +1 -0
- package/dist/hooks/canned-response/useFetchCannedCategories.js +13 -0
- package/dist/hooks/canned-response/useFetchCannedResponse.d.ts +219 -0
- package/dist/hooks/canned-response/useFetchCannedResponse.d.ts.map +1 -0
- package/dist/hooks/canned-response/useFetchCannedResponse.js +55 -0
- package/dist/index.d.ts +9 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -6
- package/dist/screens/biz-message/index.d.ts +9 -0
- package/dist/screens/biz-message/index.d.ts.map +1 -0
- package/dist/screens/biz-message/index.js +55 -0
- package/dist/screens/biz-thread-detail/index.d.ts +9 -0
- package/dist/screens/biz-thread-detail/index.d.ts.map +1 -0
- package/dist/screens/biz-thread-detail/index.js +36 -0
- package/dist/screens/chat-bubble/index.d.ts +7 -0
- package/dist/screens/chat-bubble/index.d.ts.map +1 -0
- package/dist/screens/chat-bubble/index.js +41 -0
- package/dist/screens/desk-message/index.d.ts +6 -0
- package/dist/screens/desk-message/index.d.ts.map +1 -0
- package/dist/screens/desk-message/index.js +17 -0
- package/dist/styles/global.css +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { BaseResponse, ICannedResponseItem, IFetchCannedResponseRequest } from "../../types/dto";
|
|
2
|
+
export declare const useFetchCannedResponse: (payload: IFetchCannedResponseRequest) => {
|
|
3
|
+
error: Error;
|
|
4
|
+
isError: true;
|
|
5
|
+
isPending: false;
|
|
6
|
+
isLoadingError: false;
|
|
7
|
+
isRefetchError: true;
|
|
8
|
+
isSuccess: false;
|
|
9
|
+
isPlaceholderData: false;
|
|
10
|
+
status: "error";
|
|
11
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>, Error>>;
|
|
12
|
+
hasPreviousPage: boolean;
|
|
13
|
+
isFetchNextPageError: boolean;
|
|
14
|
+
isFetchPreviousPageError: boolean;
|
|
15
|
+
isFetchingPreviousPage: boolean;
|
|
16
|
+
dataUpdatedAt: number;
|
|
17
|
+
errorUpdatedAt: number;
|
|
18
|
+
failureCount: number;
|
|
19
|
+
failureReason: Error | null;
|
|
20
|
+
errorUpdateCount: number;
|
|
21
|
+
isFetched: boolean;
|
|
22
|
+
isFetchedAfterMount: boolean;
|
|
23
|
+
isFetching: boolean;
|
|
24
|
+
isInitialLoading: boolean;
|
|
25
|
+
isPaused: boolean;
|
|
26
|
+
isRefetching: boolean;
|
|
27
|
+
isStale: boolean;
|
|
28
|
+
isEnabled: boolean;
|
|
29
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>, Error>>;
|
|
30
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
31
|
+
promise: Promise<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>>;
|
|
32
|
+
data: import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown> | undefined;
|
|
33
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>, Error>>;
|
|
34
|
+
hasNextPage: boolean;
|
|
35
|
+
isFetchingNextPage: boolean;
|
|
36
|
+
isLoading: boolean;
|
|
37
|
+
dataFlatten: ICannedResponseItem[];
|
|
38
|
+
} | {
|
|
39
|
+
error: null;
|
|
40
|
+
isError: false;
|
|
41
|
+
isPending: false;
|
|
42
|
+
isLoadingError: false;
|
|
43
|
+
isRefetchError: false;
|
|
44
|
+
isFetchNextPageError: false;
|
|
45
|
+
isFetchPreviousPageError: false;
|
|
46
|
+
isSuccess: true;
|
|
47
|
+
isPlaceholderData: false;
|
|
48
|
+
status: "success";
|
|
49
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>, Error>>;
|
|
50
|
+
hasPreviousPage: boolean;
|
|
51
|
+
isFetchingPreviousPage: boolean;
|
|
52
|
+
dataUpdatedAt: number;
|
|
53
|
+
errorUpdatedAt: number;
|
|
54
|
+
failureCount: number;
|
|
55
|
+
failureReason: Error | null;
|
|
56
|
+
errorUpdateCount: number;
|
|
57
|
+
isFetched: boolean;
|
|
58
|
+
isFetchedAfterMount: boolean;
|
|
59
|
+
isFetching: boolean;
|
|
60
|
+
isInitialLoading: boolean;
|
|
61
|
+
isPaused: boolean;
|
|
62
|
+
isRefetching: boolean;
|
|
63
|
+
isStale: boolean;
|
|
64
|
+
isEnabled: boolean;
|
|
65
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>, Error>>;
|
|
66
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
67
|
+
promise: Promise<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>>;
|
|
68
|
+
data: import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown> | undefined;
|
|
69
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>, Error>>;
|
|
70
|
+
hasNextPage: boolean;
|
|
71
|
+
isFetchingNextPage: boolean;
|
|
72
|
+
isLoading: boolean;
|
|
73
|
+
dataFlatten: ICannedResponseItem[];
|
|
74
|
+
} | {
|
|
75
|
+
error: Error;
|
|
76
|
+
isError: true;
|
|
77
|
+
isPending: false;
|
|
78
|
+
isLoadingError: true;
|
|
79
|
+
isRefetchError: false;
|
|
80
|
+
isFetchNextPageError: false;
|
|
81
|
+
isFetchPreviousPageError: false;
|
|
82
|
+
isSuccess: false;
|
|
83
|
+
isPlaceholderData: false;
|
|
84
|
+
status: "error";
|
|
85
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>, Error>>;
|
|
86
|
+
hasPreviousPage: boolean;
|
|
87
|
+
isFetchingPreviousPage: boolean;
|
|
88
|
+
dataUpdatedAt: number;
|
|
89
|
+
errorUpdatedAt: number;
|
|
90
|
+
failureCount: number;
|
|
91
|
+
failureReason: Error | null;
|
|
92
|
+
errorUpdateCount: number;
|
|
93
|
+
isFetched: boolean;
|
|
94
|
+
isFetchedAfterMount: boolean;
|
|
95
|
+
isFetching: boolean;
|
|
96
|
+
isInitialLoading: boolean;
|
|
97
|
+
isPaused: boolean;
|
|
98
|
+
isRefetching: boolean;
|
|
99
|
+
isStale: boolean;
|
|
100
|
+
isEnabled: boolean;
|
|
101
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>, Error>>;
|
|
102
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
103
|
+
promise: Promise<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>>;
|
|
104
|
+
data: import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown> | undefined;
|
|
105
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>, Error>>;
|
|
106
|
+
hasNextPage: boolean;
|
|
107
|
+
isFetchingNextPage: boolean;
|
|
108
|
+
isLoading: boolean;
|
|
109
|
+
dataFlatten: ICannedResponseItem[];
|
|
110
|
+
} | {
|
|
111
|
+
error: null;
|
|
112
|
+
isError: false;
|
|
113
|
+
isPending: true;
|
|
114
|
+
isLoadingError: false;
|
|
115
|
+
isRefetchError: false;
|
|
116
|
+
isFetchNextPageError: false;
|
|
117
|
+
isFetchPreviousPageError: false;
|
|
118
|
+
isSuccess: false;
|
|
119
|
+
isPlaceholderData: false;
|
|
120
|
+
status: "pending";
|
|
121
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>, Error>>;
|
|
122
|
+
hasPreviousPage: boolean;
|
|
123
|
+
isFetchingPreviousPage: boolean;
|
|
124
|
+
dataUpdatedAt: number;
|
|
125
|
+
errorUpdatedAt: number;
|
|
126
|
+
failureCount: number;
|
|
127
|
+
failureReason: Error | null;
|
|
128
|
+
errorUpdateCount: number;
|
|
129
|
+
isFetched: boolean;
|
|
130
|
+
isFetchedAfterMount: boolean;
|
|
131
|
+
isFetching: boolean;
|
|
132
|
+
isInitialLoading: boolean;
|
|
133
|
+
isPaused: boolean;
|
|
134
|
+
isRefetching: boolean;
|
|
135
|
+
isStale: boolean;
|
|
136
|
+
isEnabled: boolean;
|
|
137
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>, Error>>;
|
|
138
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
139
|
+
promise: Promise<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>>;
|
|
140
|
+
data: import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown> | undefined;
|
|
141
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>, Error>>;
|
|
142
|
+
hasNextPage: boolean;
|
|
143
|
+
isFetchingNextPage: boolean;
|
|
144
|
+
isLoading: boolean;
|
|
145
|
+
dataFlatten: ICannedResponseItem[];
|
|
146
|
+
} | {
|
|
147
|
+
error: null;
|
|
148
|
+
isError: false;
|
|
149
|
+
isPending: true;
|
|
150
|
+
isLoadingError: false;
|
|
151
|
+
isRefetchError: false;
|
|
152
|
+
isFetchNextPageError: false;
|
|
153
|
+
isFetchPreviousPageError: false;
|
|
154
|
+
isSuccess: false;
|
|
155
|
+
isPlaceholderData: false;
|
|
156
|
+
status: "pending";
|
|
157
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>, Error>>;
|
|
158
|
+
hasPreviousPage: boolean;
|
|
159
|
+
isFetchingPreviousPage: boolean;
|
|
160
|
+
dataUpdatedAt: number;
|
|
161
|
+
errorUpdatedAt: number;
|
|
162
|
+
failureCount: number;
|
|
163
|
+
failureReason: Error | null;
|
|
164
|
+
errorUpdateCount: number;
|
|
165
|
+
isFetched: boolean;
|
|
166
|
+
isFetchedAfterMount: boolean;
|
|
167
|
+
isFetching: boolean;
|
|
168
|
+
isInitialLoading: boolean;
|
|
169
|
+
isPaused: boolean;
|
|
170
|
+
isRefetching: boolean;
|
|
171
|
+
isStale: boolean;
|
|
172
|
+
isEnabled: boolean;
|
|
173
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>, Error>>;
|
|
174
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
175
|
+
promise: Promise<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>>;
|
|
176
|
+
data: import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown> | undefined;
|
|
177
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>, Error>>;
|
|
178
|
+
hasNextPage: boolean;
|
|
179
|
+
isFetchingNextPage: boolean;
|
|
180
|
+
isLoading: boolean;
|
|
181
|
+
dataFlatten: ICannedResponseItem[];
|
|
182
|
+
} | {
|
|
183
|
+
isError: false;
|
|
184
|
+
error: null;
|
|
185
|
+
isPending: false;
|
|
186
|
+
isLoadingError: false;
|
|
187
|
+
isRefetchError: false;
|
|
188
|
+
isSuccess: true;
|
|
189
|
+
isPlaceholderData: true;
|
|
190
|
+
isFetchNextPageError: false;
|
|
191
|
+
isFetchPreviousPageError: false;
|
|
192
|
+
status: "success";
|
|
193
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>, Error>>;
|
|
194
|
+
hasPreviousPage: boolean;
|
|
195
|
+
isFetchingPreviousPage: boolean;
|
|
196
|
+
dataUpdatedAt: number;
|
|
197
|
+
errorUpdatedAt: number;
|
|
198
|
+
failureCount: number;
|
|
199
|
+
failureReason: Error | null;
|
|
200
|
+
errorUpdateCount: number;
|
|
201
|
+
isFetched: boolean;
|
|
202
|
+
isFetchedAfterMount: boolean;
|
|
203
|
+
isFetching: boolean;
|
|
204
|
+
isInitialLoading: boolean;
|
|
205
|
+
isPaused: boolean;
|
|
206
|
+
isRefetching: boolean;
|
|
207
|
+
isStale: boolean;
|
|
208
|
+
isEnabled: boolean;
|
|
209
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>, Error>>;
|
|
210
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
211
|
+
promise: Promise<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>>;
|
|
212
|
+
data: import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown> | undefined;
|
|
213
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ICannedResponseItem[]>, unknown>, Error>>;
|
|
214
|
+
hasNextPage: boolean;
|
|
215
|
+
isFetchingNextPage: boolean;
|
|
216
|
+
isLoading: boolean;
|
|
217
|
+
dataFlatten: ICannedResponseItem[];
|
|
218
|
+
};
|
|
219
|
+
//# sourceMappingURL=useFetchCannedResponse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFetchCannedResponse.d.ts","sourceRoot":"","sources":["../../../src/hooks/canned-response/useFetchCannedResponse.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,2BAA2B,EAC5B,MAAM,aAAa,CAAC;AAMrB,eAAO,MAAM,sBAAsB,GACjC,SAAS,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDrC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { useInfiniteQuery } from "@tanstack/react-query";
|
|
13
|
+
import { QUERY_KEYS } from "../../services/query";
|
|
14
|
+
import { apiInstance } from "../../services/api";
|
|
15
|
+
import { ENDPOINTS } from "../../services/routes";
|
|
16
|
+
import { PAGE_SIZE } from "../../constants";
|
|
17
|
+
import { useMemo } from "react";
|
|
18
|
+
export const useFetchCannedResponse = (payload) => {
|
|
19
|
+
const _a = useInfiniteQuery({
|
|
20
|
+
initialPageParam: 1,
|
|
21
|
+
queryKey: [QUERY_KEYS.GET_CANNED_RESPONSES, payload],
|
|
22
|
+
queryFn: async ({ pageParam = 1 }) => {
|
|
23
|
+
const params = Object.assign(Object.assign({ pageSize: (payload === null || payload === void 0 ? void 0 : payload.pageSize) || PAGE_SIZE.large }, payload), { page: pageParam });
|
|
24
|
+
const res = await apiInstance.get(ENDPOINTS.chatService.getCannedResponses, {
|
|
25
|
+
params,
|
|
26
|
+
});
|
|
27
|
+
return res.data;
|
|
28
|
+
},
|
|
29
|
+
getNextPageParam: (lastPage) => {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
const pageSize = (payload === null || payload === void 0 ? void 0 : payload.pageSize) || PAGE_SIZE.large;
|
|
32
|
+
const dataLength = ((_a = lastPage === null || lastPage === void 0 ? void 0 : lastPage.data) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
33
|
+
const currentPage = ((_b = lastPage === null || lastPage === void 0 ? void 0 : lastPage.pageable) === null || _b === void 0 ? void 0 : _b.pageNumber) || 1;
|
|
34
|
+
return dataLength < pageSize ? undefined : currentPage + 1;
|
|
35
|
+
},
|
|
36
|
+
enabled: (payload === null || payload === void 0 ? void 0 : payload.visibilityScope) === "PRIVATE" || !!(payload === null || payload === void 0 ? void 0 : payload.teamId),
|
|
37
|
+
}), { data, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading } = _a, rest = __rest(_a, ["data", "fetchNextPage", "hasNextPage", "isFetchingNextPage", "isLoading"]);
|
|
38
|
+
const { dataFlatten } = useMemo(() => {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
if (!data)
|
|
41
|
+
return {
|
|
42
|
+
dataFlatten: [],
|
|
43
|
+
};
|
|
44
|
+
const allItems = ((_b = (_a = data === null || data === void 0 ? void 0 : data.pages) === null || _a === void 0 ? void 0 : _a.flatMap) === null || _b === void 0 ? void 0 : _b.call(_a, (page) => page.data)) || [];
|
|
45
|
+
return {
|
|
46
|
+
dataFlatten: allItems,
|
|
47
|
+
};
|
|
48
|
+
}, [data]);
|
|
49
|
+
return Object.assign({ data,
|
|
50
|
+
fetchNextPage,
|
|
51
|
+
hasNextPage,
|
|
52
|
+
isFetchingNextPage,
|
|
53
|
+
isLoading,
|
|
54
|
+
dataFlatten }, rest);
|
|
55
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./locales/i18n";
|
|
2
|
-
import DChatDeskMessage from "./screens/
|
|
3
|
-
import DChatBubble from "./screens/
|
|
2
|
+
import DChatDeskMessage from "./screens/desk-message";
|
|
3
|
+
import DChatBubble from "./screens/chat-bubble";
|
|
4
4
|
import { Platform, LogLevel, SessionType } from "@openim/wasm-client-sdk";
|
|
5
5
|
import { Icon } from "./components/icon";
|
|
6
6
|
import useUserStore from "./store/user";
|
|
@@ -12,13 +12,13 @@ export { default as qs } from "query-string";
|
|
|
12
12
|
export * from "antd/es/table";
|
|
13
13
|
export { ChatProvider, useChatContext } from "./context/ChatContext";
|
|
14
14
|
export { DChatDeskMessage, DChatBubble, Icon };
|
|
15
|
-
export { default as RichTextEditor } from "./components/
|
|
16
|
-
export { default as DChatBizInbox } from "./screens/
|
|
17
|
-
export type { DChatBizInboxProps } from "./screens/
|
|
18
|
-
export { default as DChatBizThreadDetail } from "./screens/
|
|
19
|
-
export type { DChatBizThreadDetailProps } from "./screens/
|
|
20
|
-
export { BizThreadDetailHeader, BizThreadDetailInput, } from "./components/
|
|
21
|
-
export type { BizThreadDetailHeaderProps, BizThreadDetailInputProps, } from "./components/
|
|
15
|
+
export { default as RichTextEditor } from "./components/rich-text-editor/RichTextEditor";
|
|
16
|
+
export { default as DChatBizInbox } from "./screens/biz-message";
|
|
17
|
+
export type { DChatBizInboxProps } from "./screens/biz-message";
|
|
18
|
+
export { default as DChatBizThreadDetail } from "./screens/biz-thread-detail";
|
|
19
|
+
export type { DChatBizThreadDetailProps } from "./screens/biz-thread-detail";
|
|
20
|
+
export { BizThreadDetailHeader, BizThreadDetailInput, } from "./components/biz-thread-detail";
|
|
21
|
+
export type { BizThreadDetailHeaderProps, BizThreadDetailInputProps, } from "./components/biz-thread-detail";
|
|
22
22
|
export { BizChatCategory, BizChatType, BizPeerType, } from "./types/biz";
|
|
23
23
|
export type { BizConversationItem, BizConversationPeer, BizCreateConversationData, BizConversationMember, } from "./types/biz";
|
|
24
24
|
export { useDChatAuth } from "./hooks/user/useAuth";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAExB,OAAO,gBAAgB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAExB,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AACtD,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,cAAc,CAAC;AAC7C,cAAc,eAAe,CAAC;AAG9B,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGrE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAEzF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAC9E,YAAY,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAE7E,OAAO,EACL,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACV,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,eAAe,EACf,WAAW,EACX,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EACL,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAG9D,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAE,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAI7E,OAAO,EACL,QAAQ,IAAI,aAAa,EACzB,QAAQ,IAAI,aAAa,EACzB,WAAW,IAAI,gBAAgB,GAChC,CAAC;AAEF,YAAY,EAAE,uBAAuB,EAAE,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./locales/i18n";
|
|
2
|
-
import DChatDeskMessage from "./screens/
|
|
3
|
-
import DChatBubble from "./screens/
|
|
2
|
+
import DChatDeskMessage from "./screens/desk-message";
|
|
3
|
+
import DChatBubble from "./screens/chat-bubble";
|
|
4
4
|
import { Platform, LogLevel, SessionType } from "@openim/wasm-client-sdk";
|
|
5
5
|
import { Icon } from "./components/icon";
|
|
6
6
|
import useUserStore from "./store/user";
|
|
@@ -14,10 +14,10 @@ export * from "antd/es/table";
|
|
|
14
14
|
export { ChatProvider, useChatContext } from "./context/ChatContext";
|
|
15
15
|
//Components
|
|
16
16
|
export { DChatDeskMessage, DChatBubble, Icon };
|
|
17
|
-
export { default as RichTextEditor } from "./components/
|
|
18
|
-
export { default as DChatBizInbox } from "./screens/
|
|
19
|
-
export { default as DChatBizThreadDetail } from "./screens/
|
|
20
|
-
export { BizThreadDetailHeader, BizThreadDetailInput, } from "./components/
|
|
17
|
+
export { default as RichTextEditor } from "./components/rich-text-editor/RichTextEditor";
|
|
18
|
+
export { default as DChatBizInbox } from "./screens/biz-message";
|
|
19
|
+
export { default as DChatBizThreadDetail } from "./screens/biz-thread-detail";
|
|
20
|
+
export { BizThreadDetailHeader, BizThreadDetailInput, } from "./components/biz-thread-detail";
|
|
21
21
|
export { BizChatCategory, BizChatType, BizPeerType, } from "./types/biz";
|
|
22
22
|
//Hooks
|
|
23
23
|
export { useDChatAuth } from "./hooks/user/useAuth";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BizConversationItem } from "../../types/biz";
|
|
2
|
+
export interface DChatBizInboxProps {
|
|
3
|
+
pageSize?: number;
|
|
4
|
+
onSelectThread?: (conversation: BizConversationItem) => void;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const DChatBizInbox: ({ pageSize, onSelectThread, className, }: DChatBizInboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default DChatBizInbox;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/biz-message/index.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGvD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,CAAC,YAAY,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,aAAa,GAAI,0CAIpB,kBAAkB,4CA8EpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
import { useSearchParams } from "next/navigation";
|
|
5
|
+
import { useTranslation } from "react-i18next";
|
|
6
|
+
import { Empty } from "antd";
|
|
7
|
+
import clsx from "clsx";
|
|
8
|
+
import useAuthStore from "../../store/auth";
|
|
9
|
+
import useBizConversationStore from "../../store/bizConversation";
|
|
10
|
+
import { useBizConversationList } from "../../hooks/biz";
|
|
11
|
+
import { BizInboxHeader } from "../../components/biz-inbox";
|
|
12
|
+
import BizThreadList from "../../components/biz-inbox/BizThreadList";
|
|
13
|
+
import DChatBizThreadDetail from "../../screens/biz-thread-detail";
|
|
14
|
+
import { PAGE_SIZE } from "../../constants";
|
|
15
|
+
import { DChatApplicationType } from "../../types/chat";
|
|
16
|
+
import { Icon } from "../../components/icon";
|
|
17
|
+
const DChatBizInbox = ({ pageSize = PAGE_SIZE.medium, onSelectThread, className, }) => {
|
|
18
|
+
const { t } = useTranslation("biz-inbox");
|
|
19
|
+
const searchParams = useSearchParams();
|
|
20
|
+
const applicationType = useAuthStore((state) => state.applicationType);
|
|
21
|
+
const conversationData = useBizConversationStore((state) => state.conversationData);
|
|
22
|
+
const selectConversation = useBizConversationStore((state) => state.selectConversation);
|
|
23
|
+
const clearSelectedConversation = useBizConversationStore((state) => state.clearSelectedConversation);
|
|
24
|
+
const threadId = searchParams.get("threadId");
|
|
25
|
+
const isApplicationTypeValid = Object.values(DChatApplicationType).includes(applicationType);
|
|
26
|
+
const conversationList = useBizConversationList({
|
|
27
|
+
enabled: isApplicationTypeValid,
|
|
28
|
+
pageSize,
|
|
29
|
+
});
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (!threadId) {
|
|
32
|
+
if (conversationData) {
|
|
33
|
+
clearSelectedConversation();
|
|
34
|
+
}
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if ((conversationData === null || conversationData === void 0 ? void 0 : conversationData.conversationId) === threadId)
|
|
38
|
+
return;
|
|
39
|
+
const matchedThread = conversationList.items.find((item) => item.conversationId === threadId);
|
|
40
|
+
if (matchedThread) {
|
|
41
|
+
selectConversation(matchedThread);
|
|
42
|
+
}
|
|
43
|
+
}, [
|
|
44
|
+
threadId,
|
|
45
|
+
conversationList.items,
|
|
46
|
+
conversationData,
|
|
47
|
+
selectConversation,
|
|
48
|
+
clearSelectedConversation,
|
|
49
|
+
]);
|
|
50
|
+
if (threadId && conversationData) {
|
|
51
|
+
return _jsx(DChatBizThreadDetail, { className: className });
|
|
52
|
+
}
|
|
53
|
+
return (_jsxs("div", { "data-testid": "biz-inbox-root", className: clsx("flex h-full w-full flex-col bg-white", className), children: [_jsx(BizInboxHeader, {}), !isApplicationTypeValid ? (_jsx("div", { className: "flex flex-1 items-center justify-center py-12", children: _jsx(Empty, { image: _jsx(Icon, { icon: "chat-square-b", size: 80, className: "text-gray-300" }), description: t("empty.no_conversations") }) })) : (_jsx(BizThreadList, { items: conversationList.items, isFetchingNextPage: conversationList.isFetchingNextPage, hasNextPage: conversationList.hasNextPage, onLoadMore: conversationList.fetchNextPage, onSelectThread: onSelectThread }))] }));
|
|
54
|
+
};
|
|
55
|
+
export default DChatBizInbox;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BizThreadDetailInputProps } from "../../components/biz-thread-detail";
|
|
2
|
+
export interface DChatBizThreadDetailProps extends BizThreadDetailInputProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
onBack?: () => void;
|
|
6
|
+
}
|
|
7
|
+
declare const DChatBizThreadDetail: ({ className, children, onBack, ...inputProps }: DChatBizThreadDetailProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export default DChatBizThreadDetail;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/biz-thread-detail/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAEhF,MAAM,WAAW,yBAA0B,SAAQ,yBAAyB;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,oBAAoB,GAAI,gDAK3B,yBAAyB,mDAiC3B,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
|
15
|
+
import clsx from "clsx";
|
|
16
|
+
import useBizConversationStore from "../../store/bizConversation";
|
|
17
|
+
import { BizMessageList, BizThreadDetailHeader, BizThreadDetailInput, } from "../../components/biz-thread-detail";
|
|
18
|
+
const DChatBizThreadDetail = (_a) => {
|
|
19
|
+
var { className, children, onBack } = _a, inputProps = __rest(_a, ["className", "children", "onBack"]);
|
|
20
|
+
const router = useRouter();
|
|
21
|
+
const pathname = usePathname();
|
|
22
|
+
const searchParams = useSearchParams();
|
|
23
|
+
const conversation = useBizConversationStore((state) => state.conversationData);
|
|
24
|
+
const handleBack = () => {
|
|
25
|
+
const newSearchParams = new URLSearchParams(searchParams);
|
|
26
|
+
newSearchParams.delete("threadId");
|
|
27
|
+
const query = newSearchParams.toString();
|
|
28
|
+
router.replace(query ? `${pathname}?${query}` : pathname);
|
|
29
|
+
onBack === null || onBack === void 0 ? void 0 : onBack();
|
|
30
|
+
};
|
|
31
|
+
if (!conversation) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
return (_jsxs("div", { "data-testid": "biz-thread-detail-root", className: clsx("flex h-full w-full flex-col bg-white", className), children: [_jsx(BizThreadDetailHeader, { conversation: conversation, onBack: handleBack }), _jsx("div", { className: "flex min-h-0 flex-1 flex-col", children: children !== null && children !== void 0 ? children : _jsx(BizMessageList, {}) }), _jsx(BizThreadDetailInput, Object.assign({}, inputProps))] }));
|
|
35
|
+
};
|
|
36
|
+
export default DChatBizThreadDetail;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/chat-bubble/index.tsx"],"names":[],"mappings":"AAOA,UAAU,gBAAgB;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,WAAW,GAAI,OAAO,gBAAgB,4CAiD3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import ChatBubble from "../../components/chat-bubble/ChatBubble";
|
|
3
|
+
import { useChatContext } from "../../context/ChatContext";
|
|
4
|
+
import { ConnectStatus } from "../../types/chat";
|
|
5
|
+
import { useEffect } from "react";
|
|
6
|
+
import useConversationStore from "../../store/conversation";
|
|
7
|
+
import { DChatSDK } from "../../constants/sdk";
|
|
8
|
+
const DChatBubble = (props) => {
|
|
9
|
+
var _a;
|
|
10
|
+
const { conversationID, className } = props;
|
|
11
|
+
const { connectStatus } = useChatContext();
|
|
12
|
+
const conversationList = useConversationStore((state) => state.conversationList);
|
|
13
|
+
const setSelectedConversationId = useConversationStore((state) => state.setSelectedConversationId);
|
|
14
|
+
const setConversationData = useConversationStore((state) => state.setConversationData);
|
|
15
|
+
const updateConversationList = useConversationStore((state) => state.updateConversationList);
|
|
16
|
+
const selectedConversationId = useConversationStore((state) => state.selectedConversationId);
|
|
17
|
+
const resolvedConversationID = conversationID ||
|
|
18
|
+
selectedConversationId ||
|
|
19
|
+
((_a = conversationList === null || conversationList === void 0 ? void 0 : conversationList[0]) === null || _a === void 0 ? void 0 : _a.conversationID);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (connectStatus !== ConnectStatus.Connected || !resolvedConversationID) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const conversation = conversationList === null || conversationList === void 0 ? void 0 : conversationList.find((item) => item.conversationID === resolvedConversationID);
|
|
25
|
+
if (conversation) {
|
|
26
|
+
setSelectedConversationId(conversation.conversationID);
|
|
27
|
+
setConversationData(conversation);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
DChatSDK.getMultipleConversation([resolvedConversationID]).then((res) => {
|
|
31
|
+
if (res.data.length > 0) {
|
|
32
|
+
setSelectedConversationId(resolvedConversationID);
|
|
33
|
+
setConversationData(res.data[0]);
|
|
34
|
+
updateConversationList(res.data, "filter");
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}, [connectStatus, conversationList === null || conversationList === void 0 ? void 0 : conversationList.length, resolvedConversationID]);
|
|
39
|
+
return _jsx(ChatBubble, { className: className });
|
|
40
|
+
};
|
|
41
|
+
export default DChatBubble;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
interface DChatDeskMessageProps {
|
|
2
|
+
openCreateCannedModal?: () => void;
|
|
3
|
+
}
|
|
4
|
+
declare const DChatDeskMessage: ({ openCreateCannedModal }: DChatDeskMessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default DChatDeskMessage;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/desk-message/index.tsx"],"names":[],"mappings":"AAWA,UAAU,qBAAqB;IAC7B,qBAAqB,CAAC,EAAE,MAAM,IAAI,CAAC;CACpC;AAED,QAAA,MAAM,gBAAgB,GAAI,2BAA2B,qBAAqB,4CA+BzE,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import MessageList from "../../components/message/MessageList";
|
|
4
|
+
import DeskConversationList from "../../components/conversation/DeskConversationList";
|
|
5
|
+
import { useChatContext } from "../../context/ChatContext";
|
|
6
|
+
import { Spin } from "antd";
|
|
7
|
+
import { ConnectStatus, SyncStatus } from "../../types/chat";
|
|
8
|
+
import useConversationStore from "../../store/conversation";
|
|
9
|
+
import DeskAssignedSession from "../../components/session/DeskAssignedSession";
|
|
10
|
+
import ThreadInfo from "../../components/thread/ThreadInfo";
|
|
11
|
+
const DChatDeskMessage = ({ openCreateCannedModal }) => {
|
|
12
|
+
const selectedConversationId = useConversationStore((state) => state.selectedConversationId);
|
|
13
|
+
const searchClientMsgID = useConversationStore((state) => state.searchClientMsgID);
|
|
14
|
+
const { connectStatus, syncStatus } = useChatContext();
|
|
15
|
+
return (_jsx(_Fragment, { children: connectStatus === ConnectStatus.Connected ? (_jsx(Spin, { spinning: syncStatus === SyncStatus.Loading, children: _jsxs("div", { className: "flex flex-1 flex-row h-screen bg-gray-50", children: [_jsx(DeskAssignedSession, {}), _jsx(DeskConversationList, {}), _jsx(MessageList, { conversationId: selectedConversationId, searchClientMsgID: searchClientMsgID, openCreateCannedModal: openCreateCannedModal }), _jsx(ThreadInfo, {})] }) })) : (_jsx("div", { className: "flex flex-1 flex-row h-screen bg-gray-50", children: connectStatus === ConnectStatus.Connecting && _jsx(Spin, { fullscreen: true }) })) }));
|
|
16
|
+
};
|
|
17
|
+
export default DChatDeskMessage;
|