react-native-acoustic-connect-beta 18.0.11 → 18.0.12

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 (40) hide show
  1. package/Examples/SampleUI/ConnectConfig.json +180 -0
  2. package/Examples/SampleUI/android/app/build.gradle +2 -0
  3. package/Examples/SampleUI/android/app/src/main/AndroidManifest.xml +18 -13
  4. package/Examples/SampleUI/android/app/src/main/java/com/sampleui/MainActivity.kt +47 -5
  5. package/Examples/SampleUI/ios/SampleUI.xcodeproj/xcshareddata/xcschemes/SampleUI.xcscheme +17 -0
  6. package/Examples/SampleUI/metro.config.js +2 -1
  7. package/Examples/SampleUI/package.json +3 -2
  8. package/Examples/SampleUI/src/RootNavigator.tsx +10 -1
  9. package/README.md +4 -0
  10. package/android/src/main/assets/ConnectAdvancedConfig.json +1 -1
  11. package/lib/commonjs/components/Connect.js +98 -0
  12. package/lib/commonjs/components/Connect.js.map +1 -0
  13. package/lib/commonjs/index.js +10 -1
  14. package/lib/commonjs/index.js.map +1 -1
  15. package/lib/module/components/Connect.js +91 -0
  16. package/lib/module/components/Connect.js.map +1 -0
  17. package/lib/module/index.js +2 -1
  18. package/lib/module/index.js.map +1 -1
  19. package/lib/typescript/src/components/Connect.d.ts +17 -0
  20. package/lib/typescript/src/components/Connect.d.ts.map +1 -0
  21. package/lib/typescript/src/index.d.ts +2 -0
  22. package/lib/typescript/src/index.d.ts.map +1 -1
  23. package/lib/typescript/src/specs/react-native-acoustic-connect.nitro.d.ts.map +1 -1
  24. package/package.json +1 -1
  25. package/scripts/ConnectConfig.json +1 -1
  26. package/scripts/javaParser.js +1 -1
  27. package/src/components/Connect.tsx +110 -0
  28. package/src/index.ts +3 -3
  29. package/src/specs/react-native-acoustic-connect.nitro.ts +1 -15
  30. package/Examples/SampleUI/package-lock.json +0 -17033
  31. package/jslib/components/Connect.js +0 -85
  32. package/lib/commonjs/types.js +0 -24
  33. package/lib/commonjs/types.js.map +0 -1
  34. package/lib/module/types.js +0 -24
  35. package/lib/module/types.js.map +0 -1
  36. package/lib/typescript/jslib/components/Connect.d.ts +0 -4
  37. package/lib/typescript/jslib/components/Connect.d.ts.map +0 -1
  38. package/lib/typescript/src/types.d.ts +0 -1
  39. package/lib/typescript/src/types.d.ts.map +0 -1
  40. package/src/types.ts +0 -23
