@phonghq/go-chat 1.0.53 → 1.0.55

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.
@@ -189,6 +189,10 @@ const handleReadMessage = () => {
189
189
  const handleOpenPhoneNumpad = () => {
190
190
  phoneNumpadRef.value?.openPhoneNumpad();
191
191
  };
192
+ const handleCloseBtn = () => {
193
+ emit('close');
194
+ phoneNumpadRef.value?.closePhoneNumpad();
195
+ };
192
196
  let __VLS_exposed;
193
197
  defineExpose({
194
198
  get unreadCount() {
@@ -391,8 +395,11 @@ else {
391
395
  ...{ class: "grow relative flex flex-col mx-auto w-full h-full bg-[#F9FAFC] overflow-hidden chat-mobile pt-4" },
392
396
  });
393
397
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
394
- ...{ class: "text-[#141B34] px-6 shrink-0" },
398
+ ...{ class: "text-[#141B34] shrink-0" },
399
+ ...{ class: (__VLS_ctx.responsiveRender == 'mobile' ? 'px-4' : 'px-6') },
395
400
  });
401
+ // @ts-ignore
402
+ [responsiveRender,];
396
403
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
397
404
  ...{ class: "flex items-center justify-between" },
398
405
  });
@@ -477,9 +484,9 @@ else {
477
484
  return;
478
485
  if (!(props.isLib))
479
486
  return;
480
- __VLS_ctx.emit('close');
487
+ __VLS_ctx.handleCloseBtn();
481
488
  // @ts-ignore
482
- [emit,];
489
+ [handleCloseBtn,];
483
490
  } },
484
491
  ...{ class: "w-10 h-10" },
485
492
  });
@@ -866,7 +873,6 @@ else {
866
873
  /** @type {__VLS_StyleScopedClasses['chat-mobile']} */ ;
867
874
  /** @type {__VLS_StyleScopedClasses['pt-4']} */ ;
868
875
  /** @type {__VLS_StyleScopedClasses['text-[#141B34]']} */ ;
869
- /** @type {__VLS_StyleScopedClasses['px-6']} */ ;
870
876
  /** @type {__VLS_StyleScopedClasses['shrink-0']} */ ;
871
877
  /** @type {__VLS_StyleScopedClasses['flex']} */ ;
872
878
  /** @type {__VLS_StyleScopedClasses['items-center']} */ ;
@@ -138,19 +138,23 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
138
138
  }
139
139
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({});
140
140
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
141
- ...{ class: "px-3 py-2 rounded-2xl max-w-xs text-left" },
141
+ ...{ class: "px-3 py-2 rounded-2xl text-left w-max" },
142
142
  ...{ class: ({
143
- 'rounded-tl-none': !__VLS_ctx.isChatStart && !__VLS_ctx.isMyMessage,
144
- 'rounded-bl-none': !__VLS_ctx.isChatFinished && !__VLS_ctx.isMyMessage,
145
- 'rounded-tr-none': !__VLS_ctx.isChatStart && __VLS_ctx.isMyMessage,
146
- 'rounded-br-none': !__VLS_ctx.isChatFinished && __VLS_ctx.isMyMessage,
143
+ 'rounded-tl-[6px]': !__VLS_ctx.isChatStart && !__VLS_ctx.isMyMessage,
144
+ 'rounded-bl-[6px]': !__VLS_ctx.isChatFinished && !__VLS_ctx.isMyMessage,
145
+ 'rounded-tr-[6px]': !__VLS_ctx.isChatStart && __VLS_ctx.isMyMessage,
146
+ 'rounded-br-[6px]': !__VLS_ctx.isChatFinished && __VLS_ctx.isMyMessage,
147
147
  '!text-white !bg-chat-success': (__VLS_ctx.message.message_uuid && !__VLS_ctx.message.is_call) || __VLS_ctx.message.is_sms,
148
148
  'bg-chat-primary text-white': __VLS_ctx.isMyMessage && !__VLS_ctx.message.is_call,
149
- 'bg-[#E4E4E4D4] text-chat-haze-600 w-max ': !__VLS_ctx.isMyMessage || __VLS_ctx.message.is_call
149
+ 'bg-[#E4E4E4D4] text-chat-haze-600': !__VLS_ctx.isMyMessage || __VLS_ctx.message.is_call,
150
+ 'ml-auto': __VLS_ctx.isMyMessage,
151
+ 'mr-auto': !__VLS_ctx.isMyMessage,
152
+ 'max-w-[280px]': __VLS_ctx.responsive == 'mobile',
153
+ 'max-w-[480px]': __VLS_ctx.responsive !== 'mobile',
150
154
  }) },
