@phonghq/go-chat 1.0.42 → 1.0.44
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/IconPlan.vue.d.ts +13 -1
- package/dist/assets/icons/call/IconPhoneCancel.vue.d.ts +13 -1
- package/dist/assets/icons/customer-detail/IconPhone.vue.d.ts +13 -1
- package/dist/chat/App.vue.d.ts +13 -2
- package/dist/chat/page/home/ChatList.vue.d.ts +10 -0
- package/dist/chat/page/home/ChatMessageItem.vue.d.ts +1 -0
- package/dist/chat/page/home/ChatMessageItem2.vue.d.ts +19 -0
- package/dist/chat/page/home/Home.vue.d.ts +2 -0
- package/dist/chat/page/home/InputChat.vue.d.ts +2 -0
- package/dist/components/chat/call/Calling.vue.d.ts +4 -2
- package/dist/components/chat/common/tabs/TabBase.vue.d.ts +18 -0
- package/dist/components/common/drawer/DrawerBaseCustom.vue.d.ts +1 -1
- package/dist/components/ui/select/Select.vue.d.ts +20 -0
- package/dist/components/ui/select/SelectContent.vue.d.ts +24 -0
- package/dist/components/ui/select/SelectGroup.vue.d.ts +10 -0
- package/dist/components/ui/select/SelectItem.vue.d.ts +18 -0
- package/dist/components/ui/select/SelectItemText.vue.d.ts +10 -0
- package/dist/components/ui/select/SelectLabel.vue.d.ts +14 -0
- package/dist/components/ui/select/SelectScrollDownButton.vue.d.ts +14 -0
- package/dist/components/ui/select/SelectScrollUpButton.vue.d.ts +14 -0
- package/dist/components/ui/select/SelectSeparator.vue.d.ts +7 -0
- package/dist/components/ui/select/SelectTrigger.vue.d.ts +17 -0
- package/dist/components/ui/select/SelectValue.vue.d.ts +10 -0
- package/dist/components/ui/select/index.d.ts +11 -0
- package/dist/components/ui/tabs/Tabs.vue.d.ts +20 -0
- package/dist/components/ui/tabs/TabsContent.vue.d.ts +14 -0
- package/dist/components/ui/tabs/TabsList.vue.d.ts +14 -0
- package/dist/components/ui/tabs/TabsTrigger.vue.d.ts +14 -0
- package/dist/components/ui/tabs/index.d.ts +4 -0
- package/dist/composable/useDigibot.d.ts +1 -1
- package/dist/composable/useInitData.d.ts +5 -2
- package/dist/composable/useListConversations.d.ts +4 -1
- package/dist/composable/useListentEvent.d.ts +5 -0
- package/dist/composable/usePlivo.d.ts +1 -0
- package/dist/constant/color.d.ts +2 -2
- package/dist/go-chat.es.js +14663 -14004
- package/dist/go-chat.umd.js +15 -15
- package/dist/style.css +1 -1
- package/dist/test/assets/icons/IconPlan.vue.js +23 -3
- package/dist/test/assets/icons/IconUser.vue.js +25 -0
- package/dist/test/assets/icons/call/IconPhone.vue.js +6 -19
- package/dist/test/assets/icons/call/IconPhoneCancel.vue.js +32 -21
- package/dist/test/assets/icons/customer-detail/IconPhone.vue.js +23 -3
- package/dist/test/chat/App.vue.js +303 -282
- package/dist/test/chat/page/customer-check-in/CustomerCheckIn.vue.js +3 -1
- package/dist/test/chat/page/customer-detail/CustomerDetail.vue.js +4 -4
- package/dist/test/chat/page/home/ChatList.vue.js +113 -43
- package/dist/test/chat/page/home/ChatMessage.vue.js +10 -1
- package/dist/test/chat/page/home/ChatMessageItem.vue.js +75 -83
- package/dist/test/chat/page/home/ChatMessageItem2.vue.js +351 -0
- package/dist/test/chat/page/home/Home.vue.js +29 -9
- package/dist/test/chat/page/home/HomeHeader.vue.js +8 -4
- package/dist/test/chat/page/home/InputChat.vue.js +58 -37
- package/dist/test/components/chat/call/Calling.vue.js +117 -71
- package/dist/test/components/chat/common/tab/TabBase.vue.js +1 -0
- package/dist/test/components/chat/common/tabs/TabBase.vue.js +92 -0
- package/dist/test/components/chat/customer/Avatar.vue.js +23 -4
- package/dist/test/components/chat/layout/mobile/Footer.vue.js +6 -1
- package/dist/test/components/common/drawer/DrawerBaseCustom.vue.js +1 -0
- package/dist/test/components/common/select/SelectBase.vue.js +139 -0
- package/dist/test/components/ui/select/Select.vue.js +49 -0
- package/dist/test/components/ui/select/SelectContent.vue.js +98 -0
- package/dist/test/components/ui/select/SelectGroup.vue.js +37 -0
- package/dist/test/components/ui/select/SelectItem.vue.js +86 -0
- package/dist/test/components/ui/select/SelectItemText.vue.js +37 -0
- package/dist/test/components/ui/select/SelectLabel.vue.js +40 -0
- package/dist/test/components/ui/select/SelectScrollDownButton.vue.js +58 -0
- package/dist/test/components/ui/select/SelectScrollUpButton.vue.js +58 -0
- package/dist/test/components/ui/select/SelectSeparator.vue.js +39 -0
- package/dist/test/components/ui/select/SelectTrigger.vue.js +76 -0
- package/dist/test/components/ui/select/SelectValue.vue.js +37 -0
- package/dist/test/components/ui/select/index.js +11 -0
- package/dist/test/components/ui/tabs/Tabs.vue.js +54 -0
- package/dist/test/components/ui/tabs/TabsContent.vue.js +44 -0
- package/dist/test/components/ui/tabs/TabsList.vue.js +44 -0
- package/dist/test/components/ui/tabs/TabsTrigger.vue.js +45 -0
- package/dist/test/components/ui/tabs/index.js +4 -0
- package/dist/test/composable/useDigibot.js +3 -3
- package/dist/test/composable/useInitData.js +23 -14
- package/dist/test/composable/useListConversations.js +51 -33
- package/dist/test/composable/useListentEvent.js +45 -0
- package/dist/test/composable/usePlivo.js +6 -1
- package/dist/test/constant/color.js +4 -2
- package/dist/test/plugins/axios-gci.js +1 -1
- package/dist/test/utils/chat/auth.js +1 -1
- package/dist/test/utils/chat/cache.js +63 -0
- package/dist/test/utils/chat/call.js +2 -3
- package/dist/test/utils/chat/conversation.js +9 -2
- package/dist/test/utils/chat/page-error.js +25 -0
- package/dist/test/utils/chat/user.js +7 -2
- package/dist/test/utils/string-helper.js +13 -0
- package/dist/test/views/NotTenantPhone.vue.js +99 -0
- package/dist/types/chat/global.d.ts +6 -5
- package/dist/types/conversation.d.ts +2 -0
- package/dist/utils/chat/auth.d.ts +1 -1
- package/dist/utils/chat/cache.d.ts +7 -0
- package/dist/utils/chat/conversation.d.ts +2 -0
- package/dist/utils/chat/page-error.d.ts +4 -0
- package/dist/utils/chat/user.d.ts +3 -0
- package/dist/utils/string-helper.d.ts +1 -0
- package/dist/views/NotTenantPhone.vue.d.ts +9 -0
- package/package.json +3 -2
- package/dist/components/layout/Blank.vue.d.ts +0 -9
- package/dist/components/layout/Default.vue.d.ts +0 -9
- package/dist/composable/useError.d.ts +0 -4
- package/dist/composable/useModalConfirm.d.ts +0 -5
- package/dist/test/components/ListenEvent.vue.js +0 -45
- package/dist/test/components/layout/Blank.vue.js +0 -19
- package/dist/test/components/layout/Default.vue.js +0 -21
- package/dist/test/components/modal/Confirm.vue.js +0 -164
- package/dist/test/composable/useError.js +0 -10
- package/dist/test/composable/useModalConfirm.js +0 -39
- /package/dist/{components/ListenEvent.vue.d.ts → assets/icons/IconUser.vue.d.ts} +0 -0
- /package/dist/components/{modal/Confirm.vue.d.ts → common/select/SelectBase.vue.d.ts} +0 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
3
|
+
import { ChevronDown } from "lucide-vue-next";
|
|
4
|
+
import { SelectIcon, SelectTrigger, useForwardProps } from "reka-ui";
|
|
5
|
+
import { cn } from "../../../lib/utils";
|
|
6
|
+
const props = withDefaults(defineProps(), { size: "default" });
|
|
7
|
+
const delegatedProps = reactiveOmit(props, "class", "size");
|
|
8
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
9
|
+
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
10
|
+
const __VLS_defaults = { size: "default" };
|
|
11
|
+
const __VLS_ctx = {
|
|
12
|
+
...{},
|
|
13
|
+
...{},
|
|
14
|
+
...{},
|
|
15
|
+
...{},
|
|
16
|
+
};
|
|
17
|
+
let __VLS_elements;
|
|
18
|
+
let __VLS_components;
|
|
19
|
+
let __VLS_directives;
|
|
20
|
+
const __VLS_0 = {}.SelectTrigger;
|
|
21
|
+
/** @type {[typeof __VLS_components.SelectTrigger, typeof __VLS_components.SelectTrigger, ]} */ ;
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
SelectTrigger;
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({
|
|
26
|
+
dataSlot: "select-trigger",
|
|
27
|
+
dataSize: (__VLS_ctx.size),
|
|
28
|
+
...(__VLS_ctx.forwardedProps),
|
|
29
|
+
...{ class: (__VLS_ctx.cn('border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*=\'text-\'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4', props.class)) },
|
|
30
|
+
}));
|
|
31
|
+
const __VLS_2 = __VLS_1({
|
|
32
|
+
dataSlot: "select-trigger",
|
|
33
|
+
dataSize: (__VLS_ctx.size),
|
|
34
|
+
...(__VLS_ctx.forwardedProps),
|
|
35
|
+
...{ class: (__VLS_ctx.cn('border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*=\'text-\'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4', props.class)) },
|
|
36
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
|
37
|
+
var __VLS_4 = {};
|
|
38
|
+
const { default: __VLS_5 } = __VLS_3.slots;
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
[size, forwardedProps, cn,];
|
|
41
|
+
var __VLS_6 = {};
|
|
42
|
+
const __VLS_8 = {}.SelectIcon;
|
|
43
|
+
/** @type {[typeof __VLS_components.SelectIcon, typeof __VLS_components.SelectIcon, ]} */ ;
|
|
44
|
+
// @ts-ignore
|
|
45
|
+
SelectIcon;
|
|
46
|
+
// @ts-ignore
|
|
47
|
+
const __VLS_9 = __VLS_asFunctionalComponent(__VLS_8, new __VLS_8({
|
|
48
|
+
asChild: true,
|
|
49
|
+
}));
|
|
50
|
+
const __VLS_10 = __VLS_9({
|
|
51
|
+
asChild: true,
|
|
52
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_9));
|
|
53
|
+
const { default: __VLS_12 } = __VLS_11.slots;
|
|
54
|
+
const __VLS_13 = {}.ChevronDown;
|
|
55
|
+
/** @type {[typeof __VLS_components.ChevronDown, ]} */ ;
|
|
56
|
+
// @ts-ignore
|
|
57
|
+
ChevronDown;
|
|
58
|
+
// @ts-ignore
|
|
59
|
+
const __VLS_14 = __VLS_asFunctionalComponent(__VLS_13, new __VLS_13({
|
|
60
|
+
...{ class: "size-4 opacity-50" },
|
|
61
|
+
}));
|
|
62
|
+
const __VLS_15 = __VLS_14({
|
|
63
|
+
...{ class: "size-4 opacity-50" },
|
|
64
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_14));
|
|
65
|
+
var __VLS_11;
|
|
66
|
+
var __VLS_3;
|
|
67
|
+
/** @type {__VLS_StyleScopedClasses['size-4']} */ ;
|
|
68
|
+
/** @type {__VLS_StyleScopedClasses['opacity-50']} */ ;
|
|
69
|
+
// @ts-ignore
|
|
70
|
+
var __VLS_7 = __VLS_6;
|
|
71
|
+
const __VLS_base = (await import('vue')).defineComponent({
|
|
72
|
+
__typeProps: {},
|
|
73
|
+
props: {},
|
|
74
|
+
});
|
|
75
|
+
const __VLS_export = {};
|
|
76
|
+
export default {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
|
+
import { SelectValue } from "reka-ui";
|
|
3
|
+
const props = defineProps();
|
|
4
|
+
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
5
|
+
const __VLS_ctx = {
|
|
6
|
+
...{},
|
|
7
|
+
...{},
|
|
8
|
+
...{},
|
|
9
|
+
...{},
|
|
10
|
+
};
|
|
11
|
+
let __VLS_elements;
|
|
12
|
+
let __VLS_components;
|
|
13
|
+
let __VLS_directives;
|
|
14
|
+
const __VLS_0 = {}.SelectValue;
|
|
15
|
+
/** @type {[typeof __VLS_components.SelectValue, typeof __VLS_components.SelectValue, ]} */ ;
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
SelectValue;
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({
|
|
20
|
+
dataSlot: "select-value",
|
|
21
|
+
...(props),
|
|
22
|
+
}));
|
|
23
|
+
const __VLS_2 = __VLS_1({
|
|
24
|
+
dataSlot: "select-value",
|
|
25
|
+
...(props),
|
|
26
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
|
27
|
+
var __VLS_4 = {};
|
|
28
|
+
const { default: __VLS_5 } = __VLS_3.slots;
|
|
29
|
+
var __VLS_6 = {};
|
|
30
|
+
var __VLS_3;
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
var __VLS_7 = __VLS_6;
|
|
33
|
+
const __VLS_base = (await import('vue')).defineComponent({
|
|
34
|
+
__typeProps: {},
|
|
35
|
+
});
|
|
36
|
+
const __VLS_export = {};
|
|
37
|
+
export default {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default as Select } from "./Select.vue";
|
|
2
|
+
export { default as SelectContent } from "./SelectContent.vue";
|
|
3
|
+
export { default as SelectGroup } from "./SelectGroup.vue";
|
|
4
|
+
export { default as SelectItem } from "./SelectItem.vue";
|
|
5
|
+
export { default as SelectItemText } from "./SelectItemText.vue";
|
|
6
|
+
export { default as SelectLabel } from "./SelectLabel.vue";
|
|
7
|
+
export { default as SelectScrollDownButton } from "./SelectScrollDownButton.vue";
|
|
8
|
+
export { default as SelectScrollUpButton } from "./SelectScrollUpButton.vue";
|
|
9
|
+
export { default as SelectSeparator } from "./SelectSeparator.vue";
|
|
10
|
+
export { default as SelectTrigger } from "./SelectTrigger.vue";
|
|
11
|
+
export { default as SelectValue } from "./SelectValue.vue";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
3
|
+
import { TabsRoot, useForwardPropsEmits } from "reka-ui";
|
|
4
|
+
import { cn } from "../../../lib/utils";
|
|
5
|
+
const props = defineProps();
|
|
6
|
+
const emits = defineEmits();
|
|
7
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
8
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
9
|
+
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
10
|
+
const __VLS_ctx = {
|
|
11
|
+
...{},
|
|
12
|
+
...{},
|
|
13
|
+
...{},
|
|
14
|
+
...{},
|
|
15
|
+
...{},
|
|
16
|
+
};
|
|
17
|
+
let __VLS_elements;
|
|
18
|
+
let __VLS_components;
|
|
19
|
+
let __VLS_directives;
|
|
20
|
+
const __VLS_0 = {}.TabsRoot;
|
|
21
|
+
/** @type {[typeof __VLS_components.TabsRoot, typeof __VLS_components.TabsRoot, ]} */ ;
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
TabsRoot;
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({
|
|
26
|
+
dataSlot: "tabs",
|
|
27
|
+
...(__VLS_ctx.forwarded),
|
|
28
|
+
...{ class: (__VLS_ctx.cn('flex flex-col gap-2', props.class)) },
|
|
29
|
+
}));
|
|
30
|
+
const __VLS_2 = __VLS_1({
|
|
31
|
+
dataSlot: "tabs",
|
|
32
|
+
...(__VLS_ctx.forwarded),
|
|
33
|
+
...{ class: (__VLS_ctx.cn('flex flex-col gap-2', props.class)) },
|
|
34
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
|
35
|
+
var __VLS_4 = {};
|
|
36
|
+
{
|
|
37
|
+
const { default: __VLS_5 } = __VLS_3.slots;
|
|
38
|
+
const [slotProps] = __VLS_getSlotParameters(__VLS_5);
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
[forwarded, cn,];
|
|
41
|
+
var __VLS_6 = {
|
|
42
|
+
...(slotProps),
|
|
43
|
+
};
|
|
44
|
+
__VLS_3.slots['' /* empty slot name completion */];
|
|
45
|
+
}
|
|
46
|
+
var __VLS_3;
|
|
47
|
+
// @ts-ignore
|
|
48
|
+
var __VLS_7 = __VLS_6;
|
|
49
|
+
const __VLS_base = (await import('vue')).defineComponent({
|
|
50
|
+
__typeEmits: {},
|
|
51
|
+
__typeProps: {},
|
|
52
|
+
});
|
|
53
|
+
const __VLS_export = {};
|
|
54
|
+
export default {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
3
|
+
import { TabsContent } from "reka-ui";
|
|
4
|
+
import { cn } from "../../../lib/utils";
|
|
5
|
+
const props = defineProps();
|
|
6
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
7
|
+
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
8
|
+
const __VLS_ctx = {
|
|
9
|
+
...{},
|
|
10
|
+
...{},
|
|
11
|
+
...{},
|
|
12
|
+
...{},
|
|
13
|
+
};
|
|
14
|
+
let __VLS_elements;
|
|
15
|
+
let __VLS_components;
|
|
16
|
+
let __VLS_directives;
|
|
17
|
+
const __VLS_0 = {}.TabsContent;
|
|
18
|
+
/** @type {[typeof __VLS_components.TabsContent, typeof __VLS_components.TabsContent, ]} */ ;
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
TabsContent;
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({
|
|
23
|
+
dataSlot: "tabs-content",
|
|
24
|
+
...{ class: (__VLS_ctx.cn('flex-1 outline-none', props.class)) },
|
|
25
|
+
...(__VLS_ctx.delegatedProps),
|
|
26
|
+
}));
|
|
27
|
+
const __VLS_2 = __VLS_1({
|
|
28
|
+
dataSlot: "tabs-content",
|
|
29
|
+
...{ class: (__VLS_ctx.cn('flex-1 outline-none', props.class)) },
|
|
30
|
+
...(__VLS_ctx.delegatedProps),
|
|
31
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
|
32
|
+
var __VLS_4 = {};
|
|
33
|
+
const { default: __VLS_5 } = __VLS_3.slots;
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
[cn, delegatedProps,];
|
|
36
|
+
var __VLS_6 = {};
|
|
37
|
+
var __VLS_3;
|
|
38
|
+
// @ts-ignore
|
|
39
|
+
var __VLS_7 = __VLS_6;
|
|
40
|
+
const __VLS_base = (await import('vue')).defineComponent({
|
|
41
|
+
__typeProps: {},
|
|
42
|
+
});
|
|
43
|
+
const __VLS_export = {};
|
|
44
|
+
export default {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
3
|
+
import { TabsList } from "reka-ui";
|
|
4
|
+
import { cn } from "../../../lib/utils";
|
|
5
|
+
const props = defineProps();
|
|
6
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
7
|
+
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
8
|
+
const __VLS_ctx = {
|
|
9
|
+
...{},
|
|
10
|
+
...{},
|
|
11
|
+
...{},
|
|
12
|
+
...{},
|
|
13
|
+
};
|
|
14
|
+
let __VLS_elements;
|
|
15
|
+
let __VLS_components;
|
|
16
|
+
let __VLS_directives;
|
|
17
|
+
const __VLS_0 = {}.TabsList;
|
|
18
|
+
/** @type {[typeof __VLS_components.TabsList, typeof __VLS_components.TabsList, ]} */ ;
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
TabsList;
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({
|
|
23
|
+
dataSlot: "tabs-list",
|
|
24
|
+
...(__VLS_ctx.delegatedProps),
|
|
25
|
+
...{ class: (__VLS_ctx.cn('bg-chat-haze-200 inline-flex w-fit items-center justify-center rounded-xl p-[3px]', props.class)) },
|
|
26
|
+
}));
|
|
27
|
+
const __VLS_2 = __VLS_1({
|
|
28
|
+
dataSlot: "tabs-list",
|
|
29
|
+
...(__VLS_ctx.delegatedProps),
|
|
30
|
+
...{ class: (__VLS_ctx.cn('bg-chat-haze-200 inline-flex w-fit items-center justify-center rounded-xl p-[3px]', props.class)) },
|
|
31
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
|
32
|
+
var __VLS_4 = {};
|
|
33
|
+
const { default: __VLS_5 } = __VLS_3.slots;
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
[delegatedProps, cn,];
|
|
36
|
+
var __VLS_6 = {};
|
|
37
|
+
var __VLS_3;
|
|
38
|
+
// @ts-ignore
|
|
39
|
+
var __VLS_7 = __VLS_6;
|
|
40
|
+
const __VLS_base = (await import('vue')).defineComponent({
|
|
41
|
+
__typeProps: {},
|
|
42
|
+
});
|
|
43
|
+
const __VLS_export = {};
|
|
44
|
+
export default {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
3
|
+
import { TabsTrigger, useForwardProps } from "reka-ui";
|
|
4
|
+
import { cn } from "../../../lib/utils";
|
|
5
|
+
const props = defineProps();
|
|
6
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
7
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
8
|
+
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
9
|
+
const __VLS_ctx = {
|
|
10
|
+
...{},
|
|
11
|
+
...{},
|
|
12
|
+
...{},
|
|
13
|
+
...{},
|
|
14
|
+
};
|
|
15
|
+
let __VLS_elements;
|
|
16
|
+
let __VLS_components;
|
|
17
|
+
let __VLS_directives;
|
|
18
|
+
const __VLS_0 = {}.TabsTrigger;
|
|
19
|
+
/** @type {[typeof __VLS_components.TabsTrigger, typeof __VLS_components.TabsTrigger, ]} */ ;
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
TabsTrigger;
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({
|
|
24
|
+
dataSlot: "tabs-trigger",
|
|
25
|
+
...{ class: (__VLS_ctx.cn('data-[state=active]:bg-white focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex flex-1 items-center justify-center gap-1.5 rounded-xl px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow,background-color] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4', props.class)) },
|
|
26
|
+
...(__VLS_ctx.forwardedProps),
|
|
27
|
+
}));
|
|
28
|
+
const __VLS_2 = __VLS_1({
|
|
29
|
+
dataSlot: "tabs-trigger",
|
|
30
|
+
...{ class: (__VLS_ctx.cn('data-[state=active]:bg-white focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex flex-1 items-center justify-center gap-1.5 rounded-xl px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow,background-color] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4', props.class)) },
|
|
31
|
+
...(__VLS_ctx.forwardedProps),
|
|
32
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
|
33
|
+
var __VLS_4 = {};
|
|
34
|
+
const { default: __VLS_5 } = __VLS_3.slots;
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
[cn, forwardedProps,];
|
|
37
|
+
var __VLS_6 = {};
|
|
38
|
+
var __VLS_3;
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
var __VLS_7 = __VLS_6;
|
|
41
|
+
const __VLS_base = (await import('vue')).defineComponent({
|
|
42
|
+
__typeProps: {},
|
|
43
|
+
});
|
|
44
|
+
const __VLS_export = {};
|
|
45
|
+
export default {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
//PINIA
|
|
2
|
+
export const digibotId = -98;
|
|
2
3
|
export const digibotData = {
|
|
3
|
-
id:
|
|
4
|
-
receiver_id:
|
|
4
|
+
id: digibotId,
|
|
5
|
+
receiver_id: digibotId,
|
|
5
6
|
username: 'Gocheckin AI',
|
|
6
7
|
phone: '',
|
|
7
8
|
avatar: '',
|
|
@@ -14,7 +15,6 @@ export const digibotData = {
|
|
|
14
15
|
color: '#4F46E5',
|
|
15
16
|
is_unknown: 0
|
|
16
17
|
};
|
|
17
|
-
export const digibotId = -98;
|
|
18
18
|
export function useDigibot() {
|
|
19
19
|
return {
|
|
20
20
|
digibotData,
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { ref } from 'vue';
|
|
2
2
|
import { sdkInit } from '../plugins/sdk';
|
|
3
|
-
import {
|
|
3
|
+
import { checkTenantPhoneOnGapInsight, dataProfile, getProfile, loginLink } from '../utils/chat/auth';
|
|
4
4
|
import { routerPush } from '../utils/chat/chat-router';
|
|
5
5
|
import { PAGE } from '../constant/general';
|
|
6
6
|
import { connectMqtt, subscribeToTopic, unsubscribeFromTopic } from '../plugins/mqtt';
|
|
7
7
|
import { TOPIC_DETAIL_CALL } from '../constant/mqtt';
|
|
8
|
-
import { checkHasBusinessTenantPhone } from '../plugins/pocketbase';
|
|
9
8
|
// import router from '../router'
|
|
10
9
|
//PINIA
|
|
11
10
|
export const isRouterReady = ref(false);
|
|
@@ -22,33 +21,43 @@ export function useInitData() {
|
|
|
22
21
|
// return
|
|
23
22
|
// }
|
|
24
23
|
}
|
|
25
|
-
|
|
26
|
-
await initData(data.props, data.response);
|
|
24
|
+
await initData(data.props, data.responsive);
|
|
27
25
|
await connectMqtt();
|
|
26
|
+
const res = checkNotificationParams();
|
|
27
|
+
isRouterReady.value = true;
|
|
28
|
+
return res;
|
|
28
29
|
}
|
|
29
30
|
catch (error) {
|
|
30
|
-
console.log(error);
|
|
31
|
-
}
|
|
32
|
-
finally {
|
|
33
31
|
isRouterReady.value = true;
|
|
32
|
+
console.log(error);
|
|
33
|
+
return {};
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
-
const initData = async (props,
|
|
37
|
-
|
|
36
|
+
const initData = async (props, responsive) => {
|
|
37
|
+
await getProfile();
|
|
38
38
|
if (dataProfile.value?.user_type == 'tenant') {
|
|
39
|
-
await
|
|
40
|
-
if (dataProfile.value)
|
|
41
|
-
dataProfile.value.has_business_tenant_phone = await checkHasBusinessTenantPhone(dataProfile.value?.tenant_id);
|
|
39
|
+
await checkTenantPhoneOnGapInsight();
|
|
42
40
|
}
|
|
43
41
|
unsubscribeFromTopic(TOPIC_DETAIL_CALL + dataProfile.value?.id);
|
|
44
42
|
subscribeToTopic(TOPIC_DETAIL_CALL + dataProfile.value?.id);
|
|
45
|
-
if (
|
|
43
|
+
if (responsive == 'mobile') {
|
|
46
44
|
routerPush(PAGE.CHAT_LIST);
|
|
47
45
|
}
|
|
48
46
|
else {
|
|
49
47
|
routerPush(PAGE.HOME);
|
|
50
48
|
}
|
|
51
49
|
};
|
|
50
|
+
const checkNotificationParams = () => {
|
|
51
|
+
// return {conversation_id: '316', is_unknown: '0'}
|
|
52
|
+
const queryString = window.location.search;
|
|
53
|
+
const urlParams = new URLSearchParams(queryString);
|
|
54
|
+
const conversation_id = urlParams.get('conversation_id') || '';
|
|
55
|
+
const is_unknown = urlParams.get('is_unknown') || '';
|
|
56
|
+
if (!conversation_id || !is_unknown)
|
|
57
|
+
return {};
|
|
58
|
+
clearApiParams();
|
|
59
|
+
return { conversation_id, is_unknown };
|
|
60
|
+
};
|
|
52
61
|
const loginApiLink = async () => {
|
|
53
62
|
try {
|
|
54
63
|
const queryString = window.location.search;
|
|
@@ -80,7 +89,7 @@ export function useInitData() {
|
|
|
80
89
|
};
|
|
81
90
|
const clearApiParams = () => {
|
|
82
91
|
const url = new URL(window.location.href);
|
|
83
|
-
url.search =
|
|
92
|
+
url.search = '';
|
|
84
93
|
window.history.replaceState({}, document.title, url);
|
|
85
94
|
};
|
|
86
95
|
return {
|
|
@@ -6,8 +6,10 @@ import { useDebounce } from '../utils/debounce';
|
|
|
6
6
|
import { getConversation } from '../utils/chat/conversation';
|
|
7
7
|
import { readMessages } from '../utils/chat/message';
|
|
8
8
|
import { useDigibot } from '../composable/useDigibot';
|
|
9
|
+
import { getCache, setCache } from '../utils/chat/cache';
|
|
9
10
|
const { digibotData, digibotId } = useDigibot();
|
|
10
|
-
export const useListConversations = (is_unknown) => {
|
|
11
|
+
export const useListConversations = (is_unknown, is_tenant) => {
|
|
12
|
+
const STORAGE_KEY = 'chat-conversation-';
|
|
11
13
|
let pageCount = 0;
|
|
12
14
|
const listConversations = ref([]);
|
|
13
15
|
const params = ref({
|
|
@@ -49,48 +51,52 @@ export const useListConversations = (is_unknown) => {
|
|
|
49
51
|
}
|
|
50
52
|
};
|
|
51
53
|
const mqttMessageHandler = (topic, data) => {
|
|
52
|
-
if ((data.is_unknown ?? 0)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
if ((data.is_unknown ?? 0) == is_unknown || (!is_tenant && is_unknown == 0)) {
|
|
55
|
+
getDataMqtt();
|
|
56
|
+
if (topic === TOPIC_HOME[0] + dataProfile.value?.id ||
|
|
57
|
+
topic === TOPIC_HOME[3] + dataProfile.value?.id) {
|
|
58
|
+
const index = listConversations.value.findIndex((item) => item.id === data.id);
|
|
59
|
+
const hasChatBox = listConversations.value.findIndex((item) => item.id === digibotId);
|
|
60
|
+
if (index != -1) {
|
|
61
|
+
listConversations.value.splice(index, 1);
|
|
62
|
+
}
|
|
63
|
+
if (hasChatBox > -1) {
|
|
64
|
+
listConversations.value.splice(1, 0, data);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
listConversations.value.unshift(data);
|
|
68
|
+
}
|
|
61
69
|
}
|
|
62
|
-
if (
|
|
63
|
-
listConversations.value.
|
|
70
|
+
if (topic === TOPIC_HOME[1] + dataProfile.value?.id) {
|
|
71
|
+
const index = listConversations.value.findIndex((item) => item.id === data.id);
|
|
72
|
+
if (index != -1) {
|
|
73
|
+
listConversations.value[index].unread_count = 0;
|
|
74
|
+
}
|
|
64
75
|
}
|
|
65
|
-
|
|
66
|
-
listConversations.value.unshift(data);
|
|
76
|
+
if (topic === TOPIC_HOME[2] + dataProfile.value?.id) {
|
|
77
|
+
listConversations.value.unshift(data?.conversations);
|
|
67
78
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
if (topic === TOPIC_HOME[2] + dataProfile.value?.id) {
|
|
76
|
-
listConversations.value.unshift(data?.conversations);
|
|
77
|
-
}
|
|
78
|
-
if (topic === TOPIC_STATUS_USER + dataProfile.value?.id) {
|
|
79
|
-
const index = listConversations.value.findIndex((e) => e.receiver_id == Number(data?.customer_id));
|
|
80
|
-
if (index != -1) {
|
|
81
|
-
listConversations.value[index].status = data.is_online ? 1 : 0;
|
|
79
|
+
if (topic === TOPIC_STATUS_USER + dataProfile.value?.id) {
|
|
80
|
+
const index = listConversations.value.findIndex((e) => e.receiver_id == Number(data?.customer_id));
|
|
81
|
+
if (index != -1) {
|
|
82
|
+
listConversations.value[index].status = data.is_online ? 1 : 0;
|
|
83
|
+
}
|
|
82
84
|
}
|
|
83
85
|
}
|
|
84
|
-
console.log(listConversations.value, is_unknown);
|
|
85
86
|
};
|
|
86
87
|
const getDataMqtt = useDebounce(() => {
|
|
87
88
|
getData(undefined, { hideLoading: true, reset: true });
|
|
88
89
|
}, 5000);
|
|
89
90
|
const getData = async (data, option) => {
|
|
90
91
|
try {
|
|
91
|
-
|
|
92
|
+
if (!is_tenant && is_unknown == 1)
|
|
93
|
+
return;
|
|
92
94
|
params.value = { ...params.value, ...(data ?? {}) };
|
|
93
|
-
const
|
|
95
|
+
const is_unknown_value = is_tenant ? is_unknown : undefined;
|
|
96
|
+
if (option?.reset) {
|
|
97
|
+
params.value.page = 1;
|
|
98
|
+
}
|
|
99
|
+
const res = await getConversation({ ...params.value, is_unknown: is_unknown_value });
|
|
94
100
|
if (option?.reset) {
|
|
95
101
|
listConversations.value = [];
|
|
96
102
|
if (is_unknown == 0 && dataProfile.value?.user_type == 'tenant')
|
|
@@ -100,14 +106,25 @@ export const useListConversations = (is_unknown) => {
|
|
|
100
106
|
listConversations.value.push(...(res?.items ?? []));
|
|
101
107
|
params.value.page = res?._meta?.currentPage || 1;
|
|
102
108
|
pageCount = res?._meta?.pageCount || 1;
|
|
109
|
+
if (params.value.page <= 1) {
|
|
110
|
+
setCache(STORAGE_KEY + is_unknown, listConversations.value);
|
|
111
|
+
}
|
|
103
112
|
}
|
|
104
113
|
catch (error) {
|
|
105
114
|
console.error(error);
|
|
106
115
|
}
|
|
107
116
|
finally {
|
|
108
|
-
// isLoadingSearch.value = false
|
|
109
117
|
}
|
|
110
118
|
};
|
|
119
|
+
const getDataCache = () => {
|
|
120
|
+
const cache_data = getCache(STORAGE_KEY + is_unknown);
|
|
121
|
+
if (cache_data.data) {
|
|
122
|
+
listConversations.value = [];
|
|
123
|
+
listConversations.value.push(...(cache_data.data ?? []));
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
return false;
|
|
127
|
+
};
|
|
111
128
|
const handleReadMessage = (receiver_id) => {
|
|
112
129
|
const index = listConversations.value.findIndex((e) => e.receiver_id == receiver_id);
|
|
113
130
|
if (index > -1) {
|
|
@@ -122,6 +139,7 @@ export const useListConversations = (is_unknown) => {
|
|
|
122
139
|
params,
|
|
123
140
|
pageCount,
|
|
124
141
|
getData,
|
|
125
|
-
handleReadMessage
|
|
142
|
+
handleReadMessage,
|
|
143
|
+
getDataCache
|
|
126
144
|
};
|
|
127
145
|
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { onMounted, onUnmounted, ref } from 'vue';
|
|
2
|
+
import { currentPage } from '../utils/chat/chat-router';
|
|
3
|
+
import { PAGE } from '../constant/general';
|
|
4
|
+
import { useDebounce } from '../utils/debounce';
|
|
5
|
+
// import router from '../router'
|
|
6
|
+
//PINIA
|
|
7
|
+
export const responsiveObserver = ref('tablet');
|
|
8
|
+
export function useListenEvent() {
|
|
9
|
+
onMounted(() => {
|
|
10
|
+
window.addEventListener('resize', getResponsiveObserverDebounce);
|
|
11
|
+
});
|
|
12
|
+
onUnmounted(() => {
|
|
13
|
+
window.removeEventListener('resize', getResponsiveObserverDebounce);
|
|
14
|
+
});
|
|
15
|
+
const getResponsiveObserver = () => {
|
|
16
|
+
const appChatRef = document.getElementById('appChatMain');
|
|
17
|
+
if (!appChatRef)
|
|
18
|
+
return;
|
|
19
|
+
const width = appChatRef?.offsetWidth ?? 0;
|
|
20
|
+
if (width >= 1180) {
|
|
21
|
+
if (responsiveObserver.value != 'window') {
|
|
22
|
+
responsiveObserver.value = 'window';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
else if (width >= 640) {
|
|
26
|
+
if (responsiveObserver.value != 'tablet') {
|
|
27
|
+
responsiveObserver.value = 'tablet';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
if (responsiveObserver.value != 'mobile') {
|
|
32
|
+
if (currentPage.value == PAGE.HOME) {
|
|
33
|
+
currentPage.value = PAGE.CHAT_LIST;
|
|
34
|
+
}
|
|
35
|
+
responsiveObserver.value = 'mobile';
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const getResponsiveObserverDebounce = useDebounce(() => {
|
|
40
|
+
getResponsiveObserver();
|
|
41
|
+
}, 50);
|
|
42
|
+
return {
|
|
43
|
+
getResponsiveObserver
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -157,12 +157,17 @@ export function usePlivo(callback) {
|
|
|
157
157
|
callback(PLIVO_CALL_STATUS.MEDIA_PERMISSION_FAIL);
|
|
158
158
|
}
|
|
159
159
|
};
|
|
160
|
+
const plivoCallSwishSpeaker = (id) => {
|
|
161
|
+
alert(id);
|
|
162
|
+
plivoBrowserSdk?.client?.audio?.set?.(id);
|
|
163
|
+
};
|
|
160
164
|
return {
|
|
161
165
|
plivoLogin,
|
|
162
166
|
plivoCallAnswer,
|
|
163
167
|
plivoCallReject,
|
|
164
168
|
plivoCall,
|
|
165
169
|
plivoEndCall,
|
|
166
|
-
plivoCallSwishMute
|
|
170
|
+
plivoCallSwishMute,
|
|
171
|
+
plivoCallSwishSpeaker,
|
|
167
172
|
};
|
|
168
173
|
}
|
|
@@ -9,10 +9,12 @@ var Color;
|
|
|
9
9
|
Color["Primary_Hover"] = "#699FF5";
|
|
10
10
|
Color["Primary_RGB"] = "41, 121, 255";
|
|
11
11
|
// Error = '#ff3b3b',
|
|
12
|
-
|
|
12
|
+
// Error = '#EF4444',
|
|
13
|
+
Color["Error"] = "#ef4444";
|
|
13
14
|
Color["Error_Hover"] = "#FF8A75";
|
|
14
15
|
// Success = '#1DA91D',
|
|
15
|
-
|
|
16
|
+
// Success = '#22C55E',
|
|
17
|
+
Color["Success"] = "#4ade80";
|
|
16
18
|
Color["Success_Hover"] = "#5FD9A0";
|
|
17
19
|
Color["Success_Bg"] = "#E9FFE4";
|
|
18
20
|
Color["Warning"] = "#f3a22c";
|
|
@@ -13,7 +13,7 @@ export const setAxiosGciInstance = (token, domain, id) => {
|
|
|
13
13
|
instance.interceptors.response.use((response) => {
|
|
14
14
|
console.log(response);
|
|
15
15
|
const data = response?.data;
|
|
16
|
-
if (data?.status == 'OK' && data?.result?.status == 'OK' && data?.result?.data) {
|
|
16
|
+
if (data?.status == 'OK' && (data?.result?.status == 'OK' || data?.result?.status == 200) && data?.result?.data) {
|
|
17
17
|
return Promise.resolve(data?.result?.data);
|
|
18
18
|
}
|
|
19
19
|
else {
|
|
@@ -38,7 +38,7 @@ export const getProfile = async () => {
|
|
|
38
38
|
// ) as IResProfile
|
|
39
39
|
return res;
|
|
40
40
|
};
|
|
41
|
-
export const
|
|
41
|
+
export const checkTenantPhoneOnGapInsight = async () => {
|
|
42
42
|
const id = localStorage.getItem('chat_id');
|
|
43
43
|
const res = await axios.get(`/api/v1/message/tenant/get-info?tenant_name=${id}`);
|
|
44
44
|
if (res.error || !res?.data)
|