react-native-inapp-inspector 2.0.1 → 2.0.3
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 +10 -0
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +23 -0
- package/dist/commonjs/components/AppHeaderLogo.js +21 -2
- package/dist/commonjs/components/Inspector/InspectorHeader.js +84 -11
- package/dist/commonjs/components/Inspector/MainScreen.js +8 -0
- package/dist/commonjs/components/Inspector/NpmUpdateToast.d.ts +3 -0
- package/dist/commonjs/components/Inspector/NpmUpdateToast.js +288 -0
- package/dist/commonjs/components/Inspector/SettingsPanel.js +192 -1
- package/dist/commonjs/components/Inspector/TelemetryConsentModal.d.ts +3 -0
- package/dist/commonjs/components/Inspector/TelemetryConsentModal.js +359 -0
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/helpers/index.d.ts +1 -0
- package/dist/commonjs/helpers/index.js +1 -0
- package/dist/commonjs/helpers/telemetry.d.ts +99 -0
- package/dist/commonjs/helpers/telemetry.js +398 -0
- package/dist/commonjs/index.d.ts +2 -0
- package/dist/commonjs/index.js +37 -3
- package/dist/commonjs/native/NativeInspector.d.ts +5 -0
- package/dist/commonjs/native/NativeInspector.js +3 -2
- package/dist/commonjs/types/interfaces.d.ts +5 -0
- package/dist/esm/components/AppHeaderLogo.js +21 -2
- package/dist/esm/components/Inspector/InspectorHeader.js +85 -12
- package/dist/esm/components/Inspector/MainScreen.js +8 -0
- package/dist/esm/components/Inspector/NpmUpdateToast.d.ts +3 -0
- package/dist/esm/components/Inspector/NpmUpdateToast.js +251 -0
- package/dist/esm/components/Inspector/SettingsPanel.js +192 -1
- package/dist/esm/components/Inspector/TelemetryConsentModal.d.ts +3 -0
- package/dist/esm/components/Inspector/TelemetryConsentModal.js +322 -0
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/index.js +1 -0
- package/dist/esm/helpers/telemetry.d.ts +99 -0
- package/dist/esm/helpers/telemetry.js +380 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +27 -3
- package/dist/esm/native/NativeInspector.d.ts +5 -0
- package/dist/esm/native/NativeInspector.js +3 -2
- package/dist/esm/types/interfaces.d.ts +5 -0
- package/ios/{NetworkInspectorModule.m → NetworkInspectorModule.mm} +175 -119
- package/package.json +2 -2
|
@@ -55,11 +55,26 @@ const performanceTracker_1 = require("../../customHooks/performanceTracker");
|
|
|
55
55
|
const reduxLogger_1 = require("../../customHooks/reduxLogger");
|
|
56
56
|
const analyticsLogger_2 = require("../../customHooks/analyticsLogger");
|
|
57
57
|
const i18n_1 = require("../../i18n");
|
|
58
|
+
const telemetry_1 = require("../../helpers/telemetry");
|
|
58
59
|
const NetworkIcons_1 = require("../NetworkIcons");
|
|
59
60
|
const SettingsPanel = () => {
|
|
60
61
|
const { t } = (0, i18n_1.useTranslation)();
|
|
61
|
-
const { settingsPage, setSettingsPage, settingsActiveSubTab, setSettingsActiveSubTab, tabVisibility, toggleTabVisibility, defaultTab, setDefaultTab, isDark, setIsDark, modalHeightPercent, setModalHeightPercent, modalAnimationType, setModalAnimationType, showDuplicateLogs, setShowDuplicateLogs, 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, } = (0, InspectorContext_1.useInspector)();
|
|
62
|
+
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, } = (0, InspectorContext_1.useInspector)();
|
|
62
63
|
const [stagedHeight, setStagedHeight] = (0, react_1.useState)(modalHeightPercent);
|
|
64
|
+
const [telemetryConsent, setTelemetryConsentState] = (0, react_1.useState)(true);
|
|
65
|
+
(0, react_1.useEffect)(() => {
|
|
66
|
+
(0, telemetry_1.getTelemetryConsentStatus)().then(status => {
|
|
67
|
+
setTelemetryConsentState(status === 'granted');
|
|
68
|
+
});
|
|
69
|
+
}, []);
|
|
70
|
+
const handleToggleTelemetry = async () => {
|
|
71
|
+
const nextVal = !telemetryConsent;
|
|
72
|
+
setTelemetryConsentState(nextVal);
|
|
73
|
+
await (0, telemetry_1.setTelemetryConsent)(nextVal);
|
|
74
|
+
if (nextVal) {
|
|
75
|
+
(0, telemetry_1.sendSessionTelemetryPing)({ force: true });
|
|
76
|
+
}
|
|
77
|
+
};
|
|
63
78
|
(0, react_1.useEffect)(() => {
|
|
64
79
|
setStagedHeight(modalHeightPercent);
|
|
65
80
|
}, [modalHeightPercent]);
|
|
@@ -1353,6 +1368,182 @@ const SettingsPanel = () => {
|
|
|
1353
1368
|
</react_native_1.View>)}
|
|
1354
1369
|
</react_native_1.View>
|
|
1355
1370
|
</react_native_1.View>
|
|
1371
|
+
|
|
1372
|
+
{/* Section 4: Privacy & Diagnostics */}
|
|
1373
|
+
<react_native_1.View style={{
|
|
1374
|
+
backgroundColor: AppColors_1.AppColors.primaryLight,
|
|
1375
|
+
borderRadius: 14,
|
|
1376
|
+
borderWidth: 1,
|
|
1377
|
+
borderColor: AppColors_1.AppColors.grayBorderSecondary,
|
|
1378
|
+
overflow: 'hidden',
|
|
1379
|
+
padding: 14,
|
|
1380
|
+
gap: 12,
|
|
1381
|
+
}}>
|
|
1382
|
+
<react_native_1.Text style={{
|
|
1383
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
1384
|
+
fontSize: 11,
|
|
1385
|
+
lineHeight: 14,
|
|
1386
|
+
color: AppColors_1.AppColors.grayTextWeak,
|
|
1387
|
+
letterSpacing: 0.8,
|
|
1388
|
+
}}>
|
|
1389
|
+
PRIVACY & ANONYMOUS DIAGNOSTICS
|
|
1390
|
+
</react_native_1.Text>
|
|
1391
|
+
|
|
1392
|
+
<react_native_1.View style={{
|
|
1393
|
+
flexDirection: 'row',
|
|
1394
|
+
alignItems: 'center',
|
|
1395
|
+
justifyContent: 'space-between',
|
|
1396
|
+
}}>
|
|
1397
|
+
<react_native_1.View style={{
|
|
1398
|
+
flexDirection: 'row',
|
|
1399
|
+
alignItems: 'center',
|
|
1400
|
+
gap: 10,
|
|
1401
|
+
flex: 1,
|
|
1402
|
+
marginRight: 10,
|
|
1403
|
+
}}>
|
|
1404
|
+
<react_native_1.View style={{
|
|
1405
|
+
width: 32,
|
|
1406
|
+
height: 32,
|
|
1407
|
+
borderRadius: 8,
|
|
1408
|
+
backgroundColor: AppColors_1.AppColors.purpleShade50,
|
|
1409
|
+
alignItems: 'center',
|
|
1410
|
+
justifyContent: 'center',
|
|
1411
|
+
}}>
|
|
1412
|
+
<NetworkIcons_1.ShieldAlertIcon color={AppColors_1.AppColors.purple} size={15}/>
|
|
1413
|
+
</react_native_1.View>
|
|
1414
|
+
<react_native_1.View style={{ flex: 1 }}>
|
|
1415
|
+
<react_native_1.Text style={{
|
|
1416
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
1417
|
+
fontSize: 13.5,
|
|
1418
|
+
lineHeight: 18,
|
|
1419
|
+
color: AppColors_1.AppColors.primaryBlack,
|
|
1420
|
+
}}>
|
|
1421
|
+
Help Improve In-App Inspector
|
|
1422
|
+
</react_native_1.Text>
|
|
1423
|
+
<react_native_1.Text style={{
|
|
1424
|
+
fontFamily: AppFonts_1.AppFonts.interRegular,
|
|
1425
|
+
fontSize: 11,
|
|
1426
|
+
lineHeight: 15,
|
|
1427
|
+
color: AppColors_1.AppColors.grayText,
|
|
1428
|
+
marginTop: 1,
|
|
1429
|
+
}}>
|
|
1430
|
+
Share non-identifiable technical metrics (RN version, JS engine, device model). No user data or network payloads are captured.
|
|
1431
|
+
</react_native_1.Text>
|
|
1432
|
+
</react_native_1.View>
|
|
1433
|
+
</react_native_1.View>
|
|
1434
|
+
|
|
1435
|
+
<TouchableScale_1.default accessible={true} accessibilityRole="switch" accessibilityLabel="Toggle Anonymous Telemetry" accessibilityState={{ checked: telemetryConsent }} onPress={handleToggleTelemetry} style={{
|
|
1436
|
+
width: 42,
|
|
1437
|
+
height: 24,
|
|
1438
|
+
borderRadius: 12,
|
|
1439
|
+
backgroundColor: telemetryConsent
|
|
1440
|
+
? AppColors_1.AppColors.purple
|
|
1441
|
+
: AppColors_1.AppColors.grayBorderSecondary,
|
|
1442
|
+
padding: 2,
|
|
1443
|
+
justifyContent: 'center',
|
|
1444
|
+
alignItems: telemetryConsent ? 'flex-end' : 'flex-start',
|
|
1445
|
+
}}>
|
|
1446
|
+
<react_native_1.View style={{
|
|
1447
|
+
width: 20,
|
|
1448
|
+
height: 20,
|
|
1449
|
+
borderRadius: 10,
|
|
1450
|
+
backgroundColor: AppColors_1.AppColors.white,
|
|
1451
|
+
shadowColor: AppColors_1.AppColors.black,
|
|
1452
|
+
shadowOpacity: 0.18,
|
|
1453
|
+
shadowRadius: 2,
|
|
1454
|
+
shadowOffset: { width: 0, height: 1 },
|
|
1455
|
+
}}/>
|
|
1456
|
+
</TouchableScale_1.default>
|
|
1457
|
+
</react_native_1.View>
|
|
1458
|
+
</react_native_1.View>
|
|
1459
|
+
|
|
1460
|
+
{/* Section 5: Notifications & Toasts */}
|
|
1461
|
+
<react_native_1.View style={{
|
|
1462
|
+
backgroundColor: AppColors_1.AppColors.primaryLight,
|
|
1463
|
+
borderRadius: 14,
|
|
1464
|
+
borderWidth: 1,
|
|
1465
|
+
borderColor: AppColors_1.AppColors.grayBorderSecondary,
|
|
1466
|
+
overflow: 'hidden',
|
|
1467
|
+
padding: 14,
|
|
1468
|
+
gap: 12,
|
|
1469
|
+
}}>
|
|
1470
|
+
<react_native_1.Text style={{
|
|
1471
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
1472
|
+
fontSize: 11,
|
|
1473
|
+
lineHeight: 14,
|
|
1474
|
+
color: AppColors_1.AppColors.grayTextWeak,
|
|
1475
|
+
letterSpacing: 0.8,
|
|
1476
|
+
}}>
|
|
1477
|
+
NOTIFICATIONS & TOASTS
|
|
1478
|
+
</react_native_1.Text>
|
|
1479
|
+
|
|
1480
|
+
<react_native_1.View style={{
|
|
1481
|
+
flexDirection: 'row',
|
|
1482
|
+
alignItems: 'center',
|
|
1483
|
+
justifyContent: 'space-between',
|
|
1484
|
+
}}>
|
|
1485
|
+
<react_native_1.View style={{
|
|
1486
|
+
flexDirection: 'row',
|
|
1487
|
+
alignItems: 'center',
|
|
1488
|
+
gap: 10,
|
|
1489
|
+
flex: 1,
|
|
1490
|
+
marginRight: 10,
|
|
1491
|
+
}}>
|
|
1492
|
+
<react_native_1.View style={{
|
|
1493
|
+
width: 32,
|
|
1494
|
+
height: 32,
|
|
1495
|
+
borderRadius: 8,
|
|
1496
|
+
backgroundColor: AppColors_1.AppColors.purpleShade50,
|
|
1497
|
+
alignItems: 'center',
|
|
1498
|
+
justifyContent: 'center',
|
|
1499
|
+
}}>
|
|
1500
|
+
<NetworkIcons_1.PackageIcon color={AppColors_1.AppColors.purple} size={15}/>
|
|
1501
|
+
</react_native_1.View>
|
|
1502
|
+
<react_native_1.View style={{ flex: 1 }}>
|
|
1503
|
+
<react_native_1.Text style={{
|
|
1504
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
1505
|
+
fontSize: 13.5,
|
|
1506
|
+
lineHeight: 18,
|
|
1507
|
+
color: AppColors_1.AppColors.primaryBlack,
|
|
1508
|
+
}}>
|
|
1509
|
+
NPM Update Toast
|
|
1510
|
+
</react_native_1.Text>
|
|
1511
|
+
<react_native_1.Text style={{
|
|
1512
|
+
fontFamily: AppFonts_1.AppFonts.interRegular,
|
|
1513
|
+
fontSize: 11,
|
|
1514
|
+
lineHeight: 15,
|
|
1515
|
+
color: AppColors_1.AppColors.grayText,
|
|
1516
|
+
marginTop: 1,
|
|
1517
|
+
}}>
|
|
1518
|
+
Show a floating toast banner with countdown progress when a newer release is published on npm.
|
|
1519
|
+
</react_native_1.Text>
|
|
1520
|
+
</react_native_1.View>
|
|
1521
|
+
</react_native_1.View>
|
|
1522
|
+
|
|
1523
|
+
<TouchableScale_1.default accessible={true} accessibilityRole="switch" accessibilityLabel="Toggle NPM Update Toast" accessibilityState={{ checked: showUpdateToast }} onPress={() => setShowUpdateToast(prev => !prev)} style={{
|
|
1524
|
+
width: 42,
|
|
1525
|
+
height: 24,
|
|
1526
|
+
borderRadius: 12,
|
|
1527
|
+
backgroundColor: showUpdateToast
|
|
1528
|
+
? AppColors_1.AppColors.purple
|
|
1529
|
+
: AppColors_1.AppColors.grayBorderSecondary,
|
|
1530
|
+
padding: 2,
|
|
1531
|
+
justifyContent: 'center',
|
|
1532
|
+
alignItems: showUpdateToast ? 'flex-end' : 'flex-start',
|
|
1533
|
+
}}>
|
|
1534
|
+
<react_native_1.View style={{
|
|
1535
|
+
width: 20,
|
|
1536
|
+
height: 20,
|
|
1537
|
+
borderRadius: 10,
|
|
1538
|
+
backgroundColor: AppColors_1.AppColors.white,
|
|
1539
|
+
shadowColor: AppColors_1.AppColors.black,
|
|
1540
|
+
shadowOpacity: 0.18,
|
|
1541
|
+
shadowRadius: 2,
|
|
1542
|
+
shadowOffset: { width: 0, height: 1 },
|
|
1543
|
+
}}/>
|
|
1544
|
+
</TouchableScale_1.default>
|
|
1545
|
+
</react_native_1.View>
|
|
1546
|
+
</react_native_1.View>
|
|
1356
1547
|
</react_native_1.View>)}
|
|
1357
1548
|
<react_native_1.View style={{ height: 48 }}/>
|
|
1358
1549
|
</react_native_1.ScrollView>
|
|
@@ -0,0 +1,359 @@
|
|
|
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.TelemetryConsentModal = 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 BrandSquareIcon_1 = require("../BrandSquareIcon");
|
|
41
|
+
const telemetry_1 = require("../../helpers/telemetry");
|
|
42
|
+
// ─── Inline Crisp SVG Icons ───────────────────────────────────────────────────
|
|
43
|
+
const ShieldCheckSvg = ({ size = 15, color = '#7C3AED' }) => (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
44
|
+
<react_native_svg_1.Path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
45
|
+
<react_native_svg_1.Path d="M9 12l2 2 4-4" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
46
|
+
</react_native_svg_1.default>);
|
|
47
|
+
const CheckSvg = ({ size = 14, color = '#FFFFFF' }) => (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
48
|
+
<react_native_svg_1.Path d="M20 6L9 17l-5-5" stroke={color} strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round"/>
|
|
49
|
+
</react_native_svg_1.default>);
|
|
50
|
+
const CloseSvg = ({ size = 13, color = '#64748B' }) => (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
51
|
+
<react_native_svg_1.Path d="M18 6L6 18M6 6l12 12" stroke={color} strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
52
|
+
</react_native_svg_1.default>);
|
|
53
|
+
const TelemetryConsentModal = () => {
|
|
54
|
+
const [visible, setVisible] = (0, react_1.useState)(false);
|
|
55
|
+
const fadeAnim = (0, react_1.useState)(new react_native_1.Animated.Value(0))[0];
|
|
56
|
+
const scaleAnim = (0, react_1.useState)(new react_native_1.Animated.Value(0.92))[0];
|
|
57
|
+
(0, react_1.useEffect)(() => {
|
|
58
|
+
let isMounted = true;
|
|
59
|
+
(0, telemetry_1.getTelemetryConsentStatus)().then(status => {
|
|
60
|
+
if (isMounted && status === 'undetermined') {
|
|
61
|
+
setVisible(true);
|
|
62
|
+
react_native_1.Animated.parallel([
|
|
63
|
+
react_native_1.Animated.timing(fadeAnim, {
|
|
64
|
+
toValue: 1,
|
|
65
|
+
duration: 250,
|
|
66
|
+
useNativeDriver: true,
|
|
67
|
+
}),
|
|
68
|
+
react_native_1.Animated.spring(scaleAnim, {
|
|
69
|
+
toValue: 1,
|
|
70
|
+
friction: 8,
|
|
71
|
+
tension: 45,
|
|
72
|
+
useNativeDriver: true,
|
|
73
|
+
}),
|
|
74
|
+
]).start();
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
return () => {
|
|
78
|
+
isMounted = false;
|
|
79
|
+
};
|
|
80
|
+
}, [fadeAnim, scaleAnim]);
|
|
81
|
+
const handleDecision = async (granted) => {
|
|
82
|
+
react_native_1.Animated.parallel([
|
|
83
|
+
react_native_1.Animated.timing(fadeAnim, {
|
|
84
|
+
toValue: 0,
|
|
85
|
+
duration: 180,
|
|
86
|
+
useNativeDriver: true,
|
|
87
|
+
}),
|
|
88
|
+
react_native_1.Animated.timing(scaleAnim, {
|
|
89
|
+
toValue: 0.92,
|
|
90
|
+
duration: 180,
|
|
91
|
+
useNativeDriver: true,
|
|
92
|
+
}),
|
|
93
|
+
]).start(async () => {
|
|
94
|
+
setVisible(false);
|
|
95
|
+
await (0, telemetry_1.setTelemetryConsent)(granted);
|
|
96
|
+
if (granted) {
|
|
97
|
+
// Immediately trigger the session initialization ping
|
|
98
|
+
(0, telemetry_1.sendSessionTelemetryPing)({ force: true });
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
if (!visible)
|
|
103
|
+
return null;
|
|
104
|
+
return (<react_native_1.Modal transparent visible={visible} animationType="none" statusBarTranslucent>
|
|
105
|
+
<react_native_1.View style={styles.overlay}>
|
|
106
|
+
<react_native_1.Animated.View style={[
|
|
107
|
+
styles.card,
|
|
108
|
+
{
|
|
109
|
+
opacity: fadeAnim,
|
|
110
|
+
transform: [{ scale: scaleAnim }],
|
|
111
|
+
},
|
|
112
|
+
]}>
|
|
113
|
+
{/* Top-Right Dismiss Icon Button */}
|
|
114
|
+
<react_native_1.TouchableOpacity style={styles.topCloseButton} onPress={() => handleDecision(false)} hitSlop={10} activeOpacity={0.7}>
|
|
115
|
+
<CloseSvg size={13} color="#64748B"/>
|
|
116
|
+
</react_native_1.TouchableOpacity>
|
|
117
|
+
|
|
118
|
+
{/* Centered Enlarged Square Brand Icon Header */}
|
|
119
|
+
<react_native_1.View style={styles.headerSection}>
|
|
120
|
+
<react_native_1.View style={styles.iconHaloRing}>
|
|
121
|
+
<BrandSquareIcon_1.BrandSquareIcon size={54}/>
|
|
122
|
+
</react_native_1.View>
|
|
123
|
+
|
|
124
|
+
<react_native_1.Text style={styles.title}>Help Improve In-App Inspector</react_native_1.Text>
|
|
125
|
+
<react_native_1.Text style={styles.subtitle}>Anonymous Diagnostic Insights</react_native_1.Text>
|
|
126
|
+
|
|
127
|
+
{/* Subheading instruction hint badge */}
|
|
128
|
+
<react_native_1.View style={styles.hintBadge}>
|
|
129
|
+
<react_native_1.Text style={styles.hintBadgeText}>
|
|
130
|
+
⚙️ You can enable or disable this anytime in Settings
|
|
131
|
+
</react_native_1.Text>
|
|
132
|
+
</react_native_1.View>
|
|
133
|
+
</react_native_1.View>
|
|
134
|
+
|
|
135
|
+
{/* Description */}
|
|
136
|
+
<react_native_1.Text style={styles.description}>
|
|
137
|
+
To help us continually enhance tooling performance and compatibility,
|
|
138
|
+
would you mind sharing anonymous diagnostics (such as React Native
|
|
139
|
+
version, JavaScript engine, and device architecture)?
|
|
140
|
+
</react_native_1.Text>
|
|
141
|
+
|
|
142
|
+
{/* Privacy Callout Box */}
|
|
143
|
+
<react_native_1.View style={styles.privacyBadge}>
|
|
144
|
+
<react_native_1.View style={styles.privacyShieldWrapper}>
|
|
145
|
+
<ShieldCheckSvg size={15} color="#7C3AED"/>
|
|
146
|
+
</react_native_1.View>
|
|
147
|
+
<react_native_1.Text style={styles.privacyText}>
|
|
148
|
+
<react_native_1.Text style={styles.privacyHighlight}>Privacy Guaranteed:</react_native_1.Text> We
|
|
149
|
+
strictly collect non-identifiable technical metrics. No user data,
|
|
150
|
+
passwords, tokens, or network payload bodies are ever captured.
|
|
151
|
+
</react_native_1.Text>
|
|
152
|
+
</react_native_1.View>
|
|
153
|
+
|
|
154
|
+
{/* Enhanced Action Buttons with Icons */}
|
|
155
|
+
<react_native_1.View style={styles.buttonRow}>
|
|
156
|
+
<react_native_1.TouchableOpacity style={styles.declineButton} onPress={() => handleDecision(false)} activeOpacity={0.7}>
|
|
157
|
+
<CloseSvg size={12} color="#64748B"/>
|
|
158
|
+
<react_native_1.Text style={styles.declineText}>Not Now</react_native_1.Text>
|
|
159
|
+
</react_native_1.TouchableOpacity>
|
|
160
|
+
|
|
161
|
+
<react_native_1.TouchableOpacity style={styles.allowButton} onPress={() => handleDecision(true)} activeOpacity={0.85}>
|
|
162
|
+
<CheckSvg size={13} color="#FFFFFF"/>
|
|
163
|
+
<react_native_1.Text style={styles.allowText}>Allow & Share</react_native_1.Text>
|
|
164
|
+
</react_native_1.TouchableOpacity>
|
|
165
|
+
</react_native_1.View>
|
|
166
|
+
</react_native_1.Animated.View>
|
|
167
|
+
</react_native_1.View>
|
|
168
|
+
</react_native_1.Modal>);
|
|
169
|
+
};
|
|
170
|
+
exports.TelemetryConsentModal = TelemetryConsentModal;
|
|
171
|
+
const fontStack = react_native_1.Platform.select({
|
|
172
|
+
ios: {
|
|
173
|
+
fontFamily: 'System',
|
|
174
|
+
},
|
|
175
|
+
android: {
|
|
176
|
+
fontFamily: 'sans-serif',
|
|
177
|
+
},
|
|
178
|
+
default: {},
|
|
179
|
+
});
|
|
180
|
+
const styles = react_native_1.StyleSheet.create({
|
|
181
|
+
overlay: {
|
|
182
|
+
flex: 1,
|
|
183
|
+
backgroundColor: 'rgba(15, 23, 42, 0.56)',
|
|
184
|
+
justifyContent: 'center',
|
|
185
|
+
alignItems: 'center',
|
|
186
|
+
paddingHorizontal: 20,
|
|
187
|
+
zIndex: 999999,
|
|
188
|
+
},
|
|
189
|
+
card: {
|
|
190
|
+
width: '100%',
|
|
191
|
+
maxWidth: 356,
|
|
192
|
+
backgroundColor: '#FFFFFF',
|
|
193
|
+
borderRadius: 24,
|
|
194
|
+
borderWidth: 1,
|
|
195
|
+
borderColor: '#E2E8F0',
|
|
196
|
+
paddingHorizontal: 20,
|
|
197
|
+
paddingTop: 22,
|
|
198
|
+
paddingBottom: 20,
|
|
199
|
+
alignItems: 'center',
|
|
200
|
+
shadowColor: '#0F172A',
|
|
201
|
+
shadowOffset: { width: 0, height: 16 },
|
|
202
|
+
shadowOpacity: 0.22,
|
|
203
|
+
shadowRadius: 32,
|
|
204
|
+
elevation: 24,
|
|
205
|
+
},
|
|
206
|
+
topCloseButton: {
|
|
207
|
+
position: 'absolute',
|
|
208
|
+
top: 14,
|
|
209
|
+
right: 14,
|
|
210
|
+
width: 28,
|
|
211
|
+
height: 28,
|
|
212
|
+
borderRadius: 14,
|
|
213
|
+
backgroundColor: '#F8FAFC',
|
|
214
|
+
justifyContent: 'center',
|
|
215
|
+
alignItems: 'center',
|
|
216
|
+
borderWidth: 1,
|
|
217
|
+
borderColor: '#E2E8F0',
|
|
218
|
+
zIndex: 10,
|
|
219
|
+
},
|
|
220
|
+
headerSection: {
|
|
221
|
+
alignItems: 'center',
|
|
222
|
+
width: '100%',
|
|
223
|
+
marginBottom: 4,
|
|
224
|
+
},
|
|
225
|
+
iconHaloRing: {
|
|
226
|
+
width: 66,
|
|
227
|
+
height: 66,
|
|
228
|
+
borderRadius: 20,
|
|
229
|
+
backgroundColor: '#FAF5FF',
|
|
230
|
+
justifyContent: 'center',
|
|
231
|
+
alignItems: 'center',
|
|
232
|
+
borderWidth: 1.5,
|
|
233
|
+
borderColor: '#F3E8FF',
|
|
234
|
+
marginBottom: 8,
|
|
235
|
+
shadowColor: '#7C3AED',
|
|
236
|
+
shadowOffset: { width: 0, height: 4 },
|
|
237
|
+
shadowOpacity: 0.16,
|
|
238
|
+
shadowRadius: 10,
|
|
239
|
+
elevation: 4,
|
|
240
|
+
},
|
|
241
|
+
title: {
|
|
242
|
+
fontSize: 17,
|
|
243
|
+
fontWeight: '800',
|
|
244
|
+
color: '#0F172A',
|
|
245
|
+
letterSpacing: -0.4,
|
|
246
|
+
textAlign: 'center',
|
|
247
|
+
lineHeight: 22,
|
|
248
|
+
marginBottom: 2,
|
|
249
|
+
...fontStack,
|
|
250
|
+
},
|
|
251
|
+
subtitle: {
|
|
252
|
+
fontSize: 11.5,
|
|
253
|
+
fontWeight: '600',
|
|
254
|
+
color: '#7C3AED',
|
|
255
|
+
textAlign: 'center',
|
|
256
|
+
letterSpacing: 0.2,
|
|
257
|
+
marginBottom: 6,
|
|
258
|
+
...fontStack,
|
|
259
|
+
},
|
|
260
|
+
hintBadge: {
|
|
261
|
+
backgroundColor: '#EDE9FE80',
|
|
262
|
+
borderWidth: 1,
|
|
263
|
+
borderColor: '#DDD6FE',
|
|
264
|
+
borderRadius: 7,
|
|
265
|
+
paddingHorizontal: 8,
|
|
266
|
+
paddingVertical: 2.5,
|
|
267
|
+
marginBottom: 8,
|
|
268
|
+
},
|
|
269
|
+
hintBadgeText: {
|
|
270
|
+
fontSize: 10,
|
|
271
|
+
fontWeight: '600',
|
|
272
|
+
color: '#6D28D9',
|
|
273
|
+
textAlign: 'center',
|
|
274
|
+
...fontStack,
|
|
275
|
+
},
|
|
276
|
+
description: {
|
|
277
|
+
fontSize: 12,
|
|
278
|
+
lineHeight: 17.5,
|
|
279
|
+
color: '#475569',
|
|
280
|
+
textAlign: 'center',
|
|
281
|
+
marginBottom: 12,
|
|
282
|
+
paddingHorizontal: 2,
|
|
283
|
+
...fontStack,
|
|
284
|
+
},
|
|
285
|
+
privacyBadge: {
|
|
286
|
+
flexDirection: 'row',
|
|
287
|
+
alignItems: 'flex-start',
|
|
288
|
+
backgroundColor: '#F8FAFC',
|
|
289
|
+
borderRadius: 12,
|
|
290
|
+
paddingVertical: 8,
|
|
291
|
+
paddingHorizontal: 10,
|
|
292
|
+
borderWidth: 1,
|
|
293
|
+
borderColor: '#E2E8F0',
|
|
294
|
+
marginBottom: 14,
|
|
295
|
+
width: '100%',
|
|
296
|
+
},
|
|
297
|
+
privacyShieldWrapper: {
|
|
298
|
+
marginRight: 7,
|
|
299
|
+
marginTop: 1,
|
|
300
|
+
},
|
|
301
|
+
privacyText: {
|
|
302
|
+
flex: 1,
|
|
303
|
+
fontSize: 10.8,
|
|
304
|
+
lineHeight: 15,
|
|
305
|
+
color: '#475569',
|
|
306
|
+
...fontStack,
|
|
307
|
+
},
|
|
308
|
+
privacyHighlight: {
|
|
309
|
+
fontWeight: '700',
|
|
310
|
+
color: '#1E293B',
|
|
311
|
+
},
|
|
312
|
+
buttonRow: {
|
|
313
|
+
flexDirection: 'row',
|
|
314
|
+
justifyContent: 'space-between',
|
|
315
|
+
alignItems: 'center',
|
|
316
|
+
gap: 10,
|
|
317
|
+
width: '100%',
|
|
318
|
+
},
|
|
319
|
+
declineButton: {
|
|
320
|
+
flex: 1,
|
|
321
|
+
flexDirection: 'row',
|
|
322
|
+
alignItems: 'center',
|
|
323
|
+
justifyContent: 'center',
|
|
324
|
+
gap: 5,
|
|
325
|
+
paddingVertical: 11,
|
|
326
|
+
borderRadius: 12,
|
|
327
|
+
backgroundColor: '#F1F5F9',
|
|
328
|
+
borderWidth: 1,
|
|
329
|
+
borderColor: '#E2E8F0',
|
|
330
|
+
},
|
|
331
|
+
declineText: {
|
|
332
|
+
fontSize: 13,
|
|
333
|
+
fontWeight: '600',
|
|
334
|
+
color: '#475569',
|
|
335
|
+
...fontStack,
|
|
336
|
+
},
|
|
337
|
+
allowButton: {
|
|
338
|
+
flex: 1,
|
|
339
|
+
flexDirection: 'row',
|
|
340
|
+
alignItems: 'center',
|
|
341
|
+
justifyContent: 'center',
|
|
342
|
+
gap: 5,
|
|
343
|
+
paddingVertical: 11,
|
|
344
|
+
borderRadius: 12,
|
|
345
|
+
backgroundColor: '#7C3AED',
|
|
346
|
+
shadowColor: '#7C3AED',
|
|
347
|
+
shadowOffset: { width: 0, height: 3 },
|
|
348
|
+
shadowOpacity: 0.28,
|
|
349
|
+
shadowRadius: 6,
|
|
350
|
+
elevation: 4,
|
|
351
|
+
},
|
|
352
|
+
allowText: {
|
|
353
|
+
fontSize: 13,
|
|
354
|
+
fontWeight: '700',
|
|
355
|
+
color: '#FFFFFF',
|
|
356
|
+
...fontStack,
|
|
357
|
+
},
|
|
358
|
+
});
|
|
359
|
+
exports.default = exports.TelemetryConsentModal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "2.0.
|
|
1
|
+
export declare const LIB_VERSION = "2.0.3";
|
|
@@ -3,4 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.LIB_VERSION = void 0;
|
|
4
4
|
// AUTO-GENERATED FILE — do not edit by hand.
|
|
5
5
|
// Regenerated from package.json on every build by scripts/gen-version.js.
|
|
6
|
-
exports.LIB_VERSION = '2.0.
|
|
6
|
+
exports.LIB_VERSION = '2.0.3';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { NetworkLog, RouteInfo, DiffResult, JsonContent, StackFrameType } from '../types';
|
|
2
2
|
export * from './searchQueryParser';
|
|
3
|
+
export * from './telemetry';
|
|
3
4
|
export declare const getDomainColor: (domain: string) => string;
|
|
4
5
|
export declare const formatDateTime: (timestamp: number) => string;
|
|
5
6
|
export declare const formatTimestamp: (timestamp: number) => string;
|
|
@@ -26,6 +26,7 @@ const AppColors_1 = require("../styles/AppColors");
|
|
|
26
26
|
// Constants
|
|
27
27
|
const constants_1 = require("../constants");
|
|
28
28
|
__exportStar(require("./searchQueryParser"), exports);
|
|
29
|
+
__exportStar(require("./telemetry"), exports);
|
|
29
30
|
const getDomainColor = (domain) => {
|
|
30
31
|
if (!domain)
|
|
31
32
|
return constants_1.DOMAIN_COLORS[0];
|