react-native-inapp-inspector 1.1.15 β†’ 1.1.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 (58) hide show
  1. package/README.md +137 -130
  2. package/dist/commonjs/components/CopyButton.d.ts +1 -1
  3. package/dist/commonjs/components/CopyButton.js +4 -4
  4. package/dist/commonjs/components/EndOfListFooter.js +2 -3
  5. package/dist/commonjs/components/Inspector/AnalyticsTab.d.ts +1 -1
  6. package/dist/commonjs/components/Inspector/AnalyticsTab.js +7 -8
  7. package/dist/commonjs/components/Inspector/ConsoleTab.d.ts +1 -1
  8. package/dist/commonjs/components/Inspector/ConsoleTab.js +9 -9
  9. package/dist/commonjs/components/Inspector/InspectorHeader.d.ts +1 -1
  10. package/dist/commonjs/components/Inspector/InspectorHeader.js +2 -2
  11. package/dist/commonjs/components/Inspector/LogDetail.d.ts +1 -1
  12. package/dist/commonjs/components/Inspector/LogDetail.js +2 -2
  13. package/dist/commonjs/components/Inspector/NetworkDetail.d.ts +1 -1
  14. package/dist/commonjs/components/Inspector/NetworkDetail.js +2 -2
  15. package/dist/commonjs/components/Inspector/NetworkTab.d.ts +1 -1
  16. package/dist/commonjs/components/Inspector/NetworkTab.js +10 -9
  17. package/dist/commonjs/components/Inspector/ReduxTab.d.ts +1 -1
  18. package/dist/commonjs/components/Inspector/ReduxTab.js +2 -2
  19. package/dist/commonjs/components/Inspector/TabBar.d.ts +1 -1
  20. package/dist/commonjs/components/Inspector/TabBar.js +2 -2
  21. package/dist/commonjs/components/JsonViewer.d.ts +2 -2
  22. package/dist/commonjs/components/JsonViewer.js +2 -2
  23. package/dist/commonjs/components/ReduxTreeView.d.ts +2 -2
  24. package/dist/commonjs/components/ReduxTreeView.js +2 -3
  25. package/dist/commonjs/components/SegmentedTabs.d.ts +1 -1
  26. package/dist/commonjs/components/SegmentedTabs.js +2 -2
  27. package/dist/commonjs/constants/version.d.ts +1 -1
  28. package/dist/commonjs/constants/version.js +1 -1
  29. package/dist/esm/components/CopyButton.d.ts +1 -1
  30. package/dist/esm/components/CopyButton.js +5 -5
  31. package/dist/esm/components/EndOfListFooter.js +2 -2
  32. package/dist/esm/components/Inspector/AnalyticsTab.d.ts +1 -1
  33. package/dist/esm/components/Inspector/AnalyticsTab.js +7 -8
  34. package/dist/esm/components/Inspector/ConsoleTab.d.ts +1 -1
  35. package/dist/esm/components/Inspector/ConsoleTab.js +9 -9
  36. package/dist/esm/components/Inspector/InspectorHeader.d.ts +1 -1
  37. package/dist/esm/components/Inspector/InspectorHeader.js +2 -2
  38. package/dist/esm/components/Inspector/LogDetail.d.ts +1 -1
  39. package/dist/esm/components/Inspector/LogDetail.js +2 -2
  40. package/dist/esm/components/Inspector/NetworkDetail.d.ts +1 -1
  41. package/dist/esm/components/Inspector/NetworkDetail.js +2 -2
  42. package/dist/esm/components/Inspector/NetworkTab.d.ts +1 -1
  43. package/dist/esm/components/Inspector/NetworkTab.js +10 -9
  44. package/dist/esm/components/Inspector/ReduxTab.d.ts +1 -1
  45. package/dist/esm/components/Inspector/ReduxTab.js +2 -2
  46. package/dist/esm/components/Inspector/TabBar.d.ts +1 -1
  47. package/dist/esm/components/Inspector/TabBar.js +2 -2
  48. package/dist/esm/components/JsonViewer.d.ts +2 -2
  49. package/dist/esm/components/JsonViewer.js +2 -2
  50. package/dist/esm/components/ReduxTreeView.d.ts +2 -2
  51. package/dist/esm/components/ReduxTreeView.js +2 -2
  52. package/dist/esm/components/SegmentedTabs.d.ts +1 -1
  53. package/dist/esm/components/SegmentedTabs.js +2 -2
  54. package/dist/esm/constants/version.d.ts +1 -1
  55. package/dist/esm/constants/version.js +1 -1
  56. package/example/App.tsx +57 -1
  57. package/example/README.md +33 -77
  58. package/package.json +1 -1
