react-native-inapp-inspector 2.0.6 → 2.0.7
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/dist/commonjs/components/Inspector/FirstTimeWalkthroughModal.d.ts +7 -0
- package/dist/commonjs/components/Inspector/FirstTimeWalkthroughModal.js +600 -0
- package/dist/commonjs/components/Inspector/MainScreen.js +5 -1
- package/dist/commonjs/components/Inspector/SettingsPanel.js +123 -35
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/helpers/settingsStore.d.ts +1 -1
- package/dist/commonjs/helpers/settingsStore.js +4 -2
- package/dist/commonjs/index.js +14 -0
- package/dist/commonjs/types/interfaces.d.ts +4 -0
- package/dist/esm/components/Inspector/FirstTimeWalkthroughModal.d.ts +7 -0
- package/dist/esm/components/Inspector/FirstTimeWalkthroughModal.js +560 -0
- package/dist/esm/components/Inspector/MainScreen.js +5 -1
- package/dist/esm/components/Inspector/SettingsPanel.js +124 -36
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/helpers/settingsStore.d.ts +1 -1
- package/dist/esm/helpers/settingsStore.js +4 -2
- package/dist/esm/index.js +14 -0
- package/dist/esm/types/interfaces.d.ts +4 -0
- package/package.json +1 -1
|
@@ -62,7 +62,7 @@ const helpers_1 = require("../../helpers");
|
|
|
62
62
|
const toast_1 = require("../../helpers/toast");
|
|
63
63
|
const SettingsPanel = () => {
|
|
64
64
|
const { t } = (0, i18n_1.useTranslation)();
|
|
65
|
-
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, isPerformanceHudEnabled, setIsPerformanceHudEnabled, reduxAutoRefresh, setReduxAutoRefreshState, reduxExpandDepth, setReduxExpandDepth, switchActiveTab, setSelected, setSelectedEvent, setReduxState, crashRecords, maxCrashLogs, setMaxCrashLogs, updateAvailable, latestNpmVersion, } = (0, InspectorContext_1.useInspector)();
|
|
65
|
+
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, isPerformanceHudEnabled, setIsPerformanceHudEnabled, reduxAutoRefresh, setReduxAutoRefreshState, reduxExpandDepth, setReduxExpandDepth, switchActiveTab, setSelected, setSelectedEvent, setReduxState, crashRecords, maxCrashLogs, setMaxCrashLogs, updateAvailable, latestNpmVersion, openWalkthrough, deviceInfo, auditReport, storageEntries, } = (0, InspectorContext_1.useInspector)();
|
|
66
66
|
const [stagedHeight, setStagedHeight] = (0, react_1.useState)(modalHeightPercent);
|
|
67
67
|
const [telemetryConsent, setTelemetryConsentState] = (0, react_1.useState)(true);
|
|
68
68
|
(0, react_1.useEffect)(() => {
|
|
@@ -462,17 +462,23 @@ const SettingsPanel = () => {
|
|
|
462
462
|
? `${logs.length} requests • Limit: ${maxNetworkLogs}`
|
|
463
463
|
: moduleItem.key === 'logs'
|
|
464
464
|
? `${consoleLogs.length} logs • Limit: ${maxConsoleLogs}`
|
|
465
|
-
: moduleItem.key === '
|
|
466
|
-
?
|
|
467
|
-
: moduleItem.key === '
|
|
468
|
-
? '
|
|
469
|
-
: moduleItem.key === '
|
|
470
|
-
? `${
|
|
471
|
-
: moduleItem.key === '
|
|
472
|
-
?
|
|
473
|
-
: moduleItem.key === '
|
|
474
|
-
?
|
|
475
|
-
: ''
|
|
465
|
+
: moduleItem.key === 'storage'
|
|
466
|
+
? `${storageEntries?.length || 0} keys • AsyncStorage/MMKV`
|
|
467
|
+
: moduleItem.key === 'device'
|
|
468
|
+
? `${deviceInfo?.platform ? deviceInfo.platform.toUpperCase() : 'Device'} • Hermes ${deviceInfo?.isHermes ? 'Enabled' : 'Off'}`
|
|
469
|
+
: moduleItem.key === 'audit'
|
|
470
|
+
? `${auditReport?.score != null ? `${auditReport.score}/100 Score • Quality Audit` : 'Package & Health Audit'}`
|
|
471
|
+
: moduleItem.key === 'performance'
|
|
472
|
+
? '60 FPS Target • Memory Telemetry'
|
|
473
|
+
: moduleItem.key === 'bundle'
|
|
474
|
+
? 'Metro Packager • Dependency Map'
|
|
475
|
+
: moduleItem.key === 'crash'
|
|
476
|
+
? `${crashRecords?.length || 0} crashes recorded • Crash Guard`
|
|
477
|
+
: moduleItem.key === 'analytics'
|
|
478
|
+
? `${analyticsEvents.length} events logged`
|
|
479
|
+
: moduleItem.key === 'redux'
|
|
480
|
+
? `${Object.keys(reduxState || {}).length} slices • Depth: ${reduxExpandDepth}`
|
|
481
|
+
: '';
|
|
476
482
|
return (<react_native_1.View key={moduleItem.key} style={{
|
|
477
483
|
backgroundColor: AppColors_1.AppColors.primaryLight,
|
|
478
484
|
borderRadius: 14,
|
|
@@ -741,29 +747,29 @@ const SettingsPanel = () => {
|
|
|
741
747
|
borderTopColor: AppColors_1.AppColors.dividerColor,
|
|
742
748
|
}}>
|
|
743
749
|
{/* Live Info Pill */}
|
|
744
|
-
<react_native_1.View style={{
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
750
|
+
{Boolean(liveStats) ? (<react_native_1.View style={{
|
|
751
|
+
flexDirection: 'row',
|
|
752
|
+
alignItems: 'center',
|
|
753
|
+
gap: 6,
|
|
754
|
+
flex: 1,
|
|
755
|
+
}}>
|
|
756
|
+
<react_native_1.View style={{
|
|
757
|
+
width: 6,
|
|
758
|
+
height: 6,
|
|
759
|
+
borderRadius: 3,
|
|
760
|
+
backgroundColor: isChecked
|
|
761
|
+
? AppColors_1.AppColors.liveGreen
|
|
762
|
+
: AppColors_1.AppColors.grayTextWeak,
|
|
763
|
+
}}/>
|
|
764
|
+
<react_native_1.Text style={{
|
|
765
|
+
fontFamily: AppFonts_1.AppFonts.interMedium,
|
|
766
|
+
fontSize: 11,
|
|
767
|
+
color: AppColors_1.AppColors.grayText,
|
|
768
|
+
lineHeight: 14,
|
|
769
|
+
}}>
|
|
770
|
+
{liveStats}
|
|
771
|
+
</react_native_1.Text>
|
|
772
|
+
</react_native_1.View>) : (<react_native_1.View style={{ flex: 1 }}/>)}
|
|
767
773
|
|
|
768
774
|
{/* Sleek Configure Button */}
|
|
769
775
|
<TouchableScale_1.default accessible={true} accessibilityRole="button" accessibilityLabel={`Configure ${moduleItem.label} settings`} onPress={() => {
|
|
@@ -1262,6 +1268,88 @@ const SettingsPanel = () => {
|
|
|
1262
1268
|
|
|
1263
1269
|
{/* ─── TAB 3: UI & APPEARANCE ────────────────────────────────────────── */}
|
|
1264
1270
|
{settingsActiveSubTab === 'ui' && (<react_native_1.View style={{ gap: 14 }}>
|
|
1271
|
+
{/* Section 0: Interactive Walkthrough Tour */}
|
|
1272
|
+
<react_native_1.View style={{
|
|
1273
|
+
backgroundColor: AppColors_1.AppColors.primaryLight,
|
|
1274
|
+
borderRadius: 14,
|
|
1275
|
+
borderWidth: 1,
|
|
1276
|
+
borderColor: AppColors_1.AppColors.grayBorderSecondary,
|
|
1277
|
+
overflow: 'hidden',
|
|
1278
|
+
padding: 14,
|
|
1279
|
+
gap: 12,
|
|
1280
|
+
}}>
|
|
1281
|
+
<react_native_1.Text style={{
|
|
1282
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
1283
|
+
fontSize: 11,
|
|
1284
|
+
lineHeight: 14,
|
|
1285
|
+
color: AppColors_1.AppColors.grayTextWeak,
|
|
1286
|
+
letterSpacing: 0.8,
|
|
1287
|
+
}}>
|
|
1288
|
+
ONBOARDING & GUIDE
|
|
1289
|
+
</react_native_1.Text>
|
|
1290
|
+
|
|
1291
|
+
<react_native_1.View style={{
|
|
1292
|
+
flexDirection: 'row',
|
|
1293
|
+
alignItems: 'center',
|
|
1294
|
+
justifyContent: 'space-between',
|
|
1295
|
+
gap: 10,
|
|
1296
|
+
}}>
|
|
1297
|
+
<react_native_1.View style={{
|
|
1298
|
+
flexDirection: 'row',
|
|
1299
|
+
alignItems: 'center',
|
|
1300
|
+
gap: 10,
|
|
1301
|
+
flex: 1,
|
|
1302
|
+
}}>
|
|
1303
|
+
<react_native_1.View style={{
|
|
1304
|
+
width: 34,
|
|
1305
|
+
height: 34,
|
|
1306
|
+
borderRadius: 9,
|
|
1307
|
+
backgroundColor: `${AppColors_1.AppColors.purple}16`,
|
|
1308
|
+
alignItems: 'center',
|
|
1309
|
+
justifyContent: 'center',
|
|
1310
|
+
}}>
|
|
1311
|
+
<NetworkIcons_1.GlobeIcon color={AppColors_1.AppColors.purple} size={16}/>
|
|
1312
|
+
</react_native_1.View>
|
|
1313
|
+
<react_native_1.View style={{ flex: 1 }}>
|
|
1314
|
+
<react_native_1.Text style={{
|
|
1315
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
1316
|
+
fontSize: 13.5,
|
|
1317
|
+
lineHeight: 18,
|
|
1318
|
+
color: AppColors_1.AppColors.primaryBlack,
|
|
1319
|
+
}}>
|
|
1320
|
+
First-Time Walkthrough
|
|
1321
|
+
</react_native_1.Text>
|
|
1322
|
+
<react_native_1.Text style={{
|
|
1323
|
+
fontFamily: AppFonts_1.AppFonts.interRegular,
|
|
1324
|
+
fontSize: 11.5,
|
|
1325
|
+
color: AppColors_1.AppColors.grayTextWeak,
|
|
1326
|
+
marginTop: 1,
|
|
1327
|
+
lineHeight: 16,
|
|
1328
|
+
}}>
|
|
1329
|
+
Explore features, gestures & developer tools
|
|
1330
|
+
</react_native_1.Text>
|
|
1331
|
+
</react_native_1.View>
|
|
1332
|
+
</react_native_1.View>
|
|
1333
|
+
|
|
1334
|
+
<TouchableScale_1.default style={{
|
|
1335
|
+
backgroundColor: `${AppColors_1.AppColors.purple}14`,
|
|
1336
|
+
borderColor: `${AppColors_1.AppColors.purple}30`,
|
|
1337
|
+
borderWidth: 1,
|
|
1338
|
+
paddingHorizontal: 12,
|
|
1339
|
+
paddingVertical: 7,
|
|
1340
|
+
borderRadius: 8,
|
|
1341
|
+
}} onPress={openWalkthrough} hitSlop={8}>
|
|
1342
|
+
<react_native_1.Text style={{
|
|
1343
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
1344
|
+
fontSize: 12,
|
|
1345
|
+
color: AppColors_1.AppColors.purple,
|
|
1346
|
+
}}>
|
|
1347
|
+
Start Tour →
|
|
1348
|
+
</react_native_1.Text>
|
|
1349
|
+
</TouchableScale_1.default>
|
|
1350
|
+
</react_native_1.View>
|
|
1351
|
+
</react_native_1.View>
|
|
1352
|
+
|
|
1265
1353
|
{/* Section 1: Appearance */}
|
|
1266
1354
|
<react_native_1.View style={{
|
|
1267
1355
|
backgroundColor: AppColors_1.AppColors.primaryLight,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "2.0.
|
|
1
|
+
export declare const LIB_VERSION = "2.0.7";
|
|
@@ -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.7';
|
|
@@ -2,7 +2,7 @@ import { InspectorStorage, PersistedSettings } from '../types';
|
|
|
2
2
|
export { InspectorStorage, PersistedSettings };
|
|
3
3
|
export declare function setCustomStorage(storage: InspectorStorage | null): void;
|
|
4
4
|
export declare function loadSettings(): Promise<PersistedSettings>;
|
|
5
|
-
export declare function saveSettings(settings: PersistedSettings): void
|
|
5
|
+
export declare function saveSettings(settings: PersistedSettings): Promise<void>;
|
|
6
6
|
export declare function clearPersistedSettings(): Promise<void>;
|
|
7
7
|
export declare const isPersistentStorageAvailable: () => boolean;
|
|
8
8
|
export declare function getCustomStorage(): InspectorStorage | null;
|
|
@@ -57,9 +57,11 @@ async function loadSettings() {
|
|
|
57
57
|
return {};
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
function saveSettings(settings) {
|
|
60
|
+
async function saveSettings(settings) {
|
|
61
61
|
try {
|
|
62
|
-
const
|
|
62
|
+
const existing = await loadSettings();
|
|
63
|
+
const merged = { ...existing, ...settings };
|
|
64
|
+
const raw = JSON.stringify(merged);
|
|
63
65
|
if (customStorage) {
|
|
64
66
|
customStorage.setItem(SETTINGS_KEY, raw);
|
|
65
67
|
return;
|
package/dist/commonjs/index.js
CHANGED
|
@@ -130,6 +130,8 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
130
130
|
const [sectionFilters, setSectionFilters] = (0, react_1.useState)({});
|
|
131
131
|
const [collapsedSections, setCollapsedSections] = (0, react_1.useState)(new Set());
|
|
132
132
|
const [showHeaderInfo, setShowHeaderInfo] = (0, react_1.useState)(true);
|
|
133
|
+
const [isWalkthroughVisible, setIsWalkthroughVisible] = (0, react_1.useState)(true);
|
|
134
|
+
const hasCompletedWalkthroughRef = (0, react_1.useRef)(null);
|
|
133
135
|
const [sortOrder, setSortOrder] = (0, react_1.useState)('newest');
|
|
134
136
|
// #7 — sort order for the Logs (console) tab
|
|
135
137
|
const [logSortOrder, setLogSortOrder] = (0, react_1.useState)('newest');
|
|
@@ -433,6 +435,7 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
433
435
|
};
|
|
434
436
|
setActiveTab(vis[dt] ? dt : 'apis');
|
|
435
437
|
}
|
|
438
|
+
hasCompletedWalkthroughRef.current = saved.hasCompletedWalkthrough === true;
|
|
436
439
|
settingsHydratedRef.current = true;
|
|
437
440
|
});
|
|
438
441
|
return () => {
|
|
@@ -898,6 +901,11 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
898
901
|
setSelectedReduxSlice(null);
|
|
899
902
|
setSelectedReduxAction(null);
|
|
900
903
|
setSelectedCrash(null);
|
|
904
|
+
// Trigger first-time walkthrough strictly on first FAB launch if not yet completed
|
|
905
|
+
if (hasCompletedWalkthroughRef.current === false) {
|
|
906
|
+
setIsWalkthroughVisible(true);
|
|
907
|
+
hasCompletedWalkthroughRef.current = true;
|
|
908
|
+
}
|
|
901
909
|
// Track inspector opened event in GA4
|
|
902
910
|
(0, helpers_1.trackInspectorOpen)({ activeTab: target });
|
|
903
911
|
// Instant synchronization of data collected while modal was closed
|
|
@@ -1743,6 +1751,12 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
1743
1751
|
setModalAnimationType,
|
|
1744
1752
|
hasNavigationContext,
|
|
1745
1753
|
setNavState,
|
|
1754
|
+
isWalkthroughVisible,
|
|
1755
|
+
setIsWalkthroughVisible,
|
|
1756
|
+
openWalkthrough: () => {
|
|
1757
|
+
setSettingsPage(null);
|
|
1758
|
+
setIsWalkthroughVisible(true);
|
|
1759
|
+
},
|
|
1746
1760
|
// ─── Tabs ───────────────────────────────────────────────────────────
|
|
1747
1761
|
activeTab,
|
|
1748
1762
|
switchActiveTab,
|
|
@@ -211,6 +211,7 @@ export interface PersistedSettings {
|
|
|
211
211
|
reduxExpandDepth?: number;
|
|
212
212
|
showDuplicateLogs?: boolean;
|
|
213
213
|
showUpdateToast?: boolean;
|
|
214
|
+
hasCompletedWalkthrough?: boolean;
|
|
214
215
|
}
|
|
215
216
|
export interface NetworkInspectorProps {
|
|
216
217
|
enabled?: boolean;
|
|
@@ -244,6 +245,9 @@ export interface InspectorContextValue {
|
|
|
244
245
|
setModalAnimationType: React.Dispatch<React.SetStateAction<'slide' | 'fade' | 'none'>>;
|
|
245
246
|
hasNavigationContext: boolean;
|
|
246
247
|
setNavState: React.Dispatch<React.SetStateAction<any>>;
|
|
248
|
+
isWalkthroughVisible: boolean;
|
|
249
|
+
setIsWalkthroughVisible: React.Dispatch<React.SetStateAction<boolean>>;
|
|
250
|
+
openWalkthrough: () => void;
|
|
247
251
|
activeTab: ActiveTab;
|
|
248
252
|
switchActiveTab: (key: ActiveTab) => void;
|
|
249
253
|
tabVisibility: Record<ActiveTab, boolean>;
|