@phonghq/go-chat 1.0.23 → 1.0.25

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 (56) hide show
  1. package/README.md +1 -1
  2. package/dist/assets/icons/IconCloseCircle.vue.d.ts +2 -0
  3. package/dist/assets/icons/IconSetting.vue.d.ts +2 -0
  4. package/dist/chat/App.vue.d.ts +2 -0
  5. package/dist/chat/page/home/ChatList.vue.d.ts +6 -3
  6. package/dist/chat/page/home/ChatMessage.vue.d.ts +2 -0
  7. package/dist/chat/page/home/ChatMessageItem.vue.d.ts +18 -0
  8. package/dist/chat/page/home/Home.vue.d.ts +4 -0
  9. package/dist/chat/page/setting/Setting.vue.d.ts +2 -0
  10. package/dist/components/chat/call/Calling.vue.d.ts +2 -0
  11. package/dist/components/chat/common/switch/SwitchBase.vue.d.ts +14 -0
  12. package/dist/components/chat/common/tab/TabBase.vue.d.ts +30 -0
  13. package/dist/components/chat/select/SelectBase.vue.d.ts +2 -0
  14. package/dist/components/common/drawer/DrawerBase.vue.d.ts +1 -1
  15. package/dist/components/common/drawer/DrawerBaseCustom.vue.d.ts +1 -0
  16. package/dist/composable/useCallHelper.d.ts +2 -0
  17. package/dist/composable/useListConversations.d.ts +48 -0
  18. package/dist/constant/color.d.ts +2 -2
  19. package/dist/go-chat.es.js +28838 -28734
  20. package/dist/go-chat.umd.js +14 -14
  21. package/dist/style.css +1 -1
  22. package/dist/test/assets/icons/IconCloseCircle.vue.js +36 -0
  23. package/dist/test/assets/icons/IconSetting.vue.js +33 -0
  24. package/dist/test/chat/App.vue.js +191 -90
  25. package/dist/test/chat/page/customer-detail/CustomerDetail.vue.js +0 -3
  26. package/dist/test/chat/page/home/ChatList.vue.js +225 -137
  27. package/dist/test/chat/page/home/ChatMessage.vue.js +45 -181
  28. package/dist/test/chat/page/home/ChatMessageItem.vue.js +335 -0
  29. package/dist/test/chat/page/home/Home.vue.js +38 -65
  30. package/dist/test/chat/page/home/HomeHeader.vue.js +18 -18
  31. package/dist/test/chat/page/home/InputChat.vue.js +62 -34
  32. package/dist/test/chat/page/setting/Setting.vue.js +125 -0
  33. package/dist/test/components/chat/call/Calling.vue.js +36 -24
  34. package/dist/test/components/chat/common/switch/SwitchBase.vue.js +70 -0
  35. package/dist/test/components/chat/common/tab/TabBase.vue.js +85 -0
  36. package/dist/test/components/chat/select/SelectBase.vue.js +26 -18
  37. package/dist/test/components/common/drawer/DrawerBaseCustom.vue.js +9 -4
  38. package/dist/test/composable/useDigibot.js +2 -1
  39. package/dist/test/composable/useInitData.js +4 -7
  40. package/dist/test/composable/useListConversations.js +124 -0
  41. package/dist/test/composable/usePlivo.js +18 -6
  42. package/dist/test/constant/color.js +4 -2
  43. package/dist/test/types/chat/call.js +4 -1
  44. package/dist/test/utils/chat/auth.js +15 -0
  45. package/dist/test/utils/chat/conversation.js +57 -0
  46. package/dist/test/utils/chat/phone-string.js +1 -1
  47. package/dist/types/chat/auth.d.ts +2 -0
  48. package/dist/types/chat/call.d.ts +3 -0
  49. package/dist/types/chat/global.d.ts +1 -0
  50. package/dist/types/conversation.d.ts +3 -1
  51. package/dist/types/message.d.ts +6 -0
  52. package/dist/utils/chat/auth.d.ts +5 -0
  53. package/dist/utils/chat/conversation.d.ts +7 -0
  54. package/dist/utils/chat/phone-string.d.ts +1 -1
  55. package/dist/utils/chat/user.d.ts +2 -0
  56. package/package.json +1 -1
package/README.md CHANGED
@@ -40,4 +40,4 @@ npm run lint
40
40
 
41
41
  ...build
42
42
  yarn vue-tsc -p tsconfig.build.json
43
- api/v1/message/tenant/gci-link?tenant_id=test1&phone=16013818811&message=Test message nè&customer_name=Loi v&business_name=Nail Spa New v
43
+ /tenant?tenant_id=test1&phone=16013818811&message=Test%20message%20n%C3%A8&customer_name=Loi%20v&business_name=Nail%20Spa%20New%20v
@@ -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,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;
@@ -3,8 +3,10 @@ import type { IResUser } from '../types/message';
3
3
  import '../style/index.scss';
4
4
  declare const _default: import("vue").DefineComponent<GoChatProps, GoChatInstance, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
5
5
  userCalling: (id: IResUser) => any;
6
+ "error:noPhoneTenant": () => any;
6
7
  }, string, import("vue").PublicProps, Readonly<GoChatProps> & Readonly<{
7
8
  onUserCalling?: ((id: IResUser) => any) | undefined;
9
+ "onError:noPhoneTenant"?: (() => any) | undefined;
8
10
  }>, {
9
11
  response: PAGE_RESPONSE;
10
12
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -10,11 +10,11 @@ type __VLS_ModelProps = {
10
10
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
11
11
  declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {
12
12
  handleReadMessage: () => void;
13
- listConversations: import("vue").Ref<{
13
+ listConversationsAll: import("vue").Ref<{
14
14
  id: number;
15
15
  receiver_id: number;
16
16
  username: string | null;
17
- customer_phone: string;
17
+ phone: string;
18
18
  avatar: string | null;
19
19
  last_message: string;
20
20
  last_message_time: string;
@@ -23,11 +23,12 @@ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {
23
23
  unread_count: number;
24
24
  status: number;
25
25
  color: string;
26
+ is_unknown: number;
26
27
  }[], IConversation[] | {
27
28
  id: number;
28
29
  receiver_id: number;
29
30
  username: string | null;
30
- customer_phone: string;
31
+ phone: string;
31
32
  avatar: string | null;
32
33
  last_message: string;
33
34
  last_message_time: string;
@@ -36,7 +37,9 @@ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {
36
37
  unread_count: number;
37
38
  status: number;
38
39
  color: string;
40
+ is_unknown: number;
39
41
  }[]>;
42
+ getCurrentConversation: () => IConversation | undefined;
40
43
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
41
44
  "update:receiverId": (value: any) => any;
42
45
  } & {
@@ -12,7 +12,9 @@ declare const _default: import("vue").DefineComponent<Props, {
12
12
  fixedScroll: () => void;
13
13
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
14
14
  scrollTop: () => any;
15
+ callBack: () => any;
15
16
  }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
16
17
  onScrollTop?: (() => any) | undefined;
18
+ onCallBack?: (() => any) | undefined;
17
19
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
20
  export default _default;
@@ -0,0 +1,18 @@
1
+ import type { IResMessage, IResUser } from '../../../types/message';
2
+ import type { PAGE_RESPONSE } from '../../../types/chat/global';
3
+ type Props = {
4
+ message: IResMessage;
5
+ responsive: PAGE_RESPONSE;
6
+ isEndMessage: boolean;
7
+ isMyMessage: boolean;
8
+ isLastMessage: boolean;
9
+ shouldShowAvatar: boolean;
10
+ isChatFinished: boolean;
11
+ data: IResUser | null;
12
+ };
13
+ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
14
+ callAgain: () => any;
15
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
16
+ onCallAgain?: (() => any) | undefined;
17
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ export default _default;
@@ -6,6 +6,10 @@ type Props = {
6
6
  };
7
7
  declare const _default: import("vue").DefineComponent<Props, {
8
8
  getData: (data?: any) => Promise<void>;
9
+ handleGetMessage: (option?: {
10
+ resetList?: boolean | undefined;
11
+ } | undefined) => Promise<void>;
12
+ infoUser: import("vue").ShallowRef<IResUser | null>;
9
13
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
10
14
  call: (value: IResUser) => any;
11
15
  }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
@@ -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;
@@ -5,7 +5,9 @@ type __VLS_Props = {
5
5
  };
6
6
  declare const _default: import("vue").DefineComponent<__VLS_Props, CallInstance, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
7
7
  userCalling: (id: IResUser) => any;
8
+ endCall: (id: IResUser | null, type: string) => any;
8
9
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
10
  onUserCalling?: ((id: IResUser) => any) | undefined;
11
+ onEndCall?: ((id: IResUser | null, type: string) => any) | undefined;
10
12
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
13
  export default _default;
@@ -0,0 +1,14 @@
1
+ type Props = {
2
+ label?: string;
3
+ };
4
+ type __VLS_Props = Props;
5
+ type __VLS_ModelProps = {
6
+ modelValue?: boolean;
7
+ };
8
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
9
+ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ "update:modelValue": (value: boolean | undefined) => any;
11
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
12
+ "onUpdate:modelValue"?: ((value: boolean | undefined) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ export default _default;
@@ -0,0 +1,30 @@
1
+ type Props = {
2
+ tabs: {
3
+ label: string;
4
+ value: any;
5
+ badge?: string;
6
+ }[];
7
+ };
8
+ type __VLS_Props = Props;
9
+ type __VLS_ModelProps = {
10
+ 'active'?: any;
11
+ };
12
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
13
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
+ "update:active": (value: any) => any;
15
+ } & {
16
+ change: (val: any) => any;
17
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
18
+ onChange?: ((val: any) => any) | undefined;
19
+ "onUpdate:active"?: ((value: any) => any) | undefined;
20
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
21
+ [x: string]: ((props: {}) => any) | undefined;
22
+ [x: number]: ((props: {}) => any) | undefined;
23
+ [x: symbol]: ((props: {}) => any) | undefined;
24
+ }>;
25
+ export default _default;
26
+ type __VLS_WithSlots<T, S> = T & {
27
+ new (): {
28
+ $slots: S;
29
+ };
30
+ };
@@ -4,6 +4,8 @@ type __VLS_Props = {
4
4
  label: string;
5
5
  value: string | number;
6
6
  }[];
7
+ placement?: 'top' | 'bottom';
8
+ disabled?: boolean;
7
9
  };
8
10
  declare const _default: __VLS_WithSlots<import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
9
11
  select: (id: any) => any;
@@ -24,8 +24,8 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<__VLS_Publ
24
24
  }>, {
25
25
  title: string;
26
26
  width: string | number;
27
- showTitle: boolean;
28
27
  placement: import("vaul-vue").DrawerDirection;
28
+ showTitle: boolean;
29
29
  showButtonClose: boolean;
30
30
  disableClose: boolean;
31
31
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
@@ -5,6 +5,7 @@ type __VLS_Props = {
5
5
  width?: number;
6
6
  responsive: PAGE_RESPONSE;
7
7
  disabledClose?: boolean;
8
+ absolute?: boolean;
8
9
  };
9
10
  declare const _default: __VLS_WithSlots<import("vue").DefineComponent<__VLS_Props, {
10
11
  close: () => Promise<void>;
@@ -25,6 +25,7 @@ export declare function useCallHelper(): {
25
25
  color: string;
26
26
  status: number;
27
27
  last_offline_at: string;
28
+ is_unknown: number;
28
29
  } | null, IResUser | {
29
30
  id: string;
30
31
  username: string;
@@ -35,6 +36,7 @@ export declare function useCallHelper(): {
35
36
  color: string;
36
37
  status: number;
37
38
  last_offline_at: string;
39
+ is_unknown: number;
38
40
  } | null>;
39
41
  testPlay: () => void;
40
42
  handleCallAnswer: (data: any) => void;
@@ -0,0 +1,48 @@
1
+ import type { IConversation, IParamGetConversation } from '../types/conversation';
2
+ export declare const useListConversations: (is_unknown: number) => {
3
+ listConversations: import("vue").Ref<{
4
+ id: number;
5
+ receiver_id: number;
6
+ username: string | null;
7
+ phone: string;
8
+ avatar: string | null;
9
+ last_message: string;
10
+ last_message_time: string;
11
+ created_at: string;
12
+ updated_at: string;
13
+ unread_count: number;
14
+ status: number;
15
+ color: string;
16
+ is_unknown: number;
17
+ }[], IConversation[] | {
18
+ id: number;
19
+ receiver_id: number;
20
+ username: string | null;
21
+ phone: string;
22
+ avatar: string | null;
23
+ last_message: string;
24
+ last_message_time: string;
25
+ created_at: string;
26
+ updated_at: string;
27
+ unread_count: number;
28
+ status: number;
29
+ color: string;
30
+ is_unknown: number;
31
+ }[]>;
32
+ params: import("vue").Ref<{
33
+ page: number;
34
+ search: string;
35
+ }, {
36
+ page: number;
37
+ search: string;
38
+ } | {
39
+ page: number;
40
+ search: string;
41
+ }>;
42
+ pageCount: number;
43
+ getData: (data?: IParamGetConversation, option?: {
44
+ reset?: boolean;
45
+ hideLoading?: boolean;
46
+ }) => Promise<void>;
47
+ handleReadMessage: (receiver_id: any) => void;
48
+ };
@@ -6,9 +6,9 @@ declare const enum Color {
6
6
  Primary = "#0051E6",
7
7
  Primary_Hover = "#699FF5",
8
8
  Primary_RGB = "41, 121, 255",
9
- Error = "#ff3b3b",
9
+ Error = "#EF4444",
10
10
  Error_Hover = "#FF8A75",
11
- Success = "#1DA91D",
11
+ Success = "#22C55E",
12
12
  Success_Hover = "#5FD9A0",
13
13
  Success_Bg = "#E9FFE4",
14
14
  Warning = "#f3a22c",