@@ -40,7 +40,7 @@ const valueContainsTerm = (val, term) => {
40
40
  }
41
41
  return Object.keys(val).some(key => key.toLowerCase().includes(t) || valueContainsTerm(val[key], term));
42
42
  };
43
- export const ReduxTreeView = ({ state, actionHistory = [], lastActionMap = {}, search = '', onSearchChange, autoRefresh = true, onToggleAutoRefresh, onClearHistory, onDetailOpenChange, selectedSliceKey = null, onSelectSliceKey, selectedActionId = null, onSelectActionId, }) => {
43
+ export const ReduxTreeView = React.memo(({ state, actionHistory = [], lastActionMap = {}, search = '', onSearchChange, autoRefresh = true, onToggleAutoRefresh, onClearHistory, onDetailOpenChange, selectedSliceKey = null, onSelectSliceKey, selectedActionId = null, onSelectActionId, }) => {
44
44
  const [activeTab, setActiveTab] = useState('state');
45
45
  const [actionSubTab, setActionSubTab] = useState('payload');
46
46
  // local fallbacks if props are not provided
@@ -708,7 +708,7 @@ export const ReduxTreeView = ({ state, actionHistory = [], lastActionMap = {}, s
708
708
  }))}
709
709
  </ScrollView>)}
710
710
  </View>);
