react-native-inapp-inspector 2.3.25 → 2.4.1
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 +26 -5
- package/dist/commonjs/components/AnalyticsDetail.js +9 -6
- package/dist/commonjs/components/AppHeaderLogo.js +4 -6
- package/dist/commonjs/components/Inspector/AnalyticsFilterModal.js +1 -1
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +18 -22
- package/dist/commonjs/components/Inspector/ConsoleTab.js +13 -16
- package/dist/commonjs/components/Inspector/CrashDetail.js +7 -6
- package/dist/commonjs/components/Inspector/CrashTab.js +23 -23
- package/dist/commonjs/components/Inspector/DebuggingTab.js +6 -6
- package/dist/commonjs/components/Inspector/DeviceInfoTab.js +77 -43
- package/dist/commonjs/components/Inspector/FabLauncher.js +8 -9
- package/dist/commonjs/components/Inspector/InspectorHeader.js +93 -70
- package/dist/commonjs/components/Inspector/LogDetail.js +10 -7
- package/dist/commonjs/components/Inspector/MainScreen.js +67 -29
- package/dist/commonjs/components/Inspector/NetworkDetail.js +29 -28
- package/dist/commonjs/components/Inspector/NetworkFilterModal.js +1 -1
- package/dist/commonjs/components/Inspector/NetworkTab.js +87 -85
- package/dist/commonjs/components/Inspector/PushCard.d.ts +4 -0
- package/dist/commonjs/components/Inspector/PushCard.js +89 -0
- package/dist/commonjs/components/Inspector/PushDetail.d.ts +4 -0
- package/dist/commonjs/components/Inspector/PushDetail.js +190 -0
- package/dist/commonjs/components/Inspector/PushTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/PushTab.js +45 -0
- package/dist/commonjs/components/Inspector/ReduxDetail.js +16 -13
- package/dist/commonjs/components/Inspector/ReduxTab.js +18 -28
- package/dist/commonjs/components/Inspector/SettingsPanel.js +253 -105
- package/dist/commonjs/components/Inspector/StorageTab.js +40 -40
- package/dist/commonjs/components/Inspector/TabBar.js +9 -8
- package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +2 -2
- package/dist/commonjs/components/JsonViewer.js +77 -90
- package/dist/commonjs/components/LogCard.js +9 -6
- package/dist/commonjs/components/ModuleErrorBoundary.d.ts +24 -0
- package/dist/commonjs/components/ModuleErrorBoundary.js +33 -0
- package/dist/commonjs/components/NetworkIcons.d.ts +3 -3
- package/dist/commonjs/components/NetworkIcons.js +10 -6
- package/dist/commonjs/components/SegmentedTabs.d.ts +4 -1
- package/dist/commonjs/components/SegmentedTabs.js +12 -8
- package/dist/commonjs/components/ShareButton.d.ts +11 -0
- package/dist/commonjs/components/ShareButton.js +6 -0
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/crashHandler.js +4 -4
- package/dist/commonjs/customHooks/networkLogger.js +1 -1
- package/dist/commonjs/customHooks/pushNotificationLogger.d.ts +19 -0
- package/dist/commonjs/customHooks/pushNotificationLogger.js +1 -0
- package/dist/commonjs/helpers/memoryManager.d.ts +2 -1
- package/dist/commonjs/helpers/memoryManager.js +1 -1
- package/dist/commonjs/helpers/settingsStore.d.ts +1 -0
- package/dist/commonjs/helpers/settingsStore.js +1 -1
- package/dist/commonjs/helpers/shareFormatter.d.ts +13 -0
- package/dist/commonjs/helpers/shareFormatter.js +7 -0
- package/dist/commonjs/i18n/locales/en.json +1 -1
- package/dist/commonjs/index.d.ts +5 -2
- package/dist/commonjs/index.js +4 -4
- package/dist/commonjs/push.d.ts +4 -0
- package/dist/commonjs/push.js +1 -0
- package/dist/commonjs/types/enums.d.ts +30 -0
- package/dist/commonjs/types/enums.js +1 -1
- package/dist/commonjs/types/index.d.ts +10 -0
- package/dist/commonjs/types/interfaces.d.ts +63 -7
- package/dist/esm/components/AnalyticsDetail.js +28 -25
- package/dist/esm/components/AppHeaderLogo.js +5 -7
- package/dist/esm/components/Inspector/AnalyticsFilterModal.js +14 -14
- package/dist/esm/components/Inspector/AnalyticsTab.js +36 -40
- package/dist/esm/components/Inspector/ConsoleTab.js +52 -55
- package/dist/esm/components/Inspector/CrashDetail.js +11 -10
- package/dist/esm/components/Inspector/CrashTab.js +23 -23
- package/dist/esm/components/Inspector/DebuggingTab.js +10 -10
- package/dist/esm/components/Inspector/DeviceInfoTab.js +208 -174
- package/dist/esm/components/Inspector/FabLauncher.js +41 -42
- package/dist/esm/components/Inspector/InspectorHeader.js +138 -115
- package/dist/esm/components/Inspector/LogDetail.js +24 -21
- package/dist/esm/components/Inspector/MainScreen.js +100 -62
- package/dist/esm/components/Inspector/NetworkDetail.js +88 -87
- package/dist/esm/components/Inspector/NetworkFilterModal.js +8 -8
- package/dist/esm/components/Inspector/NetworkTab.js +136 -134
- package/dist/esm/components/Inspector/PushCard.d.ts +4 -0
- package/dist/esm/components/Inspector/PushCard.js +89 -0
- package/dist/esm/components/Inspector/PushDetail.d.ts +4 -0
- package/dist/esm/components/Inspector/PushDetail.js +190 -0
- package/dist/esm/components/Inspector/PushTab.d.ts +3 -0
- package/dist/esm/components/Inspector/PushTab.js +45 -0
- package/dist/esm/components/Inspector/ReduxDetail.js +40 -37
- package/dist/esm/components/Inspector/ReduxTab.js +109 -119
- package/dist/esm/components/Inspector/SettingsPanel.js +406 -258
- package/dist/esm/components/Inspector/StorageTab.js +174 -174
- package/dist/esm/components/Inspector/TabBar.js +28 -27
- package/dist/esm/components/Inspector/UpdateAvailableModal.js +1 -1
- package/dist/esm/components/JsonViewer.js +101 -114
- package/dist/esm/components/LogCard.js +25 -22
- package/dist/esm/components/ModuleErrorBoundary.d.ts +24 -0
- package/dist/esm/components/ModuleErrorBoundary.js +33 -0
- package/dist/esm/components/NetworkIcons.d.ts +3 -3
- package/dist/esm/components/NetworkIcons.js +7 -3
- package/dist/esm/components/SegmentedTabs.d.ts +4 -1
- package/dist/esm/components/SegmentedTabs.js +12 -8
- package/dist/esm/components/ShareButton.d.ts +11 -0
- package/dist/esm/components/ShareButton.js +6 -0
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/crashHandler.js +6 -6
- package/dist/esm/customHooks/networkLogger.js +1 -1
- package/dist/esm/customHooks/pushNotificationLogger.d.ts +19 -0
- package/dist/esm/customHooks/pushNotificationLogger.js +1 -0
- package/dist/esm/helpers/memoryManager.d.ts +2 -1
- package/dist/esm/helpers/memoryManager.js +1 -1
- package/dist/esm/helpers/settingsStore.d.ts +1 -0
- package/dist/esm/helpers/settingsStore.js +1 -1
- package/dist/esm/helpers/shareFormatter.d.ts +13 -0
- package/dist/esm/helpers/shareFormatter.js +7 -0
- package/dist/esm/i18n/locales/en.json +1 -1
- package/dist/esm/index.d.ts +5 -2
- package/dist/esm/index.js +7 -7
- package/dist/esm/push.d.ts +4 -0
- package/dist/esm/push.js +1 -0
- package/dist/esm/types/enums.d.ts +30 -0
- package/dist/esm/types/enums.js +1 -1
- package/dist/esm/types/index.d.ts +10 -0
- package/dist/esm/types/interfaces.d.ts +63 -7
- package/package.json +53 -10
- package/src/native/NativeInspector.ts +0 -1
- package/dist/commonjs/components/BrandSquareIcon.d.ts +0 -5
- package/dist/commonjs/components/BrandSquareIcon.js +0 -112
- package/dist/esm/components/BrandSquareIcon.d.ts +0 -5
- package/dist/esm/components/BrandSquareIcon.js +0 -112
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useState as q,useMemo as z}from"react";import{Pressable as Ce,ScrollView as Te,StyleSheet as Ve,Text as B,TextInput as Be,View as C}from"react-native";import G from"./CopyButton";import Y from"./JsonViewer";import
|
|
1
|
+
import{useState as q,useMemo as z}from"react";import{Pressable as Ce,ScrollView as Te,StyleSheet as Ve,Text as B,TextInput as Be,View as C}from"react-native";import G from"./CopyButton";import Se from"./ShareButton";import Y from"./JsonViewer";import Ie from"./SegmentedTabs";import Q from"./HighlightText";import Pe from"./AnimatedEntrance";import{AppFonts as S}from"../styles/AppFonts";import{AppColors as e}from"../styles/AppColors";import{getSize as Re,formatDateTime as De}from"../helpers";import{shareAnalyticsReport as We}from"../helpers/shareFormatter";import{getEventCategory as He}from"../helpers/gaAnalyticsRegistry";import{useTranslation as Fe}from"../i18n";import{SparkleIcon as X,ClockIcon as Ne,SearchIcon as Ae,ClearIcon as Oe,LayersIcon as Ee,CartIcon as Ke,GlobeIcon as Le,BoltIcon as Me,PinIcon as $e,MoneyIcon as _e,PrettyIcon as Je,TableIcon as Z,DocIcon as Ue,PackageIcon as Ge}from"./NetworkIcons";const Ye=({event:T})=>{const{t:P}=Fe(),[A,ee]=q("overview"),[R,v]=q(""),k=z(()=>T.params??{},[T.params]),F=z(()=>T.userProperties??{},[T.userProperties]),N=z(()=>Object.keys(k),[k]),D=z(()=>Object.keys(F),[F]),M=z(()=>He(T.name,k),[T.name,k]),O=z(()=>({name:T.name,timestamp:T.timestamp,source:T.source,...T.screenName?{screenName:T.screenName}:{},...T.screenClass?{screenClass:T.screenClass}:{},...T.userId?{userId:T.userId}:{},...T.sessionId?{sessionId:T.sessionId}:{},...T.trackingId?{trackingId:T.trackingId}:{},params:k,...D.length>0?{userProperties:F}:{}}),[T,k,D.length,F]),E=z(()=>{const V=k.value??k.price,I=k.currency??"USD";return V!=null&&!isNaN(Number(V))?{amount:Number(V).toFixed(2),currency:String(I).toUpperCase()}:null},[k]),$=z(()=>Array.isArray(k.items)?k.items.length:null,[k.items]),_=z(()=>T.screenName||k.firebase_screen||k.screen_name||k.page_title||T.screenClass||k.firebase_screen_class,[T.screenName,T.screenClass,k]),J=z(()=>{const V=Object.entries(k);if(!R.trim())return V;const I=R.toLowerCase();return V.filter(([K,W])=>{const L=typeof W=="object"?JSON.stringify(W):String(W);return K.toLowerCase().includes(I)||L.toLowerCase().includes(I)})},[k,R]),H=z(()=>{switch(M){case"ecommerce":return{label:P("analytics.ecommerceCategory"),color:e.amber700,bg:e.amber100,border:e.amber200,icon:V=><Ke color={V}size={11}/>};case"page_view":return{label:P("analytics.screensCategory"),color:e.sky600,bg:e.sky100,border:e.sky400,icon:V=><Le color={V}size={11}/>};case"system":return{label:P("analytics.systemCategory"),color:e.purple,bg:e.purple100,border:e.purple200,icon:V=><Me color={V}size={11}/>};default:return{label:P("analytics.customCategory"),color:e.brandPurple,bg:e.purple100,border:e.purple200,icon:V=><X color={V}size={11}/>}}},[M,P]),re=[{key:"overview",label:`${P("analytics.overviewTab")} (${N.length})`,icon:V=><Z color={V?e.white:e.grayText}size={12}/>},{key:"json",label:"JSON Payload",icon:V=><Je color={V?e.white:e.grayText}size={12}/>}];return<Te style={r.scroll}contentContainerStyle={r.content}showsVerticalScrollIndicator contentInsetAdjustmentBehavior="never"automaticallyAdjustContentInsets={!1}>
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
<C style={r.heroCard}>
|
|
@@ -30,7 +30,10 @@ import{useState as q,useMemo as z}from"react";import{Pressable as Ce,ScrollView
|
|
|
30
30
|
</C>
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
<
|
|
33
|
+
<C style={{flexDirection:"row",alignItems:"center",gap:6}}>
|
|
34
|
+
<Se onShare={()=>We(T)}/>
|
|
35
|
+
<G value={JSON.stringify(O,null,2)}label={P("analytics.eventDetails")}/>
|
|
36
|
+
</C>
|
|
34
37
|
</C>
|
|
35
38
|
|
|
36
39
|
|
|
@@ -43,14 +46,14 @@ import{useState as q,useMemo as z}from"react";import{Pressable as Ce,ScrollView
|
|
|
43
46
|
|
|
44
47
|
<C style={r.metaRow}>
|
|
45
48
|
<C style={r.timePill}>
|
|
46
|
-
<
|
|
49
|
+
<Ne color={e.purple}size={11}/>
|
|
47
50
|
<B style={r.timeText}>
|
|
48
|
-
{
|
|
51
|
+
{De(T.timestamp)}
|
|
49
52
|
</B>
|
|
50
53
|
</C>
|
|
51
54
|
|
|
52
55
|
{_&&<C style={r.screenPill}>
|
|
53
|
-
|
|
56
|
+
<$e color={e.sky600}size={11}/>
|
|
54
57
|
<B style={r.screenText}numberOfLines={1}>
|
|
55
58
|
{String(_)}
|
|
56
59
|
</B>
|
|
@@ -64,25 +67,25 @@ import{useState as q,useMemo as z}from"react";import{Pressable as Ce,ScrollView
|
|
|
64
67
|
<B style={r.metricValue}>{N.length}</B>
|
|
65
68
|
</C>
|
|
66
69
|
|
|
67
|
-
{
|
|
70
|
+
{D.length>0&&<C style={r.metricPill}>
|
|
68
71
|
<B style={r.metricLabel}>User Props:</B>
|
|
69
|
-
<B style={r.metricValue}>{
|
|
72
|
+
<B style={r.metricValue}>{D.length}</B>
|
|
70
73
|
</C>}
|
|
71
74
|
|
|
72
75
|
<C style={r.metricPill}>
|
|
73
76
|
<B style={r.metricLabel}>Size:</B>
|
|
74
|
-
<B style={r.metricValue}>{
|
|
77
|
+
<B style={r.metricValue}>{Re(O)}</B>
|
|
75
78
|
</C>
|
|
76
79
|
|
|
77
80
|
{E&&<C style={r.revenuePill}>
|
|
78
|
-
<
|
|
81
|
+
<_e color={e.emerald600}size={11}/>
|
|
79
82
|
<B style={r.revenueValue}>
|
|
80
83
|
${E.amount} {E.currency}
|
|
81
84
|
</B>
|
|
82
85
|
</C>}
|
|
83
86
|
|
|
84
87
|
{$!==null&&<C style={r.itemsPill}>
|
|
85
|
-
<
|
|
88
|
+
<Ge size={12}color={e.blue700}/>
|
|
86
89
|
<B style={r.itemsValue}>
|
|
87
90
|
{$} items
|
|
88
91
|
</B>
|
|
@@ -92,15 +95,15 @@ import{useState as q,useMemo as z}from"react";import{Pressable as Ce,ScrollView
|
|
|
92
95
|
|
|
93
96
|
|
|
94
97
|
<C style={r.tabsWrap}>
|
|
95
|
-
<
|
|
98
|
+
<Ie tabs={re}activeKey={A}onChange={V=>ee(V)}/>
|
|
96
99
|
</C>
|
|
97
100
|
|
|
98
101
|
|
|
99
|
-
{
|
|
102
|
+
{A==="overview"&&<C style={r.tabContent}>
|
|
100
103
|
|
|
101
104
|
{(T.userId||T.sessionId||T.trackingId)&&<C style={r.sectionCard}>
|
|
102
105
|
<C style={r.sectionHeader}>
|
|
103
|
-
<
|
|
106
|
+
<Ee color={e.purple}size={12}/>
|
|
104
107
|
<B style={r.sectionTitle}>SESSION & IDENTITY</B>
|
|
105
108
|
</C>
|
|
106
109
|
<C style={r.sectionBody}>
|
|
@@ -135,15 +138,15 @@ import{useState as q,useMemo as z}from"react";import{Pressable as Ce,ScrollView
|
|
|
135
138
|
|
|
136
139
|
|
|
137
140
|
{N.length>4&&<C style={r.searchBar}>
|
|
138
|
-
<
|
|
141
|
+
<Ae color={e.grayTextWeak}size={13}/>
|
|
139
142
|
<Be placeholder="Filter parameters by key or value..."placeholderTextColor={e.grayTextWeak}value={R}onChangeText={v}style={r.searchInput}autoCorrect={!1}autoCapitalize="none"/>
|
|
140
143
|
{R.length>0&&<Ce onPress={()=>v("")}hitSlop={8}>
|
|
141
|
-
<
|
|
144
|
+
<Oe color={e.grayTextWeak}size={13}/>
|
|
142
145
|
</Ce>}
|
|
143
146
|
</C>}
|
|
144
147
|
|
|
145
148
|
{N.length===0?<C style={r.emptyParamsBox}>
|
|
146
|
-
|
|
149
|
+
<Ue color={e.grayTextWeak}size={16}/>
|
|
147
150
|
<B style={r.emptyParamsText}>
|
|
148
151
|
No custom parameters recorded for this event.
|
|
149
152
|
</B>
|
|
@@ -152,7 +155,7 @@ import{useState as q,useMemo as z}from"react";import{Pressable as Ce,ScrollView
|
|
|
152
155
|
No parameters matching "{R}"
|
|
153
156
|
</B>
|
|
154
157
|
</C>:<C style={r.paramList}>
|
|
155
|
-
{J.map(([V,I],K)=>{const
|
|
158
|
+
{J.map(([V,I],K)=>{const W=typeof I=="object"&&I!==null,L=Array.isArray(I);let j=typeof I;I===null?j="null":L?j=`array [${I.length}]`:W&&(j="object");const U=W?JSON.stringify(I,null,2):String(I),te=V==="value"||V==="price"||V==="currency"||V==="screen_name"||V==="item_id"||V==="item_name";return<Pe key={V}index={K}distance={4}>
|
|
156
159
|
<C style={r.paramCard}>
|
|
157
160
|
|
|
158
161
|
<C style={r.paramCardHeader}>
|
|
@@ -170,23 +173,23 @@ import{useState as q,useMemo as z}from"react";import{Pressable as Ce,ScrollView
|
|
|
170
173
|
|
|
171
174
|
|
|
172
175
|
<C style={r.paramValBox}>
|
|
173
|
-
{
|
|
176
|
+
{W?<Y data={I}search={R}hideTabs wrap/>:<Q text={U}search={R}style={r.paramValText}highlightStyle={r.highlight}selectable/>}
|
|
174
177
|
</C>
|
|
175
178
|
</C>
|
|
176
|
-
</
|
|
179
|
+
</Pe>})}
|
|
177
180
|
</C>}
|
|
178
181
|
</C>
|
|
179
182
|
|
|
180
183
|
|
|
181
|
-
{
|
|
184
|
+
{D.length>0&&<C style={r.sectionCard}>
|
|
182
185
|
<C style={r.sectionHeader}>
|
|
183
186
|
<X color={e.purple}size={12}/>
|
|
184
187
|
<B style={r.sectionTitle}>
|
|
185
|
-
USER PROPERTIES SNAPSHOT ({
|
|
188
|
+
USER PROPERTIES SNAPSHOT ({D.length})
|
|
186
189
|
</B>
|
|
187
190
|
</C>
|
|
188
191
|
<C style={r.sectionBody}>
|
|
189
|
-
{
|
|
192
|
+
{D.map(V=><C key={V}style={r.kvRow}>
|
|
190
193
|
<B style={r.kvKey}>{V}:</B>
|
|
191
194
|
<B style={r.kvVal}selectable>
|
|
192
195
|
{String(F[V])}
|
|
@@ -197,7 +200,7 @@ import{useState as q,useMemo as z}from"react";import{Pressable as Ce,ScrollView
|
|
|
197
200
|
</C>}
|
|
198
201
|
|
|
199
202
|
|
|
200
|
-
{
|
|
201
|
-
<Y data={
|
|
203
|
+
{A==="json"&&<C style={r.jsonContainer}>
|
|
204
|
+
<Y data={O}defaultExpandDepth={2}fullHeight/>
|
|
202
205
|
</C>}
|
|
203
|
-
</Te>},r=Ve.create({scroll:{flex:1,backgroundColor:e.grayBackground},content:{paddingTop:12,paddingBottom:40,paddingHorizontal:12},heroCard:{backgroundColor:e.white,borderRadius:12,padding:14,borderWidth:1,borderColor:e.dividerColor,shadowColor:e.primaryBlack,shadowOffset:{width:0,height:1},shadowOpacity:.04,shadowRadius:4,elevation:2,marginBottom:12},heroTopRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:10},idBadge:{paddingHorizontal:6,paddingVertical:2.5,borderRadius:5,backgroundColor:`${e.slate500}12`,borderWidth:1,borderColor:`${e.slate500}22`},idBadgeText:{fontFamily:S.interBold,fontSize:10,color:e.grayTextWeak,letterSpacing:.2},sourceBadge:{flexDirection:"row",alignItems:"center",gap:4.5,paddingHorizontal:7,paddingVertical:3,borderRadius:5,borderWidth:1},sourceDot:{width:6,height:6,borderRadius:3},sourceBadgeText:{fontFamily:S.interBold,fontSize:9.5,letterSpacing:.4},catBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:7,paddingVertical:3,borderRadius:5,borderWidth:1},catBadgeText:{fontFamily:S.interBold,fontSize:9.5,letterSpacing:.3},titleRow:{marginBottom:8},eventTitle:{fontFamily:S.interBold,fontSize:16,color:e.primaryBlack,lineHeight:22},metaRow:{flexDirection:"row",alignItems:"center",gap:6,flexWrap:"wrap",marginBottom:10},timePill:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:`${e.purple}14`,paddingHorizontal:7,paddingVertical:3,borderRadius:5,borderWidth:1,borderColor:`${e.purple}2E`},timeText:{fontFamily:S.interMedium,fontSize:10.5,color:e.purple},screenPill:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:`${e.sky500}14`,paddingHorizontal:7,paddingVertical:3,borderRadius:5,borderWidth:1,borderColor:`${e.sky500}2E`,maxWidth:220},screenText:{fontFamily:S.interMedium,fontSize:10.5,color:e.sky600},metricsBar:{flexDirection:"row",alignItems:"center",gap:6,flexWrap:"wrap",paddingTop:8,borderTopWidth:1,borderTopColor:e.dividerColor},metricPill:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:e.grayBackground,paddingHorizontal:7,paddingVertical:3,borderRadius:5,borderWidth:1,borderColor:e.dividerColor},metricLabel:{fontFamily:S.interMedium,fontSize:10.5,color:e.grayTextWeak},metricValue:{fontFamily:S.interBold,fontSize:10.5,color:e.primaryBlack},revenuePill:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:e.emeraldBg,paddingHorizontal:7,paddingVertical:3,borderRadius:5,borderWidth:1,borderColor:e.emeraldBorder},revenueValue:{fontFamily:S.interBold,fontSize:10.5,color:e.greenSuccessDark},itemsPill:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:e.blueTintBg,paddingHorizontal:7,paddingVertical:3,borderRadius:5,borderWidth:1,borderColor:e.sky100},itemsValue:{fontFamily:S.interBold,fontSize:10.5,color:e.blue700},tabsWrap:{marginBottom:12},tabContent:{gap:12},sectionCard:{backgroundColor:e.white,borderRadius:12,padding:12,borderWidth:1,borderColor:e.dividerColor,shadowColor:e.primaryBlack,shadowOffset:{width:0,height:1},shadowOpacity:.04,shadowRadius:4,elevation:2},sectionHeader:{flexDirection:"row",alignItems:"center",gap:6,marginBottom:10,paddingBottom:6,borderBottomWidth:1,borderBottomColor:e.dividerColor},sectionHeaderBetween:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:10,paddingBottom:6,borderBottomWidth:1,borderBottomColor:e.dividerColor},sectionTitle:{fontFamily:S.interBold,fontSize:11,color:e.slate700,letterSpacing:.4},sectionSubtitle:{fontFamily:S.interMedium,fontSize:10,color:e.grayTextWeak},sectionBody:{gap:6},kvRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:3},kvKey:{fontFamily:S.interMedium,fontSize:11,color:e.grayTextWeak},kvVal:{fontFamily:S.interBold,fontSize:11,color:e.primaryBlack},searchBar:{flexDirection:"row",alignItems:"center",backgroundColor:e.grayBackground,borderRadius:8,paddingHorizontal:8,paddingVertical:5,borderWidth:1,borderColor:e.dividerColor,marginBottom:10,gap:6},searchInput:{flex:1,fontFamily:S.interRegular,fontSize:11,color:e.primaryBlack,paddingVertical:0},emptyParamsBox:{alignItems:"center",justifyContent:"center",paddingVertical:20,gap:6},emptyParamsText:{fontFamily:S.interMedium,fontSize:11,color:e.grayTextWeak},paramList:{gap:8},paramCard:{backgroundColor:e.grayBackground,borderRadius:8,padding:9,borderWidth:1,borderColor:e.dividerColor},paramCardHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:4},paramKeyText:{fontFamily:S.interBold,fontSize:11.5,color:e.primaryBlack},paramKeyHighlighted:{color:e.brandPurple},typeBadge:{backgroundColor:e.slate200,paddingHorizontal:5,paddingVertical:1.5,borderRadius:3},typeBadgeText:{fontFamily:S.interBold,fontSize:8.5,color:e.slate700,letterSpacing:.3},paramValBox:{marginTop:2},paramValText:{fontFamily:S.interRegular,fontSize:11,color:e.slate700,lineHeight:16},jsonContainer:{borderRadius:12,borderWidth:1,borderColor:e.dividerColor,overflow:"hidden",backgroundColor:e.white,minHeight:300},highlight:{backgroundColor:e.yellow200,color:e.yellow800,fontFamily:S.interBold}});export default
|
|
206
|
+
</Te>},r=Ve.create({scroll:{flex:1,backgroundColor:e.grayBackground},content:{paddingTop:12,paddingBottom:40,paddingHorizontal:12},heroCard:{backgroundColor:e.white,borderRadius:12,padding:14,borderWidth:1,borderColor:e.dividerColor,shadowColor:e.primaryBlack,shadowOffset:{width:0,height:1},shadowOpacity:.04,shadowRadius:4,elevation:2,marginBottom:12},heroTopRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:10},idBadge:{paddingHorizontal:6,paddingVertical:2.5,borderRadius:5,backgroundColor:`${e.slate500}12`,borderWidth:1,borderColor:`${e.slate500}22`},idBadgeText:{fontFamily:S.interBold,fontSize:10,color:e.grayTextWeak,letterSpacing:.2},sourceBadge:{flexDirection:"row",alignItems:"center",gap:4.5,paddingHorizontal:7,paddingVertical:3,borderRadius:5,borderWidth:1},sourceDot:{width:6,height:6,borderRadius:3},sourceBadgeText:{fontFamily:S.interBold,fontSize:9.5,letterSpacing:.4},catBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:7,paddingVertical:3,borderRadius:5,borderWidth:1},catBadgeText:{fontFamily:S.interBold,fontSize:9.5,letterSpacing:.3},titleRow:{marginBottom:8},eventTitle:{fontFamily:S.interBold,fontSize:16,color:e.primaryBlack,lineHeight:22},metaRow:{flexDirection:"row",alignItems:"center",gap:6,flexWrap:"wrap",marginBottom:10},timePill:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:`${e.purple}14`,paddingHorizontal:7,paddingVertical:3,borderRadius:5,borderWidth:1,borderColor:`${e.purple}2E`},timeText:{fontFamily:S.interMedium,fontSize:10.5,color:e.purple},screenPill:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:`${e.sky500}14`,paddingHorizontal:7,paddingVertical:3,borderRadius:5,borderWidth:1,borderColor:`${e.sky500}2E`,maxWidth:220},screenText:{fontFamily:S.interMedium,fontSize:10.5,color:e.sky600},metricsBar:{flexDirection:"row",alignItems:"center",gap:6,flexWrap:"wrap",paddingTop:8,borderTopWidth:1,borderTopColor:e.dividerColor},metricPill:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:e.grayBackground,paddingHorizontal:7,paddingVertical:3,borderRadius:5,borderWidth:1,borderColor:e.dividerColor},metricLabel:{fontFamily:S.interMedium,fontSize:10.5,color:e.grayTextWeak},metricValue:{fontFamily:S.interBold,fontSize:10.5,color:e.primaryBlack},revenuePill:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:e.emeraldBg,paddingHorizontal:7,paddingVertical:3,borderRadius:5,borderWidth:1,borderColor:e.emeraldBorder},revenueValue:{fontFamily:S.interBold,fontSize:10.5,color:e.greenSuccessDark},itemsPill:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:e.blueTintBg,paddingHorizontal:7,paddingVertical:3,borderRadius:5,borderWidth:1,borderColor:e.sky100},itemsValue:{fontFamily:S.interBold,fontSize:10.5,color:e.blue700},tabsWrap:{marginBottom:12},tabContent:{gap:12},sectionCard:{backgroundColor:e.white,borderRadius:12,padding:12,borderWidth:1,borderColor:e.dividerColor,shadowColor:e.primaryBlack,shadowOffset:{width:0,height:1},shadowOpacity:.04,shadowRadius:4,elevation:2},sectionHeader:{flexDirection:"row",alignItems:"center",gap:6,marginBottom:10,paddingBottom:6,borderBottomWidth:1,borderBottomColor:e.dividerColor},sectionHeaderBetween:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:10,paddingBottom:6,borderBottomWidth:1,borderBottomColor:e.dividerColor},sectionTitle:{fontFamily:S.interBold,fontSize:11,color:e.slate700,letterSpacing:.4},sectionSubtitle:{fontFamily:S.interMedium,fontSize:10,color:e.grayTextWeak},sectionBody:{gap:6},kvRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:3},kvKey:{fontFamily:S.interMedium,fontSize:11,color:e.grayTextWeak},kvVal:{fontFamily:S.interBold,fontSize:11,color:e.primaryBlack},searchBar:{flexDirection:"row",alignItems:"center",backgroundColor:e.grayBackground,borderRadius:8,paddingHorizontal:8,paddingVertical:5,borderWidth:1,borderColor:e.dividerColor,marginBottom:10,gap:6},searchInput:{flex:1,fontFamily:S.interRegular,fontSize:11,color:e.primaryBlack,paddingVertical:0},emptyParamsBox:{alignItems:"center",justifyContent:"center",paddingVertical:20,gap:6},emptyParamsText:{fontFamily:S.interMedium,fontSize:11,color:e.grayTextWeak},paramList:{gap:8},paramCard:{backgroundColor:e.grayBackground,borderRadius:8,padding:9,borderWidth:1,borderColor:e.dividerColor},paramCardHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:4},paramKeyText:{fontFamily:S.interBold,fontSize:11.5,color:e.primaryBlack},paramKeyHighlighted:{color:e.brandPurple},typeBadge:{backgroundColor:e.slate200,paddingHorizontal:5,paddingVertical:1.5,borderRadius:3},typeBadgeText:{fontFamily:S.interBold,fontSize:8.5,color:e.slate700,letterSpacing:.3},paramValBox:{marginTop:2},paramValText:{fontFamily:S.interRegular,fontSize:11,color:e.slate700,lineHeight:16},jsonContainer:{borderRadius:12,borderWidth:1,borderColor:e.dividerColor,overflow:"hidden",backgroundColor:e.white,minHeight:300},highlight:{backgroundColor:e.yellow200,color:e.yellow800,fontFamily:S.interBold}});export default Ye;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
{
|
|
3
|
-
</C>}return<C style={[
|
|
4
|
-
<R source={
|
|
5
|
-
</C>}return<
|
|
6
|
-
<V size={e}/>
|
|
7
|
-
</C>};const i=S.create({container:{overflow:"hidden",alignItems:"center",justifyContent:"center",borderWidth:1.5,borderColor:"rgba(255, 255, 255, 0.55)",backgroundColor:t.white,shadowColor:t.shadowColorString,shadowOffset:{width:0,height:2},shadowOpacity:.35,shadowRadius:5,elevation:4},imageContainer:{overflow:"hidden",backgroundColor:t.white,borderWidth:1.5,borderColor:"rgba(255, 255, 255, 0.55)",alignItems:"center",justifyContent:"center",shadowColor:t.shadowColorString,shadowOffset:{width:0,height:2},shadowOpacity:.3,shadowRadius:4,elevation:3},image:{width:"100%",height:"100%"}});export default AppHeaderLogo;
|
|
1
|
+
import o from"react";import{Image as R,StyleSheet as V,View as C}from"react-native";import S from"./BrandCircleIcon";export const AppHeaderLogo=({size:e=52,customIcon:t})=>{const r=Math.round(e*.23);if(t){if(o.isValidElement(t)){const b=o.cloneElement(t,{size:e,width:e,height:e});return<C style={[n.container,{width:e,height:e,borderRadius:r}]}>
|
|
2
|
+
{b}
|
|
3
|
+
</C>}return<C style={[n.imageContainer,{width:e,height:e,borderRadius:r}]}>
|
|
4
|
+
<R source={t}style={[n.image,{borderRadius:r}]}resizeMode="cover"/>
|
|
5
|
+
</C>}return<S size={e}/>};const n=V.create({container:{overflow:"hidden",alignItems:"center",justifyContent:"center",backgroundColor:"transparent"},imageContainer:{overflow:"hidden",backgroundColor:"transparent",alignItems:"center",justifyContent:"center"},image:{width:"100%",height:"100%"}});export default AppHeaderLogo;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useEffect as Se,useMemo as q,useState as ve}from"react";import{Modal as Ce,Pressable as Ae,ScrollView as Ie,StyleSheet as Y,Text as T,TouchableOpacity as R,View as P}from"react-native";import{useInspector as ze}from"./InspectorContext";import{AppColors as l}from"../../styles/AppColors";import{AppFonts as A}from"../../styles/AppFonts";import{getEventCategory as Be}from"../../helpers";import{FilterIcon as Ve,CloseWhite as Re,CheckIcon as L,CartIcon as We,GlobeIcon as
|
|
1
|
+
import{useEffect as Se,useMemo as q,useState as ve}from"react";import{Modal as Ce,Pressable as Ae,ScrollView as Ie,StyleSheet as Y,Text as T,TouchableOpacity as R,View as P}from"react-native";import{useInspector as ze}from"./InspectorContext";import{AppColors as l}from"../../styles/AppColors";import{AppFonts as A}from"../../styles/AppFonts";import{getEventCategory as Be}from"../../helpers";import{FilterIcon as Ve,CloseWhite as Re,CheckIcon as L,CartIcon as We,GlobeIcon as Oe,BoltIcon as Z,SparkleIcon as J,MoneyIcon as M,ClockIcon as $,HourglassIcon as _e,FlameIcon as Ee,PinIcon as K,RepeatIcon as De,TargetGoalIcon as X,UserIcon as Q,UserCheckIcon as Fe,PackageBoxIcon as He,CodeBracketsIcon as Te}from"../NetworkIcons";import S from"../TouchableScale";const Ne=({visible:W,onClose:G})=>{const{analyticsEvents:z,analyticsSearch:O,analyticsFilters:v,setAnalyticsFilters:pe}=ze(),[t,C]=ve(()=>({...v,categories:new Set(v.categories),screens:new Set(v.screens),sources:new Set(v.sources||["all"]),userTypes:new Set(v.userTypes||["all"])}));Se(()=>{W&&C({...v,categories:new Set(v.categories),screens:new Set(v.screens),sources:new Set(v.sources||["all"]),userTypes:new Set(v.userTypes||["all"])})},[W,v]);const _=q(()=>{const s=new Set;for(const i of z){const r=i.screenName||i.params?.firebase_screen||i.params?.screen_name||i.params?.firebase_screen_class||i.screenClass;r&&typeof r=="string"&&r.trim()!==""&&s.add(r.trim())}return Array.from(s)},[z]),I=s=>{C(i=>{const r=new Set(i.categories);return s==="all"?{...i,categories:new Set(["all"])}:(r.delete("all"),r.has(s)?(r.delete(s),r.size===0&&r.add("all")):r.add(s),{...i,categories:r})})},me=s=>{C(i=>{const r=new Set(i.screens);return r.has(s)?r.delete(s):r.add(s),{...i,screens:r}})},E=s=>{C(i=>{const r=new Set(i.sources);return s==="all"?{...i,sources:new Set(["all"])}:(r.delete("all"),r.has(s)?(r.delete(s),r.size===0&&r.add("all")):r.add(s),{...i,sources:r})})},D=s=>{C(i=>{const r=new Set(i.userTypes);return s==="all"?{...i,userTypes:new Set(["all"])}:(r.delete("all"),r.has(s)?(r.delete(s),r.size===0&&r.add("all")):r.add(s),{...i,userTypes:r})})},k=s=>{C(i=>({...i,[s]:!i[s]}))},Pe=s=>{C(i=>({...i,timeWindow:s}))},we=s=>{C(i=>({...i,payloadComplexity:s}))},B=s=>{C(i=>({...i,sortBy:s}))},ge=()=>{C({categories:new Set(["all"]),screens:new Set,sources:new Set(["all"]),userTypes:new Set(["all"]),timeWindow:"all",payloadComplexity:"all",hasRevenue:!1,hasItems:!1,hasUserProps:!1,hasParams:!1,onlyDuplicates:!1,onlyConversions:!1,sortBy:"time_desc"})},xe=()=>{pe({...t,categories:new Set(t.categories),screens:new Set(t.screens),sources:new Set(t.sources),userTypes:new Set(t.userTypes)}),G()},V=()=>{C({...v,categories:new Set(v.categories),screens:new Set(v.screens),sources:new Set(v.sources||["all"]),userTypes:new Set(v.userTypes||["all"])}),G()},be=q(()=>{let s=z;if(O){const i=O.toLowerCase();s=s.filter(r=>r.name.toLowerCase().includes(i)||JSON.stringify(r.params||{}).toLowerCase().includes(i)||(r.screenName??"").toLowerCase().includes(i)||(r.pageTitle??"").toLowerCase().includes(i))}if(t.categories.size>0&&!t.categories.has("all")&&(s=s.filter(i=>{const r=Be(i.name);return t.categories.has(r)})),t.timeWindow!=="all"){const i=Date.now(),r=t.timeWindow==="1m"?i-60*1e3:t.timeWindow==="5m"?i-300*1e3:t.timeWindow==="15m"?i-900*1e3:i-3600*1e3;s=s.filter(U=>U.timestamp>=r)}if(t.sources.size>0&&!t.sources.has("all")&&(s=s.filter(i=>t.sources.has(i.source||"manual"))),t.userTypes.size>0&&!t.userTypes.has("all")&&(s=s.filter(i=>{const r=!!(i.userId&&i.userId.trim()!=="");return!!(t.userTypes.has("identified")&&r||t.userTypes.has("anonymous")&&!r)})),t.payloadComplexity!=="all"&&(s=s.filter(i=>{const r=i.params?Object.keys(i.params).length:0;return t.payloadComplexity==="none"?r===0:t.payloadComplexity==="simple"?r>=1&&r<=5:t.payloadComplexity==="heavy"?r>5:!0})),t.onlyConversions){const i=["purchase","item_purchase","ecommerce_purchase","sign_up","login","lead","generate_lead","tutorial_complete","add_payment_info","begin_checkout"];s=s.filter(r=>i.some(U=>r.name.toLowerCase().includes(U)))}return t.screens.size>0&&(s=s.filter(i=>{const r=i.screenName||i.params?.firebase_screen||i.params?.screen_name||i.params?.firebase_screen_class||i.screenClass||"";return t.screens.has(r)})),t.hasRevenue&&(s=s.filter(i=>{const r=i.params?.value??i.params?.price;return r!=null&&Number(r)>0})),t.hasItems&&(s=s.filter(i=>Array.isArray(i.params?.items)&&i.params.items.length>0)),t.hasUserProps&&(s=s.filter(i=>i.userProperties&&Object.keys(i.userProperties).length>0)),t.hasParams&&(s=s.filter(i=>i.params&&Object.keys(i.params).length>0)),s.length},[z,O,t]),F=t.categories.has("all")||t.categories.size===0,H=t.sources.has("all")||t.sources.size===0,N=t.userTypes.has("all")||t.userTypes.size===0;return<Ce visible={W}transparent animationType="fade"onRequestClose={V}>
|
|
2
2
|
<P style={e.backdrop}>
|
|
3
3
|
<Ae style={Y.absoluteFill}onPress={V}/>
|
|
4
4
|
|
|
@@ -67,7 +67,7 @@ import{useEffect as Se,useMemo as q,useState as ve}from"react";import{Modal as C
|
|
|
67
67
|
</S>
|
|
68
68
|
|
|
69
69
|
<S onPress={()=>I("page_view")}style={[e.filterPill,t.categories.has("page_view")&&e.filterPillActive]}>
|
|
70
|
-
<
|
|
70
|
+
<Oe color={t.categories.has("page_view")?l.white:l.sky600}size={13}/>
|
|
71
71
|
<T style={[e.filterPillText,t.categories.has("page_view")&&e.filterPillTextActive]}>
|
|
72
72
|
Screens & Pages
|
|
73
73
|
</T>
|
|
@@ -113,7 +113,7 @@ import{useEffect as Se,useMemo as q,useState as ve}from"react";import{Modal as C
|
|
|
113
113
|
</S>
|
|
114
114
|
|
|
115
115
|
<S onPress={()=>k("hasItems")}style={[e.filterPill,t.hasItems&&e.filterPillActive]}>
|
|
116
|
-
<
|
|
116
|
+
<He color={t.hasItems?l.white:l.amber700}size={13}/>
|
|
117
117
|
<T style={[e.filterPillText,t.hasItems&&e.filterPillTextActive]}>
|
|
118
118
|
With Items Payload
|
|
119
119
|
</T>
|
|
@@ -149,9 +149,9 @@ import{useEffect as Se,useMemo as q,useState as ve}from"react";import{Modal as C
|
|
|
149
149
|
<T style={e.sectionTitle}>USER IDENTIFICATION</T>
|
|
150
150
|
</P>
|
|
151
151
|
<P style={e.chipsWrap}>
|
|
152
|
-
<S onPress={()=>D("all")}style={[e.filterPill,
|
|
153
|
-
{
|
|
154
|
-
<T style={[e.filterPillText,
|
|
152
|
+
<S onPress={()=>D("all")}style={[e.filterPill,N&&e.filterPillActive]}>
|
|
153
|
+
{N&&<L color={l.white}size={12}/>}
|
|
154
|
+
<T style={[e.filterPillText,N&&e.filterPillTextActive]}>
|
|
155
155
|
All Users
|
|
156
156
|
</T>
|
|
157
157
|
</S>
|
|
@@ -179,9 +179,9 @@ import{useEffect as Se,useMemo as q,useState as ve}from"react";import{Modal as C
|
|
|
179
179
|
<T style={e.sectionTitle}>EVENT SOURCE</T>
|
|
180
180
|
</P>
|
|
181
181
|
<P style={e.chipsWrap}>
|
|
182
|
-
<S onPress={()=>E("all")}style={[e.filterPill,
|
|
183
|
-
{
|
|
184
|
-
<T style={[e.filterPillText,
|
|
182
|
+
<S onPress={()=>E("all")}style={[e.filterPill,H&&e.filterPillActive]}>
|
|
183
|
+
{H&&<L color={l.white}size={12}/>}
|
|
184
|
+
<T style={[e.filterPillText,H&&e.filterPillTextActive]}>
|
|
185
185
|
All Sources
|
|
186
186
|
</T>
|
|
187
187
|
</S>
|
|
@@ -216,15 +216,15 @@ import{useEffect as Se,useMemo as q,useState as ve}from"react";import{Modal as C
|
|
|
216
216
|
</P>
|
|
217
217
|
|
|
218
218
|
|
|
219
|
-
{
|
|
219
|
+
{_.length>0&&<P style={e.section}>
|
|
220
220
|
<P style={e.sectionHeaderRow}>
|
|
221
221
|
<K color={l.grayTextWeak}size={12}/>
|
|
222
222
|
<T style={e.sectionTitle}>
|
|
223
|
-
DISCOVERED SCREENS ({
|
|
223
|
+
DISCOVERED SCREENS ({_.length})
|
|
224
224
|
</T>
|
|
225
225
|
</P>
|
|
226
226
|
<P style={e.chipsWrap}>
|
|
227
|
-
{
|
|
227
|
+
{_.map(s=>{const i=t.screens.has(s);return<S key={s}onPress={()=>me(s)}style={[e.filterPill,i&&e.filterPillActive]}>
|
|
228
228
|
<K color={i?l.white:l.amber700}size={12}/>
|
|
229
229
|
<T style={[e.filterPillText,i&&e.filterPillTextActive]}>
|
|
230
230
|
{s}
|
|
@@ -248,7 +248,7 @@ import{useEffect as Se,useMemo as q,useState as ve}from"react";import{Modal as C
|
|
|
248
248
|
</S>
|
|
249
249
|
|
|
250
250
|
<S onPress={()=>B("time_asc")}style={[e.filterPill,t.sortBy==="time_asc"&&e.filterPillActive]}>
|
|
251
|
-
<
|
|
251
|
+
<_e color={t.sortBy==="time_asc"?l.white:l.grayText}size={12}/>
|
|
252
252
|
<T style={[e.filterPillText,t.sortBy==="time_asc"&&e.filterPillTextActive]}>
|
|
253
253
|
Oldest First
|
|
254
254
|
</T>
|
|
@@ -285,4 +285,4 @@ import{useEffect as Se,useMemo as q,useState as ve}from"react";import{Modal as C
|
|
|
285
285
|
</P>
|
|
286
286
|
</P>
|
|
287
287
|
</P>
|
|
288
|
-
</Ce>},e=Y.create({backdrop:{flex:1,backgroundColor:`${l.primaryBlack}85`,justifyContent:"center",alignItems:"center",padding:16},modalCard:{width:"100%",maxWidth:440,backgroundColor:l.white,borderRadius:14,borderWidth:1,borderColor:l.dividerColor,shadowColor:l.black,shadowOpacity:.18,shadowRadius:12,shadowOffset:{width:0,height:4},elevation:8,overflow:"hidden"},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:14,paddingVertical:12,borderBottomWidth:1,borderBottomColor:l.dividerColor,backgroundColor:`${l.brandPurple}08`},headerIconBox:{width:28,height:28,borderRadius:7,backgroundColor:`${l.brandPurple}18`,alignItems:"center",justifyContent:"center"},headerTitle:{fontFamily:A.interBold,fontSize:13.5,color:l.primaryBlack},headerSubtitle:{fontFamily:A.interMedium,fontSize:10,color:l.grayTextWeak},resetBtn:{paddingHorizontal:8,paddingVertical:4,borderRadius:5,backgroundColor:`${l.darkOrange}14`,borderWidth:1,borderColor:`${l.darkOrange}30`},resetBtnText:{fontFamily:A.interBold,fontSize:10,color:l.darkOrange},closeBtn:{width:24,height:24,borderRadius:12,backgroundColor:`${l.primaryBlack}18`,alignItems:"center",justifyContent:"center"},scrollContent:{padding:14,gap:14},section:{gap:7},sectionHeaderRow:{flexDirection:"row",alignItems:"center",gap:5},sectionTitle:{fontFamily:A.interBold,fontSize:9.5,color:l.grayTextWeak,letterSpacing:.5},chipsWrap:{flexDirection:"row",flexWrap:"wrap",gap:6.5},filterPill:{flexDirection:"row",alignItems:"center",gap:5,paddingHorizontal:9,paddingVertical:5.5,borderRadius:7,backgroundColor:l.grayBackground,borderWidth:1,borderColor:l.dividerColor},filterPillActive:{backgroundColor:l.brandPurple,borderColor:l.brandPurple,shadowColor:l.brandPurple,shadowOffset:{width:0,height:1},shadowOpacity:.25,shadowRadius:3,elevation:2},filterPillText:{fontFamily:A.interMedium,fontSize:11,color:l.primaryBlack},filterPillTextActive:{color:l.white,fontFamily:A.interBold},footer:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:14,paddingVertical:12,borderTopWidth:1,borderTopColor:l.dividerColor,backgroundColor:l.grayBackground},discardBtn:{flex:1,paddingVertical:9.5,borderRadius:8,borderWidth:1,borderColor:l.dividerColor,backgroundColor:l.white,alignItems:"center",justifyContent:"center"},discardBtnText:{fontFamily:A.interBold,fontSize:12.5,color:l.grayTextStrong},applyBtn:{flex:2,backgroundColor:l.brandPurple,paddingVertical:9.5,borderRadius:8,alignItems:"center",justifyContent:"center",shadowColor:l.brandPurple,shadowOffset:{width:0,height:1},shadowOpacity:.25,shadowRadius:3,elevation:2},applyBtnText:{fontFamily:A.interBold,fontSize:12.5,color:l.white}});export default
|
|
288
|
+
</Ce>},e=Y.create({backdrop:{flex:1,backgroundColor:`${l.primaryBlack}85`,justifyContent:"center",alignItems:"center",padding:16},modalCard:{width:"100%",maxWidth:440,backgroundColor:l.white,borderRadius:14,borderWidth:1,borderColor:l.dividerColor,shadowColor:l.black,shadowOpacity:.18,shadowRadius:12,shadowOffset:{width:0,height:4},elevation:8,overflow:"hidden"},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:14,paddingVertical:12,borderBottomWidth:1,borderBottomColor:l.dividerColor,backgroundColor:`${l.brandPurple}08`},headerIconBox:{width:28,height:28,borderRadius:7,backgroundColor:`${l.brandPurple}18`,alignItems:"center",justifyContent:"center"},headerTitle:{fontFamily:A.interBold,fontSize:13.5,color:l.primaryBlack},headerSubtitle:{fontFamily:A.interMedium,fontSize:10,color:l.grayTextWeak},resetBtn:{paddingHorizontal:8,paddingVertical:4,borderRadius:5,backgroundColor:`${l.darkOrange}14`,borderWidth:1,borderColor:`${l.darkOrange}30`},resetBtnText:{fontFamily:A.interBold,fontSize:10,color:l.darkOrange},closeBtn:{width:24,height:24,borderRadius:12,backgroundColor:`${l.primaryBlack}18`,alignItems:"center",justifyContent:"center"},scrollContent:{padding:14,gap:14},section:{gap:7},sectionHeaderRow:{flexDirection:"row",alignItems:"center",gap:5},sectionTitle:{fontFamily:A.interBold,fontSize:9.5,color:l.grayTextWeak,letterSpacing:.5},chipsWrap:{flexDirection:"row",flexWrap:"wrap",gap:6.5},filterPill:{flexDirection:"row",alignItems:"center",gap:5,paddingHorizontal:9,paddingVertical:5.5,borderRadius:7,backgroundColor:l.grayBackground,borderWidth:1,borderColor:l.dividerColor},filterPillActive:{backgroundColor:l.brandPurple,borderColor:l.brandPurple,shadowColor:l.brandPurple,shadowOffset:{width:0,height:1},shadowOpacity:.25,shadowRadius:3,elevation:2},filterPillText:{fontFamily:A.interMedium,fontSize:11,color:l.primaryBlack},filterPillTextActive:{color:l.white,fontFamily:A.interBold},footer:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:14,paddingVertical:12,borderTopWidth:1,borderTopColor:l.dividerColor,backgroundColor:l.grayBackground},discardBtn:{flex:1,paddingVertical:9.5,borderRadius:8,borderWidth:1,borderColor:l.dividerColor,backgroundColor:l.white,alignItems:"center",justifyContent:"center"},discardBtnText:{fontFamily:A.interBold,fontSize:12.5,color:l.grayTextStrong},applyBtn:{flex:2,backgroundColor:l.brandPurple,paddingVertical:9.5,borderRadius:8,alignItems:"center",justifyContent:"center",shadowColor:l.brandPurple,shadowOffset:{width:0,height:1},shadowOpacity:.25,shadowRadius:3,elevation:2},applyBtnText:{fontFamily:A.interBold,fontSize:12.5,color:l.white}});export default Ne;
|
|
@@ -1,64 +1,60 @@
|
|
|
1
|
-
import
|
|
1
|
+
import X,{useCallback as F,useState as Y,useMemo as Z,useRef as Fe}from"react";import{FlatList as Pe,Platform as Re,Pressable as Ve,ScrollView as Be,Text as N,TextInput as Me,TouchableOpacity as Ce,View as C}from"react-native";import{animateNextLayout as _e,useInspector as Ne}from"./InspectorContext";import Oe from"../AnalyticsEventCard";import $e from"./AnalyticsFilterModal";import De from"../EndOfListFooter";import He from"../EmptyState";import I from"../../styles";import{AppColors as r}from"../../styles/AppColors";import{AppFonts as O}from"../../styles/AppFonts";import{useTranslation as We}from"../../i18n";import Ge from"../TouchableScale";import{getEventCategory as je}from"../../helpers";import{LayersIcon as Je,SearchIcon as Qe,ClearIcon as Ke,TrashIcon as Ue,FilterIcon as Xe,CartIcon as Ye,GlobeIcon as Ze,BoltIcon as et,SparkleIcon as tt}from"../NetworkIcons";const Se=10,ot=X.memo(()=>{const{t:$}=We(),{analyticsEvents:D,filteredAnalyticsEvents:a,analyticsSearch:S,setAnalyticsSearch:P,analyticsFilters:A,setAnalyticsFilters:H,handleDelete:we,selectedEvent:Ie,setSelectedEvent:W,newEventIds:G,logRouteMapRef:j,isAnalyticsLayoutReady:Te,setIsAnalyticsLayoutReady:ve,isAnalyticsFilterApplied:R,maxAnalyticsEventsLimit:V}=Ne(),xe=V||100,J=Fe(null),[Le,Q]=Y(!1),[q,K]=Y(xe);X.useEffect(()=>{K(V||100),J.current?.scrollToOffset({offset:0,animated:!1})},[S,A,V]);const B=Z(()=>a.slice(0,q),[a,q]),v=Z(()=>{let e=0,o=0,t=0,w=0;for(const E of D){const k=je(E.name),T=E.count||1;k==="ecommerce"?e+=T:k==="page_view"?o+=T:k==="system"?t+=T:w+=T}const L=e+o+t+w;return{ecommerce:e,page_view:o,system:t,custom:w,totalCount:L}},[D]),ke=F(e=>{_e(),H(o=>{if(e==="all")return{...o,categories:new Set(["all"])};const t=new Set(o.categories);if(t.has("all"))t.delete("all"),t.add(e);else if(t.has(e))t.delete(e),t.size===0&&t.add("all");else if(t.add(e),t.has("ecommerce")&&t.has("page_view")&&t.has("system")&&t.has("custom"))return{...o,categories:new Set(["all"])};return{...o,categories:t}})},[H]),Ae=F((e,o)=>e?.id?.toString()??o.toString(),[]),Ee=F(({item:e,index:o})=>{const t=a[o+1],w=a[o-1],L=t?e.timestamp-t.timestamp:void 0,E=Math.floor(e.timestamp/6e4),k=w?Math.floor(w.timestamp/6e4):-1,T=o===0||E!==k;return<Oe event={e}onPress={()=>{W(e)}}isNew={G.has(e.id)}searchStr={S}isFirst={o===0}isLast={o===a.length-1}msSincePrev={L}showTimestamp={T}computedScreenName={(()=>{if(!e)return"";const z=e.screenName||e.screenClass||e.pageTitle||e.pageLocation||e.params?.firebase_screen||e.params?.screen_name||e.params?.firebase_screen_class||e.params?.screen_class;let M=typeof z=="string"?z:z?JSON.stringify(z):"";const _=j.current.get(e.id+1e6);if(!M&&_&&_.path!=="Navigators"){const U=_.path.split(" \u2794 ");M=U[U.length-1]}return M})()}/>},[a,S,G,W,j]),ze=F((e,o)=>({length:86,offset:86*o,index:o}),[]);return<>
|
|
2
2
|
|
|
3
|
-
{
|
|
4
|
-
<C style={[
|
|
5
|
-
<C style={
|
|
6
|
-
<
|
|
7
|
-
<
|
|
3
|
+
{Ie==null&&<C style={{backgroundColor:r.white,borderBottomWidth:1,borderBottomColor:r.dividerColor,paddingBottom:6}}>
|
|
4
|
+
<C style={[I.toolbarRow,{marginTop:12,marginBottom:8}]}>
|
|
5
|
+
<C style={I.searchContainer}>
|
|
6
|
+
<Qe color={r.grayTextWeak}size={16}/>
|
|
7
|
+
<Me placeholder={$("analytics.searchPlaceholder","Search events...")}placeholderTextColor={r.grayTextWeak}value={S}onChangeText={P}style={I.searchInput}autoCorrect={!1}autoCapitalize="none"/>
|
|
8
8
|
{S.length>0&&<C style={{flexDirection:"row",alignItems:"center",gap:4}}>
|
|
9
|
-
<C style={{backgroundColor:`${
|
|
10
|
-
<
|
|
9
|
+
<C style={{backgroundColor:`${r.purple}20`,borderRadius:10,paddingHorizontal:6,paddingVertical:1.5}}>
|
|
10
|
+
<N style={{color:r.purple,fontSize:9.5,fontFamily:O.interBold}}>
|
|
11
11
|
{a.length}
|
|
12
|
-
</
|
|
12
|
+
</N>
|
|
13
13
|
</C>
|
|
14
|
-
<
|
|
15
|
-
<
|
|
16
|
-
</
|
|
14
|
+
<Ve onPress={()=>P("")}hitSlop={10}style={I.clearBtn}>
|
|
15
|
+
<Ke color={r.grayTextWeak}size={13}/>
|
|
16
|
+
</Ve>
|
|
17
17
|
</C>}
|
|
18
18
|
</C>
|
|
19
|
-
<C style={
|
|
20
|
-
<$ style={[w.toolbarBtn,B&&{borderColor:`${t.darkOrange}50`,backgroundColor:`${t.darkOrange}18`}]}onPress={()=>re(e=>!e)}hitSlop={6}>
|
|
21
|
-
<He isPaused={B}color={B?t.darkOrange:t.grayTextStrong}size={16}/>
|
|
22
|
-
</$>
|
|
23
|
-
|
|
19
|
+
<C style={I.toolbarRight}>
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
<
|
|
27
|
-
{
|
|
28
|
-
|
|
21
|
+
<Ce style={[I.toolbarBtn,R&&{borderColor:`${r.brandPurple}60`,backgroundColor:`${r.brandPurple}15`}]}onPress={()=>Q(!0)}hitSlop={6}>
|
|
22
|
+
<Xe color={R?r.brandPurple:r.grayTextStrong}size={15}/>
|
|
23
|
+
{R&&<C style={{position:"absolute",top:2,right:2,width:7,height:7,borderRadius:3.5,backgroundColor:r.darkOrange,borderWidth:1,borderColor:r.white}}/>}
|
|
24
|
+
</Ce>
|
|
29
25
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
<Ce style={[I.toolbarBtn,{borderColor:`${r.errorColor}38`,backgroundColor:`${r.errorColor}0F`}]}onPress={we}hitSlop={6}>
|
|
27
|
+
<Ue color={r.errorColor}size={15}/>
|
|
28
|
+
</Ce>
|
|
33
29
|
</C>
|
|
34
30
|
</C>
|
|
35
31
|
|
|
36
32
|
|
|
37
33
|
<C style={{flexDirection:"row",alignItems:"center",marginBottom:8,paddingHorizontal:12,gap:6}}>
|
|
38
|
-
<
|
|
39
|
-
{[{id:"all",label
|
|
40
|
-
<C style={{flexDirection:"row",alignItems:"center",paddingHorizontal:9,paddingVertical:4.5,borderRadius:8,backgroundColor:
|
|
41
|
-
<
|
|
42
|
-
<
|
|
34
|
+
<Be horizontal showsHorizontalScrollIndicator={!1}style={{flex:1}}contentContainerStyle={{flexDirection:"row",alignItems:"center",gap:6,paddingRight:6}}>
|
|
35
|
+
{[{id:"all",label:$("common.all","All"),count:v.totalCount,color:r.purple,Icon:Je},{id:"ecommerce",label:"Ecommerce",count:v.ecommerce,color:r.amber600,Icon:Ye},{id:"page_view",label:"Screens",count:v.page_view,color:r.sky600,Icon:Ze},{id:"system",label:"System",count:v.system,color:r.violet600,Icon:et},{id:"custom",label:"Custom",count:v.custom,color:r.teal600,Icon:tt}].map(e=>{const o=e.id==="all"?A.categories.has("all"):!A.categories.has("all")&&A.categories.has(e.id),t=e.color||r.purple,w=o?r.white:t,L=e.Icon;return<Ge key={e.id}onPress={()=>ke(e.id)}>
|
|
36
|
+
<C style={{flexDirection:"row",alignItems:"center",paddingHorizontal:9,paddingVertical:4.5,borderRadius:8,backgroundColor:o?t:`${t}12`,borderWidth:1,borderColor:o?t:`${t}30`,gap:5}}>
|
|
37
|
+
<L size={11}color={w}/>
|
|
38
|
+
<N style={{fontFamily:O.interBold,fontSize:10.5,color:o?r.white:r.primaryBlack}}>
|
|
43
39
|
{e.label}
|
|
44
|
-
</
|
|
45
|
-
<C style={{backgroundColor:
|
|
46
|
-
<
|
|
40
|
+
</N>
|
|
41
|
+
<C style={{backgroundColor:o?"rgba(255,255,255,0.25)":`${t}20`,paddingHorizontal:5,paddingVertical:1,borderRadius:8,alignItems:"center",justifyContent:"center"}}>
|
|
42
|
+
<N style={{fontFamily:O.interBold,fontSize:9.5,color:o?r.white:t}}>
|
|
47
43
|
{e.count}
|
|
48
|
-
</
|
|
44
|
+
</N>
|
|
49
45
|
</C>
|
|
50
46
|
</C>
|
|
51
|
-
</
|
|
52
|
-
</
|
|
47
|
+
</Ge>})}
|
|
48
|
+
</Be>
|
|
53
49
|
</C>
|
|
54
50
|
</C>}
|
|
55
51
|
|
|
56
52
|
|
|
57
|
-
|
|
53
|
+
<$e visible={Le}onClose={()=>Q(!1)}/>
|
|
58
54
|
|
|
59
|
-
<C style={{flex:1}}onLayout={()=>
|
|
60
|
-
{
|
|
61
|
-
<
|
|
55
|
+
<C style={{flex:1}}onLayout={()=>ve(!0)}>
|
|
56
|
+
{Te?<>
|
|
57
|
+
<Pe ref={J}data={B}keyExtractor={Ae}renderItem={Ee}getItemLayout={ze}initialNumToRender={15}maxToRenderPerBatch={10}windowSize={9}removeClippedSubviews={Re.OS==="android"}renderToHardwareTextureAndroid={!0}ListEmptyComponent={<He isSearch={S.length>0}searchQuery={S}customTitle={S.length>0?"No matching analytics events":"No analytics events yet"}customSub={S.length>0?`No events matched "${S}"`:"Call setupAnalyticsLogger(analytics()) at app start."}onClearSearch={()=>P("")}/>}ListFooterComponent={a.length>0?<De count={B.length}totalCount={a.length}label="events"loadMoreStep={Se}hasMore={B.length<a.length}onLoadMore={()=>K(e=>e+Se)}/>:null}contentContainerStyle={[I.listContent,a.length===0&&{flexGrow:1}]}keyboardShouldPersistTaps="handled"/>
|
|
62
58
|
</>:null}
|
|
63
59
|
</C>
|
|
64
|
-
</>});export default
|
|
60
|
+
</>});export default ot;
|