react-native-inapp-inspector 1.0.9 → 1.0.11

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 (47) hide show
  1. package/README.md +5 -6
  2. package/dist/commonjs/components/AnalyticsDetail.js +28 -23
  3. package/dist/commonjs/components/AnalyticsEventCard.js +9 -9
  4. package/dist/commonjs/components/BrandSquareIcon.d.ts +5 -0
  5. package/dist/commonjs/components/BrandSquareIcon.js +180 -0
  6. package/dist/commonjs/components/CodeSnippet.js +32 -24
  7. package/dist/commonjs/components/ConsoleLogCard.js +127 -70
  8. package/dist/commonjs/components/JsonViewer.d.ts +2 -1
  9. package/dist/commonjs/components/JsonViewer.js +2 -2
  10. package/dist/commonjs/components/MetaAccordion.d.ts +1 -1
  11. package/dist/commonjs/components/MetaAccordion.js +45 -2
  12. package/dist/commonjs/components/NetworkIcons.d.ts +7 -0
  13. package/dist/commonjs/components/NetworkIcons.js +42 -1
  14. package/dist/commonjs/components/ReduxTreeView.d.ts +17 -0
  15. package/dist/commonjs/components/ReduxTreeView.js +630 -0
  16. package/dist/commonjs/components/TouchableScale.js +15 -1
  17. package/dist/commonjs/components/TreeNode.js +3 -3
  18. package/dist/commonjs/customHooks/reduxLogger.d.ts +12 -0
  19. package/dist/commonjs/customHooks/reduxLogger.js +71 -2
  20. package/dist/commonjs/index.js +1568 -505
  21. package/dist/commonjs/styles/index.d.ts +11 -1
  22. package/dist/commonjs/styles/index.js +19 -9
  23. package/dist/commonjs/types/index.d.ts +4 -0
  24. package/dist/esm/components/AnalyticsDetail.js +28 -23
  25. package/dist/esm/components/AnalyticsEventCard.js +9 -9
  26. package/dist/esm/components/BrandSquareIcon.d.ts +5 -0
  27. package/dist/esm/components/BrandSquareIcon.js +140 -0
  28. package/dist/esm/components/CodeSnippet.js +32 -24
  29. package/dist/esm/components/ConsoleLogCard.js +127 -70
  30. package/dist/esm/components/JsonViewer.d.ts +2 -1
  31. package/dist/esm/components/JsonViewer.js +2 -2
  32. package/dist/esm/components/MetaAccordion.d.ts +1 -1
  33. package/dist/esm/components/MetaAccordion.js +46 -3
  34. package/dist/esm/components/NetworkIcons.d.ts +7 -0
  35. package/dist/esm/components/NetworkIcons.js +34 -0
  36. package/dist/esm/components/ReduxTreeView.d.ts +17 -0
  37. package/dist/esm/components/ReduxTreeView.js +592 -0
  38. package/dist/esm/components/TouchableScale.js +16 -2
  39. package/dist/esm/components/TreeNode.js +3 -3
  40. package/dist/esm/customHooks/reduxLogger.d.ts +12 -0
  41. package/dist/esm/customHooks/reduxLogger.js +64 -1
  42. package/dist/esm/index.js +1571 -508
  43. package/dist/esm/styles/index.d.ts +11 -1
  44. package/dist/esm/styles/index.js +19 -9
  45. package/dist/esm/types/index.d.ts +4 -0
  46. package/example/App.tsx +46 -0
  47. package/package.json +7 -5
