agora-appbuilder-core 4.0.25-beta-13 → 4.0.25-beta-14

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.0.25-beta-13",
3
+ "version": "4.0.25-beta-14",
4
4
  "description": "React Native template for RTE app builder",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -14,7 +14,6 @@
14
14
  "@gorhom/bottom-sheet": "4.4.7",
15
15
  "@netless/react-native-whiteboard": "^0.0.14",
16
16
  "@openspacelabs/react-native-zoomable-view": "^2.1.1",
17
- "@react-native-assets/slider": "^7.2.1",
18
17
  "@react-native-async-storage/async-storage": "1.19.2",
19
18
  "@react-native-community/checkbox": "0.5.16",
20
19
  "@react-native-community/clipboard": "1.5.1",
@@ -3966,17 +3965,6 @@
3966
3965
  "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
3967
3966
  "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw=="
3968
3967
  },
3969
- "node_modules/@react-native-assets/slider": {
3970
- "version": "7.2.1",
3971
- "resolved": "https://registry.npmjs.org/@react-native-assets/slider/-/slider-7.2.1.tgz",
3972
- "integrity": "sha512-8n1IBQ6QSBMwL+GasCEgHctsjcJwpZ3eioTgL7nyOSteOnmDTsyNVjUU5zQ80YeZOvSWQTeIQ7g30ikfbK4t1A==",
3973
- "peerDependencies": {
3974
- "react": ">=16.13.1",
3975
- "react-dom": ">=16.13.1",
3976
- "react-native": ">=0.61.4",
3977
- "react-native-web": ">=0.13.4"
3978
- }
3979
- },
3980
3968
  "node_modules/@react-native-async-storage/async-storage": {
3981
3969
  "version": "1.19.2",
3982
3970
  "resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.19.2.tgz",
@@ -35771,12 +35759,6 @@
35771
35759
  "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
35772
35760
  "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw=="
35773
35761
  },
