react-native-inapp-inspector 2.3.10 → 2.3.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 (43) hide show
  1. package/dist/commonjs/components/Inspector/DebuggingTab.d.ts +3 -0
  2. package/dist/commonjs/components/Inspector/DebuggingTab.js +683 -0
  3. package/dist/commonjs/components/Inspector/MainScreen.js +2 -0
  4. package/dist/commonjs/components/Inspector/SettingsPanel.js +12 -0
  5. package/dist/commonjs/components/Inspector/TabBar.js +9 -0
  6. package/dist/commonjs/components/NetworkIcons.d.ts +1 -0
  7. package/dist/commonjs/components/NetworkIcons.js +8 -1
  8. package/dist/commonjs/components/QRCodeView.d.ts +9 -0
  9. package/dist/commonjs/components/QRCodeView.js +82 -0
  10. package/dist/commonjs/constants/version.d.ts +1 -1
  11. package/dist/commonjs/constants/version.js +1 -1
  12. package/dist/commonjs/helpers/qrGenerator.d.ts +2 -0
  13. package/dist/commonjs/helpers/qrGenerator.js +44 -0
  14. package/dist/commonjs/index.js +2 -0
  15. package/dist/commonjs/types/enums.d.ts +2 -0
  16. package/dist/commonjs/types/enums.js +2 -0
  17. package/dist/esm/components/Inspector/DebuggingTab.d.ts +3 -0
  18. package/dist/esm/components/Inspector/DebuggingTab.js +643 -0
  19. package/dist/esm/components/Inspector/MainScreen.js +2 -0
  20. package/dist/esm/components/Inspector/SettingsPanel.js +13 -1
  21. package/dist/esm/components/Inspector/TabBar.js +10 -1
  22. package/dist/esm/components/NetworkIcons.d.ts +1 -0
  23. package/dist/esm/components/NetworkIcons.js +6 -0
  24. package/dist/esm/components/QRCodeView.d.ts +9 -0
  25. package/dist/esm/components/QRCodeView.js +45 -0
  26. package/dist/esm/constants/version.d.ts +1 -1
  27. package/dist/esm/constants/version.js +1 -1
  28. package/dist/esm/helpers/qrGenerator.d.ts +2 -0
  29. package/dist/esm/helpers/qrGenerator.js +38 -0
  30. package/dist/esm/index.js +2 -0
  31. package/dist/esm/types/enums.d.ts +2 -0
  32. package/dist/esm/types/enums.js +2 -0
  33. package/package.json +4 -2
  34. package/src/components/Inspector/DebuggingTab.tsx +756 -0
  35. package/src/components/Inspector/MainScreen.tsx +2 -0
  36. package/src/components/Inspector/SettingsPanel.tsx +20 -0
  37. package/src/components/Inspector/TabBar.tsx +11 -0
  38. package/src/components/NetworkIcons.tsx +39 -0
  39. package/src/components/QRCodeView.tsx +75 -0
  40. package/src/constants/version.ts +1 -1
  41. package/src/helpers/qrGenerator.ts +49 -0
  42. package/src/index.tsx +2 -0
  43. package/src/types/enums.ts +2 -0
@@ -29,6 +29,7 @@ import CrashTab from './CrashTab';
29
29
  import CrashDetail from './CrashDetail';
30
30
  import DeviceInfoTab from './DeviceInfoTab';
31
31
  import StorageTab from './StorageTab';
32
+ import DebuggingTab from './DebuggingTab';
32
33
  import SettingsPanel from './SettingsPanel';
33
34
  import NpmUpdateToast from './NpmUpdateToast';
34
35
  import Toast from '../Toast';
@@ -170,6 +171,7 @@ const MainScreen = () => {
170
171
  {activeTab === 'crash' && <CrashTab />}
171
172
  {activeTab === 'device' && <DeviceInfoTab />}
172
173
  {activeTab === 'storage' && <StorageTab />}
174
+ {activeTab === 'debugging' && <DebuggingTab />}
173
175
  </Animated.View>
174
176
 
175
177
  {/* Detail View Layer - Rendered on top with smooth slide & spring transition */}
@@ -56,6 +56,7 @@ import {
56
56
  BrainIcon,
57
57
  SmartphoneIcon,
58
58
  DatabaseIcon,
59
+ QrCodeIcon,
59
60
  } from '../NetworkIcons';
60
61
  import {LIB_VERSION} from '../../constants';
61
62
  import {copyToClipboard} from '../../helpers';
@@ -194,6 +195,13 @@ const SettingsPanel = () => {
194
195
  icon: 'storage',
195
196
  desc: 'AsyncStorage & MMKV key-value store viewer with full CRUD support',
196
197
  },
198
+ {
199
+ key: 'debugging',
200
+ label: 'Multi-Device Debugging',
201
+ category: 'diagnostic',
202
+ icon: 'debugging',
203
+ desc: 'QR Code bridge for direct Debug APK download & Metro live-reload sync',
204
+ },
197
205
  ] as const;
198
206
 
199
207
  // Staged selection state for checkboxes before clicking "Save Changes"
