@phonghq/go-chat 1.0.76 → 1.0.77
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 -0
- package/dist/chat/App.vue.js +3 -0
- package/dist/chat/page/home/ChatMessageItem.vue.js +66 -42
- package/dist/go-chat.es.js +16861 -49553
- package/dist/go-chat.umd.js +22 -23
- package/dist/style.css +1 -1
- package/dist/types/chat/global.d.ts +2 -0
- package/package.json +1 -2
package/dist/chat/App.vue.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ declare const _default: import("vue").DefineComponent<GoChatProps, GoChatInstanc
|
|
|
10
10
|
"app:close": () => any;
|
|
11
11
|
"app:zoomChange": () => any;
|
|
12
12
|
"app:openPhoneNumpad": () => any;
|
|
13
|
+
"update:hasTenantPhone": (id: boolean) => any;
|
|
13
14
|
}, string, import("vue").PublicProps, Readonly<GoChatProps> & Readonly<{
|
|
14
15
|
onCall?: ((data: IResUser) => any) | undefined;
|
|
15
16
|
"onBooking-admin:viewAppointment"?: ((id: any) => any) | undefined;
|
|
@@ -19,6 +20,7 @@ declare const _default: import("vue").DefineComponent<GoChatProps, GoChatInstanc
|
|
|
19
20
|
"onApp:close"?: (() => any) | undefined;
|
|
20
21
|
"onApp:zoomChange"?: (() => any) | undefined;
|
|
21
22
|
"onApp:openPhoneNumpad"?: (() => any) | undefined;
|
|
23
|
+
"onUpdate:hasTenantPhone"?: ((id: boolean) => any) | undefined;
|
|
22
24
|
}>, {
|
|
23
25
|
isZoomIn: boolean;
|
|
24
26
|
response: PAGE_RESPONSIVE;
|
package/dist/chat/App.vue.js
CHANGED
|
@@ -186,6 +186,9 @@ const handleInitPage = async () => {
|
|
|
186
186
|
emit('error:noPhoneTenant');
|
|
187
187
|
routerPush(PAGE.NOT_TENANT_PHONE);
|
|
188
188
|
}
|
|
189
|
+
else if (dataProfile.value?.phone && dataProfile.value?.user_type == 'tenant') {
|
|
190
|
+
emit('update:hasTenantPhone', true);
|
|
191
|
+
}
|
|
189
192
|
handleExposeInit(init_data);
|
|
190
193
|
};
|
|
191
194
|
const openSettings = () => {
|
|
@@ -14,7 +14,6 @@ import IconMenuDot from '../../../assets/icons/chat/IconMenuDot.vue';
|
|
|
14
14
|
import IconResend from '../../../assets/icons/chat/IconResend.vue';
|
|
15
15
|
import IconCopy from '../../../assets/icons/chat/IconCopy.vue';
|
|
16
16
|
import PopoverBase from '../../../components/chat/common/popover/PopoverBase.vue';
|
|
17
|
-
import { userHistory } from '../../../utils/chat/store/user';
|
|
18
17
|
dayjs.extend(utc);
|
|
19
18
|
dayjs.extend(timezone);
|
|
20
19
|
const props = withDefaults(defineProps(), {});
|
|
@@ -49,28 +48,46 @@ const callTitle = computed(() => {
|
|
|
49
48
|
});
|
|
50
49
|
const popoverContent = computed(() => {
|
|
51
50
|
let result = [];
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
popoverOpen.value = false;
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
if (props.isMyMessage) {
|
|
63
|
-
result.unshift({
|
|
64
|
-
icon: IconResend,
|
|
65
|
-
title: 'Resend',
|
|
66
|
-
disabled: false,
|
|
67
|
-
click: () => {
|
|
68
|
-
emit('resend');
|
|
69
|
-
popoverOpen.value = false;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
51
|
+
result.unshift({
|
|
52
|
+
icon: IconCopy,
|
|
53
|
+
title: 'Copy',
|
|
54
|
+
disabled: props.message?.is_call == 1,
|
|
55
|
+
click: () => {
|
|
56
|
+
copyToClipboard(props.message.message ?? '');
|
|
57
|
+
popoverOpen.value = false;
|
|
72
58
|
}
|
|
73
|
-
}
|
|
59
|
+
});
|
|
60
|
+
result.unshift({
|
|
61
|
+
icon: IconResend,
|
|
62
|
+
title: 'Resend',
|
|
63
|
+
disabled: !props.isMyMessage || props.message?.is_call == 1,
|
|
64
|
+
click: () => {
|
|
65
|
+
emit('resend');
|
|
66
|
+
popoverOpen.value = false;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
// if (props.message?.is_call != 1) {
|
|
70
|
+
// result.unshift({
|
|
71
|
+
// icon: IconCopy,
|
|
72
|
+
// title: 'Copy',
|
|
73
|
+
// disabled: props.message?.is_call == 1,
|
|
74
|
+
// click: () => {
|
|
75
|
+
// copyToClipboard(props.message.message ?? '')
|
|
76
|
+
// popoverOpen.value = false
|
|
77
|
+
// }
|
|
78
|
+
// })
|
|
79
|
+
// if (props.isMyMessage) {
|
|
80
|
+
// result.unshift({
|
|
81
|
+
// icon: IconResend,
|
|
82
|
+
// title: 'Resend',
|
|
83
|
+
// disabled: false,
|
|
84
|
+
// click: () => {
|
|
85
|
+
// emit('resend')
|
|
86
|
+
// popoverOpen.value = false
|
|
87
|
+
// }
|
|
88
|
+
// })
|
|
89
|
+
// }
|
|
90
|
+
// }
|
|
74
91
|
return result;
|
|
75
92
|
});
|
|
76
93
|
const popoverOpen = ref(false);
|
|
@@ -238,26 +255,26 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
|
|
|
238
255
|
const __VLS_4 = __VLS_asFunctionalComponent(PopoverBase, new PopoverBase({
|
|
239
256
|
open: (__VLS_ctx.popoverOpen),
|
|
240
257
|
trigger: "click",
|
|
241
|
-
side: "
|
|
258
|
+
side: "bottom",
|
|
242
259
|
align: (__VLS_ctx.isMyMessage ? 'end' : 'start'),
|
|
243
260
|
...{ class: "" },
|
|
244
|
-
triggerClass: (`absolute w-6 opacity-0 group-hover:opacity-[1] ${__VLS_ctx.isMyMessage ? '-left-
|
|
245
|
-
contentClass: "min-w-0
|
|
261
|
+
triggerClass: (`absolute w-6 opacity-0 group-hover:opacity-[1] bottom-1/2 translate-y-1/2 ${__VLS_ctx.isMyMessage ? '-left-10 ' : '-right-10'}`),
|
|
262
|
+
contentClass: "min-w-0",
|
|
246
263
|
}));
|
|
247
264
|
const __VLS_5 = __VLS_4({
|
|
248
265
|
open: (__VLS_ctx.popoverOpen),
|
|
249
266
|
trigger: "click",
|
|
250
|
-
side: "
|
|
267
|
+
side: "bottom",
|
|
251
268
|
align: (__VLS_ctx.isMyMessage ? 'end' : 'start'),
|
|
252
269
|
...{ class: "" },
|
|
253
|
-
triggerClass: (`absolute w-6 opacity-0 group-hover:opacity-[1] ${__VLS_ctx.isMyMessage ? '-left-
|
|
254
|
-
contentClass: "min-w-0
|
|
270
|
+
triggerClass: (`absolute w-6 opacity-0 group-hover:opacity-[1] bottom-1/2 translate-y-1/2 ${__VLS_ctx.isMyMessage ? '-left-10 ' : '-right-10'}`),
|
|
271
|
+
contentClass: "min-w-0",
|
|
255
272
|
}, ...__VLS_functionalComponentArgsRest(__VLS_4));
|
|
256
273
|
const { default: __VLS_7 } = __VLS_6.slots;
|
|
257
274
|
// @ts-ignore
|
|
258
275
|
[isMyMessage, isMyMessage, popoverOpen,];
|
|
259
276
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
260
|
-
...{ class: "" },
|
|
277
|
+
...{ class: "w-8 h-8 rotate-90 rounded-full bg-[#f1f5f9] flex-center shadow-3xl" },
|
|
261
278
|
});
|
|
262
279
|
/** @type {[typeof IconMenuDot, ]} */ ;
|
|
263
280
|
// @ts-ignore
|
|
@@ -266,7 +283,10 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
|
|
|
266
283
|
{
|
|
267
284
|
const { content: __VLS_12 } = __VLS_6.slots;
|
|
268
285
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
269
|
-
...{ class: "
|
|
286
|
+
...{ class: "rounded-xl p-2 min-w-[200px]" },
|
|
287
|
+
});
|
|
288
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
289
|
+
...{ class: "text-chat-text" },
|
|
270
290
|
});
|
|
271
291
|
for (const [item, i] of __VLS_getVForSourceType((__VLS_ctx.popoverContent))) {
|
|
272
292
|
// @ts-ignore
|
|
@@ -279,7 +299,7 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
|
|
|
279
299
|
return;
|
|
280
300
|
item.click?.();
|
|
281
301
|
} },
|
|
282
|
-
...{ class: "flex items-center
|
|
302
|
+
...{ class: "flex items-center gap-2 p-2 hover:bg-chat-primary hover:text-white duration-200 cursor-pointer rounded-lg" },
|
|
283
303
|
key: (i),
|
|
284
304
|
...{ class: ({ 'opacity-[0.3] pointer-events-none': item.disabled }) },
|
|
285
305
|
});
|
|
@@ -418,7 +438,6 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
|
|
|
418
438
|
}
|
|
419
439
|
/** @type {__VLS_StyleScopedClasses['']} */ ;
|
|
420
440
|
/** @type {__VLS_StyleScopedClasses['']} */ ;
|
|
421
|
-
/** @type {__VLS_StyleScopedClasses['']} */ ;
|
|
422
441
|
/** @type {__VLS_StyleScopedClasses['relative']} */ ;
|
|
423
442
|
/** @type {__VLS_StyleScopedClasses['flex-center']} */ ;
|
|
424
443
|
/** @type {__VLS_StyleScopedClasses['text-chat-haze-200']} */ ;
|
|
@@ -469,21 +488,26 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
|
|
|
469
488
|
/** @type {__VLS_StyleScopedClasses['mr-auto']} */ ;
|
|
470
489
|
/** @type {__VLS_StyleScopedClasses['max-w-[280px]']} */ ;
|
|
471
490
|
/** @type {__VLS_StyleScopedClasses['max-w-[480px]']} */ ;
|
|
472
|
-
/** @type {__VLS_StyleScopedClasses['
|
|
473
|
-
/** @type {__VLS_StyleScopedClasses['
|
|
474
|
-
/** @type {__VLS_StyleScopedClasses['
|
|
491
|
+
/** @type {__VLS_StyleScopedClasses['w-8']} */ ;
|
|
492
|
+
/** @type {__VLS_StyleScopedClasses['h-8']} */ ;
|
|
493
|
+
/** @type {__VLS_StyleScopedClasses['rotate-90']} */ ;
|
|
494
|
+
/** @type {__VLS_StyleScopedClasses['rounded-full']} */ ;
|
|
495
|
+
/** @type {__VLS_StyleScopedClasses['bg-[#f1f5f9]']} */ ;
|
|
496
|
+
/** @type {__VLS_StyleScopedClasses['flex-center']} */ ;
|
|
497
|
+
/** @type {__VLS_StyleScopedClasses['shadow-3xl']} */ ;
|
|
475
498
|
/** @type {__VLS_StyleScopedClasses['rounded-xl']} */ ;
|
|
476
|
-
/** @type {__VLS_StyleScopedClasses['
|
|
499
|
+
/** @type {__VLS_StyleScopedClasses['p-2']} */ ;
|
|
500
|
+
/** @type {__VLS_StyleScopedClasses['min-w-[200px]']} */ ;
|
|
501
|
+
/** @type {__VLS_StyleScopedClasses['text-chat-text']} */ ;
|
|
477
502
|
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
478
503
|
/** @type {__VLS_StyleScopedClasses['items-center']} */ ;
|
|
479
|
-
/** @type {__VLS_StyleScopedClasses['
|
|
480
|
-
/** @type {__VLS_StyleScopedClasses['
|
|
481
|
-
/** @type {__VLS_StyleScopedClasses['
|
|
482
|
-
/** @type {__VLS_StyleScopedClasses['text-
|
|
504
|
+
/** @type {__VLS_StyleScopedClasses['gap-2']} */ ;
|
|
505
|
+
/** @type {__VLS_StyleScopedClasses['p-2']} */ ;
|
|
506
|
+
/** @type {__VLS_StyleScopedClasses['hover:bg-chat-primary']} */ ;
|
|
507
|
+
/** @type {__VLS_StyleScopedClasses['hover:text-white']} */ ;
|
|
483
508
|
/** @type {__VLS_StyleScopedClasses['duration-200']} */ ;
|
|
484
509
|
/** @type {__VLS_StyleScopedClasses['cursor-pointer']} */ ;
|
|
485
|
-
/** @type {__VLS_StyleScopedClasses['
|
|
486
|
-
/** @type {__VLS_StyleScopedClasses['last:border-none']} */ ;
|
|
510
|
+
/** @type {__VLS_StyleScopedClasses['rounded-lg']} */ ;
|
|
487
511
|
/** @type {__VLS_StyleScopedClasses['opacity-[0.3]']} */ ;
|
|
488
512
|
/** @type {__VLS_StyleScopedClasses['pointer-events-none']} */ ;
|
|
489
513
|
/** @type {__VLS_StyleScopedClasses['w-5']} */ ;
|