@@ -161,7 +161,7 @@ export declare const getRawStyles: (colors: typeof AppColors) => {
161
161
  iconBtnMinimal: {
162
162
  padding: number;
163
163
  };
164
- closeButtonCircle: {
164
+ closeButtonSquare: {
165
165
  width: number;
166
166
  height: number;
167
167
  borderRadius: number;
@@ -198,6 +198,16 @@ export declare const getRawStyles: (colors: typeof AppColors) => {
198
198
  shadowOpacity: number;
199
199
  shadowRadius: number;
200
200
  };
201
+ fabIconContainer: {
202
+ backgroundColor: string;
203
+ borderRadius: number;
204
+ width: number;
205
+ height: number;
206
+ borderWidth: number;
207
+ borderColor: string;
208
+ alignItems: string;
209
+ justifyContent: string;
210
+ };
201
211
  fabPulseRing: {
202
212
  position: string;
203
213
  width: number;
@@ -6,16 +6,16 @@ export const getRawStyles = (colors) => ({
6
6
  flexDirection: 'row',
7
7
  alignItems: 'center',
8
8
  paddingHorizontal: 12,
9
- paddingVertical: 8,
9
+ paddingVertical: 10,
10
10
  zIndex: 10,
11
- minHeight: 48,
11
+ minHeight: 64,
12
12
  shadowColor: '#000000',
13
13
  shadowOffset: { width: 0, height: 2 },
14
14
  shadowOpacity: 0.08,
15
15
  shadowRadius: 4,
16
16
  elevation: 4,
17
17
  },
18
- headerLeft: { flex: 1, alignItems: 'flex-start' },
18
+ headerLeft: { flex: 2, alignItems: 'flex-start' },
19
19
  headerCenter: { flex: 3, alignItems: 'center' },
20
20
  headerRight: {
21
21
  flex: 1,
@@ -140,10 +140,10 @@ export const getRawStyles = (colors) => ({
140
140
  letterSpacing: 0.2,
141
141
  },
142
142
  iconBtnMinimal: { padding: 6 },
143
- closeButtonCircle: {
143
+ closeButtonSquare: {
144
144
  width: 32,
145
145
  height: 32,
146
- borderRadius: 16,
146
+ borderRadius: 8,
147
147
  backgroundColor: 'rgba(255, 255, 255, 0.15)',
148
148
  alignItems: 'center',
149
149
  justifyContent: 'center',
@@ -166,6 +166,16 @@ export const getRawStyles = (colors) => ({
166
166
  shadowOpacity: 0.4,
167
167
  shadowRadius: 12,
168
168
  },
169
+ fabIconContainer: {
170
+ backgroundColor: '#FFFFFF',
171
+ borderRadius: 28,
172
+ width: 56,
173
+ height: 56,
174
+ borderWidth: 1.5,
175
+ borderColor: colors.purple,
176
+ alignItems: 'center',
177
+ justifyContent: 'center',
178
+ },
169
179
  fabPulseRing: {
170
180
  position: 'absolute',
171
181
  width: 60,
@@ -1411,10 +1421,10 @@ export const getRawStyles = (colors) => ({
1411
1421
  gap: 10,
1412
1422
  },
1413
1423
  dashboardModuleCard: {
1414
- backgroundColor: '#FFFFFF',
1424
+ backgroundColor: colors.primaryLight,
1415
1425
  borderRadius: 10,
1416
1426
  borderWidth: 1,
1417
- borderColor: '#EFEFEF',
1427
+ borderColor: colors.grayBorderSecondary,
1418
1428
  padding: 12,
1419
1429
  shadowColor: '#000000',
1420
1430
  shadowOpacity: 0.03,
@@ -1428,7 +1438,7 @@ export const getRawStyles = (colors) => ({
1428
1438
  alignItems: 'center',
1429
1439
  marginBottom: 10,
1430
1440
  borderBottomWidth: 1,
1431
- borderBottomColor: '#F3F4F6',
1441
+ borderBottomColor: colors.dividerColor,
1432
1442
  paddingBottom: 8,
1433
1443
  },
1434
1444
  dashboardModuleTitle: {
@@ -1450,7 +1460,7 @@ export const getRawStyles = (colors) => ({
1450
1460
  dashboardGridItem: {
1451
1461
  flex: 1,
1452
1462
  minWidth: '22%',
1453
- backgroundColor: '#F8FAFC',
1463
+ backgroundColor: colors.grayBackground,
1454
1464
  borderRadius: 8,
1455
1465
  paddingVertical: 8,
1456
1466
  paddingHorizontal: 4,
@@ -92,6 +92,7 @@ export interface TreeNodeProps {
92
92
  level?: number;
93
93
  search?: string;
94
94
  forceOpen?: boolean;
95
+ defaultExpandDepth?: number;
95
96
  }
96
97
  export interface LogCardProps {
97
98
  item: NetworkLog;
@@ -109,6 +110,9 @@ export interface MetaAccordionProps {
109
110
  duration: number | null;
110
111
  size: string;
111
112
  triggeredAt: string;
113
+ method?: string;
114
+ contentType?: string;
115
+ url?: string;
112
116
  }
113
117
  export interface HeadersSectionProps {
114
118
  title: string;
package/example/App.tsx CHANGED
@@ -17,6 +17,8 @@ import NetworkInspector, {
17
17
  connectReduxStore,
18
18
  subscribeNetworkLogs,
19
19
  subscribeConsoleLogs,
20
+ logAnalyticsEvent,
21
+ subscribeAnalyticsEvents,
20
22
  } from 'react-native-inapp-inspector';
21
23
 
22
24
  // ─── Mock Redux Store ────────────────────────────────────────────────────────
@@ -101,12 +103,14 @@ function HomeScreen({ navigation }: any) {
101
103
  const [activeCrash, setActiveCrash] = React.useState<'none' | 'js' | 'native'>('none');
102
104
  const [apiCount, setApiCount] = React.useState(0);
103
105
  const [logCount, setLogCount] = React.useState(0);
106
+ const [analyticsCount, setAnalyticsCount] = React.useState(0);
104
107
  const [reduxState, setReduxState] = React.useState(mockStore.getState());
105
108
 
106
109
  React.useEffect(() => {
107
110
  // Subscribe to logs to display live dashboard counters
108
111
  const unsubNet = subscribeNetworkLogs(logs => setApiCount(logs.length));
109
112
  const unsubConsole = subscribeConsoleLogs(logs => setLogCount(logs.length));
113
+ const unsubAnalytics = subscribeAnalyticsEvents(events => setAnalyticsCount(events.length));
110
114
  const unsubRedux = mockStore.subscribe(() => setReduxState(mockStore.getState()));
111
115
 
112
116
  // Initial Logs to populate stats
@@ -116,6 +120,7 @@ function HomeScreen({ navigation }: any) {
116
120
  return () => {
117
121
  unsubNet();
118
122
  unsubConsole();
123
+ unsubAnalytics();
119
124
  unsubRedux();
120
125
  };
121
126
  }, []);
@@ -175,6 +180,10 @@ function HomeScreen({ navigation }: any) {
175
180
  <Text style={styles.statVal}>{logCount}</Text>
176
181
  <Text style={styles.statLbl}>Logs</Text>
177
182
  </View>
183
+ <View style={styles.statBox}>
184
+ <Text style={[styles.statVal, { color: '#EA580C' }]}>{analyticsCount}</Text>
185
+ <Text style={styles.statLbl}>Analytics</Text>
186
+ </View>
178
187
  <View style={styles.statBox}>
179
188
  <Text style={[styles.statVal, { color: '#A78BFA' }]}>
180
189
  {reduxState.ui.sidebarOpen ? 'Open' : 'Closed'}
@@ -204,6 +213,43 @@ function HomeScreen({ navigation }: any) {
204
213
  </TouchableOpacity>
205
214
  </View>
206
215
 
216
+ <View style={styles.panelCard}>
217
+ <Text style={styles.panelHeader}>📊 ANALYTICS LOG TESTS</Text>
218
+ <View style={styles.btnRow}>
219
+ <TouchableOpacity
220
+ style={[styles.gridBtn, { borderColor: '#EA580C' }]}
221
+ onPress={() => {
222
+ console.log('[App] Logged custom analytics event: click_button');
223
+ logAnalyticsEvent('click_button', {
224
+ button_name: 'test_action',
225
+ screen_name: 'Home',
226
+ clicked_at: new Date().toLocaleTimeString(),
227
+ });
228
+ }}
229
+ >
230
+ <Text style={[styles.btnText, { color: '#EA580C' }]}>Log Custom Event</Text>
231
+ </TouchableOpacity>
232
+ <TouchableOpacity
233
+ style={[styles.gridBtn, { borderColor: '#E11D48' }]}
234
+ onPress={() => {
235
+ console.log('[App] Logged analytics ecommerce event: item_purchase');
236
+ logAnalyticsEvent('item_purchase', {
237
+ item_id: 'prod_999',
238
+ item_name: 'Premium Debug Kit',
239
+ price: 29.99,
240
+ currency: 'USD',
241
+ items: [{ id: 'prod_999', name: 'Premium Debug Kit', price: 29.99 }],
242
+ }, {
243
+ user_tier: 'gold_member',
244
+ signup_platform: 'ios_app',
245
+ });
246
+ }}
247
+ >
248
+ <Text style={[styles.btnText, { color: '#E11D48' }]}>Log Purchase</Text>
249
+ </TouchableOpacity>
250
+ </View>
251
+ </View>
252
+
207
253
  <View style={styles.panelCard}>
208
254
  <Text style={styles.panelHeader}>⚙️ REDUX & STATE ACTIONS</Text>
209
255
  <TouchableOpacity style={[styles.fullWidthBtn, { backgroundColor: '#8B5CF6' }]} onPress={handleToggleSidebar}>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-inapp-inspector",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "A self-contained network, console, analytics, and webview inspector for React Native applications.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -52,12 +52,14 @@
52
52
  "type": "github",
53
53
  "url": "https://github.com/sponsors/vengatmacuser"
54
54
  },
55
+ "dependencies": {
56
+ "@react-navigation/native": "^6.1.9",
57
+ "react-native-linear-gradient": "^2.8.3",
58
+ "react-native-svg": "^15.14.0"
59
+ },
55
60
  "peerDependencies": {
56
- "@react-navigation/native": ">=6.0.0",
57
61
  "react": ">=18.0.0",
58
- "react-native": ">=0.60.0",
59
- "react-native-linear-gradient": ">=2.0.0",
60
- "react-native-svg": ">=12.0.0"
62
+ "react-native": ">=0.60.0"
61
63
  },
62
64
  "devDependencies": {
63
65
  "@react-navigation/native": "^6.1.9",