@phonghq/go-chat 1.0.75 → 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.
@@ -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;
@@ -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
- if (props.message?.is_call != 1) {
53
- result.unshift({
54
- icon: IconCopy,
55
- title: 'Copy',
56
- disabled: !userHistory.value?.appointment?.length,
57
- click: () => {
58
- copyToClipboard(props.message.message ?? '');
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: "top",
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-6 ' : '-right-6'}`),
245
- contentClass: "min-w-0 -translate-y-4 shadow-none",
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: "top",
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-6 ' : '-right-6'}`),
254
- contentClass: "min-w-0 -translate-y-4 shadow-none",
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: "flex bg-chat-primary-dark text-chat-text rounded-xl py-2" },
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 flex-col w-[70px] text-white duration-200 cursor-pointer border-r last:border-none" },
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,20 +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['flex']} */ ;
473
- /** @type {__VLS_StyleScopedClasses['bg-chat-primary-dark']} */ ;
474
- /** @type {__VLS_StyleScopedClasses['text-chat-text']} */ ;
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['py-2']} */ ;
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['flex-col']} */ ;
480
- /** @type {__VLS_StyleScopedClasses['w-[70px]']} */ ;
481
- /** @type {__VLS_StyleScopedClasses['text-white']} */ ;
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']} */ ;
482
508
  /** @type {__VLS_StyleScopedClasses['duration-200']} */ ;
483
509
  /** @type {__VLS_StyleScopedClasses['cursor-pointer']} */ ;
484
- /** @type {__VLS_StyleScopedClasses['border-r']} */ ;
485
- /** @type {__VLS_StyleScopedClasses['last:border-none']} */ ;
510
+ /** @type {__VLS_StyleScopedClasses['rounded-lg']} */ ;
486
511
  /** @type {__VLS_StyleScopedClasses['opacity-[0.3]']} */ ;
487
512
  /** @type {__VLS_StyleScopedClasses['pointer-events-none']} */ ;
488
513
  /** @type {__VLS_StyleScopedClasses['w-5']} */ ;