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
@@ -57,6 +57,7 @@ const CrashTab_1 = __importDefault(require("./CrashTab"));
57
57
  const CrashDetail_1 = __importDefault(require("./CrashDetail"));
58
58
  const DeviceInfoTab_1 = __importDefault(require("./DeviceInfoTab"));
59
59
  const StorageTab_1 = __importDefault(require("./StorageTab"));
60
+ const DebuggingTab_1 = __importDefault(require("./DebuggingTab"));
60
61
  const SettingsPanel_1 = __importDefault(require("./SettingsPanel"));
61
62
  const NpmUpdateToast_1 = __importDefault(require("./NpmUpdateToast"));
62
63
  const Toast_1 = __importDefault(require("../Toast"));
@@ -156,6 +157,7 @@ const MainScreen = () => {
156
157
  {activeTab === 'crash' && <CrashTab_1.default />}
157
158
  {activeTab === 'device' && <DeviceInfoTab_1.default />}
158
159
  {activeTab === 'storage' && <StorageTab_1.default />}
160
+ {activeTab === 'debugging' && <DebuggingTab_1.default />}
159
161
  </react_native_1.Animated.View>
160
162
 
161
163
 
@@ -135,6 +135,13 @@ const SettingsPanel = () => {
135
135
  icon: 'storage',
136
136
  desc: 'AsyncStorage & MMKV key-value store viewer with full CRUD support',
137
137
  },
138
+ {
139
+ key: 'debugging',
140
+ label: 'Multi-Device Debugging',
141
+ category: 'diagnostic',
142
+ icon: 'debugging',
143
+ desc: 'QR Code bridge for direct Debug APK download & Metro live-reload sync',
144
+ },
138
145
  ];
