agora-appbuilder-core 2.3.0-beta.21 → 2.3.0-beta.22

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": "2.3.0-beta.21",
3
+ "version": "2.3.0-beta.22",
4
4
  "description": "React Native template for RTE app builder",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -141,7 +141,18 @@ const general = {
141
141
  );
142
142
  },
143
143
  typescriptFix: () => {
144
- return src('../Builds/fpe-api.d.ts')
144
+ return src(['../Builds/fpe-api.d.ts', './global.d.ts'])
145
+ .pipe(concat('./fpe-api.d.ts'))
146
+ .pipe(
147
+ replace(
148
+ `declare var $config: ConfigInterface;
149
+ declare module 'test-fpe' {
150
+ const data: {};
151
+ export default data;
152
+ }`,
153
+ ' ',
154
+ ),
155
+ )
145
156
  .pipe(replace('"agora-rn-uikit"', '"agora-rn-uikit/src/index"'))
146
157
  .pipe(dest('../Builds/'));
147
158
  },
@@ -12,16 +12,27 @@
12
12
  /**
13
13
  * @format
14
14
  */
15
- import SDKAppWrapper,{AppBuilderSdkApi,AppBuilderSdkApiInterface} from './src/SDKAppWrapper';
15
+ import SDKAppWrapper, {
16
+ AppBuilderSdkApi,
17
+ AppBuilderSdkApiInterface,
18
+ } from './src/SDKAppWrapper';
16
19
  import React from 'react';
20
+ import * as RN from 'react-native-web';
21
+ import jsonFile from './config.json';
22
+
17
23
  export * from 'fpe-api';
24
+ export * from 'fpe-implementation';
18
25
 
19
26
  interface AppBuilderReactSdkInterface extends AppBuilderSdkApiInterface {
20
27
  View: React.FC;
21
28
  }
22
29
 
23
30
  const AppBuilderReactSdkApi: AppBuilderReactSdkInterface = {
24
- ...AppBuilderSdkApi,
25
- View: SDKAppWrapper,
26
- }
31
+ ...AppBuilderSdkApi,
32
+ View: SDKAppWrapper,
33
+ };
34
+
35
+ let config: ConfigInterface = jsonFile as unknown as ConfigInterface;
36
+
37
+ export {React, RN, config};
27
38
  export default AppBuilderReactSdkApi;
@@ -1,9 +1,16 @@
1
1
  import {AppRegistry} from 'react-native';
2
- import SDKAppWrapper,{AppBuilderSdkApi,AppBuilderSdkApiInterface} from './src/SDKAppWrapper';
2
+ import SDKAppWrapper, {
3
+ AppBuilderSdkApi,
4
+ AppBuilderSdkApiInterface,
5
+ } from './src/SDKAppWrapper';
6
+ import React from 'react';
7
+ import * as RN from 'react-native-web';
8
+ import jsonFile from './config.json';
9
+
3
10
  export * from 'fpe-api';
11
+ export * from 'fpe-implementation';
4
12
 
5
- interface AppBuilderWebSdkInterface extends AppBuilderSdkApiInterface {
6
- }
13
+ interface AppBuilderWebSdkInterface extends AppBuilderSdkApiInterface {}
7
14
 
8
15
  const AppBuilderWebSdkApi: AppBuilderWebSdkInterface = AppBuilderSdkApi;
9
16
 
