react-native-acoustic-connect-beta 18.0.14 → 18.0.16

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 (97) hide show
  1. package/Examples/SampleUI/.detoxrc.js +83 -0
  2. package/Examples/SampleUI/ConnectConfig.json +2 -2
  3. package/Examples/SampleUI/android/app/build.gradle +3 -0
  4. package/Examples/SampleUI/android/app/src/main/java/com/sampleui/MainActivity.kt +0 -35
  5. package/Examples/SampleUI/android/settings.gradle +1 -1
  6. package/Examples/SampleUI/package.json +8 -6
  7. package/Examples/SampleUI/scripts/integration-test-android.sh +292 -0
  8. package/Examples/SampleUI/src/Examples/DialogExample.tsx +88 -2
  9. package/Examples/SampleUI/src/Examples/Dialogs/DialogTrackingTest.tsx +307 -0
  10. package/Examples/SampleUI/src/Examples/Dialogs/index.tsx +37 -0
  11. package/Examples/SampleUI/src/index.native.tsx +4 -5
  12. package/android/build.gradle +2 -2
  13. package/android/src/main/assets/ConnectAdvancedConfig.json +1 -1
  14. package/android/src/main/java/com/acousticconnectrn/HybridAcousticConnectRN.kt +787 -490
  15. package/ios/HybridAcousticConnectRN.swift +75 -0
  16. package/lib/commonjs/TLTRN.js +69 -0
  17. package/lib/commonjs/TLTRN.js.map +1 -1
  18. package/lib/commonjs/components/Connect.js +5 -1
  19. package/lib/commonjs/components/Connect.js.map +1 -1
  20. package/lib/commonjs/docs/DialogTracking.md +252 -0
  21. package/lib/commonjs/docs/NativeImplementation.md +176 -0
  22. package/lib/commonjs/examples/DialogTrackingExample.js +175 -0
  23. package/lib/commonjs/examples/DialogTrackingExample.js.map +1 -0
  24. package/lib/commonjs/examples/HOCDialogExample.js +296 -0
  25. package/lib/commonjs/examples/HOCDialogExample.js.map +1 -0
  26. package/lib/commonjs/index.js +28 -0
  27. package/lib/commonjs/index.js.map +1 -1
  28. package/lib/commonjs/utils/DialogDebugger.js +216 -0
  29. package/lib/commonjs/utils/DialogDebugger.js.map +1 -0
  30. package/lib/commonjs/utils/DialogListener.js +203 -0
  31. package/lib/commonjs/utils/DialogListener.js.map +1 -0
  32. package/lib/commonjs/utils/useDialogTracking.js +107 -0
  33. package/lib/commonjs/utils/useDialogTracking.js.map +1 -0
  34. package/lib/commonjs/utils/withAcousticAutoDialog.js +282 -0
  35. package/lib/commonjs/utils/withAcousticAutoDialog.js.map +1 -0
  36. package/lib/module/TLTRN.js +69 -0
  37. package/lib/module/TLTRN.js.map +1 -1
  38. package/lib/module/components/Connect.js +5 -1
  39. package/lib/module/components/Connect.js.map +1 -1
  40. package/lib/module/docs/DialogTracking.md +252 -0
  41. package/lib/module/docs/NativeImplementation.md +176 -0
  42. package/lib/module/examples/DialogTrackingExample.js +172 -0
  43. package/lib/module/examples/DialogTrackingExample.js.map +1 -0
  44. package/lib/module/examples/HOCDialogExample.js +292 -0
  45. package/lib/module/examples/HOCDialogExample.js.map +1 -0
  46. package/lib/module/index.js +5 -1
  47. package/lib/module/index.js.map +1 -1
  48. package/lib/module/utils/DialogDebugger.js +211 -0
  49. package/lib/module/utils/DialogDebugger.js.map +1 -0
  50. package/lib/module/utils/DialogListener.js +199 -0
  51. package/lib/module/utils/DialogListener.js.map +1 -0
  52. package/lib/module/utils/useDialogTracking.js +102 -0
  53. package/lib/module/utils/useDialogTracking.js.map +1 -0
  54. package/lib/module/utils/withAcousticAutoDialog.js +275 -0
  55. package/lib/module/utils/withAcousticAutoDialog.js.map +1 -0
  56. package/lib/typescript/src/TLTRN.d.ts +7 -0
  57. package/lib/typescript/src/TLTRN.d.ts.map +1 -1
  58. package/lib/typescript/src/components/Connect.d.ts +1 -0
  59. package/lib/typescript/src/components/Connect.d.ts.map +1 -1
  60. package/lib/typescript/src/examples/DialogTrackingExample.d.ts +17 -0
  61. package/lib/typescript/src/examples/DialogTrackingExample.d.ts.map +1 -0
  62. package/lib/typescript/src/examples/HOCDialogExample.d.ts +21 -0
  63. package/lib/typescript/src/examples/HOCDialogExample.d.ts.map +1 -0
  64. package/lib/typescript/src/index.d.ts +5 -1
  65. package/lib/typescript/src/index.d.ts.map +1 -1
  66. package/lib/typescript/src/specs/react-native-acoustic-connect.nitro.d.ts +4 -0
  67. package/lib/typescript/src/specs/react-native-acoustic-connect.nitro.d.ts.map +1 -1
  68. package/lib/typescript/src/utils/DialogDebugger.d.ts +58 -0
  69. package/lib/typescript/src/utils/DialogDebugger.d.ts.map +1 -0
  70. package/lib/typescript/src/utils/DialogListener.d.ts +85 -0
  71. package/lib/typescript/src/utils/DialogListener.d.ts.map +1 -0
  72. package/lib/typescript/src/utils/useDialogTracking.d.ts +25 -0
  73. package/lib/typescript/src/utils/useDialogTracking.d.ts.map +1 -0
  74. package/lib/typescript/src/utils/withAcousticAutoDialog.d.ts +37 -0
  75. package/lib/typescript/src/utils/withAcousticAutoDialog.d.ts.map +1 -0
  76. package/nitrogen/generated/android/c++/JHybridAcousticConnectRNSpec.cpp +26 -0
  77. package/nitrogen/generated/android/c++/JHybridAcousticConnectRNSpec.hpp +4 -0
  78. package/nitrogen/generated/android/kotlin/com/margelo/nitro/acousticconnectrn/HybridAcousticConnectRNSpec.kt +16 -0
  79. package/nitrogen/generated/ios/c++/HybridAcousticConnectRNSpecSwift.hpp +32 -0
  80. package/nitrogen/generated/ios/swift/HybridAcousticConnectRNSpec.swift +4 -0
  81. package/nitrogen/generated/ios/swift/HybridAcousticConnectRNSpec_cxx.swift +71 -0
  82. package/nitrogen/generated/shared/c++/HybridAcousticConnectRNSpec.cpp +4 -0
  83. package/nitrogen/generated/shared/c++/HybridAcousticConnectRNSpec.hpp +4 -0
  84. package/package.json +1 -1
  85. package/scripts/ConnectConfig.json +1 -1
  86. package/src/TLTRN.ts +75 -0
  87. package/src/components/Connect.tsx +6 -1
  88. package/src/docs/DialogTracking.md +252 -0
  89. package/src/docs/NativeImplementation.md +176 -0
  90. package/src/examples/DialogTrackingExample.tsx +163 -0
  91. package/src/examples/HOCDialogExample.tsx +253 -0
  92. package/src/index.ts +5 -1
  93. package/src/specs/react-native-acoustic-connect.nitro.ts +5 -0
  94. package/src/utils/DialogDebugger.ts +224 -0
  95. package/src/utils/DialogListener.ts +238 -0
  96. package/src/utils/useDialogTracking.ts +102 -0
  97. package/src/utils/withAcousticAutoDialog.tsx +312 -0
@@ -0,0 +1,176 @@
1
+ # Native Implementation for Dialog Event Tracking
2
+
3
+ This document summarizes the native implementation of the dialog event tracking functionality for both Android and iOS platforms.
4
+
5
+ ## Overview
6
+
7
+ The dialog event tracking system has been implemented across all three layers:
8
+ 1. **TypeScript Interface** (`src/specs/react-native-acoustic-connect.nitro.ts`)
9
+ 2. **Android Implementation** (`android/src/main/java/com/acousticconnectrn/HybridAcousticConnectRN.kt`)
10
+ 3. **iOS Implementation** (`ios/HybridAcousticConnectRN.swift`)
11
+
12
+ ## Interface Methods Added
13
+
14
+ Four new methods were added to the `AcousticConnectRN` interface:
15
+
16
+ ### 1. `logDialogShowEvent`
17
+ - **Purpose**: Logs when a dialog is shown
18
+ - **Parameters**:
19
+ - `dialogId`: Unique identifier for the dialog
20
+ - `dialogTitle`: The title of the dialog
21
+ - `dialogType`: The type of dialog (alert, custom, modal)
22
+ - **Returns**: `Boolean` indicating success/failure
23
+
24
+ ### 2. `logDialogDismissEvent`
25
+ - **Purpose**: Logs when a dialog is dismissed
26
+ - **Parameters**:
27
+ - `dialogId`: Unique identifier for the dialog
28
+ - `dismissReason`: The reason for dismissing the dialog
29
+ - **Returns**: `Boolean` indicating success/failure
30
+
31
+ ### 3. `logDialogButtonClickEvent`
32
+ - **Purpose**: Logs when a button in a dialog is clicked
33
+ - **Parameters**:
34
+ - `dialogId`: Unique identifier for the dialog
35
+ - `buttonText`: The text of the clicked button
36
+ - `buttonIndex`: The index of the clicked button
37
+ - **Returns**: `Boolean` indicating success/failure
38
+
39
+ ### 4. `logDialogCustomEvent`
40
+ - **Purpose**: Logs custom dialog events with additional data
41
+ - **Parameters**:
42
+ - `dialogId`: Unique identifier for the dialog
43
+ - `eventName`: The name of the custom event
44
+ - `values`: A map of values associated with the event
45
+ - **Returns**: `Boolean` indicating success/failure
46
+
47
+ ## Android Implementation
48
+
49
+ ### File: `android/src/main/java/com/acousticconnectrn/HybridAcousticConnectRN.kt`
50
+
51
+ All four methods have been implemented using the existing `Connect.logCustomEvent()` API:
52
+
53
+ ```kotlin
54
+ override fun logDialogShowEvent(dialogId: String, dialogTitle: String, dialogType: String): Boolean {
55
+ var result = false
56
+ try {
57
+ val values = HashMap<String?, String?>()
58
+ values["dialogId"] = dialogId
59
+ values["dialogTitle"] = dialogTitle
60
+ values["dialogType"] = dialogType
61
+ values["eventType"] = "dialog_show"
62
+ values["timestamp"] = System.currentTimeMillis().toString()
63
+
64
+ result = Connect.logCustomEvent("DialogShowEvent", values, EOMonitoringLevel.kEOMonitoringLevelInfo.value)
65
+ } catch (e: Exception) {
66
+ println("Error logging dialog show event: ${e.message}")
67
+ result = false
68
+ }
69
+ return result
70
+ }
71
+ ```
72
+
73
+ ### Key Features:
74
+ - **Error Handling**: All methods include try-catch blocks for robust error handling
75
+ - **Consistent Logging**: Uses the same `Connect.logCustomEvent()` API as other events
76
+ - **Timestamp**: Includes millisecond timestamps for event tracking
77
+ - **Event Type**: Each event includes an `eventType` field for easy filtering
78
+ - **Monitoring Level**: Uses `EOMonitoringLevel.kEOMonitoringLevelInfo.value` for consistent logging level
79
+
80
+ ## iOS Implementation
81
+
82
+ ### File: `ios/HybridAcousticConnectRN.swift`
83
+
84
+ All four methods have been implemented using the existing `ConnectCustomEvent().logEvent()` API:
85
+
86
+ ```swift
87
+ func logDialogShowEvent(dialogId: String, dialogTitle: String, dialogType: String) throws -> Bool {
88
+ let values: [String: Any] = [
89
+ "dialogId": dialogId,
90
+ "dialogTitle": dialogTitle,
91
+ "dialogType": dialogType,
92
+ "eventType": "dialog_show",
93
+ "timestamp": String(Int(Date().timeIntervalSince1970 * 1000))
94
+ ]
95
+
96
+ let result = ConnectCustomEvent().logEvent("DialogShowEvent", values: values, level: kConnectMonitoringLevelType.connectMonitoringLevelInfo)
97
+ return result
98
+ }
99
+ ```
100
+
101
+ ### Key Features:
102
+ - **Error Handling**: Uses Swift's throwing mechanism for error handling
103
+ - **Consistent Logging**: Uses the same `ConnectCustomEvent().logEvent()` API as other events
104
+ - **Timestamp**: Includes millisecond timestamps for event tracking
105
+ - **Event Type**: Each event includes an `eventType` field for easy filtering
106
+ - **Monitoring Level**: Uses `kConnectMonitoringLevelType.connectMonitoringLevelInfo` for consistent logging level
107
+ - **Type Safety**: Leverages Swift's strong typing for parameter validation
108
+
109
+ ## Generated Spec Files
110
+
111
+ The Nitro framework automatically generated the interface specifications:
112
+
113
+ ### Android: `nitrogen/generated/android/kotlin/com/margelo/nitro/acousticconnectrn/HybridAcousticConnectRNSpec.kt`
114
+ - Contains abstract method declarations for all four dialog event methods
115
+ - Properly annotated with `@DoNotStrip` and `@Keep` for ProGuard compatibility
116
+
117
+ ### iOS: `nitrogen/generated/ios/swift/HybridAcousticConnectRNSpec.swift`
118
+ - Contains protocol method declarations for all four dialog event methods
119
+ - Includes proper Swift documentation comments
120
+
121
+ ## Data Structure
122
+
123
+ All dialog events include consistent metadata:
124
+
125
+ ```json
126
+ {
127
+ "dialogId": "unique_dialog_identifier",
128
+ "eventType": "dialog_show|dialog_dismiss|dialog_button_click|dialog_custom_event",
129
+ "timestamp": "1703123456789",
130
+ // Additional fields specific to each event type
131
+ }
132
+ ```
133
+
134
+ ## Error Handling Strategy
135
+
136
+ ### Android:
137
+ - Uses try-catch blocks to prevent app crashes
138
+ - Logs error messages to console for debugging
139
+ - Returns `false` on any exception
140
+
141
+ ### iOS:
142
+ - Uses Swift's throwing mechanism
143
+ - Errors are propagated up the call stack
144
+ - Caller can handle errors appropriately
145
+
146
+ ## Performance Considerations
147
+
148
+ - **Lightweight**: All methods are lightweight and don't perform heavy operations
149
+ - **Async Safe**: Methods can be called from any thread
150
+ - **Memory Efficient**: Uses simple data structures and minimal memory allocation
151
+ - **Network Efficient**: Events are batched and sent according to existing Connect SDK policies
152
+
153
+ ## Testing
154
+
155
+ The implementation can be tested using:
156
+
157
+ 1. **Unit Tests**: Test individual method calls
158
+ 2. **Integration Tests**: Test with actual dialog components
159
+ 3. **End-to-End Tests**: Verify events appear in Acoustic Connect dashboard
160
+
161
+ ## Future Enhancements
162
+
163
+ Potential improvements for future versions:
164
+
165
+ 1. **Event Batching**: Batch multiple dialog events for better performance
166
+ 2. **Custom Event Types**: Allow developers to define custom dialog event types
167
+ 3. **Event Filtering**: Add configuration options to filter specific dialog events
168
+ 4. **Analytics Integration**: Direct integration with analytics platforms
169
+ 5. **Performance Metrics**: Track dialog performance metrics (show time, interaction time)
170
+
171
+ ## Compatibility
172
+
173
+ - **Backward Compatible**: No breaking changes to existing functionality
174
+ - **Platform Agnostic**: Consistent API across Android and iOS
175
+ - **Framework Compatible**: Works with existing Connect SDK infrastructure
176
+ - **Version Safe**: Compatible with current React Native versions
@@ -0,0 +1,175 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _useDialogTracking = require("../utils/useDialogTracking");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
12
+ /********************************************************************************************
13
+ * Copyright (C) 2025 Acoustic, L.P. All rights reserved.
14
+ *
15
+ * NOTICE: This file contains material that is confidential and proprietary to
16
+ * Acoustic, L.P. and/or other developers. No license is granted under any intellectual or
17
+ * industrial property rights of Acoustic, L.P. except as may be provided in an agreement with
18
+ * Acoustic, L.P. Any unauthorized copying or distribution of content from this file is
19
+ * prohibited.
20
+ ********************************************************************************************/
21
+
22
+ /**
23
+ * Example component demonstrating dialog event tracking
24
+ * Shows how to use both automatic Alert.alert interception and manual custom dialog tracking
25
+ */const DialogTrackingExample = () => {
26
+ const [customDialogVisible, setCustomDialogVisible] = (0, _react.useState)(false);
27
+ const {
28
+ generateDialogId,
29
+ trackDialogShow,
30
+ trackDialogDismiss,
31
+ createTrackedButton
32
+ } = (0, _useDialogTracking.useDialogTracking)();
33
+
34
+ // Example 1: Automatic Alert.alert tracking (no additional code needed)
35
+ const showAlertDialog = () => {
36
+ _reactNative.Alert.alert('Confirmation', 'Are you sure you want to proceed?', [{
37
+ text: 'Cancel',
38
+ style: 'cancel'
39
+ }, {
40
+ text: 'OK',
41
+ onPress: () => console.log('OK pressed')
42
+ }]);
43
+ };
44
+
45
+ // Example 2: Manual custom dialog tracking
46
+ const showCustomDialog = () => {
47
+ const dialogId = generateDialogId();
48
+ const title = 'Custom Dialog';
49
+ const buttons = [{
50
+ text: 'Cancel',
51
+ style: 'cancel'
52
+ }, {
53
+ text: 'Confirm',
54
+ onPress: () => console.log('Confirm pressed')
55
+ }];
56
+
57
+ // Track dialog show event
58
+ trackDialogShow(dialogId, title, buttons);
59
+ setCustomDialogVisible(true);
60
+ };
61
+ const hideCustomDialog = () => {
62
+ const dialogId = generateDialogId(); // In real app, you'd store this
63
+ trackDialogDismiss(dialogId, 'user_dismiss');
64
+ setCustomDialogVisible(false);
65
+ };
66
+
67
+ // Example 3: Custom dialog with tracked buttons
68
+ const showTrackedCustomDialog = () => {
69
+ const dialogId = generateDialogId();
70
+ const title = 'Tracked Custom Dialog';
71
+ const originalButtons = [{
72
+ text: 'No',
73
+ style: 'cancel'
74
+ }, {
75
+ text: 'Yes',
76
+ onPress: () => console.log('Yes pressed')
77
+ }];
78
+
79
+ // Create tracked buttons
80
+ const trackedButtons = originalButtons.map((button, index) => createTrackedButton(dialogId, button, index));
81
+ trackDialogShow(dialogId, title, trackedButtons);
82
+ setCustomDialogVisible(true);
83
+ };
84
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
85
+ style: styles.container,
86
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
87
+ style: styles.title,
88
+ children: "Dialog Tracking Examples"
89
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
90
+ style: styles.buttonContainer,
91
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Button, {
92
+ title: "Show Alert Dialog (Auto-tracked)",
93
+ onPress: showAlertDialog
94
+ })
95
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
96
+ style: styles.buttonContainer,
97
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Button, {
98
+ title: "Show Custom Dialog (Manual tracking)",
99
+ onPress: showCustomDialog
100
+ })
101
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
102
+ style: styles.buttonContainer,
103
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Button, {
104
+ title: "Show Tracked Custom Dialog",
105
+ onPress: showTrackedCustomDialog
106
+ })
107
+ }), customDialogVisible && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
108
+ style: styles.customDialog,
109
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
110
+ style: styles.dialogTitle,
111
+ children: "Custom Dialog"
112
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
113
+ style: styles.dialogMessage,
114
+ children: "This is a custom dialog with manual tracking"
115
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
116
+ style: styles.dialogButtons,
117
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Button, {
118
+ title: "Cancel",
119
+ onPress: hideCustomDialog
120
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Button, {
121
+ title: "OK",
122
+ onPress: hideCustomDialog
123
+ })]
124
+ })]
125
+ })]
126
+ });
127
+ };
128
+ const styles = _reactNative.StyleSheet.create({
129
+ container: {
130
+ flex: 1,
131
+ padding: 20,
132
+ justifyContent: 'center'
133
+ },
134
+ title: {
135
+ fontSize: 24,
136
+ fontWeight: 'bold',
137
+ textAlign: 'center',
138
+ marginBottom: 30
139
+ },
140
+ buttonContainer: {
141
+ marginVertical: 10
142
+ },
143
+ customDialog: {
144
+ position: 'absolute',
145
+ top: '50%',
146
+ left: 20,
147
+ right: 20,
148
+ backgroundColor: 'white',
149
+ borderRadius: 10,
150
+ padding: 20,
151
+ elevation: 5,
152
+ shadowColor: '#000',
153
+ shadowOffset: {
154
+ width: 0,
155
+ height: 2
156
+ },
157
+ shadowOpacity: 0.25,
158
+ shadowRadius: 3.84
159
+ },
160
+ dialogTitle: {
161
+ fontSize: 18,
162
+ fontWeight: 'bold',
163
+ marginBottom: 10
164
+ },
165
+ dialogMessage: {
166
+ fontSize: 16,
167
+ marginBottom: 20
168
+ },
169
+ dialogButtons: {
170
+ flexDirection: 'row',
171
+ justifyContent: 'space-around'
172
+ }
173
+ });
174
+ var _default = exports.default = DialogTrackingExample;
175
+ //# sourceMappingURL=DialogTrackingExample.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_useDialogTracking","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DialogTrackingExample","customDialogVisible","setCustomDialogVisible","useState","generateDialogId","trackDialogShow","trackDialogDismiss","createTrackedButton","useDialogTracking","showAlertDialog","Alert","alert","text","style","onPress","console","log","showCustomDialog","dialogId","title","buttons","hideCustomDialog","showTrackedCustomDialog","originalButtons","trackedButtons","map","button","index","jsxs","View","styles","container","children","jsx","Text","buttonContainer","Button","customDialog","dialogTitle","dialogMessage","dialogButtons","StyleSheet","create","flex","padding","justifyContent","fontSize","fontWeight","textAlign","marginBottom","marginVertical","position","top","left","right","backgroundColor","borderRadius","elevation","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","flexDirection","_default","exports"],"sourceRoot":"../../../src","sources":["examples/DialogTrackingExample.tsx"],"mappings":";;;;;;AAUA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AAA+D,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAA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+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _Connect = _interopRequireDefault(require("../components/Connect"));
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
13
+ /********************************************************************************************
14
+ * Copyright (C) 2025 Acoustic, L.P. All rights reserved.
15
+ *
16
+ * NOTICE: This file contains material that is confidential and proprietary to
17
+ * Acoustic, L.P. and/or other developers. No license is granted under any intellectual or
18
+ * industrial property rights of Acoustic, L.P. except as may be provided in an agreement with
19
+ * Acoustic, L.P. Any unauthorized copying or distribution of content from this file is
20
+ * prohibited.
21
+ ********************************************************************************************/
22
+
23
+ /**
24
+ * Example demonstrating HOC-based Paper Dialog tracking
25
+ *
26
+ * This approach requires minimal code changes:
27
+ * 1. Create tracked versions of your dialog components
28
+ * 2. Use the tracked versions instead of the original ones
29
+ * 3. All dialog events are automatically tracked!
30
+ */const HOCDialogExample = () => {
31
+ const [dialogVisible, setDialogVisible] = React.useState(false);
32
+
33
+ // Example 1: React Native Alert.alert (automatically tracked)
34
+ const showAlertDialog = () => {
35
+ _reactNative.Alert.alert('Confirmation Alert', 'This is a native alert dialog that is automatically tracked.', [{
36
+ text: 'Cancel',
37
+ style: 'cancel'
38
+ }, {
39
+ text: 'OK',
40
+ onPress: () => console.log('Alert OK pressed')
41
+ }]);
42
+ };
43
+
44
+ // Example 2: Paper Dialog with HOC tracking
45
+ const showPaperDialog = () => {
46
+ setDialogVisible(true);
47
+ };
48
+ const hidePaperDialog = () => {
49
+ setDialogVisible(false);
50
+ };
51
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Connect.default, {
52
+ captureDialogEvents: true,
53
+ captureKeyboardEvents: false,
54
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
55
+ style: styles.container,
56
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
57
+ style: styles.title,
58
+ children: "HOC Dialog Tracking Example"
59
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
60
+ style: styles.subtitle,
61
+ children: "Minimal code changes required - just wrap your dialog components!"
62
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
63
+ style: styles.buttonContainer,
64
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
65
+ style: styles.button,
66
+ onPress: showAlertDialog,
67
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
68
+ style: styles.buttonText,
69
+ children: "Show Alert.alert"
70
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
71
+ style: styles.buttonSubtext,
72
+ children: "Automatically tracked"
73
+ })]
74
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
75
+ style: styles.button,
76
+ onPress: showPaperDialog,
77
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
78
+ style: styles.buttonText,
79
+ children: "Show Paper Dialog (HOC)"
80
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
81
+ style: styles.buttonSubtext,
82
+ children: "Minimal code changes"
83
+ })]
84
+ })]
85
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
86
+ style: styles.infoContainer,
87
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
88
+ style: styles.infoTitle,
89
+ children: "How to use HOC approach:"
90
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
91
+ style: styles.infoText,
92
+ children: "1. Create tracked dialog components"
93
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
94
+ style: styles.infoText,
95
+ children: "2. Use tracked versions instead of originals"
96
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
97
+ style: styles.infoText,
98
+ children: "3. All events automatically tracked!"
99
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
100
+ style: styles.infoText,
101
+ children: "4. No manual tracking code needed"
102
+ })]
103
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
104
+ style: styles.codeContainer,
105
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
106
+ style: styles.codeTitle,
107
+ children: "Example Setup Code:"
108
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
109
+ style: styles.codeText,
110
+ children: `// In your app setup
111
+ import { withAcousticAutoDialog } from 'react-native-acoustic-connect-beta';
112
+ import { Dialog, Portal } from 'react-native-paper';
113
+
114
+ // Create tracked versions
115
+ const TrackedDialog = withAcousticAutoDialog(Dialog);
116
+ const TrackedPortal = withAcousticAutoDialog(Portal);
117
+
118
+ // Use TrackedDialog instead of Dialog - that's it!`
119
+ })]
120
+ }), dialogVisible && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
121
+ style: styles.exampleDialog,
122
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
123
+ style: styles.dialogTitle,
124
+ children: "Example Dialog"
125
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
126
+ style: styles.dialogContent,
127
+ children: "This shows how you would use the tracked dialog components. In a real app, you would use TrackedDialog instead of Dialog."
128
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
129
+ style: styles.dialogActions,
130
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
131
+ style: styles.dialogButton,
132
+ onPress: hidePaperDialog,
133
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
134
+ style: styles.dialogButtonText,
135
+ children: "Cancel"
136
+ })
137
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
138
+ style: [styles.dialogButton, styles.primaryButton],
139
+ onPress: () => {
140
+ console.log('Dialog confirmed!');
141
+ hidePaperDialog();
142
+ },
143
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
144
+ style: styles.dialogButtonText,
145
+ children: "Confirm"
146
+ })
147
+ })]
148
+ })]
149
+ })]
150
+ })
151
+ });
152
+ };
153
+ const styles = _reactNative.StyleSheet.create({
154
+ container: {
155
+ flex: 1,
156
+ padding: 20,
157
+ backgroundColor: '#f5f5f5'
158
+ },
159
+ title: {
160
+ fontSize: 24,
161
+ fontWeight: 'bold',
162
+ textAlign: 'center',
163
+ marginBottom: 10,
164
+ color: '#333'
165
+ },
166
+ subtitle: {
167
+ fontSize: 16,
168
+ textAlign: 'center',
169
+ marginBottom: 30,
170
+ color: '#666',
171
+ fontStyle: 'italic'
172
+ },
173
+ buttonContainer: {
174
+ gap: 15
175
+ },
176
+ button: {
177
+ backgroundColor: '#007AFF',
178
+ padding: 15,
179
+ borderRadius: 10,
180
+ shadowColor: '#000',
181
+ shadowOffset: {
182
+ width: 0,
183
+ height: 2
184
+ },
185
+ shadowOpacity: 0.1,
186
+ shadowRadius: 4,
187
+ elevation: 3
188
+ },
189
+ buttonText: {
190
+ color: 'white',
191
+ fontSize: 16,
192
+ fontWeight: '600',
193
+ textAlign: 'center'
194
+ },
195
+ buttonSubtext: {
196
+ color: 'rgba(255, 255, 255, 0.8)',
197
+ fontSize: 12,
198
+ textAlign: 'center',
199
+ marginTop: 2
200
+ },
201
+ infoContainer: {
202
+ backgroundColor: 'white',
203
+ padding: 20,
204
+ borderRadius: 10,
205
+ marginTop: 30,
206
+ shadowColor: '#000',
207
+ shadowOffset: {
208
+ width: 0,
209
+ height: 1
210
+ },
211
+ shadowOpacity: 0.1,
212
+ shadowRadius: 2,
213
+ elevation: 2
214
+ },
215
+ infoTitle: {
216
+ fontSize: 18,
217
+ fontWeight: '600',
218
+ marginBottom: 10,
219
+ color: '#333'
220
+ },
221
+ infoText: {
222
+ fontSize: 14,
223
+ color: '#666',
224
+ marginBottom: 5
225
+ },
226
+ codeContainer: {
227
+ backgroundColor: '#f8f9fa',
228
+ padding: 15,
229
+ borderRadius: 8,
230
+ marginTop: 20,
231
+ borderLeftWidth: 4,
232
+ borderLeftColor: '#007AFF'
233
+ },
234
+ codeTitle: {
235
+ fontSize: 16,
236
+ fontWeight: '600',
237
+ marginBottom: 10,
238
+ color: '#333'
239
+ },
240
+ codeText: {
241
+ fontSize: 12,
242
+ color: '#555',
243
+ fontFamily: 'monospace',
244
+ lineHeight: 18
245
+ },
246
+ exampleDialog: {
247
+ position: 'absolute',
248
+ top: '50%',
249
+ left: 20,
250
+ right: 20,
251
+ backgroundColor: 'white',
252
+ borderRadius: 12,
253
+ padding: 20,
254
+ shadowColor: '#000',
255
+ shadowOffset: {
256
+ width: 0,
257
+ height: 4
258
+ },
259
+ shadowOpacity: 0.25,
260
+ shadowRadius: 8,
261
+ elevation: 8
262
+ },
263
+ dialogTitle: {
264
+ fontSize: 20,
265
+ fontWeight: 'bold',
266
+ marginBottom: 15,
267
+ color: '#333'
268
+ },
269
+ dialogContent: {
270
+ fontSize: 16,
271
+ color: '#666',
272
+ marginBottom: 20,
273
+ lineHeight: 22
274
+ },
275
+ dialogActions: {
276
+ flexDirection: 'row',
277
+ justifyContent: 'flex-end',
278
+ gap: 10
279
+ },
280
+ dialogButton: {
281
+ paddingHorizontal: 20,
282
+ paddingVertical: 10,
283
+ borderRadius: 6,
284
+ backgroundColor: '#f0f0f0'
285
+ },
286
+ primaryButton: {
287
+ backgroundColor: '#007AFF'
288
+ },
289
+ dialogButtonText: {
290
+ fontSize: 16,
291
+ fontWeight: '600',
292
+ color: '#333'
293
+ }
294
+ });
295
+ var _default = exports.default = HOCDialogExample;
296
+ //# sourceMappingURL=HOCDialogExample.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_Connect","_interopRequireDefault","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","HOCDialogExample","dialogVisible","setDialogVisible","useState","showAlertDialog","Alert","alert","text","style","onPress","console","log","showPaperDialog","hidePaperDialog","jsx","captureDialogEvents","captureKeyboardEvents","children","jsxs","View","styles","container","Text","title","subtitle","buttonContainer","TouchableOpacity","button","buttonText","buttonSubtext","infoContainer","infoTitle","infoText","codeContainer","codeTitle","codeText","exampleDialog","dialogTitle","dialogContent","dialogActions","dialogButton","dialogButtonText","primaryButton","StyleSheet","create","flex","padding","backgroundColor","fontSize","fontWeight","textAlign","marginBottom","color","fontStyle","gap","borderRadius","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","marginTop","borderLeftWidth","borderLeftColor","fontFamily","lineHeight","position","top","left","right","flexDirection","justifyContent","paddingHorizontal","paddingVertical","_default","exports"],"sourceRoot":"../../../src","sources":["examples/HOCDialogExample.tsx"],"mappings":";;;;;;AAUA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA4C,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAG,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,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