agora-appbuilder-core 4.1.0 → 4.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-appbuilder-core",
3
- "version": "4.1.0",
3
+ "version": "4.1.2",
4
4
  "description": "React Native template for RTE app builder",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -67,6 +67,5 @@ export {useBeautyEffects} from '../src/app-state/useBeautyEffects';
67
67
  export {useLiveStreamDataContext} from '../src/components/contexts/LiveStreamDataContext';
68
68
  export {useRtm} from '../src/components/ChatContext';
69
69
  export {useGetHostIds} from '../src/utils/useGetHostUids';
70
- export {useAIAgent} from '../src/ai-agent/components/AgentControls/AgentContext';
71
70
  export type {AIAgentContextInterface} from '../src/ai-agent/components/AgentControls/AgentContext';
72
71
  export type {AIAgentState} from '../src/ai-agent/components/AgentControls/const';
@@ -9,9 +9,10 @@
9
9
  information visit https://appbuilder.agora.io.
10
10
  *********************************************
11
11
  */
12
- import {customize} from 'customization-api';
13
12
  /**
14
13
  * Dummy Config used to load when project doesn't have the customization.
15
14
  */
16
- const dummyConfig = customize({});
15
+ import {isSDK, customize} from 'customization-api';
16
+
17
+ const dummyConfig = isSDK() ? {} : customize({});
17
18
  export default dummyConfig;
@@ -76,8 +76,8 @@ const DefaultConfig = {
76
76
  CHAT_ORG_NAME: '',
77
77
  CHAT_APP_NAME: '',
78
78
  CHAT_URL: '',
79
- CLI_VERSION: '3.1.0',
80
- CORE_VERSION: '4.1.0',
79
+ CLI_VERSION: '3.1.2',
80
+ CORE_VERSION: '4.1.2',
81
81
  DISABLE_LANDSCAPE_MODE: false,
82
82
  STT_AUTO_START: false,
83
83
  CLOUD_RECORDING_AUTO_START: false,
@@ -2,7 +2,6 @@ import React, {createContext, useContext, useEffect, useState} from 'react';
2
2
  import StorageContext from '../../../components/StorageContext';
3
3
  import {AIAgentState, ASR_LANGUAGES, AgentState} from './const';
4
4
  import {AI_AGENT_VOICE} from './const';
5
- import {createHook} from 'customization-implementation';
6
5
  import {
7
6
  UidType,
8
7
  useContent,
@@ -460,5 +459,3 @@ export const connectToAIAgent = async (
460
459
  throw error;
461
460
  }
462
461
  };
463
-
464
- export const useAIAgent = createHook(AgentContext);
@@ -12,7 +12,7 @@ import {
12
12
  import SelectAiAgent from './SelectAiAgent';
13
13
  import ThemeConfig from '../../theme';
14
14
  import hexadecimalTransparency from '../../utils/hexadecimalTransparency';
15
- import {AgentContext, useAIAgent} from './AgentControls/AgentContext';
15
+ import {AgentContext} from './AgentControls/AgentContext';
16
16
  import UserPrompt from './UserPrompt';
17
17
  import {useIsAgentAvailable} from './utils';
18
18
  import Toggle from '../../atoms/Toggle';
@@ -116,7 +116,7 @@ const AdvancedSettings = () => {
116
116
  setIsInterruptionHandlingEnabled,
117
117
  agentId,
118
118
  agentConnectionState,
119
- } = useAIAgent();
119
+ } = useContext(AgentContext);
120
120
  const {
121
121
  data: {agents},
122
122
  } = useRoomInfo();
@@ -1,4 +1,4 @@
1
- import React, {Suspense, useEffect, useRef, useState} from 'react';
1
+ import React, {Suspense, useContext, useEffect, useRef, useState} from 'react';
2
2
  import {
3
3
  Platform,
4
4
  StyleSheet,
@@ -17,7 +17,7 @@ import {
17
17
  SidePanelType,
18
18
  } from 'customization-api';
19
19
  import ThemeConfig from '../../theme';
20
- import {useAIAgent} from '../components/AgentControls/AgentContext';
20
+ import {AgentContext} from '../components/AgentControls/AgentContext';
21
21
  import {AgentState} from '../components/AgentControls/const';
22
22
  import {useIsAgentAvailable} from '../components/utils';
23
23
 
@@ -98,7 +98,7 @@ const SettingButton = () => {
98
98
  };
99
99
 
100
100
  const DisconnectButton = () => {
101
- const {toggleAgentConnection} = useAIAgent();
101
+ const {toggleAgentConnection} = useContext(AgentContext);
102
102
  return (
103
103
  <TouchableOpacity
104
104
  style={{backgroundColor: $config.SEMANTIC_ERROR, borderRadius: 50}}
@@ -111,7 +111,8 @@ const DisconnectButton = () => {
111
111
  };
112
112
 
113
113
  export const ConversationalAI: LayoutComponent = () => {
114
- const {agentConnectionState, toggleAgentConnection} = useAIAgent();
114
+ const {agentConnectionState, toggleAgentConnection} =
115
+ useContext(AgentContext);
115
116
  // const spline = useRef();
116
117
  // const sphere = useRef();
117
118
 
@@ -6,7 +6,7 @@ import {
6
6
  validateMeetingInfoData,
7
7
  RoomInfoContextInterface,
8
8
  } from './room-info/useRoomInfo';
9
- import {CustomizationApiInterface} from 'customization-api';
9
+ import {CustomizationApiInterface, customize} from 'customization-api';
10
10
  import {Unsubscribe} from 'nanoevents';
11
11
 
12
12
  type extractPromises<T extends (...p: any) => any> = {
@@ -75,7 +75,12 @@ const SdkApiInitState: SdkApiContextInterface = {
75
75
  join: {
76
76
  initialized: false,
77
77
  },
78
- customize: {},
78
+ //for AI apps we should call customize method to get the default customization applied.
79
+ customize: $config.ENABLE_CONVERSATIONAL_AI
80
+ ? {
81
+ customization: customize({}),
82
+ }
83
+ : {},
79
84
  // mediaDevice: {},
80
85
  microphoneDevice: {},
81
86
  speakerDevice: {},
@@ -51,7 +51,7 @@ import {
51
51
  import {LogSource, logger} from '../../logger/AppBuilderLogger';
52
52
  import {useFullScreen} from '../../utils/useFullScreen';
53
53
  import SpotlightHighligher from './SpotlightHighlighter';
54
- import {useAIAgent} from '../../ai-agent/components/AgentControls/AgentContext';
54
+ import {AgentContext} from '../../ai-agent/components/AgentControls/AgentContext';
55
55
 
56
56
  export interface VideoRendererProps {
57
57
  user: ContentInterface;
@@ -71,7 +71,7 @@ const VideoRenderer: React.FC<VideoRendererProps> = ({
71
71
  containerStyle = {},
72
72
  innerContainerStyle = {},
73
73
  }) => {
74
- const {agentConnectionState} = useAIAgent();
74
+ const {agentConnectionState} = useContext(AgentContext);
75
75
  const {CustomAgentView} = useCustomization(data => {
76
76
  let components: {
77
77
  CustomAgentView: React.ComponentType<CustomAgentInterfaceProps>;