agora-appbuilder-core 4.0.7 → 4.0.8

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 (79) hide show
  1. package/package.json +1 -1
  2. package/template/_package-lock.json +82 -0
  3. package/template/android/app/build.gradle +8 -0
  4. package/template/android/build.gradle +3 -0
  5. package/template/bridge/rtc/webNg/RtcEngine.ts +581 -31
  6. package/template/bridge/rtc/webNg/RtcSurfaceView.tsx +2 -1
  7. package/template/bridge/rtm/web/index.ts +2 -1
  8. package/template/customization-api/customize.ts +29 -10
  9. package/template/index.js +17 -1
  10. package/template/index.web.js +2 -2
  11. package/template/package.json +3 -0
  12. package/template/src/SDKAppWrapper.tsx +44 -2
  13. package/template/src/app-state/useNoiseSupression.native.tsx +6 -0
  14. package/template/src/app-state/useNoiseSupression.tsx +17 -0
  15. package/template/src/auth/AuthProvider.tsx +145 -8
  16. package/template/src/auth/IDPAuth.electron.tsx +2 -1
  17. package/template/src/auth/IDPAuth.tsx +8 -2
  18. package/template/src/auth/openIDPURL.native.tsx +14 -3
  19. package/template/src/auth/useTokenAuth.tsx +7 -1
  20. package/template/src/components/Controls.tsx +2 -1
  21. package/template/src/components/DeviceConfigure.tsx +67 -17
  22. package/template/src/components/Precall.tsx +21 -0
  23. package/template/src/components/RTMConfigure.tsx +188 -24
  24. package/template/src/components/SettingsView.tsx +2 -0
  25. package/template/src/components/Share.tsx +11 -0
  26. package/template/src/components/StorageContext.tsx +32 -2
  27. package/template/src/components/chat-messages/useChatMessages.tsx +65 -5
  28. package/template/src/components/contexts/WaitingRoomContext.tsx +5 -1
  29. package/template/src/components/precall/joinCallBtn.tsx +6 -0
  30. package/template/src/components/precall/usePreCall.tsx +18 -2
  31. package/template/src/components/room-info/useRoomInfo.tsx +28 -25
  32. package/template/src/components/useUserPreference.tsx +13 -2
  33. package/template/src/components/useWakeLock.tsx +18 -4
  34. package/template/src/components/virtual-background/VBCard.tsx +40 -1
  35. package/template/src/components/virtual-background/VButils.native.ts +24 -5
  36. package/template/src/components/virtual-background/VButils.ts +29 -5
  37. package/template/src/components/virtual-background/VideoPreview.tsx +11 -1
  38. package/template/src/components/virtual-background/useVB.native.tsx +19 -3
  39. package/template/src/components/whiteboard/WhiteboardConfigure.tsx +32 -5
  40. package/template/src/components/whiteboard/WhiteboardToolBox.tsx +38 -8
  41. package/template/src/components/whiteboard/WhiteboardView.native.tsx +37 -13
  42. package/template/src/language/useLanguage.tsx +10 -4
  43. package/template/src/logger/AppBuilderLogger.tsx +215 -0
  44. package/template/src/logger/constants.ts +18 -0
  45. package/template/src/logger/transports/agora-transport.native.ts +58 -0
  46. package/template/src/logger/transports/agora-transport.ts +28 -0
  47. package/template/src/logger/transports/customer-transport.ts +115 -0
  48. package/template/src/pages/Create.tsx +27 -2
  49. package/template/src/pages/Endcall.tsx +6 -1
  50. package/template/src/pages/Join.tsx +31 -4
  51. package/template/src/pages/VideoCall.tsx +20 -56
  52. package/template/src/pages/video-call/DefaultLayouts.ts +11 -3
  53. package/template/src/pages/video-call/SidePanelHeader.tsx +12 -2
  54. package/template/src/pages/video-call/VideoCallScreen.tsx +8 -0
  55. package/template/src/pages/video-call/VideoRenderer.tsx +6 -0
  56. package/template/src/rtm/RTMEngine.ts +5 -0
  57. package/template/src/rtm-events-api/Events.ts +70 -16
  58. package/template/src/subComponents/LayoutIconDropdown.tsx +6 -0
  59. package/template/src/subComponents/LocalAudioMute.tsx +13 -3
  60. package/template/src/subComponents/LocalEndCall.tsx +8 -3
  61. package/template/src/subComponents/LocalVideoMute.tsx +15 -1
  62. package/template/src/subComponents/SelectDevice.tsx +111 -3
  63. package/template/src/subComponents/caption/CaptionContainer.tsx +17 -2
  64. package/template/src/subComponents/caption/useSTTAPI.tsx +62 -20
  65. package/template/src/subComponents/caption/useTranscriptDownload.native.ts +35 -5
  66. package/template/src/subComponents/caption/useTranscriptDownload.ts +12 -2
  67. package/template/src/subComponents/chat/ChatParticipants.tsx +6 -0
  68. package/template/src/subComponents/recording/useRecording.tsx +102 -15
  69. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +33 -2
  70. package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +18 -2
  71. package/template/src/subComponents/waiting-rooms/useWaitingRoomAPI.ts +26 -0
  72. package/template/src/utils/axiomLogger.ts +2 -1
  73. package/template/src/utils/useCreateRoom.ts +30 -0
  74. package/template/src/utils/useFindActiveSpeaker.ts +43 -0
  75. package/template/src/utils/useFocus.tsx +8 -3
  76. package/template/src/utils/useIsLocalUserSpeaking.ts +19 -3
  77. package/template/src/utils/useJoinRoom.ts +27 -0
  78. package/template/src/utils/useLayout.tsx +9 -3
  79. package/template/src/utils/useSidePanel.tsx +14 -3
