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,151 +1,153 @@
|
|
|
1
|
-
import
|
|
2
|
-
<
|
|
3
|
-
</
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
{ie("network.successRate")}
|
|
23
|
-
</I>
|
|
24
|
-
</S>
|
|
25
|
-
|
|
26
|
-
<S style={{width:1,height:11,backgroundColor:e.dividerColor}}/>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<S style={{flexDirection:"row",alignItems:"center",gap:4}}>
|
|
30
|
-
<Ie color={e.purple}size={10}/>
|
|
31
|
-
<I style={{fontFamily:B.interBold,fontSize:10.5,color:e.purple}}>
|
|
32
|
-
{v.avgDuration}ms
|
|
33
|
-
</I>
|
|
34
|
-
<I style={{fontFamily:B.interRegular,fontSize:10,color:e.grayTextWeak}}>
|
|
35
|
-
{ie("network.avgLatency")}
|
|
36
|
-
</I>
|
|
37
|
-
</S>
|
|
1
|
+
import X,{useCallback as de,useMemo as J,useRef as Oe}from"react";import{FlatList as $e,Platform as qe,Pressable as Ne,ScrollView as He,Text as R,TextInput as Ae,View as C}from"react-native";import{useInspector as De}from"./InspectorContext";import O from"../TouchableScale";import Ce from"../AnimatedEntrance";import Me from"../DomainHeader";import Ee from"../LogCard";import We from"../EmptyState";import Ge from"../EndOfListFooter";import Qe from"./NetworkFilterModal";import b from"../../styles";import{AppColors as e}from"../../styles/AppColors";import{AppFonts as k}from"../../styles/AppFonts";import{METHOD_COLORS as Se}from"../../constants";import{useTranslation as _e}from"../../i18n";import{SearchIcon as Ue,ClearIcon as Ke,TrashIcon as Xe,SortArrowIcon as Je,FilterIcon as Te,ChevronIcon as Ye,CheckIcon as Ze,CircleCheckIcon as Co,CircleXIcon as So,LayersIcon as To,ClockIcon as Vo,RequestIcon as Io,ResponseIcon as Ro,AtomIcon as Fo}from"../NetworkIcons";const Lo=X.memo(()=>{const{groupedData:Y,loadMoreSection:Z,search:F,setSearch:M,setSearchScope:xe,quickFilter:G,setQuickFilter:j,handleDelete:Ve,selectedLogs:E,sortOrder:Q,setSortOrder:v,statusFilters:x,setStatusFilters:N,methodFilters:V,setMethodFilters:H,filteredLogs:$,logs:A,toggleSectionFilter:ee,toggleSectionCollapse:oe,minStart:te,totalRange:re,newLogIds:le,toggleSelect:ie,setSelected:se}=De(),{t:_}=_e(),Ie=Oe(null),[Re,U]=X.useState(!1),[ae,ne]=X.useState(!1),ke=J(()=>({statusCodes:x.size>0?new Set(x):new Set(["all"]),methods:V.size>0?new Set(V):new Set(["all"]),latency:"all",protocol:"all",sortBy:Q==="newest"?"time_desc":"time_asc"}),[x,V,Q]),Fe=de(o=>{o.statusCodes.has("all")||o.statusCodes.size===0?N(new Set):N(new Set(o.statusCodes)),o.methods.has("all")||o.methods.size===0?H(new Set):H(new Set([...o.methods].map(z=>z))),o.sortBy==="time_asc"?v("oldest"):v("newest")},[N,H,v]),L=J(()=>{let o=0,z=0,T=0,I=0,D=0,W=0;return A.forEach(S=>{const P=typeof S.status=="number"?S.status:parseInt(String(S.status),10);S.status===0||S.status==null||!isNaN(P)&&P>=400?o++:!isNaN(P)&&P>=200&&P<400&&z++,(S.duration||0)>=500&&T++;const B=(S.method||"").toUpperCase();B==="POST"&&I++,B==="GET"&&D++;const K=(S.url||"").toLowerCase(),q=(S.client||"").toLowerCase();(K.includes("graphql")||q.includes("graphql")||q.includes("apollo"))&&W++}),{all:A.length,errors:o,success:z,slow:T,post:I,get:D,graphql:W}},[A]),Le=J(()=>[{id:"all",label:"All",count:L.all,color:e.purple},{id:"errors",label:"Errors",count:L.errors,color:e.errorColor},{id:"success",label:"2xx OK",count:L.success,color:e.greenColor},{id:"slow",label:"Slow >500ms",count:L.slow,color:e.warningIconGold},{id:"POST",label:"POST",count:L.post,color:Se.POST||"#3B82F6"},{id:"GET",label:"GET",count:L.get,color:Se.GET||"#10B981"},{id:"graphql",label:"GraphQL",count:L.graphql,color:e.graphqlPink}],[L]),Be=de(({item:o,index:z})=>{if(o.type==="header")return<Ce index={z}distance={8}>
|
|
2
|
+
<Me pageName={o.pageName}color={o.color}stats={o.stats}activeFilters={o.activeFilters}onToggleFilter={ee}isCollapsed={o.isCollapsed}onToggleCollapse={oe}isFirst={o.isFirst}timestamp={o.timestamp}/>
|
|
3
|
+
</Ce>;if(o.type==="loadMore"){const{pageName:W,color:S,remainingCount:P,totalCount:B,loadedCount:K,loadMoreStep:q,hasMore:Pe}=o;return<C style={[b.treeNodeRow,b.treeNodeRowLast]}>
|
|
4
|
+
<C style={b.treeLines}>
|
|
5
|
+
<C style={[b.modernTreeLine,{borderColor:S},b.modernTreeLineLast]}/>
|
|
6
|
+
</C>
|
|
7
|
+
<C style={b.treeCardWrapper}>
|
|
8
|
+
{Pe?<O onPress={()=>Z(W,q||10)}hitSlop={6}style={{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:9,paddingHorizontal:12,marginVertical:3,marginRight:2,borderRadius:10,backgroundColor:`${S}14`,borderWidth:1.5,borderColor:`${S}40`,shadowColor:S,shadowOffset:{width:0,height:1.5},shadowOpacity:.1,shadowRadius:3,elevation:2}}>
|
|
9
|
+
<C style={{flexDirection:"row",alignItems:"center",gap:8}}>
|
|
10
|
+
<C style={{width:22,height:22,borderRadius:11,backgroundColor:S,alignItems:"center",justifyContent:"center",shadowColor:S,shadowOffset:{width:0,height:1},shadowOpacity:.25,shadowRadius:2,elevation:1}}>
|
|
11
|
+
<Ye color={e.white}size={9}direction="down"/>
|
|
12
|
+
</C>
|
|
13
|
+
<C>
|
|
14
|
+
<R style={{fontFamily:k.interBold,fontSize:12,color:S}}>
|
|
15
|
+
{_("footer.loadMoreRequests",{count:q,defaultValue:`Load ${q} More Requests`})}
|
|
16
|
+
</R>
|
|
17
|
+
<R style={{fontFamily:k.interRegular,fontSize:9.5,color:e.grayTextWeak,marginTop:1}}>
|
|
18
|
+
Showing {K} of {B} requests
|
|
19
|
+
</R>
|
|
20
|
+
</C>
|
|
21
|
+
</C>
|
|
38
22
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
23
|
+
<C style={{flexDirection:"row",alignItems:"center",backgroundColor:`${S}25`,paddingHorizontal:8,paddingVertical:4,borderRadius:8,borderWidth:1,borderColor:`${S}40`,gap:3}}>
|
|
24
|
+
<R style={{fontFamily:k.interBold,fontSize:10.5,color:S}}>
|
|
25
|
+
+{P}
|
|
26
|
+
</R>
|
|
27
|
+
<R style={{fontFamily:k.interRegular,fontSize:9,color:S}}>
|
|
28
|
+
more
|
|
29
|
+
</R>
|
|
30
|
+
</C>
|
|
31
|
+
</O>:<C style={{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:7,paddingHorizontal:11,marginVertical:3,marginRight:2,borderRadius:9,backgroundColor:`${S}0A`,borderWidth:1,borderColor:`${S}25`}}>
|
|
32
|
+
<C style={{flexDirection:"row",alignItems:"center",gap:7}}>
|
|
33
|
+
<C style={{width:17,height:17,borderRadius:8.5,backgroundColor:`${S}25`,alignItems:"center",justifyContent:"center"}}>
|
|
34
|
+
<Ze color={S}size={8}/>
|
|
35
|
+
</C>
|
|
36
|
+
<R style={{fontFamily:k.interMedium,fontSize:11,color:e.grayTextStrong}}>
|
|
37
|
+
{_("footer.allLoaded",{count:B,defaultValue:`All ${B} requests loaded`})}
|
|
38
|
+
</R>
|
|
39
|
+
</C>
|
|
51
40
|
|
|
41
|
+
<C style={{backgroundColor:`${S}18`,paddingHorizontal:7,paddingVertical:2,borderRadius:6}}>
|
|
42
|
+
<R style={{fontFamily:k.interBold,fontSize:9.5,color:S}}>
|
|
43
|
+
{B}/{B}
|
|
44
|
+
</R>
|
|
45
|
+
</C>
|
|
46
|
+
</C>}
|
|
47
|
+
</C>
|
|
48
|
+
</C>}const{log:T,isLast:I,color:D}=o;return<Ce index={z}distance={8}style={[b.treeNodeRow,I&&b.treeNodeRowLast]}>
|
|
49
|
+
<C style={b.treeLines}>
|
|
50
|
+
<C style={[b.modernTreeLine,{borderColor:D},I&&b.modernTreeLineLast]}/>
|
|
51
|
+
{!I&&<C style={[b.modernTreeBranch,{borderColor:D}]}/>}
|
|
52
|
+
</C>
|
|
53
|
+
<C style={b.treeCardWrapper}>
|
|
54
|
+
<Ee item={T}isSelected={E.has(T.id)}onToggleSelect={ie}onPress={()=>{se(T)}}timelineMinStart={te}timelineTotalRange={re}isNew={le.has(T.id)}searchStr={F}/>
|
|
55
|
+
</C>
|
|
56
|
+
</Ce>},[te,re,le,E,ie,F,ee,oe,Z,se,_]);return<C style={{flex:1}}>
|
|
57
|
+
<C style={{marginTop:6}}>
|
|
52
58
|
|
|
53
|
-
<
|
|
54
|
-
<
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
{L.length>0&&<S style={{flexDirection:"row",alignItems:"center",gap:4}}>
|
|
59
|
-
<S style={{backgroundColor:`${e.purple}20`,borderRadius:10,paddingHorizontal:6,paddingVertical:1.5}}>
|
|
60
|
-
<I style={{color:e.purple,fontSize:9.5,fontFamily:B.interBold}}>
|
|
61
|
-
{O.length}
|
|
62
|
-
</I>
|
|
63
|
-
</S>
|
|
64
|
-
<Ae onPress={()=>W("")}hitSlop={10}style={b.clearBtn}>
|
|
65
|
-
<Ze color={e.grayTextWeak}size={13}/>
|
|
66
|
-
</Ae>
|
|
67
|
-
</S>}
|
|
68
|
-
</S>
|
|
59
|
+
<C style={b.toolbarRow}>
|
|
60
|
+
<C style={[b.searchContainer,ae&&{borderColor:e.purple,borderWidth:1.5}]}>
|
|
61
|
+
<Ue color={ae?e.purple:e.grayTextWeak}size={15}/>
|
|
62
|
+
<Ae placeholder="Search URL, status, method, headers, body..."placeholderTextColor={e.grayTextWeak}value={F}onChangeText={M}onFocus={()=>ne(!0)}onBlur={()=>ne(!1)}style={b.searchInput}autoCorrect={!1}autoCapitalize="none"/>
|
|
69
63
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
64
|
+
{F.length>0&&<C style={{flexDirection:"row",alignItems:"center",gap:4}}>
|
|
65
|
+
<C style={{backgroundColor:`${e.purple}20`,borderRadius:10,paddingHorizontal:6,paddingVertical:1.5}}>
|
|
66
|
+
<R style={{color:e.purple,fontSize:9.5,fontFamily:k.interBold}}>
|
|
67
|
+
{$.length}
|
|
68
|
+
</R>
|
|
69
|
+
</C>
|
|
70
|
+
<Ne onPress={()=>M("")}hitSlop={10}style={b.clearBtn}>
|
|
71
|
+
<Ke color={e.grayTextWeak}size={13}/>
|
|
72
|
+
</Ne>
|
|
73
|
+
</C>}
|
|
74
|
+
</C>
|
|
74
75
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
<C style={b.toolbarRight}>
|
|
77
|
+
<O style={[b.toolbarBtn,{borderColor:`${e.errorColor}38`,backgroundColor:`${e.errorColor}0F`}]}onPress={Ve}hitSlop={6}>
|
|
78
|
+
<Xe color={e.errorColor}size={15}/>
|
|
79
|
+
{E.size>0&&<C style={b.trashBadge}>
|
|
80
|
+
<R style={b.trashBadgeText}>
|
|
81
|
+
{E.size}
|
|
82
|
+
</R>
|
|
83
|
+
</C>}
|
|
84
|
+
</O>
|
|
83
85
|
|
|
84
|
-
<
|
|
85
|
-
<
|
|
86
|
-
</
|
|
86
|
+
<O style={b.toolbarBtn}onPress={()=>v(o=>o==="newest"?"oldest":"newest")}hitSlop={10}>
|
|
87
|
+
<Je direction={Q==="newest"?"down":"up"}color={e.grayTextStrong}size={18}/>
|
|
88
|
+
</O>
|
|
87
89
|
|
|
88
|
-
<
|
|
89
|
-
<Te color={
|
|
90
|
-
{(
|
|
91
|
-
</
|
|
92
|
-
</
|
|
93
|
-
</
|
|
90
|
+
<O style={[b.toolbarBtn,(x.size>0||V.size>0)&&{borderColor:e.purple,backgroundColor:`${e.purple}15`}]}onPress={()=>U(!0)}hitSlop={6}>
|
|
91
|
+
<Te color={x.size>0||V.size>0?e.purple:e.grayTextStrong}size={16}/>
|
|
92
|
+
{(x.size>0||V.size>0)&&<C style={b.activeFilterDot}/>}
|
|
93
|
+
</O>
|
|
94
|
+
</C>
|
|
95
|
+
</C>
|
|
94
96
|
|
|
95
97
|
|
|
96
|
-
<
|
|
97
|
-
<
|
|
98
|
-
{
|
|
99
|
-
<
|
|
100
|
-
{
|
|
101
|
-
{
|
|
102
|
-
{
|
|
103
|
-
{
|
|
104
|
-
{
|
|
105
|
-
{
|
|
106
|
-
{
|
|
107
|
-
<
|
|
108
|
-
{
|
|
109
|
-
</
|
|
110
|
-
<
|
|
111
|
-
<
|
|
112
|
-
{
|
|
113
|
-
</
|
|
114
|
-
</
|
|
115
|
-
</
|
|
116
|
-
</
|
|
117
|
-
</
|
|
98
|
+
<C style={{flexDirection:"row",alignItems:"center",marginBottom:8,paddingHorizontal:12,gap:6}}>
|
|
99
|
+
<He horizontal showsHorizontalScrollIndicator={!1}style={{flex:1}}contentContainerStyle={{flexDirection:"row",alignItems:"center",gap:6,paddingRight:6}}>
|
|
100
|
+
{Le.map(o=>{const z=G===o.id,T=o.color||e.purple,I=z?e.white:T;return<O key={o.id}onPress={()=>{j(z?"all":o.id)}}>
|
|
101
|
+
<C style={{flexDirection:"row",alignItems:"center",paddingHorizontal:9,paddingVertical:4.5,borderRadius:8,backgroundColor:z?T:`${T}12`,borderWidth:1,borderColor:z?T:`${T}30`,gap:5}}>
|
|
102
|
+
{o.id==="all"&&<To size={11}color={I}/>}
|
|
103
|
+
{o.id==="errors"&&<So size={11}color={I}/>}
|
|
104
|
+
{o.id==="success"&&<Co size={11}color={I}/>}
|
|
105
|
+
{o.id==="slow"&&<Vo size={11}color={I}/>}
|
|
106
|
+
{o.id==="POST"&&<Io size={11}color={I}/>}
|
|
107
|
+
{o.id==="GET"&&<Ro size={11}color={I}/>}
|
|
108
|
+
{o.id==="graphql"&&<Fo size={11}color={I}/>}
|
|
109
|
+
<R style={{fontFamily:k.interBold,fontSize:10.5,color:z?e.white:e.primaryBlack}}>
|
|
110
|
+
{o.label}
|
|
111
|
+
</R>
|
|
112
|
+
<C style={{backgroundColor:z?"rgba(255,255,255,0.25)":`${T}20`,paddingHorizontal:5,paddingVertical:1,borderRadius:8}}>
|
|
113
|
+
<R style={{fontFamily:k.interBold,fontSize:9,color:z?e.white:T}}>
|
|
114
|
+
{o.count}
|
|
115
|
+
</R>
|
|
116
|
+
</C>
|
|
117
|
+
</C>
|
|
118
|
+
</O>})}
|
|
119
|
+
</He>
|
|
118
120
|
|
|
119
|
-
<
|
|
120
|
-
<
|
|
121
|
-
<Te size={11}color={
|
|
122
|
-
<
|
|
121
|
+
<O onPress={()=>U(!0)}style={{flexShrink:0}}>
|
|
122
|
+
<C style={{flexDirection:"row",alignItems:"center",paddingHorizontal:10,paddingVertical:4.5,borderRadius:8,backgroundColor:x.size>0||V.size>0?`${e.purple}20`:e.grayBackground,borderWidth:1,borderColor:x.size>0||V.size>0?e.purple:e.grayBorderSecondary,gap:5,shadowColor:e.black,shadowOpacity:.04,shadowRadius:2,shadowOffset:{width:0,height:1},elevation:1}}>
|
|
123
|
+
<Te size={11}color={x.size>0||V.size>0?e.purple:e.grayText}/>
|
|
124
|
+
<R style={{fontFamily:k.interBold,fontSize:10.5,color:x.size>0||V.size>0?e.purple:e.grayText}}>
|
|
123
125
|
More Filters
|
|
124
|
-
</
|
|
125
|
-
{(
|
|
126
|
-
<
|
|
127
|
-
{
|
|
128
|
-
</
|
|
129
|
-
</
|
|
130
|
-
</
|
|
131
|
-
</
|
|
132
|
-
</
|
|
126
|
+
</R>
|
|
127
|
+
{(x.size>0||V.size>0)&&<C style={{backgroundColor:e.purple,paddingHorizontal:4.5,paddingVertical:1,borderRadius:6}}>
|
|
128
|
+
<R style={{fontFamily:k.interBold,fontSize:8.5,color:e.white}}>
|
|
129
|
+
{x.size+V.size}
|
|
130
|
+
</R>
|
|
131
|
+
</C>}
|
|
132
|
+
</C>
|
|
133
|
+
</O>
|
|
134
|
+
</C>
|
|
133
135
|
|
|
134
136
|
|
|
135
|
-
{(
|
|
136
|
-
<
|
|
137
|
-
Showing {
|
|
138
|
-
</
|
|
139
|
-
<
|
|
140
|
-
<
|
|
137
|
+
{(G!=="all"||F.trim().length>0||x.size>0||V.size>0||$.length!==A.length)&&<C style={{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginHorizontal:12,marginBottom:8,paddingHorizontal:10,paddingVertical:5.5,backgroundColor:`${e.purple}10`,borderRadius:8,borderWidth:1,borderColor:`${e.purple}25`}}>
|
|
138
|
+
<R style={{fontFamily:k.interMedium,fontSize:10.5,color:e.purple}}>
|
|
139
|
+
Showing {$.length} of {A.length} requests
|
|
140
|
+
</R>
|
|
141
|
+
<O onPress={()=>{M(""),j("all"),N(new Set),H(new Set)}}>
|
|
142
|
+
<R style={{fontFamily:k.interBold,fontSize:10.5,color:e.errorColor}}>
|
|
141
143
|
Clear All Filters
|
|
142
|
-
</
|
|
143
|
-
</
|
|
144
|
-
</
|
|
145
|
-
</
|
|
144
|
+
</R>
|
|
145
|
+
</O>
|
|
146
|
+
</C>}
|
|
147
|
+
</C>
|
|
146
148
|
|
|
147
|
-
|
|
149
|
+
<$e ref={Ie}data={Y}keyExtractor={o=>o?.id?.toString()}renderItem={Be}initialNumToRender={15}maxToRenderPerBatch={10}windowSize={9}removeClippedSubviews={qe.OS==="android"}renderToHardwareTextureAndroid={!0}ListEmptyComponent={<We isSearch={F.length>0||x.size>0||V.size>0||G!=="all"}searchQuery={F}customTitle={F.length>0?"No matching API requests":"No network activity"}onClearSearch={()=>{M(""),N(new Set),H(new Set),j("all"),xe("all")}}/>}ListFooterComponent={Y.length>0?<Ge count={$.length}totalCount={$.length}label="requests"/>:null}contentContainerStyle={[b.listContent,$.length===0&&{flexGrow:1}]}keyboardShouldPersistTaps="handled"/>
|
|
148
150
|
|
|
149
151
|
|
|
150
|
-
<
|
|
151
|
-
</
|
|
152
|
+
<Qe visible={Re}onClose={()=>U(!1)}filters={ke}onApply={Fe}searchQuery={F}/>
|
|
153
|
+
</C>});export default Lo;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import O,{useMemo as $}from"react";import{StyleSheet as F,Text as T,View as C}from"react-native";import{AppColors as e}from"../../styles/AppColors";import{AppFonts as k}from"../../styles/AppFonts";import{formatTime as W}from"../../helpers";import{BellIcon as N,ClockIcon as E,ForwardChevronIcon as A,KeyIcon as U,SunIcon as M,MoonIcon as G,ExternalLinkIcon as K,CloudPushIcon as _}from"../NetworkIcons";import D from"../HighlightText";import X from"../TouchableScale";const q=B=>{const r=(B||"").toLowerCase();return r.includes("salesforce")||r==="sfmc"?{badgeColor:e.sky600,border:e.sky600,cardBg:`${e.sky600}04`,label:"SALESFORCE"}:r.includes("fcm")||r.includes("firebase")?{badgeColor:e.firebaseOrange,border:e.firebaseOrange,cardBg:`${e.firebaseOrange}04`,label:"FCM"}:r.includes("apns")||r.includes("apple")?{badgeColor:e.slate700,border:e.slate700,cardBg:`${e.slate700}04`,label:"APNS"}:r.includes("expo")?{badgeColor:e.brandPurple,border:e.brandPurple,cardBg:`${e.brandPurple}04`,label:"EXPO"}:r.includes("notifee")?{badgeColor:e.pink500,border:e.pink500,cardBg:`${e.pink500}04`,label:"NOTIFEE"}:r.includes("onesignal")?{badgeColor:e.errorColor,border:e.errorColor,cardBg:`${e.errorColor}04`,label:"ONESIGNAL"}:{badgeColor:e.purple,border:e.purple,cardBg:`${e.purple}04`,label:(B||"PUSH").toUpperCase()}},J=(B,r)=>{if(r==="opened")return{label:"OPENED",text:e.brandPurple,bg:`${e.brandPurple}14`,border:`${e.brandPurple}30`,Icon:K};const P=(B||"").toLowerCase();return P==="foreground"?{label:"FOREGROUND",text:e.greenColor,bg:`${e.greenColor}14`,border:`${e.greenColor}30`,Icon:M}:P==="background"?{label:"BACKGROUND",text:e.amber600,bg:`${e.amber600}14`,border:`${e.amber600}30`,Icon:G}:{label:(B||"RECEIVED").toUpperCase(),text:e.grayTextWeak,bg:`${e.grayTextWeak}14`,border:`${e.grayTextWeak}30`,Icon:_}},V=O.memo(function({item:r,onPress:P,searchStr:R=""}){const S=$(()=>q(r.source),[r.source]),H=$(()=>J(r.appState,r.action),[r.appState,r.action]),I=$(()=>r.data?Object.keys(r.data).length:0,[r.data]),z=$(()=>!!(r.data?.deepLink||r.data?.openDirectUrl||r.data?._od||r.customDomainAttributes?.openDirectUrl),[r.data,r.customDomainAttributes]),L=H.Icon;return<X onPress={P}style={[o.card,{borderLeftWidth:3.5,borderLeftColor:S.border,backgroundColor:S.cardBg}]}accessibilityRole="button"accessibilityLabel={`Push Notification: ${r.title||"Notification"}`}>
|
|
2
|
+
<C style={o.cardBody}>
|
|
3
|
+
|
|
4
|
+
<C style={o.cardHeaderRow}>
|
|
5
|
+
<C style={o.cardHeaderLeft}>
|
|
6
|
+
<T style={o.serialNumber}>
|
|
7
|
+
#{r.id?r.id.replace(/^push_/,"").slice(-4):"1"}
|
|
8
|
+
</T>
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<C style={[o.methodBadge,{backgroundColor:S.badgeColor}]}>
|
|
12
|
+
<T style={o.methodBadgeText}>{S.label}</T>
|
|
13
|
+
</C>
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
<C style={[o.chip,{backgroundColor:`${S.badgeColor}12`,borderColor:`${S.badgeColor}2E`}]}>
|
|
17
|
+
<T style={[o.chipText,{color:S.badgeColor}]}numberOfLines={1}>
|
|
18
|
+
push.{(r.source||"remote").toLowerCase()}
|
|
19
|
+
</T>
|
|
20
|
+
</C>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
{I>0&&<C style={[o.chip,{backgroundColor:`${e.teal600}14`,borderColor:`${e.teal600}33`}]}>
|
|
24
|
+
<T style={[o.chipText,{color:e.teal600}]}>
|
|
25
|
+
Payload{`{${I}}`}
|
|
26
|
+
</T>
|
|
27
|
+
</C>}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
{z&&<C style={[o.chip,{backgroundColor:`${e.brandPurple}14`,borderColor:`${e.brandPurple}33`}]}>
|
|
31
|
+
<T style={[o.chipText,{color:e.brandPurple}]}>
|
|
32
|
+
🔗 Link
|
|
33
|
+
</T>
|
|
34
|
+
</C>}
|
|
35
|
+
</C>
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
<C style={o.cardHeaderRight}>
|
|
39
|
+
<C style={[o.statusPill,{backgroundColor:H.bg,borderColor:H.border}]}>
|
|
40
|
+
<L color={H.text}size={9.5}/>
|
|
41
|
+
<T style={[o.statusPillText,{color:H.text}]}>
|
|
42
|
+
{H.label}
|
|
43
|
+
</T>
|
|
44
|
+
</C>
|
|
45
|
+
<A color={e.grayTextWeak}size={13}/>
|
|
46
|
+
</C>
|
|
47
|
+
</C>
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
<C style={o.messageBox}>
|
|
51
|
+
<D text={r.title||"(No Title)"}searchWords={R?[R]:[]}numberOfLines={1}style={o.messageTitle}highlightStyle={o.highlight}/>
|
|
52
|
+
<D text={r.body||"(No message body)"}searchWords={R?[R]:[]}numberOfLines={2}style={o.messageBody}highlightStyle={o.highlight}/>
|
|
53
|
+
</C>
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
<C style={o.cardFooterRow}>
|
|
57
|
+
<C style={o.footerLeft}>
|
|
58
|
+
<C style={o.cardDateRow}>
|
|
59
|
+
<E color={e.slate400}size={10}/>
|
|
60
|
+
<T style={o.cardDateText}numberOfLines={1}>
|
|
61
|
+
{W(r.timestamp)}
|
|
62
|
+
</T>
|
|
63
|
+
</C>
|
|
64
|
+
|
|
65
|
+
{r.channelId?<C style={o.callerChip}>
|
|
66
|
+
<N color={e.skySoftText}size={8.5}/>
|
|
67
|
+
<T style={o.callerChipText}numberOfLines={1}ellipsizeMode="middle">
|
|
68
|
+
{r.channelId}
|
|
69
|
+
</T>
|
|
70
|
+
</C>:null}
|
|
71
|
+
|
|
72
|
+
{r.customDomainAttributes?.journeyName?<C style={[o.callerChip,{backgroundColor:`${e.brandPurple}14`,borderColor:`${e.brandPurple}30`}]}>
|
|
73
|
+
<T style={[o.callerChipText,{color:e.brandPurple}]}numberOfLines={1}ellipsizeMode="middle">
|
|
74
|
+
{r.customDomainAttributes.journeyName}
|
|
75
|
+
</T>
|
|
76
|
+
</C>:null}
|
|
77
|
+
</C>
|
|
78
|
+
|
|
79
|
+
<C style={o.footerRight}>
|
|
80
|
+
{I>0&&<C style={o.metaStatChip}>
|
|
81
|
+
<U color={e.purple}size={8.5}/>
|
|
82
|
+
<T style={o.metaStatText}>
|
|
83
|
+
{I} {I===1?"key":"keys"}
|
|
84
|
+
</T>
|
|
85
|
+
</C>}
|
|
86
|
+
</C>
|
|
87
|
+
</C>
|
|
88
|
+
</C>
|
|
89
|
+
</X>}),o=F.create({card:{height:140,alignSelf:"stretch",borderRadius:10,overflow:"hidden",borderWidth:1,borderColor:e.dividerColor,shadowColor:e.shadowColorString,marginBottom:6},cardBody:{height:"100%",paddingHorizontal:12,paddingTop:10,paddingBottom:8,justifyContent:"space-between"},cardHeaderRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:22,minHeight:22,maxHeight:22},cardHeaderLeft:{flexDirection:"row",alignItems:"center",flex:1,marginRight:8,gap:6,minWidth:0,overflow:"hidden"},cardHeaderRight:{flexDirection:"row",alignItems:"center",gap:6,flexShrink:0},serialNumber:{fontFamily:k.interBold,color:e.grayTextWeak,fontSize:10},methodBadge:{paddingHorizontal:7,paddingVertical:2.5,borderRadius:5,alignItems:"center",justifyContent:"center"},methodBadgeText:{fontFamily:k.interBold,fontSize:9.5,lineHeight:12,letterSpacing:.5,color:e.white},chip:{paddingHorizontal:6,paddingVertical:2,borderRadius:4,borderWidth:1},chipText:{fontFamily:k.interBold,fontSize:9,lineHeight:12},statusPill:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:7,paddingVertical:2.5,borderRadius:6,borderWidth:1,flexShrink:0},statusPillText:{fontFamily:k.interBold,fontSize:10,lineHeight:13},messageBox:{backgroundColor:e.grayBackground,borderRadius:7,borderWidth:1,borderColor:e.dividerColor,paddingHorizontal:10,paddingVertical:6,height:68,minHeight:68,maxHeight:68,justifyContent:"center",gap:2,overflow:"hidden"},messageTitle:{fontFamily:k.interBold,fontSize:12,color:e.primaryBlack,lineHeight:16},messageBody:{fontFamily:k.interRegular,fontSize:11,color:e.grayText,lineHeight:15},highlight:{backgroundColor:e.yellowHighlight,color:e.primaryBlack,borderRadius:2},cardFooterRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:18,minHeight:18,maxHeight:18,gap:6},footerLeft:{flexDirection:"row",alignItems:"center",gap:6,flex:1,minWidth:0,overflow:"hidden"},footerRight:{flexDirection:"row",alignItems:"center",gap:5,flexShrink:0},cardDateRow:{flexDirection:"row",alignItems:"center",gap:3.5},cardDateText:{fontFamily:k.interRegular,fontSize:10,lineHeight:13,color:e.slate400},callerChip:{flexDirection:"row",alignItems:"center",gap:3,backgroundColor:e.skySoftBg,borderColor:e.skySoftBorder,borderWidth:1,paddingHorizontal:5,paddingVertical:1.5,borderRadius:4,flexShrink:1,minWidth:0},callerChipText:{color:e.skySoftText,fontSize:9,lineHeight:12,fontFamily:k.interBold},metaStatChip:{flexDirection:"row",alignItems:"center",gap:3,backgroundColor:`${e.purple}14`,borderColor:`${e.purple}2B`,borderWidth:1,paddingHorizontal:5,paddingVertical:1.5,borderRadius:4},metaStatText:{color:e.purple,fontSize:9,lineHeight:12,fontFamily:k.interBold}});V.displayName="PushCard";export default V;
|