react-native-inapp-inspector 1.0.3 → 1.0.5
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 +3 -3
- package/dist/commonjs/components/AnalyticsEventCard.js +10 -10
- package/dist/commonjs/components/CodeSnippet.js +233 -10
- package/dist/commonjs/components/ConsoleLogCard.js +55 -9
- package/dist/commonjs/components/CopyButton.js +2 -1
- package/dist/commonjs/components/ErrorBoundary.d.ts +20 -0
- package/dist/commonjs/components/ErrorBoundary.js +332 -0
- package/dist/commonjs/components/NetworkIcons.d.ts +5 -0
- package/dist/commonjs/components/NetworkIcons.js +45 -1
- package/dist/commonjs/customHooks/reduxLogger.d.ts +4 -0
- package/dist/commonjs/customHooks/reduxLogger.js +30 -0
- package/dist/commonjs/customHooks/webViewLogger.d.ts +2 -0
- package/dist/commonjs/customHooks/webViewLogger.js +281 -246
- package/dist/commonjs/helpers/index.js +2 -1
- package/dist/commonjs/index.d.ts +5 -3
- package/dist/commonjs/index.js +685 -911
- package/dist/commonjs/styles/AppColors.d.ts +29 -1
- package/dist/commonjs/styles/AppColors.js +38 -2
- package/dist/commonjs/styles/index.d.ts +438 -229
- package/dist/commonjs/styles/index.js +448 -209
- package/dist/commonjs/types/index.d.ts +2 -2
- package/dist/esm/components/AnalyticsEventCard.js +10 -10
- package/dist/esm/components/CodeSnippet.js +232 -12
- package/dist/esm/components/ConsoleLogCard.js +55 -9
- package/dist/esm/components/CopyButton.js +2 -1
- package/dist/esm/components/ErrorBoundary.d.ts +20 -0
- package/dist/esm/components/ErrorBoundary.js +295 -0
- package/dist/esm/components/NetworkIcons.d.ts +5 -0
- package/dist/esm/components/NetworkIcons.js +39 -0
- package/dist/esm/customHooks/reduxLogger.d.ts +4 -0
- package/dist/esm/customHooks/reduxLogger.js +23 -0
- package/dist/esm/customHooks/webViewLogger.d.ts +2 -0
- package/dist/esm/customHooks/webViewLogger.js +281 -246
- package/dist/esm/helpers/index.js +2 -1
- package/dist/esm/index.d.ts +5 -3
- package/dist/esm/index.js +683 -914
- package/dist/esm/styles/AppColors.d.ts +29 -1
- package/dist/esm/styles/AppColors.js +35 -1
- package/dist/esm/styles/index.d.ts +438 -229
- package/dist/esm/styles/index.js +412 -209
- package/dist/esm/types/index.d.ts +2 -2
- package/example/App.tsx +351 -127
- package/example/ios/Podfile.lock +26 -0
- package/example/metro.config.js +1 -1
- package/example/package-lock.json +20 -4
- package/example/package.json +4 -3
- package/package.json +1 -1
|
@@ -0,0 +1,332 @@
|
|
|
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.ErrorBoundary = void 0;
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
const react_native_1 = require("react-native");
|
|
39
|
+
const AppColors_1 = require("../styles/AppColors");
|
|
40
|
+
const AppFonts_1 = require("../styles/AppFonts");
|
|
41
|
+
const helpers_1 = require("../helpers");
|
|
42
|
+
function parseStackTrace(stack) {
|
|
43
|
+
if (!stack)
|
|
44
|
+
return null;
|
|
45
|
+
const lines = stack.split('\n');
|
|
46
|
+
for (const line of lines) {
|
|
47
|
+
if (line.includes('ErrorBoundary') ||
|
|
48
|
+
line.includes('getDerivedStateFromError') ||
|
|
49
|
+
line.includes('componentDidCatch')) {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
// Matching ios format: method@url:line:col
|
|
53
|
+
const iosMatch = line.match(/^([^@]+)@(.*):(\d+):(\d+)$/);
|
|
54
|
+
if (iosMatch) {
|
|
55
|
+
const [, method, file, lineNum, colNum] = iosMatch;
|
|
56
|
+
const cleanFile = file.split('?')[0].split('/').pop() || file;
|
|
57
|
+
return { method: method.trim(), file: cleanFile, line: lineNum, column: colNum };
|
|
58
|
+
}
|
|
59
|
+
// Matching android format: at method (url:line:col) or at url:line:col
|
|
60
|
+
const androidMatch = line.match(/^\s*at\s+(.+)\s+\((.+):(\d+):(\d+)\)$/);
|
|
61
|
+
if (androidMatch) {
|
|
62
|
+
const [, method, file, lineNum, colNum] = androidMatch;
|
|
63
|
+
const cleanFile = file.split('?')[0].split('/').pop() || file;
|
|
64
|
+
return { method: method.trim(), file: cleanFile, line: lineNum, column: colNum };
|
|
65
|
+
}
|
|
66
|
+
const androidMatchSimple = line.match(/^\s*at\s+(.+):(\d+):(\d+)$/);
|
|
67
|
+
if (androidMatchSimple) {
|
|
68
|
+
const [, file, lineNum, colNum] = androidMatchSimple;
|
|
69
|
+
const cleanFile = file.split('?')[0].split('/').pop() || file;
|
|
70
|
+
return { method: 'anonymous', file: cleanFile, line: lineNum, column: colNum };
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
class ErrorBoundary extends react_1.Component {
|
|
76
|
+
constructor() {
|
|
77
|
+
super(...arguments);
|
|
78
|
+
this.state = {
|
|
79
|
+
hasError: false,
|
|
80
|
+
error: null,
|
|
81
|
+
};
|
|
82
|
+
this.handleReset = () => {
|
|
83
|
+
this.setState({ hasError: false, error: null });
|
|
84
|
+
if (this.props.onReset) {
|
|
85
|
+
this.props.onReset();
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
this.handleCopyTrace = () => {
|
|
89
|
+
const error = this.state.error;
|
|
90
|
+
if (error) {
|
|
91
|
+
const isNativeCrash = error.message.includes('Native') || error.message.includes('native') || error.message.includes('Swift') || error.message.includes('Java');
|
|
92
|
+
const parsed = error.stack ? parseStackTrace(error.stack) : null;
|
|
93
|
+
const detailStr = `Crash Source: ${isNativeCrash ? 'Native Crash' : 'JavaScript Crash'}
|
|
94
|
+
Message: ${error.message}
|
|
95
|
+
${parsed ? `Method: ${parsed.method}\nFile: ${parsed.file}\nLine: ${parsed.line}:${parsed.column}` : ''}
|
|
96
|
+
Stack Trace:
|
|
97
|
+
${error.stack}`;
|
|
98
|
+
(0, helpers_1.copyToClipboard)(detailStr, 'Crash traceback');
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
static getDerivedStateFromError(error) {
|
|
103
|
+
return { hasError: true, error };
|
|
104
|
+
}
|
|
105
|
+
componentDidCatch(error, errorInfo) {
|
|
106
|
+
console.error('InAppInspector ErrorBoundary caught a crash:', error, errorInfo);
|
|
107
|
+
}
|
|
108
|
+
render() {
|
|
109
|
+
if (this.state.hasError) {
|
|
110
|
+
const isInline = this.props.fallbackType === 'inline';
|
|
111
|
+
if (isInline) {
|
|
112
|
+
return (<react_native_1.View style={styles.inlineContainer}>
|
|
113
|
+
<react_native_1.Text style={styles.inlineTitle}>⚠️ Inspector Crash</react_native_1.Text>
|
|
114
|
+
<react_native_1.TouchableOpacity style={styles.inlineResetBtn} onPress={this.handleReset}>
|
|
115
|
+
<react_native_1.Text style={styles.inlineResetText}>Reload</react_native_1.Text>
|
|
116
|
+
</react_native_1.TouchableOpacity>
|
|
117
|
+
</react_native_1.View>);
|
|
118
|
+
}
|
|
119
|
+
const error = this.state.error;
|
|
120
|
+
const isNativeCrash = error ? (error.message.includes('Native') || error.message.includes('native') || error.message.includes('Swift') || error.message.includes('Java')) : false;
|
|
121
|
+
const parsed = error && error.stack ? parseStackTrace(error.stack) : null;
|
|
122
|
+
return (<react_native_1.View style={styles.container}>
|
|
123
|
+
<react_native_1.View style={styles.card}>
|
|
124
|
+
<react_native_1.Text style={styles.emoji}>⚠️</react_native_1.Text>
|
|
125
|
+
<react_native_1.Text style={styles.title}>Something went wrong</react_native_1.Text>
|
|
126
|
+
|
|
127
|
+
<react_native_1.View style={{
|
|
128
|
+
flexDirection: 'row',
|
|
129
|
+
alignItems: 'center',
|
|
130
|
+
backgroundColor: isNativeCrash ? 'rgba(239, 68, 68, 0.1)' : 'rgba(245, 158, 11, 0.1)',
|
|
131
|
+
paddingHorizontal: 10,
|
|
132
|
+
paddingVertical: 4,
|
|
133
|
+
borderRadius: 20,
|
|
134
|
+
marginBottom: 12,
|
|
135
|
+
gap: 4
|
|
136
|
+
}}>
|
|
137
|
+
<react_native_1.Text style={{
|
|
138
|
+
fontSize: 10,
|
|
139
|
+
fontWeight: 'bold',
|
|
140
|
+
color: isNativeCrash ? '#EF4444' : '#F59E0B',
|
|
141
|
+
fontFamily: AppFonts_1.AppFonts.interBold || 'System'
|
|
142
|
+
}}>
|
|
143
|
+
{isNativeCrash ? '🔴 NATIVE CRASH' : '🟡 JAVASCRIPT CRASH'}
|
|
144
|
+
</react_native_1.Text>
|
|
145
|
+
</react_native_1.View>
|
|
146
|
+
|
|
147
|
+
<react_native_1.Text style={styles.subtitle}>
|
|
148
|
+
The In-App Inspector or active view encountered an error. Traceback details are parsed below:
|
|
149
|
+
</react_native_1.Text>
|
|
150
|
+
|
|
151
|
+
{parsed && (<react_native_1.View style={{
|
|
152
|
+
backgroundColor: '#F1F5F9',
|
|
153
|
+
borderRadius: 8,
|
|
154
|
+
padding: 10,
|
|
155
|
+
width: '100%',
|
|
156
|
+
marginBottom: 10,
|
|
157
|
+
borderWidth: 1,
|
|
158
|
+
borderColor: '#E2E8F0',
|
|
159
|
+
gap: 4
|
|
160
|
+
}}>
|
|
161
|
+
<react_native_1.Text style={{ fontSize: 11, color: '#475569', fontFamily: AppFonts_1.AppFonts.interMedium }} numberOfLines={1}>
|
|
162
|
+
<react_native_1.Text style={{ fontWeight: 'bold' }}>Method:</react_native_1.Text> {parsed.method}
|
|
163
|
+
</react_native_1.Text>
|
|
164
|
+
<react_native_1.Text style={{ fontSize: 11, color: '#475569', fontFamily: AppFonts_1.AppFonts.interMedium }} numberOfLines={1}>
|
|
165
|
+
<react_native_1.Text style={{ fontWeight: 'bold' }}>File:</react_native_1.Text> {parsed.file}
|
|
166
|
+
</react_native_1.Text>
|
|
167
|
+
<react_native_1.Text style={{ fontSize: 11, color: '#475569', fontFamily: AppFonts_1.AppFonts.interMedium }}>
|
|
168
|
+
<react_native_1.Text style={{ fontWeight: 'bold' }}>Line:</react_native_1.Text> {parsed.line} <react_native_1.Text style={{ fontWeight: 'bold' }}>Col:</react_native_1.Text> {parsed.column}
|
|
169
|
+
</react_native_1.Text>
|
|
170
|
+
</react_native_1.View>)}
|
|
171
|
+
|
|
172
|
+
{error && (<react_native_1.ScrollView style={styles.scroll} contentContainerStyle={styles.scrollContent}>
|
|
173
|
+
<react_native_1.Text style={styles.code}>
|
|
174
|
+
{error.message}
|
|
175
|
+
{'\n\n'}
|
|
176
|
+
{error.stack}
|
|
177
|
+
</react_native_1.Text>
|
|
178
|
+
</react_native_1.ScrollView>)}
|
|
179
|
+
|
|
180
|
+
<react_native_1.View style={{ width: '100%', gap: 8, marginBottom: 12 }}>
|
|
181
|
+
<react_native_1.TouchableOpacity style={{
|
|
182
|
+
backgroundColor: '#0F172A',
|
|
183
|
+
height: 38,
|
|
184
|
+
borderRadius: 8,
|
|
185
|
+
justifyContent: 'center',
|
|
186
|
+
alignItems: 'center',
|
|
187
|
+
flexDirection: 'row',
|
|
188
|
+
gap: 6
|
|
189
|
+
}} onPress={this.handleCopyTrace}>
|
|
190
|
+
<react_native_1.Text style={{ color: '#FFFFFF', fontSize: 12, fontWeight: 'bold', fontFamily: AppFonts_1.AppFonts.interBold || 'System' }}>
|
|
191
|
+
📋 Copy Crash Traceback
|
|
192
|
+
</react_native_1.Text>
|
|
193
|
+
</react_native_1.TouchableOpacity>
|
|
194
|
+
</react_native_1.View>
|
|
195
|
+
|
|
196
|
+
<react_native_1.View style={styles.btnRow}>
|
|
197
|
+
<react_native_1.TouchableOpacity style={styles.resetBtn} onPress={this.handleReset}>
|
|
198
|
+
<react_native_1.Text style={styles.resetBtnText}>Retry / Reload</react_native_1.Text>
|
|
199
|
+
</react_native_1.TouchableOpacity>
|
|
200
|
+
|
|
201
|
+
{this.props.onClose && (<react_native_1.TouchableOpacity style={styles.closeBtn} onPress={this.props.onClose}>
|
|
202
|
+
<react_native_1.Text style={styles.closeBtnText}>Close Inspector</react_native_1.Text>
|
|
203
|
+
</react_native_1.TouchableOpacity>)}
|
|
204
|
+
</react_native_1.View>
|
|
205
|
+
</react_native_1.View>
|
|
206
|
+
</react_native_1.View>);
|
|
207
|
+
}
|
|
208
|
+
return this.props.children;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
exports.ErrorBoundary = ErrorBoundary;
|
|
212
|
+
const monoFont = react_native_1.Platform.OS === 'ios' ? 'Menlo' : 'monospace';
|
|
213
|
+
const styles = react_native_1.StyleSheet.create({
|
|
214
|
+
container: {
|
|
215
|
+
flex: 1,
|
|
216
|
+
backgroundColor: 'rgba(0,0,0,0.3)',
|
|
217
|
+
justifyContent: 'center',
|
|
218
|
+
alignItems: 'center',
|
|
219
|
+
padding: 16,
|
|
220
|
+
},
|
|
221
|
+
card: {
|
|
222
|
+
width: '100%',
|
|
223
|
+
maxWidth: 400,
|
|
224
|
+
backgroundColor: '#FFFFFF',
|
|
225
|
+
borderRadius: 16,
|
|
226
|
+
padding: 20,
|
|
227
|
+
alignItems: 'center',
|
|
228
|
+
shadowColor: '#000000',
|
|
229
|
+
shadowOffset: { width: 0, height: 4 },
|
|
230
|
+
shadowOpacity: 0.1,
|
|
231
|
+
shadowRadius: 12,
|
|
232
|
+
elevation: 8,
|
|
233
|
+
},
|
|
234
|
+
emoji: {
|
|
235
|
+
fontSize: 40,
|
|
236
|
+
marginBottom: 12,
|
|
237
|
+
},
|
|
238
|
+
title: {
|
|
239
|
+
fontFamily: AppFonts_1.AppFonts.interBold || 'System',
|
|
240
|
+
fontSize: 18,
|
|
241
|
+
color: '#0F172A',
|
|
242
|
+
marginBottom: 8,
|
|
243
|
+
textAlign: 'center',
|
|
244
|
+
},
|
|
245
|
+
subtitle: {
|
|
246
|
+
fontFamily: AppFonts_1.AppFonts.interRegular || 'System',
|
|
247
|
+
fontSize: 12,
|
|
248
|
+
color: '#64748B',
|
|
249
|
+
lineHeight: 18,
|
|
250
|
+
textAlign: 'center',
|
|
251
|
+
marginBottom: 16,
|
|
252
|
+
},
|
|
253
|
+
scroll: {
|
|
254
|
+
width: '100%',
|
|
255
|
+
maxHeight: 180,
|
|
256
|
+
backgroundColor: '#F8FAFC',
|
|
257
|
+
borderRadius: 8,
|
|
258
|
+
borderWidth: 1,
|
|
259
|
+
borderColor: '#E2E8F0',
|
|
260
|
+
padding: 10,
|
|
261
|
+
marginBottom: 20,
|
|
262
|
+
},
|
|
263
|
+
scrollContent: {
|
|
264
|
+
paddingBottom: 10,
|
|
265
|
+
},
|
|
266
|
+
code: {
|
|
267
|
+
fontFamily: monoFont,
|
|
268
|
+
fontSize: 11,
|
|
269
|
+
color: '#E11D48',
|
|
270
|
+
},
|
|
271
|
+
btnRow: {
|
|
272
|
+
flexDirection: 'row',
|
|
273
|
+
gap: 12,
|
|
274
|
+
width: '100%',
|
|
275
|
+
},
|
|
276
|
+
resetBtn: {
|
|
277
|
+
flex: 1,
|
|
278
|
+
backgroundColor: AppColors_1.AppColors.purple || '#684B9B',
|
|
279
|
+
height: 40,
|
|
280
|
+
borderRadius: 8,
|
|
281
|
+
justifyContent: 'center',
|
|
282
|
+
alignItems: 'center',
|
|
283
|
+
},
|
|
284
|
+
resetBtnText: {
|
|
285
|
+
fontFamily: AppFonts_1.AppFonts.interBold || 'System',
|
|
286
|
+
fontSize: 13,
|
|
287
|
+
color: '#FFFFFF',
|
|
288
|
+
},
|
|
289
|
+
closeBtn: {
|
|
290
|
+
flex: 1,
|
|
291
|
+
backgroundColor: '#F1F5F9',
|
|
292
|
+
borderWidth: 1,
|
|
293
|
+
borderColor: '#E2E8F0',
|
|
294
|
+
height: 40,
|
|
295
|
+
borderRadius: 8,
|
|
296
|
+
justifyContent: 'center',
|
|
297
|
+
alignItems: 'center',
|
|
298
|
+
},
|
|
299
|
+
closeBtnText: {
|
|
300
|
+
fontFamily: AppFonts_1.AppFonts.interBold || 'System',
|
|
301
|
+
fontSize: 13,
|
|
302
|
+
color: '#475569',
|
|
303
|
+
},
|
|
304
|
+
inlineContainer: {
|
|
305
|
+
padding: 8,
|
|
306
|
+
backgroundColor: '#FFE4E6',
|
|
307
|
+
borderWidth: 1,
|
|
308
|
+
borderColor: '#FCA5A5',
|
|
309
|
+
borderRadius: 8,
|
|
310
|
+
flexDirection: 'row',
|
|
311
|
+
alignItems: 'center',
|
|
312
|
+
justifyContent: 'space-between',
|
|
313
|
+
margin: 8,
|
|
314
|
+
},
|
|
315
|
+
inlineTitle: {
|
|
316
|
+
fontFamily: AppFonts_1.AppFonts.interBold || 'System',
|
|
317
|
+
fontSize: 11,
|
|
318
|
+
color: '#991B1B',
|
|
319
|
+
},
|
|
320
|
+
inlineResetBtn: {
|
|
321
|
+
backgroundColor: '#991B1B',
|
|
322
|
+
paddingHorizontal: 10,
|
|
323
|
+
paddingVertical: 4,
|
|
324
|
+
borderRadius: 4,
|
|
325
|
+
},
|
|
326
|
+
inlineResetText: {
|
|
327
|
+
fontFamily: AppFonts_1.AppFonts.interBold || 'System',
|
|
328
|
+
fontSize: 10,
|
|
329
|
+
color: '#FFFFFF',
|
|
330
|
+
},
|
|
331
|
+
});
|
|
332
|
+
exports.default = ErrorBoundary;
|
|
@@ -29,3 +29,8 @@ export declare const FilterIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
|
29
29
|
export declare const DownloadIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
30
30
|
export declare const CloseWhite: ({ color, size }: any) => React.JSX.Element;
|
|
31
31
|
export declare const WhiteBackNavigation: ({ color, size }: any) => React.JSX.Element;
|
|
32
|
+
export declare const AnalyticsIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
33
|
+
export declare const InsightsIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
34
|
+
export declare const DebugIcon: ({ color, size }: any) => React.JSX.Element;
|
|
35
|
+
export declare const SunIcon: ({ color, size }: any) => React.JSX.Element;
|
|
36
|
+
export declare const MoonIcon: ({ color, size }: any) => React.JSX.Element;
|
|
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
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.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;
|
|
39
|
+
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.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
|
const react_1 = __importDefault(require("react"));
|
|
41
41
|
const react_native_svg_1 = __importStar(require("react-native-svg"));
|
|
42
42
|
// Stylesheet
|
|
@@ -243,3 +243,47 @@ const WhiteBackNavigation = ({ color = '#FFFFFF', size = 20 }) => {
|
|
|
243
243
|
</react_native_svg_1.default>);
|
|
244
244
|
};
|
|
245
245
|
exports.WhiteBackNavigation = WhiteBackNavigation;
|
|
246
|
+
const AnalyticsIcon = ({ color = AppColors_1.AppColors.grayTextWeak, size = 14, }) => {
|
|
247
|
+
return (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
248
|
+
<react_native_svg_1.Path d="M18 20V10M12 20V4M6 20v-6" stroke={color} strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"/>
|
|
249
|
+
</react_native_svg_1.default>);
|
|
250
|
+
};
|
|
251
|
+
exports.AnalyticsIcon = AnalyticsIcon;
|
|
252
|
+
const InsightsIcon = ({ color = AppColors_1.AppColors.grayTextWeak, size = 14, }) => {
|
|
253
|
+
return (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
254
|
+
<react_native_svg_1.Path d="M2 17l6-6 4 4 10-10M22 12V7h-5" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
255
|
+
</react_native_svg_1.default>);
|
|
256
|
+
};
|
|
257
|
+
exports.InsightsIcon = InsightsIcon;
|
|
258
|
+
const DebugIcon = ({ color = '#FFFFFF', size = 18 }) => {
|
|
259
|
+
return (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
260
|
+
{/* Hammer: diagonal from bottom-left to top-right */}
|
|
261
|
+
{/* Handle */}
|
|
262
|
+
<react_native_svg_1.Path d="M6 18l8-8" stroke={color} strokeWidth="2.5" strokeLinecap="round"/>
|
|
263
|
+
{/* Head */}
|
|
264
|
+
<react_native_svg_1.Path d="M13.5 10.5l2-2 1.5 1.5-2 2-1.5-1.5z" fill={color}/>
|
|
265
|
+
<react_native_svg_1.Path d="M15.5 8.5L19 5c.5-.5 1.2-.5 1.7 0s.5 1.2 0 1.7L17.2 10.2" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
266
|
+
|
|
267
|
+
{/* Screwdriver: diagonal from bottom-right to top-left */}
|
|
268
|
+
{/* Handle */}
|
|
269
|
+
<react_native_svg_1.Path d="M15 15l4 4" stroke={color} strokeWidth="3.5" strokeLinecap="round"/>
|
|
270
|
+
{/* Shaft */}
|
|
271
|
+
<react_native_svg_1.Path d="M15 15L8.5 8.5" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
272
|
+
{/* Flat tip */}
|
|
273
|
+
<react_native_svg_1.Path d="M9 9L5 5M4.5 6.5l2-2" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
274
|
+
</react_native_svg_1.default>);
|
|
275
|
+
};
|
|
276
|
+
exports.DebugIcon = DebugIcon;
|
|
277
|
+
const SunIcon = ({ color = '#FFFFFF', size = 16 }) => {
|
|
278
|
+
return (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
279
|
+
<react_native_svg_1.Circle cx="12" cy="12" r="5" stroke={color} strokeWidth="2"/>
|
|
280
|
+
<react_native_svg_1.Path d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
281
|
+
</react_native_svg_1.default>);
|
|
282
|
+
};
|
|
283
|
+
exports.SunIcon = SunIcon;
|
|
284
|
+
const MoonIcon = ({ color = '#FFFFFF', size = 16 }) => {
|
|
285
|
+
return (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
286
|
+
<react_native_svg_1.Path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" fill={color} stroke={color} strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
|
|
287
|
+
</react_native_svg_1.default>);
|
|
288
|
+
};
|
|
289
|
+
exports.MoonIcon = MoonIcon;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.connectReduxStore = exports.subscribeReduxState = exports.setReduxState = exports.getReduxState = void 0;
|
|
4
|
+
let currentReduxState = null;
|
|
5
|
+
const listeners = new Set();
|
|
6
|
+
const getReduxState = () => currentReduxState;
|
|
7
|
+
exports.getReduxState = getReduxState;
|
|
8
|
+
const setReduxState = (state) => {
|
|
9
|
+
currentReduxState = state;
|
|
10
|
+
listeners.forEach(cb => cb());
|
|
11
|
+
};
|
|
12
|
+
exports.setReduxState = setReduxState;
|
|
13
|
+
const subscribeReduxState = (cb) => {
|
|
14
|
+
listeners.add(cb);
|
|
15
|
+
return () => {
|
|
16
|
+
listeners.delete(cb);
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
exports.subscribeReduxState = subscribeReduxState;
|
|
20
|
+
const connectReduxStore = (store) => {
|
|
21
|
+
if (!store || typeof store.getState !== 'function' || typeof store.subscribe !== 'function') {
|
|
22
|
+
console.warn('[NetworkInspector] Invalid Redux store passed to connectReduxStore.');
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
(0, exports.setReduxState)(store.getState());
|
|
26
|
+
store.subscribe(() => {
|
|
27
|
+
(0, exports.setReduxState)(store.getState());
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
exports.connectReduxStore = connectReduxStore;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
export interface WebViewLog {
|
|
2
3
|
id: number;
|
|
3
4
|
type: 'log' | 'info' | 'warn' | 'error';
|
|
@@ -9,6 +10,7 @@ export interface WebViewNavState {
|
|
|
9
10
|
title?: string;
|
|
10
11
|
timestamp: number;
|
|
11
12
|
}
|
|
13
|
+
export declare const WebView: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
|
|
12
14
|
export declare const addWebViewLog: (type: "log" | "info" | "warn" | "error", message: string) => void;
|
|
13
15
|
export declare const addWebViewNav: (url: string, title?: string) => void;
|
|
14
16
|
export declare const addWebViewHtml: (url: string, html: string, css?: string, js?: string) => void;
|