139
146
  const [stagedTabVisibility, setStagedTabVisibility] = (0, react_1.useState)(() => ({
140
147
  apis: true,
@@ -146,6 +153,7 @@ const SettingsPanel = () => {
146
153
  crash: Boolean(tabVisibility?.crash),
147
154
  device: Boolean(tabVisibility?.device),
148
155
  storage: Boolean(tabVisibility?.storage),
156
+ debugging: Boolean(tabVisibility?.debugging ?? true),
149
157
  }));
150
158
  (0, react_1.useEffect)(() => {
151
159
  setStagedTabVisibility({
@@ -158,6 +166,7 @@ const SettingsPanel = () => {
158
166
  crash: Boolean(tabVisibility?.crash),
159
167
  device: Boolean(tabVisibility?.device),
160
168
  storage: Boolean(tabVisibility?.storage),
169
+ debugging: Boolean(tabVisibility?.debugging ?? true),
161
170
  });
162
171
  }, [tabVisibility]);
163
172
  const hasUnsavedChanges = (0, react_1.useMemo)(() => {
@@ -545,6 +554,9 @@ const SettingsPanel = () => {
545
554
  {moduleItem.icon === 'storage' && (<NetworkIcons_1.DatabaseIcon color={isChecked
546
555
  ? AppColors_1.AppColors.purple
547
556
  : AppColors_1.AppColors.grayTextWeak} size={16}/>)}
557
+ {moduleItem.icon === 'debugging' && (<NetworkIcons_1.QrCodeIcon color={isChecked
558
+ ? AppColors_1.AppColors.purple
559
+ : AppColors_1.AppColors.grayTextWeak} size={16}/>)}
548
560
  </react_native_1.View>
549
561
 
550
562
 
@@ -73,8 +73,16 @@ const TabBar = react_1.default.memo(() => {
73
73
  count: 0,
74
74
  icon: 'storage',
75
75
  },
76
+ {
77
+ key: 'debugging',
78
+ label: 'Debugging',
79
+ count: 0,
80
+ icon: 'debugging',
81
+ },
76
82
  ]
77
83
  .filter(tab => {
84
+ if (tab.key === 'debugging')
85
+ return true;
78
86
  if (!tabVisibility?.[tab.key])
79
87
  return false;
80
88
  if (tab.key === 'redux' && !isReduxAvail)
@@ -117,6 +125,7 @@ const TabBar = react_1.default.memo(() => {
117
125
  {tab.icon === 'crash' && (<NetworkIcons_1.CrashIcon color={iconColor} size={14}/>)}
118
126
  {tab.icon === 'device' && (<NetworkIcons_1.SmartphoneIcon color={iconColor} size={14}/>)}
119
127
  {tab.icon === 'storage' && (<NetworkIcons_1.DatabaseIcon color={iconColor} size={14}/>)}
128
+ {tab.icon === 'debugging' && (<NetworkIcons_1.QrCodeIcon color={iconColor} size={14}/>)}
120
129
  <react_native_1.Text numberOfLines={1} ellipsizeMode="tail" style={[
121
130
  styles_1.default.contentTabButtonText,
122
131
  isActive &&
@@ -134,3 +134,4 @@ export declare const DatabaseIcon: ({ color, size, }: IconProps) => React.JSX.El
134
134
  export declare const PencilIcon: ({ color, size, }: IconProps) => React.JSX.Element;
135
135
  export declare const PlusIcon: ({ color, size, }: IconProps) => React.JSX.Element;
136
136
  export declare const LockIcon: ({ color, size, }: IconProps) => React.JSX.Element;
137
+ export declare const QrCodeIcon: ({ color, size, }: IconProps) => React.JSX.Element;
@@ -38,7 +38,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.InfoCircleIcon = exports.UserIcon = exports.LayersIcon = exports.WipeIcon = exports.FolderIcon = exports.SettingsIcon = exports.EyeIcon = exports.JsIcon = exports.CssIcon = exports.HtmlIcon = exports.BrandSquareIcon = exports.BrandCircleIcon = exports.MoonIcon = exports.SunIcon = exports.DebugIcon = exports.InsightsIcon = exports.AnalyticsIcon = exports.WhiteBackNavigation = exports.CloseWhite = exports.DownloadIcon = exports.FilterIcon = exports.ChevronIcon = exports.SortArrowIcon = exports.GlobeIcon = exports.DiffIcon = exports.SignalIcon = exports.ExportIcon = exports.HeaderPauseIcon = exports.TrashIcon = exports.FailIcon = exports.CircleAlertIcon = exports.CircleXIcon = exports.CircleCheckIcon = exports.CheckIcon = exports.TerminalIcon = exports.FetchIcon = exports.CopyIcon = exports.HeadersIcon = exports.ResponseIcon = exports.RequestIcon = exports.SizeIcon = exports.StatusIcon = exports.CalendarIcon = exports.ClockIcon = exports.ClearIcon = exports.SearchIcon = exports.ExpandCollapseIcon = exports.ScreenIcon = exports.MapPinIcon = exports.EmptyRadarIcon = void 0;
40
40
  exports.DiagnosticsIcon = exports.StackTraceIcon = exports.LayoutIcon = exports.ChipIcon = exports.SkullIcon = exports.ShieldAlertIcon = exports.CrashIcon = exports.UserCheckIcon = exports.TargetGoalIcon = exports.RepeatIcon = exports.PinIcon = exports.HourglassIcon = exports.FlameIcon = exports.CodeBracketsIcon = exports.AndroidIcon = exports.AppleIcon = exports.LinkChainIcon = exports.GitHubIcon = exports.PackageBoxIcon = exports.ExternalLinkIcon = exports.MoneyIcon = exports.CartIcon = exports.TextAaIcon = exports.BrainIcon = exports.AtomIcon = exports.MapIcon = exports.SparkleIcon = exports.LightbulbIcon = exports.DocIcon = exports.FolderOpenIcon = exports.BanIcon = exports.BoltIcon = exports.PerformanceIcon = exports.ReduxIcon = exports.MetadataIcon = exports.StorageIcon = exports.RefreshCcwIcon = exports.TimelineIcon = exports.LiveStateIcon = exports.BundleIcon = exports.ForwardChevronIcon = exports.PackageIcon = exports.TableIcon = exports.RawIcon = exports.PrettyIcon = exports.SortIcon = exports.MotionIcon = exports.TrendingUpIcon = exports.ErrorCircleIcon = exports.WarningTriangleIcon = void 0;
41
- exports.LockIcon = exports.PlusIcon = exports.PencilIcon = exports.DatabaseIcon = exports.ShieldCheckIcon = exports.WifiIcon = exports.CpuIcon = exports.ChevronDownIcon = exports.ResetIcon = exports.NpmIcon = exports.TagIcon = exports.BugIcon = exports.AlertTriangleIcon = exports.SmartphoneIcon = exports.KeyIcon = exports.BarChartIcon = exports.DiceIcon = exports.ZapIcon = exports.FlaskIcon = exports.LoadingSpinnerIcon = exports.ListenerIcon = exports.AllFramesIcon = exports.AppFramesIcon = exports.RawJsonIcon = exports.TrailIcon = void 0;
41
+ exports.QrCodeIcon = exports.LockIcon = exports.PlusIcon = exports.PencilIcon = exports.DatabaseIcon = exports.ShieldCheckIcon = exports.WifiIcon = exports.CpuIcon = exports.ChevronDownIcon = exports.ResetIcon = exports.NpmIcon = exports.TagIcon = exports.BugIcon = exports.AlertTriangleIcon = exports.SmartphoneIcon = exports.KeyIcon = exports.BarChartIcon = exports.DiceIcon = exports.ZapIcon = exports.FlaskIcon = exports.LoadingSpinnerIcon = exports.ListenerIcon = exports.AllFramesIcon = exports.AppFramesIcon = exports.RawJsonIcon = exports.TrailIcon = void 0;
42
42
  const react_1 = __importDefault(require("react"));
43
43
  const react_native_svg_1 = __importStar(require("react-native-svg"));
44
44
  const AppColors_1 = require("../styles/AppColors");
@@ -899,3 +899,10 @@ const LockIcon = ({ color = AppColors_1.AppColors.grayTextWeak, size = 14, }) =>
899
899
  <react_native_svg_1.Path d="M7 11V7a5 5 0 0 1 10 0v4" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
900
900
  </react_native_svg_1.default>);
901
901
  exports.LockIcon = LockIcon;
902
+ const QrCodeIcon = ({ color = AppColors_1.AppColors.grayTextWeak, size = 14, }) => (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
903
+ <react_native_svg_1.Rect x="3" y="3" width="7" height="7" rx="1.5" stroke={color} strokeWidth="2"/>
904
+ <react_native_svg_1.Rect x="14" y="3" width="7" height="7" rx="1.5" stroke={color} strokeWidth="2"/>
905
+ <react_native_svg_1.Rect x="3" y="14" width="7" height="7" rx="1.5" stroke={color} strokeWidth="2"/>
906
+ <react_native_svg_1.Path d="M14 14h3v3h-3zM18 18h3v3h-3zM14 19h3v2h-3zM19 14h2v3h-2z" fill={color}/>
907
+ </react_native_svg_1.default>);
908
+ exports.QrCodeIcon = QrCodeIcon;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface QRCodeViewProps {
3
+ value: string;
4
+ size?: number;
5
+ color?: string;
6
+ backgroundColor?: string;
7
+ }
8
+ export declare const QRCodeView: React.FC<QRCodeViewProps>;
9
+ export default QRCodeView;
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.QRCodeView = void 0;
37
+ const react_1 = __importStar(require("react"));
38
+ const react_native_1 = require("react-native");
39
+ const react_native_svg_1 = __importStar(require("react-native-svg"));
40
+ const qrGenerator_1 = require("../helpers/qrGenerator");
41
+ const AppColors_1 = require("../styles/AppColors");
42
+ const QRCodeView = ({ value, size = 200, color = '#000000', backgroundColor = '#FFFFFF', }) => {
43
+ const matrix = (0, react_1.useMemo)(() => (0, qrGenerator_1.generateQRMatrix)(value || 'http://localhost:8081'), [value]);
44
+ const numCells = matrix.length || 21;
45
+ const margin = 3;
46
+ const totalCells = numCells + margin * 2;
47
+ const cellSize = size / totalCells;
48
+ return (<react_native_1.View style={[
49
+ styles.container,
50
+ {
51
+ width: size + 20,
52
+ height: size + 20,
53
+ backgroundColor,
54
+ },
55
+ ]}>
56
+ <react_native_svg_1.default width={size} height={size} viewBox={`0 0 ${size} ${size}`}>
57
+ <react_native_svg_1.Rect width={size} height={size} fill={backgroundColor}/>
58
+ <react_native_svg_1.G>
59
+ {matrix.map((row, r) => row.map((cell, c) => {
60
+ if (!cell)
61
+ return null;
62
+ return (<react_native_svg_1.Rect key={`${r}-${c}`} x={(c + margin) * cellSize} y={(r + margin) * cellSize} width={cellSize + 0.3} height={cellSize + 0.3} fill={color}/>);
63
+ }))}
64
+ </react_native_svg_1.G>
65
+ </react_native_svg_1.default>
66
+ </react_native_1.View>);
67
+ };
68
+ exports.QRCodeView = QRCodeView;
69
+ const styles = react_native_1.StyleSheet.create({
70
+ container: {
71
+ padding: 10,
72
+ borderRadius: 14,
73
+ alignItems: 'center',
74
+ justifyContent: 'center',
75
+ shadowColor: AppColors_1.AppColors.black,
76
+ shadowOffset: { width: 0, height: 3 },
77
+ shadowOpacity: 0.15,
78
+ shadowRadius: 8,
79
+ elevation: 4,
80
+ },
81
+ });
82
+ exports.default = exports.QRCodeView;
@@ -1 +1 @@
1
- export declare const LIB_VERSION = "2.3.10";
1
+ export declare const LIB_VERSION = "2.3.12";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LIB_VERSION = void 0;
4
- exports.LIB_VERSION = '2.3.10';
4
+ exports.LIB_VERSION = '2.3.12';
@@ -0,0 +1,2 @@
1
+ export type QRECC = 'L' | 'M' | 'Q' | 'H';
2
+ export declare function generateQRMatrix(text: string, ecc?: QRECC): boolean[][];
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.generateQRMatrix = generateQRMatrix;
7
+ const qrcode_generator_1 = __importDefault(require("qrcode-generator"));
8
+ function generateQRMatrix(text, ecc = 'M') {
9
+ try {
10
+ const qr = (0, qrcode_generator_1.default)(0, ecc);
11
+ qr.addData(text);
12
+ qr.make();
13
+ const count = qr.getModuleCount();
14
+ const matrix = [];
15
+ for (let row = 0; row < count; row++) {
16
+ const rowData = [];
17
+ for (let col = 0; col < count; col++) {
18
+ rowData.push(qr.isDark(row, col));
19
+ }
20
+ matrix.push(rowData);
21
+ }
22
+ return matrix;
23
+ }
24
+ catch (err) {
25
+ try {
26
+ const qr = (0, qrcode_generator_1.default)(10, ecc);
27
+ qr.addData(text);
28
+ qr.make();
29
+ const count = qr.getModuleCount();
30
+ const matrix = [];
31
+ for (let row = 0; row < count; row++) {
32
+ const rowData = [];
33
+ for (let col = 0; col < count; col++) {
34
+ rowData.push(qr.isDark(row, col));
35
+ }
36
+ matrix.push(rowData);
37
+ }
38
+ return matrix;
39
+ }
40
+ catch {
41
+ return [];
42
+ }
43
+ }
44
+ }
@@ -209,6 +209,7 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
209
209
  crash: false,
210
210
  device: false,
211
211
  storage: false,
212
+ debugging: true,
212
213
  });
213
214
  const [maxNetworkLogs, setMaxNetworkLogs] = (0, react_1.useState)(100);
214
215
  const [maxAnalyticsEventsLimit, setMaxAnalyticsEventsLimit] = (0, react_1.useState)(75);
@@ -262,6 +263,7 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
262
263
  crash: false,
263
264
  device: false,
264
265
  storage: false,
266
+ debugging: true,
265
267
  });
266
268
  setDefaultTab('apis');
267
269
  setIsAutoRamLimitEnabled(true);
@@ -8,6 +8,7 @@ export declare const ActiveTab: {
8
8
  readonly Crash: "crash";
9
9
  readonly Device: "device";
10
10
  readonly Storage: "storage";
11
+ readonly Debugging: "debugging";
11
12
  };
12
13
  export type ActiveTab = (typeof ActiveTab)[keyof typeof ActiveTab];
13
14
  export declare const Method: {
@@ -59,6 +60,7 @@ export declare const SettingsPage: {
59
60
  readonly Crash: "crash";
60
61
  readonly Device: "device";
61
62
  readonly Storage: "storage";
63
+ readonly Debugging: "debugging";
62
64
  };
63
65
  export type SettingsPage = (typeof SettingsPage)[keyof typeof SettingsPage] | null;
64
66
  export declare const SettingsSubTab: {
@@ -11,6 +11,7 @@ exports.ActiveTab = {
11
11
  Crash: 'crash',
12
12
  Device: 'device',
13
13
  Storage: 'storage',
14
+ Debugging: 'debugging',
14
15
  };
15
16
  exports.Method = {
16
17
  All: 'ALL',
@@ -56,6 +57,7 @@ exports.SettingsPage = {
56
57
  Crash: 'crash',
57
58
  Device: 'device',
58
59
  Storage: 'storage',
60
+ Debugging: 'debugging',
59
61
  };
60
62
  exports.SettingsSubTab = {
61
63
  Module: 'module',
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const DebuggingTab: React.FC;
3
+ export default DebuggingTab;