@@ -1,85 +0,0 @@
1
- /********************************************************************************************
2
- * Copyright (C) 2024 Acoustic, L.P. All rights reserved.
3
- *
4
- * NOTICE: This file contains material that is confidential and proprietary to
5
- * Acoustic, L.P. and/or other developers. No license is granted under any intellectual or
6
- * industrial property rights of Acoustic, L.P. except as may be provided in an agreement with
7
- * Acoustic, L.P. Any unauthorized copying or distribution of content from this file is
8
- * prohibited.
9
- ********************************************************************************************/
10
- import React, {useCallback, useEffect, useRef} from "react";
11
- import { View, StyleSheet, Platform, NativeModules, findNodeHandle } from "react-native";
12
- import TLTRN from '../TLTRN';
13
-
14
- const Connect = (props) => {
15
- const { children, captureKeyboardEvents } = props;
16
- const navigation = children.ref;
17
- const currentRoute = useRef();
18
- const initial = useRef(false);
19
-
20
- useEffect(() => { TLTRN.interceptKeyboardEvents(captureKeyboardEvents); }, [captureKeyboardEvents]);
21
-
22
- useEffect(() => {
23
- if(!navigation || typeof navigation.current.addListener !== 'function' || typeof navigation.current.getCurrentRoute !== 'function'){
24
- console.warn('Connect: The Connect components first child must be a NavigationContainer with a ref.');
25
- return;
26
- }
27
-
28
- const unsubscribe = navigation.current.addListener('state', () => {
29
- currentRoute.current = extractName(navigation) || navigation.current.getCurrentRoute().name;
30
- console.log('State change - ', currentRoute.current);
31
-
32
- if (Platform.OS === 'ios' && currentRoute && currentRoute.current) {
33
- TLTRN.setCurrentScreenName(currentRoute.current);
34
- } else if (Platform.OS === 'android') {
35
- TLTRN.setCurrentScreenName(currentRoute.current);
36
- TLTRN.logScreenLayout(currentRoute.current);
37
- }
38
- });
39
-
40
- return unsubscribe;
41
- }, [navigation]);
42
-
43
- const onStartShouldSetResponderCapture = useCallback((event) => {
44
- currentRoute.current = extractName(navigation) || navigation.current.getCurrentRoute().name;
45
- if (currentRoute && currentRoute.current) {
46
- TLTRN.setCurrentScreenName(currentRoute.current);
47
- }
48
- TLTRN.logClickEvent(event);
49
- return false; // Must be false; true means this component becomes the touch responder and events dont bubble
50
- }, []);
51
-
52
- const onLayout = useCallback(() => {
53
- if(initial.current){ return false; }
54
- initial.current = true;
55
-
56
- currentRoute.current = navigation.current.getCurrentRoute().name;
57
- if (Platform.OS === 'ios' && currentRoute && currentRoute.current) {
58
- TLTRN.setCurrentScreenName(currentRoute.current);
59
- } else if (Platform.OS === 'android') {
60
- TLTRN.logScreenLayout(currentRoute.current);
61
- }
62
- }, [navigation]);
63
-
64
- return (
65
- <View style={styles.connect_main}
66
- onLayout={onLayout}
67
- onStartShouldSetResponderCapture={onStartShouldSetResponderCapture}>
68
- {children}
69
- </View>
70
- );
71
- };
72
- function extractName(navigation){
73
- if(navigation.current.getCurrentRoute().params){
74
- const { name } = navigation.current.getCurrentRoute().params
75
- return name
76
- }
77
- return ""
78
- }
79
- export default Connect;
80
-
81
- const styles = StyleSheet.create({
82
- connect_main: {
83
- flex: 1
84
- }
85
- })
@@ -1,24 +0,0 @@
1
- // Copyright (C) 2024 Acoustic, L.P. All rights reserved.
2
- //
3
- // NOTICE: This file contains material that is confidential and proprietary to
4
- // Acoustic, L.P. and/or other developers. No license is granted under any intellectual or
5
- // industrial property rights of Acoustic, L.P. except as may be provided in an agreement with
6
- // Acoustic, L.P. Any unauthorized copying or distribution of content from this file is
7
- // prohibited.
8
- //
9
- //
10
- // Created by Omar Hernandez on 5/9/25.
11
- //
12
-
13
- // export type ConnectionType = 'unknown' | 'ethernet' | 'wifi' | 'cellular'
14
-
15
- // export type AcousticConnectStatusInfoRNBeta = {
16
- // isConnected: boolean
17
- // connectionType: ConnectionType
18
- // }
19
-
20
- // export type NetworkInfoListener = (networkInfo: AcousticConnectStatusInfoRNBeta) => void
21
-
22
- // export type ConnectionType = 'Ignore' | 'CellularAndWiFi' | 'WiFi'
23
- "use strict";
24
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAGA;;AAEA;AAAA","ignoreList":[]}
@@ -1,24 +0,0 @@
1
- // Copyright (C) 2024 Acoustic, L.P. All rights reserved.
2
- //
3
- // NOTICE: This file contains material that is confidential and proprietary to
4
- // Acoustic, L.P. and/or other developers. No license is granted under any intellectual or
5
- // industrial property rights of Acoustic, L.P. except as may be provided in an agreement with
6
- // Acoustic, L.P. Any unauthorized copying or distribution of content from this file is
7
- // prohibited.
8
- //
9
- //
10
- // Created by Omar Hernandez on 5/9/25.
11
- //
12
-
13
- // export type ConnectionType = 'unknown' | 'ethernet' | 'wifi' | 'cellular'
14
-
15
- // export type AcousticConnectStatusInfoRNBeta = {
16
- // isConnected: boolean
17
- // connectionType: ConnectionType
18
- // }
19
-
20
- // export type NetworkInfoListener = (networkInfo: AcousticConnectStatusInfoRNBeta) => void
21
-
22
- // export type ConnectionType = 'Ignore' | 'CellularAndWiFi' | 'WiFi'
23
- "use strict";
24
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAGA;;AAEA;AAAA","ignoreList":[]}
@@ -1,4 +0,0 @@
1
- export default Connect;
2
- declare function Connect(props: any): React.JSX.Element;
3
- import React from "react";
4
- //# sourceMappingURL=Connect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Connect.d.ts","sourceRoot":"","sources":["../../../../jslib/components/Connect.js"],"names":[],"mappings":";AAaA,wDAyDC;kBA7DmD,OAAO"}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":""}
package/src/types.ts DELETED
@@ -1,23 +0,0 @@
1
- // Copyright (C) 2024 Acoustic, L.P. All rights reserved.
2
- //
3
- // NOTICE: This file contains material that is confidential and proprietary to
4
- // Acoustic, L.P. and/or other developers. No license is granted under any intellectual or
5
- // industrial property rights of Acoustic, L.P. except as may be provided in an agreement with
6
- // Acoustic, L.P. Any unauthorized copying or distribution of content from this file is
7
- // prohibited.
8
- //
9
- //
10
- // Created by Omar Hernandez on 5/9/25.
11
- //
12
-
13
- // export type ConnectionType = 'unknown' | 'ethernet' | 'wifi' | 'cellular'
14
-
15
- // export type AcousticConnectStatusInfoRNBeta = {
16
- // isConnected: boolean
17
- // connectionType: ConnectionType
18
- // }
19
-
20
-
21
- // export type NetworkInfoListener = (networkInfo: AcousticConnectStatusInfoRNBeta) => void
22
-
23
- // export type ConnectionType = 'Ignore' | 'CellularAndWiFi' | 'WiFi'