@@ -7,6 +7,7 @@ import {GraphQLContext} from '../components/GraphQLProvider';
7
7
  import useGetName from './useGetName';
8
8
  import useWaitingRoomAPI from '../subComponents/waiting-rooms/useWaitingRoomAPI';
9
9
  import {base64ToUint8Array} from '../utils';
10
+ import {LogSource, logger} from '../logger/AppBuilderLogger';
10
11
 
11
12
  const JOIN_CHANNEL_PHRASE_AND_GET_USER = gql`
12
13
  query JoinChannel($passphrase: String!) {
@@ -85,11 +86,21 @@ export default function useJoinRoom() {
85
86
  try {
86
87
  let response = null;
87
88
  if (isWaitingRoomEnabled) {
89
+ logger.log(
90
+ LogSource.NetworkRest,
91
+ 'channel_join_request',
92
+ 'API channel_join_request. Trying request to join channel as waiting room is enabled',
93
+ );
88
94
  response = await requestToJoin({
89
95
  meetingPhrase: phrase,
90
96
  send_event: false,
91
97
  });
92
98
  } else {
99
+ logger.log(
100
+ LogSource.NetworkRest,
101
+ 'joinChannel',
102
+ 'API joinChannel. Trying to join channel. Waiting room is disabled',
103
+ );
93
104
  response = await client.query({
94
105
  query:
95
106
  store.token === null
@@ -102,10 +113,26 @@ export default function useJoinRoom() {
102
113
  });
103
114
  }
104
115
  if (response?.error) {
116
+ logger.error(
117
+ LogSource.NetworkRest,
118
+ `${isWaitingRoomEnabled ? 'channel_join_request' : 'joinChannel'}`,
119
+ `API ${
120
+ isWaitingRoomEnabled ? 'channel_join_request' : 'joinChannel'
121
+ } failed.`,
122
+ response?.error,
123
+ );
105
124
  throw response.error;
106
125
  } else {
107
126
  if ((response && response.data) || isWaitingRoomEnabled) {
108
127
  let data = isWaitingRoomEnabled ? response : response.data;
128
+ logger.log(
129
+ LogSource.NetworkRest,
130
+ `${isWaitingRoomEnabled ? 'channel_join_request' : 'joinChannel'}`,
131
+ `API to ${
132
+ isWaitingRoomEnabled ? 'channel_join_request' : 'joinChannel'
133
+ } successful.`,
134
+ phrase,
135
+ );
109
136
  let roomInfo: Partial<RoomInfoContextInterface['data']> = {};
110
137
 
111
138
  if (data?.joinChannel?.channel || data?.channel) {
@@ -10,8 +10,10 @@
10
10
  *********************************************
11
11
  */
12
12
 
13
- import React, {SetStateAction} from 'react';
13
+ import React, {SetStateAction, useState} from 'react';
14
14
  import {createHook} from 'customization-implementation';
15
+ import useLayoutsData from '../pages/video-call/useLayoutsData';
16
+ import {isArray} from './common';
15
17
 
16
18
  export interface LayoutContextInterface {
17
19
  currentLayout: string;
@@ -24,12 +26,16 @@ const LayoutContext = React.createContext<LayoutContextInterface>({
24
26
  });
25
27
 
26
28
  interface LayoutProviderProps {
27
- value: LayoutContextInterface;
28
29
  children: React.ReactNode;
29
30
  }
30
31
  const LayoutProvider = (props: LayoutProviderProps) => {
32
+ const layouts = useLayoutsData();
33
+ const defaultLayoutName = isArray(layouts) ? layouts[0].name : '';
34
+ const [currentLayout, setLayout] = useState(defaultLayoutName);
35
+
36
+ const value = {currentLayout, setLayout};
31
37
  return (
32
- <LayoutContext.Provider value={{...props.value}}>
38
+ <LayoutContext.Provider value={value}>
33
39
  {props.children}
34
40
  </LayoutContext.Provider>
35
41
  );
@@ -10,9 +10,10 @@
10
10
  *********************************************
11
11
  */
12
12
 
13
- import React, {SetStateAction} from 'react';
13
+ import React, {useState, SetStateAction, useEffect} from 'react';
14
14
  import {SidePanelType} from '../subComponents/SidePanelEnum';
15
15
  import {createHook} from 'customization-implementation';
16
+ import {LogSource, logger} from '../logger/AppBuilderLogger';
16
17
 
17
18
  export interface SidePanelContextInterface {
18
19
  sidePanel: SidePanelType;
@@ -25,12 +26,22 @@ const SidePanelContext = React.createContext<SidePanelContextInterface>({
25
26
  });
26
27
 
27
28
  interface SidePanelProviderProps {
28
- value: SidePanelContextInterface;
29
29
  children: React.ReactNode;
30
30
  }
31
31
  const SidePanelProvider = (props: SidePanelProviderProps) => {
32
+ const [sidePanel, setSidePanel] = useState<SidePanelType>(SidePanelType.None);
33
+
34
+ useEffect(() => {
35
+ logger.log(
36
+ LogSource.Internals,
37
+ 'CONTROLS',
38
+ `Side panel changed to -> ${SidePanelType[sidePanel]}`,
39
+ );
40
+ }, [sidePanel]);
41
+
42
+ const value = {sidePanel, setSidePanel};
32
43
  return (
33
- <SidePanelContext.Provider value={{...props.value}}>
44
+ <SidePanelContext.Provider value={value}>
34
45
  {props.children}
35
46
  </SidePanelContext.Provider>
36
47
  );