react-native-inapp-inspector 1.1.13 → 1.1.14

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.
@@ -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.clearActionHistory = exports.getActionHistory = exports.subscribeReduxState = exports.getReduxState = exports.inspectorReduxMiddleware = exports.connectReduxStore = exports.ErrorBoundary = exports.subscribeWebView = exports.clearWebViewData = exports.getWebViewHtmlUrl = exports.getWebViewJs = exports.getWebViewCss = exports.getWebViewHtml = exports.getWebViewNavHistory = exports.getWebViewLogs = exports.WebView = exports.clearAnalyticsEvents = exports.subscribeAnalyticsEvents = exports.logAnalyticsEvent = exports.setupAnalyticsLogger = exports.subscribeConsoleLogs = exports.clearConsoleLogs = exports.setupConsoleLogger = exports.addAxiosInterceptors = exports.subscribeNetworkLogs = exports.clearNetworkLogs = exports.setupNetworkLogger = void 0;
39
+ exports.clearActionHistory = exports.getActionHistory = exports.subscribeReduxState = exports.getReduxState = exports.inspectorReduxMiddleware = exports.connectReduxStore = exports.ErrorBoundary = exports.subscribeWebView = exports.clearWebViewData = exports.getWebViewHtmlUrl = exports.getWebViewJs = exports.getWebViewCss = exports.getWebViewHtml = exports.getWebViewNavHistory = exports.getWebViewLogs = exports.WebView = exports.getCollectionEnabled = exports.getDefaultEventParameters = exports.getCurrentUserId = exports.getCurrentUserProperties = exports.clearAnalyticsEvents = exports.subscribeAnalyticsEvents = exports.logAnalyticsEvent = exports.setupAnalyticsLogger = exports.subscribeConsoleLogs = exports.clearConsoleLogs = exports.setupConsoleLogger = exports.addAxiosInterceptors = exports.subscribeNetworkLogs = exports.clearNetworkLogs = exports.setupNetworkLogger = void 0;
40
40
  const react_1 = __importStar(require("react"));
41
41
  const react_native_1 = require("react-native");
42
42
  const react_native_svg_1 = __importStar(require("react-native-svg"));
@@ -77,7 +77,7 @@ const networkLogger_1 = require("./customHooks/networkLogger");
77
77
  const consoleLogger_1 = require("./customHooks/consoleLogger");
78
78
  const logFilters_1 = require("./customHooks/logFilters");
79
79
  const analyticsLogger_1 = require("./customHooks/analyticsLogger");
80
- const AnalyticsEventCard_1 = __importStar(require("./components/AnalyticsEventCard"));
80
+ const AnalyticsEventCard_1 = __importDefault(require("./components/AnalyticsEventCard"));
81
81
  const AnalyticsDetail_1 = __importDefault(require("./components/AnalyticsDetail"));
82
82
  const webViewLogger_1 = require("./customHooks/webViewLogger");
83
83
  let OriginalWebView = null;
@@ -272,10 +272,10 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, }) => {
272
272
  const [settingsActiveSubTab, setSettingsActiveSubTab] = (0, react_1.useState)('module');
273
273
  const [insightsActiveSubTab, setInsightsActiveSubTab] = (0, react_1.useState)('apis');
274
274
  const [tabVisibility, setTabVisibility] = (0, react_1.useState)({
275
- insights: true,
275
+ insights: false,
276
276
  apis: true,
277
277
  logs: true,
278
- analytics: false,
278
+ analytics: true,
279
279
  webview: false,
280
280
  redux: false,
281
281
  });
@@ -295,10 +295,10 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, }) => {
295
295
  setModalHeightPercent(90);
296
296
  setModalAnimationType('slide');
297
297
  setTabVisibility({
298
- insights: true,
298
+ insights: false,
299
299
  apis: true,
300
300
  logs: true,
301
- analytics: false,
301
+ analytics: true,
302
302
  webview: false,
303
303
  redux: false,
304
304
  });
@@ -363,10 +363,10 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, }) => {
363
363
  const dt = saved.defaultTab;
364
364
  const vis = {
365
365
  ...{
366
- insights: true,
366
+ insights: false,
367
367
  apis: true,
368
368
  logs: true,
369
- analytics: false,
369
+ analytics: true,
370
370
  webview: false,
371
371
  redux: false,
372
372
  },
@@ -476,7 +476,6 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, }) => {
476
476
  });
477
477
  };
478
478
  const switchActiveTab = (0, react_1.useCallback)((key) => {
479
- animateNextLayout();
480
479
  setActiveTab(key);
481
480
  }, []);
482
481
  const navigateFromDashboard = (key) => {
@@ -530,8 +529,8 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, }) => {
530
529
  const [selectedEvent, setSelectedEvent] = (0, react_1.useState)(null);
531
530
  const [analyticsSearch, setAnalyticsSearch] = (0, react_1.useState)('');
532
531
  const [hideScreenView, setHideScreenView] = (0, react_1.useState)(true);
533
- const [analyticsSubTab, setAnalyticsSubTab] = (0, react_1.useState)('ga_events');
534
- const [topEventsExpanded, setTopEventsExpanded] = (0, react_1.useState)(true);
532
+ const [isAnalyticsLayoutReady, setIsAnalyticsLayoutReady] = (0, react_1.useState)(false);
533
+ const [analyticsHeaderExpanded, setAnalyticsHeaderExpanded] = (0, react_1.useState)(false);
535
534
  const [newEventIds, setNewEventIds] = (0, react_1.useState)(new Set());
536
535
  const prevEventIdsRef = (0, react_1.useRef)(new Set());
537
536
  const [navState, setNavState] = (0, react_1.useState)(null);
@@ -727,6 +726,84 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, }) => {
727
726
  }).start();
