@phonghq/go-chat 1.0.27 → 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.
@@ -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
- if (props.showTitle) {
127
- const __VLS_26 = {}.BaseTitle;
128
- /** @type {[typeof __VLS_components.BaseTitle, typeof __VLS_components.baseTitle, ]} */ ;
129
- // @ts-ignore
130
- BaseTitle;
131
- // @ts-ignore
132
- const __VLS_27 = __VLS_asFunctionalComponent(__VLS_26, new __VLS_26({
133
- ...{ 'onClose': {} },
134
- title: (props.title),
135
- showButtonClose: (props.showButtonClose && !props.nonClosable),
136
- }));
137
- const __VLS_28 = __VLS_27({
138
- ...{ 'onClose': {} },
139
- title: (props.title),
140
- showButtonClose: (props.showButtonClose && !props.nonClosable),
141
- }, ...__VLS_functionalComponentArgsRest(__VLS_27));
142
- let __VLS_30;
143
- let __VLS_31;
144
- const __VLS_32 = ({ close: {} },
145
- { onClose: (__VLS_ctx.hide) });
146
- // @ts-ignore
147
- [hide,];
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 __VLS_34 = {};
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 __VLS_35 = __VLS_34;
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-danger border-[1.5px] text-danger hover:bg-danger hover:text-white [&_.loader::before]:border-danger',
9
- success: 'bg-success text-white hover:bg-success-hover [&_.loader::before]:border-white',
10
- danger: 'bg-danger text-white hover:bg-danger-hover [&_.loader::before]:border-white',
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
- // plivoBrowserSdk?.client?.on?.('onReady', () => console.log('Ready'))
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
- // const speaker = document.getElementById('go-chat-remote-audio')
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
- identity: dataProfile.value?.id?.toString()
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-sm', body, {});
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.27",
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": "^20.14.5",
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",