@@ -209,6 +217,7 @@ const SettingsPanel = () => {
209
217
  crash: Boolean(tabVisibility?.crash),
210
218
  device: Boolean(tabVisibility?.device),
211
219
  storage: Boolean(tabVisibility?.storage),
220
+ debugging: Boolean(tabVisibility?.debugging ?? true),
212
221
  }));
213
222
 
214
223
  // Synchronize staged state with tabVisibility when tabVisibility updates
@@ -223,6 +232,7 @@ const SettingsPanel = () => {
223
232
  crash: Boolean(tabVisibility?.crash),
224
233
  device: Boolean(tabVisibility?.device),
225
234
  storage: Boolean(tabVisibility?.storage),
235
+ debugging: Boolean(tabVisibility?.debugging ?? true),
226
236
  });
227
237
  }, [tabVisibility]);
228
238
 
@@ -823,6 +833,16 @@ const SettingsPanel = () => {
823
833
  size={16}
824
834
  />
825
835
  )}
836
+ {moduleItem.icon === 'debugging' && (
837
+ <QrCodeIcon
838
+ color={
839
+ isChecked
840
+ ? AppColors.purple
841
+ : AppColors.grayTextWeak
842
+ }
843
+ size={16}
844
+ />
845
+ )}
826
846
  </View>
827
847
 
828
848
  {/* Titles & Status Pill */}
@@ -14,6 +14,7 @@ import {
14
14
  CrashIcon,
15
15
  SmartphoneIcon,
16
16
  DatabaseIcon,
17
+ QrCodeIcon,
17
18
  } from '../NetworkIcons';
18
19
 
19
20
  import {isReduxConnected} from '../../customHooks/reduxLogger';
@@ -100,9 +101,16 @@ const TabBar = React.memo(() => {
100
101
  count: 0,
101
102
  icon: 'storage',
102
103
  },
104
+ {
105
+ key: 'debugging',
106
+ label: 'Debugging',
107
+ count: 0,
108
+ icon: 'debugging',
109
+ },
103
110
  ] as const
104
111
  )