728
727
  }
729
728
  }, [newLogIds]);
729
+ const renderAnalyticsHeader = () => {
730
+ const userId = (0, analyticsLogger_1.getCurrentUserId)();
731
+ const userProperties = (0, analyticsLogger_1.getCurrentUserProperties)();
732
+ const defaultParams = (0, analyticsLogger_1.getDefaultEventParameters)();
733
+ const isTrackingEnabled = (0, analyticsLogger_1.getCollectionEnabled)();
734
+ const hasUserProps = Object.keys(userProperties).length > 0;
735
+ const hasDefaultParams = Object.keys(defaultParams).length > 0;
736
+ const totalEvents = filteredAnalyticsEvents.length;
737
+ return (<react_native_1.View style={styles_1.default.analyticsHeaderCard}>
738
+ <react_native_1.View style={[styles_1.default.analyticsHeaderTop, !analyticsHeaderExpanded && { marginBottom: 0 }]}>
739
+ <react_native_1.View style={{ flex: 1 }}>
740
+ <react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', gap: 6 }}>
741
+ <react_native_1.Text style={styles_1.default.analyticsHeaderTitle}>Session Info</react_native_1.Text>
742
+ <react_native_1.View style={[
743
+ styles_1.default.statusDot,
744
+ { backgroundColor: isTrackingEnabled ? AppColors_1.AppColors.greenColor : AppColors_1.AppColors.errorColor }
745
+ ]}/>
746
+ <react_native_1.Text style={styles_1.default.statusText}>
747
+ {isTrackingEnabled ? 'Active' : 'Paused'}
748
+ </react_native_1.Text>
749
+ </react_native_1.View>
750
+ <react_native_1.Text style={styles_1.default.analyticsHeaderSubtitle} numberOfLines={1}>
751
+ {userId ? `User ID: ${userId}` : 'Anonymous Session'}
752
+ </react_native_1.Text>
753
+ </react_native_1.View>
754
+
755
+ <react_native_1.TouchableOpacity style={styles_1.default.analyticsHeaderToggle} activeOpacity={0.7} onPress={() => {
756
+ animateNextLayout();
757
+ setAnalyticsHeaderExpanded(!analyticsHeaderExpanded);
758
+ }}>
759
+ <react_native_1.Text style={styles_1.default.analyticsHeaderToggleText}>
760
+ {analyticsHeaderExpanded ? 'Collapse' : 'Expand'}
761
+ </react_native_1.Text>
762
+ </react_native_1.TouchableOpacity>
763
+ </react_native_1.View>
764
+
765
+ {analyticsHeaderExpanded && (<>
766
+ {/* Stats Row */}
767
+ <react_native_1.View style={styles_1.default.analyticsStatsRow}>
768
+ <react_native_1.View style={styles_1.default.analyticsStatBox}>
769
+ <react_native_1.Text style={styles_1.default.analyticsStatValue}>{totalEvents}</react_native_1.Text>
770
+ <react_native_1.Text style={styles_1.default.analyticsStatLabel}>Events</react_native_1.Text>
771
+ </react_native_1.View>
772
+ <react_native_1.View style={styles_1.default.analyticsStatBox}>
773
+ <react_native_1.Text style={styles_1.default.analyticsStatValue}>
774
+ {Object.keys(userProperties).length}
775
+ </react_native_1.Text>
776
+ <react_native_1.Text style={styles_1.default.analyticsStatLabel}>User Props</react_native_1.Text>
777
+ </react_native_1.View>
778
+ <react_native_1.View style={styles_1.default.analyticsStatBox}>
779
+ <react_native_1.Text style={styles_1.default.analyticsStatValue}>
780
+ {Object.keys(defaultParams).length}
781
+ </react_native_1.Text>
782
+ <react_native_1.Text style={styles_1.default.analyticsStatLabel}>Defaults</react_native_1.Text>
783
+ </react_native_1.View>
784
+ </react_native_1.View>
785
+
786
+ {/* Details Section */}
787
+ {(hasUserProps || hasDefaultParams) && (<react_native_1.View style={styles_1.default.analyticsHeaderDetails}>
788
+ {hasUserProps && (<react_native_1.View style={{ marginBottom: 10 }}>
789
+ <react_native_1.Text style={styles_1.default.detailsGroupTitle}>Active User Properties</react_native_1.Text>
790
+ {Object.entries(userProperties).map(([k, v]) => (<react_native_1.View key={k} style={styles_1.default.detailsRow}>
791
+ <react_native_1.Text style={styles_1.default.detailsKey} selectable={true}>{k}</react_native_1.Text>
792
+ <react_native_1.Text style={styles_1.default.detailsValue} selectable={true}>{String(v)}</react_native_1.Text>
793
+ </react_native_1.View>))}
794
+ </react_native_1.View>)}
795
+
796
+ {hasDefaultParams && (<react_native_1.View>
797
+ <react_native_1.Text style={styles_1.default.detailsGroupTitle}>Default Event Parameters</react_native_1.Text>
798
+ {Object.entries(defaultParams).map(([k, v]) => (<react_native_1.View key={k} style={styles_1.default.detailsRow}>
799
+ <react_native_1.Text style={styles_1.default.detailsKey} selectable={true}>{k}</react_native_1.Text>
800
+ <react_native_1.Text style={styles_1.default.detailsValue} selectable={true}>{String(v)}</react_native_1.Text>
801
+ </react_native_1.View>))}
802
+ </react_native_1.View>)}
803
+ </react_native_1.View>)}
804
+ </>)}
805
+ </react_native_1.View>);
806
+ };
730
807
  // #6 — every time the inspector is opened, land on the chosen default tab.
