react-native-inapp-inspector 2.2.4 → 2.2.6
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.
- package/README.md +0 -10
- package/dist/commonjs/components/BrandSquareIcon.js +51 -117
- package/dist/commonjs/components/Inspector/InspectorHeader.js +0 -73
- package/dist/commonjs/components/Inspector/MainScreen.js +0 -4
- package/dist/commonjs/components/Inspector/SettingsPanel.js +2 -107
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/helpers/index.d.ts +0 -1
- package/dist/commonjs/helpers/index.js +0 -1
- package/dist/commonjs/index.d.ts +1 -1
- package/dist/commonjs/index.js +2 -19
- package/dist/commonjs/native/NativeInspector.js +50 -26
- package/dist/esm/components/BrandSquareIcon.js +52 -118
- package/dist/esm/components/Inspector/InspectorHeader.js +0 -73
- package/dist/esm/components/Inspector/MainScreen.js +0 -4
- package/dist/esm/components/Inspector/SettingsPanel.js +2 -107
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/helpers/index.d.ts +0 -1
- package/dist/esm/helpers/index.js +0 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +2 -12
- package/dist/esm/native/NativeInspector.js +51 -27
- package/ios/NetworkInspectorModule.mm +34 -19
- package/package.json +2 -2
- package/src/components/BrandSquareIcon.tsx +109 -118
- package/src/components/Inspector/InspectorHeader.tsx +0 -93
- package/src/components/Inspector/MainScreen.tsx +0 -4
- package/src/components/Inspector/SettingsPanel.tsx +2 -128
- package/src/constants/version.ts +1 -1
- package/src/helpers/index.ts +0 -1
- package/src/index.tsx +2 -24
- package/src/native/NativeInspector.ts +56 -24
- package/dist/commonjs/components/Inspector/TelemetryConsentModal.d.ts +0 -3
- package/dist/commonjs/components/Inspector/TelemetryConsentModal.js +0 -368
- package/dist/commonjs/helpers/telemetry.d.ts +0 -99
- package/dist/commonjs/helpers/telemetry.js +0 -398
- package/dist/esm/components/Inspector/TelemetryConsentModal.d.ts +0 -3
- package/dist/esm/components/Inspector/TelemetryConsentModal.js +0 -331
- package/dist/esm/helpers/telemetry.d.ts +0 -99
- package/dist/esm/helpers/telemetry.js +0 -380
- package/src/components/Inspector/TelemetryConsentModal.tsx +0 -416
- package/src/helpers/telemetry.ts +0 -505
|
@@ -12,10 +12,16 @@ const isNativeModuleAvailable = () => {
|
|
|
12
12
|
return !!NativeModule;
|
|
13
13
|
};
|
|
14
14
|
exports.isNativeModuleAvailable = isNativeModuleAvailable;
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const getNativeEmitter = () => {
|
|
16
|
+
try {
|
|
17
|
+
if (react_native_1.NativeModules && react_native_1.NativeModules.NetworkInspectorModule) {
|
|
18
|
+
return new react_native_1.NativeEventEmitter(react_native_1.NativeModules.NetworkInspectorModule);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
catch (e) { }
|
|
22
|
+
return null;
|
|
23
|
+
};
|
|
24
|
+
const nativeEmitter = getNativeEmitter();
|
|
19
25
|
/**
|
|
20
26
|
* Retrieves low-level native hardware and system metrics (RAM, Heap, Disk, Battery, CPU).
|
|
21
27
|
*/
|
|
@@ -56,18 +62,27 @@ exports.enableNativeCrashProtection = enableNativeCrashProtection;
|
|
|
56
62
|
* Subscribes to fatal native crash events caught by the iOS / Kotlin exception handlers.
|
|
57
63
|
*/
|
|
58
64
|
const subscribeNativeCrashes = (callback) => {
|
|
59
|
-
|
|
60
|
-
return () => { };
|
|
61
|
-
}
|
|
65
|
+
const cleanups = [];
|
|
62
66
|
try {
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
const sub1 = react_native_1.DeviceEventEmitter.addListener('onNativeCrash', callback);
|
|
68
|
+
cleanups.push(() => sub1.remove());
|
|
69
|
+
}
|
|
70
|
+
catch (e) { }
|
|
71
|
+
if (nativeEmitter) {
|
|
72
|
+
try {
|
|
73
|
+
const sub2 = nativeEmitter.addListener('onNativeCrash', callback);
|
|
74
|
+
cleanups.push(() => sub2.remove());
|
|
75
|
+
}
|
|
76
|
+
catch (e) { }
|
|
77
|
+
}
|
|
78
|
+
return () => {
|
|
79
|
+
cleanups.forEach(fn => {
|
|
80
|
+
try {
|
|
81
|
+
fn();
|
|
82
|
+
}
|
|
83
|
+
catch (e) { }
|
|
84
|
+
});
|
|
85
|
+
};
|
|
71
86
|
};
|
|
72
87
|
exports.subscribeNativeCrashes = subscribeNativeCrashes;
|
|
73
88
|
/**
|
|
@@ -123,18 +138,27 @@ exports.setNativeFloatingButtonBadge = setNativeFloatingButtonBadge;
|
|
|
123
138
|
* Subscribes to tap events on the native floating button.
|
|
124
139
|
*/
|
|
125
140
|
const subscribeNativeFloatingButtonPress = (callback) => {
|
|
126
|
-
|
|
127
|
-
return () => { };
|
|
128
|
-
}
|
|
141
|
+
const cleanups = [];
|
|
129
142
|
try {
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
143
|
+
const sub1 = react_native_1.DeviceEventEmitter.addListener('onFloatingButtonPress', callback);
|
|
144
|
+
cleanups.push(() => sub1.remove());
|
|
145
|
+
}
|
|
146
|
+
catch (e) { }
|
|
147
|
+
if (nativeEmitter) {
|
|
148
|
+
try {
|
|
149
|
+
const sub2 = nativeEmitter.addListener('onFloatingButtonPress', callback);
|
|
150
|
+
cleanups.push(() => sub2.remove());
|
|
151
|
+
}
|
|
152
|
+
catch (e) { }
|
|
153
|
+
}
|
|
154
|
+
return () => {
|
|
155
|
+
cleanups.forEach(fn => {
|
|
156
|
+
try {
|
|
157
|
+
fn();
|
|
158
|
+
}
|
|
159
|
+
catch (e) { }
|
|
160
|
+
});
|
|
161
|
+
};
|
|
138
162
|
};
|
|
139
163
|
exports.subscribeNativeFloatingButtonPress = subscribeNativeFloatingButtonPress;
|
|
140
164
|
/**
|
|
@@ -1,140 +1,74 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import Svg, { Circle, Path, G, Defs, LinearGradient, RadialGradient, Stop, Rect,
|
|
2
|
+
import Svg, { Circle, Path, G, Defs, LinearGradient, RadialGradient, Stop, Rect, Line, } from 'react-native-svg';
|
|
3
3
|
export const BrandSquareIcon = ({ size = 56 }) => {
|
|
4
4
|
return (<Svg width={size} height={size} viewBox="0 0 256 256" fill="none">
|
|
5
5
|
<Defs>
|
|
6
|
-
<LinearGradient id="
|
|
7
|
-
<Stop offset="0" stopColor="#
|
|
8
|
-
<Stop offset="1" stopColor="#
|
|
6
|
+
<LinearGradient id="bs_tile" x1="0" y1="0" x2="256" y2="256" gradientUnits="userSpaceOnUse">
|
|
7
|
+
<Stop offset="0" stopColor="#1E1B4B"/>
|
|
8
|
+
<Stop offset="1" stopColor="#0F172A"/>
|
|
9
9
|
</LinearGradient>
|
|
10
|
-
<LinearGradient id="
|
|
11
|
-
<Stop offset="0" stopColor="#
|
|
12
|
-
<Stop offset="
|
|
10
|
+
<LinearGradient id="bs_beam" x1="0" y1="0" x2="256" y2="256" gradientUnits="userSpaceOnUse">
|
|
11
|
+
<Stop offset="0" stopColor="#818CF8"/>
|
|
12
|
+
<Stop offset="0.5" stopColor="#A855F7"/>
|
|
13
|
+
<Stop offset="1" stopColor="#EC4899"/>
|
|
13
14
|
</LinearGradient>
|
|
14
|
-
<LinearGradient id="
|
|
15
|
-
<Stop offset="0" stopColor="#
|
|
16
|
-
<Stop offset="
|
|
17
|
-
<Stop offset="1" stopColor="#A78BFA"/>
|
|
15
|
+
<LinearGradient id="bs_body" x1="0" y1="0" x2="0" y2="256" gradientUnits="userSpaceOnUse">
|
|
16
|
+
<Stop offset="0" stopColor="#312E81"/>
|
|
17
|
+
<Stop offset="1" stopColor="#1E1B4B"/>
|
|
18
18
|
</LinearGradient>
|
|
19
|
-
<RadialGradient id="
|
|
20
|
-
<Stop offset="0" stopColor="#
|
|
21
|
-
<Stop offset="
|
|
19
|
+
<RadialGradient id="bs_iris" cx="40%" cy="40%" r="60%">
|
|
20
|
+
<Stop offset="0" stopColor="#FDE047"/>
|
|
21
|
+
<Stop offset="0.7" stopColor="#F59E0B"/>
|
|
22
|
+
<Stop offset="1" stopColor="#D97706"/>
|
|
22
23
|
</RadialGradient>
|
|
23
|
-
<LinearGradient id="
|
|
24
|
-
<Stop offset="0" stopColor="#
|
|
25
|
-
<Stop offset="1" stopColor="#
|
|
26
|
-
</LinearGradient>
|
|
27
|
-
<LinearGradient id="beakSquare" x1="120" y1="151" x2="136" y2="168" gradientUnits="userSpaceOnUse">
|
|
28
|
-
<Stop offset="0" stopColor="#FCD34D"/>
|
|
29
|
-
<Stop offset="1" stopColor="#FB923C"/>
|
|
30
|
-
</LinearGradient>
|
|
31
|
-
<RadialGradient id="irisSquare" cx="0.42" cy="0.38" r="0.72">
|
|
32
|
-
<Stop offset="0" stopColor="#FDE68A"/>
|
|
33
|
-
<Stop offset="0.5" stopColor="#FBBF24"/>
|
|
34
|
-
<Stop offset="1" stopColor="#F59E0B"/>
|
|
35
|
-
</RadialGradient>
|
|
36
|
-
<RadialGradient id="blushSquare" cx="0.5" cy="0.5" r="0.5">
|
|
37
|
-
<Stop offset="0" stopColor="#FB7185" stopOpacity={0.5}/>
|
|
38
|
-
<Stop offset="1" stopColor="#FB7185" stopOpacity={0}/>
|
|
39
|
-
</RadialGradient>
|
|
40
|
-
<LinearGradient id="wingSquare" x1="70" y1="120" x2="190" y2="206" gradientUnits="userSpaceOnUse">
|
|
41
|
-
<Stop offset="0" stopColor="#1A2545"/>
|
|
42
|
-
<Stop offset="1" stopColor="#0E1530"/>
|
|
43
|
-
</LinearGradient>
|
|
44
|
-
<LinearGradient id="faceplateSquare" x1="70" y1="72" x2="186" y2="152" gradientUnits="userSpaceOnUse">
|
|
45
|
-
<Stop offset="0" stopColor="#35497E"/>
|
|
46
|
-
<Stop offset="1" stopColor="#1E2D4D"/>
|
|
47
|
-
</LinearGradient>
|
|
48
|
-
<RadialGradient id="lensglassSquare" cx="0.4" cy="0.32" r="0.75">
|
|
49
|
-
<Stop offset="0" stopColor="#7DE8FF" stopOpacity={0.22}/>
|
|
50
|
-
<Stop offset="0.7" stopColor="#7DE8FF" stopOpacity={0.05}/>
|
|
51
|
-
<Stop offset="1" stopColor="#7DE8FF" stopOpacity={0}/>
|
|
52
|
-
</RadialGradient>
|
|
53
|
-
<LinearGradient id="bellySquare" x1="94" y1="126" x2="162" y2="212" gradientUnits="userSpaceOnUse">
|
|
54
|
-
<Stop offset="0" stopColor="#33477A"/>
|
|
55
|
-
<Stop offset="1" stopColor="#1D2B53"/>
|
|
24
|
+
<LinearGradient id="bs_beak" x1="0" y1="0" x2="0" y2="20" gradientUnits="userSpaceOnUse">
|
|
25
|
+
<Stop offset="0" stopColor="#FBBF24"/>
|
|
26
|
+
<Stop offset="1" stopColor="#F97316"/>
|
|
56
27
|
</LinearGradient>
|
|
57
28
|
</Defs>
|
|
58
|
-
<Rect x={8} y={8} width={240} height={240} rx={58} fill="url(#tileSquare)"/>
|
|
59
|
-
<Rect x={8.6} y={8.6} width={238.8} height={238.8} rx={57.4} fill="none" stroke="url(#edgeSquare)" strokeOpacity={0.6} strokeWidth={1.2}/>
|
|
60
|
-
<Circle cx={128} cy={128} r={104} fill="url(#haloSquare)"/>
|
|
61
|
-
<G transform="translate(128 128) scale(1.16) translate(-128 -134)">
|
|
62
|
-
{/* wing 1 */}
|
|
63
|
-
<Path d="M74 124 C58 154 60 190 86 204 C79 176 77 148 88 126 Z" fill="url(#wingSquare)" stroke="url(#beamSquare)" strokeWidth={2.5} strokeOpacity={0.45}/>
|
|
64
|
-
{/* wing 2 */}
|
|
65
|
-
<Path d="M182 124 C198 154 196 190 170 204 C177 176 179 148 168 126 Z" fill="url(#wingSquare)" stroke="url(#beamSquare)" strokeWidth={2.5} strokeOpacity={0.45}/>
|
|
66
|
-
{/* body */}
|
|
67
|
-
<Path d="M62 150 C58 104 70 70 90 58 L98 42 L116 62 Q128 57 140 62 L158 42 L166 58 C186 70 198 104 194 150 C198 180 184 204 152 212 C140 216 116 216 104 212 C72 204 58 180 62 150 Z" fill="url(#owlbodySquare)" stroke="url(#beamSquare)" strokeWidth={4} strokeLinejoin="round"/>
|
|
68
|
-
|
|
69
|
-
{/* inner-ear shadows */}
|
|
70
|
-
<Path d="M99 48 L114 62 L104 63 L98 55 Z" fill="#080F22" opacity={0.5}/>
|
|
71
|
-
<Path d="M157 48 L142 62 L152 63 L158 55 Z" fill="#080F22" opacity={0.5}/>
|
|
72
|
-
|
|
73
|
-
{/* wing feather lines */}
|
|
74
|
-
<G stroke="#22325A" strokeWidth={2.2} fill="none" strokeLinecap="round" opacity={0.75}>
|
|
75
|
-
<Path d="M80 138 q-5 26 3 50"/>
|
|
76
|
-
<Path d="M90 134 q-4 26 3 48"/>
|
|
77
|
-
<Path d="M176 138 q5 26 -3 50"/>
|
|
78
|
-
<Path d="M166 134 q4 26 -3 48"/>
|
|
79
|
-
</G>
|
|
80
29
|
|
|
81
|
-
|
|
82
|
-
|
|
30
|
+
{/* Rounded App Tile Background */}
|
|
31
|
+
<Rect x="8" y="8" width="240" height="240" rx="54" fill="url(#bs_tile)"/>
|
|
32
|
+
<Rect x="8" y="8" width="240" height="240" rx="54" fill="none" stroke="url(#bs_beam)" strokeWidth="3" strokeOpacity={0.4}/>
|
|
83
33
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
<Path d="M110 154 Q118 162 126 154"/>
|
|
87
|
-
<Path d="M126 154 Q134 162 142 154"/>
|
|
88
|
-
<Path d="M142 154 Q150 162 158 154"/>
|
|
89
|
-
<Path d="M102 172 Q110 180 118 172"/>
|
|
90
|
-
<Path d="M150 172 Q158 180 166 172"/>
|
|
91
|
-
<Path d="M112 190 Q120 198 128 190"/>
|
|
92
|
-
<Path d="M128 190 Q136 198 144 190"/>
|
|
93
|
-
</G>
|
|
34
|
+
{/* Owl Outer Body Contour */}
|
|
35
|
+
<Path d="M64 148 C60 102 72 68 92 56 L100 40 L118 60 Q128 55 138 60 L156 40 L164 56 C184 68 196 102 192 148 C196 178 182 202 150 210 C138 214 118 214 106 210 C74 202 60 178 64 148 Z" fill="url(#bs_body)" stroke="url(#bs_beam)" strokeWidth="4" strokeLinejoin="round"/>
|
|
94
36
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
<Path d="M122 170 L115 177 L122 184"/>
|
|
99
|
-
<Path d="M134 170 L141 177 L134 184"/>
|
|
100
|
-
<Path d="M130 168 L126 186"/>
|
|
101
|
-
</G>
|
|
37
|
+
{/* Wings */}
|
|
38
|
+
<Path d="M74 124 C58 154 60 190 86 204 C79 176 77 148 88 126 Z" fill="#1E1B4B" stroke="#818CF8" strokeWidth="2.5" strokeOpacity={0.6}/>
|
|
39
|
+
<Path d="M182 124 C198 154 196 190 170 204 C177 176 179 148 168 126 Z" fill="#1E1B4B" stroke="#818CF8" strokeWidth="2.5" strokeOpacity={0.6}/>
|
|
102
40
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
41
|
+
{/* Belly Screen Plate */}
|
|
42
|
+
<Rect x="105" y="160" width="46" height="34" rx="8" fill="#0B0F19" stroke="url(#bs_beam)" strokeWidth="2"/>
|
|
43
|
+
{/* Code Emblem on Chest */}
|
|
44
|
+
<G stroke="#A5B4FC" strokeWidth="2.8" strokeLinecap="round" strokeLinejoin="round" fill="none">
|
|
45
|
+
<Path d="M120 171 L114 177 L120 183"/>
|
|
46
|
+
<Path d="M136 171 L142 177 L136 183"/>
|
|
47
|
+
<Path d="M130 169 L126 185" stroke="#EC4899"/>
|
|
48
|
+
</G>
|
|
107
49
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
<Path d="M111 209 L105 224 M111 209 L111 226 M111 209 L117 224"/>
|
|
111
|
-
<Path d="M145 209 L139 224 M145 209 L145 226 M145 209 L151 224"/>
|
|
112
|
-
</G>
|
|
50
|
+
{/* Facial Disc & Mask */}
|
|
51
|
+
<Path d="M128 92 C148 70 186 78 186 108 C186 134 160 152 128 152 C96 152 70 134 70 108 C70 78 108 70 128 92 Z" fill="#2E1065" stroke="#818CF8" strokeWidth="2" strokeOpacity={0.6}/>
|
|
113
52
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
53
|
+
{/* Right Eye (Normal Cute Eye) */}
|
|
54
|
+
<Circle cx="154" cy="108" r="17" fill="url(#bs_iris)" stroke="#0F172A" strokeWidth="2"/>
|
|
55
|
+
<Circle cx="154" cy="108" r="8.5" fill="#0F172A"/>
|
|
56
|
+
<Circle cx="157" cy="105" r="3" fill="#FFFFFF"/>
|
|
57
|
+
<Circle cx="151" cy="111" r="1.5" fill="#FFFFFF" opacity={0.8}/>
|
|
119
58
|
|
|
120
|
-
|
|
121
|
-
|
|
59
|
+
{/* Left Eye (Diagnostic Magnifier Lens) */}
|
|
60
|
+
<Circle cx="96" cy="104" r="20" fill="url(#bs_iris)" stroke="#0F172A" strokeWidth="2"/>
|
|
61
|
+
<Circle cx="96" cy="104" r="10" fill="#0F172A"/>
|
|
62
|
+
<Circle cx="99.5" cy="100.5" r="3.5" fill="#FFFFFF"/>
|
|
63
|
+
<Circle cx="92" cy="107" r="1.8" fill="#FFFFFF" opacity={0.8}/>
|
|
122
64
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
<Circle cx={91} cy={107} r={1.8} fill="#ffffff" opacity={0.7}/>
|
|
128
|
-
<Circle cx={95} cy={103} r={28} fill="url(#lensglassSquare)"/>
|
|
129
|
-
<Path d="M77 87 A28 28 0 0 1 106 79" fill="none" stroke="#ffffff" strokeWidth={4} strokeLinecap="round" strokeOpacity={0.5}/>
|
|
130
|
-
<Line x1={75} y1={123} x2={54} y2={147} stroke="#0A0F1C" strokeWidth={14} strokeLinecap="round"/>
|
|
131
|
-
<Line x1={75} y1={123} x2={54} y2={147} stroke="url(#beamSquare)" strokeWidth={8.5} strokeLinecap="round"/>
|
|
132
|
-
<Circle cx={95} cy={103} r={28} fill="none" stroke="url(#beamSquare)" strokeWidth={7}/>
|
|
65
|
+
{/* Magnifier Glass Ring & Handle */}
|
|
66
|
+
<Line x1="76" y1="124" x2="55" y2="148" stroke="#0F172A" strokeWidth="12" strokeLinecap="round"/>
|
|
67
|
+
<Line x1="76" y1="124" x2="55" y2="148" stroke="url(#bs_beam)" strokeWidth="7" strokeLinecap="round"/>
|
|
68
|
+
<Circle cx="96" cy="104" r="28" fill="#38BDF8" fillOpacity={0.12} stroke="url(#bs_beam)" strokeWidth="6"/>
|
|
133
69
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
<Ellipse cx={167} cy={122} rx={9} ry={6} fill="url(#blushSquare)"/>
|
|
137
|
-
</G>
|
|
70
|
+
{/* Beak */}
|
|
71
|
+
<Path d="M123.5 123 Q128 121 132.5 123 Q131 132 128 134.5 Q125 132 123.5 123 Z" fill="url(#bs_beak)"/>
|
|
138
72
|
</Svg>);
|
|
139
73
|
};
|
|
140
74
|
export default BrandSquareIcon;
|
|
@@ -10,37 +10,11 @@ import { AppFonts } from '../../styles/AppFonts';
|
|
|
10
10
|
import { METHOD_COLORS } from '../../constants';
|
|
11
11
|
import { LIB_VERSION } from '../../constants';
|
|
12
12
|
import { getStatusColor, getAppName, formatTime, getSize } from '../../helpers';
|
|
13
|
-
import { getTelemetryConsentStatus } from '../../helpers/telemetry';
|
|
14
13
|
import { UpdateAvailableModal } from './UpdateAvailableModal';
|
|
15
14
|
import { WhiteBackNavigation, TrashIcon, SettingsIcon, CloseWhite, ClockIcon, SizeIcon, AppleIcon, AndroidIcon, NpmIcon, ResetIcon, BoltIcon, } from '../NetworkIcons';
|
|
16
15
|
const InspectorHeader = React.memo(() => {
|
|
17
16
|
const { modalHeightPercent, appIcon, selected, setSelected, selectedEvent, setSelectedEvent, selectedLog, setSelectedLog, selectedReduxSlice, setSelectedReduxSlice, selectedReduxAction, setSelectedReduxAction, reduxState, reduxLastActionMap, showHeaderInfo, setShowHeaderInfo, updateAvailable, latestNpmVersion, clearAnim, activePulseAnim, unreadPulseAnim, runClearAllWithAnimation, settingsPage, setSettingsPage, resetToDefaults, closeModal, detailTitle, activeTab, environment, visible, selectedCrash, setSelectedCrash, } = useInspector();
|
|
18
17
|
const [showUpdateModal, setShowUpdateModal] = React.useState(false);
|
|
19
|
-
const [isTelemetryActive, setIsTelemetryActive] = React.useState(false);
|
|
20
|
-
const telemetryPulseAnim = React.useRef(new Animated.Value(1)).current;
|
|
21
|
-
React.useEffect(() => {
|
|
22
|
-
getTelemetryConsentStatus().then(status => {
|
|
23
|
-
setIsTelemetryActive(status === 'granted');
|
|
24
|
-
});
|
|
25
|
-
}, [visible]);
|
|
26
|
-
React.useEffect(() => {
|
|
27
|
-
if (!isTelemetryActive)
|
|
28
|
-
return;
|
|
29
|
-
const pulse = Animated.loop(Animated.sequence([
|
|
30
|
-
Animated.timing(telemetryPulseAnim, {
|
|
31
|
-
toValue: 2.2,
|
|
32
|
-
duration: 1500,
|
|
33
|
-
useNativeDriver: true,
|
|
34
|
-
}),
|
|
35
|
-
Animated.timing(telemetryPulseAnim, {
|
|
36
|
-
toValue: 1,
|
|
37
|
-
duration: 0,
|
|
38
|
-
useNativeDriver: true,
|
|
39
|
-
}),
|
|
40
|
-
]));
|
|
41
|
-
pulse.start();
|
|
42
|
-
return () => pulse.stop();
|
|
43
|
-
}, [isTelemetryActive, telemetryPulseAnim]);
|
|
44
18
|
const envConfig = useMemo(() => {
|
|
45
19
|
const rawEnv = (environment || (__DEV__ ? 'DEV' : 'PROD')).trim();
|
|
46
20
|
const clean = rawEnv.toUpperCase();
|
|
@@ -333,53 +307,6 @@ const InspectorHeader = React.memo(() => {
|
|
|
333
307
|
●
|
|
334
308
|
</Text>)}
|
|
335
309
|
</Pressable>
|
|
336
|
-
|
|
337
|
-
{isTelemetryActive && (<Pressable onPress={() => Alert.alert('Anonymous Telemetry Active', 'Anonymous diagnostics (such as React Native version, JavaScript engine, and device model) are currently enabled to help improve library tooling.\n\nNo user data or network payloads are captured. You can toggle this anytime in Settings.', [{ text: 'Got it' }])} style={{
|
|
338
|
-
flexDirection: 'row',
|
|
339
|
-
alignItems: 'center',
|
|
340
|
-
backgroundColor: 'rgba(16, 185, 129, 0.22)',
|
|
341
|
-
borderRadius: 5,
|
|
342
|
-
paddingHorizontal: 5.5,
|
|
343
|
-
paddingVertical: 2,
|
|
344
|
-
gap: 4.5,
|
|
345
|
-
borderWidth: 1,
|
|
346
|
-
borderColor: 'rgba(52, 211, 153, 0.45)',
|
|
347
|
-
flexShrink: 0,
|
|
348
|
-
}}>
|
|
349
|
-
<View style={{
|
|
350
|
-
width: 6,
|
|
351
|
-
height: 6,
|
|
352
|
-
alignItems: 'center',
|
|
353
|
-
justifyContent: 'center',
|
|
354
|
-
}}>
|
|
355
|
-
<Animated.View style={{
|
|
356
|
-
position: 'absolute',
|
|
357
|
-
width: 6,
|
|
358
|
-
height: 6,
|
|
359
|
-
borderRadius: 3,
|
|
360
|
-
backgroundColor: '#34D399',
|
|
361
|
-
opacity: telemetryPulseAnim.interpolate({
|
|
362
|
-
inputRange: [1, 2.2],
|
|
363
|
-
outputRange: [0.8, 0],
|
|
364
|
-
}),
|
|
365
|
-
transform: [{ scale: telemetryPulseAnim }],
|
|
366
|
-
}}/>
|
|
367
|
-
<View style={{
|
|
368
|
-
width: 4,
|
|
369
|
-
height: 4,
|
|
370
|
-
borderRadius: 2,
|
|
371
|
-
backgroundColor: '#10B981',
|
|
372
|
-
}}/>
|
|
373
|
-
</View>
|
|
374
|
-
<Text style={{
|
|
375
|
-
fontFamily: AppFonts.interBold,
|
|
376
|
-
fontSize: 9,
|
|
377
|
-
color: '#6EE7B7',
|
|
378
|
-
letterSpacing: 0.2,
|
|
379
|
-
}}>
|
|
380
|
-
LIVE
|
|
381
|
-
</Text>
|
|
382
|
-
</Pressable>)}
|
|
383
310
|
</View>
|
|
384
311
|
</View>
|
|
385
312
|
</View>) : null}
|
|
@@ -20,7 +20,6 @@ import CrashDetail from './CrashDetail';
|
|
|
20
20
|
import DeviceInfoTab from './DeviceInfoTab';
|
|
21
21
|
import StorageTab from './StorageTab';
|
|
22
22
|
import SettingsPanel from './SettingsPanel';
|
|
23
|
-
import TelemetryConsentModal from './TelemetryConsentModal';
|
|
24
23
|
import NpmUpdateToast from './NpmUpdateToast';
|
|
25
24
|
import Toast from '../Toast';
|
|
26
25
|
import styles from '../../styles';
|
|
@@ -176,9 +175,6 @@ const MainScreen = () => {
|
|
|
176
175
|
|
|
177
176
|
{/* NPM Version Update Toast with timeout progress bar */}
|
|
178
177
|
<NpmUpdateToast />
|
|
179
|
-
|
|
180
|
-
{/* Anonymous Telemetry Consent Dialog shown ONLY when inspector is active */}
|
|
181
|
-
<TelemetryConsentModal />
|
|
182
178
|
</View>
|
|
183
179
|
</View>
|
|
184
180
|
</ErrorBoundary>)}
|
|
@@ -17,7 +17,6 @@ import { clearPerformanceEvents } from '../../customHooks/performanceTracker';
|
|
|
17
17
|
import { isReduxConnected } from '../../customHooks/reduxLogger';
|
|
18
18
|
import { isAnalyticsConnected } from '../../customHooks/analyticsLogger';
|
|
19
19
|
import { useTranslation } from '../../i18n';
|
|
20
|
-
import { getTelemetryConsentStatus, setTelemetryConsent, sendSessionTelemetryPing, } from '../../helpers/telemetry';
|
|
21
20
|
import { SignalIcon, TerminalIcon, AnalyticsIcon, SettingsIcon, SunIcon, MoonIcon, ScreenIcon, MotionIcon, LayersIcon, EyeIcon, CheckIcon, TrashIcon, PackageIcon, ReduxIcon, PerformanceIcon, CrashIcon, ShieldAlertIcon, ForwardChevronIcon, ChevronDownIcon, NpmIcon, BoltIcon, BrainIcon, SmartphoneIcon, DatabaseIcon, } from '../NetworkIcons';
|
|
22
21
|
import { LIB_VERSION } from '../../constants';
|
|
23
22
|
import { copyToClipboard } from '../../helpers';
|
|
@@ -27,20 +26,6 @@ const SettingsPanel = () => {
|
|
|
27
26
|
const { t } = useTranslation();
|
|
28
27
|
const { settingsPage, setSettingsPage, settingsActiveSubTab, setSettingsActiveSubTab, tabVisibility, toggleTabVisibility, defaultTab, setDefaultTab, isDark, setIsDark, modalHeightPercent, setModalHeightPercent, modalAnimationType, setModalAnimationType, showDuplicateLogs, setShowDuplicateLogs, showUpdateToast, setShowUpdateToast, showConsoleLevels, setShowConsoleLevels, resetToDefaults, storage, logs, consoleLogs, analyticsEvents, reduxState, maxNetworkLogs, setMaxNetworkLogs, maxConsoleLogs, setMaxConsoleLogs, maxAnalyticsEventsLimit, setMaxAnalyticsEventsLimit, isAutoRamLimitEnabled, setIsAutoRamLimitEnabled, deviceFreeRamMb, reduxAutoRefresh, setReduxAutoRefreshState, reduxExpandDepth, setReduxExpandDepth, switchActiveTab, setSelected, setSelectedEvent, setReduxState, crashRecords, maxCrashLogs, setMaxCrashLogs, updateAvailable, latestNpmVersion, } = useInspector();
|
|
29
28
|
const [stagedHeight, setStagedHeight] = useState(modalHeightPercent);
|
|
30
|
-
const [telemetryConsent, setTelemetryConsentState] = useState(true);
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
getTelemetryConsentStatus().then(status => {
|
|
33
|
-
setTelemetryConsentState(status === 'granted');
|
|
34
|
-
});
|
|
35
|
-
}, []);
|
|
36
|
-
const handleToggleTelemetry = async () => {
|
|
37
|
-
const nextVal = !telemetryConsent;
|
|
38
|
-
setTelemetryConsentState(nextVal);
|
|
39
|
-
await setTelemetryConsent(nextVal);
|
|
40
|
-
if (nextVal) {
|
|
41
|
-
sendSessionTelemetryPing({ force: true });
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
29
|
useEffect(() => {
|
|
45
30
|
setStagedHeight(modalHeightPercent);
|
|
46
31
|
}, [modalHeightPercent]);
|
|
@@ -1197,97 +1182,7 @@ const SettingsPanel = () => {
|
|
|
1197
1182
|
</View>
|
|
1198
1183
|
</View>
|
|
1199
1184
|
|
|
1200
|
-
{/* Section 4:
|
|
1201
|
-
<View style={{
|
|
1202
|
-
backgroundColor: AppColors.primaryLight,
|
|
1203
|
-
borderRadius: 14,
|
|
1204
|
-
borderWidth: 1,
|
|
1205
|
-
borderColor: AppColors.grayBorderSecondary,
|
|
1206
|
-
overflow: 'hidden',
|
|
1207
|
-
padding: 14,
|
|
1208
|
-
gap: 12,
|
|
1209
|
-
}}>
|
|
1210
|
-
<Text style={{
|
|
1211
|
-
fontFamily: AppFonts.interBold,
|
|
1212
|
-
fontSize: 11,
|
|
1213
|
-
lineHeight: 14,
|
|
1214
|
-
color: AppColors.grayTextWeak,
|
|
1215
|
-
letterSpacing: 0.8,
|
|
1216
|
-
}}>
|
|
1217
|
-
PRIVACY & ANONYMOUS DIAGNOSTICS
|
|
1218
|
-
</Text>
|
|
1219
|
-
|
|
1220
|
-
<View style={{
|
|
1221
|
-
flexDirection: 'row',
|
|
1222
|
-
alignItems: 'center',
|
|
1223
|
-
justifyContent: 'space-between',
|
|
1224
|
-
}}>
|
|
1225
|
-
<View style={{
|
|
1226
|
-
flexDirection: 'row',
|
|
1227
|
-
alignItems: 'center',
|
|
1228
|
-
gap: 10,
|
|
1229
|
-
flex: 1,
|
|
1230
|
-
marginRight: 10,
|
|
1231
|
-
}}>
|
|
1232
|
-
<View style={{
|
|
1233
|
-
width: 32,
|
|
1234
|
-
height: 32,
|
|
1235
|
-
borderRadius: 8,
|
|
1236
|
-
backgroundColor: AppColors.purpleShade50,
|
|
1237
|
-
alignItems: 'center',
|
|
1238
|
-
justifyContent: 'center',
|
|
1239
|
-
}}>
|
|
1240
|
-
<ShieldAlertIcon color={AppColors.purple} size={15}/>
|
|
1241
|
-
</View>
|
|
1242
|
-
<View style={{ flex: 1 }}>
|
|
1243
|
-
<Text style={{
|
|
1244
|
-
fontFamily: AppFonts.interBold,
|
|
1245
|
-
fontSize: 13.5,
|
|
1246
|
-
lineHeight: 18,
|
|
1247
|
-
color: AppColors.primaryBlack,
|
|
1248
|
-
}}>
|
|
1249
|
-
Help Improve In-App Inspector
|
|
1250
|
-
</Text>
|
|
1251
|
-
<Text style={{
|
|
1252
|
-
fontFamily: AppFonts.interRegular,
|
|
1253
|
-
fontSize: 11,
|
|
1254
|
-
lineHeight: 15,
|
|
1255
|
-
color: AppColors.grayText,
|
|
1256
|
-
marginTop: 1,
|
|
1257
|
-
}}>
|
|
1258
|
-
Share non-identifiable technical metrics (RN version, JS
|
|
1259
|
-
engine, device model). No user data or network payloads
|
|
1260
|
-
are captured.
|
|
1261
|
-
</Text>
|
|
1262
|
-
</View>
|
|
1263
|
-
</View>
|
|
1264
|
-
|
|
1265
|
-
<TouchableScale accessible={true} accessibilityRole="switch" accessibilityLabel="Toggle Anonymous Telemetry" accessibilityState={{ checked: telemetryConsent }} onPress={handleToggleTelemetry} style={{
|
|
1266
|
-
width: 42,
|
|
1267
|
-
height: 24,
|
|
1268
|
-
borderRadius: 12,
|
|
1269
|
-
backgroundColor: telemetryConsent
|
|
1270
|
-
? AppColors.purple
|
|
1271
|
-
: AppColors.grayBorderSecondary,
|
|
1272
|
-
padding: 2,
|
|
1273
|
-
justifyContent: 'center',
|
|
1274
|
-
alignItems: telemetryConsent ? 'flex-end' : 'flex-start',
|
|
1275
|
-
}}>
|
|
1276
|
-
<View style={{
|
|
1277
|
-
width: 20,
|
|
1278
|
-
height: 20,
|
|
1279
|
-
borderRadius: 10,
|
|
1280
|
-
backgroundColor: AppColors.white,
|
|
1281
|
-
shadowColor: AppColors.black,
|
|
1282
|
-
shadowOpacity: 0.18,
|
|
1283
|
-
shadowRadius: 2,
|
|
1284
|
-
shadowOffset: { width: 0, height: 1 },
|
|
1285
|
-
}}/>
|
|
1286
|
-
</TouchableScale>
|
|
1287
|
-
</View>
|
|
1288
|
-
</View>
|
|
1289
|
-
|
|
1290
|
-
{/* Section 5: Notifications & Toasts */}
|
|
1185
|
+
{/* Section 4: Notifications & Toasts */}
|
|
1291
1186
|
<View style={{
|
|
1292
1187
|
backgroundColor: AppColors.primaryLight,
|
|
1293
1188
|
borderRadius: 14,
|
|
@@ -1376,7 +1271,7 @@ const SettingsPanel = () => {
|
|
|
1376
1271
|
</View>
|
|
1377
1272
|
</View>
|
|
1378
1273
|
|
|
1379
|
-
{/* Section
|
|
1274
|
+
{/* Section 5: NPM Package & Updates */}
|
|
1380
1275
|
<View style={{
|
|
1381
1276
|
backgroundColor: AppColors.primaryLight,
|
|
1382
1277
|
borderRadius: 14,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "2.2.
|
|
1
|
+
export declare const LIB_VERSION = "2.2.6";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { NetworkLog, RouteInfo, DiffResult, JsonContent, StackFrameType } from '../types';
|
|
2
2
|
export * from './searchQueryParser';
|
|
3
|
-
export * from './telemetry';
|
|
4
3
|
export * from './memoryManager';
|
|
5
4
|
export declare const getDomainColor: (domain: string) => string;
|
|
6
5
|
export declare const formatDateTime: (timestamp: number) => string;
|
|
@@ -6,7 +6,6 @@ import { AppColors } from '../styles/AppColors';
|
|
|
6
6
|
// Constants
|
|
7
7
|
import { DOMAIN_COLORS, DURATION_FAST_MS, DURATION_SLOW_MS } from '../constants';
|
|
8
8
|
export * from './searchQueryParser';
|
|
9
|
-
export * from './telemetry';
|
|
10
9
|
export * from './memoryManager';
|
|
11
10
|
export const getDomainColor = (domain) => {
|
|
12
11
|
if (!domain)
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export { getEventCategory, registerGAPlugin, type GAPlugin, } from './helpers/ga
|
|
|
13
13
|
export { usePerformanceTracker, useComponentProfiler, useNavigationProfiler, trackComponentRender, trackNavigationTransition, trackHeavyTask, measureAsync, getHermesMemoryStats, registerComponentProfile, subscribeRenderProfiles, getRenderProfiles, logPerformanceEvent, clearPerformanceEvents, subscribePerformanceEvents, getPerformanceEvents, getInitialRenderProfiles, getInitialPerformanceEvents, generateFixSnippet, } from './customHooks/performanceTracker';
|
|
14
14
|
export { InspectLog, InspectTrackTime, InspectCatch, type InspectLogOptions, } from './decorators';
|
|
15
15
|
export { getNativeDeviceMetrics, enableNativeCrashProtection, subscribeNativeCrashes, showNativeFloatingButton, hideNativeFloatingButton, setNativeFloatingButtonBadge, subscribeNativeFloatingButtonPress, subscribeNativeDeviceShake, startNativeFpsMonitoring, stopNativeFpsMonitoring, getNativeFpsMetrics, getNativeStorageItem, setNativeStorageItem, isNativeModuleAvailable, type NativeDeviceMetrics, type NativeCrashEvent, type FloatingButtonOptions, type NativeFpsMetrics, } from './native/NativeInspector';
|
|
16
|
-
export {
|
|
16
|
+
export { setupMemoryWarningHandler, pruneAllLogs, subscribeMemoryWarning, type MemoryPruneSummary, } from './helpers';
|
|
17
17
|
export { setMaxNetworkLogsLimit, getMaxNetworkLogsLimit, pruneNetworkLogs, } from './customHooks/networkLogger';
|
|
18
18
|
export { setMaxConsoleLogsLimit, getMaxConsoleLogsLimit, pruneConsoleLogs, } from './customHooks/consoleLogger';
|
|
19
19
|
export { setMaxReduxHistoryLimit, getMaxReduxHistoryLimit, pruneReduxHistory, } from './customHooks/reduxLogger';
|
package/dist/esm/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import ErrorBoundary from './components/ErrorBoundary';
|
|
|
8
8
|
import MainScreen from './components/Inspector/MainScreen';
|
|
9
9
|
import { InspectorContext, animateNextLayout, } from './components/Inspector/InspectorContext';
|
|
10
10
|
// Helpers
|
|
11
|
-
import { formatDisplayUrl, getNavigationInfo, deduplicateLogs, getDomainColor, getEventCategory, matchNetworkLogQuery,
|
|
11
|
+
import { formatDisplayUrl, getNavigationInfo, deduplicateLogs, getDomainColor, getEventCategory, matchNetworkLogQuery, setupMemoryWarningHandler, } from './helpers';
|
|
12
12
|
// #5 — settings persistence
|
|
13
13
|
import { loadSettings, saveSettings, setCustomStorage, clearPersistedSettings, calculateRamBasedLimits, } from './helpers/settingsStore';
|
|
14
14
|
import { getNativeSystemMetrics, pushNativeLogRecord, fetchNativeCachedPage, } from './native/NativeInspector';
|
|
@@ -717,14 +717,6 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
717
717
|
}, [unreadPulseAnim]);
|
|
718
718
|
const isNativeModule = useMemo(() => isNativeModuleAvailable(), []);
|
|
719
719
|
const useNativeFab = (Platform.OS === 'ios' || Platform.OS === 'android') && isNativeModule;
|
|
720
|
-
// Send anonymous initialization heartbeat to GA4 Measurement Protocol
|
|
721
|
-
useEffect(() => {
|
|
722
|
-
sendSessionTelemetryPing({
|
|
723
|
-
environment,
|
|
724
|
-
hasNavigation: Boolean(navigationRef),
|
|
725
|
-
hasAppIcon: Boolean(appIcon),
|
|
726
|
-
});
|
|
727
|
-
}, [environment, navigationRef, appIcon]);
|
|
728
720
|
// 100% Native Main-Thread Floating Button Lifecycle
|
|
729
721
|
useEffect(() => {
|
|
730
722
|
if (!useNativeFab || !isEnabled || !enabled) {
|
|
@@ -779,8 +771,6 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
779
771
|
? defaultTab
|
|
780
772
|
: 'apis';
|
|
781
773
|
setActiveTab(target);
|
|
782
|
-
// Track inspector opened event in GA4
|
|
783
|
-
trackInspectorOpen({ activeTab: target });
|
|
784
774
|
// Instant synchronization of data collected while modal was closed
|
|
785
775
|
if (latestNetworkLogsRef.current.length > 0) {
|
|
786
776
|
const deduped = deduplicateLogs(latestNetworkLogsRef.current);
|
|
@@ -1824,7 +1814,7 @@ export { getEventCategory, registerGAPlugin, } from './helpers/gaAnalyticsRegist
|
|
|
1824
1814
|
export { usePerformanceTracker, useComponentProfiler, useNavigationProfiler, trackComponentRender, trackNavigationTransition, trackHeavyTask, measureAsync, getHermesMemoryStats, registerComponentProfile, subscribeRenderProfiles, getRenderProfiles, logPerformanceEvent, clearPerformanceEvents, subscribePerformanceEvents, getPerformanceEvents, getInitialRenderProfiles, getInitialPerformanceEvents, generateFixSnippet, } from './customHooks/performanceTracker';
|
|
1825
1815
|
export { InspectLog, InspectTrackTime, InspectCatch, } from './decorators';
|
|
1826
1816
|
export { getNativeDeviceMetrics, enableNativeCrashProtection, subscribeNativeCrashes, showNativeFloatingButton, hideNativeFloatingButton, setNativeFloatingButtonBadge, subscribeNativeFloatingButtonPress, subscribeNativeDeviceShake, startNativeFpsMonitoring, stopNativeFpsMonitoring, getNativeFpsMetrics, getNativeStorageItem, setNativeStorageItem, isNativeModuleAvailable, } from './native/NativeInspector';
|
|
1827
|
-
export {
|
|
1817
|
+
export { setupMemoryWarningHandler, pruneAllLogs, subscribeMemoryWarning, } from './helpers';
|
|
1828
1818
|
export { setMaxNetworkLogsLimit, getMaxNetworkLogsLimit, pruneNetworkLogs, } from './customHooks/networkLogger';
|
|
1829
1819
|
export { setMaxConsoleLogsLimit, getMaxConsoleLogsLimit, pruneConsoleLogs, } from './customHooks/consoleLogger';
|
|
1830
1820
|
export { setMaxReduxHistoryLimit, getMaxReduxHistoryLimit, pruneReduxHistory, } from './customHooks/reduxLogger';
|