@phonghq/go-chat 1.0.56 → 1.0.57

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.
Files changed (41) hide show
  1. package/dist/assets/icons/call/IconClock.vue.d.ts +2 -0
  2. package/dist/assets/icons/call/IconClock.vue.js +22 -0
  3. package/dist/chat/App.vue.js +24 -8
  4. package/dist/chat/page/home/ChatList.vue.d.ts +4 -0
  5. package/dist/chat/page/home/ChatList.vue.js +4 -2
  6. package/dist/chat/page/home/ChatMessage.vue.d.ts +1 -0
  7. package/dist/chat/page/home/ChatMessage.vue.js +27 -7
  8. package/dist/chat/page/home/ChatMessageItem.vue.js +31 -16
  9. package/dist/chat/page/home/DropZone.vue.d.ts +13 -0
  10. package/dist/chat/page/home/DropZone.vue.js +130 -0
  11. package/dist/chat/page/home/Home.vue.d.ts +1 -0
  12. package/dist/chat/page/home/Home.vue.js +71 -20
  13. package/dist/chat/page/home/HomeHeader.vue.js +7 -5
  14. package/dist/chat/page/home/InputChat.vue.js +139 -70
  15. package/dist/chat/page/home/PhoneNumpad.vue.js +2 -0
  16. package/dist/components/chat/call/Calling.vue.js +76 -70
  17. package/dist/components/chat/call/TimeLeft.vue.d.ts +5 -0
  18. package/dist/components/chat/call/TimeLeft.vue.js +59 -0
  19. package/dist/composable/useInitData.js +2 -2
  20. package/dist/composable/useListConversations.d.ts +2 -0
  21. package/dist/composable/useListConversations.js +50 -11
  22. package/dist/composable/usePlivo.d.ts +1 -0
  23. package/dist/composable/usePlivo.js +31 -9
  24. package/dist/constant/mqtt.d.ts +1 -0
  25. package/dist/constant/mqtt.js +2 -0
  26. package/dist/go-chat.es.js +40713 -40472
  27. package/dist/go-chat.umd.js +23 -23
  28. package/dist/plugins/mqtt.js +5 -7
  29. package/dist/style.css +1 -1
  30. package/dist/types/chat/auth.d.ts +0 -1
  31. package/dist/types/chat/call.d.ts +1 -0
  32. package/dist/types/chat/call.js +1 -0
  33. package/dist/types/chat/global.d.ts +1 -1
  34. package/dist/types/message.d.ts +1 -0
  35. package/dist/utils/chat/store/auth.d.ts +0 -2
  36. package/dist/utils/chat/store/auth.js +7 -7
  37. package/dist/utils/chat/store/conversation.js +1 -1
  38. package/dist/utils/chat/store/message.d.ts +4 -0
  39. package/dist/utils/chat/store/message.js +4 -0
  40. package/dist/views/home/phone-numpad/PhoneNumpad.vue.js +3 -0
  41. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1,22 @@