731
808
  (0, react_1.useEffect)(() => {
732
809
  if (visible) {
@@ -895,6 +972,11 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, }) => {
895
972
  unsubscribeRedux();
896
973
  };
897
974
  }, []);
975
+ (0, react_1.useEffect)(() => {
976
+ if (activeTab !== 'analytics') {
977
+ setIsAnalyticsLayoutReady(false);
978
+ }
979
+ }, [activeTab]);
898
980
  (0, react_1.useEffect)(() => {
899
981
  setReqExpanded(undefined);
900
982
  setResExpanded(undefined);
@@ -1238,15 +1320,6 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, }) => {
1238
1320
  analytics: `${searchedLogs.filter(l => l.message.toLowerCase().includes('[analytics error]')).length}/${total}`,
1239
1321
  };
1240
1322
  }, [visibleConsoleLogs, logSearch]);
1241
- const topEventsArray = (0, react_1.useMemo)(() => {
1242
- const freq = {};
1243
- filteredAnalyticsEvents.forEach(e => {
1244
- if (e.name === 'screen_view')
1245
- return;
1246
- freq[e.name] = (freq[e.name] || 0) + 1;
1247
- });
1248
- return Object.entries(freq).sort((a, b) => b[1] - a[1]);
1249
- }, [filteredAnalyticsEvents]);
1250
1323
  function closeModal() {
1251
1324
  animateNextLayout();
1252
1325
  setVisible(false);
@@ -3685,16 +3758,9 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, }) => {
3685
3758
  </react_native_1.Animated.View>
3686
3759
  </react_native_1.View>
3687
3760
  {(logs.length > 0 || analyticsEvents.length > 0) && (<react_native_1.Animated.View style={[
3688
- styles_1.default.fabBadge,
3689
- hasErrors ? styles_1.default.fabBadgeError : styles_1.default.fabBadgeNormal,
3690
- { transform: [{ scale: badgeAnim }] },
3691
- ]}>
3692
- <react_native_1.Text style={styles_1.default.fabBadgeText}>
3693
- {logs.length + analyticsEvents.length > 99
3694
- ? '99+'
3695
- : logs.length + analyticsEvents.length}
3696
- </react_native_1.Text>
3697
- </react_native_1.Animated.View>)}
3761
+ styles_1.default.fabGreenDot,
3762
+ { transform: [{ scale: unreadPulseAnim }] },
3763
+ ]}/>)}
3698
3764
  </TouchableScale_1.default>
3699
3765
  </react_native_1.Animated.View>
3700
3766
 
@@ -3916,108 +3982,108 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, }) => {
3916
3982
  </TouchableScale_1.default>) : null}
3917
3983
  </react_native_1.View>
3918
3984
 
