@phonghq/go-chat 1.0.47 → 1.0.49

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.
@@ -796,12 +796,16 @@ else {
796
796
  const __VLS_117 = __VLS_asFunctionalComponent(PhoneNumpad, new PhoneNumpad({
797
797
  ...{ 'onCall': {} },
798
798
  ref: "phoneNumpadRef",
799
+ hideNumpad: (__VLS_ctx.isLib),
800
+ responsive: (__VLS_ctx.responsiveRender),
799
801
  ...{ class: "bg-white shrink-0 border-l layout-border" },
800
802
  modelValue: "",
801
803
  }));
802
804
  const __VLS_118 = __VLS_117({
803
805
  ...{ 'onCall': {} },
804
806
  ref: "phoneNumpadRef",
807
+ hideNumpad: (__VLS_ctx.isLib),
808
+ responsive: (__VLS_ctx.responsiveRender),
805
809
  ...{ class: "bg-white shrink-0 border-l layout-border" },
806
810
  modelValue: "",
807
811
  }, ...__VLS_functionalComponentArgsRest(__VLS_117));
@@ -812,7 +816,7 @@ else {
812
816
  /** @type {typeof __VLS_ctx.phoneNumpadRef} */ ;
813
817
  var __VLS_123 = {};
814
818
  // @ts-ignore
815
- [handleCall, phoneNumpadRef,];
819
+ [isLib, responsiveRender, handleCall, phoneNumpadRef,];
816
820
  var __VLS_119;
817
821
  }
818
822
  /** @type {__VLS_StyleScopedClasses['go-chat-main']} */ ;
@@ -2,7 +2,7 @@
2
2
  import HomeHeader from '../../../chat/page/home/HomeHeader.vue';
3
3
  import NewCustomer from '../../../chat/page/home/NewCustomer.vue';
4
4
  import InputChat from '../../../chat/page/home/InputChat.vue';
5
- import { getDetailReceiver, getMessage, sendMessage, upLoadImage } from '../../../utils/chat/store/message';
5
+ import { getDetailReceiver, getMessage, sendMessage, sendMessageSmsTest, upLoadImage } from '../../../utils/chat/store/message';
6
6
  import { computed, nextTick, onMounted, onUnmounted, ref, shallowRef } from 'vue';
7
7
  import ChatMessage from '../../../chat/page/home/ChatMessage.vue';
8
8
  import { addHandleMqttMessage, connectMqtt, publishMessage, removeHandleMqttMessage, subscribeToTopic, unsubscribeFromTopic } from '../../../plugins/mqtt';
@@ -10,6 +10,7 @@ import { TOPIC_DETAIL_CHAT, TOPIC_PLIVO_SMS } from '../../../constant/mqtt';
10
10
  import { MessageState } from '../../../constant/message';
11
11
  import { publicTopicConversationUpdate } from '../../../utils/chat/store/conversation';
12
12
  import { getCache, removeOldestCache, setCache } from '../../../utils/chat/cache';
13
+ import { dataProfile } from '../../../utils/chat/store/auth';
13
14
  import { digibotId } from '../../../composable/useDigibot';
14
15
  const props = withDefaults(defineProps(), {});
15
16
  const emit = defineEmits();
@@ -163,7 +164,17 @@ const handleSendMessage = async (data) => {
163
164
  if (file_upload?.length) {
164
165
  formData.append('url', file_upload[0]?.url ?? '');
165
166
  }
166
- await sendMessage(formData);
167
+ if (dataProfile.value?.user_type == 'tenant') {
168
+ await sendMessage(formData);
169
+ }
170
+ else {
171
+ await sendMessageSmsTest({
172
+ from: dataProfile.value?.phone ?? '',
173
+ to: infoUser.value?.phone ?? '',
174
+ host_id: infoUser.value?.tenant_id ?? '',
175
+ text: data.message ?? ''
176
+ });
177
+ }
167
178
  publishMessage(topic, {
168
179
  ...data,
169
180
  state: MessageState.Sent,
@@ -1,9 +1,9 @@
1
1
  /// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
2
  import { ref } from 'vue';
3
3
  import DrawerBaseCustom from '../../../components/common/drawer/DrawerBaseCustom.vue';
4
- import { responsiveObserver } from '../../../composable/useListentEvent';
5
4
  import PhoneNumpad from '../../../views/home/phone-numpad/PhoneNumpad.vue';
6
5
  const emit = defineEmits();
6
+ const props = withDefaults(defineProps(), {});
7
7
  const drawerVisibleRef = ref();
8
8
  const phoneNumpadRef = ref();
9
9
  const openPhoneNumpad = () => {
@@ -16,6 +16,7 @@ const handleCall = (data) => {
16
16
  const __VLS_exposed = { openPhoneNumpad };
17
17
  defineExpose(__VLS_exposed);
18
18
  debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
19
+ const __VLS_defaults = {};
19
20
  const __VLS_ctx = {
20
21
  ...{},
21
22
  ...{},
@@ -26,32 +27,36 @@ const __VLS_ctx = {
26
27
  let __VLS_elements;
27
28
  let __VLS_components;
28
29
  let __VLS_directives;
29
- if (__VLS_ctx.responsiveObserver == 'window') {
30
+ if (__VLS_ctx.responsive == 'window') {
30
31
  // @ts-ignore
31
- [responsiveObserver,];
32
+ [responsive,];
32
33
  /** @type {[typeof PhoneNumpad, ]} */ ;
33
34
  // @ts-ignore
34
35
  const __VLS_0 = __VLS_asFunctionalComponent(PhoneNumpad, new PhoneNumpad({
35
36
  ...{ 'onCall': {} },
36
37
  ...{ class: "bg-white shrink-0 border-l layout-border" },
37
38
  modelValue: "",
39
+ hideNumpad: (__VLS_ctx.hideNumpad),
40
+ responsive: (__VLS_ctx.responsive),
38
41
  }));
39
42
  const __VLS_1 = __VLS_0({
40
43
  ...{ 'onCall': {} },
41
44
  ...{ class: "bg-white shrink-0 border-l layout-border" },
42
45
  modelValue: "",
46
+ hideNumpad: (__VLS_ctx.hideNumpad),
47
+ responsive: (__VLS_ctx.responsive),
43
48
  }, ...__VLS_functionalComponentArgsRest(__VLS_0));
44
49
  let __VLS_3;
45
50
  let __VLS_4;
46
51
  const __VLS_5 = ({ call: {} },
47
52
  { onCall: (__VLS_ctx.handleCall) });
48
53
  // @ts-ignore
49
- [handleCall,];
54
+ [responsive, hideNumpad, handleCall,];
50
55
  var __VLS_2;
51
56
  }
52
- if (__VLS_ctx.responsiveObserver != 'window') {
57
+ if (__VLS_ctx.responsive != 'window') {
53
58
  // @ts-ignore
54
- [responsiveObserver,];
59
+ [responsive,];
55
60
  /** @type {[typeof DrawerBaseCustom, typeof DrawerBaseCustom, ]} */ ;
56
61
  // @ts-ignore
57
62
  const __VLS_7 = __VLS_asFunctionalComponent(DrawerBaseCustom, new DrawerBaseCustom({
@@ -79,12 +84,16 @@ if (__VLS_ctx.responsiveObserver != 'window') {
79
84
  ...{ 'onBack': {} },
80
85
  ref: "phoneNumpadRef",
81
86
  ...{ class: "bg-white grow border-l layout-border w-full" },
87
+ hideNumpad: (__VLS_ctx.hideNumpad),
88
+ responsive: (__VLS_ctx.responsive),
82
89
  }));
83
90
  const __VLS_15 = __VLS_14({
84
91
  ...{ 'onCall': {} },
85
92
  ...{ 'onBack': {} },
86
93
  ref: "phoneNumpadRef",
87
94
  ...{ class: "bg-white grow border-l layout-border w-full" },
95
+ hideNumpad: (__VLS_ctx.hideNumpad),
96
+ responsive: (__VLS_ctx.responsive),
88
97
  }, ...__VLS_functionalComponentArgsRest(__VLS_14));
89
98
  let __VLS_17;
90
99
  let __VLS_18;
@@ -92,11 +101,11 @@ if (__VLS_ctx.responsiveObserver != 'window') {
92
101
  { onCall: (__VLS_ctx.handleCall) });
93
102
  const __VLS_20 = ({ back: {} },
94
103
  { onBack: (...[$event]) => {
95
- if (!(__VLS_ctx.responsiveObserver != 'window'))
104
+ if (!(__VLS_ctx.responsive != 'window'))
96
105
  return;
97
106
  __VLS_ctx.drawerVisibleRef?.close();
98
107
  // @ts-ignore
99
- [handleCall, drawerVisibleRef,];
108
+ [responsive, hideNumpad, handleCall, drawerVisibleRef,];
100
109
  } });
101
110
  /** @type {typeof __VLS_ctx.phoneNumpadRef} */ ;
102
111
  var __VLS_21 = {};
@@ -123,5 +132,7 @@ var __VLS_11 = __VLS_10, __VLS_22 = __VLS_21;
123
132
  const __VLS_export = (await import('vue')).defineComponent({
124
133
  setup: () => (__VLS_exposed),
125
134
  __typeEmits: {},
135
+ __typeProps: {},
136
+ props: {},
126
137
  });
127
138
  export default {};
@@ -104,18 +104,24 @@ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
104
104
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
105
105
  ...{ class: "flex items-center justify-between border-chat-gray-5 layout-shadow border-b px-2 sm:px-6" },
106
106
  });
107
- __VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
108
- ...{ onClick: (...[$event]) => {
109
- __VLS_ctx.emit('back');
110
- // @ts-ignore
111
- [emit,];
112
- } },
113
- ...{ class: "flex justify-center w-14 sm:hidden" },
114
- });
115
- /** @type {[typeof IconArrowLeft, ]} */ ;
116
- // @ts-ignore
117
- const __VLS_0 = __VLS_asFunctionalComponent(IconArrowLeft, new IconArrowLeft({}));
118
- const __VLS_1 = __VLS_0({}, ...__VLS_functionalComponentArgsRest(__VLS_0));
107
+ if (__VLS_ctx.responsive != 'window') {
108
+ // @ts-ignore
109
+ [responsive,];
110
+ __VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
111
+ ...{ onClick: (...[$event]) => {
112
+ if (!(__VLS_ctx.responsive != 'window'))
113
+ return;
114
+ __VLS_ctx.emit('back');
115
+ // @ts-ignore
116
+ [emit,];
117
+ } },
118
+ ...{ class: "flex justify-center w-14" },
119
+ });
120
+ /** @type {[typeof IconArrowLeft, ]} */ ;
121
+ // @ts-ignore
122
+ const __VLS_0 = __VLS_asFunctionalComponent(IconArrowLeft, new IconArrowLeft({}));
123
+ const __VLS_1 = __VLS_0({}, ...__VLS_functionalComponentArgsRest(__VLS_0));
124
+ }
119
125
  __VLS_asFunctionalElement(__VLS_elements.input)({
120
126
  ...{ onInput: (__VLS_ctx.handleInput) },
121
127
  ...{ class: "py-2 h-[80px] sm:h-[96px] text-xl grow" },
@@ -222,7 +228,6 @@ if (!__VLS_ctx.hideNumpad) {
222
228
  /** @type {__VLS_StyleScopedClasses['flex']} */ ;
223
229
  /** @type {__VLS_StyleScopedClasses['justify-center']} */ ;
224
230
  /** @type {__VLS_StyleScopedClasses['w-14']} */ ;
225
- /** @type {__VLS_StyleScopedClasses['sm:hidden']} */ ;
226
231
  /** @type {__VLS_StyleScopedClasses['py-2']} */ ;
227
232
  /** @type {__VLS_StyleScopedClasses['h-[80px]']} */ ;
228
233
  /** @type {__VLS_StyleScopedClasses['sm:h-[96px]']} */ ;
@@ -1,7 +1,9 @@
1
1
  import type { IResUser } from '../../../types/message';
2
+ import type { PAGE_RESPONSIVE } from '../../../types/chat/global';
2
3
  type KeyPadProps = {
3
4
  disabled?: boolean;
4
5
  hideNumpad?: boolean;
6
+ responsive?: PAGE_RESPONSIVE;
5
7
  };
6
8
  type __VLS_Props = KeyPadProps;
7
9
  type __VLS_ModelProps = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phonghq/go-chat",
3
- "version": "1.0.47",
3
+ "version": "1.0.49",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist"