@phonghq/go-chat 1.0.1 → 1.0.2

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 (98) hide show
  1. package/dist/chat/App.vue.d.ts +2 -2
  2. package/dist/chat/App.vue.js +60 -63
  3. package/dist/chat/page/customer-appointment/{CustomerApointment.vue.js → CustomerAppointment.vue.js} +5 -5
  4. package/dist/chat/page/customer-check-in/CollapseCheckIn.vue.js +2 -2
  5. package/dist/chat/page/customer-check-in/CustomerCheckIn.vue.js +4 -4
  6. package/dist/chat/page/customer-detail/CustomerDetail.vue.d.ts +1 -1
  7. package/dist/chat/page/customer-detail/CustomerDetail.vue.js +16 -15
  8. package/dist/chat/page/customer-detail/SubInformation.vue.js +1 -1
  9. package/dist/chat/page/error/Error.vue.js +1 -1
  10. package/dist/chat/page/home/ChatList.vue.d.ts +1 -1
  11. package/dist/chat/page/home/ChatList.vue.js +11 -13
  12. package/dist/chat/page/home/ChatMessage.vue.d.ts +2 -2
  13. package/dist/chat/page/home/ChatMessage.vue.js +4 -4
  14. package/dist/chat/page/home/Home.vue.d.ts +2 -2
  15. package/dist/chat/page/home/Home.vue.js +10 -10
  16. package/dist/chat/page/home/HomeHeader.vue.d.ts +1 -1
  17. package/dist/chat/page/home/HomeHeader.vue.js +6 -6
  18. package/dist/chat/page/home/InputChat.vue.d.ts +1 -1
  19. package/dist/chat/page/home/InputChat.vue.js +13 -11
  20. package/dist/chat/page/home/NewCustomer.vue.d.ts +1 -1
  21. package/dist/chat/page/home/NewCustomer.vue.js +2 -2
  22. package/dist/components/ListenEvent.vue.js +25 -27
  23. package/dist/components/chat/ScrollEvent/ScrollEvent.vue.js +1 -1
  24. package/dist/components/chat/call/Calling.vue.d.ts +1 -1
  25. package/dist/components/chat/call/Calling.vue.js +68 -38
  26. package/dist/components/chat/common/collapse/CollapseBase.vue.js +1 -1
  27. package/dist/components/chat/common/input/InputSearch.vue.d.ts +1 -1
  28. package/dist/components/chat/common/input/InputSearch.vue.js +2 -2
  29. package/dist/components/chat/common/popover/PopoverBase.vue.js +1 -1
  30. package/dist/components/chat/layout/mobile/Footer.vue.js +10 -10
  31. package/dist/components/common/button/ButtonBase.vue.js +2 -2
  32. package/dist/components/common/button/ButtonToggle.vue.js +1 -1
  33. package/dist/components/common/checkbox/CCheckboxNumber.vue.js +1 -1
  34. package/dist/components/common/drawer/DrawerBase.vue.js +1 -1
  35. package/dist/components/common/dropdown/DropdownBase.vue.js +1 -1
  36. package/dist/components/common/input/CInputSearch.vue.js +1 -1
  37. package/dist/components/common/modal/ModalBase.vue.js +2 -2
  38. package/dist/components/common/slider/BaseSlider.vue.js +1 -1
  39. package/dist/components/modal/Confirm.vue.js +3 -3
  40. package/dist/components/ui/button/CButton.vue.js +1 -1
  41. package/dist/components/ui/checkbox/Checkbox.vue.js +1 -1
  42. package/dist/components/ui/dialog/DialogContent.vue.js +1 -1
  43. package/dist/components/ui/dialog/DialogDescription.vue.js +1 -1
  44. package/dist/components/ui/dialog/DialogFooter.vue.js +1 -1
  45. package/dist/components/ui/dialog/DialogHeader.vue.js +1 -1
  46. package/dist/components/ui/dialog/DialogScrollContent.vue.js +1 -1
  47. package/dist/components/ui/dialog/DialogTitle.vue.js +1 -1
  48. package/dist/components/ui/drawer/DrawerContent.vue.js +1 -1
  49. package/dist/components/ui/drawer/DrawerDescription.vue.js +1 -1
  50. package/dist/components/ui/drawer/DrawerFooter.vue.js +1 -1
  51. package/dist/components/ui/drawer/DrawerHeader.vue.js +1 -1
  52. package/dist/components/ui/drawer/DrawerOverlay.vue.js +1 -1
  53. package/dist/components/ui/drawer/DrawerTitle.vue.js +1 -1
  54. package/dist/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.js +1 -1
  55. package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.js +1 -1
  56. package/dist/components/ui/dropdown-menu/DropdownMenuItem.vue.js +1 -1
  57. package/dist/components/ui/dropdown-menu/DropdownMenuLabel.vue.js +1 -1
  58. package/dist/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.js +1 -1
  59. package/dist/components/ui/dropdown-menu/DropdownMenuSeparator.vue.js +1 -1
  60. package/dist/components/ui/dropdown-menu/DropdownMenuShortcut.vue.js +1 -1
  61. package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.js +1 -1
  62. package/dist/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.js +1 -1
  63. package/dist/components/ui/popover/PopoverContent.vue.js +1 -1
  64. package/dist/components/ui/radio-group/RadioGroup.vue.js +1 -1
  65. package/dist/components/ui/radio-group/RadioGroupItem.vue.js +1 -1
  66. package/dist/components/ui/slider/Slider.vue.js +1 -1
  67. package/dist/components/ui/switch/Switch.vue.js +1 -1
  68. package/dist/composable/useCallHelper.d.ts +1 -1
  69. package/dist/composable/useCallHelper.js +4 -16
  70. package/dist/composable/useInitData.d.ts +1 -1
  71. package/dist/composable/useInitData.js +8 -6
  72. package/dist/composable/useModalConfirm.d.ts +1 -1
  73. package/dist/go-chat.es.js +26369 -28399
  74. package/dist/go-chat.umd.js +15 -23
  75. package/dist/plugins/mqtt.d.ts +2 -1
  76. package/dist/plugins/mqtt.js +1 -2
  77. package/dist/plugins/sdk.js +3 -3
  78. package/dist/plugins/websocket.d.ts +4 -1
  79. package/dist/plugins/websocket.js +61 -22
  80. package/dist/style.css +1 -1
  81. package/dist/utils/chat/auth.d.ts +1 -1
  82. package/dist/utils/chat/auth.js +2 -2
  83. package/dist/utils/chat/call.d.ts +4 -0
  84. package/dist/utils/chat/call.js +52 -1
  85. package/dist/utils/chat/chat-router.d.ts +1 -1
  86. package/dist/utils/chat/chat-router.js +1 -1
  87. package/dist/utils/chat/conversation.d.ts +2 -2
  88. package/dist/utils/chat/conversation.js +1 -1
  89. package/dist/utils/chat/message.d.ts +2 -2
  90. package/dist/utils/chat/message.js +1 -1
  91. package/dist/utils/chat/user.d.ts +2 -2
  92. package/dist/utils/chat/user.js +1 -1
  93. package/dist/utils/json.d.ts +2 -0
  94. package/dist/utils/json.js +18 -0
  95. package/package.json +1 -1
  96. package/dist/stores/general.d.ts +0 -48
  97. package/dist/stores/general.js +0 -39
  98. /package/dist/chat/page/customer-appointment/{CustomerApointment.vue.d.ts → CustomerAppointment.vue.d.ts} +0 -0
@@ -1,20 +1,14 @@
1
- import { publishMessage } from '@/plugins/mqtt';
2
- import { TOPIC_DETAIL_CALL } from '@/constant/mqtt';
3
- import { getIceService } from '@/utils/chat/call';
4
- import { dataProfile } from '@/utils/chat/auth';
1
+ import { publishMessage } from '../plugins/mqtt';
2
+ import { TOPIC_DETAIL_CALL } from '../constant/mqtt';
3
+ import { getIceService } from '../utils/chat/call';
4
+ import { dataProfile } from '../utils/chat/auth';
5
5
  import { ref } from 'vue';
6
6
  export function useCallHelper() {
7
7
  let pc;
8
8
  let iceStunServiceLink = '';
9
- let iceTurnServiceLink = '';
10
9
  let iceServer = null;
11
10
  let answer;
12
11
  let offer = null;
13
- // const servers = {
14
- // iceServers: [
15
- // { urls: 'stun:stun.l.google.com:19302' }
16
- // ]
17
- // }
18
12
  const remoteAudio = () => {
19
13
  return document.getElementById('go-chat-remote-audio');
20
14
  };
@@ -22,11 +16,6 @@ export function useCallHelper() {
22
16
  return document.getElementById('go-chat-local-audio');
23
17
  };
24
18
  const userRemoter = ref(null);
25
- // const start = async () => {
26
- // localStream = await navigator?.mediaDevices?.getUserMedia({ audio: true })
27
- // const local = localAudio() as any
28
- // if (local) local.srcObject = localStream
29
- // }
30
19
  const call = async (user) => {
31
20
  userRemoter.value = user;
32
21
  await getIceServiceLink();
@@ -120,7 +109,6 @@ export function useCallHelper() {
120
109
  const res = await getIceService();
121
110
  console.log(res);
122
111
  iceStunServiceLink = res[0]?.urls[0] ?? '';
123
- iceTurnServiceLink = res[1]?.urls[0] ?? '';
124
112
  iceServer = res;
125
113
  };
126
114
  const handleOffer = async (data) => {
@@ -1,4 +1,4 @@
1
- import type { PAGE_RESPONSE } from '@/types/chat/global';
1
+ import type { PAGE_RESPONSE } from '../types/chat/global';
2
2
  export declare const isRouterReady: import("vue").Ref<boolean, boolean>;
3
3
  export declare function useInitData(): {
4
4
  NOTIFY_ID_APPOINTMENT_NAME: string;
@@ -1,10 +1,11 @@
1
1
  import { ref } from 'vue';
2
- import { sdkInit } from '@/plugins/sdk';
3
- import { dataProfile, getProfile, loginLink } from '@/utils/chat/auth';
4
- import { routerPush } from '@/utils/chat/chat-router';
5
- import { PAGE } from '@/constant/general';
6
- import { subscribeToTopic, unsubscribeFromTopic } from '@/plugins/mqtt';
7
- import { TOPIC_DETAIL_CALL } from '@/constant/mqtt';
2
+ import { sdkInit } from '../plugins/sdk';
3
+ import { dataProfile, getProfile, loginLink } from '../utils/chat/auth';
4
+ import { routerPush } from '../utils/chat/chat-router';
5
+ import { PAGE } from '../constant/general';
6
+ import { subscribeToTopic, unsubscribeFromTopic } from '../plugins/mqtt';
7
+ import { TOPIC_DETAIL_CALL } from '../constant/mqtt';
8
+ import { getWebSocket } from '../plugins/websocket';
8
9
  //PINIA
9
10
  export const isRouterReady = ref(false);
10
11
  export function useInitData() {
@@ -38,6 +39,7 @@ export function useInitData() {
38
39
  };
39
40
  const initData = async () => {
40
41
  await getProfile();
42
+ getWebSocket();
41
43
  unsubscribeFromTopic(TOPIC_DETAIL_CALL + dataProfile.value?.id);
42
44
  subscribeToTopic(TOPIC_DETAIL_CALL + dataProfile.value?.id);
43
45
  };
@@ -1,4 +1,4 @@
1
- import type { ConfirmPayloadPromise, ConfirmPayload } from '@/types/chat/promise';
1
+ import type { ConfirmPayloadPromise, ConfirmPayload } from '../types/chat/promise';
2
2
  export declare function useModalConfirm(): {
3
3
  setHandleConfirm: (callback: (data: ConfirmPayloadPromise) => void) => void;
4
4
  modalConfirm: (data: ConfirmPayload) => Promise<any>;