3919
- <react_native_1.View style={styles_1.default.headerCenter}>
3920
- {selected != null ? (<react_native_1.View style={styles_1.default.headerDetailCenter}>
3921
- <react_native_1.View style={styles_1.default.headerDetailRow}>
3922
- <react_native_1.View style={[
3923
- styles_1.default.headerMethodBadge,
3924
- {
3925
- backgroundColor: constants_1.METHOD_COLORS[selected.method] ??
3926
- AppColors_1.AppColors.grayText,
3927
- },
3928
- ]}>
3929
- <react_native_1.Text style={styles_1.default.headerMethodText}>
3930
- {selected.method}
3985
+ {(selected != null || selectedEvent != null) && (<react_native_1.View style={styles_1.default.headerCenter}>
3986
+ {selected != null ? (<react_native_1.View style={styles_1.default.headerDetailCenter}>
3987
+ <react_native_1.View style={styles_1.default.headerDetailRow}>
3988
+ <react_native_1.View style={[
3989
+ styles_1.default.headerMethodBadge,
3990
+ {
3991
+ backgroundColor: constants_1.METHOD_COLORS[selected.method] ??
3992
+ AppColors_1.AppColors.grayText,
3993
+ },
3994
+ ]}>
3995
+ <react_native_1.Text style={styles_1.default.headerMethodText}>
3996
+ {selected.method}
3997
+ </react_native_1.Text>
3998
+ </react_native_1.View>
3999
+ <react_native_1.Text style={styles_1.default.headerDetailTitle} numberOfLines={1} ellipsizeMode="middle">
4000
+ {detailTitle}
3931
4001
  </react_native_1.Text>
3932
4002
  </react_native_1.View>
3933
- <react_native_1.Text style={styles_1.default.headerDetailTitle} numberOfLines={1} ellipsizeMode="middle">
3934
- {detailTitle}
3935
- </react_native_1.Text>
3936
- </react_native_1.View>
3937
- <react_native_1.View style={styles_1.default.headerDetailSubRow}>
3938
- <react_native_1.View style={{
3939
- flexDirection: 'row',
3940
- alignItems: 'center',
3941
- gap: 5,
3942
- paddingHorizontal: 8,
3943
- paddingVertical: 3,
3944
- borderRadius: 20,
3945
- backgroundColor: `${(0, helpers_1.getStatusColor)(selected.status)}26`,
3946
- borderWidth: 1,
3947
- borderColor: `${(0, helpers_1.getStatusColor)(selected.status)}55`,
3948
- }}>
4003
+ <react_native_1.View style={styles_1.default.headerDetailSubRow}>
4004
+ <react_native_1.View style={{
4005
+ flexDirection: 'row',
4006
+ alignItems: 'center',
4007
+ gap: 5,
4008
+ paddingHorizontal: 8,
4009
+ paddingVertical: 3,
4010
+ borderRadius: 20,
4011
+ backgroundColor: `${(0, helpers_1.getStatusColor)(selected.status)}26`,
4012
+ borderWidth: 1,
4013
+ borderColor: `${(0, helpers_1.getStatusColor)(selected.status)}55`,
4014
+ }}>
4015
+ <react_native_1.View style={[
4016
+ styles_1.default.headerStatusDot,
4017
+ {
4018
+ backgroundColor: (0, helpers_1.getStatusColor)(selected.status),
4019
+ },
4020
+ ]}/>
4021
+ <react_native_1.Text style={[
4022
+ styles_1.default.headerSubTitle,
4023
+ { fontFamily: AppFonts_1.AppFonts.interBold },
4024
+ ]}>
4025
+ {selected.status === 0
4026
+ ? 'Failed'
4027
+ : selected.status ?? 'Pending'}
4028
+ </react_native_1.Text>
4029
+ </react_native_1.View>
4030
+ <react_native_1.View style={{
4031
+ flexDirection: 'row',
4032
+ alignItems: 'center',
4033
+ gap: 4,
4034
+ paddingHorizontal: 8,
4035
+ paddingVertical: 3,
4036
+ borderRadius: 20,
4037
+ backgroundColor: 'rgba(255,255,255,0.16)',
4038
+ }}>
4039
+ <NetworkIcons_1.ClockIcon color="#FFFFFF" size={11}/>
4040
+ <react_native_1.Text style={styles_1.default.headerSubTitle}>
4041
+ {selected.duration != null
4042
+ ? `${selected.duration}ms`
4043
+ : '—'}
4044
+ </react_native_1.Text>
4045
+ </react_native_1.View>
4046
+ </react_native_1.View>
4047
+ </react_native_1.View>) : selectedEvent != null ? (<react_native_1.View style={styles_1.default.headerDetailCenter}>
4048
+ <react_native_1.View style={styles_1.default.headerDetailRow}>
3949
4049
  <react_native_1.View style={[
3950
- styles_1.default.headerStatusDot,
3951
- {
3952
- backgroundColor: (0, helpers_1.getStatusColor)(selected.status),
3953
- },
3954
- ]}/>
3955
- <react_native_1.Text style={[
3956
- styles_1.default.headerSubTitle,
3957
- { fontFamily: AppFonts_1.AppFonts.interBold },
3958
- ]}>
3959
- {selected.status === 0
3960
- ? 'Failed'
3961
- : selected.status ?? 'Pending'}
4050
+ styles_1.default.headerMethodBadge,
4051
+ {
4052
+ backgroundColor: selectedEvent.source === 'firebase'
4053
+ ? 'rgba(224,123,26,0.3)'
4054
+ : 'rgba(124,92,191,0.3)',
4055
+ },
4056
+ ]}>
4057
+ <react_native_1.Text style={styles_1.default.headerMethodText}>
4058
+ {selectedEvent.source === 'firebase'
4059
+ ? 'FB'
4060
+ : 'MAN'}
4061
+ </react_native_1.Text>
4062
+ </react_native_1.View>
4063
+ <react_native_1.Text style={styles_1.default.headerDetailTitle} numberOfLines={1} ellipsizeMode="middle">
4064
+ {selectedEvent.name}
3962
4065
  </react_native_1.Text>
3963
4066
  </react_native_1.View>
3964
- <react_native_1.View style={{
3965
- flexDirection: 'row',
3966
- alignItems: 'center',
3967
- gap: 4,
3968
- paddingHorizontal: 8,
3969
- paddingVertical: 3,
3970
- borderRadius: 20,
3971
- backgroundColor: 'rgba(255,255,255,0.16)',
3972
- }}>
3973
- <NetworkIcons_1.ClockIcon color="#FFFFFF" size={11}/>
4067
+ <react_native_1.View style={styles_1.default.headerDetailSubRow}>
4068
+ <react_native_1.View style={[
4069
+ styles_1.default.headerStatusDot,
4070
+ {
4071
+ backgroundColor: selectedEvent.source === 'firebase'
4072
+ ? '#E07B1A'
4073
+ : AppColors_1.AppColors.purple,
4074
+ },
4075
+ ]}/>
3974
4076
  <react_native_1.Text style={styles_1.default.headerSubTitle}>
3975
- {selected.duration != null
3976
- ? `${selected.duration}ms`
3977
- : ''}
4077
+ {Object.keys(selectedEvent.params).length} param
4078
+ {Object.keys(selectedEvent.params).length !== 1
4079
+ ? 's'
4080
+ : ''}
4081
+ {' · '}
4082
+ {selectedEvent.source}
3978
4083
  </react_native_1.Text>
3979
4084
  </react_native_1.View>
3980
- </react_native_1.View>
3981
- </react_native_1.View>) : selectedEvent != null ? (<react_native_1.View style={styles_1.default.headerDetailCenter}>
3982
- <react_native_1.View style={styles_1.default.headerDetailRow}>
3983
- <react_native_1.View style={[
3984
- styles_1.default.headerMethodBadge,
3985
- {
3986
- backgroundColor: selectedEvent.source === 'firebase'
3987
- ? 'rgba(224,123,26,0.3)'
3988
- : 'rgba(124,92,191,0.3)',
3989
- },
3990
- ]}>
3991
- <react_native_1.Text style={styles_1.default.headerMethodText}>
3992
- {selectedEvent.source === 'firebase'
3993
- ? 'FB'
3994
- : 'MAN'}
3995
- </react_native_1.Text>
3996
- </react_native_1.View>
3997
- <react_native_1.Text style={styles_1.default.headerDetailTitle} numberOfLines={1} ellipsizeMode="middle">
3998
- {selectedEvent.name}
3999
- </react_native_1.Text>
4000
- </react_native_1.View>
4001
- <react_native_1.View style={styles_1.default.headerDetailSubRow}>
4002
- <react_native_1.View style={[
4003
- styles_1.default.headerStatusDot,
4004
- {
4005
- backgroundColor: selectedEvent.source === 'firebase'
4006
- ? '#E07B1A'
4007
- : AppColors_1.AppColors.purple,
4008
- },
4009
- ]}/>
4010
- <react_native_1.Text style={styles_1.default.headerSubTitle}>
4011
- {Object.keys(selectedEvent.params).length} param
4012
- {Object.keys(selectedEvent.params).length !== 1
4013
- ? 's'
4014
- : ''}
4015
- {' · '}
4016
- {selectedEvent.source}
4017
- </react_native_1.Text>
4018
- </react_native_1.View>
4019
- </react_native_1.View>) : null}
4020
- </react_native_1.View>
4085
+ </react_native_1.View>) : null}
4086
+ </react_native_1.View>)}
4021
4087
 