35774
- "@react-native-assets/slider": {
35775
- "version": "7.2.1",
35776
- "resolved": "https://registry.npmjs.org/@react-native-assets/slider/-/slider-7.2.1.tgz",
35777
- "integrity": "sha512-8n1IBQ6QSBMwL+GasCEgHctsjcJwpZ3eioTgL7nyOSteOnmDTsyNVjUU5zQ80YeZOvSWQTeIQ7g30ikfbK4t1A==",
35778
- "requires": {}
35779
- },
35780
35762
  "@react-native-async-storage/async-storage": {
35781
35763
  "version": "1.19.2",
35782
35764
  "resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.19.2.tgz",
@@ -33,8 +33,8 @@ const DefaultConfig = {
33
33
  BG: '',
34
34
  PRIMARY_FONT_COLOR: '#363636',
35
35
  SECONDARY_FONT_COLOR: '#FFFFFF',
36
- PROFILE: "720p_3",
37
- SCREEN_SHARE_PROFILE: "1080p_2",
36
+ PROFILE: '720p_3',
37
+ SCREEN_SHARE_PROFILE: '1080p_2',
38
38
  ICON_TEXT: true,
39
39
  PRIMARY_ACTION_BRAND_COLOR: '#099DFD',
40
40
  PRIMARY_ACTION_TEXT_COLOR: '#FFFFFF',
@@ -76,8 +76,8 @@ const DefaultConfig = {
76
76
  CHAT_ORG_NAME: '',
77
77
  CHAT_APP_NAME: '',
78
78
  CHAT_URL: '',
79
- CLI_VERSION: '3.0.25-beta-13',
80
- CORE_VERSION: '4.0.25-beta-13',
79
+ CLI_VERSION: '3.0.25-beta-14',
80
+ CORE_VERSION: '4.0.25-beta-14',
81
81
  };
82
82
 
83
83
  module.exports = DefaultConfig;
@@ -14,7 +14,6 @@
14
14
  "@gorhom/bottom-sheet": "4.4.7",
15
15
  "@netless/react-native-whiteboard": "^0.0.14",
16
16
  "@openspacelabs/react-native-zoomable-view": "^2.1.1",
17
- "@react-native-assets/slider": "^7.2.1",
18
17
  "@react-native-async-storage/async-storage": "1.19.2",
19
18
  "@react-native-community/checkbox": "0.5.16",
20
19
  "@react-native-community/clipboard": "1.5.1",
@@ -3966,17 +3965,6 @@
3966
3965
  "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
3967
3966
  "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw=="
3968
3967
  },
3969
- "node_modules/@react-native-assets/slider": {
3970
- "version": "7.2.1",
3971
- "resolved": "https://registry.npmjs.org/@react-native-assets/slider/-/slider-7.2.1.tgz",
3972
- "integrity": "sha512-8n1IBQ6QSBMwL+GasCEgHctsjcJwpZ3eioTgL7nyOSteOnmDTsyNVjUU5zQ80YeZOvSWQTeIQ7g30ikfbK4t1A==",
3973
- "peerDependencies": {
3974
- "react": ">=16.13.1",
3975
- "react-dom": ">=16.13.1",
3976
- "react-native": ">=0.61.4",
3977
- "react-native-web": ">=0.13.4"
3978
- }
3979
- },
3980
3968
  "node_modules/@react-native-async-storage/async-storage": {
3981
3969
  "version": "1.19.2",
3982
3970
  "resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.19.2.tgz",
@@ -35771,12 +35759,6 @@
35771
35759
  "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
35772
35760
  "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw=="
35773
35761
  },
35774
- "@react-native-assets/slider": {
35775
- "version": "7.2.1",
35776
- "resolved": "https://registry.npmjs.org/@react-native-assets/slider/-/slider-7.2.1.tgz",
35777
- "integrity": "sha512-8n1IBQ6QSBMwL+GasCEgHctsjcJwpZ3eioTgL7nyOSteOnmDTsyNVjUU5zQ80YeZOvSWQTeIQ7g30ikfbK4t1A==",
35778
- "requires": {}
35779
- },
35780
35762
  "@react-native-async-storage/async-storage": {
35781
35763
  "version": "1.19.2",
35782
35764
  "resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.19.2.tgz",
@@ -54,7 +54,6 @@
54
54
  "@gorhom/bottom-sheet": "4.4.7",
55
55
  "@netless/react-native-whiteboard": "^0.0.14",
56
56
  "@openspacelabs/react-native-zoomable-view": "^2.1.1",
57
- "@react-native-assets/slider": "^7.2.1",
58
57
  "@react-native-async-storage/async-storage": "1.19.2",
59
58
  "@react-native-community/checkbox": "0.5.16",
60
59
  "@react-native-community/clipboard": "1.5.1",
@@ -23,8 +23,6 @@ export interface AppBuilderSdkApiInterface {
23
23
  userName?: string,
24
24
  preference?: {
25
25
  disableShareTile: boolean;
26
- showBeautyControls: boolean;
27
- showQualityControls: boolean;
28
26
  },
29
27
  ) => Promise<meetingData>;
30
28
  joinPrecall: (
@@ -33,8 +31,6 @@ export interface AppBuilderSdkApiInterface {
33
31
  skipPrecall?: boolean,
34
32
  preference?: {
35
33
  disableShareTile: boolean;
36
- showBeautyControls: boolean;
37
- showQualityControls: boolean;
38
34
  },
39
35
  ) => Promise<
40
36
  [
@@ -42,10 +42,19 @@ export function NoiseSupressionProvider(props) {
42
42
 
43
43
  useEffect(() => {
44
44
  if ($config.ENABLE_NOISE_CANCELLATION) {
45
- const denoiserExtension = new AIDenoiserExtension({assetsPath: 'wasm'});
46
- AgoraRTC.registerExtensions([denoiserExtension]);
47
- processor.current = denoiserExtension.createProcessor();
48
- processor.current.disable();
45
+ try {
46
+ const denoiserExtension = new AIDenoiserExtension({assetsPath: 'wasm'});
47
+ AgoraRTC.registerExtensions([denoiserExtension]);
48
+ processor.current = denoiserExtension.createProcessor();
49
+ processor.current.disable();
50
+ } catch (error) {
51
+ logger.error(
52
+ LogSource.Internals,
53
+ 'NOISE_CANCELLATION',
54
+ 'Failed to initiate AIDenoiserExtension',
55
+ error,
56
+ );
57
+ }
49
58
  }
50
59
  }, []);
51
60
 
@@ -56,27 +65,45 @@ export function NoiseSupressionProvider(props) {
56
65
  //@ts-ignore
57
66
  const localAudioTrack = RtcEngineUnsafe?.localStream?.audio;
58
67
 
59
- if (processor?.current) {
60
- localAudioTrack
61
- ?.pipe(processor.current)
62
- .pipe(localAudioTrack?.processorDestination);
68
+ try {
69
+ if (processor?.current) {
70
+ localAudioTrack
71
+ ?.pipe(processor.current)
72
+ .pipe(localAudioTrack?.processorDestination);
63
73
 
64
- await processor?.current?.enable();
65
- logger.log(
74
+ await processor?.current?.enable();
75
+ logger.log(
76
+ LogSource.Internals,
77
+ 'NOISE_CANCELLATION',
78
+ 'noise suppression enabled',
79
+ );
80
+ }
81
+ } catch (error) {
82
+ logger.error(
66
83
  LogSource.Internals,
67
84
  'NOISE_CANCELLATION',
68
- 'noise suppression enabled',
85
+ 'Failed to enable noise suppression',
86
+ error,
69
87
  );
70
88
  }
71
89
  };
72
90
 
73
91
  const disableNoiseSuppression = async () => {
74
- if (processor?.current) {
75
- await processor?.current?.disable();
76
- logger.log(
92
+ try {
93
+ if (processor?.current) {
94
+ await processor?.current?.disable();
95
+ logger.log(
96
+ LogSource.Internals,
97
+ 'NOISE_CANCELLATION',
98
+ 'noise suppression disabled',
99
+ );
100
+ }
101
+ } catch (error) {
102
+ logger.error(
77
103
  LogSource.Internals,
78
104
  'NOISE_CANCELLATION',
79
- 'noise suppression disabled',
105
+ 'Failed to disable noise suppression',
106
+ error,
80
107
  );
81
108
  }
82
109
  };
@@ -59,8 +59,6 @@ import {
59
59
  settingsPanelHeading,
60
60
  } from '../language/default-labels/precallScreenLabels';
61
61
  import {LogSource, logger} from '../logger/AppBuilderLogger';
62
- import BeautyEffectsControls from './beauty-effect/BeautyEffectsControls';
63
- import QualityControls from './quality-profiles/QualityControls';
64
62
 
65
63
  const JoinRoomInputView = ({isDesktop}) => {
66
64
  const {rtcProps} = useContext(PropsContext);
@@ -386,8 +384,6 @@ const Precall = () => {
386
384
 
387
385
  const isDesktop = useIsDesktop();
388
386
  const getResponsiveValue = useResponsive();
389
- const {roomPreference} = useRoomInfo();
390
- const showBeautyControls = roomPreference?.showBeautyControls;
391
387
 
392
388
  return FpePrecallComponent ? (
393
389
  <FpePrecallComponent />
@@ -527,22 +523,6 @@ const Precall = () => {
527
523
  <VirtualBackgroundComponent isOnPrecall={true} />
528
524
  </ScrollView>
529
525
  )}
530
-
531
- {roomPreference?.showQualityControls ? (
532
- <View style={style.deviceSelectContainer}>
533
- <QualityControls />
534
- </View>
535
- ) : (
536
- <></>
537
- )}
538
- <Spacer size={24} />
539
- {showBeautyControls ? (
540
- <View style={style.panelContainer}>
541
- <BeautyEffectsControls />
542
- </View>
543
- ) : (
544
- <></>
545
- )}
546
526
  </ScrollView>
547
527
  </Card>
548
528
  </ScrollView>
@@ -29,8 +29,6 @@ type SdkApiContextInterface = {
29
29
  skipPrecall: boolean;
30
30
  preference: {
31
31
  disableShareTile: boolean;
32
- showBeautyControls: boolean;
33
- showQualityControls: boolean;
34
32
  };
35
33
  promise: extractPromises<_InternalSDKMethodEventsMap['join']>;
36
34
  }
@@ -54,8 +54,6 @@ import {
54
54
  settingPanelNameInputLabel,
55
55
  } from '../../src/language/default-labels/videoCallScreenLabels';
56
56
  import {LogSource, logger} from '../logger/AppBuilderLogger';
57
- import BeautyEffectsControls from './beauty-effect/BeautyEffectsControls';
58
- import QualityControls from './quality-profiles/QualityControls';
59
57
 
60
58
  interface EditNameProps {}
61
59
  const EditName: React.FC = (props?: EditNameProps) => {
@@ -284,9 +282,6 @@ const SettingsView = props => {
284
282
  const {currentLayout} = useLayout();
285
283
  const {transcriptHeight} = useCaptionWidth();
286
284
  const {roomPreference} = useRoomInfo();
287
- const showBeautyControls = roomPreference?.showBeautyControls;
288
-
289
- const showQualityControls = roomPreference?.showQualityControls;
290
285
 
291
286
  return (
292
287
  <View
@@ -310,15 +305,6 @@ const SettingsView = props => {
310
305
  {hideName ? <></> : <EditName />}
311
306
  {isWebInternal() && <SelectDevice isIconDropdown />}
312
307
  <LanguageSelector />
313
- {showBeautyControls ? (
314
- <View style={style.panelContainer}>
315
- <BeautyEffectsControls />
316
- </View>
317
- ) : (
318
- <></>
319
- )}
320
- <Spacer size={24} />
321
- {showQualityControls ? <QualityControls /> : <></>}
322
308
  </ScrollView>
323
309
  </View>
324
310
  );
@@ -116,8 +116,6 @@ export const RoomInfoDefaultValue: RoomInfoContextInterface = {
116
116
  },
117
117
  roomPreference: {
118
118
  disableShareTile: false,
119
- showBeautyControls: false,
120
- showQualityControls: false,
121
119
  },
122
120
  };
123
121
 
@@ -17,6 +17,7 @@ import {PropsContext, ToggleState} from '../../../agora-rn-uikit';
17
17
  import {isMobileUA} from '../../utils/common';
18
18
  import {retrieveImagesFromStorage} from './VButils';
19
19
  import imagePathsArray from './imagePaths';
20
+ import {LogSource, logger} from '../../logger/AppBuilderLogger';
20
21
 
21
22
  export type VBMode = 'blur' | 'image' | 'custom' | 'none';
22
23
 
@@ -38,17 +39,26 @@ let previewViewProcessor: ReturnType<
38
39
 
39
40
  // fn to initialize processors
40
41
  const initializeProcessors = () => {
41
- const mainViewExtension = new VirtualBackgroundExtension();
42
- AgoraRTC.registerExtensions([mainViewExtension]);
43
- mainViewProcessor = mainViewExtension.createProcessor();
44
- mainViewProcessor.init(wasm1).then(() => {
45
- mainViewProcessor.disable();
46
- });
42
+ try {
43
+ const mainViewExtension = new VirtualBackgroundExtension();
44
+ AgoraRTC.registerExtensions([mainViewExtension]);
45
+ mainViewProcessor = mainViewExtension.createProcessor();
46
+ mainViewProcessor.init(wasm1).then(() => {
47
+ mainViewProcessor.disable();
48
+ });
47
49
 
48
- previewViewProcessor = mainViewExtension.createProcessor();
49
- previewViewProcessor.init(wasm1).then(() => {
50
- previewViewProcessor.disable();
51
- });
50
+ previewViewProcessor = mainViewExtension.createProcessor();
51
+ previewViewProcessor.init(wasm1).then(() => {
52
+ previewViewProcessor.disable();
53
+ });
54
+ } catch (error) {
55
+ logger.error(
56
+ LogSource.Internals,
57
+ 'VIRTUAL_BACKGROUND',
58
+ 'Failed to initiate VirtualBackgroundExtension',
59
+ error,
60
+ );
61
+ }
52
62
  };
53
63
 
54
64
  type VirtualBackgroundConfig = {
@@ -276,9 +276,7 @@ export default class AppBuilderLogger implements Logger {
276
276
  LogSource.Internals,
277
277
  'AUTH',
278
278
  'App intitialized with config.json',
279
- {
280
- config: configJSON,
281
- },
279
+ configJSON,
282
280
  );
283
281
  }
284
282
 
@@ -30,12 +30,39 @@ export function getCircularReplacer() {
30
30
  // return value;
31
31
  // };
32
32
  }
33
+
34
+ function getTopLevels(obj, level = 1, maxLevel = 4) {
35
+ if (level > maxLevel || typeof obj !== 'object' || obj === null) {
36
+ return ['MaxLevelExceeds'];
37
+ }
38
+ const result = {};
39
+ for (const key in obj) {
40
+ if (obj.hasOwnProperty(key)) {
41
+ if (typeof obj[key] === 'object' && obj[key] !== null) {
42
+ if (key === 'logContent') {
43
+ result[key] = [obj[key]];
44
+ } else {
45
+ result[key] = getTopLevels(obj[key], level + 1, maxLevel);
46
+ }
47
+ } else {
48
+ result[key] = obj[key];
49
+ }
50
+ }
51
+ }
52
+ return result;
53
+ }
54
+
33
55
  const getSafeBody = (p: any[]) => {
34
56
  try {
35
- return JSON.stringify(p, getCircularReplacer());
57
+ const logResult = [];
58
+ for (let index = 0; index < p.length; index++) {
59
+ const element = p[index];
60
+ logResult.push(getTopLevels(element));
61
+ }
62
+ return JSON.stringify(logResult);
36
63
  } catch (error) {
37
- console.error('there was an error converting this object', p);
38
- return [' object convertion error'];
64
+ console.error('there was an error converting this object', error, p);
65
+ return ['object convertion error'];
39
66
  }
40
67
  };
41
68
 
@@ -121,7 +148,7 @@ export const initTransportLayerForCustomers = () => {
121
148
  service: 'app-builder-core-frontend-customer',
122
149
  logType,
123
150
  logMessage,
124
- logContent,
151
+ logContent: getTopLevels(logContent),
125
152
  contextInfo,
126
153
  ...columns,
127
154
  });
@@ -13,8 +13,6 @@ export interface SdkMethodEvents {
13
13
  username?: string,
14
14
  preference?: {
15
15
  disableShareTile: boolean;
16
- showBeautyControls: boolean;
17
- showQualityControls: boolean;
18
16
  },
19
17
  ): RoomInfoContextInterface['data'];
20
18
  microphoneDevice: (deviceId: deviceId) => void;
@@ -81,8 +81,6 @@ const JOIN_CHANNEL_PHRASE = gql`
81
81
 
82
82
  export interface joinRoomPreference {
83
83
  disableShareTile: boolean;
84
- showBeautyControls: boolean;
85
- showQualityControls: boolean;
86
84
  }
87
85
 
88
86
  export default function useJoinRoom() {
@@ -1,117 +0,0 @@
1
- import React from 'react';
2
- import {Appearance, View, StyleSheet, Platform} from 'react-native';
3
- import {TextInput} from 'react-native-gesture-handler';
4
- import {
5
- GestureHandlerRootView,
6
- GestureDetector,
7
- Gesture,
8
- } from 'react-native-gesture-handler';
9
- import Animated, {
10
- useSharedValue,
11
- useAnimatedStyle,
12
- useAnimatedProps,
13
- } from 'react-native-reanimated';
14
-
15
- const INITIAL_BOX_SIZE = 50;
16
- const SLIDER_WIDTH = 300;
17
-
18
- const AnimatedTextInput = Animated.createAnimatedComponent(TextInput);
19
-
20
- const Slider = () => {
21
- const colorScheme = Appearance.getColorScheme();
22
- const offset = useSharedValue(0);
23
- const boxWidth = useSharedValue(INITIAL_BOX_SIZE);
24
- const MAX_VALUE = SLIDER_WIDTH - INITIAL_BOX_SIZE;
25
-
26
- const pan = Gesture.Pan().onChange(event => {
27
- offset.value = Math.min(
28
- MAX_VALUE,
29
- Math.max(0, offset.value + event.changeX),
30
- );
31
-
32
- const newWidth = INITIAL_BOX_SIZE + offset.value;
33
- boxWidth.value = newWidth;
34
- });
35
-
36
- const boxStyle = useAnimatedStyle(() => {
37
- return {
38
- width: INITIAL_BOX_SIZE + offset.value,
39
- };
40
- });
41
-
42
- const sliderStyle = useAnimatedStyle(() => {
43
- return {
44
- transform: [{translateX: offset.value}],
45
- };
46
- });
47
-
48
- const animatedBoxTextColor = {
49
- color: colorScheme === 'light' ? '#001a72' : '#f8f9ff',
50
- };
51
-
52
- const animatedProps = useAnimatedProps(() => {
53
- return {
54
- text: `Box width: ${Math.round(boxWidth.value)}`,
55
- defaultValue: `Box width: ${boxWidth.value}`,
56
- };
57
- });
58
-
59
- return (
60
- <GestureHandlerRootView style={styles.container}>
61
- {/* Remove the TextInput if you don't want to show the box width */}
62
- {/* <AnimatedTextInput
63
- animatedProps={animatedProps}
64
- style={[animatedBoxTextColor, styles.boxWidthText]}
65
- editable={false}
66
- /> */}
67
- <Animated.View style={[styles.box, boxStyle]} />
68
- <View style={styles.sliderTrack}>
69
- <GestureDetector gesture={pan}>
70
- <Animated.View
71
- style={[
72
- styles.sliderHandle,
73
- sliderStyle,
74
- Platform.OS === 'web' && styles.webCursorPointer,
75
- ]}
76
- />
77
- </GestureDetector>
78
- </View>
79
- </GestureHandlerRootView>
80
- );
81
- };
82
-
83
- const styles = StyleSheet.create({
84
- container: {
85
- flex: 1,
86
- justifyContent: 'center',
87
- alignItems: 'center',
88
- gap: 32,
89
- },
90
- sliderTrack: {
91
- width: SLIDER_WIDTH,
92
- height: 50,
93
- backgroundColor: '#82cab2',
94
- borderRadius: 25,
95
- justifyContent: 'center',
96
- padding: 5,
97
- },
98
- sliderHandle: {
99
- width: 40,
100
- height: 40,
101
- backgroundColor: '#f8f9ff',
102
- borderRadius: 20,
103
- position: 'absolute',
104
- left: 5,
105
- },
106
- box: {
107
- height: INITIAL_BOX_SIZE,
108
- backgroundColor: '#b58df1',
109
- borderRadius: 10,
110
- },
111
- // web-specific cursor style
112
- webCursorPointer: {
113
- cursor: 'pointer',
114
- },
115
- });
116
-
117
- export default Slider;
@@ -1,48 +0,0 @@
1
- import {StyleSheet, Text, View} from 'react-native';
2
- import React from 'react';
3
- import {Slider} from '@react-native-assets/slider';
4
-
5
- interface RangeSliderProps {
6
- value: number;
7
- minimumValue: number;
8
- maximumValue: number;
9
- step: number;
10
- onValueChange: (value: number) => void;
11
- disabled?: boolean;
12
- }
13
-
14
- const RangeSlider = (props: RangeSliderProps) => {
15
- const {value, minimumValue, maximumValue, step, onValueChange, disabled} =
16
- props;
17
- return (
18
- <View>
19
- <Slider
20
- minimumValue={minimumValue}
21
- maximumValue={maximumValue}
22
- step={step}
23
- value={value}
24
- onValueChange={onValueChange}
25
- minimumTrackTintColor={
26
- disabled
27
- ? $config.SEMANTIC_NEUTRAL
28
- : $config.PRIMARY_ACTION_BRAND_COLOR
29
- }
30
- maximumTrackTintColor={$config.SEMANTIC_NEUTRAL}
31
- thumbStyle={{backgroundColor: $config.SECONDARY_ACTION_COLOR}}
32
- style={styles.slider}
33
- enabled={!disabled}
34
- />
35
- </View>
36
- );
37
- };
38
-
39
- export default RangeSlider;
40
-
41
- const styles = StyleSheet.create({
42
- slider: {
43
- // width: 200,
44
- height: 40,
45
- flexGrow: 1,
46
- width: 120,
47
- },
48
- });
@@ -1,158 +0,0 @@
1
- import {StyleSheet, Text, View, ScrollView} from 'react-native';
2
- import {
3
- useBeautyEffect,
4
- type LighteningContrastLevel,
5
- type Level,
6
- } from './useBeautyEffects';
7
- import React from 'react';
8
- import Toggle from '../../atoms/Toggle';
9
- import ThemeConfig from '../../theme';
10
- import hexadecimalTransparency from '../../utils/hexadecimalTransparency';
11
- import RangeSlider from '../../atoms/RangeSlider';
12
-
13
- const Header = () => (
14
- <Text
15
- style={{
16
- paddingHorizontal: 24,
17
- fontWeight: '400',
18
- fontSize: ThemeConfig.FontSize.small,
19
- color: $config.FONT_COLOR + hexadecimalTransparency['70%'],
20
- fontFamily: ThemeConfig.FontFamily.sansPro,
21
- paddingVertical: 20,
22
- borderBottomWidth: 1,
23
- borderBottomColor: $config.INPUT_FIELD_BORDER_COLOR,
24
- }}>
25
- {'Apply Beauty Effects'}
26
- </Text>
27
- );
28
-
29
- const BeautyEffectsControls = () => {
30
- const {
31
- beautyEffectsOn,
32
- setBeautyEffectsOn,
33
- lighteningContrastLevel,
34
- setLighteningContrastLevel,
35
- rednessLevel,
36
- setRednessLevel,
37
- smoothnessLevel,
38
- setSmoothnessLevel,
39
- sharpnessLevel,
40
- setSharpnessLevel,
41
- lighteningLevel,
42
- setLighteningLevel,
43
- } = useBeautyEffect();
44
-
45
- return (
46
- <View>
47
- <Header />
48
- <ScrollView>
49
- <View style={styles.row}>
50
- <Text numberOfLines={1} style={styles.label}>
51
- Enable Beauty Effects
52
- </Text>
53
- <View style={styles.toggleContainer}>
54
- <Toggle
55
- isEnabled={beautyEffectsOn}
56
- toggleSwitch={setBeautyEffectsOn}
57
- />
58
- </View>
59
- </View>
60
-
61
- <View style={styles.row}>
62
- <Text style={styles.label}>
63
- Lightening Contrast: {lighteningContrastLevel}
64
- </Text>
65
- <RangeSlider
66
- minimumValue={0}
67
- maximumValue={2}
68
- step={1}
69
- value={lighteningContrastLevel}
70
- onValueChange={value =>
71
- setLighteningContrastLevel(value as LighteningContrastLevel)
72
- }
73
- disabled={!beautyEffectsOn}
74
- />
75
- </View>
76
- <View style={styles.row}>
77
- <Text style={styles.label}>
78
- Lightening : {lighteningLevel.toFixed(1)}
79
- </Text>
80
- <RangeSlider
81
- minimumValue={0}
82
- maximumValue={1}
83
- step={0.1}
84
- value={lighteningLevel}
85
- onValueChange={value => setLighteningLevel(value as Level)}
86
- disabled={!beautyEffectsOn}
87
- />
88
- </View>
89
- <View style={styles.row}>
90
- <Text style={styles.label}>
91
- Smoothness : {smoothnessLevel.toFixed(1)}
92
- </Text>
93
- <RangeSlider
94
- minimumValue={0}
95
- maximumValue={1}
96
- step={0.1}
97
- value={smoothnessLevel}
98
- onValueChange={value => setSmoothnessLevel(value as Level)}
99
- disabled={!beautyEffectsOn}
100
- />
101
- </View>
102
- <View style={styles.row}>
103
- <Text style={styles.label}>
104
- Sharpness : {sharpnessLevel.toFixed(1)}
105
- </Text>
106
-
107
- <RangeSlider
108
- minimumValue={0}
109
- maximumValue={1}
110
- step={0.1}
111
- value={sharpnessLevel}
112
- onValueChange={value => setSharpnessLevel(value as Level)}
113
- disabled={!beautyEffectsOn}
114
- />
115
- </View>
116
- <View style={styles.row}>
117
- <Text style={styles.label}>Redness : {rednessLevel.toFixed(1)}</Text>
118
- <RangeSlider
119
- minimumValue={0}
120
- maximumValue={1}
121
- step={0.1}
122
- value={rednessLevel}
123
- onValueChange={value => setRednessLevel(value as Level)}
124
- disabled={!beautyEffectsOn}
125
- />
126
- </View>
127
- </ScrollView>
128
- </View>
129
- );
130
- };
131
-
132
- export default BeautyEffectsControls;
133
-
134
- const styles = StyleSheet.create({
135
- row: {
136
- flexDirection: 'row',
137
- paddingHorizontal: 24,
138
- paddingTop: 12,
139
- paddingBottom: 12,
140
- flex: 1,
141
- justifyContent: 'space-between',
142
- alignItems: 'center',
143
- },
144
- toggleContainer: {
145
- flex: 0.2,
146
- alignItems: 'flex-end',
147
- alignSelf: 'center',
148
- },
149
- RangeSliderContainer: {
150
- marginBottom: 20,
151
- },
152
- label: {
153
- fontFamily: ThemeConfig.FontFamily.sansPro,
154
- fontWeight: '400',
155
- fontSize: ThemeConfig.FontSize.normal,
156
- color: $config.FONT_COLOR + hexadecimalTransparency['70%'],
157
- },
158
- });
@@ -1,76 +0,0 @@
1
- import {StyleSheet, Text, ScrollView} from 'react-native';
2
- import React from 'react';
3
- import ThemeConfig from '../../theme';
4
- import Dropdown from '../../atoms/Dropdown';
5
- import {
6
- useVideoQuality,
7
- videoProfilesArray,
8
- screenShareProfilesArray,
9
- } from '../../app-state/useVideoQuality';
10
- import Spacer from '../../atoms/Spacer';
11
-
12
- const QualityControls = () => {
13
- const {
14
- currentVideoQuality,
15
- setVideoQuality,
16
- currentScreenShareQuality,
17
- setScreenShareQuality,
18
- } = useVideoQuality();
19
- const videoProfiles = videoProfilesArray.map(profile => ({
20
- label: profile,
21
- value: profile,
22
- }));
23
- const screenShareProfiles = screenShareProfilesArray.map(profile => ({
24
- label: profile,
25
- value: profile,
26
- }));
27
-
28
- const OnVideoProfileChange = ({label, value}) => {
29
- setVideoQuality(value);
30
- };
31
-
32
- const onScreenShareProfileChange = ({label, value}) => {
33
- setScreenShareQuality(value);
34
- };
35
-
36
- if (
37
- typeof currentVideoQuality !== 'string' ||
38
- typeof currentScreenShareQuality !== 'string'
39
- ) {
40
- return;
41
- }
42
-
43
- return (
44
- <ScrollView>
45
- <Text style={styles.label}>{'Video Profile'}</Text>
46
- <Dropdown
47
- data={videoProfiles}
48
- enabled={true}
49
- label={currentVideoQuality}
50
- onSelect={OnVideoProfileChange}
51
- selectedValue={currentVideoQuality}
52
- />
53
- <Spacer size={24} />
54
- <Text style={styles.label}>{'Screen Share Profile'}</Text>
55
- <Dropdown
56
- data={screenShareProfiles}
57
- enabled={true}
58
- label={currentScreenShareQuality}
59
- onSelect={onScreenShareProfileChange}
60
- selectedValue={currentScreenShareQuality}
61
- />
62
- </ScrollView>
63
- );
64
- };
65
-
66
- export default QualityControls;
67
-
68
- const styles = StyleSheet.create({
69
- label: {
70
- fontWeight: '400',
71
- fontSize: ThemeConfig.FontSize.small,
72
- color: $config.FONT_COLOR,
73
- fontFamily: ThemeConfig.FontFamily.sansPro,
74
- marginBottom: 12,
75
- },
76
- });