711
- };
711
+ });
712
712
  const styles = StyleSheet.create({
713
713
  container: {
714
714
  flex: 1,
@@ -11,5 +11,5 @@ interface SegmentedTabsProps {
11
11
  onChange: (key: string) => void;
12
12
  style?: ViewStyle | ViewStyle[];
13
13
  }
14
- declare const SegmentedTabs: ({ tabs, activeKey, onChange, style }: SegmentedTabsProps) => React.JSX.Element;
14
+ declare const SegmentedTabs: React.MemoExoticComponent<({ tabs, activeKey, onChange, style }: SegmentedTabsProps) => React.JSX.Element>;
15
15
  export default SegmentedTabs;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { Pressable, Text, View } from 'react-native';
3
3
  import { AppColors } from '../styles/AppColors';
4
4
  import { AppFonts } from '../styles/AppFonts';
5
- const SegmentedTabs = ({ tabs, activeKey, onChange, style }) => (<View style={[
5
+ const SegmentedTabs = React.memo(({ tabs, activeKey, onChange, style }) => (<View style={[
6
6
  {
7
7
  flexDirection: 'row',
8
8
  borderRadius: 8,
@@ -43,5 +43,5 @@ const SegmentedTabs = ({ tabs, activeKey, onChange, style }) => (<View style={[
43
43
  </Text>
44
44
  </Pressable>);
45
45
  })}
46
- </View>);
46
+ </View>));
47
47
  export default SegmentedTabs;
@@ -1 +1 @@
1
- export declare const LIB_VERSION = "1.1.15";
1
+ export declare const LIB_VERSION = "1.1.16";
@@ -1,3 +1,3 @@
1
1
  // AUTO-GENERATED FILE β€” do not edit by hand.
2
2
  // Regenerated from package.json on every build by scripts/gen-version.js.
3
- export const LIB_VERSION = '1.1.15';
3
+ export const LIB_VERSION = '1.1.16';
package/example/App.tsx CHANGED
@@ -458,6 +458,39 @@ function HomeScreen({ navigation }: any) {
458
458
  Trigger Log, Warn & Error Logs
459
459
  </Text>
460
460
  </TouchableOpacity>
461
+
462
+ <View style={[styles.btnRow, {marginTop: 8}]}>
463
+ <TouchableOpacity
464
+ style={[styles.gridBtn, { borderColor: '#8B5CF6' }]}
465
+ onPress={() => {
466
+ console.log(
467
+ 'Multi-argument payload inspection:',
468
+ { userId: 101, username: 'venkatesh', role: 'Lead Architect' },
469
+ ['permissions.read', 'permissions.write', 'permissions.admin'],
470
+ { device: 'iPhone 15 Pro', os: 'iOS 18.0', battery: '92%' },
471
+ );
472
+ }}
473
+ >
474
+ <Text style={[styles.btnText, { color: '#8B5CF6' }]}>
475
+ Multi-Arg Log
476
+ </Text>
477
+ </TouchableOpacity>
478
+
479
+ <TouchableOpacity
480
+ style={[styles.gridBtn, { borderColor: '#EF4444' }]}
481
+ onPress={() => {
482
+ try {
483
+ throw new TypeError('Cannot read properties of undefined (reading "authToken")');
484
+ } catch (err) {
485
+ console.error(err);
486
+ }
487
+ }}
488
+ >
489
+ <Text style={[styles.btnText, { color: '#EF4444' }]}>
490
+ Error Stack Log
491
+ </Text>
492
+ </TouchableOpacity>
493
+ </View>
461
494
  </View>
462
495
 
463
496
  <View style={styles.panelCard}>
@@ -517,8 +550,31 @@ function HomeScreen({ navigation }: any) {
517
550
 
518
551
  <View style={styles.panelCard}>
519
552
  <Text style={styles.panelHeader}>βš™οΈ REDUX & STATE ACTIONS</Text>
553
+ <View style={styles.btnRow}>
554
+ <TouchableOpacity
555
+ style={[styles.gridBtn, { borderColor: '#10B981' }]}
556
+ onPress={handleToggleSidebar}
557
+ >
558
+ <Text style={[styles.btnText, { color: '#10B981' }]}>
559
+ Toggle Sidebar
560
+ </Text>
561
+ </TouchableOpacity>
562
+ <TouchableOpacity
563
+ style={[styles.gridBtn, { borderColor: '#06B6D4' }]}
564
+ onPress={() => {
565
+ mockStore.dispatch({
566
+ type: 'SET_THEME',
567
+ payload: mockStore.getState().settings.theme === 'dark' ? 'light' : 'dark',
568
+ });
569
+ }}
570
+ >
571
+ <Text style={[styles.btnText, { color: '#06B6D4' }]}>
572
+ Toggle Theme
573
+ </Text>
574
+ </TouchableOpacity>
575
+ </View>
520
576
  <TouchableOpacity
521
- style={[styles.fullWidthBtn, { backgroundColor: '#8B5CF6' }]}
577
+ style={[styles.fullWidthBtn, { backgroundColor: '#8B5CF6', marginTop: 8 }]}
522
578
  onPress={handleToggleSidebar}
523
579
  >
524
580
  <Text style={styles.fullWidthBtnText}>
package/example/README.md CHANGED
@@ -1,97 +1,53 @@
1
- This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli).
1
+ # React Native In-App Inspector Example App πŸš€
2
2
 
3
- # Getting Started
3
+ This directory contains a complete, interactive sample application demonstrating all the capabilities of **`react-native-inapp-inspector`**.
4
4
 
5
- > **Note**: Make sure you have completed the [Set Up Your Environment](https://reactnative.dev/docs/set-up-your-environment) guide before proceeding.
5
+ ---
6
6
 
7
- ## Step 1: Start Metro
7
+ ## πŸ“± Features Demonstrated
8
8
 
9
- First, you will need to run **Metro**, the JavaScript build tool for React Native.
9
+ - 🌐 **Network Interception**: Test Axios (`GET`, `POST`, `PUT`, `PATCH`, `DELETE`) and `fetch` requests with response inspector, headers, and cURL generation.
10
+ - πŸͺ΅ **Console Logger & Call Stacks**: Test log levels (`log`, `warn`, `error`), multi-argument object logging, error exception stack traces, and Metro source map symbolication.
11
+ - ⏸️ **Live Stream Pause / Resume**: Test pausing and resuming real-time traffic across API and console streams.
12
+ - πŸ”„ **Redux State Inspection**: Test Redux state tree, live action dispatches, and diff tracking.
13
+ - πŸ“Š **Analytics Tracking**: Test custom analytics events and e-commerce purchase payloads.
14
+ - πŸ›‘οΈ **Error Boundary**: Test simulated JavaScript and native error catches.
10
15
 
11
- To start the Metro dev server, run the following command from the root of your React Native project:
16
+ ---
12
17
 
13
- ```sh
14
- # Using npm
15
- npm start
18
+ ## πŸƒ Quick Start
16
19
 
17
- # OR using Yarn
18
- yarn start
19
- ```
20
-
21
- ## Step 2: Build and run your app
22
-
23
- With Metro running, open a new terminal window/pane from the root of your React Native project, and use one of the following commands to build and run your Android or iOS app:
24
-
25
- ### Android
20
+ ### 1. Install Dependencies
26
21
 
27
- ```sh
28
- # Using npm
29
- npm run android
30
-
31
- # OR using Yarn
32
- yarn android
22
+ ```bash
23
+ cd example
24
+ npm install
33
25
  ```
34
26
 
35
- ### iOS
36
-
37
- For iOS, remember to install CocoaPods dependencies (this only needs to be run on first clone or after updating native deps).
27
+ ### 2. iOS Setup
38
28
 
39
- The first time you create a new project, run the Ruby bundler to install CocoaPods itself:
40
-
41
- ```sh
29
+ ```bash
30
+ cd ios
42
31
  bundle install
43
- ```
44
-
45
- Then, and every time you update your native dependencies, run:
46
-
47
- ```sh
48
32
  bundle exec pod install
49
- ```
50
-
51
- For more information, please visit [CocoaPods Getting Started guide](https://guides.cocoapods.org/using/getting-started.html).
52
-
53
- ```sh
54
- # Using npm
33
+ cd ..
55
34
  npm run ios
56
-
57
- # OR using Yarn
58
- yarn ios
59
35
  ```
60
36
 
61
- If everything is set up correctly, you should see your new app running in the Android Emulator, iOS Simulator, or your connected device.
62
-
63
- This is one way to run your app β€” you can also build it directly from Android Studio or Xcode.
64
-
65
- ## Step 3: Modify your app
66
-
67
- Now that you have successfully run the app, let's make changes!
68
-
69
- Open `App.tsx` in your text editor of choice and make some changes. When you save, your app will automatically update and reflect these changes β€”Β this is powered by [Fast Refresh](https://reactnative.dev/docs/fast-refresh).
70
-
71
- When you want to forcefully reload, for example to reset the state of your app, you can perform a full reload:
72
-
73
- - **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Dev Menu**, accessed via <kbd>Ctrl</kbd> + <kbd>M</kbd> (Windows/Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (macOS).
74
- - **iOS**: Press <kbd>R</kbd> in iOS Simulator.
37
+ ### 3. Android Setup
75
38
 
76
- ## Congratulations! :tada:
77
-
78
- You've successfully run and modified your React Native App. :partying_face:
79
-
80
- ### Now what?
81
-
82
- - If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
83
- - If you're curious to learn more about React Native, check out the [docs](https://reactnative.dev/docs/getting-started).
84
-
85
- # Troubleshooting
86
-
87
- If you're having issues getting the above steps to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
39
+ ```bash
40
+ npm run android
41
+ ```
88
42
 
89
- # Learn More
43
+ ---
90
44
 
91
- To learn more about React Native, take a look at the following resources:
45
+ ## πŸ§ͺ Interactive Test Controls
92
46
 
93
- - [React Native Website](https://reactnative.dev) - learn more about React Native.
94
- - [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment.
95
- - [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**.
96
- - [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts.
97
- - [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native.
47
+ The example screen provides one-tap triggers for:
48
+ - **Network Requests**: `Fetch User`, `Failing Request`, `Axios GET`, `Axios POST`, `Axios PUT`, `Axios PATCH`, `Axios DELETE`.
49
+ - **Console Events**: `Trigger Log / Warn / Error`, `Multi-Arg Log`, `Error Stack Log`.
50
+ - **Analytics Events**: `Log Custom Event`, `Log Purchase`.
51
+ - **Redux Actions**: `Toggle Sidebar`, `Toggle Theme`.
52
+ - **Simulate Batch (Flood)**: `Fire Sample All` triggers a simultaneous barrage of requests, logs, analytics events, and state dispatches.
53
+ - **Error Boundary**: `Crash JS Component` triggers a safe Error Boundary catch.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-inapp-inspector",
3
- "version": "1.1.15",
3
+ "version": "1.1.16",
4
4
  "description": "A self-contained network, console, analytics, and webview inspector for React Native applications.",
5
5
  "repository": {
6
6
  "type": "git",