@phonghq/go-chat 1.0.1 → 1.0.2
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/chat/App.vue.d.ts +2 -2
- package/dist/chat/App.vue.js +60 -63
- package/dist/chat/page/customer-appointment/{CustomerApointment.vue.js → CustomerAppointment.vue.js} +5 -5
- package/dist/chat/page/customer-check-in/CollapseCheckIn.vue.js +2 -2
- package/dist/chat/page/customer-check-in/CustomerCheckIn.vue.js +4 -4
- package/dist/chat/page/customer-detail/CustomerDetail.vue.d.ts +1 -1
- package/dist/chat/page/customer-detail/CustomerDetail.vue.js +16 -15
- package/dist/chat/page/customer-detail/SubInformation.vue.js +1 -1
- package/dist/chat/page/error/Error.vue.js +1 -1
- package/dist/chat/page/home/ChatList.vue.d.ts +1 -1
- package/dist/chat/page/home/ChatList.vue.js +11 -13
- package/dist/chat/page/home/ChatMessage.vue.d.ts +2 -2
- package/dist/chat/page/home/ChatMessage.vue.js +4 -4
- package/dist/chat/page/home/Home.vue.d.ts +2 -2
- package/dist/chat/page/home/Home.vue.js +10 -10
- package/dist/chat/page/home/HomeHeader.vue.d.ts +1 -1
- package/dist/chat/page/home/HomeHeader.vue.js +6 -6
- package/dist/chat/page/home/InputChat.vue.d.ts +1 -1
- package/dist/chat/page/home/InputChat.vue.js +13 -11
- package/dist/chat/page/home/NewCustomer.vue.d.ts +1 -1
- package/dist/chat/page/home/NewCustomer.vue.js +2 -2
- package/dist/components/ListenEvent.vue.js +25 -27
- package/dist/components/chat/ScrollEvent/ScrollEvent.vue.js +1 -1
- package/dist/components/chat/call/Calling.vue.d.ts +1 -1
- package/dist/components/chat/call/Calling.vue.js +68 -38
- package/dist/components/chat/common/collapse/CollapseBase.vue.js +1 -1
- package/dist/components/chat/common/input/InputSearch.vue.d.ts +1 -1
- package/dist/components/chat/common/input/InputSearch.vue.js +2 -2
- package/dist/components/chat/common/popover/PopoverBase.vue.js +1 -1
- package/dist/components/chat/layout/mobile/Footer.vue.js +10 -10
- package/dist/components/common/button/ButtonBase.vue.js +2 -2
- package/dist/components/common/button/ButtonToggle.vue.js +1 -1
- package/dist/components/common/checkbox/CCheckboxNumber.vue.js +1 -1
- package/dist/components/common/drawer/DrawerBase.vue.js +1 -1
- package/dist/components/common/dropdown/DropdownBase.vue.js +1 -1
- package/dist/components/common/input/CInputSearch.vue.js +1 -1
- package/dist/components/common/modal/ModalBase.vue.js +2 -2
- package/dist/components/common/slider/BaseSlider.vue.js +1 -1
- package/dist/components/modal/Confirm.vue.js +3 -3
- package/dist/components/ui/button/CButton.vue.js +1 -1
- package/dist/components/ui/checkbox/Checkbox.vue.js +1 -1
- package/dist/components/ui/dialog/DialogContent.vue.js +1 -1
- package/dist/components/ui/dialog/DialogDescription.vue.js +1 -1
- package/dist/components/ui/dialog/DialogFooter.vue.js +1 -1
- package/dist/components/ui/dialog/DialogHeader.vue.js +1 -1
- package/dist/components/ui/dialog/DialogScrollContent.vue.js +1 -1
- package/dist/components/ui/dialog/DialogTitle.vue.js +1 -1
- package/dist/components/ui/drawer/DrawerContent.vue.js +1 -1
- package/dist/components/ui/drawer/DrawerDescription.vue.js +1 -1
- package/dist/components/ui/drawer/DrawerFooter.vue.js +1 -1
- package/dist/components/ui/drawer/DrawerHeader.vue.js +1 -1
- package/dist/components/ui/drawer/DrawerOverlay.vue.js +1 -1
- package/dist/components/ui/drawer/DrawerTitle.vue.js +1 -1
- package/dist/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.js +1 -1
- package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.js +1 -1
- package/dist/components/ui/dropdown-menu/DropdownMenuItem.vue.js +1 -1
- package/dist/components/ui/dropdown-menu/DropdownMenuLabel.vue.js +1 -1
- package/dist/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.js +1 -1
- package/dist/components/ui/dropdown-menu/DropdownMenuSeparator.vue.js +1 -1
- package/dist/components/ui/dropdown-menu/DropdownMenuShortcut.vue.js +1 -1
- package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.js +1 -1
- package/dist/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.js +1 -1
- package/dist/components/ui/popover/PopoverContent.vue.js +1 -1
- package/dist/components/ui/radio-group/RadioGroup.vue.js +1 -1
- package/dist/components/ui/radio-group/RadioGroupItem.vue.js +1 -1
- package/dist/components/ui/slider/Slider.vue.js +1 -1
- package/dist/components/ui/switch/Switch.vue.js +1 -1
- package/dist/composable/useCallHelper.d.ts +1 -1
- package/dist/composable/useCallHelper.js +4 -16
- package/dist/composable/useInitData.d.ts +1 -1
- package/dist/composable/useInitData.js +8 -6
- package/dist/composable/useModalConfirm.d.ts +1 -1
- package/dist/go-chat.es.js +26369 -28399
- package/dist/go-chat.umd.js +15 -23
- package/dist/plugins/mqtt.d.ts +2 -1
- package/dist/plugins/mqtt.js +1 -2
- package/dist/plugins/sdk.js +3 -3
- package/dist/plugins/websocket.d.ts +4 -1
- package/dist/plugins/websocket.js +61 -22
- package/dist/style.css +1 -1
- package/dist/utils/chat/auth.d.ts +1 -1
- package/dist/utils/chat/auth.js +2 -2
- package/dist/utils/chat/call.d.ts +4 -0
- package/dist/utils/chat/call.js +52 -1
- package/dist/utils/chat/chat-router.d.ts +1 -1
- package/dist/utils/chat/chat-router.js +1 -1
- package/dist/utils/chat/conversation.d.ts +2 -2
- package/dist/utils/chat/conversation.js +1 -1
- package/dist/utils/chat/message.d.ts +2 -2
- package/dist/utils/chat/message.js +1 -1
- package/dist/utils/chat/user.d.ts +2 -2
- package/dist/utils/chat/user.js +1 -1
- package/dist/utils/json.d.ts +2 -0
- package/dist/utils/json.js +18 -0
- package/package.json +1 -1
- package/dist/stores/general.d.ts +0 -48
- package/dist/stores/general.js +0 -39
- /package/dist/chat/page/customer-appointment/{CustomerApointment.vue.d.ts → CustomerAppointment.vue.d.ts} +0 -0
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
import { publishMessage } from '
|
|
2
|
-
import { TOPIC_DETAIL_CALL } from '
|
|
3
|
-
import { getIceService } from '
|
|
4
|
-
import { dataProfile } from '
|
|
1
|
+
import { publishMessage } from '../plugins/mqtt';
|
|
2
|
+
import { TOPIC_DETAIL_CALL } from '../constant/mqtt';
|
|
3
|
+
import { getIceService } from '../utils/chat/call';
|
|
4
|
+
import { dataProfile } from '../utils/chat/auth';
|
|
5
5
|
import { ref } from 'vue';
|
|
6
6
|
export function useCallHelper() {
|
|
7
7
|
let pc;
|
|
8
8
|
let iceStunServiceLink = '';
|
|
9
|
-
let iceTurnServiceLink = '';
|
|
10
9
|
let iceServer = null;
|
|
11
10
|
let answer;
|
|
12
11
|
let offer = null;
|
|
13
|
-
// const servers = {
|
|
14
|
-
// iceServers: [
|
|
15
|
-
// { urls: 'stun:stun.l.google.com:19302' }
|
|
16
|
-
// ]
|
|
17
|
-
// }
|
|
18
12
|
const remoteAudio = () => {
|
|
19
13
|
return document.getElementById('go-chat-remote-audio');
|
|
20
14
|
};
|
|
@@ -22,11 +16,6 @@ export function useCallHelper() {
|
|
|
22
16
|
return document.getElementById('go-chat-local-audio');
|
|
23
17
|
};
|
|
24
18
|
const userRemoter = ref(null);
|
|
25
|
-
// const start = async () => {
|
|
26
|
-
// localStream = await navigator?.mediaDevices?.getUserMedia({ audio: true })
|
|
27
|
-
// const local = localAudio() as any
|
|
28
|
-
// if (local) local.srcObject = localStream
|
|
29
|
-
// }
|
|
30
19
|
const call = async (user) => {
|
|
31
20
|
userRemoter.value = user;
|
|
32
21
|
await getIceServiceLink();
|
|
@@ -120,7 +109,6 @@ export function useCallHelper() {
|
|
|
120
109
|
const res = await getIceService();
|
|
121
110
|
console.log(res);
|
|
122
111
|
iceStunServiceLink = res[0]?.urls[0] ?? '';
|
|
123
|
-
iceTurnServiceLink = res[1]?.urls[0] ?? '';
|
|
124
112
|
iceServer = res;
|
|
125
113
|
};
|
|
126
114
|
const handleOffer = async (data) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PAGE_RESPONSE } from '
|
|
1
|
+
import type { PAGE_RESPONSE } from '../types/chat/global';
|
|
2
2
|
export declare const isRouterReady: import("vue").Ref<boolean, boolean>;
|
|
3
3
|
export declare function useInitData(): {
|
|
4
4
|
NOTIFY_ID_APPOINTMENT_NAME: string;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ref } from 'vue';
|
|
2
|
-
import { sdkInit } from '
|
|
3
|
-
import { dataProfile, getProfile, loginLink } from '
|
|
4
|
-
import { routerPush } from '
|
|
5
|
-
import { PAGE } from '
|
|
6
|
-
import { subscribeToTopic, unsubscribeFromTopic } from '
|
|
7
|
-
import { TOPIC_DETAIL_CALL } from '
|
|
2
|
+
import { sdkInit } from '../plugins/sdk';
|
|
3
|
+
import { dataProfile, getProfile, loginLink } from '../utils/chat/auth';
|
|
4
|
+
import { routerPush } from '../utils/chat/chat-router';
|
|
5
|
+
import { PAGE } from '../constant/general';
|
|
6
|
+
import { subscribeToTopic, unsubscribeFromTopic } from '../plugins/mqtt';
|
|
7
|
+
import { TOPIC_DETAIL_CALL } from '../constant/mqtt';
|
|
8
|
+
import { getWebSocket } from '../plugins/websocket';
|
|
8
9
|
//PINIA
|
|
9
10
|
export const isRouterReady = ref(false);
|
|
10
11
|
export function useInitData() {
|
|
@@ -38,6 +39,7 @@ export function useInitData() {
|
|
|
38
39
|
};
|
|
39
40
|
const initData = async () => {
|
|
40
41
|
await getProfile();
|
|
42
|
+
getWebSocket();
|
|
41
43
|
unsubscribeFromTopic(TOPIC_DETAIL_CALL + dataProfile.value?.id);
|
|
42
44
|
subscribeToTopic(TOPIC_DETAIL_CALL + dataProfile.value?.id);
|
|
43
45
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConfirmPayloadPromise, ConfirmPayload } from '
|
|
1
|
+
import type { ConfirmPayloadPromise, ConfirmPayload } from '../types/chat/promise';
|
|
2
2
|
export declare function useModalConfirm(): {
|
|
3
3
|
setHandleConfirm: (callback: (data: ConfirmPayloadPromise) => void) => void;
|
|
4
4
|
modalConfirm: (data: ConfirmPayload) => Promise<any>;
|