151
155
  });
152
156
  // @ts-ignore
153
- [isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, message, message, message, message, message, isChatStart, isChatStart, isChatFinished, isChatFinished,];
157
+ [isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, message, message, message, message, message, responsive, responsive, isChatStart, isChatStart, isChatFinished, isChatFinished,];
154
158
  if (__VLS_ctx.message.is_call == 1) {
155
159
  // @ts-ignore
156
160
  [message,];
@@ -286,19 +290,22 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
286
290
  /** @type {__VLS_StyleScopedClasses['px-3']} */ ;
287
291
  /** @type {__VLS_StyleScopedClasses['py-2']} */ ;
288
292
  /** @type {__VLS_StyleScopedClasses['rounded-2xl']} */ ;
289
- /** @type {__VLS_StyleScopedClasses['max-w-xs']} */ ;
290
293
  /** @type {__VLS_StyleScopedClasses['text-left']} */ ;
291
- /** @type {__VLS_StyleScopedClasses['rounded-tl-none']} */ ;
292
- /** @type {__VLS_StyleScopedClasses['rounded-bl-none']} */ ;
293
- /** @type {__VLS_StyleScopedClasses['rounded-tr-none']} */ ;
294
- /** @type {__VLS_StyleScopedClasses['rounded-br-none']} */ ;
294
+ /** @type {__VLS_StyleScopedClasses['w-max']} */ ;
295
+ /** @type {__VLS_StyleScopedClasses['rounded-tl-[6px]']} */ ;
296
+ /** @type {__VLS_StyleScopedClasses['rounded-bl-[6px]']} */ ;
297
+ /** @type {__VLS_StyleScopedClasses['rounded-tr-[6px]']} */ ;
298
+ /** @type {__VLS_StyleScopedClasses['rounded-br-[6px]']} */ ;
295
299
  /** @type {__VLS_StyleScopedClasses['!text-white']} */ ;
296
300
  /** @type {__VLS_StyleScopedClasses['!bg-chat-success']} */ ;
297
301
  /** @type {__VLS_StyleScopedClasses['bg-chat-primary']} */ ;
298
302
  /** @type {__VLS_StyleScopedClasses['text-white']} */ ;
299
303
  /** @type {__VLS_StyleScopedClasses['bg-[#E4E4E4D4]']} */ ;
300
304
  /** @type {__VLS_StyleScopedClasses['text-chat-haze-600']} */ ;
301
- /** @type {__VLS_StyleScopedClasses['w-max']} */ ;
305
+ /** @type {__VLS_StyleScopedClasses['ml-auto']} */ ;
306
+ /** @type {__VLS_StyleScopedClasses['mr-auto']} */ ;
307
+ /** @type {__VLS_StyleScopedClasses['max-w-[280px]']} */ ;
308
+ /** @type {__VLS_StyleScopedClasses['max-w-[480px]']} */ ;
302
309
  /** @type {__VLS_StyleScopedClasses['flex']} */ ;
303
310
  /** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
304
311
  /** @type {__VLS_StyleScopedClasses['gap-2']} */ ;
@@ -44,7 +44,7 @@ const handleConnectMqtt = async () => {
44
44
  };
45
45
  const handleDisconnectMqtt = async () => {
46
46
  // unsubscribeFromTopic(topic)
47
- unsubscribeFromTopic(topic_plivo_chat);
47
+ await unsubscribeFromTopic(topic_plivo_chat);
48
48
  // removeHandleMqttMessage('chat-home')
49
49
  removeHandleMqttMessage('chat-home-1');
50
50
  };
@@ -112,7 +112,7 @@ const handleGetDetailReceiver = async (data) => {
112
112
  const res = (await getDetailReceiver(props.receiverId)) ?? null;
113
113
  if (id == props.receiverId) {
114
114
  infoUser.value = res;
115
- handleDisconnectMqtt();
115
+ await handleDisconnectMqtt();
116
116
  await handleConnectMqtt();
117
117
  }
118
118
  };
@@ -53,7 +53,10 @@ let __VLS_components;
53
53
  let __VLS_directives;
54
54
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
55
55
  ...{ class: "px-8 py-4 h-[96px] layout-shadow border-b border-chat-gray-5 z-10" },
56
+ ...{ class: ({ '!px-4': __VLS_ctx.responsive == 'mobile' }) },
56
57
  });
58
+ // @ts-ignore
59
+ [responsive,];
57
60
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
58
61
  ...{ class: "flex items-center gap-2 h-full" },
59
62
  });
@@ -193,6 +196,7 @@ if (__VLS_ctx.data?.id && __VLS_ctx.data?.id != __VLS_ctx.digibotId.toString() &
193
196
  /** @type {__VLS_StyleScopedClasses['border-b']} */ ;
194
197
  /** @type {__VLS_StyleScopedClasses['border-chat-gray-5']} */ ;
195
198
  /** @type {__VLS_StyleScopedClasses['z-10']} */ ;
199
+ /** @type {__VLS_StyleScopedClasses['!px-4']} */ ;
196
200
  /** @type {__VLS_StyleScopedClasses['flex']} */ ;
197
201
  /** @type {__VLS_StyleScopedClasses['items-center']} */ ;
198
202
  /** @type {__VLS_StyleScopedClasses['gap-2']} */ ;
@@ -46,7 +46,7 @@ const handleSendMessage = async (type) => {
46
46
  keyword.value = '';
47
47
  // chatInputRef.value.style.height = 'auto'
48
48
  chatId++;
49
- const id = props.data?.id.toString() + '-' + chatId;
49
+ const id = props.data?.id.toString() + '-' + chatId + '-' + Date.now();
50
50
  const data = {
51
51
  conversation_id: props.data?.conversation_id,
52
52
  created_at: dayjs().tz(TIME_ZONE_UTC).format(DATE_FORMATS['DATE_FORMAT_FULL']),
@@ -149,7 +149,7 @@ __VLS_asFunctionalElement(__VLS_elements.textarea)({
149
149
  // @ts-ignore
150
150
  [setInputHeight,];
151
151
  } },
152
- ...{ class: "text-[14px] sm:text-base w-full min-h-11 overflow-hidden chat-input !rounded-xl px-4 py-2 border border-chat-haze-200" },
152
+ ...{ class: "text-[14px] sm:text-base w-full min-h-11 overflow-hidden chat-input !rounded-xl px-4 py-2 border border-chat-haze-200 leading-[24px]" },
153
153
  ref: "chatInputRef",
154
154
  rows: "1",
155
155
  placeholder: "Send Message",
@@ -310,6 +310,7 @@ const __VLS_19 = __VLS_18({
310
310
  /** @type {__VLS_StyleScopedClasses['py-2']} */ ;
311
311
  /** @type {__VLS_StyleScopedClasses['border']} */ ;
312
312
  /** @type {__VLS_StyleScopedClasses['border-chat-haze-200']} */ ;
313
+ /** @type {__VLS_StyleScopedClasses['leading-[24px]']} */ ;
313
314
  /** @type {__VLS_StyleScopedClasses['flex']} */ ;
314
315
  /** @type {__VLS_StyleScopedClasses['gap-2']} */ ;
315
316
  /** @type {__VLS_StyleScopedClasses['-translate-y-2']} */ ;
@@ -7,6 +7,7 @@ type KeyPadProps = {
7
7
  };
8
8
  declare const _default: import("vue").DefineComponent<KeyPadProps, {
9
9
  openPhoneNumpad: () => void;
10
+ closePhoneNumpad: () => void;
10
11
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
11
12
  call: (data: IResUser) => any;
12
13
  "error:noPhoneTenant": () => any;
@@ -10,10 +10,14 @@ const openPhoneNumpad = () => {
10
10
  phoneNumpadRef.value?.reset();
11
11
  drawerVisibleRef.value?.open();
12
12
  };
13
+ const closePhoneNumpad = () => {
14
+ phoneNumpadRef.value?.reset();
15
+ drawerVisibleRef.value?.close();
16
+ };
13
17
  const handleCall = (data) => {
14
18
  emit('call', data);
15
19
  };
16
- const __VLS_exposed = { openPhoneNumpad };
20
+ const __VLS_exposed = { openPhoneNumpad, closePhoneNumpad };
17
21
  defineExpose(__VLS_exposed);
18
22
  debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
19
23
  const __VLS_defaults = {};