@esvndev/es-react-template-chat 0.0.14 → 0.0.16
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/components/hook/index.d.ts +0 -26
- package/dist/index.js +144 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +144 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -14,31 +14,5 @@ export declare const useChat: () => {
|
|
|
14
14
|
archiveStore: any;
|
|
15
15
|
checkScroll: any;
|
|
16
16
|
listGeneralGroup: any;
|
|
17
|
-
getHistoryApi: (params: any) => any;
|
|
18
|
-
getInfoApi: (params: any) => any;
|
|
19
|
-
getMessageByGroupApi: (params: any, paging: any) => any;
|
|
20
|
-
getMessageByContactApi: (params: string, paging: any) => any;
|
|
21
|
-
groupsApi: (params: any) => any;
|
|
22
|
-
addMemberGroup: (params: any) => any;
|
|
23
|
-
senMessageApi: (id: string, params: any) => any;
|
|
24
|
-
deleteMessageApi: (params: any) => any;
|
|
25
|
-
recallMessageApi: (params: any) => any;
|
|
26
|
-
contactAddApi: (params: any) => any;
|
|
27
|
-
updateGroupAvatarApi: (params: any) => any;
|
|
28
|
-
getProfileApi: () => any;
|
|
29
|
-
getUsersApi: (params: any) => any;
|
|
30
|
-
getContactApi: (params: any) => any;
|
|
31
|
-
getHistoryActiveApi: (params: any) => any;
|
|
32
|
-
updateChatRoomMemberApi: (params: any) => any;
|
|
33
|
-
setScroll: (params: any) => any;
|
|
34
|
-
setGeneralGroup: (params: any) => any;
|
|
35
|
-
get_message_by_group_cursor_api: (params: any) => any;
|
|
36
|
-
getPagingEmployeeApi: (params: any) => any;
|
|
37
|
-
connectChatRoomMember: (params: any) => any;
|
|
38
|
-
pinMessageChatRoom: (params: any) => any;
|
|
39
|
-
getPinMessageChatRoomApi: (params: any) => any;
|
|
40
|
-
deletePinMessage: (pinId: string) => any;
|
|
41
|
-
updateGroupTagApi: (params: any) => any;
|
|
42
|
-
createReminderApi: (params: any) => any;
|
|
43
17
|
typingUsers: any;
|
|
44
18
|
};
|
package/dist/index.js
CHANGED
|
@@ -20468,24 +20468,152 @@ var dayjs_min = {exports: {}};
|
|
|
20468
20468
|
!function(t,n){module.exports=n(dayjs_min.exports);}(commonjsGlobal,(function(t){function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var h=n(t),_={name:"vi",weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),weekStart:1,weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"}};return h.default.locale(_,null,!0),_}));
|
|
20469
20469
|
}(vi));
|
|
20470
20470
|
|
|
20471
|
+
//import * as chatStore from '../store'
|
|
20472
|
+
const useChat = () => {
|
|
20473
|
+
//const dispatch = useAppDispatch()
|
|
20474
|
+
const { active, checkInit, chatRoomId, userLogin, listContact, contactId, typeChat, loadChat, messageByGroup, listHistory, listChatType, archiveStore, checkScroll, listGeneralGroup, pinnedMessages, typingUsers } = configureStore.useAppSelector((state) => state.chat);
|
|
20475
|
+
console.log('active', active);
|
|
20476
|
+
// const getHistoryApi = (params: any) => {
|
|
20477
|
+
// return dispatch(chatStore.get_history(params))
|
|
20478
|
+
// }
|
|
20479
|
+
// const get_message_by_group_cursor_api = (params: any) => {
|
|
20480
|
+
// return dispatch(chatStore.get_message_by_group_cursor(params))
|
|
20481
|
+
// }
|
|
20482
|
+
// const getHistoryActiveApi = (params: any) => {
|
|
20483
|
+
// return dispatch(chatStore.get_history_active(params))
|
|
20484
|
+
// }
|
|
20485
|
+
// const getInfoApi = (params: any) => {
|
|
20486
|
+
// return dispatch(chatStore.get_info(params))
|
|
20487
|
+
// }
|
|
20488
|
+
// const getMessageByGroupApi = (params: any, paging: any) => {
|
|
20489
|
+
// return dispatch(chatStore.get_message_by_group({ chatRoomId: params, paging }))
|
|
20490
|
+
// }
|
|
20491
|
+
// const getMessageByContactApi = (params: string, paging: any) => {
|
|
20492
|
+
// return dispatch(chatStore.get_message_by_contact({ chatRoomId: params, paging }))
|
|
20493
|
+
// }
|
|
20494
|
+
// const groupsApi = (params: any) => {
|
|
20495
|
+
// return dispatch(chatStore.groups(params))
|
|
20496
|
+
// }
|
|
20497
|
+
// const addMemberGroup = (params: any) => {
|
|
20498
|
+
// return dispatch(chatStore.addMemberGroup(params))
|
|
20499
|
+
// }
|
|
20500
|
+
// const senMessageApi = (id: string, params: any) => {
|
|
20501
|
+
// return dispatch(chatStore.sen_message({ id, formData: params }))
|
|
20502
|
+
// }
|
|
20503
|
+
// const deleteMessageApi = (params: any) => {
|
|
20504
|
+
// return dispatch(chatStore.delete_message(params))
|
|
20505
|
+
// }
|
|
20506
|
+
// const recallMessageApi = (params: any) => {
|
|
20507
|
+
// return dispatch(chatStore.recall_message(params))
|
|
20508
|
+
// }
|
|
20509
|
+
// const contactAddApi = (params: any) => {
|
|
20510
|
+
// return dispatch(chatStore.contact_add(params))
|
|
20511
|
+
// }
|
|
20512
|
+
// const updateGroupAvatarApi = (params: any) => {
|
|
20513
|
+
// return dispatch(chatStore.update_group_avatar(params))
|
|
20514
|
+
// }
|
|
20515
|
+
// const getProfileApi = () => {
|
|
20516
|
+
// return dispatch(chatStore.get_profile())
|
|
20517
|
+
// }
|
|
20518
|
+
// const getUsersApi = (params: any) => {
|
|
20519
|
+
// return dispatch(chatStore.get_users(params))
|
|
20520
|
+
// }
|
|
20521
|
+
// const getContactApi = (params: any) => {
|
|
20522
|
+
// return dispatch(chatStore.get_contact(params))
|
|
20523
|
+
// }
|
|
20524
|
+
// const updateChatRoomMemberApi = (params: any) => {
|
|
20525
|
+
// return dispatch(chatStore.update_chat_room_member(params))
|
|
20526
|
+
// }
|
|
20527
|
+
// const setScroll = (params: any) => {
|
|
20528
|
+
// return dispatch(chatStore.setScroll(params))
|
|
20529
|
+
// }
|
|
20530
|
+
// const setGeneralGroup = (params: any) => {
|
|
20531
|
+
// return dispatch(chatStore.setGeneralGroup(params))
|
|
20532
|
+
// }
|
|
20533
|
+
// const getPagingEmployeeApi = (params: any) => {
|
|
20534
|
+
// return dispatch(chatStore.getPagingEmployeeApi(params))
|
|
20535
|
+
// }
|
|
20536
|
+
// const connectChatRoomMember = (params: any) => {
|
|
20537
|
+
// return dispatch(chatStore.connectChatRoomMemberApi(params))
|
|
20538
|
+
// }
|
|
20539
|
+
// const pinMessageChatRoom = (params: any) => {
|
|
20540
|
+
// return dispatch(chatStore.pinMessageChatRoomApi(params))
|
|
20541
|
+
// }
|
|
20542
|
+
// const getPinMessageChatRoomApi = (params: any) => {
|
|
20543
|
+
// return dispatch(chatStore.getPinMessageChatRoomApi(params))
|
|
20544
|
+
// }
|
|
20545
|
+
// const deletePinMessage = (pinId: string) => {
|
|
20546
|
+
// return dispatch(chatStore.deletePinMessageApi(pinId))
|
|
20547
|
+
// }
|
|
20548
|
+
// const updateGroupTagApi = (params: any) => {
|
|
20549
|
+
// return dispatch(chatStore.updateGroupTagApi(params))
|
|
20550
|
+
// }
|
|
20551
|
+
// const createReminderApi = (params: any) => {
|
|
20552
|
+
// return dispatch(chatStore.createReminderApi(params))
|
|
20553
|
+
// }
|
|
20554
|
+
return {
|
|
20555
|
+
active,
|
|
20556
|
+
contactId,
|
|
20557
|
+
typeChat,
|
|
20558
|
+
chatRoomId,
|
|
20559
|
+
checkInit,
|
|
20560
|
+
userLogin,
|
|
20561
|
+
listContact,
|
|
20562
|
+
loadChat,
|
|
20563
|
+
messageByGroup,
|
|
20564
|
+
listHistory,
|
|
20565
|
+
listChatType,
|
|
20566
|
+
pinnedMessages,
|
|
20567
|
+
archiveStore,
|
|
20568
|
+
checkScroll,
|
|
20569
|
+
listGeneralGroup,
|
|
20570
|
+
// getHistoryApi,
|
|
20571
|
+
// getInfoApi,
|
|
20572
|
+
// getMessageByGroupApi,
|
|
20573
|
+
// getMessageByContactApi,
|
|
20574
|
+
// groupsApi,
|
|
20575
|
+
// addMemberGroup,
|
|
20576
|
+
// senMessageApi,
|
|
20577
|
+
// deleteMessageApi,
|
|
20578
|
+
// recallMessageApi,
|
|
20579
|
+
// contactAddApi,
|
|
20580
|
+
// updateGroupAvatarApi,
|
|
20581
|
+
// getProfileApi,
|
|
20582
|
+
// getUsersApi,
|
|
20583
|
+
// getContactApi,
|
|
20584
|
+
// getHistoryActiveApi,
|
|
20585
|
+
// updateChatRoomMemberApi,
|
|
20586
|
+
// setScroll,
|
|
20587
|
+
// setGeneralGroup,
|
|
20588
|
+
// get_message_by_group_cursor_api,
|
|
20589
|
+
// getPagingEmployeeApi,
|
|
20590
|
+
// connectChatRoomMember,
|
|
20591
|
+
// pinMessageChatRoom,
|
|
20592
|
+
// getPinMessageChatRoomApi,
|
|
20593
|
+
// deletePinMessage,
|
|
20594
|
+
// updateGroupTagApi,
|
|
20595
|
+
// createReminderApi,
|
|
20596
|
+
typingUsers
|
|
20597
|
+
};
|
|
20598
|
+
};
|
|
20599
|
+
|
|
20471
20600
|
const AppChat = () => {
|
|
20472
|
-
|
|
20473
|
-
//
|
|
20474
|
-
//
|
|
20475
|
-
//
|
|
20476
|
-
//
|
|
20477
|
-
//
|
|
20478
|
-
//
|
|
20479
|
-
//
|
|
20480
|
-
//
|
|
20481
|
-
//
|
|
20482
|
-
//
|
|
20483
|
-
//
|
|
20484
|
-
//
|
|
20485
|
-
|
|
20486
|
-
// } = useChat()
|
|
20601
|
+
const { active,
|
|
20602
|
+
// contactId,
|
|
20603
|
+
// typeChat,
|
|
20604
|
+
// chatRoomId,
|
|
20605
|
+
// messageByGroup,
|
|
20606
|
+
// listHistory,
|
|
20607
|
+
// checkInit,
|
|
20608
|
+
// setScroll,
|
|
20609
|
+
// getHistoryApi,
|
|
20610
|
+
// getProfileApi,
|
|
20611
|
+
// getInfoApi,
|
|
20612
|
+
// getContactApi,
|
|
20613
|
+
// senMessageApi
|
|
20614
|
+
} = useChat();
|
|
20487
20615
|
const { connection } = configureStore.useAppSelector((state) => state.hubNotification);
|
|
20488
|
-
|
|
20616
|
+
console.log('active', active);
|
|
20489
20617
|
console.log('connection', connection);
|
|
20490
20618
|
// const getWindowSize = () => {
|
|
20491
20619
|
// const {innerWidth, innerHeight} = window
|