4022
4088
  <react_native_1.View style={[
4023
4089
  styles_1.default.headerRight,
@@ -4185,7 +4251,7 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, }) => {
4185
4251
  {/* ─── Search + Shared Toolbar for Analytics ──────────────────────── */}
4186
4252
  <react_native_1.View style={[
4187
4253
  styles_1.default.toolbarRow,
4188
- { marginTop: 12, marginBottom: 4 },
4254
+ { marginTop: 12, marginBottom: 8 },
4189
4255
  ]}>
4190
4256
  <react_native_1.View style={styles_1.default.searchContainer}>
4191
4257
  <NetworkIcons_1.SearchIcon color={AppColors_1.AppColors.grayTextWeak} size={16}/>
@@ -4194,194 +4260,24 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, }) => {
4194
4260
  <NetworkIcons_1.ClearIcon color={AppColors_1.AppColors.grayTextWeak} size={14}/>
4195
4261
  </react_native_1.Pressable>)}
4196
4262
  </react_native_1.View>
4197
- {analyticsSubTab === 'ga_events' && (<react_native_1.View style={styles_1.default.toolbarRight}>
4198
- <TouchableScale_1.default style={{
4199
- flexDirection: 'row',
4200
- alignItems: 'center',
4201
- gap: 4,
4202
- paddingHorizontal: 10,
4203
- paddingVertical: 5,
4204
- borderRadius: 8,
4205
- backgroundColor: 'rgba(255,46,87,0.06)',
4206
- borderWidth: 1,
4207
- borderColor: 'rgba(255,46,87,0.15)',
4208
- }} onPress={handleDelete} hitSlop={6}>
4209
- <NetworkIcons_1.WipeIcon color={AppColors_1.AppColors.errorColor} size={13}/>
4210
- <react_native_1.Text style={{
4211
- fontFamily: AppFonts_1.AppFonts.interBold,
4212
- fontSize: 10.5,
4213
- color: AppColors_1.AppColors.errorColor,
4214
- }}>
4215
- Clear
4216
- </react_native_1.Text>
4217
- </TouchableScale_1.default>
4218
- </react_native_1.View>)}
4219
- </react_native_1.View>
4220
-
4221
- {/* ─── Secondary Tab Bar for Analytics ──────────────────────── */}
4222
- <react_native_1.View style={{
4223
- marginHorizontal: 16,
4224
- marginTop: 4,
4225
- marginBottom: 8,
4226
- backgroundColor: AppColors_1.AppColors.grayBackground,
4227
- borderRadius: 8,
4228
- padding: 4,
4229
- flexDirection: 'row',
4230
- borderWidth: 1,
4231
- borderColor: AppColors_1.AppColors.grayBorderSecondary,
4232
- }}>
4233
- <react_native_1.Pressable style={[
4263
+ <react_native_1.View style={styles_1.default.toolbarRight}>
4264
+ <TouchableScale_1.default style={[
4265
+ styles_1.default.toolbarBtn,
4234
4266
  {
4235
- flex: 1,
4236
- paddingVertical: 8,
4237
- borderRadius: 6,
4238
- alignItems: 'center',
4239
- },
4240
- analyticsSubTab === 'ga_events' && {
4241
- backgroundColor: AppColors_1.AppColors.primaryLight,
4242
- shadowColor: '#000',
4243
- shadowOpacity: 0.1,
4244
- shadowRadius: 3,
4245
- shadowOffset: { width: 0, height: 1 },
4246
- elevation: 2,
4247
- },
4248
- ]} onPress={() => {
4249
- animateNextLayout();
4250
- setAnalyticsSubTab('ga_events');
4251
- }}>
4252
- <react_native_1.View style={{
4253
- flexDirection: 'row',
4254
- alignItems: 'center',
4255
- gap: 6,
4256
- }}>
4257
- {/* #7 */}
4258
- <NetworkIcons_1.AnalyticsIcon size={13} color={analyticsSubTab === 'ga_events'
4259
- ? AppColors_1.AppColors.purple
4260
- : AppColors_1.AppColors.grayTextStrong}/>
4261
- <react_native_1.Text style={[
4262
- {
4263
- fontFamily: AppFonts_1.AppFonts.interMedium,
4264
- fontSize: 13,
4265
- color: AppColors_1.AppColors.grayTextStrong,
4266
- },
4267
- analyticsSubTab === 'ga_events' && {
4268
- fontFamily: AppFonts_1.AppFonts.interBold,
4269
- color: AppColors_1.AppColors.purple,
4270
- },
4271
- ]}>
4272
- GA Events (
4273
- {analyticsSearch
4274
- ? filteredAnalyticsEvents.length
4275
- : analyticsEvents.length}
4276
- )
4277
- </react_native_1.Text>
4278
- </react_native_1.View>
4279
- </react_native_1.Pressable>
4280
- <react_native_1.Pressable style={[
4281
- {
4282
- flex: 1,
4283
- paddingVertical: 8,
4284
- borderRadius: 6,
4285
- alignItems: 'center',
4286
- },
4287
- analyticsSubTab === 'top_events' && {
4288
- backgroundColor: AppColors_1.AppColors.primaryLight,
4289
- shadowColor: '#000',
4290
- shadowOpacity: 0.1,
4291
- shadowRadius: 3,
4292
- shadowOffset: { width: 0, height: 1 },
4293
- elevation: 2,
4294
- },
4295
- ]} onPress={() => {
4296
- animateNextLayout();
4297
- setAnalyticsSubTab('top_events');
4298
- }}>
4299
- <react_native_1.View style={{
4300
- flexDirection: 'row',
4301
- alignItems: 'center',
4302
- gap: 6,
4303
- }}>
4304
- {/* #7 */}
4305
- <NetworkIcons_1.TrendingUpIcon size={13} color={analyticsSubTab === 'top_events'
4306
- ? AppColors_1.AppColors.purple
4307
- : AppColors_1.AppColors.grayTextStrong}/>
4308
- <react_native_1.Text style={[
4309
- {
4310
- fontFamily: AppFonts_1.AppFonts.interMedium,
4311
- fontSize: 13,
4312
- color: AppColors_1.AppColors.grayTextStrong,
4313
- },
4314
- analyticsSubTab === 'top_events' && {
4315
- fontFamily: AppFonts_1.AppFonts.interBold,
4316
- color: AppColors_1.AppColors.purple,
4267
+ borderColor: 'rgba(255,46,87,0.22)',
4268
+ backgroundColor: 'rgba(255,46,87,0.06)',
4317
4269
  },
4318
- ]}>
4319
- Top Events ({topEventsArray.length})
4320
- </react_native_1.Text>
4321
- </react_native_1.View>
4322
- </react_native_1.Pressable>
4270
+ ]} onPress={handleDelete} hitSlop={6}>
4271
+ <NetworkIcons_1.WipeIcon color={AppColors_1.AppColors.errorColor} size={15}/>
4272
+ </TouchableScale_1.default>
4273
+ </react_native_1.View>
4323
4274
  </react_native_1.View>
