@phonghq/go-chat 1.0.26 → 1.0.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/README.md +2 -1
- package/dist/chat/page/home/Home.vue.d.ts +2 -0
- package/dist/chat/page/home/InputChat.vue.d.ts +2 -0
- package/dist/components/chat/common/modal/Modal.vue.d.ts +94 -0
- package/dist/components/chat/common/spin/BaseSpin.vue.d.ts +8 -1
- package/dist/components/chat/common/switch/SwitchBase.vue.d.ts +3 -0
- package/dist/components/common/drawer/DrawerBase.vue.d.ts +1 -1
- package/dist/constant/mqtt.d.ts +1 -0
- package/dist/go-chat.es.js +7538 -7477
- package/dist/go-chat.umd.js +13 -13
- package/dist/style.css +1 -1
- package/dist/test/chat/App.vue.js +77 -66
- package/dist/test/chat/page/customer-appointment/CustomerAppointment.vue.js +3 -3
- package/dist/test/chat/page/home/ChatList.vue.js +14 -115
- package/dist/test/chat/page/home/ChatMessage.vue.js +1 -3
- package/dist/test/chat/page/home/ChatMessageItem.vue.js +3 -3
- package/dist/test/chat/page/home/Home.vue.js +30 -15
- package/dist/test/chat/page/home/InputChat.vue.js +78 -28
- package/dist/test/components/chat/call/Calling.vue.js +4 -3
- package/dist/test/components/chat/common/modal/Modal.vue.js +260 -0
- package/dist/test/components/chat/common/spin/BaseSpin.vue.js +29 -2
- package/dist/test/components/chat/common/switch/SwitchBase.vue.js +8 -2
- package/dist/test/components/common/modal/ModalBase.vue.js +49 -26
- package/dist/test/components/ui/button/c-button.js +7 -7
- package/dist/test/composable/useInitData.js +2 -1
- package/dist/test/composable/useListConversations.js +1 -1
- package/dist/test/composable/usePlivo.js +11 -7
- package/dist/test/constant/mqtt.js +1 -0
- package/dist/test/utils/chat/call.js +4 -3
- package/dist/test/utils/chat/conversation.js +1 -1
- package/dist/test/utils/chat/message.js +4 -0
- package/dist/utils/chat/message.d.ts +4 -0
- package/package.json +2 -2
- package/dist/assets/icons/IconSetting.vue.d.ts +0 -2
- package/dist/test/assets/icons/IconSetting.vue.js +0 -33
|
@@ -2,7 +2,7 @@ import { computed, onMounted, onUnmounted, ref } from 'vue';
|
|
|
2
2
|
import IconPhone from '../../../assets/icons/call/IconPhone.vue';
|
|
3
3
|
import { dataProfile } from '../../../utils/chat/auth.js';
|
|
4
4
|
import IconPhoneCancel from '../../../assets/icons/call/IconPhoneCancel.vue';
|
|
5
|
-
import { downloadRecord } from '../../../utils/chat/call';
|
|
5
|
+
import { downloadRecord, getPlivoAccessToken } from '../../../utils/chat/call';
|
|
6
6
|
import DrawerBaseCustom from '../../../components/common/drawer/DrawerBaseCustom.vue';
|
|
7
7
|
import Avatar from '../../../components/chat/customer/Avatar.vue';
|
|
8
8
|
import { getUserDetailChat } from '../../../utils/chat/user';
|
|
@@ -75,9 +75,10 @@ let timeOut = null;
|
|
|
75
75
|
let callType = 'call';
|
|
76
76
|
let uuidEnd = '';
|
|
77
77
|
onMounted(async () => {
|
|
78
|
-
console.log(dataProfile.value);
|
|
79
78
|
if (dataProfile.value?.tenant_phone) {
|
|
80
|
-
await
|
|
79
|
+
const token = await getPlivoAccessToken();
|
|
80
|
+
// const token = ''
|
|
81
|
+
await plivoLogin(token);
|
|
81
82
|
}
|
|
82
83
|
});
|
|
83
84
|
onUnmounted(() => {
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
|
+
import { ref, onMounted, onUnmounted } from 'vue';
|
|
3
|
+
import IconCloseCircle from '../../../../assets/icons/IconCloseCircle.vue';
|
|
4
|
+
onMounted(() => {
|
|
5
|
+
addEvent();
|
|
6
|
+
});
|
|
7
|
+
onUnmounted(() => {
|
|
8
|
+
removeEvent();
|
|
9
|
+
});
|
|
10
|
+
// CREATE DATA
|
|
11
|
+
const visible = ref(false);
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
title: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: 'TITLE'
|
|
16
|
+
},
|
|
17
|
+
showFooter: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: true
|
|
20
|
+
},
|
|
21
|
+
showCloseButton: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: true
|
|
24
|
+
},
|
|
25
|
+
clickOutSide: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: true
|
|
28
|
+
},
|
|
29
|
+
disabledClose: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false
|
|
32
|
+
},
|
|
33
|
+
phone: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false
|
|
36
|
+
},
|
|
37
|
+
maxValue: {
|
|
38
|
+
type: Number,
|
|
39
|
+
default: 0
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
const emit = defineEmits(['changeValue', 'afterClose', 'afterCloseNumPad']);
|
|
43
|
+
// CREATE FUNCTION
|
|
44
|
+
const close = () => {
|
|
45
|
+
visible.value = false;
|
|
46
|
+
document.getElementsByTagName('body')[0].classList.remove('overflow-hidden');
|
|
47
|
+
emit('afterClose');
|
|
48
|
+
};
|
|
49
|
+
const closeOnly = () => {
|
|
50
|
+
visible.value = false;
|
|
51
|
+
document.getElementsByTagName('body')[0].classList.remove('overflow-hidden');
|
|
52
|
+
};
|
|
53
|
+
const open = () => {
|
|
54
|
+
document.getElementsByTagName('body')[0].className = 'overflow-hidden';
|
|
55
|
+
visible.value = true;
|
|
56
|
+
};
|
|
57
|
+
const __VLS_exposed = {
|
|
58
|
+
open,
|
|
59
|
+
close,
|
|
60
|
+
visible,
|
|
61
|
+
closeOnly
|
|
62
|
+
};
|
|
63
|
+
defineExpose(__VLS_exposed);
|
|
64
|
+
const clickOutSideClose = () => {
|
|
65
|
+
close();
|
|
66
|
+
};
|
|
67
|
+
const addEvent = () => { };
|
|
68
|
+
const removeEvent = () => { };
|
|
69
|
+
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
70
|
+
const __VLS_ctx = {
|
|
71
|
+
...{},
|
|
72
|
+
...{},
|
|
73
|
+
...{},
|
|
74
|
+
...{},
|
|
75
|
+
...{},
|
|
76
|
+
};
|
|
77
|
+
let __VLS_elements;
|
|
78
|
+
let __VLS_components;
|
|
79
|
+
let __VLS_directives;
|
|
80
|
+
/** @type {__VLS_StyleScopedClasses['modal-title']} */ ;
|
|
81
|
+
/** @type {__VLS_StyleScopedClasses['modal']} */ ;
|
|
82
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
83
|
+
...{ class: "fixed top-0 bottom-0 right-0 left-0 over z-[1000] bg-[#00000066] custom-modal default-modal" },
|
|
84
|
+
...{ class: (__VLS_ctx.visible ? 'show' : 'pointer-events-none opacity-0 delay-[0.15s]') },
|
|
85
|
+
id: "modal",
|
|
86
|
+
});
|
|
87
|
+
// @ts-ignore
|
|
88
|
+
[visible,];
|
|
89
|
+
if (__VLS_ctx.clickOutSide && !__VLS_ctx.disabledClose) {
|
|
90
|
+
// @ts-ignore
|
|
91
|
+
[clickOutSide, disabledClose,];
|
|
92
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
93
|
+
...{ onClick: (__VLS_ctx.clickOutSideClose) },
|
|
94
|
+
...{ class: "absolute w-full h-full" },
|
|
95
|
+
});
|
|
96
|
+
// @ts-ignore
|
|
97
|
+
[clickOutSideClose,];
|
|
98
|
+
}
|
|
99
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
100
|
+
...{ class: "delay-100 duration-[0.15s] ease-out flex flex-col modal" },
|
|
101
|
+
...{ class: ({ visible: __VLS_ctx.visible }) },
|
|
102
|
+
});
|
|
103
|
+
// @ts-ignore
|
|
104
|
+
[visible,];
|
|
105
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
106
|
+
...{ class: "w-full modal-title bg-chat-haze-100" },
|
|
107
|
+
});
|
|
108
|
+
var __VLS_0 = {};
|
|
109
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
110
|
+
...{ class: "h-full min-h-[46px] lg:min-h-[52px] flex items-center relative px-6 py-1" },
|
|
111
|
+
});
|
|
112
|
+
__VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({
|
|
113
|
+
...{ class: "text-base lg:text-xl text-white font-medium mr-[50px] custom_title_modal" },
|
|
114
|
+
});
|
|
115
|
+
(__VLS_ctx.title);
|
|
116
|
+
// @ts-ignore
|
|
117
|
+
[title,];
|
|
118
|
+
if (__VLS_ctx.showCloseButton) {
|
|
119
|
+
// @ts-ignore
|
|
120
|
+
[showCloseButton,];
|
|
121
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
122
|
+
...{ class: "h-full w-[50px] flex-center absolute right-0 cursor-pointer mr-1" },
|
|
123
|
+
});
|
|
124
|
+
if (!__VLS_ctx.disabledClose) {
|
|
125
|
+
// @ts-ignore
|
|
126
|
+
[disabledClose,];
|
|
127
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
128
|
+
...{ onClick: (__VLS_ctx.close) },
|
|
129
|
+
...{ class: "h-full w-full flex-center" },
|
|
130
|
+
});
|
|
131
|
+
// @ts-ignore
|
|
132
|
+
[close,];
|
|
133
|
+
/** @type {[typeof IconCloseCircle, ]} */ ;
|
|
134
|
+
// @ts-ignore
|
|
135
|
+
const __VLS_2 = __VLS_asFunctionalComponent(IconCloseCircle, new IconCloseCircle({}));
|
|
136
|
+
const __VLS_3 = __VLS_2({}, ...__VLS_functionalComponentArgsRest(__VLS_2));
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
140
|
+
...{ class: "edit-scrollbar grow w-full min-w-full modal-content" },
|
|
141
|
+
...{ class: (__VLS_ctx.showFooter ? '' : 'rounded-bottom') },
|
|
142
|
+
});
|
|
143
|
+
// @ts-ignore
|
|
144
|
+
[showFooter,];
|
|
145
|
+
var __VLS_6 = {};
|
|
146
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
147
|
+
...{ class: "flex p-4 content" },
|
|
148
|
+
});
|
|
149
|
+
__VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({});
|
|
150
|
+
if (__VLS_ctx.showFooter) {
|
|
151
|
+
// @ts-ignore
|
|
152
|
+
[showFooter,];
|
|
153
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
154
|
+
...{ class: "modal-footer" },
|
|
155
|
+
});
|
|
156
|
+
var __VLS_8 = {};
|
|
157
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
158
|
+
...{ class: "h-full flex items-center p-4 footer" },
|
|
159
|
+
});
|
|
160
|
+
__VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({});
|
|
161
|
+
}
|
|
162
|
+
/** @type {__VLS_StyleScopedClasses['fixed']} */ ;
|
|
163
|
+
/** @type {__VLS_StyleScopedClasses['top-0']} */ ;
|
|
164
|
+
/** @type {__VLS_StyleScopedClasses['bottom-0']} */ ;
|
|
165
|
+
/** @type {__VLS_StyleScopedClasses['right-0']} */ ;
|
|
166
|
+
/** @type {__VLS_StyleScopedClasses['left-0']} */ ;
|
|
167
|
+
/** @type {__VLS_StyleScopedClasses['over']} */ ;
|
|
168
|
+
/** @type {__VLS_StyleScopedClasses['z-[1000]']} */ ;
|
|
169
|
+
/** @type {__VLS_StyleScopedClasses['bg-[#00000066]']} */ ;
|
|
170
|
+
/** @type {__VLS_StyleScopedClasses['custom-modal']} */ ;
|
|
171
|
+
/** @type {__VLS_StyleScopedClasses['default-modal']} */ ;
|
|
172
|
+
/** @type {__VLS_StyleScopedClasses['absolute']} */ ;
|
|
173
|
+
/** @type {__VLS_StyleScopedClasses['w-full']} */ ;
|
|
174
|
+
/** @type {__VLS_StyleScopedClasses['h-full']} */ ;
|
|
175
|
+
/** @type {__VLS_StyleScopedClasses['delay-100']} */ ;
|
|
176
|
+
/** @type {__VLS_StyleScopedClasses['duration-[0.15s]']} */ ;
|
|
177
|
+
/** @type {__VLS_StyleScopedClasses['ease-out']} */ ;
|
|
178
|
+
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
179
|
+
/** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
|
|
180
|
+
/** @type {__VLS_StyleScopedClasses['modal']} */ ;
|
|
181
|
+
/** @type {__VLS_StyleScopedClasses['visible']} */ ;
|
|
182
|
+
/** @type {__VLS_StyleScopedClasses['w-full']} */ ;
|
|
183
|
+
/** @type {__VLS_StyleScopedClasses['modal-title']} */ ;
|
|
184
|
+
/** @type {__VLS_StyleScopedClasses['bg-chat-haze-100']} */ ;
|
|
185
|
+
/** @type {__VLS_StyleScopedClasses['h-full']} */ ;
|
|
186
|
+
/** @type {__VLS_StyleScopedClasses['min-h-[46px]']} */ ;
|
|
187
|
+
/** @type {__VLS_StyleScopedClasses['lg:min-h-[52px]']} */ ;
|
|
188
|
+
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
189
|
+
/** @type {__VLS_StyleScopedClasses['items-center']} */ ;
|
|
190
|
+
/** @type {__VLS_StyleScopedClasses['relative']} */ ;
|
|
191
|
+
/** @type {__VLS_StyleScopedClasses['px-6']} */ ;
|
|
192
|
+
/** @type {__VLS_StyleScopedClasses['py-1']} */ ;
|
|
193
|
+
/** @type {__VLS_StyleScopedClasses['text-base']} */ ;
|
|
194
|
+
/** @type {__VLS_StyleScopedClasses['lg:text-xl']} */ ;
|
|
195
|
+
/** @type {__VLS_StyleScopedClasses['text-white']} */ ;
|
|
196
|
+
/** @type {__VLS_StyleScopedClasses['font-medium']} */ ;
|
|
197
|
+
/** @type {__VLS_StyleScopedClasses['mr-[50px]']} */ ;
|
|
198
|
+
/** @type {__VLS_StyleScopedClasses['custom_title_modal']} */ ;
|
|
199
|
+
/** @type {__VLS_StyleScopedClasses['h-full']} */ ;
|
|
200
|
+
/** @type {__VLS_StyleScopedClasses['w-[50px]']} */ ;
|
|
201
|
+
/** @type {__VLS_StyleScopedClasses['flex-center']} */ ;
|
|
202
|
+
/** @type {__VLS_StyleScopedClasses['absolute']} */ ;
|
|
203
|
+
/** @type {__VLS_StyleScopedClasses['right-0']} */ ;
|
|
204
|
+
/** @type {__VLS_StyleScopedClasses['cursor-pointer']} */ ;
|
|
205
|
+
/** @type {__VLS_StyleScopedClasses['mr-1']} */ ;
|
|
206
|
+
/** @type {__VLS_StyleScopedClasses['h-full']} */ ;
|
|
207
|
+
/** @type {__VLS_StyleScopedClasses['w-full']} */ ;
|
|
208
|
+
/** @type {__VLS_StyleScopedClasses['flex-center']} */ ;
|
|
209
|
+
/** @type {__VLS_StyleScopedClasses['edit-scrollbar']} */ ;
|
|
210
|
+
/** @type {__VLS_StyleScopedClasses['grow']} */ ;
|
|
211
|
+
/** @type {__VLS_StyleScopedClasses['w-full']} */ ;
|
|
212
|
+
/** @type {__VLS_StyleScopedClasses['min-w-full']} */ ;
|
|
213
|
+
/** @type {__VLS_StyleScopedClasses['modal-content']} */ ;
|
|
214
|
+
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
215
|
+
/** @type {__VLS_StyleScopedClasses['p-4']} */ ;
|
|
216
|
+
/** @type {__VLS_StyleScopedClasses['content']} */ ;
|
|
217
|
+
/** @type {__VLS_StyleScopedClasses['modal-footer']} */ ;
|
|
218
|
+
/** @type {__VLS_StyleScopedClasses['h-full']} */ ;
|
|
219
|
+
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
220
|
+
/** @type {__VLS_StyleScopedClasses['items-center']} */ ;
|
|
221
|
+
/** @type {__VLS_StyleScopedClasses['p-4']} */ ;
|
|
222
|
+
/** @type {__VLS_StyleScopedClasses['footer']} */ ;
|
|
223
|
+
// @ts-ignore
|
|
224
|
+
var __VLS_1 = __VLS_0, __VLS_7 = __VLS_6, __VLS_9 = __VLS_8;
|
|
225
|
+
const __VLS_base = (await import('vue')).defineComponent({
|
|
226
|
+
setup: () => (__VLS_exposed),
|
|
227
|
+
emits: {},
|
|
228
|
+
props: {
|
|
229
|
+
title: {
|
|
230
|
+
type: String,
|
|
231
|
+
default: 'TITLE'
|
|
232
|
+
},
|
|
233
|
+
showFooter: {
|
|
234
|
+
type: Boolean,
|
|
235
|
+
default: true
|
|
236
|
+
},
|
|
237
|
+
showCloseButton: {
|
|
238
|
+
type: Boolean,
|
|
239
|
+
default: true
|
|
240
|
+
},
|
|
241
|
+
clickOutSide: {
|
|
242
|
+
type: Boolean,
|
|
243
|
+
default: true
|
|
244
|
+
},
|
|
245
|
+
disabledClose: {
|
|
246
|
+
type: Boolean,
|
|
247
|
+
default: false
|
|
248
|
+
},
|
|
249
|
+
phone: {
|
|
250
|
+
type: Boolean,
|
|
251
|
+
default: false
|
|
252
|
+
},
|
|
253
|
+
maxValue: {
|
|
254
|
+
type: Number,
|
|
255
|
+
default: 0
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
});
|
|
259
|
+
const __VLS_export = {};
|
|
260
|
+
export default {};
|
|
@@ -1,12 +1,39 @@
|
|
|
1
1
|
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
const props = withDefaults(defineProps(), {
|
|
4
|
+
size: 48,
|
|
5
|
+
border: 5,
|
|
6
|
+
});
|
|
7
|
+
const style = computed(() => {
|
|
8
|
+
let result = {};
|
|
9
|
+
result.width = props.size + 'px';
|
|
10
|
+
result.height = props.size + 'px';
|
|
11
|
+
result.borderWidth = props.border + 'px';
|
|
12
|
+
return result;
|
|
13
|
+
});
|
|
2
14
|
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
3
|
-
const
|
|
15
|
+
const __VLS_defaults = {
|
|
16
|
+
size: 48,
|
|
17
|
+
border: 5,
|
|
18
|
+
};
|
|
19
|
+
const __VLS_ctx = {
|
|
20
|
+
...{},
|
|
21
|
+
...{},
|
|
22
|
+
...{},
|
|
23
|
+
...{},
|
|
24
|
+
};
|
|
4
25
|
let __VLS_elements;
|
|
5
26
|
let __VLS_components;
|
|
6
27
|
let __VLS_directives;
|
|
7
28
|
__VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({
|
|
8
29
|
...{ class: "loader" },
|
|
30
|
+
...{ style: (__VLS_ctx.style) },
|
|
9
31
|
});
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
[style,];
|
|
10
34
|
/** @type {__VLS_StyleScopedClasses['loader']} */ ;
|
|
11
|
-
const __VLS_export = (await import('vue')).defineComponent({
|
|
35
|
+
const __VLS_export = (await import('vue')).defineComponent({
|
|
36
|
+
__typeProps: {},
|
|
37
|
+
props: {},
|
|
38
|
+
});
|
|
12
39
|
export default {};
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
2
|
const props = withDefaults(defineProps(), {});
|
|
3
|
+
const emit = defineEmits();
|
|
3
4
|
const result = defineModel();
|
|
5
|
+
const handleClick = () => {
|
|
6
|
+
const value = !result.value;
|
|
7
|
+
result.value = value;
|
|
8
|
+
emit('change', value);
|
|
9
|
+
};
|
|
4
10
|
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
5
11
|
const __VLS_modelEmit = defineEmits();
|
|
6
12
|
const __VLS_defaults = {};
|
|
@@ -16,9 +22,9 @@ let __VLS_components;
|
|
|
16
22
|
let __VLS_directives;
|
|
17
23
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
18
24
|
...{ onClick: (...[$event]) => {
|
|
19
|
-
__VLS_ctx.
|
|
25
|
+
__VLS_ctx.handleClick();
|
|
20
26
|
// @ts-ignore
|
|
21
|
-
[
|
|
27
|
+
[handleClick,];
|
|
22
28
|
} },
|
|
23
29
|
...{ class: "flex items-center gap-2 cursor-pointer w-max" },
|
|
24
30
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
|
+
import IconCloseCircle from '@/assets/icons/IconCloseCircle.vue';
|
|
2
3
|
defineOptions({
|
|
3
4
|
inheritAttrs: false
|
|
4
5
|
});
|
|
@@ -123,37 +124,59 @@ DialogTitle;
|
|
|
123
124
|
const __VLS_22 = __VLS_asFunctionalComponent(__VLS_21, new __VLS_21({}));
|
|
124
125
|
const __VLS_23 = __VLS_22({}, ...__VLS_functionalComponentArgsRest(__VLS_22));
|
|
125
126
|
const { default: __VLS_25 } = __VLS_24.slots;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
var __VLS_29;
|
|
149
|
-
}
|
|
127
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
128
|
+
...{ class: "h-full min-h-[46px] lg:min-h-[52px] flex items-center relative bg-chat-haze-100 sm:rounded-t-lg px-6 py-1" },
|
|
129
|
+
});
|
|
130
|
+
__VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({
|
|
131
|
+
...{ class: "text-base lg:text-xl font-medium mr-[50px] " },
|
|
132
|
+
});
|
|
133
|
+
(__VLS_ctx.title);
|
|
134
|
+
// @ts-ignore
|
|
135
|
+
[title,];
|
|
136
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
137
|
+
...{ class: "h-full w-[50px] flex-center absolute right-0 cursor-pointer mr-1" },
|
|
138
|
+
});
|
|
139
|
+
__VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
|
|
140
|
+
...{ onClick: (__VLS_ctx.hide) },
|
|
141
|
+
...{ class: "h-full w-full flex-center" },
|
|
142
|
+
});
|
|
143
|
+
// @ts-ignore
|
|
144
|
+
[hide,];
|
|
145
|
+
/** @type {[typeof IconCloseCircle, ]} */ ;
|
|
146
|
+
// @ts-ignore
|
|
147
|
+
const __VLS_26 = __VLS_asFunctionalComponent(IconCloseCircle, new IconCloseCircle({}));
|
|
148
|
+
const __VLS_27 = __VLS_26({}, ...__VLS_functionalComponentArgsRest(__VLS_26));
|
|
150
149
|
var __VLS_24;
|
|
151
|
-
var
|
|
150
|
+
var __VLS_30 = {};
|
|
152
151
|
var __VLS_19;
|
|
153
152
|
var __VLS_11;
|
|
154
153
|
var __VLS_3;
|
|
154
|
+
/** @type {__VLS_StyleScopedClasses['h-full']} */ ;
|
|
155
|
+
/** @type {__VLS_StyleScopedClasses['min-h-[46px]']} */ ;
|
|
156
|
+
/** @type {__VLS_StyleScopedClasses['lg:min-h-[52px]']} */ ;
|
|
157
|
+
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
158
|
+
/** @type {__VLS_StyleScopedClasses['items-center']} */ ;
|
|
159
|
+
/** @type {__VLS_StyleScopedClasses['relative']} */ ;
|
|
160
|
+
/** @type {__VLS_StyleScopedClasses['bg-chat-haze-100']} */ ;
|
|
161
|
+
/** @type {__VLS_StyleScopedClasses['sm:rounded-t-lg']} */ ;
|
|
162
|
+
/** @type {__VLS_StyleScopedClasses['px-6']} */ ;
|
|
163
|
+
/** @type {__VLS_StyleScopedClasses['py-1']} */ ;
|
|
164
|
+
/** @type {__VLS_StyleScopedClasses['text-base']} */ ;
|
|
165
|
+
/** @type {__VLS_StyleScopedClasses['lg:text-xl']} */ ;
|
|
166
|
+
/** @type {__VLS_StyleScopedClasses['font-medium']} */ ;
|
|
167
|
+
/** @type {__VLS_StyleScopedClasses['mr-[50px]']} */ ;
|
|
168
|
+
/** @type {__VLS_StyleScopedClasses['h-full']} */ ;
|
|
169
|
+
/** @type {__VLS_StyleScopedClasses['w-[50px]']} */ ;
|
|
170
|
+
/** @type {__VLS_StyleScopedClasses['flex-center']} */ ;
|
|
171
|
+
/** @type {__VLS_StyleScopedClasses['absolute']} */ ;
|
|
172
|
+
/** @type {__VLS_StyleScopedClasses['right-0']} */ ;
|
|
173
|
+
/** @type {__VLS_StyleScopedClasses['cursor-pointer']} */ ;
|
|
174
|
+
/** @type {__VLS_StyleScopedClasses['mr-1']} */ ;
|
|
175
|
+
/** @type {__VLS_StyleScopedClasses['h-full']} */ ;
|
|
176
|
+
/** @type {__VLS_StyleScopedClasses['w-full']} */ ;
|
|
177
|
+
/** @type {__VLS_StyleScopedClasses['flex-center']} */ ;
|
|
155
178
|
// @ts-ignore
|
|
156
|
-
var
|
|
179
|
+
var __VLS_31 = __VLS_30;
|
|
157
180
|
const __VLS_base = (await import('vue')).defineComponent({
|
|
158
181
|
setup: () => (__VLS_exposed),
|
|
159
182
|
__typeEmits: {},
|
|
@@ -3,14 +3,14 @@ export { default as CButton } from './CButton.vue';
|
|
|
3
3
|
export const buttonVariants = cva('inline-flex flex-center gap-2 whitespace-nowrap rounded-[8px] text-base font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 hover:duration-100', {
|
|
4
4
|
variants: {
|
|
5
5
|
variant: {
|
|
6
|
-
default: 'bg-primary text-white hover:bg-primary-hover [&_.loader::before]:border-white',
|
|
7
|
-
primary: 'bg-primary text-white hover:bg-primary-hover [&_.loader::before]:border-white',
|
|
8
|
-
['danger-outline']: 'bg-white border border-
|
|
9
|
-
success: 'bg-success text-white hover:bg-success-hover [&_.loader::before]:border-white',
|
|
10
|
-
danger: 'bg-
|
|
11
|
-
['primary-outline']: 'bg-white text-primary hover:bg-primary border hover:text-white border-primary border-[1.5px] [&_.loader::before]:border-primary',
|
|
6
|
+
default: 'bg-chat-primary text-white hover:bg-chat-primary-hover [&_.loader::before]:border-white',
|
|
7
|
+
primary: 'bg-chat-primary text-white hover:bg-chat-primary-hover [&_.loader::before]:border-white',
|
|
8
|
+
['danger-outline']: 'bg-white border border-chat-error border-[1.5px] text-chat-error hover:bg-chat-error hover:text-white [&_.loader::before]:border-chat-error',
|
|
9
|
+
success: 'bg-chat-success text-white hover:bg-chat-success-hover [&_.loader::before]:border-white',
|
|
10
|
+
danger: 'bg-chat-error text-white hover:bg-chat-error-hover [&_.loader::before]:border-white',
|
|
11
|
+
['primary-outline']: 'bg-white text-chat-primary hover:bg-chat-primary border hover:text-white border-primary border-[1.5px] [&_.loader::before]:border-primary',
|
|
12
12
|
ghost: 'hover:bg-accent hover:text-accent-foreground',
|
|
13
|
-
link: 'text-primary underline-offset-4 hover:underline'
|
|
13
|
+
link: 'text-chat-primary underline-offset-4 hover:underline'
|
|
14
14
|
},
|
|
15
15
|
size: {
|
|
16
16
|
default: 'h-10 px-4 py-2',
|
|
@@ -3,7 +3,7 @@ import { sdkInit } from '../plugins/sdk';
|
|
|
3
3
|
import { checkTenantPhone, dataProfile, getProfile, loginLink } from '../utils/chat/auth';
|
|
4
4
|
import { routerPush } from '../utils/chat/chat-router';
|
|
5
5
|
import { PAGE } from '../constant/general';
|
|
6
|
-
import { subscribeToTopic, unsubscribeFromTopic } from '../plugins/mqtt';
|
|
6
|
+
import { connectMqtt, subscribeToTopic, unsubscribeFromTopic } from '../plugins/mqtt';
|
|
7
7
|
import { TOPIC_DETAIL_CALL } from '../constant/mqtt';
|
|
8
8
|
// import router from '../router'
|
|
9
9
|
//PINIA
|
|
@@ -22,6 +22,7 @@ export function useInitData() {
|
|
|
22
22
|
// }
|
|
23
23
|
}
|
|
24
24
|
// connectMqtt()
|
|
25
|
+
await connectMqtt();
|
|
25
26
|
await initData(data.props, data.response);
|
|
26
27
|
}
|
|
27
28
|
catch (error) {
|
|
@@ -90,7 +90,7 @@ export const useListConversations = (is_unknown) => {
|
|
|
90
90
|
const res = await getConversation({ ...params.value, is_unknown });
|
|
91
91
|
if (option?.reset) {
|
|
92
92
|
listConversations.value = [];
|
|
93
|
-
if (is_unknown == 0)
|
|
93
|
+
if (is_unknown == 0 && dataProfile.value?.user_type == 'tenant')
|
|
94
94
|
listConversations.value.push(digibotData);
|
|
95
95
|
await nextTick();
|
|
96
96
|
}
|
|
@@ -12,8 +12,8 @@ export function usePlivo(callback) {
|
|
|
12
12
|
let custom_resolve = null;
|
|
13
13
|
let custom_reject = null;
|
|
14
14
|
const plivoLogin = async (token) => {
|
|
15
|
-
token =
|
|
16
|
-
|
|
15
|
+
// token =
|
|
16
|
+
// 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6InBsaXZvO3Y9MSJ9.eyJqdGkiOiJ0ZXN0MSIsImlzcyI6IlNBTjJZMFpERTRNSkFUTVpZNU5DIiwic3ViIjoid2ViY2FsbDAwMzA3OTY3MzQ1NDg5MTgyNyIsIm5iZiI6MTc2MzY5MzUyNSwiZXhwIjoxNzYzNzc5OTI1LCJncmFudHMiOnsidm9pY2UiOnsiaW5jb21pbmdfYWxsb3ciOnRydWUsIm91dGdvaW5nX2FsbG93Ijp0cnVlfX19.9p4O_xTb4kNhKyDVfK3EemSKBQiHtbKNUZ5iwnSdX1I'
|
|
17
17
|
try {
|
|
18
18
|
if (!plivoBrowserSdk)
|
|
19
19
|
plivoBrowserSdk = new window.Plivo(options);
|
|
@@ -33,19 +33,23 @@ export function usePlivo(callback) {
|
|
|
33
33
|
});
|
|
34
34
|
plivoBrowserSdk.client.on('onCallRemoteRinging', (data) => handleCallRemoteRinging(data));
|
|
35
35
|
plivoBrowserSdk.client.on('onMediaPermission', (e) => handleMediaPermission(e));
|
|
36
|
-
|
|
37
|
-
// plivoBrowserSdk?.client?.on?.('onLoginFailed', () => console.log('Login failed'))
|
|
36
|
+
plivoBrowserSdk?.client?.on?.('onLoginFailed', (e) => handleLoginFailed(e));
|
|
38
37
|
// plivoBrowserSdk?.client?.on?.('remoteAudioStatus', () => console.log('remoteAudioStatus'))
|
|
38
|
+
const payload = JSON.parse(atob(token.split('.')[1]));
|
|
39
|
+
// await plivoBrowserSdk?.client?.tokenLogin(username, token)
|
|
39
40
|
await plivoBrowserSdk?.client?.login('webcall003079673454891827', '123456abcA!');
|
|
40
|
-
//
|
|
41
|
-
//
|
|
42
|
-
console.log('Registered with token');
|
|
41
|
+
// await plivoBrowserSdk?.client?.loginWithAccessToken(token)
|
|
42
|
+
// console.log('Registered with token')
|
|
43
43
|
}
|
|
44
44
|
catch (err) {
|
|
45
45
|
console.log('Login error: ' + err);
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
+
const handleLoginFailed = (e) => {
|
|
49
|
+
console.log('Login failed', e);
|
|
50
|
+
};
|
|
48
51
|
const handleIncomingCall = (call) => {
|
|
52
|
+
console.log(call);
|
|
49
53
|
const data = {
|
|
50
54
|
phone: _getPhone(call.src)
|
|
51
55
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import axios from '../../plugins/axios';
|
|
2
2
|
import { dataProfile } from '../../utils/chat/auth';
|
|
3
|
-
|
|
4
|
-
const BARE_WEBSOCKET_URL = 'https://web-socket-test.dev01.dtsmart.dev'
|
|
3
|
+
const BARE_WEBSOCKET_URL = 'https://web-socket.dev01.dtsmart.dev';
|
|
4
|
+
// const BARE_WEBSOCKET_URL = 'https://web-socket-test.dev01.dtsmart.dev'
|
|
5
5
|
// const BARE_WEBSOCKET_URL = 'http://192.168.1.173:3000'
|
|
6
6
|
export const getIceService = async () => {
|
|
7
7
|
const res = await axios.post('/api/v1/message/call/ice-servers', {
|
|
@@ -124,7 +124,8 @@ export const getPlivoAccessToken = async () => {
|
|
|
124
124
|
const response = await fetch(url, {
|
|
125
125
|
method: 'POST',
|
|
126
126
|
body: JSON.stringify({
|
|
127
|
-
clientId: dataProfile.value?.tenant_id,
|
|
127
|
+
// clientId: dataProfile.value?.tenant_id,
|
|
128
|
+
username: dataProfile.value?.id?.toString()
|
|
128
129
|
}),
|
|
129
130
|
headers: {
|
|
130
131
|
['Content-Type']: 'application/json'
|
|
@@ -38,7 +38,7 @@ export const publicTopicConversationUpdate = async (data) => {
|
|
|
38
38
|
last_message_time: current,
|
|
39
39
|
created_at: current,
|
|
40
40
|
updated_at: current,
|
|
41
|
-
unread_count: (res?.unread_count ?? 0)
|
|
41
|
+
unread_count: (res?.unread_count ?? 0),
|
|
42
42
|
status: 1,
|
|
43
43
|
color: dataProfile.value?.color ?? '',
|
|
44
44
|
is_call: dataProfile.value?.color ?? '',
|
|
@@ -14,4 +14,8 @@ export declare const getCountUnread: (params: {
|
|
|
14
14
|
receiver_id: number;
|
|
15
15
|
}) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
16
16
|
export declare const upLoadImage: (body: FormData) => Promise<IUploadFile[]>;
|
|
17
|
+
export declare const activePlivoMode: (body: {
|
|
18
|
+
id: any;
|
|
19
|
+
is_sms: number;
|
|
20
|
+
}) => Promise<any>;
|
|
17
21
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phonghq/go-chat",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.28",
|
|
4
4
|
"private": false,
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@rushstack/eslint-patch": "^1.8.0",
|
|
49
49
|
"@tsconfig/node20": "^20.1.4",
|
|
50
|
-
"@types/node": "^
|
|
50
|
+
"@types/node": "^24.10.1",
|
|
51
51
|
"@vitejs/plugin-vue": "^5.0.5",
|
|
52
52
|
"@vitejs/plugin-vue-jsx": "^4.0.0",
|
|
53
53
|
"@vue/eslint-config-prettier": "^9.0.0",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
-
export default _default;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
|
-
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
3
|
-
const __VLS_ctx = {};
|
|
4
|
-
let __VLS_elements;
|
|
5
|
-
let __VLS_components;
|
|
6
|
-
let __VLS_directives;
|
|
7
|
-
__VLS_asFunctionalElement(__VLS_elements.svg, __VLS_elements.svg)({
|
|
8
|
-
viewBox: "0 0 24 24",
|
|
9
|
-
fill: "none",
|
|
10
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
11
|
-
});
|
|
12
|
-
__VLS_asFunctionalElement(__VLS_elements.g, __VLS_elements.g)({
|
|
13
|
-
id: "style=stroke",
|
|
14
|
-
});
|
|
15
|
-
__VLS_asFunctionalElement(__VLS_elements.g, __VLS_elements.g)({
|
|
16
|
-
id: "setting",
|
|
17
|
-
});
|
|
18
|
-
__VLS_asFunctionalElement(__VLS_elements.path)({
|
|
19
|
-
id: "vector (Stroke)",
|
|
20
|
-
'fill-rule': "evenodd",
|
|
21
|
-
'clip-rule': "evenodd",
|
|
22
|
-
d: "M12 9.75C10.7574 9.75 9.75 10.7574 9.75 12C9.75 13.2426 10.7574 14.25 12 14.25C13.2426 14.25 14.25 13.2426 14.25 12C14.25 10.7574 13.2426 9.75 12 9.75ZM8.25 12C8.25 9.92893 9.92893 8.25 12 8.25C14.0711 8.25 15.75 9.92893 15.75 12C15.75 14.0711 14.0711 15.75 12 15.75C9.92893 15.75 8.25 14.0711 8.25 12Z",
|
|
23
|
-
fill: "#000000",
|
|
24
|
-
});
|
|
25
|
-
__VLS_asFunctionalElement(__VLS_elements.path)({
|
|
26
|
-
id: "vector (Stroke)_2",
|
|
27
|
-
'fill-rule': "evenodd",
|
|
28
|
-
'clip-rule': "evenodd",
|
|
29
|
-
d: "M9.60347 3.77018C9.3358 3.32423 8.77209 3.18551 8.35347 3.43457L8.34256 3.44105L6.61251 4.43096C6.06514 4.74375 5.8763 5.45289 6.1894 5.9948L5.54 6.37001L6.18888 5.99391C6.72395 6.91704 6.86779 7.92882 6.38982 8.75823C5.91192 9.58753 4.96479 9.97001 3.9 9.97001C3.26678 9.97001 2.75 10.4917 2.75 11.12V12.88C2.75 13.5084 3.26678 14.03 3.9 14.03C4.96479 14.03 5.91192 14.4125 6.38982 15.2418C6.86773 16.0711 6.72398 17.0827 6.18909 18.0058C5.87642 18.5476 6.06491 19.2561 6.6121 19.5688L8.35352 20.5654C8.77214 20.8144 9.33577 20.6758 9.60345 20.2299L9.71093 20.0442C10.2458 19.1214 11.052 18.4925 12.0087 18.4925C12.9662 18.4925 13.77 19.1219 14.3 20.0458C14.3002 20.0462 14.3004 20.0466 14.3007 20.047L14.4065 20.2298C14.6742 20.6758 15.2379 20.8145 15.6565 20.5655L15.6674 20.559L17.3975 19.5691C17.9434 19.2571 18.1351 18.5578 17.8198 18.0038C17.2858 17.0813 17.1426 16.0705 17.6202 15.2418C18.0981 14.4125 19.0452 14.03 20.11 14.03C20.7432 14.03 21.26 13.5084 21.26 12.88V11.12C21.26 10.4868 20.7384 9.97001 20.11 9.97001C19.0452 9.97001 18.0981 9.58753 17.6202 8.75824C17.1423 7.92899 17.286 6.91744 17.8208 5.99445C18.1336 5.45258 17.9451 4.74391 17.3979 4.43119L15.6565 3.43466C15.2379 3.1856 14.6742 3.32423 14.4065 3.77019L14.2991 3.95579C13.7642 4.8786 12.958 5.50751 12.0012 5.50751C11.0439 5.50751 10.2402 4.87825 9.71021 3.95455C9.70992 3.95403 9.70962 3.95352 9.70933 3.95301L9.60347 3.77018ZM7.59248 2.14193C8.75191 1.45656 10.2226 1.87704 10.8946 3.00654L10.8991 3.01421L11.0091 3.20423L11.0107 3.20701C11.3807 3.85247 11.7666 4.00751 12.0012 4.00751C12.237 4.00751 12.6259 3.85115 13.0009 3.20423C13.001 3.20412 13.0009 3.20434 13.0009 3.20423L13.1154 3.00651C13.7874 1.877 15.2581 1.45656 16.4175 2.14193L18.1421 3.12883C19.4147 3.85604 19.8463 5.48713 19.1194 6.74522L19.1189 6.74611C18.7439 7.39298 18.8028 7.8062 18.9198 8.00929C19.0369 8.21249 19.3648 8.47001 20.11 8.47001C21.5616 8.47001 22.76 9.65323 22.76 11.12V12.88C22.76 14.3317 21.5768 15.53 20.11 15.53C19.3648 15.53 19.0369 15.7875 18.9198 15.9907C18.8028 16.1938 18.7439 16.607 19.1189 17.2539L19.1212 17.2579C19.8444 18.5235 19.4157 20.1431 18.1425 20.871C18.1424 20.871 18.1426 20.8709 18.1425 20.871L16.4174 21.8581C15.258 22.5434 13.7874 22.123 13.1154 20.9935L13.1109 20.9858L13.0009 20.7958L12.9993 20.793C12.6293 20.1476 12.2434 19.9925 12.0087 19.9925C11.773 19.9925 11.3841 20.1489 11.0091 20.7958C11.009 20.7959 11.0091 20.7957 11.0091 20.7958L10.8946 20.9935C10.2226 22.123 8.75199 22.5434 7.59257 21.8581L5.8679 20.8712C5.86776 20.8711 5.86803 20.8713 5.8679 20.8712C4.59558 20.1439 4.16378 18.5128 4.8906 17.2548L4.89112 17.2539C5.26605 16.607 5.20721 16.1938 5.09018 15.9907C4.97308 15.7875 4.64521 15.53 3.9 15.53C2.43322 15.53 1.25 14.3317 1.25 12.88V11.12C1.25 9.66837 2.43322 8.47001 3.9 8.47001C4.64521 8.47001 4.97308 8.21249 5.09018 8.00929C5.20721 7.8062 5.26605 7.39298 4.89112 6.74611L4.8906 6.74522C4.16378 5.48726 4.59518 3.85639 5.86749 3.12906L7.59248 2.14193Z",
|
|
30
|
-
fill: "#000000",
|
|
31
|
-
});
|
|
32
|
-
const __VLS_export = (await import('vue')).defineComponent({});
|
|
33
|
-
export default {};
|