agora-appbuilder-core 2.3.0-beta.9 → 3.0.1

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 (206) hide show
  1. package/Readme.md +11 -6
  2. package/package.json +1 -1
  3. package/template/Gulpfile.js +121 -83
  4. package/template/_gitignore +2 -2
  5. package/template/_package-lock.json +12959 -13248
  6. package/template/agora-rn-uikit/src/AgoraUIKit.tsx +2 -2
  7. package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +2 -0
  8. package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +3 -3
  9. package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +4 -5
  10. package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +3 -1
  11. package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +2 -2
  12. package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +1 -1
  13. package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +1 -1
  14. package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +1 -1
  15. package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +1 -1
  16. package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +4 -4
  17. package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +7 -5
  18. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +1 -1
  19. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +1 -1
  20. package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +2 -2
  21. package/template/agora-rn-uikit/src/Rtc/Create.tsx +88 -43
  22. package/template/agora-rn-uikit/src/Rtc/Join.tsx +13 -4
  23. package/template/agora-rn-uikit/src/RtcConfigure.tsx +36 -19
  24. package/template/agora-rn-uikit/src/Utils/permission.ts +17 -6
  25. package/template/babel.config.js +9 -9
  26. package/template/bridge/rtc/webNg/RtcEngine.ts +51 -26
  27. package/template/customization-api/action-library.ts +22 -0
  28. package/template/{fpe-api/context.ts → customization-api/app-state.ts} +21 -14
  29. package/template/customization-api/customEvents.ts +9 -0
  30. package/template/{fpe-api/install.ts → customization-api/customize.ts} +27 -26
  31. package/template/{fpe-api → customization-api}/index.ts +11 -6
  32. package/template/{fpe-api/components.ts → customization-api/sub-components.ts} +22 -3
  33. package/template/{fpe-api → customization-api}/typeDefinition.ts +13 -14
  34. package/template/customization-api/utils.ts +30 -0
  35. package/template/{fpe-implementation → customization-implementation}/createHook.ts +0 -0
  36. package/template/{fpe-implementation/dummyFpe.ts → customization-implementation/dummyConfig.ts} +4 -4
  37. package/template/customization-implementation/index.ts +4 -0
  38. package/template/{fpe-api/useFpe.tsx → customization-implementation/useCustomization.tsx} +12 -12
  39. package/template/{fpe.config.js → customization.config.js} +11 -11
  40. package/template/electron/main/index.js +42 -35
  41. package/template/esbuild.rsdk.go +8 -17
  42. package/template/global.d.ts +4 -3
  43. package/template/index.rsdk.tsx +13 -5
  44. package/template/index.wsdk.tsx +21 -5
  45. package/template/package.json +3 -0
  46. package/template/react-native-toast-message/src/index.js +3 -7
  47. package/template/react-native-toast-message/src/{index.wsdk.js → index.sdk.tsx} +1 -1
  48. package/template/react-native-toast-message/src/styles.sdk.ts +17 -0
  49. package/template/src/App.tsx +8 -4
  50. package/template/src/AppWrapper.tsx +8 -6
  51. package/template/src/SDKAppWrapper.tsx +28 -21
  52. package/template/src/app-state/useLocalUserInfo.ts +11 -0
  53. package/template/src/app-state/useMessages.ts +55 -0
  54. package/template/src/atoms/PrimaryButton.tsx +2 -2
  55. package/template/src/atoms/SecondaryButton.tsx +12 -4
  56. package/template/src/atoms/TextInput.tsx +2 -2
  57. package/template/src/components/Chat.tsx +22 -11
  58. package/template/src/components/ChatContext.ts +10 -27
  59. package/template/src/components/Controls.native.tsx +13 -7
  60. package/template/src/components/Controls.tsx +15 -24
  61. package/template/src/components/DeviceConfigure.tsx +4 -3
  62. package/template/src/components/EventsConfigure.tsx +54 -0
  63. package/template/src/components/GridVideo.tsx +5 -6
  64. package/template/src/components/HostControlView.tsx +13 -19
  65. package/template/src/components/Navbar.tsx +54 -41
  66. package/template/src/components/NetworkQualityContext.tsx +4 -3
  67. package/template/src/components/ParticipantsView.tsx +7 -7
  68. package/template/src/components/PinnedVideo.tsx +3 -4
  69. package/template/src/components/Precall.native.tsx +3 -3
  70. package/template/src/components/Precall.tsx +14 -10
  71. package/template/src/components/RTMConfigure.tsx +61 -219
  72. package/template/src/components/SettingsView.tsx +6 -3
  73. package/template/src/components/Share.tsx +24 -18
  74. package/template/src/components/chat-messages/useChatMessages.tsx +397 -80
  75. package/template/src/components/chat-notification/useChatNotification.tsx +2 -2
  76. package/template/src/components/chat-ui/useChatUIControl.tsx +4 -1
  77. package/template/src/components/common/Logo.tsx +3 -2
  78. package/template/src/components/contexts/LiveStreamDataContext.tsx +3 -3
  79. package/template/src/components/contexts/ScreenShareContext.tsx +3 -1
  80. package/template/src/components/contexts/VideoMeetingDataContext.tsx +85 -0
  81. package/template/src/components/contexts/WhiteboardContext.tsx +8 -8
  82. package/template/src/components/livestream/LiveStreamContext.tsx +88 -74
  83. package/template/src/components/meeting-info/useMeetingInfo.tsx +26 -19
  84. package/template/src/components/meeting-info/useSetMeetingInfo.tsx +1 -1
  85. package/template/src/components/participants/AllAudienceParticipants.tsx +2 -2
  86. package/template/src/components/participants/AllHostParticipants.tsx +4 -4
  87. package/template/src/components/participants/MeParticipant.tsx +5 -3
  88. package/template/src/components/participants/ParticipantName.tsx +2 -2
  89. package/template/src/components/participants/RemoteParticipants.tsx +9 -7
  90. package/template/src/components/precall/LocalMute.native.tsx +14 -10
  91. package/template/src/components/precall/LocalMute.tsx +7 -5
  92. package/template/src/components/precall/VideoPreview.native.tsx +6 -6
  93. package/template/src/components/precall/VideoPreview.tsx +3 -3
  94. package/template/src/components/precall/joinCallBtn.tsx +3 -3
  95. package/template/src/components/precall/meetingTitle.tsx +3 -1
  96. package/template/src/components/precall/selectDevice.tsx +2 -2
  97. package/template/src/components/precall/usePreCall.tsx +1 -1
  98. package/template/src/components/styles.ts +3 -3
  99. package/template/src/components/useShareLink.tsx +69 -29
  100. package/template/src/components/useUserPreference.tsx +16 -15
  101. package/template/src/components/useWakeLock.tsx +3 -3
  102. package/template/src/language/i18nTypes.ts +1 -1
  103. package/template/src/language/index.ts +2 -2
  104. package/template/src/language/useLanguage.tsx +2 -3
  105. package/template/src/pages/Authenticate.tsx +3 -2
  106. package/template/src/pages/Create.tsx +18 -20
  107. package/template/src/pages/Join.tsx +6 -7
  108. package/template/src/pages/VideoCall.tsx +74 -66
  109. package/template/src/pages/create/useCreate.tsx +1 -1
  110. package/template/src/pages/video-call/CustomUserContextHolder.tsx +14 -6
  111. package/template/src/pages/video-call/DefaultLayouts.ts +8 -8
  112. package/template/src/pages/video-call/{NameWithMicStatus.tsx → NameWithMicIcon.tsx} +8 -1
  113. package/template/src/pages/video-call/RenderComponent.tsx +7 -10
  114. package/template/src/pages/video-call/VideoCallScreen.tsx +31 -22
  115. package/template/src/pages/video-call/VideoComponent.tsx +13 -15
  116. package/template/src/pages/video-call/VideoRenderer.tsx +6 -6
  117. package/template/src/pages/video-call/useLayoutsData.ts +23 -0
  118. package/template/src/rtm/RTMEngine.ts +13 -0
  119. package/template/src/rtm-events/EventUtils.ts +20 -20
  120. package/template/src/rtm-events/EventsQueue.ts +9 -3
  121. package/template/src/rtm-events/constants.ts +5 -0
  122. package/template/src/rtm-events/index.tsx +1 -3
  123. package/template/src/rtm-events-api/Events.ts +255 -0
  124. package/template/src/rtm-events-api/index.tsx +6 -0
  125. package/template/src/rtm-events-api/types.ts +22 -0
  126. package/template/src/subComponents/ChatBubble.tsx +24 -8
  127. package/template/src/subComponents/ChatContainer.tsx +24 -15
  128. package/template/src/subComponents/ChatInput.tsx +56 -42
  129. package/template/src/subComponents/LanguageSelector.tsx +2 -2
  130. package/template/src/subComponents/LayoutIconDropdown.native.tsx +5 -5
  131. package/template/src/subComponents/LayoutIconDropdown.tsx +7 -7
  132. package/template/src/subComponents/LocalAudioMute.tsx +3 -4
  133. package/template/src/subComponents/LocalEndCall.tsx +3 -6
  134. package/template/src/subComponents/LocalSwitchCamera.tsx +3 -4
  135. package/template/src/subComponents/LocalVideoMute.tsx +3 -3
  136. package/template/src/subComponents/NetworkQualityPill.tsx +8 -9
  137. package/template/src/subComponents/OpenInNativeButton.tsx +2 -3
  138. package/template/src/subComponents/RemoteAudioMute.tsx +5 -11
  139. package/template/src/subComponents/RemoteEndCall.tsx +3 -10
  140. package/template/src/subComponents/RemoteVideoMute.tsx +3 -10
  141. package/template/src/subComponents/SelectDevice.tsx +4 -3
  142. package/template/src/subComponents/SelectOAuth.tsx +3 -2
  143. package/template/src/subComponents/SidePanelButtons.ts +6 -5
  144. package/template/src/subComponents/TextWithTooltip.tsx +6 -2
  145. package/template/src/subComponents/{toastConfig.tsx → ToastConfig.tsx} +2 -2
  146. package/template/src/subComponents/chat/ChatParticipants.tsx +6 -5
  147. package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +2 -2
  148. package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +4 -3
  149. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +2 -2
  150. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +2 -4
  151. package/template/src/subComponents/livestream/index.ts +2 -2
  152. package/template/src/subComponents/recording/useRecording.tsx +47 -24
  153. package/template/src/subComponents/recording/useRecordingLayoutQuery.tsx +11 -5
  154. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +46 -34
  155. package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +98 -39
  156. package/template/src/subComponents/screenshare/useScreenshare.tsx +1 -1
  157. package/template/src/utils/SdkEvents.ts +9 -46
  158. package/template/src/utils/common.tsx +41 -9
  159. package/template/src/utils/getUniqueID.ts +5 -0
  160. package/template/src/utils/isMobileOrTablet.native.ts +6 -2
  161. package/template/src/utils/isMobileOrTablet.ts +25 -8
  162. package/template/src/utils/useButtonTemplate.tsx +1 -1
  163. package/template/src/utils/useCreateMeeting.ts +24 -10
  164. package/template/src/utils/useGetMeetingPhrase.ts +11 -8
  165. package/template/src/utils/{IsAttendeeUser.ts → useIsAttendee.ts} +12 -16
  166. package/template/src/utils/{isAudioEnabled.ts → useIsAudioEnabled.ts} +8 -4
  167. package/template/src/utils/{isHostUser.ts → useIsHost.ts} +17 -16
  168. package/template/src/utils/{isPSTNUser.ts → useIsPSTN.ts} +4 -3
  169. package/template/src/utils/{isScreenShareUser.ts → useIsScreenShare.ts} +1 -1
  170. package/template/src/utils/{isVideoEnabled.ts → useIsVideoEnabled.ts} +9 -6
  171. package/template/src/utils/useJoinMeeting.ts +11 -7
  172. package/template/src/utils/useLayout.tsx +8 -6
  173. package/template/src/utils/useMutePSTN.ts +5 -3
  174. package/template/src/utils/useMuteToggleLocal.ts +6 -4
  175. package/template/src/utils/useRemoteEndCall.ts +14 -10
  176. package/template/src/utils/useRemoteMute.ts +45 -20
  177. package/template/src/utils/useSidePanel.tsx +4 -1
  178. package/template/src/utils/useString.ts +2 -2
  179. package/template/src/utils/useUserName.ts +14 -0
  180. package/template/tsconfig_fpeApi.json +8 -9
  181. package/template/tsconfig_rsdk_index.json +8 -9
  182. package/template/tsconfig_wsdk_index.json +8 -9
  183. package/template/webpack.commons.js +9 -9
  184. package/template/webpack.rsdk.config.js +4 -2
  185. package/template/webpack.ts.config.js +6 -6
  186. package/template/webpack.wsdk.config.js +2 -1
  187. package/template/fpe-api/fpeEvents.ts +0 -9
  188. package/template/fpe-api/utils.ts +0 -61
  189. package/template/fpe-implementation/index.ts +0 -1
  190. package/template/fpe-todo.txt +0 -14
  191. package/template/src/components/RTMEvents.tsx +0 -84
  192. package/template/src/custom-events/CustomEvents.ts +0 -238
  193. package/template/src/custom-events/index.tsx +0 -4
  194. package/template/src/custom-events/types.ts +0 -51
  195. package/template/src/pages/video-call/CustomLayout.ts +0 -17
  196. package/template/src/rtm-events/types.ts +0 -7
  197. package/template/src/utils/getMeetingInvite.ts +0 -53
  198. package/template/src/utils/useGroupMessages.ts +0 -24
  199. package/template/src/utils/useNavParams.ts +0 -6
  200. package/template/src/utils/useNavigateTo.ts +0 -8
  201. package/template/src/utils/usePrivateMessages.ts +0 -33
  202. package/template/src/utils/useSendControlMessage.ts +0 -51
  203. package/template/src/utils/useSendMessage.ts +0 -40
  204. package/template/src/utils/useSetUnreadMessageCount.ts +0 -43
  205. package/template/src/utils/useUnreadMessageCount.ts +0 -50
  206. package/template/src/utils/useUserList.ts +0 -26