105
112
  .filter(tab => {
113
+ if (tab.key === 'debugging') return true;
106
114
  if (!tabVisibility?.[tab.key]) return false;
107
115
  if (tab.key === 'redux' && !isReduxAvail) return false;
108
116
  if (tab.key === 'analytics' && !isAnalyticsAvail) return false;
@@ -169,6 +177,9 @@ const TabBar = React.memo(() => {
169
177
  {tab.icon === 'storage' && (
170
178
  <DatabaseIcon color={iconColor} size={14} />
171
179
  )}
180
+ {tab.icon === 'debugging' && (
181
+ <QrCodeIcon color={iconColor} size={14} />
182
+ )}
172
183
  <Text
173
184
  numberOfLines={1}
174
185
  ellipsizeMode="tail"
@@ -2246,3 +2246,42 @@ export const LockIcon = ({
2246
2246
  </Svg>
2247
2247
  );
2248
2248
 
2249
+ export const QrCodeIcon = ({
2250
+ color = AppColors.grayTextWeak,
2251
+ size = 14,
2252
+ }: IconProps) => (
2253
+ <Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
2254
+ <Rect
2255
+ x="3"
2256
+ y="3"
2257
+ width="7"
2258
+ height="7"
2259
+ rx="1.5"
2260
+ stroke={color}
2261
+ strokeWidth="2"
2262
+ />
2263
+ <Rect
2264
+ x="14"
2265
+ y="3"
2266
+ width="7"
2267
+ height="7"
2268
+ rx="1.5"
2269
+ stroke={color}
2270
+ strokeWidth="2"
2271
+ />
2272
+ <Rect
2273
+ x="3"
2274
+ y="14"
2275
+ width="7"
2276
+ height="7"
2277
+ rx="1.5"
2278
+ stroke={color}
2279
+ strokeWidth="2"
2280
+ />
2281
+ <Path
2282
+ d="M14 14h3v3h-3zM18 18h3v3h-3zM14 19h3v2h-3zM19 14h2v3h-2z"
2283
+ fill={color}
2284
+ />
2285
+ </Svg>
2286
+ );
2287
+
@@ -0,0 +1,75 @@
1
+ import React, {useMemo} from 'react';
2
+ import {View, StyleSheet} from 'react-native';
3
+ import Svg, {Rect, G} from 'react-native-svg';
4
+ import {generateQRMatrix} from '../helpers/qrGenerator';
5
+ import {AppColors} from '../styles/AppColors';
6
+
7
+ interface QRCodeViewProps {
8
+ value: string;
9
+ size?: number;
10
+ color?: string;
11
+ backgroundColor?: string;
12
+ }
13
+
14
+ export const QRCodeView: React.FC<QRCodeViewProps> = ({
15
+ value,
16
+ size = 200,
17
+ color = '#000000',
18
+ backgroundColor = '#FFFFFF',
19
+ }) => {
20
+ const matrix = useMemo(() => generateQRMatrix(value || 'http://localhost:8081'), [value]);
21
+ const numCells = matrix.length || 21;
22
+ // Add a 3-module quiet zone (white border) required by QR scanners
23
+ const margin = 3;
24
+ const totalCells = numCells + margin * 2;
25
+ const cellSize = size / totalCells;
26
+
27
+ return (
28
+ <View
29
+ style={[
30
+ styles.container,
31
+ {
32
+ width: size + 20,
33
+ height: size + 20,
34
+ backgroundColor,
35
+ },
36
+ ]}>
37
+ <Svg width={size} height={size} viewBox={`0 0 ${size} ${size}`}>
38
+ <Rect width={size} height={size} fill={backgroundColor} />
39
+ <G>
40
+ {matrix.map((row, r) =>
41
+ row.map((cell, c) => {
42
+ if (!cell) return null;
43
+ return (
44
+ <Rect
45
+ key={`${r}-${c}`}
46
+ x={(c + margin) * cellSize}
47
+ y={(r + margin) * cellSize}
48
+ width={cellSize + 0.3}
49
+ height={cellSize + 0.3}
50
+ fill={color}
51
+ />
52
+ );
53
+ }),
54
+ )}
55
+ </G>
56
+ </Svg>
57
+ </View>
58
+ );
59
+ };
60
+
61
+ const styles = StyleSheet.create({
62
+ container: {
63
+ padding: 10,
64
+ borderRadius: 14,
65
+ alignItems: 'center',
66
+ justifyContent: 'center',
67
+ shadowColor: AppColors.black,
68
+ shadowOffset: {width: 0, height: 3},
69
+ shadowOpacity: 0.15,
70
+ shadowRadius: 8,
71
+ elevation: 4,
72
+ },
73
+ });
74
+
75
+ export default QRCodeView;
@@ -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 = '2.3.10';
3
+ export const LIB_VERSION = '2.3.12';
@@ -0,0 +1,49 @@
1
+ /**
2
+ * ISO/IEC 18004 Standard QR Code Matrix Generator
3
+ * Uses industry-standard qrcode-generator with full Reed-Solomon Error Correction
4
+ * and BCH format encoding for 100% instant phone camera / Google Lens recognition.
5
+ */
6
+ import qrcode from 'qrcode-generator';
7
+
8
+ export type QRECC = 'L' | 'M' | 'Q' | 'H';
9
+
10
+ export function generateQRMatrix(text: string, ecc: QRECC = 'M'): boolean[][] {
11
+ try {
12
+ // Type 0 = auto detect smallest valid QR version
13
+ const qr = qrcode(0, ecc);
14
+ qr.addData(text);
15
+ qr.make();
16
+
17
+ const count = qr.getModuleCount();
18
+ const matrix: boolean[][] = [];
19
+
20
+ for (let row = 0; row < count; row++) {
21
+ const rowData: boolean[] = [];
22
+ for (let col = 0; col < count; col++) {
23
+ rowData.push(qr.isDark(row, col));
24
+ }
25
+ matrix.push(rowData);
26
+ }
27
+
28
+ return matrix;
29
+ } catch (err) {
30
+ // Fallback: higher version if auto-detect fails
31
+ try {
32
+ const qr = qrcode(10, ecc);
33
+ qr.addData(text);
34
+ qr.make();
35
+ const count = qr.getModuleCount();
36
+ const matrix: boolean[][] = [];
37
+ for (let row = 0; row < count; row++) {
38
+ const rowData: boolean[] = [];
39
+ for (let col = 0; col < count; col++) {
40
+ rowData.push(qr.isDark(row, col));
41
+ }
42
+ matrix.push(rowData);
43
+ }
44
+ return matrix;
45
+ } catch {
46
+ return [];
47
+ }
48
+ }
49
+ }
package/src/index.tsx CHANGED
@@ -365,6 +365,7 @@ const NetworkInspector = ({
365
365
  crash: false,
366
366
  device: false,
367
367
  storage: false,
368
+ debugging: true,
368
369
  });
369
370
 
370
371
  const [maxNetworkLogs, setMaxNetworkLogs] = useState<number>(100);
@@ -427,6 +428,7 @@ const NetworkInspector = ({
427
428
  crash: false,
428
429
  device: false,
429
430
  storage: false,
431
+ debugging: true,
430
432
  });
431
433
  setDefaultTab('apis');
432
434
  setIsAutoRamLimitEnabled(true);
@@ -12,6 +12,7 @@ export const ActiveTab = {
12
12
  Crash: 'crash',
13
13
  Device: 'device',
14
14
  Storage: 'storage',
15
+ Debugging: 'debugging',
15
16
  } as const;
16
17
  export type ActiveTab = (typeof ActiveTab)[keyof typeof ActiveTab];
17
18
 
@@ -70,6 +71,7 @@ export const SettingsPage = {
70
71
  Crash: 'crash',
71
72
  Device: 'device',
72
73
  Storage: 'storage',
74
+ Debugging: 'debugging',
73
75
  } as const;
74
76
  export type SettingsPage =
75
77
  | (typeof SettingsPage)[keyof typeof SettingsPage]