@@ -24,4 +31,7 @@ class AppBuilder extends HTMLElement {
24
31
 
25
32
  customElements.define('app-builder', AppBuilder);
26
33
 
34
+ let config: ConfigInterface = jsonFile as unknown as ConfigInterface;
35
+
36
+ export {React, RN, config};
27
37
  export default AppBuilderWebSdkApi;
@@ -50,7 +50,7 @@ const SDKAppWrapper = () => {
50
50
  const [fpe, setFpe] = useState(fpeConfig);
51
51
  useEffect(() => {
52
52
  SDKEvents.on('addFpe', (sdkFpeConfig) => {
53
- console.log('DEBUG(aditya)-SDKEvents: addFpe event called');
53
+ console.log('SDKEvents: addFpe event called');
54
54
  setFpe(sdkFpeConfig);
55
55
  });
56
56
  // Join event consumed in Create.tsx
@@ -30,6 +30,7 @@ import useJoinMeeting from '../utils/useJoinMeeting';
30
30
  import SDKEvents from '../utils/SdkEvents';
31
31
  import {MeetingInfoDefaultValue} from '../components/meeting-info/useMeetingInfo';
32
32
  import {useSetMeetingInfo} from '../components/meeting-info/useSetMeetingInfo';
33
+ import useNavigateTo from '../utils/useNavigateTo';
33
34
 
34
35
  const Create = () => {
35
36
  const {CreateComponent} = useFpe((data) => {
@@ -64,6 +65,7 @@ const Create = () => {
64
65
  const {
65
66
  meetingPassphrase: {attendee, host, pstn},
66
67
  } = useMeetingInfo();
68
+ const navigateTo = useNavigateTo();
67
69
  //commented for v1 release
68
70
  // const createdText = useString('meetingCreatedNotificationLabel')();
69
71
  // const hostControlsToggle = useString<boolean>('hostControlsToggle');
@@ -91,9 +93,10 @@ const Create = () => {
91
93
  }
92
94
  SDKEvents.on('joinMeetingWithPhrase', (phrase) => {
93
95
  console.log(
94
- 'DEBUG(aditya)-SDKEvents: joinMeetingWithPhrase event called',
96
+ 'SDKEvents: joinMeetingWithPhrase event called', phrase
95
97
  );
96
- useJoin(phrase);
98
+ setMeetingInfo(MeetingInfoDefaultValue);
99
+ navigateTo(phrase)
97
100
  });
98
101
  return () => {
99
102
  SDKEvents.off('joinMeetingWithPhrase');
@@ -46,7 +46,7 @@ const SDKEvents: SDKEventsInterface = {
46
46
  },
47
47
  on: function (eventName, cb) {
48
48
  console.log(
49
- 'DEBUG(aditya)-SDKEvents: event registered:',
49
+ 'SDKEvents: event registered:',
50
50
  eventName,
51
51
  );
52
52
  this.eventsMap[eventName] = cb;
@@ -55,12 +55,12 @@ const SDKEvents: SDKEventsInterface = {
55
55
  }
56
56
  },
57
57
  emit: function (eventName, ...args) {
58
- console.log('DEBUG(aditya)-SDKEvents: emit called:', eventName, ...args);
58
+ console.log('SDKEvents: emit called:', eventName, ...args);
59
59
  this.eventsMap[eventName](...args);
60
60
  this.eventSubs[eventName] = args;
61
61
  },
62
62
  off: function (eventName) {
63
- console.log('DEBUG(aditya)-SDKEvents: event deregistered:', eventName);
63
+ console.log('SDKEvents: event deregistered:', eventName);
64
64
  this.eventSubs[eventName] = null;
65
65
  },
66
66
  };
@@ -16,6 +16,7 @@ module.exports = merge(commons, {
16
16
  'react-router': 'react-router',
17
17
  'react-router-dom': 'react-router-dom',
18
18
  '@apollo/client': '@apollo/client',
19
+ nanoid: 'nanoid',
19
20
  },
20
21
  // Main entry point for the web application
21
22
  entry: {
@@ -25,9 +26,9 @@ module.exports = merge(commons, {
25
26
  output: {
26
27
  path: path.resolve(__dirname, `../Builds/react-sdk`),
27
28
  filename: 'index.js',
28
- library:{
29
+ library: {
29
30
  type: 'commonjs2',
30
- }
31
+ },
31
32
  },
32
33
  // watch: isDevelopment
33
34
  });
@@ -20,7 +20,6 @@ const baseConfig = {
20
20
  name: 'AgoraAppBuilder',
21
21
  },
22
22
  },
23
- watch: isDevelopment
24
23
  };
25
24
 
26
25
  const mappedConfigs = libraryTargets.map((target, _) => {