@phonghq/go-chat 1.0.74 → 1.0.75
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.
- package/dist/assets/icons/chat/IconCopy.vue.d.ts +2 -0
- package/dist/assets/icons/chat/IconCopy.vue.js +22 -0
- package/dist/assets/icons/chat/IconMenuDot.vue.js +2 -2
- package/dist/assets/icons/chat/IconResend.vue.d.ts +2 -0
- package/dist/assets/icons/chat/IconResend.vue.js +48 -0
- package/dist/chat/App.vue.js +7 -7
- package/dist/chat/page/home/ChatMessage.vue.d.ts +2 -0
- package/dist/chat/page/home/ChatMessage.vue.js +8 -2
- package/dist/chat/page/home/ChatMessageItem.vue.d.ts +2 -0
- package/dist/chat/page/home/ChatMessageItem.vue.js +138 -11
- package/dist/chat/page/home/Home.vue.js +59 -44
- package/dist/chat/page/home/InputChat.vue.d.ts +3 -0
- package/dist/chat/page/home/InputChat.vue.js +6 -6
- package/dist/chat/page/home/header/DropdownInfo.vue.d.ts +6 -0
- package/dist/chat/page/home/header/DropdownInfo.vue.js +137 -0
- package/dist/chat/page/home/{HomeHeader.vue.d.ts → header/HomeHeader.vue.d.ts} +2 -2
- package/dist/chat/page/home/{HomeHeader.vue.js → header/HomeHeader.vue.js} +35 -147
- package/dist/components/chat/ScrollEvent/ScrollEvent.vue.js +4 -2
- package/dist/components/chat/common/popover/PopoverBase.vue.d.ts +2 -0
- package/dist/components/chat/common/popover/PopoverBase.vue.js +5 -1
- package/dist/components/ui/popover/PopoverContent.vue.js +6 -2
- package/dist/go-chat.es.js +9197 -9082
- package/dist/go-chat.umd.js +19 -19
- package/dist/plugins/axios.js +2 -2
- package/dist/style.css +1 -1
- 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: "M3 16V4C3 2.89543 3.89543 2 5 2H15M9 22H18C19.1046 22 20 21.1046 20 20V8C20 6.89543 19.1046 6 18 6H9C7.89543 6 7 6.89543 7 8V20C7 21.1046 7.89543 22 9 22Z",
|
|
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 {};
|
|
@@ -6,8 +6,8 @@ let __VLS_components;
|
|
|
6
6
|
let __VLS_directives;
|
|
7
7
|
__VLS_asFunctionalElement(__VLS_elements.svg, __VLS_elements.svg)({
|
|
8
8
|
fill: "#000000",
|
|
9
|
-
width: "
|
|
10
|
-
height: "
|
|
9
|
+
width: "20",
|
|
10
|
+
height: "20",
|
|
11
11
|
viewBox: "0 0 32 32",
|
|
12
12
|
'enable-background': "new 0 0 32 32",
|
|
13
13
|
id: "Glyph",
|
|
@@ -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,48 @@
|
|
|
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
|
+
version: "1.1",
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13
|
+
'xmlns:xlink': "http://www.w3.org/1999/xlink",
|
|
14
|
+
});
|
|
15
|
+
__VLS_asFunctionalElement(__VLS_elements.g, __VLS_elements.g)({
|
|
16
|
+
id: "Page-1",
|
|
17
|
+
stroke: "none",
|
|
18
|
+
'stroke-width': "1",
|
|
19
|
+
fill: "none",
|
|
20
|
+
'fill-rule': "evenodd",
|
|
21
|
+
});
|
|
22
|
+
__VLS_asFunctionalElement(__VLS_elements.g, __VLS_elements.g)({
|
|
23
|
+
id: "Reload",
|
|
24
|
+
});
|
|
25
|
+
__VLS_asFunctionalElement(__VLS_elements.rect, __VLS_elements.rect)({
|
|
26
|
+
id: "Rectangle",
|
|
27
|
+
'fill-rule': "nonzero",
|
|
28
|
+
x: "0",
|
|
29
|
+
y: "0",
|
|
30
|
+
width: "24",
|
|
31
|
+
height: "24",
|
|
32
|
+
});
|
|
33
|
+
__VLS_asFunctionalElement(__VLS_elements.path, __VLS_elements.path)({
|
|
34
|
+
d: "M4,13 C4,17.4183 7.58172,21 12,21 C16.4183,21 20,17.4183 20,13 C20,8.58172 16.4183,5 12,5 C10.4407,5 8.98566,5.44609 7.75543,6.21762",
|
|
35
|
+
id: "Path",
|
|
36
|
+
stroke: "currentColor",
|
|
37
|
+
'stroke-width': "2",
|
|
38
|
+
'stroke-linecap': "round",
|
|
39
|
+
});
|
|
40
|
+
__VLS_asFunctionalElement(__VLS_elements.path, __VLS_elements.path)({
|
|
41
|
+
d: "M9.2384,1.89795 L7.49856,5.83917 C7.27552,6.34441 7.50429,6.9348 8.00954,7.15784 L11.9508,8.89768",
|
|
42
|
+
id: "Path",
|
|
43
|
+
stroke: "currentColor",
|
|
44
|
+
'stroke-width': "2",
|
|
45
|
+
'stroke-linecap': "round",
|
|
46
|
+
});
|
|
47
|
+
const __VLS_export = (await import('vue')).defineComponent({});
|
|
48
|
+
export default {};
|
package/dist/chat/App.vue.js
CHANGED
|
@@ -541,10 +541,10 @@ else {
|
|
|
541
541
|
var __VLS_45;
|
|
542
542
|
}
|
|
543
543
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
544
|
-
...{ class: "relative flex
|
|
544
|
+
...{ class: "relative flex grow h-full overflow-hidden" },
|
|
545
545
|
...{ class: ({
|
|
546
546
|
'': __VLS_ctx.responsiveRender != 'mobile',
|
|
547
|
-
'grow flex-col mx-auto bg-[#F9FAFC]
|
|
547
|
+
'grow flex-col mx-auto bg-[#F9FAFC] chat-mobile': __VLS_ctx.responsiveRender == 'mobile'
|
|
548
548
|
}) },
|
|
549
549
|
});
|
|
550
550
|
// @ts-ignore
|
|
@@ -564,7 +564,7 @@ else {
|
|
|
564
564
|
ref: "chatListRef",
|
|
565
565
|
...{ class: "" },
|
|
566
566
|
...{ class: ({
|
|
567
|
-
'w-[38%] max-w-[500px] min-w-[
|
|
567
|
+
'w-[38%] max-w-[500px] min-w-[350px] xl:min-w-[450px] border-r layout-border': __VLS_ctx.responsiveRender != 'mobile',
|
|
568
568
|
'w-full max-w-[500px] !bg-[#F9FAFC]': __VLS_ctx.responsiveRender == 'mobile'
|
|
569
569
|
}) },
|
|
570
570
|
responsive: (__VLS_ctx.responsiveRender),
|
|
@@ -577,7 +577,7 @@ else {
|
|
|
577
577
|
ref: "chatListRef",
|
|
578
578
|
...{ class: "" },
|
|
579
579
|
...{ class: ({
|
|
580
|
-
'w-[38%] max-w-[500px] min-w-[
|
|
580
|
+
'w-[38%] max-w-[500px] min-w-[350px] xl:min-w-[450px] border-r layout-border': __VLS_ctx.responsiveRender != 'mobile',
|
|
581
581
|
'w-full max-w-[500px] !bg-[#F9FAFC]': __VLS_ctx.responsiveRender == 'mobile'
|
|
582
582
|
}) },
|
|
583
583
|
responsive: (__VLS_ctx.responsiveRender),
|
|
@@ -870,20 +870,20 @@ else {
|
|
|
870
870
|
/** @type {__VLS_StyleScopedClasses['relative']} */ ;
|
|
871
871
|
/** @type {__VLS_StyleScopedClasses['relative']} */ ;
|
|
872
872
|
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
873
|
-
/** @type {__VLS_StyleScopedClasses['
|
|
873
|
+
/** @type {__VLS_StyleScopedClasses['grow']} */ ;
|
|
874
874
|
/** @type {__VLS_StyleScopedClasses['h-full']} */ ;
|
|
875
|
+
/** @type {__VLS_StyleScopedClasses['overflow-hidden']} */ ;
|
|
875
876
|
/** @type {__VLS_StyleScopedClasses['grow']} */ ;
|
|
876
877
|
/** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
|
|
877
878
|
/** @type {__VLS_StyleScopedClasses['mx-auto']} */ ;
|
|
878
879
|
/** @type {__VLS_StyleScopedClasses['bg-[#F9FAFC]']} */ ;
|
|
879
|
-
/** @type {__VLS_StyleScopedClasses['overflow-hidden']} */ ;
|
|
880
880
|
/** @type {__VLS_StyleScopedClasses['chat-mobile']} */ ;
|
|
881
881
|
/** @type {__VLS_StyleScopedClasses['grow']} */ ;
|
|
882
882
|
/** @type {__VLS_StyleScopedClasses['overflow-hidden']} */ ;
|
|
883
883
|
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
884
884
|
/** @type {__VLS_StyleScopedClasses['w-[38%]']} */ ;
|
|
885
885
|
/** @type {__VLS_StyleScopedClasses['max-w-[500px]']} */ ;
|
|
886
|
-
/** @type {__VLS_StyleScopedClasses['min-w-[
|
|
886
|
+
/** @type {__VLS_StyleScopedClasses['min-w-[350px]']} */ ;
|
|
887
887
|
/** @type {__VLS_StyleScopedClasses['xl:min-w-[450px]']} */ ;
|
|
888
888
|
/** @type {__VLS_StyleScopedClasses['border-r']} */ ;
|
|
889
889
|
/** @type {__VLS_StyleScopedClasses['layout-border']} */ ;
|
|
@@ -13,9 +13,11 @@ declare const _default: import("vue").DefineComponent<Props, {
|
|
|
13
13
|
fixedScroll: () => void;
|
|
14
14
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
15
15
|
scrollTop: () => any;
|
|
16
|
+
resend: (data: IResMessage) => any;
|
|
16
17
|
callBack: () => any;
|
|
17
18
|
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
18
19
|
onScrollTop?: (() => any) | undefined;
|
|
20
|
+
onResend?: ((data: IResMessage) => any) | undefined;
|
|
19
21
|
onCallBack?: (() => any) | undefined;
|
|
20
22
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
23
|
export default _default;
|
|
@@ -148,8 +148,8 @@ for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.message))) {
|
|
|
148
148
|
// @ts-ignore
|
|
149
149
|
const __VLS_18 = __VLS_asFunctionalComponent(ChatMessageItem, new ChatMessageItem({
|
|
150
150
|
...{ 'onCallAgain': {} },
|
|
151
|
+
...{ 'onResend': {} },
|
|
151
152
|
message: (item),
|
|
152
|
-
index: (index),
|
|
153
153
|
responsive: (__VLS_ctx.responsive),
|
|
154
154
|
isMyMessage: (item.sender_id == __VLS_ctx.dataProfile?.id),
|
|
155
155
|
data: (__VLS_ctx.data),
|
|
@@ -162,8 +162,8 @@ for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.message))) {
|
|
|
162
162
|
}));
|
|
163
163
|
const __VLS_19 = __VLS_18({
|
|
164
164
|
...{ 'onCallAgain': {} },
|
|
165
|
+
...{ 'onResend': {} },
|
|
165
166
|
message: (item),
|
|
166
|
-
index: (index),
|
|
167
167
|
responsive: (__VLS_ctx.responsive),
|
|
168
168
|
isMyMessage: (item.sender_id == __VLS_ctx.dataProfile?.id),
|
|
169
169
|
data: (__VLS_ctx.data),
|
|
@@ -182,6 +182,12 @@ for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.message))) {
|
|
|
182
182
|
// @ts-ignore
|
|
183
183
|
[data, message, responsive, dataProfile, shouldShowAvatar, isEndMessage, isChatFinished, isChatStart, isStartNewDate, emit,];
|
|
184
184
|
} });
|
|
185
|
+
const __VLS_24 = ({ resend: {} },
|
|
186
|
+
{ onResend: (...[$event]) => {
|
|
187
|
+
__VLS_ctx.emit('resend', item);
|
|
188
|
+
// @ts-ignore
|
|
189
|
+
[emit,];
|
|
190
|
+
} });
|
|
185
191
|
var __VLS_20;
|
|
186
192
|
}
|
|
187
193
|
var __VLS_16;
|
|
@@ -14,7 +14,9 @@ type Props = {
|
|
|
14
14
|
};
|
|
15
15
|
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
16
16
|
callAgain: () => any;
|
|
17
|
+
resend: () => any;
|
|
17
18
|
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
18
19
|
onCallAgain?: (() => any) | undefined;
|
|
20
|
+
onResend?: (() => any) | undefined;
|
|
19
21
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
22
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
2
|
import Avatar from '../../../components/chat/customer/Avatar.vue';
|
|
3
|
-
import { computed, nextTick } from 'vue';
|
|
3
|
+
import { computed, nextTick, ref } from 'vue';
|
|
4
4
|
import { MessageState } from '../../../constant/message';
|
|
5
5
|
import IconPhoneCancel from '../../../assets/icons/call/IconPhoneCancel.vue';
|
|
6
6
|
import { PLIVO_CALL_STATUS } from '../../../types/chat/call';
|
|
@@ -10,7 +10,11 @@ import { DATE_FORMATS } from '../../../constant/datetime';
|
|
|
10
10
|
import utc from 'dayjs/plugin/utc';
|
|
11
11
|
import timezone from 'dayjs/plugin/timezone';
|
|
12
12
|
import { getTimeLocal } from '../../../utils/dayjs-helper';
|
|
13
|
-
|
|
13
|
+
import IconMenuDot from '../../../assets/icons/chat/IconMenuDot.vue';
|
|
14
|
+
import IconResend from '../../../assets/icons/chat/IconResend.vue';
|
|
15
|
+
import IconCopy from '../../../assets/icons/chat/IconCopy.vue';
|
|
16
|
+
import PopoverBase from '../../../components/chat/common/popover/PopoverBase.vue';
|
|
17
|
+
import { userHistory } from '../../../utils/chat/store/user';
|
|
14
18
|
dayjs.extend(utc);
|
|
15
19
|
dayjs.extend(timezone);
|
|
16
20
|
const props = withDefaults(defineProps(), {});
|
|
@@ -43,6 +47,33 @@ const callTitle = computed(() => {
|
|
|
43
47
|
}
|
|
44
48
|
return '';
|
|
45
49
|
});
|
|
50
|
+
const popoverContent = computed(() => {
|
|
51
|
+
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
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return result;
|
|
75
|
+
});
|
|
76
|
+
const popoverOpen = ref(false);
|
|
46
77
|
const scrollBottom = () => {
|
|
47
78
|
nextTick(() => {
|
|
48
79
|
const eleIdContentChat = document.getElementById('content-chat');
|
|
@@ -83,6 +114,16 @@ const getStartDate = (time) => {
|
|
|
83
114
|
}
|
|
84
115
|
return getTimeLocal(time)?.format(DATE_FORMATS['DATE_FORMAT_MEDIUM']) ?? '';
|
|
85
116
|
};
|
|
117
|
+
const copyToClipboard = async (text) => {
|
|
118
|
+
try {
|
|
119
|
+
await navigator.clipboard.writeText(text);
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
console.error('Copy failed:', error);
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
86
127
|
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
87
128
|
const __VLS_defaults = {};
|
|
88
129
|
const __VLS_ctx = {
|
|
@@ -112,7 +153,7 @@ if (__VLS_ctx.isStartNewDate) {
|
|
|
112
153
|
[getStartDate, message,];
|
|
113
154
|
}
|
|
114
155
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
115
|
-
...{ class: "flex items-end mt-1 relative" },
|
|
156
|
+
...{ class: "flex items-end mt-1 relative group" },
|
|
116
157
|
...{ class: ({
|
|
117
158
|
'mt-2': __VLS_ctx.shouldShowAvatar,
|
|
118
159
|
'flex-col justify-end pl-[60px]': __VLS_ctx.isMyMessage,
|
|
@@ -172,7 +213,7 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
|
|
|
172
213
|
}
|
|
173
214
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({});
|
|
174
215
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
175
|
-
...{ class: "px-3 py-2 rounded-2xl text-left w-max relative
|
|
216
|
+
...{ class: "px-3 py-2 rounded-2xl text-left w-max relative" },
|
|
176
217
|
...{ class: ({
|
|
177
218
|
'rounded-tl-[6px]': !__VLS_ctx.isChatStart && !__VLS_ctx.isMyMessage,
|
|
178
219
|
'rounded-bl-[6px]': !__VLS_ctx.isChatFinished && !__VLS_ctx.isMyMessage,
|
|
@@ -189,6 +230,72 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
|
|
|
189
230
|
});
|
|
190
231
|
// @ts-ignore
|
|
191
232
|
[message, message, message, message, message, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, responsive, responsive, isChatStart, isChatStart, isChatFinished, isChatFinished,];
|
|
233
|
+
if (__VLS_ctx.popoverContent.length) {
|
|
234
|
+
// @ts-ignore
|
|
235
|
+
[popoverContent,];
|
|
236
|
+
/** @type {[typeof PopoverBase, typeof PopoverBase, ]} */ ;
|
|
237
|
+
// @ts-ignore
|
|
238
|
+
const __VLS_4 = __VLS_asFunctionalComponent(PopoverBase, new PopoverBase({
|
|
239
|
+
open: (__VLS_ctx.popoverOpen),
|
|
240
|
+
trigger: "click",
|
|
241
|
+
side: "top",
|
|
242
|
+
align: (__VLS_ctx.isMyMessage ? 'end' : 'start'),
|
|
243
|
+
...{ 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",
|
|
246
|
+
}));
|
|
247
|
+
const __VLS_5 = __VLS_4({
|
|
248
|
+
open: (__VLS_ctx.popoverOpen),
|
|
249
|
+
trigger: "click",
|
|
250
|
+
side: "top",
|
|
251
|
+
align: (__VLS_ctx.isMyMessage ? 'end' : 'start'),
|
|
252
|
+
...{ 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",
|
|
255
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_4));
|
|
256
|
+
const { default: __VLS_7 } = __VLS_6.slots;
|
|
257
|
+
// @ts-ignore
|
|
258
|
+
[isMyMessage, isMyMessage, popoverOpen,];
|
|
259
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
260
|
+
...{ class: "" },
|
|
261
|
+
});
|
|
262
|
+
/** @type {[typeof IconMenuDot, ]} */ ;
|
|
263
|
+
// @ts-ignore
|
|
264
|
+
const __VLS_8 = __VLS_asFunctionalComponent(IconMenuDot, new IconMenuDot({}));
|
|
265
|
+
const __VLS_9 = __VLS_8({}, ...__VLS_functionalComponentArgsRest(__VLS_8));
|
|
266
|
+
{
|
|
267
|
+
const { content: __VLS_12 } = __VLS_6.slots;
|
|
268
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
269
|
+
...{ class: "flex bg-chat-primary-dark text-chat-text rounded-xl py-2" },
|
|
270
|
+
});
|
|
271
|
+
for (const [item, i] of __VLS_getVForSourceType((__VLS_ctx.popoverContent))) {
|
|
272
|
+
// @ts-ignore
|
|
273
|
+
[popoverContent,];
|
|
274
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
275
|
+
...{ onClick: (...[$event]) => {
|
|
276
|
+
if (!(__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyMessage))
|
|
277
|
+
return;
|
|
278
|
+
if (!(__VLS_ctx.popoverContent.length))
|
|
279
|
+
return;
|
|
280
|
+
item.click?.();
|
|
281
|
+
} },
|
|
282
|
+
...{ class: "flex items-center flex-col w-[70px] text-white duration-200 cursor-pointer border-r last:border-none" },
|
|
283
|
+
key: (i),
|
|
284
|
+
...{ class: ({ 'opacity-[0.3] pointer-events-none': item.disabled }) },
|
|
285
|
+
});
|
|
286
|
+
const __VLS_13 = ((item.icon));
|
|
287
|
+
// @ts-ignore
|
|
288
|
+
const __VLS_14 = __VLS_asFunctionalComponent(__VLS_13, new __VLS_13({
|
|
289
|
+
...{ class: "w-5 h-5" },
|
|
290
|
+
}));
|
|
291
|
+
const __VLS_15 = __VLS_14({
|
|
292
|
+
...{ class: "w-5 h-5" },
|
|
293
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_14));
|
|
294
|
+
(item.title);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
var __VLS_6;
|
|
298
|
+
}
|
|
192
299
|
if (__VLS_ctx.message.is_call == 1) {
|
|
193
300
|
// @ts-ignore
|
|
194
301
|
[message,];
|
|
@@ -203,26 +310,26 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
|
|
|
203
310
|
[message, PLIVO_CALL_STATUS,];
|
|
204
311
|
/** @type {[typeof IconPhone, ]} */ ;
|
|
205
312
|
// @ts-ignore
|
|
206
|
-
const
|
|
313
|
+
const __VLS_18 = __VLS_asFunctionalComponent(IconPhone, new IconPhone({
|
|
207
314
|
weight: (2),
|
|
208
315
|
...{ class: "w-5 h-5 text-chat-success" },
|
|
209
316
|
}));
|
|
210
|
-
const
|
|
317
|
+
const __VLS_19 = __VLS_18({
|
|
211
318
|
weight: (2),
|
|
212
319
|
...{ class: "w-5 h-5 text-chat-success" },
|
|
213
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
320
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_18));
|
|
214
321
|
}
|
|
215
322
|
else {
|
|
216
323
|
/** @type {[typeof IconPhoneCancel, ]} */ ;
|
|
217
324
|
// @ts-ignore
|
|
218
|
-
const
|
|
325
|
+
const __VLS_22 = __VLS_asFunctionalComponent(IconPhoneCancel, new IconPhoneCancel({
|
|
219
326
|
weight: (2),
|
|
220
327
|
...{ class: "w-5 h-5 text-chat-error" },
|
|
221
328
|
}));
|
|
222
|
-
const
|
|
329
|
+
const __VLS_23 = __VLS_22({
|
|
223
330
|
weight: (2),
|
|
224
331
|
...{ class: "w-5 h-5 text-chat-error" },
|
|
225
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
332
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_22));
|
|
226
333
|
}
|
|
227
334
|
__VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({
|
|
228
335
|
...{ class: "font-semibold" },
|
|
@@ -310,6 +417,8 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
|
|
|
310
417
|
}
|
|
311
418
|
}
|
|
312
419
|
/** @type {__VLS_StyleScopedClasses['']} */ ;
|
|
420
|
+
/** @type {__VLS_StyleScopedClasses['']} */ ;
|
|
421
|
+
/** @type {__VLS_StyleScopedClasses['']} */ ;
|
|
313
422
|
/** @type {__VLS_StyleScopedClasses['relative']} */ ;
|
|
314
423
|
/** @type {__VLS_StyleScopedClasses['flex-center']} */ ;
|
|
315
424
|
/** @type {__VLS_StyleScopedClasses['text-chat-haze-200']} */ ;
|
|
@@ -329,6 +438,7 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
|
|
|
329
438
|
/** @type {__VLS_StyleScopedClasses['items-end']} */ ;
|
|
330
439
|
/** @type {__VLS_StyleScopedClasses['mt-1']} */ ;
|
|
331
440
|
/** @type {__VLS_StyleScopedClasses['relative']} */ ;
|
|
441
|
+
/** @type {__VLS_StyleScopedClasses['group']} */ ;
|
|
332
442
|
/** @type {__VLS_StyleScopedClasses['mt-2']} */ ;
|
|
333
443
|
/** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
|
|
334
444
|
/** @type {__VLS_StyleScopedClasses['justify-end']} */ ;
|
|
@@ -345,7 +455,6 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
|
|
|
345
455
|
/** @type {__VLS_StyleScopedClasses['text-left']} */ ;
|
|
346
456
|
/** @type {__VLS_StyleScopedClasses['w-max']} */ ;
|
|
347
457
|
/** @type {__VLS_StyleScopedClasses['relative']} */ ;
|
|
348
|
-
/** @type {__VLS_StyleScopedClasses['group']} */ ;
|
|
349
458
|
/** @type {__VLS_StyleScopedClasses['rounded-tl-[6px]']} */ ;
|
|
350
459
|
/** @type {__VLS_StyleScopedClasses['rounded-bl-[6px]']} */ ;
|
|
351
460
|
/** @type {__VLS_StyleScopedClasses['rounded-tr-[6px]']} */ ;
|
|
@@ -361,6 +470,24 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
|
|
|
361
470
|
/** @type {__VLS_StyleScopedClasses['max-w-[280px]']} */ ;
|
|
362
471
|
/** @type {__VLS_StyleScopedClasses['max-w-[480px]']} */ ;
|
|
363
472
|
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
473
|
+
/** @type {__VLS_StyleScopedClasses['bg-chat-primary-dark']} */ ;
|
|
474
|
+
/** @type {__VLS_StyleScopedClasses['text-chat-text']} */ ;
|
|
475
|
+
/** @type {__VLS_StyleScopedClasses['rounded-xl']} */ ;
|
|
476
|
+
/** @type {__VLS_StyleScopedClasses['py-2']} */ ;
|
|
477
|
+
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
478
|
+
/** @type {__VLS_StyleScopedClasses['items-center']} */ ;
|
|
479
|
+
/** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
|
|
480
|
+
/** @type {__VLS_StyleScopedClasses['w-[70px]']} */ ;
|
|
481
|
+
/** @type {__VLS_StyleScopedClasses['text-white']} */ ;
|
|
482
|
+
/** @type {__VLS_StyleScopedClasses['duration-200']} */ ;
|
|
483
|
+
/** @type {__VLS_StyleScopedClasses['cursor-pointer']} */ ;
|
|
484
|
+
/** @type {__VLS_StyleScopedClasses['border-r']} */ ;
|
|
485
|
+
/** @type {__VLS_StyleScopedClasses['last:border-none']} */ ;
|
|
486
|
+
/** @type {__VLS_StyleScopedClasses['opacity-[0.3]']} */ ;
|
|
487
|
+
/** @type {__VLS_StyleScopedClasses['pointer-events-none']} */ ;
|
|
488
|
+
/** @type {__VLS_StyleScopedClasses['w-5']} */ ;
|
|
489
|
+
/** @type {__VLS_StyleScopedClasses['h-5']} */ ;
|
|
490
|
+
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
364
491
|
/** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
|
|
365
492
|
/** @type {__VLS_StyleScopedClasses['gap-2']} */ ;
|
|
366
493
|
/** @type {__VLS_StyleScopedClasses['w-[210px]']} */ ;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
|
-
import HomeHeader from '
|
|
2
|
+
import HomeHeader from './header/HomeHeader.vue';
|
|
3
3
|
import NewCustomer from '../../../chat/page/home/NewCustomer.vue';
|
|
4
4
|
import InputChat from '../../../chat/page/home/InputChat.vue';
|
|
5
5
|
import { getMessage, sendMessage, upLoadImage } from '../../../utils/chat/store/message';
|
|
@@ -138,7 +138,7 @@ const handleGetDetailReceiver = async (data) => {
|
|
|
138
138
|
const id = props.receiverId;
|
|
139
139
|
if (!data)
|
|
140
140
|
return;
|
|
141
|
-
infoUser.value = { ...data, conversation_id: data.id };
|
|
141
|
+
infoUser.value = { ...data, conversation_id: data.id, id: data.receiver_id };
|
|
142
142
|
// const res = (await getDetailReceiver(props.receiverId)) ?? null
|
|
143
143
|
userHistory.value = null;
|
|
144
144
|
customerLoading.value = true;
|
|
@@ -209,34 +209,42 @@ const handleSendMessage = async (data) => {
|
|
|
209
209
|
formData.append('url', file_upload[0]?.url ?? '');
|
|
210
210
|
}
|
|
211
211
|
const res = await sendMessage(formData);
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
212
|
+
if (res?.message?.id) {
|
|
213
|
+
publishMessage(topic_plivo_chat, {
|
|
214
|
+
...data,
|
|
215
|
+
state: MessageState.Sent,
|
|
216
|
+
attachments: file_upload
|
|
217
|
+
? [
|
|
218
|
+
{
|
|
219
|
+
file_name: data.attachments[0]?.file_name ?? '',
|
|
220
|
+
file_path: file_upload[0]?.url ?? ''
|
|
221
|
+
}
|
|
222
|
+
]
|
|
223
|
+
: [],
|
|
224
|
+
id: res?.message?.id,
|
|
225
|
+
is_sms: res?.message?.is_sms,
|
|
226
|
+
local_id: data?.id
|
|
227
|
+
});
|
|
228
|
+
updateMessageItem(data.id, {
|
|
229
|
+
state: MessageState.Sent,
|
|
230
|
+
id: res?.message?.id,
|
|
231
|
+
is_sms: res?.message?.is_sms
|
|
232
|
+
});
|
|
233
|
+
chatMessageRef.value?.scrollBottom();
|
|
234
|
+
publicTopicConversationUpdate({
|
|
235
|
+
message: data?.message ?? '',
|
|
236
|
+
isSendImg: !!file_upload?.length,
|
|
237
|
+
infoUser: infoUser.value,
|
|
238
|
+
is_known: props.conversation?.is_known ?? 0,
|
|
239
|
+
conversation_id: props.conversation?.id ?? 0
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
updateMessageItem(data.id, {
|
|
244
|
+
state: MessageState.Failed,
|
|
245
|
+
error: res?.messages ?? ''
|
|
246
|
+
});
|
|
247
|
+
}
|
|
240
248
|
}
|
|
241
249
|
catch (error) {
|
|
242
250
|
console.log(error);
|
|
@@ -281,6 +289,9 @@ const reconcileAndSortMessages = (serverMessages) => {
|
|
|
281
289
|
});
|
|
282
290
|
listMessage.value = currentMessages.sort((a, b) => dayjs(b.created_at).valueOf() - dayjs(a.created_at).valueOf());
|
|
283
291
|
};
|
|
292
|
+
const handleResent = (message) => {
|
|
293
|
+
inputChatRef.value?.handleSendMessage('message', { message: message.message ?? '' });
|
|
294
|
+
};
|
|
284
295
|
const handleGetListMqtt = useDebounce(() => handleGetMessage({ is_mqtt: true }), 5000);
|
|
285
296
|
const __VLS_exposed = { getData, handleGetMessage, infoUser, handleGetDetailReceiverQuickly };
|
|
286
297
|
defineExpose(__VLS_exposed);
|
|
@@ -353,6 +364,7 @@ if (__VLS_ctx.infoUser) {
|
|
|
353
364
|
const __VLS_9 = __VLS_asFunctionalComponent(ChatMessage, new ChatMessage({
|
|
354
365
|
...{ 'onScrollTop': {} },
|
|
355
366
|
...{ 'onCallBack': {} },
|
|
367
|
+
...{ 'onResend': {} },
|
|
356
368
|
ref: "chatMessageRef",
|
|
357
369
|
data: (__VLS_ctx.infoUser),
|
|
358
370
|
message: (__VLS_ctx.reversedList),
|
|
@@ -364,6 +376,7 @@ if (__VLS_ctx.infoUser) {
|
|
|
364
376
|
const __VLS_10 = __VLS_9({
|
|
365
377
|
...{ 'onScrollTop': {} },
|
|
366
378
|
...{ 'onCallBack': {} },
|
|
379
|
+
...{ 'onResend': {} },
|
|
367
380
|
ref: "chatMessageRef",
|
|
368
381
|
data: (__VLS_ctx.infoUser),
|
|
369
382
|
message: (__VLS_ctx.reversedList),
|
|
@@ -378,10 +391,12 @@ if (__VLS_ctx.infoUser) {
|
|
|
378
391
|
{ onScrollTop: (__VLS_ctx.handleScrollTop) });
|
|
379
392
|
const __VLS_15 = ({ callBack: {} },
|
|
380
393
|
{ onCallBack: (__VLS_ctx.call) });
|
|
394
|
+
const __VLS_16 = ({ resend: {} },
|
|
395
|
+
{ onResend: (__VLS_ctx.handleResent) });
|
|
381
396
|
/** @type {typeof __VLS_ctx.chatMessageRef} */ ;
|
|
382
|
-
var
|
|
397
|
+
var __VLS_17 = {};
|
|
383
398
|
// @ts-ignore
|
|
384
|
-
[infoUser, responsive, call, reversedList, page, pageCount, isLoading, handleScrollTop, chatMessageRef,];
|
|
399
|
+
[infoUser, responsive, call, reversedList, page, pageCount, isLoading, handleScrollTop, handleResent, chatMessageRef,];
|
|
385
400
|
var __VLS_11;
|
|
386
401
|
}
|
|
387
402
|
else if (!__VLS_ctx.isLoading) {
|
|
@@ -389,16 +404,16 @@ if (__VLS_ctx.infoUser) {
|
|
|
389
404
|
[isLoading,];
|
|
390
405
|
/** @type {[typeof NewCustomer, ]} */ ;
|
|
391
406
|
// @ts-ignore
|
|
392
|
-
const
|
|
407
|
+
const __VLS_20 = __VLS_asFunctionalComponent(NewCustomer, new NewCustomer({
|
|
393
408
|
data: (__VLS_ctx.infoUser),
|
|
394
409
|
...{ class: "grow" },
|
|
395
410
|
isNew: (!__VLS_ctx.listMessage.length),
|
|
396
411
|
}));
|
|
397
|
-
const
|
|
412
|
+
const __VLS_21 = __VLS_20({
|
|
398
413
|
data: (__VLS_ctx.infoUser),
|
|
399
414
|
...{ class: "grow" },
|
|
400
415
|
isNew: (!__VLS_ctx.listMessage.length),
|
|
401
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
416
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_20));
|
|
402
417
|
// @ts-ignore
|
|
403
418
|
[infoUser, listMessage,];
|
|
404
419
|
}
|
|
@@ -412,7 +427,7 @@ if (__VLS_ctx.infoUser) {
|
|
|
412
427
|
[receiverId, digibotId,];
|
|
413
428
|
/** @type {[typeof InputChat, ]} */ ;
|
|
414
429
|
// @ts-ignore
|
|
415
|
-
const
|
|
430
|
+
const __VLS_24 = __VLS_asFunctionalComponent(InputChat, new InputChat({
|
|
416
431
|
...{ 'onSendMessage': {} },
|
|
417
432
|
...{ 'onFocus': {} },
|
|
418
433
|
data: (__VLS_ctx.infoUser),
|
|
@@ -421,7 +436,7 @@ if (__VLS_ctx.infoUser) {
|
|
|
421
436
|
ref: "inputChatRef",
|
|
422
437
|
...{ class: "p-2 sm:p-6" },
|
|
423
438
|
}));
|
|
424
|
-
const
|
|
439
|
+
const __VLS_25 = __VLS_24({
|
|
425
440
|
...{ 'onSendMessage': {} },
|
|
426
441
|
...{ 'onFocus': {} },
|
|
427
442
|
data: (__VLS_ctx.infoUser),
|
|
@@ -429,12 +444,12 @@ if (__VLS_ctx.infoUser) {
|
|
|
429
444
|
conversation: (__VLS_ctx.conversation),
|
|
430
445
|
ref: "inputChatRef",
|
|
431
446
|
...{ class: "p-2 sm:p-6" },
|
|
432
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
433
|
-
let __VLS_26;
|
|
447
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_24));
|
|
434
448
|
let __VLS_27;
|
|
435
|
-
|
|
449
|
+
let __VLS_28;
|
|
450
|
+
const __VLS_29 = ({ sendMessage: {} },
|
|
436
451
|
{ onSendMessage: (__VLS_ctx.handleSendMessage) });
|
|
437
|
-
const
|
|
452
|
+
const __VLS_30 = ({ focus: {} },
|
|
438
453
|
{ onFocus: (...[$event]) => {
|
|
439
454
|
if (!(__VLS_ctx.infoUser))
|
|
440
455
|
return;
|
|
@@ -445,10 +460,10 @@ if (__VLS_ctx.infoUser) {
|
|
|
445
460
|
[infoUser, responsive, emit, conversation, handleSendMessage,];
|
|
446
461
|
} });
|
|
447
462
|
/** @type {typeof __VLS_ctx.inputChatRef} */ ;
|
|
448
|
-
var
|
|
463
|
+
var __VLS_31 = {};
|
|
449
464
|
// @ts-ignore
|
|
450
465
|
[inputChatRef,];
|
|
451
|
-
var
|
|
466
|
+
var __VLS_26;
|
|
452
467
|
}
|
|
453
468
|
}
|
|
454
469
|
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
@@ -462,7 +477,7 @@ if (__VLS_ctx.infoUser) {
|
|
|
462
477
|
/** @type {__VLS_StyleScopedClasses['p-2']} */ ;
|
|
463
478
|
/** @type {__VLS_StyleScopedClasses['sm:p-6']} */ ;
|
|
464
479
|
// @ts-ignore
|
|
465
|
-
var
|
|
480
|
+
var __VLS_18 = __VLS_17, __VLS_32 = __VLS_31;
|
|
466
481
|
const __VLS_export = (await import('vue')).defineComponent({
|
|
467
482
|
setup: () => (__VLS_exposed),
|
|
468
483
|
__typeEmits: {},
|
|
@@ -14,6 +14,9 @@ type __VLS_ModelProps = {
|
|
|
14
14
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
15
15
|
declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
16
16
|
clearInput: () => void;
|
|
17
|
+
handleSendMessage: (type: "message" | "file", option?: {
|
|
18
|
+
message?: string | undefined;
|
|
19
|
+
} | undefined) => Promise<void>;
|
|
17
20
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
21
|
"update:modelValue": (value: string | undefined) => any;
|
|
19
22
|
} & {
|