1
+ /// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
+ debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
3
+ const __VLS_ctx = {};
4
+ let __VLS_elements;
5
+ let __VLS_components;
6
+ let __VLS_directives;
7
+ __VLS_asFunctionalElement(__VLS_elements.svg, __VLS_elements.svg)({
8
+ width: "24",
9
+ height: "24",
10
+ viewBox: "0 0 24 24",
11
+ fill: "none",
12
+ xmlns: "http://www.w3.org/2000/svg",
13
+ });
14
+ __VLS_asFunctionalElement(__VLS_elements.path)({
15
+ d: "M12 7V12H15M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",
16
+ stroke: "currentColor",
17
+ 'stroke-width': "2",
18
+ 'stroke-linecap': "round",
19
+ 'stroke-linejoin': "round",
20
+ });
21
+ const __VLS_export = (await import('vue')).defineComponent({});
22
+ export default {};
@@ -55,9 +55,9 @@ const routerMobileConfig = computed(() => [
55
55
  : () => {
56
56
  logout();
57
57
  },
58
- backTitle: 'Go Chat',
58
+ backTitle: 'logo',
59
59
  subTitle: dataProfile.value?.user_type == 'tenant'
60
- ? phoneNumberFormat(dataProfile.value?.tenant_phone ?? '')
60
+ ? phoneNumberFormat(dataProfile.value?.phone ?? '')
61
61
  : ''
62
62
  },
63
63
  {
@@ -171,10 +171,11 @@ const handleCall = (user) => {
171
171
  else {
172
172
  emit('call', user);
173
173
  }
174
+ handleReadMessage();
174
175
  };
175
176
  const handleInitPage = async () => {
176
177
  const init_data = await initPage({ props: props, responsive: responsiveRender.value });
177
- if (!dataProfile.value?.tenant_phone && dataProfile.value?.user_type == 'tenant') {
178
+ if (!dataProfile.value?.phone && dataProfile.value?.user_type == 'tenant') {
178
179
  emit('error:noPhoneTenant');
179
180
  routerPush(PAGE.NOT_TENANT_PHONE);
180
181
  }
@@ -193,6 +194,9 @@ const handleCloseBtn = () => {
193
194
  emit('close');
194
195
  phoneNumpadRef.value?.closePhoneNumpad();
195
196
  };
197
+ const backToHome = () => {
198
+ phoneNumpadRef.value?.closePhoneNumpad();
199
+ };
196
200
  let __VLS_exposed;
197
201
  defineExpose({
198
202
  get unreadCount() {
@@ -213,7 +217,7 @@ defineExpose({
213
217
  endCall: () => callingRef.value?.endCall(),
214
218
  openSettings,
215
219
  initData: (data) => handleExposeInit(data),
216
- closePhoneNumpad: () => phoneNumpadRef.value?.closePhoneNumpad(),
220
+ backToHome,
217
221
  });
218
222
  debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
219
223
  const __VLS_defaults = {
@@ -439,9 +443,20 @@ else {
439
443
  __VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({
440
444
  ...{ class: "text-xl font-semibold text-left text-chat-haze-900" },
441
445
  });
442
- (__VLS_ctx.currentPageConfig.backTitle ?? '');
443
- // @ts-ignore
444
- [currentPageConfig,];
446
+ if (__VLS_ctx.currentPageConfig.backTitle != 'logo') {
447
+ // @ts-ignore
448
+ [currentPageConfig,];
449
+ __VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({});
450
+ (__VLS_ctx.currentPageConfig.backTitle ?? '');
451
+ // @ts-ignore
452
+ [currentPageConfig,];
453
+ }
454
+ else {
455
+ __VLS_asFunctionalElement(__VLS_elements.img)({
456
+ ...{ class: "h-7" },
457
+ src: "@/assets/images/logo-1.png",
458
+ });
459
+ }
445
460
  __VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({
446
461
  ...{ class: "text-sm font-medium text-chat-haze-900" },
447
462
  });
@@ -461,7 +476,7 @@ else {
461
476
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
462
477
  ...{ class: "font-medium text-gray-700" },
463
478
  });
464
- (__VLS_ctx.phoneNumberFormat(__VLS_ctx.dataProfile?.tenant_phone ?? '') ?? '');
479
+ (__VLS_ctx.phoneNumberFormat(__VLS_ctx.dataProfile?.phone ?? '') ?? '');
465
480
  // @ts-ignore
466
481
  [dataProfile, phoneNumberFormat,];
467
482
  }
@@ -885,6 +900,7 @@ else {
885
900
  /** @type {__VLS_StyleScopedClasses['font-semibold']} */ ;
886
901
  /** @type {__VLS_StyleScopedClasses['text-left']} */ ;
887
902
  /** @type {__VLS_StyleScopedClasses['text-chat-haze-900']} */ ;
903
+ /** @type {__VLS_StyleScopedClasses['h-7']} */ ;
888
904
  /** @type {__VLS_StyleScopedClasses['text-sm']} */ ;
889
905
  /** @type {__VLS_StyleScopedClasses['font-medium']} */ ;
890
906
  /** @type {__VLS_StyleScopedClasses['text-chat-haze-900']} */ ;
@@ -81,6 +81,10 @@ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {
81
81
  conversation_id?: any;
82
82
  is_unknown?: string | undefined;
83
83
  } | undefined) => Promise<void>;
84
+ handleTabChange: (tab: any, option?: {
85
+ hideCheckHasReceiveId?: boolean | undefined;
86
+ hideLoading?: boolean | undefined;
87
+ } | undefined) => Promise<void>;
84
88
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
85
89
  "update:receiverId": (value: any) => any;
86
90
  } & {
@@ -73,7 +73,7 @@ const getData = async (data, option) => {
73
73
  const tab_value = option?.tab ?? activeTabs.value;
74
74
  if (!option?.hideLoading)
75
75
  isLoadingSearch.value = true;
76
- if (option?.reset) {
76
+ if (option?.reset && !data?.search) {
77
77
  let cache = false;
78
78
  if (tab_value == TAB_VALUE.ALL) {
79
79
  cache = getDataCacheAll();
@@ -154,6 +154,7 @@ const handleScroll = useDebounce(async () => {
154
154
  }
155
155
  }, 200);
156
156
  const selectUser = (user) => {
157
+ handleReadMessage();
157
158
  emit('selectReceiver', user);
158
159
  };
159
160
  const handleReadMessage = () => {
@@ -205,7 +206,8 @@ const __VLS_exposed = {
205
206
  listConversationsAll,
206
207
  listConversationsUnknown,
207
208
  getCurrentConversation,
208
- initData
209
+ initData,
210
+ handleTabChange
209
211
  };
210
212
  defineExpose(__VLS_exposed);
211
213
  debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
@@ -5,6 +5,7 @@ type Props = {
5
5
  message: IResMessage[];
6
6
  responsive: PAGE_RESPONSIVE;
7
7
  showNewCustomer: boolean;
8
+ isLoading: boolean;
8
9
  };
9
10
  declare const _default: import("vue").DefineComponent<Props, {
10
11
  scrollBottom: () => void;
@@ -113,12 +113,30 @@ if (__VLS_ctx.showNewCustomer) {
113
113
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
114
114
  ...{ class: "chat-padding-page" },
115
115
  });
116
+ const __VLS_13 = {}.TransitionGroup;
117
+ /** @type {[typeof __VLS_components.TransitionGroup, typeof __VLS_components.transitionGroup, typeof __VLS_components.TransitionGroup, typeof __VLS_components.transitionGroup, ]} */ ;
118
+ // @ts-ignore
119
+ TransitionGroup;
120
+ // @ts-ignore
121
+ const __VLS_14 = __VLS_asFunctionalComponent(__VLS_13, new __VLS_13({
122
+ name: (__VLS_ctx.isLoading ? '' : 'message'),
123
+ tag: "div",
124
+ ...{ class: "chat-list" },
125
+ }));
126
+ const __VLS_15 = __VLS_14({
127
+ name: (__VLS_ctx.isLoading ? '' : 'message'),
128
+ tag: "div",
129
+ ...{ class: "chat-list" },
130
+ }, ...__VLS_functionalComponentArgsRest(__VLS_14));
131
+ const { default: __VLS_17 } = __VLS_16.slots;
132
+ // @ts-ignore
133
+ [isLoading,];
116
134
  for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.message))) {
117
135
  // @ts-ignore
118
136
  [message,];
119
137
  /** @type {[typeof ChatMessageItem, ]} */ ;
120
138
  // @ts-ignore
121
- const __VLS_13 = __VLS_asFunctionalComponent(ChatMessageItem, new ChatMessageItem({
139
+ const __VLS_18 = __VLS_asFunctionalComponent(ChatMessageItem, new ChatMessageItem({
122
140
  ...{ 'onCallAgain': {} },
123
141
  message: (item),
124
142
  index: (index),
@@ -131,7 +149,7 @@ for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.message))) {
131
149
  isChatFinished: (__VLS_ctx.isChatFinished(index)),
132
150
  isChatStart: (__VLS_ctx.isChatStart(index)),
133
151
  }));
134
- const __VLS_14 = __VLS_13({
152
+ const __VLS_19 = __VLS_18({
135
153
  ...{ 'onCallAgain': {} },
136
154
  message: (item),
137
155
  index: (index),
@@ -143,17 +161,18 @@ for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.message))) {
143
161
  isEndMessage: (__VLS_ctx.isEndMessage(index)),
144
162
  isChatFinished: (__VLS_ctx.isChatFinished(index)),
145
163
  isChatStart: (__VLS_ctx.isChatStart(index)),
146
- }, ...__VLS_functionalComponentArgsRest(__VLS_13));
147
- let __VLS_16;
148
- let __VLS_17;
149
- const __VLS_18 = ({ callAgain: {} },
164
+ }, ...__VLS_functionalComponentArgsRest(__VLS_18));
165
+ let __VLS_21;
166
+ let __VLS_22;
167
+ const __VLS_23 = ({ callAgain: {} },
150
168
  { onCallAgain: (...[$event]) => {
151
169
  __VLS_ctx.emit('callBack');
152
170
  // @ts-ignore
153
171
  [data, message, responsive, dataProfile, shouldShowAvatar, isEndMessage, isChatFinished, isChatStart, emit,];
154
172
  } });
155
- var __VLS_15;
173
+ var __VLS_20;
156
174
  }
175
+ var __VLS_16;
157
176
  var __VLS_2;
158
177
  /** @type {__VLS_StyleScopedClasses['relative']} */ ;
159
178
  /** @type {__VLS_StyleScopedClasses['overflow-hidden']} */ ;
@@ -167,6 +186,7 @@ var __VLS_2;
167
186
  /** @type {__VLS_StyleScopedClasses['chat-padding-page']} */ ;
168
187
  /** @type {__VLS_StyleScopedClasses['h-full']} */ ;
169
188
  /** @type {__VLS_StyleScopedClasses['chat-padding-page']} */ ;
189
+ /** @type {__VLS_StyleScopedClasses['chat-list']} */ ;
170
190
  // @ts-ignore
171
191
  var __VLS_7 = __VLS_6;
172
192
  const __VLS_export = (await import('vue')).defineComponent({
@@ -26,15 +26,17 @@ const callTitle = computed(() => {
26
26
  }
27
27
  }
28
28
  else {
29
- if (props.message?.call_status == PLIVO_CALL_STATUS.CONNECT_FAILED ||
29
+ if (props.message?.call_status == PLIVO_CALL_STATUS.BUSY ||
30
+ props.message?.call_status == PLIVO_CALL_STATUS.CANCEL) {
31
+ return 'Call canceled';
32
+ }
33
+ else if (props.message?.call_status == PLIVO_CALL_STATUS.CONNECT_FAILED ||
30
34
  props.message?.call_status == PLIVO_CALL_STATUS.TIME_OUT ||
31
- props.message?.call_status == PLIVO_CALL_STATUS.CANCEL ||
32
- props.message?.call_status == PLIVO_CALL_STATUS.NO_ANSWER ||
33
- props.message?.call_status == PLIVO_CALL_STATUS.BUSY) {
35
+ props.message?.call_status == PLIVO_CALL_STATUS.NO_ANSWER) {
34
36
  return 'Call missed';
35
37
  }
36
38
  else if (props.message?.call_status == PLIVO_CALL_STATUS.CALL_END) {
37
- return 'Incomming audio call';
39
+ return 'Incoming audio call';
38
40
  }
39
41
  }
40
42
  return '';
@@ -88,7 +90,7 @@ let __VLS_elements;
88
90
  let __VLS_components;
89
91
  let __VLS_directives;
90
92
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
91
- ...{ class: "flex items-end mt-1" },
93
+ ...{ class: "flex items-end mt-1 relative" },
92
94
  ...{ class: ({
93
95
  'mt-2': __VLS_ctx.shouldShowAvatar,
94
96
  'flex-col justify-end pl-[60px]': __VLS_ctx.isMyMessage,
@@ -106,26 +108,36 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
106
108
  if (__VLS_ctx.shouldShowAvatar) {
107
109
  // @ts-ignore
108
110
  [shouldShowAvatar,];
111
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
112
+ ...{ class: "" },
113
+ ...{ class: (__VLS_ctx.responsive == 'mobile' ? 'w-8' : 'w-12') },
114
+ });
115
+ // @ts-ignore
116
+ [responsive,];
109
117
  /** @type {[typeof Avatar, ]} */ ;
110
118
  // @ts-ignore
111
119
  const __VLS_0 = __VLS_asFunctionalComponent(Avatar, new Avatar({
112
- ...{ class: "shrink-0" },
120
+ ...{ class: "shrink-0 absolute top-0" },
113
121
  src: (__VLS_ctx.data?.avatar ?? ''),
114
122
  color: (__VLS_ctx.data?.color),
115
123
  name: (__VLS_ctx.data?.username),
116
124
  size: (__VLS_ctx.responsive == 'mobile' ? 'sm' : 'md'),
117
- ...{ class: ({ 'translate-y-[-2px]': __VLS_ctx.responsive == 'mobile', '!-translate-y-[26px]': __VLS_ctx.isChatStart && __VLS_ctx.isChatFinished }) },
125
+ ...{ class: ({
126
+ 'translate-y-[-2px]': __VLS_ctx.responsive == 'mobile',
127
+ }) },
118
128
  }));
119
129
  const __VLS_1 = __VLS_0({
120
- ...{ class: "shrink-0" },
130
+ ...{ class: "shrink-0 absolute top-0" },
121
131
  src: (__VLS_ctx.data?.avatar ?? ''),
122
132
  color: (__VLS_ctx.data?.color),
123
133
  name: (__VLS_ctx.data?.username),
124
134
  size: (__VLS_ctx.responsive == 'mobile' ? 'sm' : 'md'),
125
- ...{ class: ({ 'translate-y-[-2px]': __VLS_ctx.responsive == 'mobile', '!-translate-y-[26px]': __VLS_ctx.isChatStart && __VLS_ctx.isChatFinished }) },
135
+ ...{ class: ({
136
+ 'translate-y-[-2px]': __VLS_ctx.responsive == 'mobile',
137
+ }) },
126
138
  }, ...__VLS_functionalComponentArgsRest(__VLS_0));
127
139
  // @ts-ignore
128
- [data, data, data, responsive, responsive, isChatStart, isChatFinished,];
140
+ [responsive, responsive, data, data, data,];
129
141
  }
130
142
  else {
131
143
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
@@ -150,7 +162,7 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
150
162
  'ml-auto': __VLS_ctx.isMyMessage,
151
163
  'mr-auto': !__VLS_ctx.isMyMessage,
152
164
  'max-w-[280px]': __VLS_ctx.responsive == 'mobile',
153
- 'max-w-[480px]': __VLS_ctx.responsive !== 'mobile',
165
+ 'max-w-[480px]': __VLS_ctx.responsive !== 'mobile'
154
166
  }) },
155
167
  });
156
168
  // @ts-ignore
@@ -222,7 +234,7 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
222
234
  [message,];
223
235
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({});
224
236
  __VLS_asFunctionalElement(__VLS_elements.div)({
225
- ...{ style: ({ wordBreak: 'break-word' }) },
237
+ ...{ style: ({ wordBreak: 'break-word', whiteSpace: 'pre-line' }) },
226
238
  });
227
239
  __VLS_asFunctionalDirective(__VLS_directives.vHtml)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.message.message) }, null, null);
228
240
  // @ts-ignore
@@ -264,7 +276,7 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
264
276
  // @ts-ignore
265
277
  [message, message, MessageState, isLastMessage, getMessageStateText,];
266
278
  __VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({
267
- ...{ class: "text-chat-haze-200 text-xs mt-1" },
279
+ ...{ class: "text-chat-haze-400 text-xs mt-1" },
268
280
  ...{ class: ({ '!text-chat-error': __VLS_ctx.message.state == __VLS_ctx.MessageState.Failed }) },
269
281
  });
270
282
  // @ts-ignore
@@ -275,17 +287,20 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
275
287
  }
276
288
  }
277
289
  }
290
+ /** @type {__VLS_StyleScopedClasses['']} */ ;
278
291
  /** @type {__VLS_StyleScopedClasses['flex']} */ ;
279
292
  /** @type {__VLS_StyleScopedClasses['items-end']} */ ;
280
293
  /** @type {__VLS_StyleScopedClasses['mt-1']} */ ;
294
+ /** @type {__VLS_StyleScopedClasses['relative']} */ ;
281
295
  /** @type {__VLS_StyleScopedClasses['mt-2']} */ ;
282
296
  /** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
283
297
  /** @type {__VLS_StyleScopedClasses['justify-end']} */ ;
284
298
  /** @type {__VLS_StyleScopedClasses['pl-[60px]']} */ ;
285
299
  /** @type {__VLS_StyleScopedClasses['gap-2']} */ ;
286
300
  /** @type {__VLS_StyleScopedClasses['shrink-0']} */ ;
301
+ /** @type {__VLS_StyleScopedClasses['absolute']} */ ;
302
+ /** @type {__VLS_StyleScopedClasses['top-0']} */ ;
287
303
  /** @type {__VLS_StyleScopedClasses['translate-y-[-2px]']} */ ;
288
- /** @type {__VLS_StyleScopedClasses['!-translate-y-[26px]']} */ ;
289
304
  /** @type {__VLS_StyleScopedClasses['shrink-0']} */ ;
290
305
  /** @type {__VLS_StyleScopedClasses['px-3']} */ ;
291
306
  /** @type {__VLS_StyleScopedClasses['py-2']} */ ;
@@ -331,7 +346,7 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
331
346
  /** @type {__VLS_StyleScopedClasses['font-semibold']} */ ;
332
347
  /** @type {__VLS_StyleScopedClasses['text-sm']} */ ;
333
348
  /** @type {__VLS_StyleScopedClasses['mt-1']} */ ;
334
- /** @type {__VLS_StyleScopedClasses['text-chat-haze-200']} */ ;
349
+ /** @type {__VLS_StyleScopedClasses['text-chat-haze-400']} */ ;
335
350
  /** @type {__VLS_StyleScopedClasses['text-xs']} */ ;
336
351
  /** @type {__VLS_StyleScopedClasses['mt-1']} */ ;
337
352
  /** @type {__VLS_StyleScopedClasses['!text-chat-error']} */ ;
@@ -0,0 +1,13 @@
1
+ import 'vue3-emoji-picker/css';
2
+ type __VLS_ModelProps = {
3
+ 'file'?: Blob | null;
4
+ 'link'?: string;
5
+ };
6
+ declare const _default: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
+ "update:file": (value: Blob | null | undefined) => any;
8
+ "update:link": (value: string | undefined) => any;
9
+ }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
10
+ "onUpdate:file"?: ((value: Blob | null | undefined) => any) | undefined;
11
+ "onUpdate:link"?: ((value: string | undefined) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ export default _default;
@@ -0,0 +1,130 @@
1
+ /// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
+ import 'vue3-emoji-picker/css';
3
+ import { ref, onMounted, onUnmounted } from 'vue';
4
+ // type Props = {
5
+ // data: IResUser | null
6
+ // responsive: PAGE_RESPONSIVE
7
+ // }
8
+ // const props = withDefaults(defineProps<Props>(), {})
9
+ // const emit = defineEmits<{
10
+ // (e: 'sendMessage', val: IResMessage): void
11
+ // (e: 'focus'): void
12
+ // }>()
13
+ const ChatModeOptions = [
14
+ { value: '0', label: 'Go Chat' },
15
+ { value: '1', label: 'Go sms' }
16
+ ];
17
+ const dropFile = defineModel('file');
18
+ const dropFileLink = defineModel('link');
19
+ let dragCounter = 0;
20
+ onMounted(() => {
21
+ window.addEventListener('dragenter', onWindowDragEnter);
22
+ window.addEventListener('dragleave', onWindowDragLeave);
23
+ window.addEventListener('drop', onWindowDrop);
24
+ window.addEventListener('dragover', onWindowDragOver);
25
+ });
26
+ onUnmounted(() => {
27
+ window.removeEventListener('dragenter', onWindowDragEnter);
28
+ window.removeEventListener('dragleave', onWindowDragLeave);
29
+ window.removeEventListener('drop', onWindowDrop);
30
+ window.removeEventListener('dragover', onWindowDragOver);
31
+ });
32
+ const mode = ref('0');
33
+ const isHover = ref(false);
34
+ const showDropzone = ref(false);
35
+ const onWindowDragEnter = (e) => {
36
+ if (!e.dataTransfer?.types.includes('Files'))
37
+ return;
38
+ dragCounter++;
39
+ showDropzone.value = true;
40
+ };
41
+ const onWindowDragLeave = () => {
42
+ dragCounter--;
43
+ if (dragCounter === 0) {
44
+ showDropzone.value = false;
45
+ isHover.value = false;
46
+ }
47
+ };
48
+ const isFileDrag = (e) => {
49
+ return e.dataTransfer?.types.includes('Files');
50
+ };
51
+ const onWindowDragOver = (e) => {
52
+ if (!isFileDrag(e))
53
+ return;
54
+ e.preventDefault();
55
+ };
56
+ const onWindowDrop = (e) => {
57
+ if (!isFileDrag(e))
58
+ return;
59
+ e.preventDefault();
60
+ dragCounter = 0;
61
+ showDropzone.value = false;
62
+ isHover.value = false;
63
+ };
64
+ const onDrop = (e) => {
65
+ isHover.value = false;
66
+ const files = e.dataTransfer?.files;
67
+ if (files)
68
+ handleFiles(files);
69
+ };
70
+ const handleFiles = (files) => {
71
+ if (files.length) {
72
+ const file_path = URL.createObjectURL(files[0]);
73
+ dropFile.value = files[0];
74
+ dropFileLink.value = file_path;
75
+ }
76
+ };
77
+ debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
78
+ const __VLS_modelEmit = defineEmits();
79
+ const __VLS_ctx = {
80
+ ...{},
81
+ ...{},
82
+ ...{},
83
+ ...{},
84
+ ...{},
85
+ };
86
+ let __VLS_elements;
87
+ let __VLS_components;
88
+ let __VLS_directives;
89
+ if (__VLS_ctx.showDropzone) {
90
+ // @ts-ignore
91
+ [showDropzone,];
92
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
93
+ ...{ onDragover: (...[$event]) => {
94
+ if (!(__VLS_ctx.showDropzone))
95
+ return;
96
+ __VLS_ctx.isHover = true;
97
+ // @ts-ignore
98
+ [isHover,];
99
+ } },
100
+ ...{ onDragleave: (...[$event]) => {
101
+ if (!(__VLS_ctx.showDropzone))
102
+ return;
103
+ __VLS_ctx.isHover = false;
104
+ // @ts-ignore
105
+ [isHover,];
106
+ } },
107
+ ...{ onDrop: (__VLS_ctx.onDrop) },
108
+ ...{ class: "dropzone" },
109
+ ...{ class: ({ hover: __VLS_ctx.isHover }) },
110
+ });
111
+ // @ts-ignore
112
+ [isHover, onDrop,];
113
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
114
+ ...{ class: "dropzone_border" },
115
+ });
116
+ __VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({
117
+ ...{ class: "text-chat-haze-500 text-xl font-medium" },
118
+ });
119
+ }
120
+ /** @type {__VLS_StyleScopedClasses['dropzone']} */ ;
121
+ /** @type {__VLS_StyleScopedClasses['hover']} */ ;
122
+ /** @type {__VLS_StyleScopedClasses['dropzone_border']} */ ;
123
+ /** @type {__VLS_StyleScopedClasses['text-chat-haze-500']} */ ;
124
+ /** @type {__VLS_StyleScopedClasses['text-xl']} */ ;
125
+ /** @type {__VLS_StyleScopedClasses['font-medium']} */ ;
126
+ const __VLS_export = (await import('vue')).defineComponent({
127
+ __typeEmits: {},
128
+ __typeProps: {},
129
+ });
130
+ export default {};
@@ -10,6 +10,7 @@ declare const _default: import("vue").DefineComponent<Props, {
10
10
  getData: (data?: any) => Promise<void>;
11
11
  handleGetMessage: (option?: {
12
12
  resetList?: boolean | undefined;
13
+ is_mqtt?: boolean | undefined;
13
14
  } | undefined) => Promise<void>;
14
15
  infoUser: import("vue").ShallowRef<IResUser | null>;
15
16
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {