@phonghq/go-chat 1.0.8 → 1.0.10
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/README.md +1 -1
- package/dist/chat/App.vue.d.ts +3 -2
- package/dist/components/chat/call/Calling.vue.d.ts +6 -2
- package/dist/components/common/drawer/DrawerBaseCustom.vue.d.ts +30 -0
- package/dist/composable/TestSound.d.ts +64 -0
- package/dist/composable/useCallHelper.d.ts +26 -8
- package/dist/constant/datetime.d.ts +1 -0
- package/dist/go-chat.es.js +143 -143
- package/dist/go-chat.umd.js +6 -6
- package/dist/plugins/websocket.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/test/assets/icons/IconArrowLeft.vue.js +1 -1
- package/dist/test/assets/icons/IconPhone.vue.js +1 -1
- package/dist/test/assets/icons/IconPlan.vue.js +1 -1
- package/dist/test/assets/icons/IconPlus.vue.js +1 -1
- package/dist/test/assets/icons/IconSearch.vue.js +1 -1
- package/dist/test/assets/icons/call/IconMic.vue.js +1 -1
- package/dist/test/assets/icons/call/IconPhone.vue.js +1 -1
- package/dist/test/assets/icons/call/IconPhoneCancel.vue.js +1 -1
- package/dist/test/assets/icons/call/IconSpeaker.vue.js +1 -1
- package/dist/test/assets/icons/customer-appointment/IconFilter.vue.js +1 -1
- package/dist/test/assets/icons/customer-detail/IconArrow.vue.js +1 -1
- package/dist/test/assets/icons/customer-detail/IconCheck.vue.js +1 -1
- package/dist/test/assets/icons/customer-detail/IconDate.vue.js +1 -1
- package/dist/test/assets/icons/customer-detail/IconGroup.vue.js +1 -1
- package/dist/test/assets/icons/customer-detail/IconMessage.vue.js +1 -1
- package/dist/test/assets/icons/customer-detail/IconNote.vue.js +1 -1
- package/dist/test/assets/icons/customer-detail/IconPhone.vue.js +1 -1
- package/dist/test/assets/icons/customer-detail/IconPin.vue.js +1 -1
- package/dist/test/assets/icons/customer-detail/IconSearch.vue.js +1 -1
- package/dist/test/chat/App.vue.js +174 -108
- package/dist/test/chat/page/customer-appointment/CustomerAppointment.vue.js +1 -1
- package/dist/test/chat/page/customer-check-in/CollapseCheckIn.vue.js +1 -1
- package/dist/test/chat/page/customer-check-in/CustomerCheckIn.vue.js +1 -1
- package/dist/test/chat/page/customer-detail/CustomerDetail.vue.js +1 -1
- package/dist/test/chat/page/customer-detail/SubInformation.vue.js +1 -1
- package/dist/test/chat/page/error/Error.vue.js +1 -1
- package/dist/test/chat/page/home/ChatList.vue.js +40 -6
- package/dist/test/chat/page/home/ChatMessage.vue.js +1 -1
- package/dist/test/chat/page/home/Home.vue.js +9 -3
- package/dist/test/chat/page/home/InputChat.vue.js +3 -2
- package/dist/test/chat/page/home/NewCustomer.vue.js +1 -1
- package/dist/test/components/ListenEvent.vue.js +1 -1
- package/dist/test/components/chat/ScrollEvent/ScrollEvent.vue.js +1 -1
- package/dist/test/components/chat/call/Calling.vue.js +102 -70
- package/dist/test/components/chat/card/CardCustomerDetail.vue.js +1 -1
- package/dist/test/components/chat/common/collapse/CollapseBase.vue.js +1 -1
- package/dist/test/components/chat/common/input/InputSearch.vue.js +1 -1
- package/dist/test/components/chat/common/popover/PopoverBase.vue.js +1 -1
- package/dist/test/components/chat/common/spin/BaseSpin.vue.js +1 -1
- package/dist/test/components/chat/customer/Avatar.vue.js +1 -1
- package/dist/test/components/chat/layout/mobile/Footer.vue.js +1 -1
- package/dist/test/components/common/CustomLoading.vue.js +1 -1
- package/dist/test/components/common/Notification/NotificationDescription.vue.js +1 -1
- package/dist/test/components/common/button/ButtonBase.vue.js +1 -1
- package/dist/test/components/common/button/ButtonToggle.vue.js +1 -1
- package/dist/test/components/common/checkbox/CCheckboxNumber.vue.js +1 -1
- package/dist/test/components/common/collapse/BaseCollapse.vue.js +1 -1
- package/dist/test/components/common/collapse/BaseCollapseItem.vue.js +1 -1
- package/dist/test/components/common/drawer/DrawerBase.vue.js +1 -1
- package/dist/test/components/common/drawer/DrawerBaseCustom.vue.js +128 -0
- package/dist/test/components/common/dropdown/DropdownBase.vue.js +1 -1
- package/dist/test/components/common/input/CInputSearch.vue.js +1 -1
- package/dist/test/components/common/modal/ModalBase.vue.js +1 -1
- package/dist/test/components/common/popover/PopoverBase.vue.js +1 -1
- package/dist/test/components/common/slider/BaseSlider.vue.js +1 -1
- package/dist/test/components/common/spin/CSpin.vue.js +1 -1
- package/dist/test/components/common/tooltip/TooltipBase.vue.js +1 -1
- package/dist/test/components/layout/Blank.vue.js +1 -1
- package/dist/test/components/layout/Default.vue.js +1 -1
- package/dist/test/components/modal/Confirm.vue.js +1 -1
- package/dist/test/components/ui/button/CButton.vue.js +1 -1
- package/dist/test/components/ui/checkbox/Checkbox.vue.js +1 -1
- package/dist/test/components/ui/collapsible/Collapsible.vue.js +1 -1
- package/dist/test/components/ui/collapsible/CollapsibleContent.vue.js +1 -1
- package/dist/test/components/ui/collapsible/CollapsibleTrigger.vue.js +1 -1
- package/dist/test/components/ui/dialog/Dialog.vue.js +1 -1
- package/dist/test/components/ui/dialog/DialogClose.vue.js +1 -1
- package/dist/test/components/ui/dialog/DialogContent.vue.js +1 -1
- package/dist/test/components/ui/dialog/DialogDescription.vue.js +1 -1
- package/dist/test/components/ui/dialog/DialogFooter.vue.js +1 -1
- package/dist/test/components/ui/dialog/DialogHeader.vue.js +1 -1
- package/dist/test/components/ui/dialog/DialogScrollContent.vue.js +1 -1
- package/dist/test/components/ui/dialog/DialogTitle.vue.js +1 -1
- package/dist/test/components/ui/dialog/DialogTrigger.vue.js +1 -1
- package/dist/test/components/ui/drawer/Drawer.vue.js +1 -1
- package/dist/test/components/ui/drawer/DrawerContent.vue.js +1 -1
- package/dist/test/components/ui/drawer/DrawerDescription.vue.js +1 -1
- package/dist/test/components/ui/drawer/DrawerFooter.vue.js +1 -1
- package/dist/test/components/ui/drawer/DrawerHeader.vue.js +1 -1
- package/dist/test/components/ui/drawer/DrawerOverlay.vue.js +3 -3
- package/dist/test/components/ui/drawer/DrawerTitle.vue.js +1 -1
- package/dist/test/components/ui/dropdown-menu/DropdownMenu.vue.js +1 -1
- package/dist/test/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.js +1 -1
- package/dist/test/components/ui/dropdown-menu/DropdownMenuContent.vue.js +1 -1
- package/dist/test/components/ui/dropdown-menu/DropdownMenuGroup.vue.js +1 -1
- package/dist/test/components/ui/dropdown-menu/DropdownMenuItem.vue.js +1 -1
- package/dist/test/components/ui/dropdown-menu/DropdownMenuLabel.vue.js +1 -1
- package/dist/test/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.js +1 -1
- package/dist/test/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.js +1 -1
- package/dist/test/components/ui/dropdown-menu/DropdownMenuSeparator.vue.js +1 -1
- package/dist/test/components/ui/dropdown-menu/DropdownMenuShortcut.vue.js +1 -1
- package/dist/test/components/ui/dropdown-menu/DropdownMenuSub.vue.js +1 -1
- package/dist/test/components/ui/dropdown-menu/DropdownMenuSubContent.vue.js +1 -1
- package/dist/test/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.js +1 -1
- package/dist/test/components/ui/dropdown-menu/DropdownMenuTrigger.vue.js +1 -1
- package/dist/test/components/ui/popover/Popover.vue.js +1 -1
- package/dist/test/components/ui/popover/PopoverContent.vue.js +1 -1
- package/dist/test/components/ui/popover/PopoverTrigger.vue.js +1 -1
- package/dist/test/components/ui/radio-group/RadioGroup.vue.js +1 -1
- package/dist/test/components/ui/radio-group/RadioGroupItem.vue.js +1 -1
- package/dist/test/components/ui/slider/Slider.vue.js +1 -1
- package/dist/test/components/ui/switch/Switch.vue.js +1 -1
- package/dist/test/composable/TestSound.js +196 -0
- package/dist/test/composable/useCallHelper.js +198 -142
- package/dist/test/constant/datetime.js +1 -0
- package/dist/test/plugins/websocket.js +10 -13
- package/dist/test/utils/chat/call.js +37 -0
- package/dist/types/chat/global.d.ts +1 -0
- package/dist/utils/chat/call.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
2
|
import Avatar from '../../../components/chat/customer/Avatar.vue';
|
|
3
3
|
import { dataProfile } from '../../../utils/chat/auth';
|
|
4
4
|
import { nextTick, ref } from 'vue';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
2
|
import HomeHeader from '../../../chat/page/home/HomeHeader.vue';
|
|
3
3
|
import NewCustomer from '../../../chat/page/home/NewCustomer.vue';
|
|
4
4
|
import InputChat from '../../../chat/page/home/InputChat.vue';
|
|
@@ -9,7 +9,7 @@ import { addHandleMqttMessage, connectMqtt, publishMessage, removeHandleMqttMess
|
|
|
9
9
|
import { TOPIC_DETAIL_CHAT, TOPIC_HOME } from '../../../constant/mqtt';
|
|
10
10
|
import { dataProfile } from '../../../utils/chat/auth';
|
|
11
11
|
import dayjs from 'dayjs';
|
|
12
|
-
import { DATE_FORMATS } from '../../../constant/datetime';
|
|
12
|
+
import { DATE_FORMATS, TIME_ZONE_UTC } from '../../../constant/datetime';
|
|
13
13
|
import { MessageState } from '../../../constant/message';
|
|
14
14
|
const props = withDefaults(defineProps(), {});
|
|
15
15
|
const emit = defineEmits();
|
|
@@ -172,7 +172,7 @@ const publicTopicConversationUpdate = async (isSendImg, message) => {
|
|
|
172
172
|
conversation_id: infoUser.value?.conversation_id ?? 0,
|
|
173
173
|
receiver_id: Number(infoUser.value?.id)
|
|
174
174
|
});
|
|
175
|
-
const current = dayjs().format(DATE_FORMATS['DATE_FORMAT_FULL']);
|
|
175
|
+
const current = dayjs().tz(TIME_ZONE_UTC).format(DATE_FORMATS['DATE_FORMAT_FULL']);
|
|
176
176
|
const dataMessageForReceiver = {
|
|
177
177
|
id: infoUser.value?.conversation_id ?? 0,
|
|
178
178
|
receiver_id: Number(dataProfile.value?.id ?? 0),
|
|
@@ -294,6 +294,11 @@ else if (!__VLS_ctx.isLoading) {
|
|
|
294
294
|
// @ts-ignore
|
|
295
295
|
[infoUser,];
|
|
296
296
|
}
|
|
297
|
+
else {
|
|
298
|
+
__VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({
|
|
299
|
+
...{ class: "grow" },
|
|
300
|
+
});
|
|
301
|
+
}
|
|
297
302
|
/** @type {[typeof InputChat, ]} */ ;
|
|
298
303
|
// @ts-ignore
|
|
299
304
|
const __VLS_20 = __VLS_asFunctionalComponent(InputChat, new InputChat({
|
|
@@ -320,6 +325,7 @@ var __VLS_22;
|
|
|
320
325
|
/** @type {__VLS_StyleScopedClasses['shrink-0']} */ ;
|
|
321
326
|
/** @type {__VLS_StyleScopedClasses['grow']} */ ;
|
|
322
327
|
/** @type {__VLS_StyleScopedClasses['grow']} */ ;
|
|
328
|
+
/** @type {__VLS_StyleScopedClasses['grow']} */ ;
|
|
323
329
|
/** @type {__VLS_StyleScopedClasses['p-6']} */ ;
|
|
324
330
|
// @ts-ignore
|
|
325
331
|
var __VLS_14 = __VLS_13;
|
|
@@ -3,7 +3,7 @@ import IconPlan from '../../../assets/icons/IconPlan.vue';
|
|
|
3
3
|
import EmojiPicker from 'vue3-emoji-picker';
|
|
4
4
|
import 'vue3-emoji-picker/css';
|
|
5
5
|
import dayjs from 'dayjs';
|
|
6
|
-
import { DATE_FORMATS } from '../../../constant/datetime';
|
|
6
|
+
import { DATE_FORMATS, TIME_ZONE_UTC } from '../../../constant/datetime';
|
|
7
7
|
import { dataProfile } from '../../../utils/chat/auth';
|
|
8
8
|
import { ref } from 'vue';
|
|
9
9
|
import PopoverBase from '../../../components/chat/common/popover/PopoverBase.vue';
|
|
@@ -35,9 +35,10 @@ const handleSendMessage = async (type) => {
|
|
|
35
35
|
keyword.value = '';
|
|
36
36
|
chatId++;
|
|
37
37
|
const id = props.data?.id.toString() + '-' + chatId;
|
|
38
|
+
console.log(dayjs().tz(TIME_ZONE_UTC).format(DATE_FORMATS['DATE_FORMAT_FULL']));
|
|
38
39
|
const data = {
|
|
39
40
|
conversation_id: 135,
|
|
40
|
-
created_at: dayjs().format(DATE_FORMATS['DATE_FORMAT_FULL']),
|
|
41
|
+
created_at: dayjs().tz(TIME_ZONE_UTC).format(DATE_FORMATS['DATE_FORMAT_FULL']),
|
|
41
42
|
id,
|
|
42
43
|
message: messageContent,
|
|
43
44
|
receiver_id: props.data?.id || 0,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
2
|
import Avatar from '../../../components/chat/customer/Avatar.vue';
|
|
3
3
|
const props = withDefaults(defineProps(), {});
|
|
4
4
|
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
2
|
import { onMounted, onBeforeUnmount } from 'vue';
|
|
3
3
|
import { useDebounce } from '../utils/debounce';
|
|
4
4
|
// import { useGeneralStore } from '@/stores/general'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
2
|
import { ref } from 'vue';
|
|
3
3
|
import { useDebounce } from '../../../utils/debounce';
|
|
4
4
|
const props = withDefaults(defineProps(), {});
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
|
-
import { ref, onMounted, onUnmounted, watch } from 'vue';
|
|
3
|
-
import DrawerBase from '../../../components/common/drawer/DrawerBase.vue';
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
|
+
import { ref, onMounted, onUnmounted, watch, computed } from 'vue';
|
|
4
3
|
import IconPhone from '../../../assets/icons/call/IconPhone.vue';
|
|
5
4
|
import { dataProfile } from '../../../utils/chat/auth.js';
|
|
6
|
-
import { addHandleMqttMessage, connectMqtt, removeHandleMqttMessage, subscribeToTopic, unsubscribeFromTopic } from '../../../plugins/mqtt.js';
|
|
7
|
-
import { TOPIC_DETAIL_CALL } from '../../../constant/mqtt.js';
|
|
8
5
|
import { useCallHelper } from '../../../composable/useCallHelper';
|
|
9
6
|
import IconPhoneCancel from '../../../assets/icons/call/IconPhoneCancel.vue';
|
|
10
7
|
import { addHandleWebSK, removeHandleWebSK } from '../../../plugins/websocket';
|
|
11
|
-
import { callClient
|
|
12
|
-
|
|
8
|
+
import { callClient } from '../../../utils/chat/call';
|
|
9
|
+
import { useAudioStream } from '../../../composable/TestSound';
|
|
10
|
+
import DrawerBaseCustom from '../../../components/common/drawer/DrawerBaseCustom.vue';
|
|
11
|
+
import Avatar from '../../../components/chat/customer/Avatar.vue';
|
|
12
|
+
const { handleOffer, handleOfferResponse, call, end, userRemoter, handleMedia, startIncomingCall } = useCallHelper();
|
|
13
|
+
const { enqueueSpeakerChunk, processSpeakerQueue } = useAudioStream('');
|
|
14
|
+
const props = withDefaults(defineProps(), {});
|
|
13
15
|
const STATUS = {
|
|
14
16
|
CONNECTING: 'Connecting...',
|
|
15
17
|
CALLING: 'calling',
|
|
@@ -18,18 +20,22 @@ const STATUS = {
|
|
|
18
20
|
CALL_START: 'in-progress',
|
|
19
21
|
CALL_END: 'completed'
|
|
20
22
|
};
|
|
21
|
-
const STATUS_LABEL = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
const STATUS_LABEL = computed(() => {
|
|
24
|
+
return {
|
|
25
|
+
[STATUS.CONNECTING]: 'Connecting...',
|
|
26
|
+
[STATUS.CALLING]: 'Calling...',
|
|
27
|
+
[STATUS.RINGING]: 'Ringing...',
|
|
28
|
+
[STATUS.CONNECT_FAILED]: errorMessage.value || 'Connect Error',
|
|
29
|
+
[STATUS.CALL_START]: '',
|
|
30
|
+
[STATUS.CALL_END]: 'Call Ended'
|
|
31
|
+
};
|
|
32
|
+
});
|
|
29
33
|
const callStatus = ref(STATUS.CONNECTING);
|
|
30
34
|
const duration = ref('00:00');
|
|
31
35
|
const drawerVisible = ref(false);
|
|
32
36
|
const disable = ref(false);
|
|
37
|
+
const errorMessage = ref('');
|
|
38
|
+
const drawerVisibleRef = ref(null);
|
|
33
39
|
let timer = null;
|
|
34
40
|
let timeOut = null;
|
|
35
41
|
onMounted(() => {
|
|
@@ -43,6 +49,7 @@ onUnmounted(() => {
|
|
|
43
49
|
clearInterval(timer);
|
|
44
50
|
if (timeOut)
|
|
45
51
|
clearTimeout(timeOut);
|
|
52
|
+
errorMessage.value = '';
|
|
46
53
|
});
|
|
47
54
|
let dataWebSK = null;
|
|
48
55
|
function startTimer() {
|
|
@@ -66,21 +73,28 @@ function endCall() {
|
|
|
66
73
|
clearInterval(timer);
|
|
67
74
|
disable.value = false;
|
|
68
75
|
drawerVisible.value = false;
|
|
76
|
+
drawerVisibleRef.value?.close();
|
|
77
|
+
if (timer)
|
|
78
|
+
clearInterval(timer);
|
|
79
|
+
if (timeOut)
|
|
80
|
+
clearTimeout(timeOut);
|
|
81
|
+
errorMessage.value = '';
|
|
69
82
|
}
|
|
70
83
|
const open = () => {
|
|
71
84
|
drawerVisible.value = true;
|
|
72
85
|
disable.value = true;
|
|
86
|
+
drawerVisibleRef.value?.open();
|
|
73
87
|
};
|
|
74
88
|
const startCall = async (data) => {
|
|
75
89
|
try {
|
|
76
90
|
callStatus.value = STATUS.CONNECTING;
|
|
77
91
|
open();
|
|
78
|
-
await
|
|
79
|
-
// await call(data)
|
|
92
|
+
await call(data);
|
|
80
93
|
callStatus.value = STATUS.CALLING;
|
|
81
94
|
}
|
|
82
95
|
catch (e) {
|
|
83
96
|
console.log(e);
|
|
97
|
+
errorMessage.value = e?.message || JSON.stringify(e);
|
|
84
98
|
callStatus.value = STATUS.CONNECT_FAILED;
|
|
85
99
|
}
|
|
86
100
|
};
|
|
@@ -90,6 +104,7 @@ const answer = async () => {
|
|
|
90
104
|
// sendOfferOk()
|
|
91
105
|
};
|
|
92
106
|
const handleMqttMessage = async (message) => {
|
|
107
|
+
let da = true;
|
|
93
108
|
if (message?.data?.status == STATUS.RINGING) {
|
|
94
109
|
if (message?.data?.to_number == dataProfile.value?.phone) {
|
|
95
110
|
callStatus.value = STATUS.RINGING;
|
|
@@ -101,89 +116,104 @@ const handleMqttMessage = async (message) => {
|
|
|
101
116
|
}
|
|
102
117
|
}
|
|
103
118
|
else if (message?.data?.status == STATUS.CALL_START) {
|
|
104
|
-
|
|
119
|
+
try {
|
|
120
|
+
await startIncomingCall();
|
|
121
|
+
startTimer();
|
|
122
|
+
callStatus.value = STATUS.CALL_START;
|
|
123
|
+
}
|
|
124
|
+
catch (e) {
|
|
125
|
+
console.log(e);
|
|
126
|
+
endCall();
|
|
127
|
+
}
|
|
105
128
|
}
|
|
106
129
|
else if (message?.data?.status == STATUS.CALL_END) {
|
|
107
130
|
endCall();
|
|
108
131
|
}
|
|
132
|
+
else {
|
|
133
|
+
da = false;
|
|
134
|
+
handleMedia(message);
|
|
135
|
+
}
|
|
136
|
+
if (da)
|
|
137
|
+
console.log(message);
|
|
109
138
|
};
|
|
110
|
-
// const handleMqttMessage = async (topic: string, message: any) => {
|
|
111
|
-
// if (topic == TOPIC_DETAIL_CALL + dataProfile.value?.id) {
|
|
112
|
-
// console.log(message)
|
|
113
|
-
// if (message?.type === 'offer') {
|
|
114
|
-
// const status = await handleOffer(message)
|
|
115
|
-
// if (status) {
|
|
116
|
-
// callStatus.value = STATUS.CALLING
|
|
117
|
-
// open()
|
|
118
|
-
// }
|
|
119
|
-
// } else if (message?.type === 'offer-response') {
|
|
120
|
-
// await handleOfferResponse(message)
|
|
121
|
-
// callStatus.value = STATUS.CALL_START
|
|
122
|
-
// } else if (message?.type === 'candidate') {
|
|
123
|
-
// addIceCandidate(message)
|
|
124
|
-
// } else if (message?.type === 'end-call') {
|
|
125
|
-
// endPc(message?.link)
|
|
126
|
-
// callStatus.value = STATUS.CALL_END
|
|
127
|
-
// }
|
|
128
|
-
// }
|
|
129
|
-
// }
|
|
130
139
|
const __VLS_exposed = { startCall, endCall };
|
|
131
140
|
defineExpose(__VLS_exposed);
|
|
132
141
|
watch(dataProfile, async (newValue, oldValue) => {
|
|
133
142
|
if (oldValue?.id && oldValue?.id != newValue?.id) {
|
|
134
|
-
unsubscribeFromTopic(TOPIC_DETAIL_CALL + oldValue?.id);
|
|
135
|
-
removeHandleMqttMessage('call-message');
|
|
136
143
|
removeHandleWebSK('call-message');
|
|
137
144
|
}
|
|
138
145
|
if (newValue?.id && oldValue?.id != newValue?.id) {
|
|
139
|
-
|
|
140
|
-
subscribeToTopic(TOPIC_DETAIL_CALL + newValue?.id);
|
|
141
|
-
addHandleMqttMessage('call-message', TOPIC_DETAIL_CALL + newValue?.id, handleMqttMessage);
|
|
146
|
+
addHandleWebSK('call-message', handleMqttMessage);
|
|
142
147
|
addHandleWebSK('call-message', handleMqttMessage);
|
|
143
148
|
}
|
|
144
149
|
}, { immediate: true });
|
|
145
150
|
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
151
|
+
const __VLS_defaults = {};
|
|
146
152
|
const __VLS_ctx = {
|
|
147
153
|
...{},
|
|
148
154
|
...{},
|
|
155
|
+
...{},
|
|
156
|
+
...{},
|
|
149
157
|
};
|
|
150
158
|
let __VLS_elements;
|
|
151
159
|
let __VLS_components;
|
|
152
160
|
let __VLS_directives;
|
|
153
|
-
/** @type {[typeof
|
|
161
|
+
/** @type {[typeof DrawerBaseCustom, typeof DrawerBaseCustom, ]} */ ;
|
|
154
162
|
// @ts-ignore
|
|
155
|
-
const __VLS_0 = __VLS_asFunctionalComponent(
|
|
156
|
-
|
|
163
|
+
const __VLS_0 = __VLS_asFunctionalComponent(DrawerBaseCustom, new DrawerBaseCustom({
|
|
164
|
+
ref: "drawerVisibleRef",
|
|
157
165
|
width: (500),
|
|
158
|
-
|
|
166
|
+
disabledClose: (__VLS_ctx.disable),
|
|
167
|
+
responsive: (__VLS_ctx.responsive),
|
|
159
168
|
}));
|
|
160
169
|
const __VLS_1 = __VLS_0({
|
|
161
|
-
|
|
170
|
+
ref: "drawerVisibleRef",
|
|
162
171
|
width: (500),
|
|
163
|
-
|
|
172
|
+
disabledClose: (__VLS_ctx.disable),
|
|
173
|
+
responsive: (__VLS_ctx.responsive),
|
|
164
174
|
}, ...__VLS_functionalComponentArgsRest(__VLS_0));
|
|
165
|
-
|
|
175
|
+
/** @type {typeof __VLS_ctx.drawerVisibleRef} */ ;
|
|
176
|
+
var __VLS_3 = {};
|
|
177
|
+
const { default: __VLS_5 } = __VLS_2.slots;
|
|
166
178
|
// @ts-ignore
|
|
167
|
-
[
|
|
179
|
+
[disable, responsive, drawerVisibleRef,];
|
|
168
180
|
{
|
|
169
|
-
const { content:
|
|
181
|
+
const { content: __VLS_6 } = __VLS_2.slots;
|
|
170
182
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
171
|
-
...{ class: "flex flex-col items-center justify-center h-
|
|
183
|
+
...{ class: "flex flex-col items-center justify-center h-full bg-chat-haze-300 text-white relative" },
|
|
172
184
|
});
|
|
173
185
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
174
|
-
...{ class: "
|
|
175
|
-
});
|
|
176
|
-
__VLS_asFunctionalElement(__VLS_elements.img)({
|
|
177
|
-
src: "https://i.pravatar.cc/300",
|
|
178
|
-
alt: "avatar",
|
|
179
|
-
...{ class: "w-full h-full object-cover" },
|
|
186
|
+
...{ class: "h-40 w-40 rounded-full overflow-hidden mb-4 border-4 border-gray-700 flex-center" },
|
|
180
187
|
});
|
|
188
|
+
/** @type {[typeof Avatar, ]} */ ;
|
|
189
|
+
// @ts-ignore
|
|
190
|
+
const __VLS_7 = __VLS_asFunctionalComponent(Avatar, new Avatar({
|
|
191
|
+
...{ class: "" },
|
|
192
|
+
src: (__VLS_ctx.userRemoter?.avatar ?? ''),
|
|
193
|
+
id: (__VLS_ctx.userRemoter?.id ?? ''),
|
|
194
|
+
color: (__VLS_ctx.userRemoter?.color),
|
|
195
|
+
name: (__VLS_ctx.userRemoter?.username),
|
|
196
|
+
size: "xxl",
|
|
197
|
+
}));
|
|
198
|
+
const __VLS_8 = __VLS_7({
|
|
199
|
+
...{ class: "" },
|
|
200
|
+
src: (__VLS_ctx.userRemoter?.avatar ?? ''),
|
|
201
|
+
id: (__VLS_ctx.userRemoter?.id ?? ''),
|
|
202
|
+
color: (__VLS_ctx.userRemoter?.color),
|
|
203
|
+
name: (__VLS_ctx.userRemoter?.username),
|
|
204
|
+
size: "xxl",
|
|
205
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_7));
|
|
206
|
+
// @ts-ignore
|
|
207
|
+
[userRemoter, userRemoter, userRemoter, userRemoter,];
|
|
181
208
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
182
209
|
...{ class: "text-center" },
|
|
183
210
|
});
|
|
184
211
|
__VLS_asFunctionalElement(__VLS_elements.h2, __VLS_elements.h2)({
|
|
185
212
|
...{ class: "text-2xl font-semibold" },
|
|
186
213
|
});
|
|
214
|
+
(__VLS_ctx.userRemoter?.username);
|
|
215
|
+
// @ts-ignore
|
|
216
|
+
[userRemoter,];
|
|
187
217
|
__VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({
|
|
188
218
|
...{ class: "text-gray-400 mt-1" },
|
|
189
219
|
});
|
|
@@ -204,8 +234,8 @@ const { default: __VLS_3 } = __VLS_2.slots;
|
|
|
204
234
|
[answer,];
|
|
205
235
|
/** @type {[typeof IconPhone, ]} */ ;
|
|
206
236
|
// @ts-ignore
|
|
207
|
-
const
|
|
208
|
-
const
|
|
237
|
+
const __VLS_11 = __VLS_asFunctionalComponent(IconPhone, new IconPhone({}));
|
|
238
|
+
const __VLS_12 = __VLS_11({}, ...__VLS_functionalComponentArgsRest(__VLS_11));
|
|
209
239
|
}
|
|
210
240
|
__VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
|
|
211
241
|
...{ onClick: (__VLS_ctx.endCall) },
|
|
@@ -215,8 +245,8 @@ const { default: __VLS_3 } = __VLS_2.slots;
|
|
|
215
245
|
[endCall,];
|
|
216
246
|
/** @type {[typeof IconPhoneCancel, ]} */ ;
|
|
217
247
|
// @ts-ignore
|
|
218
|
-
const
|
|
219
|
-
const
|
|
248
|
+
const __VLS_15 = __VLS_asFunctionalComponent(IconPhoneCancel, new IconPhoneCancel({}));
|
|
249
|
+
const __VLS_16 = __VLS_15({}, ...__VLS_functionalComponentArgsRest(__VLS_15));
|
|
220
250
|
__VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({
|
|
221
251
|
...{ class: "absolute bottom-6 text-gray-500 text-sm" },
|
|
222
252
|
});
|
|
@@ -228,30 +258,28 @@ var __VLS_2;
|
|
|
228
258
|
__VLS_asFunctionalElement(__VLS_elements.audio, __VLS_elements.audio)({
|
|
229
259
|
id: "go-chat-local-audio",
|
|
230
260
|
autoplay: true,
|
|
231
|
-
muted: true,
|
|
232
261
|
});
|
|
233
262
|
__VLS_asFunctionalElement(__VLS_elements.audio, __VLS_elements.audio)({
|
|
234
263
|
id: "go-chat-remote-audio",
|
|
235
264
|
autoplay: true,
|
|
236
265
|
});
|
|
266
|
+
/** @type {__VLS_StyleScopedClasses['']} */ ;
|
|
237
267
|
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
238
268
|
/** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
|
|
239
269
|
/** @type {__VLS_StyleScopedClasses['items-center']} */ ;
|
|
240
270
|
/** @type {__VLS_StyleScopedClasses['justify-center']} */ ;
|
|
241
|
-
/** @type {__VLS_StyleScopedClasses['h-
|
|
271
|
+
/** @type {__VLS_StyleScopedClasses['h-full']} */ ;
|
|
242
272
|
/** @type {__VLS_StyleScopedClasses['bg-chat-haze-300']} */ ;
|
|
243
273
|
/** @type {__VLS_StyleScopedClasses['text-white']} */ ;
|
|
244
274
|
/** @type {__VLS_StyleScopedClasses['relative']} */ ;
|
|
245
|
-
/** @type {__VLS_StyleScopedClasses['
|
|
246
|
-
/** @type {__VLS_StyleScopedClasses['
|
|
275
|
+
/** @type {__VLS_StyleScopedClasses['h-40']} */ ;
|
|
276
|
+
/** @type {__VLS_StyleScopedClasses['w-40']} */ ;
|
|
247
277
|
/** @type {__VLS_StyleScopedClasses['rounded-full']} */ ;
|
|
248
278
|
/** @type {__VLS_StyleScopedClasses['overflow-hidden']} */ ;
|
|
249
279
|
/** @type {__VLS_StyleScopedClasses['mb-4']} */ ;
|
|
250
280
|
/** @type {__VLS_StyleScopedClasses['border-4']} */ ;
|
|
251
281
|
/** @type {__VLS_StyleScopedClasses['border-gray-700']} */ ;
|
|
252
|
-
/** @type {__VLS_StyleScopedClasses['
|
|
253
|
-
/** @type {__VLS_StyleScopedClasses['h-full']} */ ;
|
|
254
|
-
/** @type {__VLS_StyleScopedClasses['object-cover']} */ ;
|
|
282
|
+
/** @type {__VLS_StyleScopedClasses['flex-center']} */ ;
|
|
255
283
|
/** @type {__VLS_StyleScopedClasses['text-center']} */ ;
|
|
256
284
|
/** @type {__VLS_StyleScopedClasses['text-2xl']} */ ;
|
|
257
285
|
/** @type {__VLS_StyleScopedClasses['font-semibold']} */ ;
|
|
@@ -285,7 +313,11 @@ __VLS_asFunctionalElement(__VLS_elements.audio, __VLS_elements.audio)({
|
|
|
285
313
|
/** @type {__VLS_StyleScopedClasses['bottom-6']} */ ;
|
|
286
314
|
/** @type {__VLS_StyleScopedClasses['text-gray-500']} */ ;
|
|
287
315
|
/** @type {__VLS_StyleScopedClasses['text-sm']} */ ;
|
|
316
|
+
// @ts-ignore
|
|
317
|
+
var __VLS_4 = __VLS_3;
|
|
288
318
|
const __VLS_export = (await import('vue')).defineComponent({
|
|
289
319
|
setup: () => (__VLS_exposed),
|
|
320
|
+
__typeProps: {},
|
|
321
|
+
props: {},
|
|
290
322
|
});
|
|
291
323
|
export default {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
2
|
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
3
3
|
const __VLS_ctx = {};
|
|
4
4
|
let __VLS_elements;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
2
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '../../../../components/ui/collapsible';
|
|
3
3
|
const isOpen = defineModel('open');
|
|
4
4
|
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
2
|
import { computed } from 'vue';
|
|
3
3
|
import IconSearch from '../../../../assets/icons/IconSearch.vue';
|
|
4
4
|
import { useDebounce } from '../../../../utils/debounce';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
2
|
import { Popover, PopoverContent, PopoverTrigger, } from '../../../../components/ui/popover';
|
|
3
3
|
const props = withDefaults(defineProps(), {
|
|
4
4
|
align: "center",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
2
|
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
3
3
|
const __VLS_ctx = {};
|
|
4
4
|
let __VLS_elements;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
2
|
import { computed } from 'vue';
|
|
3
3
|
import { digibotId } from '../../../composable/useDigibot';
|
|
4
4
|
const props = withDefaults(defineProps(), {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
2
|
import ICon1 from '../../../../assets/images/layout/mobile/chat.png';
|
|
3
3
|
import ICon1Active from '../../../../assets/images/layout/mobile/chat-active.png';
|
|
4
4
|
import ICon2 from '../../../../assets/images/layout/mobile/review.png';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
2
|
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
3
3
|
const __VLS_ctx = {};
|
|
4
4
|
let __VLS_elements;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
2
|
const __VLS_props = defineProps();
|
|
3
3
|
const { description, type, tag } = __VLS_props;
|
|
4
4
|
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
2
|
import CButton from '../../../components/ui/button/CButton.vue';
|
|
3
3
|
import { computed } from 'vue';
|
|
4
4
|
import CSpin from '../../../components/common/spin/CSpin.vue';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
2
|
import { computed } from 'vue';
|
|
3
3
|
import { CSwitch } from '../../../components/ui/switch';
|
|
4
4
|
const props = withDefaults(defineProps(), {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
2
|
import { computed } from 'vue';
|
|
3
3
|
import { Checkbox } from "../../../components/ui/checkbox";
|
|
4
4
|
const props = defineProps();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
2
|
import { computed } from 'vue';
|
|
3
3
|
const props = withDefaults(defineProps(), {
|
|
4
4
|
ghost: false,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
2
|
// COMPONENT
|
|
3
3
|
import { Drawer, DrawerContent, DrawerHeader } from '../../../components/ui/drawer';
|
|
4
4
|
const props = withDefaults(defineProps(), {
|