@phonghq/go-chat 1.0.47 → 1.0.48

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,
@@ -4,6 +4,7 @@ import DrawerBaseCustom from '../../../components/common/drawer/DrawerBaseCustom
4
4
  import { responsiveObserver } from '../../../composable/useListentEvent';
5
5
  import PhoneNumpad from '../../../views/home/phone-numpad/PhoneNumpad.vue';
6
6
  const emit = defineEmits();
7
+ const props = withDefaults(defineProps(), {});
7
8
  const drawerVisibleRef = ref();
8
9
  const phoneNumpadRef = ref();
9
10
  const openPhoneNumpad = () => {
@@ -16,6 +17,7 @@ const handleCall = (data) => {
16
17
  const __VLS_exposed = { openPhoneNumpad };
17
18
  defineExpose(__VLS_exposed);
18
19
  debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
20
+ const __VLS_defaults = {};
19
21
  const __VLS_ctx = {
20
22
  ...{},
21
23
  ...{},
@@ -35,18 +37,22 @@ if (__VLS_ctx.responsiveObserver == 'window') {
35
37
  ...{ 'onCall': {} },
36
38
  ...{ class: "bg-white shrink-0 border-l layout-border" },
37
39
  modelValue: "",
40
+ hideNumpad: (__VLS_ctx.hideNumpad),
41
+ responsive: (__VLS_ctx.responsive),
38
42
  }));
39
43
  const __VLS_1 = __VLS_0({
40
44
  ...{ 'onCall': {} },
41
45
  ...{ class: "bg-white shrink-0 border-l layout-border" },
42
46
  modelValue: "",
47
+ hideNumpad: (__VLS_ctx.hideNumpad),
48
+ responsive: (__VLS_ctx.responsive),
43
49
  }, ...__VLS_functionalComponentArgsRest(__VLS_0));
44
50
  let __VLS_3;
45
51
  let __VLS_4;
46
52
  const __VLS_5 = ({ call: {} },
47
53
  { onCall: (__VLS_ctx.handleCall) });
48
54
  // @ts-ignore
49
- [handleCall,];
55
+ [hideNumpad, responsive, handleCall,];
50
56
  var __VLS_2;
51
57
  }
52
58
  if (__VLS_ctx.responsiveObserver != 'window') {
@@ -79,12 +85,16 @@ if (__VLS_ctx.responsiveObserver != 'window') {
79
85
  ...{ 'onBack': {} },
80
86
  ref: "phoneNumpadRef",
81
87
  ...{ class: "bg-white grow border-l layout-border w-full" },
88
+ hideNumpad: (__VLS_ctx.hideNumpad),
89
+ responsive: (__VLS_ctx.responsive),
82
90
  }));
83
91
  const __VLS_15 = __VLS_14({
84
92
  ...{ 'onCall': {} },
85
93
  ...{ 'onBack': {} },
86
94
  ref: "phoneNumpadRef",
87
95
  ...{ class: "bg-white grow border-l layout-border w-full" },
96
+ hideNumpad: (__VLS_ctx.hideNumpad),
97
+ responsive: (__VLS_ctx.responsive),
88
98
  }, ...__VLS_functionalComponentArgsRest(__VLS_14));
89
99
  let __VLS_17;
90
100
  let __VLS_18;
@@ -96,7 +106,7 @@ if (__VLS_ctx.responsiveObserver != 'window') {
96
106
  return;
97
107
  __VLS_ctx.drawerVisibleRef?.close();
98
108
  // @ts-ignore
99
- [handleCall, drawerVisibleRef,];
109
+ [hideNumpad, responsive, handleCall, drawerVisibleRef,];
100
110
  } });
101
111
  /** @type {typeof __VLS_ctx.phoneNumpadRef} */ ;
102
112
  var __VLS_21 = {};
@@ -123,5 +133,7 @@ var __VLS_11 = __VLS_10, __VLS_22 = __VLS_21;
123
133
  const __VLS_export = (await import('vue')).defineComponent({
124
134
  setup: () => (__VLS_exposed),
125
135
  __typeEmits: {},
136
+ __typeProps: {},
137
+ props: {},
126
138
  });
127
139
  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.48",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist"