@phonghq/go-chat 1.0.27 → 1.0.29
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 -0
- package/dist/components/chat/common/modal/Modal.vue.d.ts +94 -0
- package/dist/go-chat.es.js +6889 -6865
- package/dist/go-chat.umd.js +13 -13
- package/dist/style.css +1 -1
- package/dist/test/chat/page/home/ChatList.vue.js +9 -6
- package/dist/test/chat/page/home/ChatMessageItem.vue.js +3 -3
- package/dist/test/chat/page/home/Home.vue.js +7 -5
- package/dist/test/components/chat/call/Calling.vue.js +3 -3
- package/dist/test/components/chat/common/modal/Modal.vue.js +260 -0
- package/dist/test/components/chat/common/switch/SwitchBase.vue.js +3 -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 +0 -1
- package/dist/test/composable/usePlivo.js +7 -6
- package/dist/test/utils/chat/call.js +1 -1
- package/dist/test/utils/chat/message.js +1 -1
- package/package.json +2 -2
|
@@ -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) {
|
|
@@ -51,7 +51,6 @@ export const useListConversations = (is_unknown) => {
|
|
|
51
51
|
if ((data.is_unknown ?? 0) != is_unknown)
|
|
52
52
|
return;
|
|
53
53
|
getDataMqtt();
|
|
54
|
-
console.log(topic, data);
|
|
55
54
|
if (topic === TOPIC_HOME[0] + dataProfile.value?.id) {
|
|
56
55
|
const index = listConversations.value.findIndex((item) => item.id === data.id);
|
|
57
56
|
const hasChatBox = listConversations.value.findIndex((item) => item.id === digibotId);
|
|
@@ -33,20 +33,21 @@ 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
|
-
// console.log(token)
|
|
41
41
|
// await plivoBrowserSdk?.client?.loginWithAccessToken(token)
|
|
42
|
-
//
|
|
43
|
-
// if (speaker) plivoBrowserSdk?.client?.setAudioElement(speaker)
|
|
44
|
-
console.log('Registered with token');
|
|
42
|
+
// console.log('Registered with token')
|
|
45
43
|
}
|
|
46
44
|
catch (err) {
|
|
47
45
|
console.log('Login error: ' + err);
|
|
48
46
|
}
|
|
49
47
|
};
|
|
48
|
+
const handleLoginFailed = (e) => {
|
|
49
|
+
console.log('Login failed', e);
|
|
50
|
+
};
|
|
50
51
|
const handleIncomingCall = (call) => {
|
|
51
52
|
console.log(call);
|
|
52
53
|
const data = {
|
|
@@ -125,7 +125,7 @@ export const getPlivoAccessToken = async () => {
|
|
|
125
125
|
method: 'POST',
|
|
126
126
|
body: JSON.stringify({
|
|
127
127
|
// clientId: dataProfile.value?.tenant_id,
|
|
128
|
-
|
|
128
|
+
username: dataProfile.value?.id?.toString()
|
|
129
129
|
}),
|
|
130
130
|
headers: {
|
|
131
131
|
['Content-Type']: 'application/json'
|
|
@@ -41,6 +41,6 @@ export const upLoadImage = async (body) => {
|
|
|
41
41
|
return res;
|
|
42
42
|
};
|
|
43
43
|
export const activePlivoMode = async (body) => {
|
|
44
|
-
const res = await axios.post('/api/v1/message/message/active-
|
|
44
|
+
const res = await axios.post('/api/v1/message/message/active-sms', body, {});
|
|
45
45
|
return res;
|
|
46
46
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phonghq/go-chat",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.29",
|
|
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",
|