@@ -10,47 +10,72 @@
10
10
  *********************************************
11
11
  */
12
12
  import {useMeetingInfo} from '../components/meeting-info/useMeetingInfo';
13
- import {UidType} from '../../agora-rn-uikit';
14
13
  import {controlMessageEnum} from '../components/ChatContext';
15
- import useIsPSTN from './isPSTNUser';
14
+ import useIsPSTN from './useIsPSTN';
16
15
  import useMutePSTN from './useMutePSTN';
17
- import useSendControlMessage, {
18
- CONTROL_MESSAGE_TYPE,
19
- } from '../utils/useSendControlMessage';
16
+ import {UidType} from '../../agora-rn-uikit';
17
+ import events, {EventPersistLevel} from '../rtm-events-api';
20
18
 
21
19
  export enum MUTE_REMOTE_TYPE {
22
20
  audio,
23
21
  video,
24
22
  }
23
+ /**
24
+ * Returns an asynchronous function to toggle muted state of the given track type for a remote user with the given uid or if no uid provided, mutes everyone else in the meeting.
25
+ */
25
26
  function useRemoteMute() {
26
- const sendCtrlMsgToUid = useSendControlMessage();
27
- const {isHost} = useMeetingInfo();
27
+ const {
28
+ data: {isHost},
29
+ } = useMeetingInfo();
28
30
  const isPSTN = useIsPSTN();
29
31
  const mutePSTN = useMutePSTN();
30
- return async (type: MUTE_REMOTE_TYPE, uid: UidType) => {
32
+
33
+ return async (type: MUTE_REMOTE_TYPE, uid?: UidType) => {
31
34
  if (isHost) {
32
35
  switch (type) {
33
36
  case MUTE_REMOTE_TYPE.audio:
34
- if (isPSTN(uid)) {
35
- try {
36
- mutePSTN(uid);
37
- } catch (error) {
38
- console.error('An error occurred while muting the PSTN user.');
37
+ // To individual
38
+ if (uid) {
39
+ if (isPSTN(uid)) {
40
+ try {
41
+ mutePSTN(uid);
42
+ } catch (error) {
43
+ console.error('An error occurred while muting the PSTN user.');
44
+ }
45
+ } else {
46
+ events.send(
47
+ controlMessageEnum.muteAudio,
48
+ '',
49
+ EventPersistLevel.LEVEL1,
50
+ uid,
51
+ );
39
52
  }
40
53
  } else {
41
- sendCtrlMsgToUid(
42
- CONTROL_MESSAGE_TYPE.controlMessageToUid,
54
+ // To everyone
55
+ events.send(
43
56
  controlMessageEnum.muteAudio,
44
- uid,
57
+ '',
58
+ EventPersistLevel.LEVEL1,
45
59
  );
46
60
  }
47
61
  break;
48
62
  case MUTE_REMOTE_TYPE.video:
49
- if (!isPSTN(uid)) {
50
- sendCtrlMsgToUid(
51
- CONTROL_MESSAGE_TYPE.controlMessageToUid,
63
+ if (uid) {
64
+ // To individual
65
+ if (!isPSTN(uid)) {
66
+ events.send(
67
+ controlMessageEnum.muteVideo,
68
+ '',
69
+ EventPersistLevel.LEVEL1,
70
+ uid,
71
+ );
72
+ }
73
+ } else {
74
+ // To everyone
75
+ events.send(
52
76
  controlMessageEnum.muteVideo,
53
- uid,
77
+ '',
78
+ EventPersistLevel.LEVEL1,
54
79
  );
55
80
  }
56
81
  break;
@@ -12,7 +12,7 @@
12
12
 
13
13
  import React, {SetStateAction} from 'react';
14
14
  import {SidePanelType} from '../subComponents/SidePanelEnum';
15
- import {createHook} from 'fpe-implementation';
15
+ import {createHook} from 'customization-implementation';
16
16
 
17
17
  export interface SidePanelContextInterface {
18
18
  sidePanel: SidePanelType;
@@ -36,6 +36,9 @@ const SidePanelProvider = (props: SidePanelProviderProps) => {
36
36
  );
37
37
  };
38
38
 
39
+ /**
40
+ * The Side panel app state governs the side panel.
41
+ */
39
42
  const useSidePanel = createHook(SidePanelContext);
40
43
 
41
44
  export {SidePanelProvider, useSidePanel};
@@ -9,7 +9,7 @@
9
9
  information visit https://appbuilder.agora.io.
10
10
  *********************************************
11
11
  */
12
- import {useFpe} from 'fpe-api';
12
+ import {useCustomization} from 'customization-implementation';
13
13
  import {useLanguage} from '../language/useLanguage';
14
14
  import {DEFAULT_I18_DATA} from '../language';
15
15
  import {TextDataInterface} from '../language/default-labels/index';
@@ -17,7 +17,7 @@ import {TextDataInterface} from '../language/default-labels/index';
17
17
  export function usei18nData(
18
18
  selectedLanguageCode: string = DEFAULT_I18_DATA.locale,
19
19
  ) {
20
- const languageData = useFpe((data) => data?.i18n);
20
+ const languageData = useCustomization((data) => data?.i18n);
21
21
  if (
22
22
  !selectedLanguageCode ||
23
23
  !languageData ||
@@ -0,0 +1,14 @@
1
+ import useSetName from './useSetName';
2
+ import useGetName from './useGetName';
3
+
4
+ /**
5
+ * The UserName app state governs the local user's display name.
6
+ */
7
+ export default function useUserName(): [
8
+ string,
9
+ React.Dispatch<React.SetStateAction<string>>,
10
+ ] {
11
+ const setName = useSetName();
12
+ const name = useGetName();
13
+ return [name, setName];
14
+ }
@@ -1,10 +1,10 @@
1
1
  {
2
2
  // --------------------------------------------------------
3
3
  // Use with webpack loader
4
- // "files":["./fpe-api/index.ts","./global.d.ts","./bridge/rtm/web/index.ts","./bridge/rtc/webNg/index.ts"],
4
+ // "files":["./customization-api/index.ts","./global.d.ts","./bridge/rtm/web/index.ts","./bridge/rtc/webNg/index.ts"],
5
5
  // --------------------------------------------------------
6
6
  // Use with typescript tsc command
7
- "files":["./fpe-api/index.ts","./global.d.ts"],
7
+ "files": ["./customization-api/index.ts", "./global.d.ts"],
8
8
  // --------------------------------------------------------
9
9
  "compilerOptions": {
10
10
  /* Basic Options */
@@ -83,21 +83,20 @@
83
83
  "agora-react-native-rtm": ["./bridge/rtm/web/index.ts"],
84
84
  "react-native-agora": ["./bridge/rtc/webNg/index.ts"],
85
85
  "react-native": ["react-native-web"],
86
- "fpe-api": ["./fpe-api/index.ts"],
87
- "fpe-api/install": ["./fpe-api/install.ts"],
88
- "fpe-implementation": ["./fpe-implementation/index.ts"],
86
+ "customization-api": ["./customization-api/index.ts"],
87
+ "customization-implementation": [
88
+ "./customization-implementation/index.ts"
89
+ ],
89
90
  "./RtcContext": ["agora-rn-uikit/src/index"]
90
91
  }
91
92
  // --------------------------------------------------------
92
93
  },
93
- // "references": [{"path": "./fpe-api", "prepend": true}],
94
+ // "references": [{"path": "./customization-api", "prepend": true}],
94
95
  "exclude": [
95
96
  //"node_modules",
96
97
  "babel.config.js",
97
98
  "metro.config.js",
98
99
  "jest.config.js"
99
100
  ],
100
- "include": [
101
- "node_modules/agora"
102
- ]
101
+ "include": ["node_modules/agora"]
103
102
  }
@@ -1,10 +1,10 @@
1
1
  {
2
2
  // --------------------------------------------------------
3
3
  // Use with webpack loader
4
- // "files":["./fpe-api/index.ts","./global.d.ts","./bridge/rtm/web/index.ts","./bridge/rtc/webNg/index.ts"],
4
+ // "files":["./customization-api/index.ts","./global.d.ts","./bridge/rtm/web/index.ts","./bridge/rtc/webNg/index.ts"],
5
5
  // --------------------------------------------------------
6
6
  // Use with typescript tsc command
7
- "files":["./src/SDKAppWrapper.tsx","./index.rsdk.tsx","./global.d.ts"],
7
+ "files": ["./src/SDKAppWrapper.tsx", "./index.rsdk.tsx", "./global.d.ts"],
8
8
  // --------------------------------------------------------
9
9
  "compilerOptions": {
10
10
  /* Basic Options */
@@ -85,21 +85,20 @@
85
85
  "agora-react-native-rtm": ["./bridge/rtm/web/index.ts"],
86
86
  "react-native-agora": ["./bridge/rtc/webNg/index.ts"],
87
87
  "react-native": ["react-native-web"],
88
- "fpe-api": ["./fpe-api/index.ts"],
89
- "fpe-api/install": ["./fpe-api/install.ts"],
90
- "fpe-implementation": ["./fpe-implementation/index.ts"],
88
+ "customization-api": ["./customization-api/index.ts"],
89
+ "customization-implementation": [
90
+ "./customization-implementation/index.ts"
91
+ ],
91
92
  "./RtcContext": ["agora-rn-uikit/src/index"]
92
93
  }
93
94
  // --------------------------------------------------------
94
95
  },
95
- // "references": [{"path": "./fpe-api", "prepend": true}],
96
+ // "references": [{"path": "./customization-api", "prepend": true}],
96
97
  "exclude": [
97
98
  //"node_modules",
98
99
  "babel.config.js",
99
100
  "metro.config.js",
100
101
  "jest.config.js"
101
102
  ],
102
- "include": [
103
- "node_modules/agora"
104
- ]
103
+ "include": ["node_modules/agora"]
105
104
  }
@@ -1,10 +1,10 @@
1
1
  {
2
2
  // --------------------------------------------------------
3
3
  // Use with webpack loader
4
- // "files":["./fpe-api/index.ts","./global.d.ts","./bridge/rtm/web/index.ts","./bridge/rtc/webNg/index.ts"],
4
+ // "files":["./customization-api/index.ts","./global.d.ts","./bridge/rtm/web/index.ts","./bridge/rtc/webNg/index.ts"],
5
5
  // --------------------------------------------------------
6
6
  // Use with typescript tsc command
7
- "files":["./src/SDKAppWrapper.tsx","./index.wsdk.tsx","./global.d.ts"],
7
+ "files": ["./src/SDKAppWrapper.tsx", "./index.wsdk.tsx", "./global.d.ts"],
8
8
  // --------------------------------------------------------
9
9
  "compilerOptions": {
10
10
  /* Basic Options */
@@ -84,21 +84,20 @@
84
84
  "agora-react-native-rtm": ["./bridge/rtm/web/index.ts"],
85
85
  "react-native-agora": ["./bridge/rtc/webNg/index.ts"],
86
86
  "react-native": ["react-native-web"],
87
- "fpe-api": ["./fpe-api/index.ts"],
88
- "fpe-api/install": ["./fpe-api/install.ts"],
89
- "fpe-implementation": ["./fpe-implementation/index.ts"],
87
+ "customization-api": ["./customization-api/index.ts"],
88
+ "customization-implementation": [
89
+ "./customization-implementation/index.ts"
90
+ ],
90
91
  "./RtcContext": ["agora-rn-uikit/src/index"]
91
92
  }
92
93
  // --------------------------------------------------------
93
94
  },
94
- // "references": [{"path": "./fpe-api", "prepend": true}],
95
+ // "references": [{"path": "./customization-api", "prepend": true}],
95
96
  "exclude": [
96
97
  //"node_modules",
97
98
  "babel.config.js",
98
99
  "metro.config.js",
99
100
  "jest.config.js"
100
101
  ],
101
- "include": [
102
- "node_modules/agora"
103
- ]
102
+ "include": ["node_modules/agora"]
104
103
  }
@@ -19,7 +19,7 @@ const isDevelopment = process.env.NODE_ENV === 'development';
19
19
  const path = require('path');
20
20
  const HtmlWebpackPlugin = require('html-webpack-plugin');
21
21
  const configVars = require('./configTransform');
22
- const getFpePath = require('./fpe.config');
22
+ const getCustomizationApiPath = require('./customization.config');
23
23
 
24
24
  const isElectron = ['linux', 'windows', 'mac'].includes(process.env.TARGET);
25
25
  const isReactSdk = process.env.TARGET === 'rsdk';
@@ -33,9 +33,7 @@ module.exports = {
33
33
  !isSdk &&
34
34
  new HtmlWebpackPlugin({
35
35
  title: configVars['$config.APP_NAME'],
36
- template: isElectron
37
- ? 'electron/index.html'
38
- : 'web/index.html',
36
+ template: isElectron ? 'electron/index.html' : 'web/index.html',
39
37
  }),
40
38
  isDevelopment &&
41
39
  !isSdk &&
@@ -55,10 +53,12 @@ module.exports = {
55
53
  // Using rtc bridge to translate React Native RTC SDK calls to web SDK calls for web and linux
56
54
  // Using rtc bridge to translate React Native RTC SDK calls to electron SDK calls for windows and mac
57
55
  'react-native-agora$': path.join(__dirname, 'bridge/rtc/webNg/index.ts'),
58
- 'fpe-api/install': path.join(__dirname, 'fpe-api/install.ts'),
59
- 'fpe-api': path.join(__dirname, 'fpe-api/index.ts'),
60
- 'fpe-implementation': path.join(__dirname, 'fpe-implementation/index.ts'),
61
- 'test-fpe': path.join(__dirname, getFpePath()),
56
+ 'customization-api': path.join(__dirname, 'customization-api/index.ts'),
57
+ 'customization-implementation': path.join(
58
+ __dirname,
59
+ 'customization-implementation/index.ts',
60
+ ),
61
+ customization: path.join(__dirname, getCustomizationApiPath()),
62
62
  'agora-react-native-rtm/lib/typescript/src': path.join(
63
63
  __dirname,
64
64
  'bridge/rtm/web/index.ts',
@@ -85,7 +85,7 @@ module.exports = {
85
85
  ].filter(Boolean),
86
86
  },
87
87
  // Enable source maps during development
88
- // devtool: isDevelopment ? 'eval-cheap-module-source-map' : undefined,
88
+ devtool: isDevelopment ? 'eval-cheap-module-source-map' : undefined,
89
89
  module: {
90
90
  rules: [
91
91
  {
@@ -7,6 +7,7 @@ const isDevelopment = process.env.NODE_ENV === 'development';
7
7
  module.exports = merge(commons, {
8
8
  // Enable optimizations in production
9
9
  mode: isDevelopment ? 'development' : 'production',
10
+ devtool: isDevelopment ? 'eval-cheap-module-source-map' : 'source-map',
10
11
  // externals: [
11
12
  // nodeExternals({allowlist: [/agora.*/, /fpe.*/]}),
12
13
  // ],
@@ -16,6 +17,7 @@ module.exports = merge(commons, {
16
17
  'react-router': 'react-router',
17
18
  'react-router-dom': 'react-router-dom',
18
19
  '@apollo/client': '@apollo/client',
20
+ nanoid: 'nanoid',
19
21
  },
20
22
  // Main entry point for the web application
21
23
  entry: {
@@ -25,9 +27,9 @@ module.exports = merge(commons, {
25
27
  output: {
26
28
  path: path.resolve(__dirname, `../Builds/react-sdk`),
27
29
  filename: 'index.js',
28
- library:{
30
+ library: {
29
31
  type: 'commonjs2',
30
- }
32
+ },
31
33
  },
32
34
  // watch: isDevelopment
33
35
  });
@@ -20,8 +20,8 @@ module.exports = merge(commons, {
20
20
  // Enable optimizations in production
21
21
  mode: isDevelopment ? 'development' : 'production',
22
22
  // Main entry point for the web application
23
- module:{
24
- rules:[
23
+ module: {
24
+ rules: [
25
25
  {
26
26
  test: /\.tsx?$/,
27
27
  loader: 'ts-loader',
@@ -29,9 +29,9 @@ module.exports = merge(commons, {
29
29
  exclude: /node_modules|\.d\.ts$/,
30
30
  options: {
31
31
  configFile: 'tsconfig.json',
32
- ignoreDiagnostics: [2339,2554,2539,1005]
32
+ ignoreDiagnostics: [2339, 2554, 2539, 1005],
33
33
  // ignoreDiagnostics: [2554,2539,2339,2551,2769,2305,2614,2322,2362,2369,2698]
34
- }
34
+ },
35
35
  },
36
36
  {
37
37
  // Use babel to transpile all js, ts, jsx and tsx files
@@ -78,10 +78,10 @@ module.exports = merge(commons, {
78
78
  },
79
79
  ],
80
80
  },
81
- ]
81
+ ],
82
82
  },
83
83
  entry: {
84
- main: './fpe-api/index.ts',
84
+ main: './customization-api/index.ts',
85
85
  },
86
86
  output: {
87
87
  path: path.resolve(__dirname, `../Builds/ts`),
@@ -9,6 +9,8 @@ const libraryTargets = ['commonjs2', 'var','umd2'];
9
9
  const baseConfig = {
10
10
  // Enable optimizations in production
11
11
  mode: isDevelopment ? 'development' : 'production',
12
+ // Angular doesn't support cheap-eval-module-source-maps
13
+ devtool:'source-map',
12
14
  // Main entry point for the web application
13
15
  entry: {
14
16
  main: './index.wsdk.tsx',
@@ -20,7 +22,6 @@ const baseConfig = {
20
22
  name: 'AgoraAppBuilder',
21
23
  },
22
24
  },
23
- watch: isDevelopment
24
25
  };
25
26
 
26
27
  const mappedConfigs = libraryTargets.map((target, _) => {
@@ -1,9 +0,0 @@
1
- // 1. Import customEvents
2
- import CustomEvents from '../src/custom-events/CustomEvents';
3
- import {EventSourceEnum} from '../src/custom-events';
4
-
5
- // 2. Initialize with source "fpe"
6
- const fpeEvents = new CustomEvents(EventSourceEnum.fpe);
7
-
8
- // 3. export
9
- export {fpeEvents as CustomEvents};
@@ -1,61 +0,0 @@
1
- /*
2
- ********************************************
3
- Copyright © 2021 Agora Lab, Inc., all rights reserved.
4
- AppBuilder and all associated components, source code, APIs, services, and documentation
5
- (the “Materials”) are owned by Agora Lab, Inc. and its licensors. The Materials may not be
6
- accessed, used, modified, or distributed for any purpose without a license from Agora Lab, Inc.
7
- Use without a license or in violation of any license terms and conditions (including use for
8
- any purpose competitive to Agora Lab, Inc.’s business) is strictly prohibited. For more
9
- information visit https://appbuilder.agora.io.
10
- *********************************************
11
- */
12
- // commented for v1 release
13
- //export {default as useIsScreenShare} from '../src/utils/isScreenShareUser';
14
- export {default as useIsHost} from '../src/utils/isHostUser';
15
- export {default as useIsAttendee} from '../src/utils/IsAttendeeUser';
16
- export {default as useIsPSTN} from '../src/utils/isPSTNUser';
17
- export {default as useUserList} from '../src/utils/useUserList';
18
- // commented for v1 release
19
- //export {default as useGroupMessages} from '../src/utils/useGroupMessages';
20
- //export {default as usePrivateMessages} from '../src/utils/usePrivateMessages';
21
- export {default as useIsAudioEnabled} from '../src/utils/isAudioEnabled';
22
- export {default as useIsVideoEnabled} from '../src/utils/isVideoEnabled';
23
- export {default as useSetName} from '../src/utils/useSetName';
24
- export {default as useGetName} from '../src/utils/useGetName';
25
- export {useSidePanel} from '../src/utils/useSidePanel';
26
- // commented for v1 release
27
- // export {
28
- // default as useUnreadMessageCount,
29
- // UNREAD_MESSAGE_COUNT_TYPE,
30
- // } from '../src/utils/useUnreadMessageCount';
31
- // export {
32
- // default as useSetUnreadMessageCount,
33
- // SET_UNREAD_MESSAGE_COUNT_TYPE,
34
- // } from '../src/utils/useSetUnreadMessageCount';
35
- export {default as useNavigateTo} from '../src/utils/useNavigateTo';
36
- export {default as useNavParams} from '../src/utils/useNavParams';
37
- export {default as useCreateMeeting} from '../src/utils/useCreateMeeting';
38
- export {default as useJoinMeeting} from '../src/utils/useJoinMeeting';
39
- // commented for v1 release
40
- // export {
41
- // default as useSendMessage,
42
- // MESSAGE_TYPE,
43
- // } from '../src/utils/useSendMessage';
44
- // export {controlMessageEnum} from '../src/components/ChatContext';
45
- // export {
46
- // default as useSendControlMessage,
47
- // CONTROL_MESSAGE_TYPE,
48
- // } from '../src/utils/useSendControlMessage';
49
- export {
50
- MUTE_LOCAL_TYPE,
51
- default as useMuteToggleLocal,
52
- } from '../src/utils/useMuteToggleLocal';
53
- export {default as useRemoteEndcall} from '../src/utils/useRemoteEndCall';
54
- export {
55
- default as useRemoteMute,
56
- MUTE_REMOTE_TYPE,
57
- } from '../src/utils/useRemoteMute';
58
- export {ToggleState} from '../agora-rn-uikit/src/Contexts/PropsContext';
59
-
60
- //export common function
61
- export * from '../src/utils/common';
@@ -1 +0,0 @@
1
- export { default as createHook } from './createHook';
@@ -1,14 +0,0 @@
1
- 1. test-fpe name should be changed
2
- - template/_gitignore
3
- - babel.config.js
4
- - webpack.config.js
5
- - fpe.config.js
6
- - fpe-api index.ts
7
- - fpe-api useFPE
8
- 2. What if user called custom context without wrapping provider
9
- - useContext will return the default vaule. so we can't identify whether is wrapped with the provider or not.
10
- 3. CustomUserContext
11
- 4. Add sibling into view without overriding
12
- 5. Translation labels
13
- - some of keys
14
- 6.Layout dropdown implementation
@@ -1,84 +0,0 @@
1
- /*
2
- ********************************************
3
- Copyright © 2021 Agora Lab, Inc., all rights reserved.
4
- AppBuilder and all associated components, source code, APIs, services, and documentation
5
- (the “Materials”) are owned by Agora Lab, Inc. and its licensors. The Materials may not be
6
- accessed, used, modified, or distributed for any purpose without a license from Agora Lab, Inc.
7
- Use without a license or in violation of any license terms and conditions (including use for
8
- any purpose competitive to Agora Lab, Inc.’s business) is strictly prohibited. For more
9
- information visit https://appbuilder.agora.io.
10
- *********************************************
11
- */
12
-
13
- import {messageChannelType, messageEventInterface} from './ChatContext';
14
-
15
- const RTM_ERROR_TEMPLATE = 'RTMError:';
16
-
17
- type eventsMapInterface = {
18
- [key in messageChannelType]: Record<string, any>;
19
- };
20
-
21
- type errorObjectInterface = {
22
- msg: string;
23
- cause: any;
24
- };
25
-
26
- type eventKeyType = keyof eventsMapInterface;
27
-
28
- const eventsMap: eventsMapInterface = {
29
- [messageChannelType.Private]: new Map<string, any>(),
30
- [messageChannelType.Public]: new Map<string, any>(),
31
- };
32
-
33
- export interface rtmEventsInterface {
34
- on: (
35
- messageChannel: messageChannelType,
36
- evtName: string,
37
- callback: any,
38
- ) => void;
39
- emit: (
40
- messageChannel: messageChannelType,
41
- data: messageEventInterface | any | null,
42
- error?: errorObjectInterface | null | undefined,
43
- ) => void;
44
- off: (messageChannel: messageChannelType, evtName: string) => void;
45
- destroyAll: () => void;
46
- }
47
-
48
- const events: rtmEventsInterface = {
49
- on: (messageChannel: messageChannelType, evtName: string, callback: any) => {
50
- eventsMap[messageChannel].set(evtName, callback);
51
- },
52
- emit: (
53
- messageChannel: messageChannelType,
54
- data: messageEventInterface | any | null,
55
- error: errorObjectInterface | null | undefined,
56
- ) => {
57
- // Handle error, if error found return error in callback
58
- if (error) {
59
- let err = new Error(`${RTM_ERROR_TEMPLATE}: ${error.msg}`);
60
- err.stack += '\nCaused by: ' + error.cause;
61
-
62
- for (const [key] of eventsMap[messageChannel].entries()) {
63
- eventsMap[messageChannel].get(`${key}`)(null, err);
64
- }
65
- return;
66
- }
67
- // Handle success, return data in callback
68
- for (const [key] of eventsMap[messageChannel].entries()) {
69
- eventsMap[messageChannel].get(`${key}`)(data, null);
70
- }
71
- },
72
- off: (messageChannel: messageChannelType, evtName: string) => {
73
- eventsMap[messageChannel].delete(evtName);
74
- },
75
- destroyAll: () => {
76
- for (const key of Object.keys(eventsMap) as Array<eventKeyType>) {
77
- eventsMap[key].clear();
78
- }
79
- },
80
- };
81
-
82
- Object.freeze(events);
83
-
84
- export default events;