4324
4275
  </react_native_1.View>)}
4325
4276
 
4326
4277
  {isReady ? (activeTab === 'insights' ? (<react_native_1.ScrollView style={styles_1.default.insightsContainer} contentContainerStyle={styles_1.default.insightsContent} showsVerticalScrollIndicator={false}>
4327
4278
  {renderInsightsDashboard()}
4328
- </react_native_1.ScrollView>) : activeTab === 'analytics' ? (<react_native_1.View style={{ flex: 1 }}>
4329
- {selectedEvent != null ? (<AnalyticsDetail_1.default event={selectedEvent}/>) : analyticsSubTab === 'top_events' ? (<react_native_1.FlatList data={topEventsArray} keyExtractor={item => item[0]} contentContainerStyle={[
4330
- styles_1.default.listContent,
4331
- { paddingHorizontal: 16, paddingTop: 12 },
4332
- ]} renderItem={({ item: [name, count], index }) => {
4333
- const maxCount = topEventsArray[0]?.[1] || 1;
4334
- const pct = Math.max(6, (count / maxCount) * 100);
4335
- const color = (0, AnalyticsEventCard_1.getEventColor)(name);
4336
- return (<AnimatedEntrance_1.default index={index} distance={8} style={[
4337
- styles_1.default.analyticsTopEventsCard,
4338
- { marginBottom: 6, paddingVertical: 10, paddingHorizontal: 12 },
4339
- ]}>
4340
- <react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', gap: 10 }}>
4341
- <react_native_1.Text style={{
4342
- fontFamily: AppFonts_1.AppFonts.interBold,
4343
- fontSize: 11,
4344
- color: color,
4345
- width: 18,
4346
- textAlign: 'center',
4347
- }}>
4348
- {index + 1}
4349
- </react_native_1.Text>
4350
- <react_native_1.View style={{ flex: 1, gap: 4 }}>
4351
- <react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between' }}>
4352
- <react_native_1.Text style={{
4353
- fontFamily: AppFonts_1.AppFonts.interMedium,
4354
- fontSize: 12.5,
4355
- color: AppColors_1.AppColors.primaryBlack,
4356
- flex: 1,
4357
- }} numberOfLines={1}>
4358
- {name}
4359
- </react_native_1.Text>
4360
- <react_native_1.Text style={{
4361
- fontFamily: AppFonts_1.AppFonts.interBold,
4362
- fontSize: 12,
4363
- color: color,
4364
- marginLeft: 8,
4365
- }}>
4366
- {count}
4367
- </react_native_1.Text>
4368
- </react_native_1.View>
4369
- <react_native_1.View style={{ height: 3, backgroundColor: AppColors_1.AppColors.grayBackground, borderRadius: 2, overflow: 'hidden' }}>
4370
- <react_native_linear_gradient_1.default colors={[color, `${color}88`]} start={{ x: 0, y: 0 }} end={{ x: 1, y: 0 }} style={{
4371
- height: '100%',
4372
- borderRadius: 2,
4373
- width: `${pct}%`,
4374
- }}/>
4375
- </react_native_1.View>
4376
- </react_native_1.View>
4377
- </react_native_1.View>
4378
- </AnimatedEntrance_1.default>);
4379
- }} ListEmptyComponent={<react_native_1.View style={styles_1.default.emptyContainer}>
4380
- <react_native_1.View style={styles_1.default.emptyIconWrap}>
4381
- <NetworkIcons_1.EmptyRadarIcon color={AppColors_1.AppColors.purple} size={32}/>
4382
- </react_native_1.View>
4383
- <react_native_1.Text style={styles_1.default.emptyTitle}>No Top Events</react_native_1.Text>
4384
- </react_native_1.View>}/>) : (<react_native_1.FlatList data={filteredAnalyticsEvents} keyExtractor={item => item.id.toString()} renderItem={({ item, index }) => {
4279
+ </react_native_1.ScrollView>) : activeTab === 'analytics' ? (<react_native_1.View style={{ flex: 1 }} onLayout={() => setIsAnalyticsLayoutReady(true)}>
4280
+ {selectedEvent != null ? (<AnalyticsDetail_1.default event={selectedEvent}/>) : isAnalyticsLayoutReady ? (<react_native_1.FlatList data={filteredAnalyticsEvents} keyExtractor={(item, index) => item?.id?.toString() ?? index.toString()} ListHeaderComponent={renderAnalyticsHeader} renderItem={({ item, index }) => {
4385
4281
  const prev = filteredAnalyticsEvents[index + 1];
4386
4282
  const next = filteredAnalyticsEvents[index - 1];
4387
4283
  const msSincePrev = prev
@@ -4392,12 +4288,13 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, }) => {
4392
4288
  ? Math.floor(next.timestamp / 60000)
4393
4289
  : -1;
4394
4290
  const showTimestamp = index === 0 || thisMin !== nextMin;
4395
- return (<AnimatedEntrance_1.default index={index} distance={8}>
4396
- <AnalyticsEventCard_1.default event={item} onPress={() => {
4291
+ return (<AnalyticsEventCard_1.default event={item} onPress={() => {
4397
4292
  animateNextLayout();
4398
4293
  setSelectedEvent(item);
4399
4294
  }} isNew={newEventIds.has(item.id)} searchStr={analyticsSearch} isFirst={index === 0} isLast={index === filteredAnalyticsEvents.length - 1} msSincePrev={msSincePrev} showTimestamp={showTimestamp} computedScreenName={(() => {
4400
- let screenName = item.screenName ||
4295
+ if (!item)
4296
+ return '';
4297
+ const rawScreenName = item.screenName ||
4401
4298
  item.screenClass ||
4402
4299
  item.pageTitle ||
4403
4300
  item.pageLocation ||
@@ -4405,6 +4302,9 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, }) => {
4405
4302
  item.params?.screen_name ||
4406
4303
  item.params?.firebase_screen_class ||
4407
4304
  item.params?.screen_class;
4305
+ let screenName = typeof rawScreenName === 'string'
4306
+ ? rawScreenName
4307
+ : (rawScreenName ? JSON.stringify(rawScreenName) : '');
4408
4308
  const routeInfo = logRouteMapRef.current.get(item.id + 1000000);
4409
4309
  if (!screenName) {
4410
4310
  if (routeInfo &&
@@ -4414,8 +4314,7 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, }) => {
4414
4314
  }
4415
4315
  }
4416
4316
  return screenName;
4417
- })()}/>
4418
- </AnimatedEntrance_1.default>);
4317
+ })()}/>);
4419
4318
  }} initialNumToRender={20} maxToRenderPerBatch={20} windowSize={5} removeClippedSubviews={false} ListEmptyComponent={<react_native_1.View style={styles_1.default.emptyContainer}>
4420
4319
  <react_native_1.View style={styles_1.default.emptyIconWrap}>
4421
4320
  <NetworkIcons_1.EmptyRadarIcon color={AppColors_1.AppColors.purple} size={32}/>
@@ -4435,7 +4334,7 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, }) => {
4435
4334
  filteredAnalyticsEvents.length === 0 && {
4436
4335
  flexGrow: 1,
4437
4336
  },
4438
- ]} keyboardShouldPersistTaps="handled"/>)}
4337
+ ]} keyboardShouldPersistTaps="handled"/>) : null}
4439
4338
  </react_native_1.View>) : activeTab === 'apis' && selected == null ? (<react_native_1.View style={{ flex: 1 }}>
4440
4339
  <react_native_1.FlatList ref={apisListRef} data={groupedData} keyExtractor={item => item?.id?.toString()} renderItem={renderItem} initialNumToRender={10} maxToRenderPerBatch={10} windowSize={5} removeClippedSubviews={true} ListHeaderComponent={<react_native_1.View style={{ marginTop: 8 }}>
4441
4340
  <react_native_1.View style={styles_1.default.toolbarRow}>
@@ -4448,27 +4347,19 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, }) => {
4448
4347
  </react_native_1.View>
4449
4348
 
4450
4349
  <react_native_1.View style={styles_1.default.toolbarRight}>
4451
- <TouchableScale_1.default style={{
4452
- flexDirection: 'row',
4453
- alignItems: 'center',
4454
- gap: 4,
4455
- paddingHorizontal: 10,
4456
- paddingVertical: 5,
4457
- borderRadius: 8,
4458
- backgroundColor: 'rgba(255,46,87,0.06)',
4459
- borderWidth: 1,
4460
- borderColor: 'rgba(255,46,87,0.15)',
4461
- }} onPress={handleDelete} hitSlop={6}>
4462
- <NetworkIcons_1.WipeIcon color={AppColors_1.AppColors.errorColor} size={13}/>
4463
- <react_native_1.Text style={{
4464
- fontFamily: AppFonts_1.AppFonts.interBold,
4465
- fontSize: 10.5,
4466
- color: AppColors_1.AppColors.errorColor,
4467
- }}>
4468
- {selectedLogs.size > 0
4469
- ? `Delete (${selectedLogs.size})`
4470
- : 'Clear'}
4471
- </react_native_1.Text>
4350
+ <TouchableScale_1.default style={[
4351
+ styles_1.default.toolbarBtn,
4352
+ {
4353
+ borderColor: 'rgba(255,46,87,0.22)',
4354
+ backgroundColor: 'rgba(255,46,87,0.06)',
4355
+ },
4356
+ ]} onPress={handleDelete} hitSlop={6}>
4357
+ <NetworkIcons_1.WipeIcon color={AppColors_1.AppColors.errorColor} size={15}/>
4358
+ {selectedLogs.size > 0 && (<react_native_1.View style={styles_1.default.trashBadge}>
4359
+ <react_native_1.Text style={styles_1.default.trashBadgeText}>
4360
+ {selectedLogs.size}
4361
+ </react_native_1.Text>
4362
+ </react_native_1.View>)}
4472
4363
  </TouchableScale_1.default>
4473
4364
 
4474
4365
  <TouchableScale_1.default style={styles_1.default.toolbarBtn} onPress={() => setSortOrder(o => o === 'newest' ? 'oldest' : 'newest')} hitSlop={10}>
@@ -4636,25 +4527,14 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, }) => {
4636
4527
  <TouchableScale_1.default style={styles_1.default.toolbarBtn} onPress={() => setLogSortOrder(o => o === 'newest' ? 'oldest' : 'newest')} hitSlop={10}>
4637
4528
  <NetworkIcons_1.SortArrowIcon color={AppColors_1.AppColors.grayTextStrong} size={18} direction={logSortOrder === 'newest' ? 'down' : 'up'}/>
4638
4529
  </TouchableScale_1.default>
4639
- <TouchableScale_1.default style={{
4640
- flexDirection: 'row',
4641
- alignItems: 'center',
4642
- gap: 4,
4643
- paddingHorizontal: 10,
4644
- paddingVertical: 5,
4645
- borderRadius: 8,
4646
- backgroundColor: 'rgba(255,46,87,0.06)',
4647
- borderWidth: 1,
4648
- borderColor: 'rgba(255,46,87,0.15)',
4649
- }} onPress={handleDelete} hitSlop={6}>
4650
- <NetworkIcons_1.WipeIcon color={AppColors_1.AppColors.errorColor} size={13}/>
4651
- <react_native_1.Text style={{
4652
- fontFamily: AppFonts_1.AppFonts.interBold,
4653
- fontSize: 10.5,
4654
- color: AppColors_1.AppColors.errorColor,
4655
- }}>
4656
- Clear
4657
- </react_native_1.Text>
4530
+ <TouchableScale_1.default style={[
4531
+ styles_1.default.toolbarBtn,
4532
+ {
4533
+ borderColor: 'rgba(255,46,87,0.22)',
4534
+ backgroundColor: 'rgba(255,46,87,0.06)',
4535
+ },
4536
+ ]} onPress={handleDelete} hitSlop={6}>
4537
+ <NetworkIcons_1.WipeIcon color={AppColors_1.AppColors.errorColor} size={15}/>
4658
4538
  </TouchableScale_1.default>
4659
4539
  </react_native_1.View>
4660
4540
  </react_native_1.View>
@@ -4925,7 +4805,7 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, }) => {
4925
4805
  </react_native_1.ScrollView>
4926
4806
  </react_native_1.View>
4927
4807
 
4928
- <react_native_1.FlatList data={filteredConsoleLogs} keyExtractor={item => item.id.toString()} ListHeaderComponent={(() => {
4808
+ <react_native_1.FlatList data={filteredConsoleLogs} keyExtractor={(item, index) => item?.id?.toString() ?? index.toString()} ListHeaderComponent={(() => {
4929
4809
  const total = visibleConsoleLogs.length;
4930
4810
  const filtered = filteredConsoleLogs.length;
4931
4811
  const isAllSelected = logFilters.has('all') ||
@@ -6000,6 +5880,10 @@ Object.defineProperty(exports, "setupAnalyticsLogger", { enumerable: true, get:
6000
5880
  Object.defineProperty(exports, "logAnalyticsEvent", { enumerable: true, get: function () { return analyticsLogger_2.logAnalyticsEvent; } });
6001
5881
  Object.defineProperty(exports, "subscribeAnalyticsEvents", { enumerable: true, get: function () { return analyticsLogger_2.subscribeAnalyticsEvents; } });
6002
5882
  Object.defineProperty(exports, "clearAnalyticsEvents", { enumerable: true, get: function () { return analyticsLogger_2.clearAnalyticsEvents; } });
5883
+ Object.defineProperty(exports, "getCurrentUserProperties", { enumerable: true, get: function () { return analyticsLogger_2.getCurrentUserProperties; } });
5884
+ Object.defineProperty(exports, "getCurrentUserId", { enumerable: true, get: function () { return analyticsLogger_2.getCurrentUserId; } });
5885
+ Object.defineProperty(exports, "getDefaultEventParameters", { enumerable: true, get: function () { return analyticsLogger_2.getDefaultEventParameters; } });
5886
+ Object.defineProperty(exports, "getCollectionEnabled", { enumerable: true, get: function () { return analyticsLogger_2.getCollectionEnabled; } });
6003
5887
  var webViewLogger_2 = require("./customHooks/webViewLogger");
6004
5888
  Object.defineProperty(exports, "WebView", { enumerable: true, get: function () { return webViewLogger_2.WebView; } });
6005
5889
  Object.defineProperty(exports, "getWebViewLogs", { enumerable: true, get: function () { return webViewLogger_2.getWebViewLogs; } });