react-native-inapp-inspector 2.3.23 → 2.3.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/components/AnalyticsDetail.js +8 -8
- package/dist/commonjs/components/AnalyticsEventCard.js +11 -8
- package/dist/commonjs/components/AppHeaderLogo.js +1 -1
- package/dist/commonjs/components/BrandSquareIcon.js +12 -12
- package/dist/commonjs/components/ConsoleLogCard.d.ts +1 -0
- package/dist/commonjs/components/ConsoleLogCard.js +92 -80
- package/dist/commonjs/components/EndOfListFooter.d.ts +5 -1
- package/dist/commonjs/components/EndOfListFooter.js +27 -5
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +30 -298
- package/dist/commonjs/components/Inspector/ConsoleTab.js +38 -93
- package/dist/commonjs/components/Inspector/CrashDetail.js +12 -12
- package/dist/commonjs/components/Inspector/CrashTab.js +43 -33
- package/dist/commonjs/components/Inspector/DebuggingTab.js +9 -9
- package/dist/commonjs/components/Inspector/DeviceInfoTab.js +54 -52
- package/dist/commonjs/components/Inspector/InspectorHeader.js +1 -1
- package/dist/commonjs/components/Inspector/LogDetail.js +6 -6
- package/dist/commonjs/components/Inspector/MainScreen.js +23 -25
- package/dist/commonjs/components/Inspector/MediaGalleryTab.js +1 -1
- package/dist/commonjs/components/Inspector/MediaPreviewModal.js +3 -3
- package/dist/commonjs/components/Inspector/NetworkTab.js +31 -31
- package/dist/commonjs/components/Inspector/NpmStarPrompt.js +3 -3
- package/dist/commonjs/components/Inspector/NpmUpdateToast.js +21 -22
- package/dist/commonjs/components/Inspector/ReduxDetail.js +1 -1
- package/dist/commonjs/components/Inspector/ReduxTab.js +110 -97
- package/dist/commonjs/components/Inspector/SettingsPanel.js +48 -100
- package/dist/commonjs/components/Inspector/StorageTab.js +56 -52
- package/dist/commonjs/components/Inspector/TabBar.js +29 -26
- package/dist/commonjs/components/JsonViewer.js +169 -164
- package/dist/commonjs/components/LogCard.js +34 -38
- package/dist/commonjs/components/LogSyntaxHighlighter.js +3 -3
- package/dist/commonjs/components/SegmentedTabs.d.ts +4 -1
- package/dist/commonjs/components/SegmentedTabs.js +8 -8
- package/dist/commonjs/constants/index.js +1 -1
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/networkLogger.js +1 -2
- package/dist/commonjs/helpers/index.d.ts +6 -0
- package/dist/commonjs/helpers/index.js +4 -4
- package/dist/commonjs/helpers/memoryManager.d.ts +0 -1
- package/dist/commonjs/helpers/memoryManager.js +1 -1
- package/dist/commonjs/helpers/remoteConfig.js +1 -1
- package/dist/commonjs/helpers/settingsStore.js +1 -1
- package/dist/commonjs/i18n/index.d.ts +35 -0
- package/dist/commonjs/i18n/index.js +1 -1
- package/dist/commonjs/i18n/locales/ar.json +1 -0
- package/dist/commonjs/i18n/locales/de.json +1 -0
- package/dist/commonjs/i18n/locales/en.json +1 -1
- package/dist/commonjs/i18n/locales/es.json +1 -0
- package/dist/commonjs/i18n/locales/fr.json +1 -0
- package/dist/commonjs/i18n/locales/hi.json +1 -0
- package/dist/commonjs/i18n/locales/ja.json +1 -0
- package/dist/commonjs/i18n/locales/ko.json +1 -0
- package/dist/commonjs/i18n/locales/pt.json +1 -0
- package/dist/commonjs/i18n/locales/ru.json +1 -0
- package/dist/commonjs/i18n/locales/zh.json +1 -0
- package/dist/commonjs/index.d.ts +2 -4
- package/dist/commonjs/index.js +2 -2
- package/dist/commonjs/styles/AppColors.d.ts +40 -0
- package/dist/commonjs/styles/AppColors.js +1 -1
- package/dist/commonjs/styles/index.js +1 -1
- package/dist/commonjs/types/enums.d.ts +0 -20
- package/dist/commonjs/types/enums.js +1 -1
- package/dist/esm/components/AnalyticsDetail.js +75 -75
- package/dist/esm/components/AnalyticsEventCard.js +20 -17
- package/dist/esm/components/AppHeaderLogo.js +5 -5
- package/dist/esm/components/BrandSquareIcon.js +39 -39
- package/dist/esm/components/ConsoleLogCard.d.ts +1 -0
- package/dist/esm/components/ConsoleLogCard.js +98 -86
- package/dist/esm/components/EndOfListFooter.d.ts +5 -1
- package/dist/esm/components/EndOfListFooter.js +36 -14
- package/dist/esm/components/Inspector/AnalyticsTab.js +47 -315
- package/dist/esm/components/Inspector/ConsoleTab.js +61 -116
- package/dist/esm/components/Inspector/CrashDetail.js +49 -49
- package/dist/esm/components/Inspector/CrashTab.js +75 -65
- package/dist/esm/components/Inspector/DebuggingTab.js +31 -31
- package/dist/esm/components/Inspector/DeviceInfoTab.js +146 -144
- package/dist/esm/components/Inspector/InspectorHeader.js +5 -5
- package/dist/esm/components/Inspector/LogDetail.js +1 -1
- package/dist/esm/components/Inspector/MainScreen.js +51 -53
- package/dist/esm/components/Inspector/MediaGalleryTab.js +1 -1
- package/dist/esm/components/Inspector/MediaPreviewModal.js +31 -31
- package/dist/esm/components/Inspector/NetworkTab.js +63 -63
- package/dist/esm/components/Inspector/NpmStarPrompt.js +42 -42
- package/dist/esm/components/Inspector/NpmUpdateToast.js +45 -46
- package/dist/esm/components/Inspector/ReduxDetail.js +1 -1
- package/dist/esm/components/Inspector/ReduxTab.js +163 -150
- package/dist/esm/components/Inspector/SettingsPanel.js +136 -188
- package/dist/esm/components/Inspector/StorageTab.js +88 -84
- package/dist/esm/components/Inspector/TabBar.js +37 -34
- package/dist/esm/components/JsonViewer.js +173 -168
- package/dist/esm/components/LogCard.js +38 -42
- package/dist/esm/components/LogSyntaxHighlighter.js +1 -1
- package/dist/esm/components/SegmentedTabs.d.ts +4 -1
- package/dist/esm/components/SegmentedTabs.js +8 -8
- package/dist/esm/constants/index.js +1 -1
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/networkLogger.js +1 -2
- package/dist/esm/helpers/index.d.ts +6 -0
- package/dist/esm/helpers/index.js +4 -4
- package/dist/esm/helpers/memoryManager.d.ts +0 -1
- package/dist/esm/helpers/memoryManager.js +1 -1
- package/dist/esm/helpers/remoteConfig.js +1 -1
- package/dist/esm/helpers/settingsStore.js +1 -1
- package/dist/esm/i18n/index.d.ts +35 -0
- package/dist/esm/i18n/index.js +1 -1
- package/dist/esm/i18n/locales/ar.json +1 -0
- package/dist/esm/i18n/locales/de.json +1 -0
- package/dist/esm/i18n/locales/en.json +1 -1
- package/dist/esm/i18n/locales/es.json +1 -0
- package/dist/esm/i18n/locales/fr.json +1 -0
- package/dist/esm/i18n/locales/hi.json +1 -0
- package/dist/esm/i18n/locales/ja.json +1 -0
- package/dist/esm/i18n/locales/ko.json +1 -0
- package/dist/esm/i18n/locales/pt.json +1 -0
- package/dist/esm/i18n/locales/ru.json +1 -0
- package/dist/esm/i18n/locales/zh.json +1 -0
- package/dist/esm/index.d.ts +2 -4
- package/dist/esm/index.js +5 -5
- package/dist/esm/styles/AppColors.d.ts +40 -0
- package/dist/esm/styles/AppColors.js +1 -1
- package/dist/esm/styles/index.js +1 -1
- package/dist/esm/types/enums.d.ts +0 -20
- package/dist/esm/types/enums.js +1 -1
- package/package.json +1 -15
- package/dist/commonjs/bundle.d.ts +0 -2
- package/dist/commonjs/bundle.js +0 -1
- package/dist/commonjs/components/Inspector/BundleTab.d.ts +0 -48
- package/dist/commonjs/components/Inspector/BundleTab.js +0 -1297
- package/dist/commonjs/components/Inspector/PerformanceTab.d.ts +0 -27
- package/dist/commonjs/components/Inspector/PerformanceTab.js +0 -454
- package/dist/commonjs/customHooks/bundleAnalyzer.d.ts +0 -115
- package/dist/commonjs/customHooks/bundleAnalyzer.js +0 -1
- package/dist/commonjs/customHooks/performanceTracker.d.ts +0 -144
- package/dist/commonjs/customHooks/performanceTracker.js +0 -63
- package/dist/commonjs/performance.d.ts +0 -2
- package/dist/commonjs/performance.js +0 -1
- package/dist/esm/bundle.d.ts +0 -2
- package/dist/esm/bundle.js +0 -1
- package/dist/esm/components/Inspector/BundleTab.d.ts +0 -48
- package/dist/esm/components/Inspector/BundleTab.js +0 -1297
- package/dist/esm/components/Inspector/PerformanceTab.d.ts +0 -27
- package/dist/esm/components/Inspector/PerformanceTab.js +0 -454
- package/dist/esm/customHooks/bundleAnalyzer.d.ts +0 -115
- package/dist/esm/customHooks/bundleAnalyzer.js +0 -1
- package/dist/esm/customHooks/performanceTracker.d.ts +0 -144
- package/dist/esm/customHooks/performanceTracker.js +0 -63
- package/dist/esm/performance.d.ts +0 -2
- package/dist/esm/performance.js +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
<
|
|
3
|
-
</Se>;const{log:
|
|
4
|
-
<S style={
|
|
5
|
-
<S style={[
|
|
6
|
-
{!z&&<S style={[
|
|
1
|
+
import U,{useCallback as ue,useMemo as A,useRef as Ee}from"react";import{FlatList as He,Platform as qe,Pressable as Ae,ScrollView as We,Text as I,TextInput as $e,View as S}from"react-native";import{useInspector as Ge}from"./InspectorContext";import M from"../TouchableScale";import Se from"../AnimatedEntrance";import Qe from"../DomainHeader";import _e from"../LogCard";import Ue from"../EmptyState";import Ke from"../EndOfListFooter";import Xe from"./NetworkFilterModal";import b from"../../styles";import{AppColors as e}from"../../styles/AppColors";import{AppFonts as B}from"../../styles/AppFonts";import{METHOD_COLORS as Ce}from"../../constants";import{useTranslation as Je}from"../../i18n";import{SearchIcon as Ye,ClearIcon as Ze,TrashIcon as St,SortArrowIcon as Ct,FilterIcon as Te,CircleCheckIcon as Tt,CircleXIcon as It,LayersIcon as Ft,HeaderPauseIcon as Rt,ClockIcon as Ie,RequestIcon as Bt,ResponseIcon as Vt,AtomIcon as Pt}from"../NetworkIcons";const Lt=U.memo(()=>{const{groupedData:j,search:L,setSearch:W,searchScope:Dt,setSearchScope:Fe,isRegexSearch:Ot,setIsRegexSearch:vt,isCaseSensitive:Nt,setIsCaseSensitive:Mt,quickFilter:K,setQuickFilter:X,handleDelete:Re,selectedLogs:$,sortOrder:J,setSortOrder:G,statusFilters:T,setStatusFilters:H,methodFilters:x,setMethodFilters:q,availableMethods:Et,filteredLogs:O,logs:P,toggleSectionFilter:ee,toggleSectionCollapse:te,minStart:oe,totalRange:re,newLogIds:le,toggleSelect:se,setSelected:ae,isNetworkPaused:Y,setIsNetworkPaused:Be}=Ge(),{t:ie}=Je(),Ve=Ee(null),[Q,Pe]=U.useState(100),Le=A(()=>{let t=0;const C=[];for(const w of j)w.type==="header"?C.push(w):w.type==="log"&&t<Q&&(C.push(w),t++);return C},[j,Q]),[De,Z]=U.useState(!1),[ne,ce]=U.useState(!1),Oe=A(()=>({statusCodes:T.size>0?new Set(T):new Set(["all"]),methods:x.size>0?new Set(x):new Set(["all"]),latency:"all",protocol:"all",sortBy:J==="newest"?"time_desc":"time_asc"}),[T,x,J]),ve=ue(t=>{t.statusCodes.has("all")||t.statusCodes.size===0?H(new Set):H(new Set(t.statusCodes)),t.methods.has("all")||t.methods.size===0?q(new Set):q(new Set([...t.methods].map(C=>C))),t.sortBy==="time_asc"?G("oldest"):G("newest")},[H,q,G]),D=A(()=>{let t=0,C=0,w=0,z=0,F=0,_=0;return P.forEach(V=>{const E=typeof V.status=="number"?V.status:parseInt(String(V.status),10);V.status===0||V.status==null||!isNaN(E)&&E>=400?t++:!isNaN(E)&&E>=200&&E<400&&C++,(V.duration||0)>=500&&w++;const R=(V.method||"").toUpperCase();R==="POST"&&z++,R==="GET"&&F++;const N=(V.url||"").toLowerCase(),de=(V.client||"").toLowerCase();(N.includes("graphql")||de.includes("graphql")||de.includes("apollo"))&&_++}),{all:P.length,errors:t,success:C,slow:w,post:z,get:F,graphql:_}},[P]),Ne=A(()=>[{id:"all",label:"All",count:D.all,color:e.purple},{id:"errors",label:"Errors",count:D.errors,color:e.errorColor},{id:"success",label:"2xx OK",count:D.success,color:e.greenColor},{id:"slow",label:"Slow >500ms",count:D.slow,color:e.warningIconGold},{id:"POST",label:"POST",count:D.post,color:Ce.POST||"#3B82F6"},{id:"GET",label:"GET",count:D.get,color:Ce.GET||"#10B981"},{id:"graphql",label:"GraphQL",count:D.graphql,color:e.graphqlPink}],[D]),v=A(()=>{if(!P||P.length===0)return null;let t=0,C=0,w=0,z=0;const F=[];P.forEach(R=>{if(R.status!=null){C++;const N=typeof R.status=="number"?R.status:parseInt(String(R.status),10);isNaN(N)||N>=200&&N<400&&t++}typeof R.duration=="number"&&R.duration>0&&(F.push(R.duration),w+=R.duration)}),F.sort((R,N)=>R-N);const _=F.length>0?Math.round(w/F.length):0,V=F.length>0?F[Math.floor(F.length*.95)]:0;return{successRate:C>0?Math.round(t/C*100):100,avgDuration:_,p95:V,totalCount:P.length}},[P]),Me=ue(({item:t,index:C})=>{if(t.type==="header")return<Se index={C}distance={8}>
|
|
2
|
+
<Qe pageName={t.pageName}color={t.color}stats={t.stats}activeFilters={t.activeFilters}onToggleFilter={ee}isCollapsed={t.isCollapsed}onToggleCollapse={te}isFirst={t.isFirst}timestamp={t.timestamp}/>
|
|
3
|
+
</Se>;const{log:w,isLast:z,color:F}=t;return<Se index={C}distance={8}style={[b.treeNodeRow,z&&b.treeNodeRowLast]}>
|
|
4
|
+
<S style={b.treeLines}>
|
|
5
|
+
<S style={[b.modernTreeLine,{borderColor:F},z&&b.modernTreeLineLast]}/>
|
|
6
|
+
{!z&&<S style={[b.modernTreeBranch,{borderColor:F}]}/>}
|
|
7
7
|
</S>
|
|
8
|
-
<S style={
|
|
9
|
-
|
|
8
|
+
<S style={b.treeCardWrapper}>
|
|
9
|
+
<_e item={w}isSelected={$.has(w.id)}onToggleSelect={se}onPress={()=>{ae(w)}}timelineMinStart={oe}timelineTotalRange={re}isNew={le.has(w.id)}searchStr={L}/>
|
|
10
10
|
</S>
|
|
11
|
-
</Se>},[oe,
|
|
11
|
+
</Se>},[oe,re,le,$,se,L,ee,te,ae]);return<S style={{flex:1}}>
|
|
12
12
|
<S style={{marginTop:6}}>
|
|
13
13
|
|
|
14
14
|
{v!=null&&v.totalCount>0&&<S style={{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:e.grayBackground,borderRadius:8,paddingHorizontal:10,paddingVertical:5.5,marginHorizontal:12,marginBottom:6,borderWidth:1,borderColor:e.dividerColor}}>
|
|
@@ -19,7 +19,7 @@ import J,{useCallback as de,useMemo as Q,useRef as Oe}from"react";import{FlatLis
|
|
|
19
19
|
{v.successRate}%
|
|
20
20
|
</I>
|
|
21
21
|
<I style={{fontFamily:B.interRegular,fontSize:10,color:e.grayTextWeak}}>
|
|
22
|
-
{
|
|
22
|
+
{ie("network.successRate")}
|
|
23
23
|
</I>
|
|
24
24
|
</S>
|
|
25
25
|
|
|
@@ -27,12 +27,12 @@ import J,{useCallback as de,useMemo as Q,useRef as Oe}from"react";import{FlatLis
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
<S style={{flexDirection:"row",alignItems:"center",gap:4}}>
|
|
30
|
-
<
|
|
30
|
+
<Ie color={e.purple}size={10}/>
|
|
31
31
|
<I style={{fontFamily:B.interBold,fontSize:10.5,color:e.purple}}>
|
|
32
32
|
{v.avgDuration}ms
|
|
33
33
|
</I>
|
|
34
34
|
<I style={{fontFamily:B.interRegular,fontSize:10,color:e.grayTextWeak}}>
|
|
35
|
-
{
|
|
35
|
+
{ie("network.avgLatency")}
|
|
36
36
|
</I>
|
|
37
37
|
</S>
|
|
38
38
|
|
|
@@ -50,75 +50,75 @@ import J,{useCallback as de,useMemo as Q,useRef as Oe}from"react";import{FlatLis
|
|
|
50
50
|
</S>}
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
<S style={
|
|
54
|
-
<S style={[
|
|
55
|
-
<
|
|
56
|
-
|
|
53
|
+
<S style={b.toolbarRow}>
|
|
54
|
+
<S style={[b.searchContainer,ne&&{borderColor:e.purple,borderWidth:1.5}]}>
|
|
55
|
+
<Ye color={ne?e.purple:e.grayTextWeak}size={15}/>
|
|
56
|
+
<$e placeholder="Search URL, status, method, headers, body..."placeholderTextColor={e.grayTextWeak}value={L}onChangeText={W}onFocus={()=>ce(!0)}onBlur={()=>ce(!1)}style={b.searchInput}autoCorrect={!1}autoCapitalize="none"/>
|
|
57
57
|
|
|
58
58
|
{L.length>0&&<S style={{flexDirection:"row",alignItems:"center",gap:4}}>
|
|
59
59
|
<S style={{backgroundColor:`${e.purple}20`,borderRadius:10,paddingHorizontal:6,paddingVertical:1.5}}>
|
|
60
60
|
<I style={{color:e.purple,fontSize:9.5,fontFamily:B.interBold}}>
|
|
61
|
-
{
|
|
61
|
+
{O.length}
|
|
62
62
|
</I>
|
|
63
63
|
</S>
|
|
64
|
-
<
|
|
65
|
-
<
|
|
66
|
-
</
|
|
64
|
+
<Ae onPress={()=>W("")}hitSlop={10}style={b.clearBtn}>
|
|
65
|
+
<Ze color={e.grayTextWeak}size={13}/>
|
|
66
|
+
</Ae>
|
|
67
67
|
</S>}
|
|
68
68
|
</S>
|
|
69
69
|
|
|
70
|
-
<S style={
|
|
71
|
-
<
|
|
72
|
-
<
|
|
73
|
-
</
|
|
70
|
+
<S style={b.toolbarRight}>
|
|
71
|
+
<M style={[b.toolbarBtn,Y&&{borderColor:`${e.darkOrange}50`,backgroundColor:`${e.darkOrange}18`}]}onPress={()=>Be(t=>!t)}hitSlop={6}>
|
|
72
|
+
<Rt isPaused={Y}color={Y?e.darkOrange:e.grayTextStrong}size={16}/>
|
|
73
|
+
</M>
|
|
74
74
|
|
|
75
|
-
<
|
|
76
|
-
<
|
|
77
|
-
{
|
|
78
|
-
<I style={
|
|
79
|
-
{
|
|
75
|
+
<M style={[b.toolbarBtn,{borderColor:`${e.errorColor}38`,backgroundColor:`${e.errorColor}0F`}]}onPress={Re}hitSlop={6}>
|
|
76
|
+
<St color={e.errorColor}size={15}/>
|
|
77
|
+
{$.size>0&&<S style={b.trashBadge}>
|
|
78
|
+
<I style={b.trashBadgeText}>
|
|
79
|
+
{$.size}
|
|
80
80
|
</I>
|
|
81
81
|
</S>}
|
|
82
|
-
</
|
|
82
|
+
</M>
|
|
83
83
|
|
|
84
|
-
<
|
|
85
|
-
<
|
|
86
|
-
</
|
|
84
|
+
<M style={b.toolbarBtn}onPress={()=>G(t=>t==="newest"?"oldest":"newest")}hitSlop={10}>
|
|
85
|
+
<Ct direction={J==="newest"?"down":"up"}color={e.grayTextStrong}size={18}/>
|
|
86
|
+
</M>
|
|
87
87
|
|
|
88
|
-
<
|
|
89
|
-
<
|
|
90
|
-
{(T.size>0||x.size>0)&&<S style={
|
|
91
|
-
</
|
|
88
|
+
<M style={[b.toolbarBtn,(T.size>0||x.size>0)&&{borderColor:e.purple,backgroundColor:`${e.purple}15`}]}onPress={()=>Z(!0)}hitSlop={6}>
|
|
89
|
+
<Te color={T.size>0||x.size>0?e.purple:e.grayTextStrong}size={16}/>
|
|
90
|
+
{(T.size>0||x.size>0)&&<S style={b.activeFilterDot}/>}
|
|
91
|
+
</M>
|
|
92
92
|
</S>
|
|
93
93
|
</S>
|
|
94
94
|
|
|
95
95
|
|
|
96
96
|
<S style={{flexDirection:"row",alignItems:"center",marginBottom:8,paddingHorizontal:12,gap:6}}>
|
|
97
|
-
<
|
|
98
|
-
{
|
|
99
|
-
<S style={{flexDirection:"row",alignItems:"center",paddingHorizontal:9,paddingVertical:4.5,borderRadius:8,backgroundColor:C?
|
|
100
|
-
{
|
|
101
|
-
{
|
|
102
|
-
{
|
|
103
|
-
{
|
|
104
|
-
{
|
|
105
|
-
{
|
|
106
|
-
{
|
|
97
|
+
<We horizontal showsHorizontalScrollIndicator={!1}style={{flex:1}}contentContainerStyle={{flexDirection:"row",alignItems:"center",gap:6,paddingRight:6}}>
|
|
98
|
+
{Ne.map(t=>{const C=K===t.id,w=t.color||e.purple,z=C?e.white:w;return<M key={t.id}onPress={()=>{X(C?"all":t.id)}}>
|
|
99
|
+
<S style={{flexDirection:"row",alignItems:"center",paddingHorizontal:9,paddingVertical:4.5,borderRadius:8,backgroundColor:C?w:`${w}12`,borderWidth:1,borderColor:C?w:`${w}30`,gap:5}}>
|
|
100
|
+
{t.id==="all"&&<Ft size={11}color={z}/>}
|
|
101
|
+
{t.id==="errors"&&<It size={11}color={z}/>}
|
|
102
|
+
{t.id==="success"&&<Tt size={11}color={z}/>}
|
|
103
|
+
{t.id==="slow"&&<Ie size={11}color={z}/>}
|
|
104
|
+
{t.id==="POST"&&<Bt size={11}color={z}/>}
|
|
105
|
+
{t.id==="GET"&&<Vt size={11}color={z}/>}
|
|
106
|
+
{t.id==="graphql"&&<Pt size={11}color={z}/>}
|
|
107
107
|
<I style={{fontFamily:B.interBold,fontSize:10.5,color:C?e.white:e.primaryBlack}}>
|
|
108
|
-
{
|
|
108
|
+
{t.label}
|
|
109
109
|
</I>
|
|
110
|
-
<S style={{backgroundColor:C?"rgba(255,255,255,0.25)":`${
|
|
111
|
-
<I style={{fontFamily:B.interBold,fontSize:9,color:C?e.white:
|
|
112
|
-
{
|
|
110
|
+
<S style={{backgroundColor:C?"rgba(255,255,255,0.25)":`${w}20`,paddingHorizontal:5,paddingVertical:1,borderRadius:8}}>
|
|
111
|
+
<I style={{fontFamily:B.interBold,fontSize:9,color:C?e.white:w}}>
|
|
112
|
+
{t.count}
|
|
113
113
|
</I>
|
|
114
114
|
</S>
|
|
115
115
|
</S>
|
|
116
|
-
</
|
|
117
|
-
</
|
|
116
|
+
</M>})}
|
|
117
|
+
</We>
|
|
118
118
|
|
|
119
|
-
<
|
|
119
|
+
<M onPress={()=>Z(!0)}style={{flexShrink:0}}>
|
|
120
120
|
<S style={{flexDirection:"row",alignItems:"center",paddingHorizontal:10,paddingVertical:4.5,borderRadius:8,backgroundColor:T.size>0||x.size>0?`${e.purple}20`:e.grayBackground,borderWidth:1,borderColor:T.size>0||x.size>0?e.purple:e.grayBorderSecondary,gap:5,shadowColor:e.black,shadowOpacity:.04,shadowRadius:2,shadowOffset:{width:0,height:1},elevation:1}}>
|
|
121
|
-
<
|
|
121
|
+
<Te size={11}color={T.size>0||x.size>0?e.purple:e.grayText}/>
|
|
122
122
|
<I style={{fontFamily:B.interBold,fontSize:10.5,color:T.size>0||x.size>0?e.purple:e.grayText}}>
|
|
123
123
|
More Filters
|
|
124
124
|
</I>
|
|
@@ -128,24 +128,24 @@ import J,{useCallback as de,useMemo as Q,useRef as Oe}from"react";import{FlatLis
|
|
|
128
128
|
</I>
|
|
129
129
|
</S>}
|
|
130
130
|
</S>
|
|
131
|
-
</
|
|
131
|
+
</M>
|
|
132
132
|
</S>
|
|
133
133
|
|
|
134
134
|
|
|
135
|
-
{(
|
|
135
|
+
{(K!=="all"||L.trim().length>0||T.size>0||x.size>0||O.length!==P.length)&&<S 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`}}>
|
|
136
136
|
<I style={{fontFamily:B.interMedium,fontSize:10.5,color:e.purple}}>
|
|
137
|
-
Showing {
|
|
137
|
+
Showing {O.length} of {P.length} requests
|
|
138
138
|
</I>
|
|
139
|
-
<
|
|
139
|
+
<M onPress={()=>{W(""),X("all"),H(new Set),q(new Set)}}>
|
|
140
140
|
<I style={{fontFamily:B.interBold,fontSize:10.5,color:e.errorColor}}>
|
|
141
141
|
Clear All Filters
|
|
142
142
|
</I>
|
|
143
|
-
</
|
|
143
|
+
</M>
|
|
144
144
|
</S>}
|
|
145
145
|
</S>
|
|
146
146
|
|
|
147
|
-
<
|
|
147
|
+
<He ref={Ve}data={Le}keyExtractor={t=>t?.id?.toString()}renderItem={Me}initialNumToRender={15}maxToRenderPerBatch={10}windowSize={9}removeClippedSubviews={qe.OS==="android"}renderToHardwareTextureAndroid={!0}ListEmptyComponent={<Ue isSearch={L.length>0||T.size>0||x.size>0||K!=="all"}searchQuery={L}customTitle={L.length>0?"No matching API requests":"No network activity"}onClearSearch={()=>{W(""),H(new Set),q(new Set),X("all"),Fe("all")}}/>}ListFooterComponent={j.length>0?<Ke count={Math.min(Q,O.length)}totalCount={O.length}label="requests"hasMore={O.length>Q}onLoadMore={()=>Pe(t=>t+10)}/>:null}contentContainerStyle={[b.listContent,O.length===0&&{flexGrow:1}]}keyboardShouldPersistTaps="handled"/>
|
|
148
148
|
|
|
149
149
|
|
|
150
|
-
<
|
|
151
|
-
</S>});export default
|
|
150
|
+
<Xe visible={De}onClose={()=>Z(!1)}filters={Oe}onApply={ve}searchQuery={L}/>
|
|
151
|
+
</S>});export default Lt;
|
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import{useEffect as
|
|
2
|
-
<r.View style={[
|
|
3
|
-
<P style={
|
|
1
|
+
import{useEffect as K,useRef as z,useState as J}from"react";import{Animated as r,Linking as j,Modal as Q,Platform as I,StyleSheet as F,Text as T,TouchableOpacity as P,View as S}from"react-native";import{AppColors as t}from"../../styles/AppColors";import{AppFonts as x}from"../../styles/AppFonts";import E from"../TouchableScale";import{loadSettings as C,saveSettings as B}from"../../helpers/settingsStore";import{trackTelemetryEvent as R}from"../../helpers/telemetry";import{StarIcon as M,CloseWhite as X,CheckIcon as Z,GitHubIcon as St,NpmIcon as Tt}from"../NetworkIcons";const xt=7200*60*1e3,Ct="https://github.com/vengatmacuser/react-native-inapp-inspector",Bt="https://www.npmjs.com/package/react-native-inapp-inspector";export const NpmStarPrompt=()=>{const[L,H]=J(!1),_=z(new r.Value(200)).current,A=z(new r.Value(0)).current,O=z(new r.Value(1)).current;K(()=>{let o=!0;async function $(){try{const k=await C();if(k.starPromptActioned)return;const D=Date.now(),Y=k.starPromptFirstSeen||D;k.starPromptFirstSeen||await B({...k,starPromptFirstSeen:D});const q=k.starPromptLastShown||Y;D-q>=xt&&Math.random()<.65&&o&&setTimeout(()=>{o&&N()},1800)}catch{}}return $(),()=>{o=!1}},[]);const N=async()=>{H(!0);try{const o=await C();await B({...o,starPromptLastShown:Date.now()}),R("npm_star_prompt_shown",{trigger:"5_day_interval",platform:I.OS})}catch{}r.parallel([r.spring(_,{toValue:0,friction:8,tension:50,useNativeDriver:!0}),r.timing(A,{toValue:1,duration:250,useNativeDriver:!0})]).start(),r.loop(r.sequence([r.timing(O,{toValue:1.15,duration:900,useNativeDriver:!0}),r.timing(O,{toValue:1,duration:900,useNativeDriver:!0})])).start()},V=o=>{r.parallel([r.timing(A,{toValue:0,duration:180,useNativeDriver:!0}),r.timing(_,{toValue:200,duration:180,useNativeDriver:!0})]).start(()=>{H(!1),o&&o()})},G=async()=>{try{const o=await C();await B({...o,starPromptActioned:!0}),R("npm_star_prompt_action",{action:"starred",platform:I.OS})}catch{}V(()=>{j.openURL(Ct).catch(()=>{j.openURL(Bt).catch(()=>{})})})},W=async()=>{try{const o=await C();await B({...o,starPromptActioned:!0}),R("npm_star_prompt_action",{action:"already_starred",platform:I.OS})}catch{}V()},v=async()=>{try{const o=await C();await B({...o,starPromptLastShown:Date.now()}),R("npm_star_prompt_action",{action:"remind_later",platform:I.OS})}catch{}V()},U=async()=>{try{const o=await C();await B({...o,starPromptActioned:!0}),R("npm_star_prompt_action",{action:"dont_ask_again",platform:I.OS})}catch{}V()};return L?<Q transparent visible={L}animationType="none"onRequestClose={v}>
|
|
2
|
+
<r.View style={[e.backdrop,{opacity:A}]}>
|
|
3
|
+
<P style={F.absoluteFill}activeOpacity={1}onPress={v}/>
|
|
4
4
|
|
|
5
|
-
<r.View style={[
|
|
5
|
+
<r.View style={[e.cardContainer,{transform:[{translateY:_}]}]}>
|
|
6
6
|
|
|
7
|
-
<S style={
|
|
8
|
-
<r.View style={[
|
|
9
|
-
<S style={
|
|
10
|
-
<
|
|
7
|
+
<S style={e.headerIconWrapper}>
|
|
8
|
+
<r.View style={[e.iconGlow,{transform:[{scale:O}]}]}/>
|
|
9
|
+
<S style={e.iconCircle}>
|
|
10
|
+
<M size={26}color={t.amber500}/>
|
|
11
11
|
</S>
|
|
12
12
|
</S>
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
<P onPress={v}hitSlop={{top:10,bottom:10,left:10,right:10}}style={
|
|
16
|
-
<
|
|
15
|
+
<P onPress={v}hitSlop={{top:10,bottom:10,left:10,right:10}}style={e.closeBtn}>
|
|
16
|
+
<X size={12}color={t.grayText}/>
|
|
17
17
|
</P>
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
<S style={
|
|
21
|
-
<
|
|
20
|
+
<S style={e.pillBadge}>
|
|
21
|
+
<T style={e.pillBadgeText}>SUPPORT OPEN SOURCE</T>
|
|
22
22
|
</S>
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
<
|
|
26
|
-
<
|
|
25
|
+
<T style={e.title}>Enjoying In-App Inspector?</T>
|
|
26
|
+
<T style={e.description}>
|
|
27
27
|
If this debugging tool saves you time, please consider giving us a
|
|
28
28
|
star on GitHub & npm. Your support helps us build more features!
|
|
29
|
-
</
|
|
29
|
+
</T>
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
<S style={
|
|
33
|
-
<S style={
|
|
34
|
-
<
|
|
35
|
-
<
|
|
32
|
+
<S style={e.metricsBar}>
|
|
33
|
+
<S style={e.metricItem}>
|
|
34
|
+
<St size={13}color={t.grayText}/>
|
|
35
|
+
<T style={e.metricText}>GitHub Star</T>
|
|
36
36
|
</S>
|
|
37
|
-
<S style={
|
|
38
|
-
<S style={
|
|
39
|
-
<Tt size={13}color=
|
|
40
|
-
<
|
|
37
|
+
<S style={e.metricDot}/>
|
|
38
|
+
<S style={e.metricItem}>
|
|
39
|
+
<Tt size={13}color={t.npmRed}/>
|
|
40
|
+
<T style={e.metricText}>npm Package</T>
|
|
41
41
|
</S>
|
|
42
|
-
<S style={
|
|
43
|
-
<S style={
|
|
44
|
-
<
|
|
42
|
+
<S style={e.metricDot}/>
|
|
43
|
+
<S style={e.metricItem}>
|
|
44
|
+
<T style={e.metricText}>100% Free</T>
|
|
45
45
|
</S>
|
|
46
46
|
</S>
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
<
|
|
50
|
-
<S style={
|
|
51
|
-
<
|
|
52
|
-
<
|
|
49
|
+
<E accessible={!0}accessibilityRole="button"accessibilityLabel="Star on GitHub"onPress={G}style={e.primaryButton}>
|
|
50
|
+
<S style={e.primaryButtonContent}>
|
|
51
|
+
<M size={16}color={t.white}/>
|
|
52
|
+
<T style={e.primaryButtonText}>Star on GitHub & npm</T>
|
|
53
53
|
</S>
|
|
54
|
-
</
|
|
54
|
+
</E>
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
<
|
|
58
|
-
<S style={
|
|
59
|
-
<
|
|
60
|
-
<
|
|
57
|
+
<E accessible={!0}accessibilityRole="button"accessibilityLabel="I already starred"onPress={W}style={e.secondaryButton}>
|
|
58
|
+
<S style={e.secondaryButtonContent}>
|
|
59
|
+
<Z size={13}color={t.purple}/>
|
|
60
|
+
<T style={e.secondaryButtonText}>I Already Starred</T>
|
|
61
61
|
</S>
|
|
62
|
-
</
|
|
62
|
+
</E>
|
|
63
63
|
|
|
64
64
|
|
|
65
|
-
<S style={
|
|
65
|
+
<S style={e.footerRow}>
|
|
66
66
|
<P onPress={v}hitSlop={{top:8,bottom:8,left:8,right:8}}>
|
|
67
|
-
<
|
|
67
|
+
<T style={e.footerLinkText}>Remind Me Later</T>
|
|
68
68
|
</P>
|
|
69
69
|
|
|
70
|
-
<S style={
|
|
70
|
+
<S style={e.footerSeparator}/>
|
|
71
71
|
|
|
72
|
-
<P onPress={
|
|
73
|
-
<
|
|
72
|
+
<P onPress={U}hitSlop={{top:8,bottom:8,left:8,right:8}}>
|
|
73
|
+
<T style={e.footerLinkTextMuted}>Don't Ask Again</T>
|
|
74
74
|
</P>
|
|
75
75
|
</S>
|
|
76
76
|
</r.View>
|
|
77
77
|
</r.View>
|
|
78
|
-
</
|
|
78
|
+
</Q>:null};const e=F.create({backdrop:{...F.absoluteFillObject,backgroundColor:"rgba(15, 23, 42, 0.65)",justifyContent:"center",alignItems:"center",paddingHorizontal:20,zIndex:99999},cardContainer:{width:"100%",maxWidth:380,backgroundColor:t.white,borderRadius:22,padding:22,alignItems:"center",shadowColor:t.black,shadowOffset:{width:0,height:8},shadowOpacity:.22,shadowRadius:20,elevation:12,borderWidth:1.5,borderColor:`${t.purple}25`},headerIconWrapper:{position:"relative",alignItems:"center",justifyContent:"center",marginBottom:12},iconGlow:{position:"absolute",width:68,height:68,borderRadius:34,backgroundColor:`${t.amber500}22`},iconCircle:{width:54,height:54,borderRadius:27,backgroundColor:t.amber100,borderWidth:2,borderColor:t.amber200,alignItems:"center",justifyContent:"center"},closeBtn:{position:"absolute",top:14,right:14,width:28,height:28,borderRadius:14,backgroundColor:t.grayBackground,alignItems:"center",justifyContent:"center"},pillBadge:{backgroundColor:`${t.purple}14`,paddingHorizontal:9,paddingVertical:3,borderRadius:10,marginBottom:8},pillBadgeText:{fontFamily:x.interBold,fontSize:9.5,color:t.purple,letterSpacing:.6},title:{fontFamily:x.interBold,fontSize:18,lineHeight:23,color:t.primaryBlack,textAlign:"center",marginBottom:6},description:{fontFamily:x.interRegular,fontSize:12.5,lineHeight:18,color:t.grayText,textAlign:"center",marginBottom:14,paddingHorizontal:8},metricsBar:{flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:t.grayBackground,paddingVertical:7,paddingHorizontal:14,borderRadius:10,marginBottom:16,gap:8},metricItem:{flexDirection:"row",alignItems:"center",gap:4},metricText:{fontFamily:x.interMedium,fontSize:11,color:t.primaryBlack},metricDot:{width:3.5,height:3.5,borderRadius:2,backgroundColor:t.dividerColor},primaryButton:{width:"100%",backgroundColor:t.purple,borderRadius:12,paddingVertical:12,alignItems:"center",justifyContent:"center",marginBottom:8,shadowColor:t.purple,shadowOffset:{width:0,height:4},shadowOpacity:.3,shadowRadius:8,elevation:4},primaryButtonContent:{flexDirection:"row",alignItems:"center",gap:7},primaryButtonText:{fontFamily:x.interBold,fontSize:14,color:t.white},secondaryButton:{width:"100%",backgroundColor:`${t.purple}10`,borderWidth:1,borderColor:`${t.purple}30`,borderRadius:12,paddingVertical:10,alignItems:"center",justifyContent:"center",marginBottom:14},secondaryButtonContent:{flexDirection:"row",alignItems:"center",gap:6},secondaryButtonText:{fontFamily:x.interBold,fontSize:13,color:t.purple},footerRow:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:12},footerLinkText:{fontFamily:x.interMedium,fontSize:11.5,color:t.grayText},footerSeparator:{width:1,height:12,backgroundColor:t.dividerColor},footerLinkTextMuted:{fontFamily:x.interRegular,fontSize:11.5,color:t.grayTextWeak}});export default NpmStarPrompt;
|
|
@@ -1,56 +1,55 @@
|
|
|
1
|
-
import{useState as
|
|
2
|
-
<C d="M18 6L6 18M6 6l12 12"stroke={
|
|
3
|
-
</
|
|
4
|
-
<C d="M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2z"stroke={
|
|
5
|
-
<C d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"stroke={
|
|
6
|
-
</
|
|
7
|
-
<C d="M20 6L9 17l-5-5"stroke={
|
|
8
|
-
</
|
|
9
|
-
<C d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"stroke={
|
|
10
|
-
<C d="M15 3h6v6"stroke={
|
|
11
|
-
<C d="M10 14L21 3"stroke={
|
|
12
|
-
</
|
|
13
|
-
<
|
|
1
|
+
import{useState as N,useEffect as G,useRef as R}from"react";import{Animated as r,Linking as J,StyleSheet as K,Text as S,TouchableOpacity as P,View as T}from"react-native";import B,{Path as C}from"react-native-svg";import{useInspector as Q}from"./InspectorContext";import{LIB_VERSION as X}from"../../constants";import{NpmIcon as Z}from"../NetworkIcons";import{copyToClipboard as ee}from"../../helpers";import{showToast as te}from"../../helpers/toast";import{AppColors as e}from"../../styles/AppColors";import{AppFonts as oe}from"../../styles/AppFonts";import{useTranslation as ie}from"../../i18n";const Ce=({size:t=13,color:i=e.slate400})=><B width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
2
|
+
<C d="M18 6L6 18M6 6l12 12"stroke={i}strokeWidth="2.4"strokeLinecap="round"strokeLinejoin="round"/>
|
|
3
|
+
</B>,Ve=({size:t=11,color:i=e.slate400})=><B width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
4
|
+
<C d="M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2z"stroke={i}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
5
|
+
<C d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"stroke={i}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
6
|
+
</B>,Te=({size:t=11,color:i=e.greenColor})=><B width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
7
|
+
<C d="M20 6L9 17l-5-5"stroke={i}strokeWidth="2.4"strokeLinecap="round"strokeLinejoin="round"/>
|
|
8
|
+
</B>,Se=({size:t=11,color:i=e.white})=><B width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
9
|
+
<C d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"stroke={i}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
10
|
+
<C d="M15 3h6v6"stroke={i}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
11
|
+
<C d="M10 14L21 3"stroke={i}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
12
|
+
</B>,H=7e3;export const NpmUpdateToast=()=>{const{t}=ie(),{updateAvailable:i,latestNpmVersion:V,showUpdateToast:O}=Q(),[_,U]=N(!1),[F,j]=N(!1),[W,E]=N(!1),I=R(new r.Value(60)).current,D=R(new r.Value(0)).current,z=R(new r.Value(1)).current,A=R(null);G(()=>(O&&i&&V&&!_&&(j(!0),r.parallel([r.spring(I,{toValue:0,friction:8,tension:40,useNativeDriver:!0}),r.timing(D,{toValue:1,duration:250,useNativeDriver:!0})]).start(),z.setValue(1),r.timing(z,{toValue:0,duration:H,useNativeDriver:!1}).start(),A.current=setTimeout(()=>{M()},H)),()=>{A.current&&clearTimeout(A.current)}),[O,i,V,_]);const M=()=>{r.parallel([r.timing(D,{toValue:0,duration:180,useNativeDriver:!0}),r.timing(I,{toValue:60,duration:180,useNativeDriver:!0})]).start(()=>{j(!1),U(!0)})},$=()=>{ee("npm install react-native-inapp-inspector@latest","Install Command"),E(!0),te("Copied npm install command!"),setTimeout(()=>{E(!1)},2e3)},Y=()=>{J.openURL("https://www.npmjs.com/package/react-native-inapp-inspector").catch(()=>{}),M()};if(typeof __DEV__>"u"||!__DEV__||!O||!F||!i||!V)return null;const q=z.interpolate({inputRange:[0,1],outputRange:["0%","100%"]});return<r.View style={[o.container,{opacity:D,transform:[{translateY:I}]}]}>
|
|
13
|
+
<T style={o.contentRow}>
|
|
14
14
|
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
</
|
|
15
|
+
<T style={o.npmIconContainer}>
|
|
16
|
+
<Z size={15}color={e.npmRed}/>
|
|
17
|
+
</T>
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
</F>
|
|
19
|
+
<T style={o.textContainer}>
|
|
20
|
+
<T style={o.titleRow}>
|
|
21
|
+
<S style={o.titleText}>{t("header.newVersionAvailable","Update Available")}</S>
|
|
22
|
+
<T style={o.versionPill}>
|
|
23
|
+
<S style={o.versionPillText}>v{V}</S>
|
|
24
|
+
</T>
|
|
25
|
+
</T>
|
|
26
|
+
<S style={o.subtitleText}>
|
|
27
|
+
{t("header.updateAvailable",{latestVersion:V,currentVersion:X,defaultValue:`react-native-inapp-inspector v${V} is available on NPM.`})}
|
|
28
|
+
</S>
|
|
29
|
+
</T>
|
|
31
30
|
|
|
32
31
|
|
|
33
|
-
<
|
|
34
|
-
{
|
|
35
|
-
<
|
|
36
|
-
{
|
|
37
|
-
</
|
|
38
|
-
</
|
|
32
|
+
<P style={o.copyButton}onPress={$}activeOpacity={.7}hitSlop={{top:8,bottom:8,left:4,right:4}}>
|
|
33
|
+
{W?<Te size={11}color={e.greenColor}/>:<Ve size={11}color={e.slate400}/>}
|
|
34
|
+
<S style={[o.copyButtonText,W&&{color:e.greenColor}]}>
|
|
35
|
+
{W?t("common.copied","Copied"):t("header.copyCommand","Copy")}
|
|
36
|
+
</S>
|
|
37
|
+
</P>
|
|
39
38
|
|
|
40
39
|
|
|
41
|
-
<
|
|
42
|
-
<
|
|
43
|
-
<
|
|
44
|
-
</
|
|
40
|
+
<P style={o.actionButton}onPress={Y}activeOpacity={.8}hitSlop={{top:8,bottom:8,left:4,right:4}}>
|
|
41
|
+
<S style={o.actionButtonText}>{t("header.viewNpm","View")}</S>
|
|
42
|
+
<Se size={10}color={e.white}/>
|
|
43
|
+
</P>
|
|
45
44
|
|
|
46
45
|
|
|
47
|
-
<
|
|
48
|
-
<
|
|
49
|
-
</
|
|
50
|
-
</
|
|
46
|
+
<P style={o.closeButton}onPress={M}activeOpacity={.7}hitSlop={{top:10,bottom:10,left:10,right:10}}>
|
|
47
|
+
<Ce size={12}color={e.slate400}/>
|
|
48
|
+
</P>
|
|
49
|
+
</T>
|
|
51
50
|
|
|
52
51
|
|
|
53
|
-
<
|
|
54
|
-
<
|
|
55
|
-
</
|
|
56
|
-
</
|
|
52
|
+
<T style={o.progressBarTrack}>
|
|
53
|
+
<r.View style={[o.progressBarFill,{width:q}]}/>
|
|
54
|
+
</T>
|
|
55
|
+
</r.View>};const L={fontFamily:oe.interRegular},o=K.create({container:{position:"absolute",bottom:24,left:14,right:14,backgroundColor:e.slate900,borderRadius:16,borderWidth:1,borderColor:e.slate700,shadowColor:e.black,shadowOffset:{width:0,height:12},shadowOpacity:.4,shadowRadius:24,elevation:24,overflow:"hidden",zIndex:99999},contentRow:{flexDirection:"row",alignItems:"center",paddingVertical:11,paddingHorizontal:12,gap:8},npmIconContainer:{width:32,height:32,borderRadius:9,backgroundColor:e.white,justifyContent:"center",alignItems:"center",borderWidth:1,borderColor:e.slate200,flexShrink:0,shadowColor:e.black,shadowOffset:{width:0,height:1},shadowOpacity:.15,shadowRadius:2,elevation:2},textContainer:{flex:1,minWidth:0},titleRow:{flexDirection:"row",alignItems:"center",gap:5},titleText:{fontSize:12.5,fontWeight:"700",color:e.slate50,letterSpacing:-.2,...L},versionPill:{backgroundColor:`${e.offerPurple}33`,paddingHorizontal:5.5,paddingVertical:1.5,borderRadius:5,borderWidth:1,borderColor:`${e.violet500}80`},versionPillText:{fontSize:10,fontWeight:"700",color:e.purpleLightMuted,...L},subtitleText:{fontSize:10.5,color:e.slate400,marginTop:1,...L},copyButton:{flexDirection:"row",alignItems:"center",gap:3.5,backgroundColor:e.slate800,paddingVertical:5.5,paddingHorizontal:8,borderRadius:7,borderWidth:1,borderColor:e.slate700,flexShrink:0},copyButtonText:{fontSize:10.5,fontWeight:"600",color:e.slate400,...L},actionButton:{flexDirection:"row",alignItems:"center",gap:3.5,backgroundColor:e.offerPurple,paddingVertical:5.5,paddingHorizontal:9,borderRadius:7,flexShrink:0,shadowColor:e.offerPurple,shadowOffset:{width:0,height:2},shadowOpacity:.35,shadowRadius:4,elevation:3},actionButtonText:{fontSize:11,fontWeight:"700",color:e.white,...L},closeButton:{width:22,height:22,borderRadius:11,backgroundColor:e.slate800,justifyContent:"center",alignItems:"center",flexShrink:0},progressBarTrack:{height:2.5,width:"100%",backgroundColor:e.slate800},progressBarFill:{height:"100%",backgroundColor:e.violet500}});export default NpmUpdateToast;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Ze,{useState as E,useMemo as Ve,useEffect as _e}from"react";import{Alert as ze,Platform as et,Pressable as U,ScrollView as Z,StyleSheet as tt,Text as C,TextInput as Tt,ToastAndroid as Oe,TouchableOpacity as Ne,View as T}from"react-native";import{useTranslation as ht}from"../../i18n";import{useInspector as wt}from"./InspectorContext";import Me from"../SegmentedTabs";import K from"../JsonViewer";import He from"../DiffViewer";import Ee from"../CopyButton";import Ct from"../TouchableScale";import St from"../HighlightText";import Bt from"../AnimatedEntrance";import{getActionHistory as Vt}from"../../customHooks/reduxLogger";import{getSize as q,openInVSCode as _,parseStackLine as je}from"../../helpers";import{getCustomStorage as $e}from"../../helpers/settingsStore";import{AppColors as e}from"../../styles/AppColors";import{AppFonts as k}from"../../styles/AppFonts";import{TerminalIcon as It,SearchIcon as Pt,ClearIcon as Wt,ClockIcon as Ie,LayersIcon as Je,TrashIcon as Ge,ForwardChevronIcon as Rt,LiveStateIcon as Ue,TimelineIcon as Te,StorageIcon as Ce,MetadataIcon as Ft,BoltIcon as Pe,AtomIcon as Dt,ScreenIcon as At,ListenerIcon as Lt,DocIcon as We,ExternalLinkIcon as Se,CodeBracketsIcon as Ot}from"../NetworkIcons";const Ke=z=>{switch(z){case"saga":return{label:"SAGA",renderIcon:(A,D=9)=><Pe color={A}size={D}/>,bg:e.purple100,text:e.brandPurple,border:e.purple200};case"thunk":return{label:"THUNK",renderIcon:(A,D=9)=><Dt color={A}size={D}/>,bg:e.amber100,text:e.amber800Warm,border:e.amber200};case"ui":return{label:"UI",renderIcon:(A,D=9)=><At color={A}size={D}/>,bg:e.sky100,text:e.sky600,border:e.sky400};case"listener":return{label:"LISTENER",renderIcon:(A,D=9)=><Lt color={A}size={D}/>,bg:e.teal100,text:e.teal700,border:e.teal400};default:return{label:"DIRECT",renderIcon:(A,D=9)=><Pe color={A}size={D}/>,bg:e.slate100,text:e.slate700,border:e.slate200}}},Nt=Ze.memo(()=>{const{t:z}=ht(),{reduxState:A,reduxLastActionMap:D,selectedReduxSlice:W,selectedReduxAction:V,setSelectedReduxSlice:Mt}=wt(),[F,Re]=E(""),[O,ve]=E("live"),[Q,qe]=E("payload"),[Fe,De]=E("
|
|
1
|
+
import Ze,{useState as E,useMemo as Ve,useEffect as _e}from"react";import{Alert as ze,Platform as et,Pressable as U,ScrollView as Z,StyleSheet as tt,Text as C,TextInput as Tt,ToastAndroid as Oe,TouchableOpacity as Ne,View as T}from"react-native";import{useTranslation as ht}from"../../i18n";import{useInspector as wt}from"./InspectorContext";import Me from"../SegmentedTabs";import K from"../JsonViewer";import He from"../DiffViewer";import Ee from"../CopyButton";import Ct from"../TouchableScale";import St from"../HighlightText";import Bt from"../AnimatedEntrance";import{getActionHistory as Vt}from"../../customHooks/reduxLogger";import{getSize as q,openInVSCode as _,parseStackLine as je}from"../../helpers";import{getCustomStorage as $e}from"../../helpers/settingsStore";import{AppColors as e}from"../../styles/AppColors";import{AppFonts as k}from"../../styles/AppFonts";import{TerminalIcon as It,SearchIcon as Pt,ClearIcon as Wt,ClockIcon as Ie,LayersIcon as Je,TrashIcon as Ge,ForwardChevronIcon as Rt,LiveStateIcon as Ue,TimelineIcon as Te,StorageIcon as Ce,MetadataIcon as Ft,BoltIcon as Pe,AtomIcon as Dt,ScreenIcon as At,ListenerIcon as Lt,DocIcon as We,ExternalLinkIcon as Se,CodeBracketsIcon as Ot}from"../NetworkIcons";const Ke=z=>{switch(z){case"saga":return{label:"SAGA",renderIcon:(A,D=9)=><Pe color={A}size={D}/>,bg:e.purple100,text:e.brandPurple,border:e.purple200};case"thunk":return{label:"THUNK",renderIcon:(A,D=9)=><Dt color={A}size={D}/>,bg:e.amber100,text:e.amber800Warm,border:e.amber200};case"ui":return{label:"UI",renderIcon:(A,D=9)=><At color={A}size={D}/>,bg:e.sky100,text:e.sky600,border:e.sky400};case"listener":return{label:"LISTENER",renderIcon:(A,D=9)=><Lt color={A}size={D}/>,bg:e.teal100,text:e.teal700,border:e.teal400};default:return{label:"DIRECT",renderIcon:(A,D=9)=><Pe color={A}size={D}/>,bg:e.slate100,text:e.slate700,border:e.slate200}}},Nt=Ze.memo(()=>{const{t:z}=ht(),{reduxState:A,reduxLastActionMap:D,selectedReduxSlice:W,selectedReduxAction:V,setSelectedReduxSlice:Mt}=wt(),[F,Re]=E(""),[O,ve]=E("live"),[Q,qe]=E("payload"),[Fe,De]=E("raw"),[Qe,Xe]=E(null),[J,G]=E(!1),[X,N]=E(null),ke=Ve(()=>Vt(),[D]),j=Ve(()=>W?ke.filter(B=>!B.affectedSlices||B.affectedSlices.length===0?!0:B.affectedSlices.includes(W)):ke,[ke,W]),Ae=Ve(()=>{if(!F.trim())return j;const B=F.toLowerCase();return j.filter(R=>R.type.toLowerCase().includes(B)||R.callerFile&&R.callerFile.toLowerCase().includes(B)||R.payload&&JSON.stringify(R.payload).toLowerCase().includes(B))},[j,F]);_e(()=>{if(!W)return;async function B(){try{const R=$e();if(!R){G(!1),N(null);return}let v=await R.getItem(`persist:${W}`);if(v){try{N(JSON.parse(v))}catch{N(v)}G(!0);return}let I=await R.getItem("persist:root");if(I){const S=JSON.parse(I);if(S&&S[W]!==void 0){const P=S[W];try{N(typeof P=="string"?JSON.parse(P):P)}catch{N(P)}G(!0);return}}}catch{}G(!1),N(null)}B()},[W]);const Le=()=>{W&&ze.alert("Clear Persisted State",`Are you sure you want to delete persisted storage for slice "${W}"?`,[{text:"Cancel",style:"cancel"},{text:"Delete",style:"destructive",onPress:async()=>{try{const B=$e();if(!B)return;typeof B.removeItem=="function"?await B.removeItem(`persist:${W}`):await B.setItem(`persist:${W}`,""),G(!1),N(null),ve("live"),et.OS==="android"?Oe.show("Persisted state cleared",Oe.SHORT):ze.alert("Cleared","Persisted state has been cleared.")}catch{ze.alert("Error","Failed to clear persisted state.")}}}])};if(W!=null){const B=A?.[W],R=B&&typeof B=="object"?Object.keys(B).length:typeof B<"u"?1:0,v=D[W],I=[{key:"live",label:z("redux.liveState","Live State"),icon:S=><Ue color={S?e.white:e.grayText}size={12}/>},{key:"timeline",label:`${z("redux.timeline","Timeline")} (${j.length})`,icon:S=><Te color={S?e.white:e.grayText}size={12}/>},{key:"persisted",label:J?z("redux.persisted","Persisted"):z("redux.storage","Storage"),icon:S=><Ce color={S?e.white:e.grayText}size={12}/>},{key:"metadata",label:z("redux.metadata","Metadata"),icon:S=><Ft color={S?e.white:e.grayText}size={12}/>}];return<T style={{flex:1,backgroundColor:e.grayBackground}}>
|
|
2
2
|
|
|
3
3
|
<T style={t.infoBar}>
|
|
4
4
|
<T style={t.infoTopRow}>
|