react-native-inapp-inspector 2.4.0 → 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/dist/commonjs/components/Inspector/AnalyticsTab.js +18 -18
- package/dist/commonjs/components/Inspector/ConsoleTab.js +12 -12
- package/dist/commonjs/components/Inspector/CrashTab.js +20 -20
- package/dist/commonjs/components/Inspector/NetworkTab.js +11 -11
- package/dist/commonjs/components/Inspector/PushTab.js +12 -12
- package/dist/commonjs/components/Inspector/ReduxTab.js +15 -15
- package/dist/commonjs/components/Inspector/StorageTab.js +16 -16
- package/dist/commonjs/components/LogCard.js +9 -6
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/index.js +1 -1
- package/dist/esm/components/Inspector/AnalyticsTab.js +31 -31
- package/dist/esm/components/Inspector/ConsoleTab.js +31 -31
- package/dist/esm/components/Inspector/CrashTab.js +23 -23
- package/dist/esm/components/Inspector/NetworkTab.js +11 -11
- package/dist/esm/components/Inspector/PushTab.js +26 -26
- package/dist/esm/components/Inspector/ReduxTab.js +40 -40
- package/dist/esm/components/Inspector/StorageTab.js +51 -51
- package/dist/esm/components/LogCard.js +25 -22
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/index.js +3 -3
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ee,{useCallback as Be,useMemo as N,useRef as Pe,useState as te}from"react";import{FlatList as De,Platform as oe,Pressable as Ce,StyleSheet as Fe,Text as S,TextInput as Ee,TouchableOpacity as We,View as C}from"react-native";import{useTranslation as Oe}from"../../i18n";import{useInspector as Me}from"./InspectorContext";import Ne from"../TouchableScale";import $e from"../AnimatedEntrance";import Ue from"../EmptyState";import Ge from"../EndOfListFooter";import Te from"../HighlightText";import{getSize as Se,openInVSCode as _e,getCleanCallerDisplay as Ze}from"../../helpers";import O from"../../styles";import{AppColors as e}from"../../styles/AppColors";import{AppFonts as R}from"../../styles/AppFonts";import{getActionHistory as Ke}from"../../customHooks/reduxLogger";import{TerminalIcon as Ae,SearchIcon as Je,ClearIcon as Qe,LayersIcon as Xe,ClockIcon as Ye,SizeIcon as Ct,ForwardChevronIcon as Tt,SortArrowIcon as St,BoltIcon as U,AtomIcon as At,ScreenIcon as It,ListenerIcon as Rt,DocIcon as Vt,LoadingSpinnerIcon as Ht,CircleAlertIcon as Lt,TextAaIcon as Bt}from"../NetworkIcons";const Ie=B=>{switch(B){case"saga":return{label:"SAGA",renderIcon:(I,z=9)=><U color={I}size={z}/>,bg:e.purple100,text:e.brandPurple,border:e.purple200};case"thunk":return{label:"THUNK",renderIcon:(I,z=9)=><At color={I}size={z}/>,bg:e.amber100,text:e.amber800Warm,border:e.amber200};case"ui":return{label:"UI",renderIcon:(I,z=9)=><It color={I}size={z}/>,bg:e.sky100,text:e.sky600,border:e.sky400};case"listener":return{label:"LISTENER",renderIcon:(I,z=9)=><Rt color={I}size={z}/>,bg:e.teal100,text:e.teal700,border:e.teal400};default:return{label:"DIRECT",renderIcon:(I,z=9)=><U color={I}size={z}/>,bg:e.slate100,text:e.slate700,border:e.slate200}}},Re=50,ze=10,Pt=ee.memo(()=>{const{t:B}=Oe(),{reduxState:I,reduxLastActionMap:z,reduxSearch:k,setReduxSearch:G,setSelectedReduxSlice:Z}=Me(),K=Pe(null),[q,J]=te(Re),[P,ke]=te("latest");ee.useEffect(()=>{J(Re),K.current?.scrollToOffset({offset:0,animated:!1})},[k,P]);const Ve=N(()=>Se(I),[I]),Q=N(()=>Ke(),[z]),$=N(()=>!I||typeof I!="object"?[]:Object.keys(I).map(A=>{const T=I[A],H=Array.isArray(T),j=T&&typeof T=="object";let F="Primitive",L=0;H?(L=T.length,F=`Array [${L}]`):j?(L=Object.keys(T).length,F=`Object {${L}}`):typeof T<"u"&&(L=1,F=typeof T);let E="live",v;j&&(T.loading===!0||T.isLoading===!0||T.status==="loading"||T.status==="pending"?(E="loading",v="Loading"):T.error||T.hasError||T.status==="error"||T.status==="failed"?(E="error",v=typeof T.error=="string"?T.error:"Error"):L===0&&(E="empty",v="Empty"));const V=z[A],He=V?.updatedAt||0,Le=Q.filter(W=>!W.affectedSlices||W.affectedSlices.length===0?!0:W.affectedSlices.includes(A)).length;let X;if(V){let W;if(V.payload!==void 0&&V.payload!==null)try{if(typeof V.payload=="object"){const Y=Object.keys(V.payload);W=`{ ${Y.slice(0,3).join(", ")}${Y.length>3?"...":""} }`}else W=String(V.payload)}catch{}X={type:V.type,timestamp:V.timestamp,updatedAt:V.updatedAt,payloadPreview:W,originType:V.originType,callerFile:V.callerFile,callerLine:V.callerLine,callerCol:V.callerCol}}return{id:`slice-${A}`,name:A,keysCount:L,sizeStr:Se(T),typeLabel:F,status:E,statusMessage:v,timelineCount:Le,lastAction:X,updatedAt:He}}),[I,z,Q]),D=N(()=>{let t=$;if(k&&k.trim().length>0){const A=k.trim().toLowerCase().split(/\s+/).filter(Boolean);t=t.filter(T=>{const H=I?I[T.name]:null,j=[T.name||"",T.lastAction?.type||"",T.lastAction?.payloadPreview||"",T.lastAction?.originType||"",T.status||"",T.statusMessage||"",H?typeof H=="string"?H:JSON.stringify(H):""].join(" ").toLowerCase();return A.every(F=>j.includes(F))})}return[...t].sort((A,T)=>P==="latest"&&T.updatedAt!==A.updatedAt?T.updatedAt-A.updatedAt:A.name.localeCompare(T.name))},[$,k,P,I]),_=N(()=>D.slice(0,q),[D,q]),M=N(()=>{const t=Object.values(z);return t.length===0?null:t.reduce((A,T)=>A?(T.updatedAt||0)>(A.updatedAt||0)?T:A:T,null)},[z]),ve=Be(({item:t,index:A})=>{const T=t.updatedAt>0&&Date.now()-t.updatedAt<5e3,H=t.status==="error"?e.errorColor:t.status==="loading"?e.warningIconGold:t.status==="empty"?e.grayTextWeak:e.greenColor,j=t.status==="error"?e.red100:t.status==="loading"?e.amber100:t.status==="empty"?e.grayBackground:e.emeraldBg,F=t.status==="error"?e.errorBorder:t.status==="loading"?e.amber200:t.status==="empty"?e.dividerColor:e.emeraldBorder,L=t.status==="error"?e.red600:t.status==="loading"?e.amber800Warm:t.status==="empty"?e.grayTextWeak:e.emerald700,E=t.lastAction?.callerFile?Ze(t.lastAction.callerFile):null;return<$e index={A}distance={8}>
|
|
2
2
|
<C style={o.cardContainer}>
|
|
3
3
|
<Ne onPress={()=>{Z(t.name)}}style={[o.card,{borderLeftWidth:3.5,borderLeftColor:H,backgroundColor:t.status==="error"?e.errorCardBg:e.white},T&&o.cardRecentlyUpdated]}>
|
|
4
4
|
<C style={o.cardBody}>
|
|
5
5
|
|
|
6
6
|
<C style={o.cardHeaderRow}>
|
|
7
7
|
<C style={o.cardHeaderLeft}>
|
|
8
|
-
<S style={o.serialNumber}>#{
|
|
8
|
+
<S style={o.serialNumber}>#{A+1}</S>
|
|
9
9
|
<C style={[o.methodBadge,{backgroundColor:e.violet600}]}>
|
|
10
10
|
<S style={o.methodBadgeText}>REDUX</S>
|
|
11
11
|
</C>
|
|
@@ -15,7 +15,7 @@ import Le,{useCallback as Pe,useMemo as N,useRef as De,useState as _}from"react"
|
|
|
15
15
|
</S>
|
|
16
16
|
</C>
|
|
17
17
|
|
|
18
|
-
{t.lastAction?.originType&&(()=>{const v=
|
|
18
|
+
{t.lastAction?.originType&&(()=>{const v=Ie(t.lastAction.originType);return<C style={[o.chip,{backgroundColor:v.bg,borderColor:v.border}]}>
|
|
19
19
|
{v.renderIcon(v.text,8.5)}
|
|
20
20
|
<S style={[o.chipText,{color:v.text}]}>
|
|
21
21
|
{v.label}
|
|
@@ -24,13 +24,13 @@ import Le,{useCallback as Pe,useMemo as N,useRef as De,useState as _}from"react"
|
|
|
24
24
|
</C>
|
|
25
25
|
|
|
26
26
|
<C style={o.cardHeaderRight}>
|
|
27
|
-
<C style={[o.statusPill,{backgroundColor:
|
|
28
|
-
{t.status==="loading"?<
|
|
29
|
-
<S style={[o.statusPillText,{color:
|
|
27
|
+
<C style={[o.statusPill,{backgroundColor:j,borderColor:F}]}>
|
|
28
|
+
{t.status==="loading"?<Ht color={e.amber800Warm}size={10}/>:t.status==="error"?<Lt color={e.red600}size={10}/>:t.status==="empty"?null:<C style={o.liveDot}/>}
|
|
29
|
+
<S style={[o.statusPillText,{color:L}]}>
|
|
30
30
|
{t.status==="loading"?"Loading":t.status==="error"?t.statusMessage||"Error":t.status==="empty"?"Empty":"Live"}
|
|
31
31
|
</S>
|
|
32
32
|
</C>
|
|
33
|
-
<
|
|
33
|
+
<Tt color={e.grayTextWeak}size={13}/>
|
|
34
34
|
</C>
|
|
35
35
|
</C>
|
|
36
36
|
|
|
@@ -46,7 +46,7 @@ import Le,{useCallback as Pe,useMemo as N,useRef as De,useState as _}from"react"
|
|
|
46
46
|
</C>}
|
|
47
47
|
</C>
|
|
48
48
|
<C style={o.actionPreviewRow}>
|
|
49
|
-
<
|
|
49
|
+
<Ae color={e.grayTextWeak}size={10}/>
|
|
50
50
|
{t.lastAction?<Te text={t.lastAction.type+(t.lastAction.payloadPreview?` \xB7 ${t.lastAction.payloadPreview}`:"")}search={k}style={o.actionPreviewText}highlightStyle={o.highlight}numberOfLines={1}/>:<S style={o.actionPreviewEmptyText}numberOfLines={1}>
|
|
51
51
|
Initial state (no actions dispatched yet)
|
|
52
52
|
</S>}
|
|
@@ -56,21 +56,21 @@ import Le,{useCallback as Pe,useMemo as N,useRef as De,useState as _}from"react"
|
|
|
56
56
|
|
|
57
57
|
<C style={o.cardFooterRow}>
|
|
58
58
|
<C style={o.footerLeft}>
|
|
59
|
-
<
|
|
59
|
+
<Ye color={e.grayTextWeak}size={10}/>
|
|
60
60
|
<S style={o.footerTimestampText}numberOfLines={1}>
|
|
61
61
|
{t.lastAction?.timestamp||"Initial state"}
|
|
62
62
|
</S>
|
|
63
|
-
{
|
|
64
|
-
<
|
|
63
|
+
{E&&<Ce onPress={()=>_e(t.lastAction.callerFile,t.lastAction.callerLine,t.lastAction.callerCol)}hitSlop={6}style={o.callerChip}>
|
|
64
|
+
<Vt color={e.sky600}size={9}/>
|
|
65
65
|
<S style={o.callerChipText}>
|
|
66
|
-
{
|
|
66
|
+
{E.display}
|
|
67
67
|
</S>
|
|
68
68
|
</Ce>}
|
|
69
69
|
</C>
|
|
70
70
|
|
|
71
71
|
<C style={o.footerRight}>
|
|
72
72
|
<C style={o.metaStatChip}>
|
|
73
|
-
<
|
|
73
|
+
<Ct color={e.violet600}size={9.5}/>
|
|
74
74
|
<S style={o.metaStatText}>
|
|
75
75
|
{t.sizeStr}
|
|
76
76
|
</S>
|
|
@@ -91,34 +91,34 @@ import Le,{useCallback as Pe,useMemo as N,useRef as De,useState as _}from"react"
|
|
|
91
91
|
</C>
|
|
92
92
|
</Ne>
|
|
93
93
|
</C>
|
|
94
|
-
</$e>},[k,Z]);return
|
|
94
|
+
</$e>},[k,Z]);return I?<C style={{flex:1,backgroundColor:e.grayBackground}}>
|
|
95
95
|
|
|
96
96
|
<C style={o.overviewCard}>
|
|
97
97
|
<C style={o.statCol}>
|
|
98
|
-
<S style={o.statHeading}>{
|
|
98
|
+
<S style={o.statHeading}>{B("redux.activeSlices","ACTIVE SLICES")}</S>
|
|
99
99
|
<S style={o.statBigVal}>{$.length}</S>
|
|
100
100
|
</C>
|
|
101
101
|
<C style={o.statDivider}/>
|
|
102
102
|
<C style={o.statCol}>
|
|
103
|
-
<S style={o.statHeading}>{
|
|
103
|
+
<S style={o.statHeading}>{B("redux.totalState","TOTAL STATE")}</S>
|
|
104
104
|
<S style={o.statBigVal}>{Ve}</S>
|
|
105
105
|
</C>
|
|
106
106
|
<C style={o.statDivider}/>
|
|
107
107
|
<C style={[o.statCol,{flex:1.6}]}>
|
|
108
108
|
<C style={{flexDirection:"row",alignItems:"center",gap:4}}>
|
|
109
|
-
<S style={o.statHeading}>{
|
|
110
|
-
{
|
|
109
|
+
<S style={o.statHeading}>{B("redux.lastActionHeader","LAST ACTION")}</S>
|
|
110
|
+
{M?.originType&&(()=>{const t=Ie(M.originType);return<C style={{flexDirection:"row",alignItems:"center",gap:2,backgroundColor:t.bg,paddingHorizontal:4,paddingVertical:1,borderRadius:3}}>
|
|
111
111
|
{t.renderIcon(t.text,8)}
|
|
112
|
-
<S style={{fontFamily:
|
|
112
|
+
<S style={{fontFamily:R.interBold,fontSize:7.5,color:t.text}}>
|
|
113
113
|
{t.label}
|
|
114
114
|
</S>
|
|
115
115
|
</C>})()}
|
|
116
116
|
</C>
|
|
117
117
|
<S style={o.statLastAction}numberOfLines={1}>
|
|
118
|
-
{
|
|
118
|
+
{M?M.type:"Initial"}
|
|
119
119
|
</S>
|
|
120
|
-
{
|
|
121
|
-
{
|
|
120
|
+
{M?.timestamp&&<S style={o.statLastTime}>
|
|
121
|
+
{M.timestamp}
|
|
122
122
|
</S>}
|
|
123
123
|
</C>
|
|
124
124
|
</C>
|
|
@@ -126,13 +126,13 @@ import Le,{useCallback as Pe,useMemo as N,useRef as De,useState as _}from"react"
|
|
|
126
126
|
|
|
127
127
|
<C style={o.toolbarContainer}>
|
|
128
128
|
<C style={o.searchRow}>
|
|
129
|
-
<C style={
|
|
129
|
+
<C style={O.searchContainer}>
|
|
130
130
|
<Je color={e.grayTextWeak}size={15}/>
|
|
131
|
-
<
|
|
131
|
+
<Ee accessible={!0}accessibilityRole="search"accessibilityLabel="Search Redux slices or actions"accessibilityHint="Type to filter state slices in real time"placeholder={B("redux.searchPlaceholder","Search state or actions...")}placeholderTextColor={e.grayTextWeak}value={k}onChangeText={G}style={O.searchInput}autoCorrect={!1}autoCapitalize="none"/>
|
|
132
132
|
{k.length>0&&<C style={{flexDirection:"row",alignItems:"center",gap:4}}>
|
|
133
133
|
<C style={{backgroundColor:`${e.purple}20`,borderRadius:10,paddingHorizontal:6,paddingVertical:1.5}}>
|
|
134
|
-
<S style={{color:e.purple,fontSize:9.5,fontFamily:
|
|
135
|
-
{
|
|
134
|
+
<S style={{color:e.purple,fontSize:9.5,fontFamily:R.interBold}}>
|
|
135
|
+
{D.length}
|
|
136
136
|
</S>
|
|
137
137
|
</C>
|
|
138
138
|
<Ce accessible={!0}accessibilityRole="button"accessibilityLabel="Clear search input"onPress={()=>G("")}hitSlop={10}>
|
|
@@ -142,32 +142,32 @@ import Le,{useCallback as Pe,useMemo as N,useRef as De,useState as _}from"react"
|
|
|
142
142
|
</C>
|
|
143
143
|
|
|
144
144
|
|
|
145
|
-
<
|
|
146
|
-
<
|
|
147
|
-
</
|
|
145
|
+
<We accessible={!0}accessibilityRole="button"accessibilityLabel={`Sort order: ${P==="latest"?"Recently updated first":"Alphabetical A to Z"}`}accessibilityHint="Switches sorting between recently updated and alphabetical"style={[O.toolbarBtn,P==="latest"&&{backgroundColor:`${e.brandPurple}1F`,borderColor:e.brandPurple}]}onPress={()=>ke(t=>t==="latest"?"alpha":"latest")}hitSlop={6}>
|
|
146
|
+
<St color={P==="latest"?e.brandPurple:e.grayTextStrong}size={16}/>
|
|
147
|
+
</We>
|
|
148
148
|
</C>
|
|
149
149
|
|
|
150
150
|
<C style={o.headerSubRow}>
|
|
151
151
|
<S style={o.resultCount}>
|
|
152
|
-
Showing {
|
|
152
|
+
Showing {D.length} of {$.length} state slices
|
|
153
153
|
</S>
|
|
154
154
|
<C style={{flexDirection:"row",alignItems:"center",gap:4}}>
|
|
155
|
-
{
|
|
155
|
+
{P==="latest"?<U color={e.brandPurple}size={11}/>:<Bt color={e.brandPurple}size={11}/>}
|
|
156
156
|
<S style={o.sortLabel}>
|
|
157
|
-
{
|
|
157
|
+
{P==="latest"?"Newest Updates First":"Alphabetical (A-Z)"}
|
|
158
158
|
</S>
|
|
159
159
|
</C>
|
|
160
160
|
</C>
|
|
161
161
|
</C>
|
|
162
162
|
|
|
163
163
|
|
|
164
|
-
<
|
|
165
|
-
</C>:<C style={
|
|
166
|
-
<C style={
|
|
167
|
-
<
|
|
164
|
+
<De ref={K}data={_}keyExtractor={t=>t.id}renderItem={ve}getItemLayout={(t,A)=>({length:126,offset:126*A,index:A})}initialNumToRender={12}maxToRenderPerBatch={8}windowSize={5}removeClippedSubviews={oe.OS==="android"}renderToHardwareTextureAndroid={!0}ListEmptyComponent={<Ue isSearch={k.trim().length>0}searchQuery={k}onClearSearch={()=>G("")}customTitle={k.trim().length>0?"No Matching Slices":"No Redux State Detected"}customSub={k.trim().length>0?`No Redux slices match "${k}"`:"Attach the Redux store or dispatch actions to see state slices."}/>}ListFooterComponent={D.length>0?<Ge count={_.length}totalCount={D.length}label="slices"loadMoreStep={ze}hasMore={_.length<D.length}onLoadMore={()=>J(t=>t+ze)}/>:null}contentContainerStyle={[o.listContent,D.length===0&&{flexGrow:1}]}keyboardShouldPersistTaps="handled"/>
|
|
165
|
+
</C>:<C style={O.emptyContainer}>
|
|
166
|
+
<C style={O.emptyIconWrap}>
|
|
167
|
+
<Ae color={e.purple}size={32}/>
|
|
168
168
|
</C>
|
|
169
|
-
<S style={
|
|
170
|
-
<S style={
|
|
171
|
-
{
|
|
169
|
+
<S style={O.emptyTitle}>{B("redux.noStoreConnected","No Redux Store Connected")}</S>
|
|
170
|
+
<S style={O.emptySub}>
|
|
171
|
+
{B("redux.connectStoreTip","Call connectReduxStore(store) or use inspectorReduxMiddleware at app initialization.")}
|
|
172
172
|
</S>
|
|
173
|
-
</C>}),o=
|
|
173
|
+
</C>}),o=Fe.create({overviewCard:{flexDirection:"row",alignItems:"center",backgroundColor:e.white,marginHorizontal:12,marginTop:10,borderRadius:12,padding:12,borderWidth:1,borderColor:e.dividerColor,shadowColor:e.primaryBlack,shadowOffset:{width:0,height:1},shadowOpacity:.03,shadowRadius:3,elevation:1},statCol:{flex:1},statDivider:{width:1,height:28,backgroundColor:e.dividerColor,marginHorizontal:8},statHeading:{fontFamily:R.interBold,fontSize:9,color:e.grayTextWeak,letterSpacing:.5},statBigVal:{fontFamily:R.interBold,fontSize:14,color:e.primaryBlack,marginTop:2},statLastAction:{fontFamily:R.interBold,fontSize:11,color:e.purple,marginTop:2},statLastTime:{fontFamily:R.interRegular,fontSize:9.5,color:e.grayTextWeak},toolbarContainer:{backgroundColor:e.white,borderBottomWidth:1,borderBottomColor:e.dividerColor,paddingHorizontal:12,paddingTop:8,paddingBottom:6,marginTop:8},searchRow:{flexDirection:"row",alignItems:"center",gap:8},headerSubRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginTop:6,paddingHorizontal:2},resultCount:{fontFamily:R.interMedium,fontSize:11,color:e.grayTextWeak},sortLabel:{fontFamily:R.interMedium,fontSize:10.5,color:e.brandPurple},listContent:{paddingVertical:8,paddingBottom:36},cardContainer:{paddingHorizontal:10,paddingVertical:4,height:126},card:{backgroundColor:e.white,borderRadius:10,borderWidth:1,borderColor:e.grayBorderSecondary,shadowColor:e.shadowColorString,shadowOffset:{width:0,height:1},shadowOpacity:.05,shadowRadius:2.5,elevation:1.5,height:118,overflow:"hidden"},cardRecentlyUpdated:{borderColor:`${e.brandPurple}66`,backgroundColor:e.purpleTintBg},cardBody:{paddingHorizontal:12,paddingTop:9,paddingBottom:7,flex:1,justifyContent:"space-between"},cardHeaderRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:22,minHeight:22,maxHeight:22,gap:6},cardHeaderLeft:{flexDirection:"row",alignItems:"center",gap:6,flex:1,minWidth:0},cardHeaderRight:{flexDirection:"row",alignItems:"center",gap:6,flexShrink:0},serialNumber:{fontFamily:R.interBold,fontSize:10.5,lineHeight:13,color:e.grayTextWeak},methodBadge:{paddingHorizontal:5.5,paddingVertical:2,borderRadius:4,alignItems:"center",justifyContent:"center"},methodBadgeText:{fontFamily:R.interBold,color:e.white,fontSize:9,lineHeight:12,letterSpacing:.4},chip:{flexDirection:"row",alignItems:"center",gap:3,paddingHorizontal:5,paddingVertical:1.5,borderRadius:4,borderWidth:1},chipText:{fontFamily:R.interBold,fontSize:8.5,lineHeight:11,letterSpacing:.3},statusPill:{flexDirection:"row",alignItems:"center",gap:3.5,paddingHorizontal:6,paddingVertical:2,borderRadius:4,borderWidth:1},liveDot:{width:6,height:6,borderRadius:3,backgroundColor:e.emerald500},statusPillText:{fontFamily:R.interBold,fontSize:9.5,lineHeight:12},cardMainRow:{height:48,minHeight:48,maxHeight:48,justifyContent:"space-between",gap:3},sliceNameRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:6},sliceNameText:{fontFamily:R.interBold,fontSize:12.5,lineHeight:16,color:e.primaryBlack,flex:1},actionCountChip:{flexDirection:"row",alignItems:"center",gap:2.5,backgroundColor:`${e.violet600}14`,borderColor:`${e.violet600}2E`,borderWidth:1,paddingHorizontal:4.5,paddingVertical:1,borderRadius:3.5},actionCountChipText:{fontFamily:R.interBold,fontSize:8.5,lineHeight:11,color:e.violet600},actionPreviewRow:{flexDirection:"row",alignItems:"center",gap:4.5,minHeight:15},actionPreviewText:{fontFamily:oe.select({ios:"Menlo",default:"monospace"}),fontSize:10,lineHeight:13,color:e.grayTextWeak,flex:1},actionPreviewEmptyText:{fontFamily:R.interRegular,fontSize:10,lineHeight:13,color:e.slate400,fontStyle:"italic",flex:1},cardFooterRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:18,minHeight:18,maxHeight:18,gap:6},footerLeft:{flexDirection:"row",alignItems:"center",gap:5,flex:1,minWidth:0,overflow:"hidden"},footerRight:{flexDirection:"row",alignItems:"center",gap:5,flexShrink:0},footerTimestampText:{fontFamily:R.interRegular,fontSize:10,lineHeight:13,color:e.slate400},callerChip:{flexDirection:"row",alignItems:"center",gap:2.5,backgroundColor:e.sky100,paddingHorizontal:4.5,paddingVertical:1,borderRadius:3,borderWidth:.5,borderColor:e.sky400,marginLeft:4},callerChipText:{fontFamily:R.interMedium,fontSize:8.5,lineHeight:11,color:e.sky600},metaStatChip:{flexDirection:"row",alignItems:"center",gap:3,backgroundColor:e.violetSoftBg,borderColor:e.violetSoftBorder,borderWidth:1,paddingHorizontal:5.5,paddingVertical:1.5,borderRadius:4},metaStatText:{fontFamily:R.interBold,color:e.violetSoftText,fontSize:9,lineHeight:12},waterfallContainer:{height:2.5,width:"100%",backgroundColor:e.graySurface,borderRadius:1.5,overflow:"hidden"},waterfallBar:{height:"100%",borderRadius:1.5},highlight:{backgroundColor:e.yellowHighlight,color:e.primaryBlack,borderRadius:2}});export default Pt;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ke,{useState as z,useEffect as ve,useMemo as N,useCallback as oe,useRef as Ue}from"react";import{View as S,Text as C,ScrollView as _e,FlatList as Ye,TextInput as Se,Modal as Qe,Alert as Ve,StyleSheet as Ze,ActivityIndicator as Xe,Platform as Ie}from"react-native";import V from"../TouchableScale";import St from"../EndOfListFooter";import{AppColors as e}from"../../styles/AppColors";import{AppFonts as T}from"../../styles/AppFonts";import{useTranslation as Tt}from"../../i18n";import{DatabaseIcon as Pe,SearchIcon as Ct,ClearIcon as Ae,PlusIcon as Bt,PencilIcon as Vt,TrashIcon as Me,CopyIcon as It,CheckIcon as Pt,LayersIcon as At,ResetIcon as Mt,ChevronIcon as Ft,WarningTriangleIcon as Lt}from"../NetworkIcons";import{fetchStorageEntries as Dt,setStorageEntry as $t,removeStorageEntry as Rt,clearStorageDriver as Wt,getRegisteredMMKVInstanceIds as Et,subscribeToStorageChanges as Kt}from"../../customHooks/storageInspector";import{copyToClipboard as Ot}from"../../helpers";import{showToast as D}from"../../helpers/toast";const Nt=w=>{switch(w){case"json":return{label:"JSON",color:e.purple,bg:`${e.purple}16`};case"number":return{label:"NUM",color:e.warningIconGold,bg:`${e.warningIconGold}16`};case"boolean":return{label:"BOOL",color:e.emerald500,bg:`${e.emerald500}16`};case"null":return{label:"NULL",color:e.grayTextWeak,bg:`${e.grayTextWeak}16`};default:return{label:"STR",color:e.blue500,bg:`${e.blue500}16`}}},Ht=ke.memo(function({entry:B,isExpanded:r,onToggleExpand:J,onCopy:M,onEdit:q,onDelete:I,badge:$}){const Q=N(()=>B.byteSize<1024?`${B.byteSize.toLocaleString()} B`:`${(B.byteSize/1024).toLocaleString(void 0,{minimumFractionDigits:1,maximumFractionDigits:1})} KB`,[B.byteSize]),G=N(()=>{if(!r)return B.value.length>250?B.value.slice(0,250)+"...":B.value;if(B.type==="json")try{const P=B.parsedValue??JSON.parse(B.value);return JSON.stringify(P,null,2)}catch{return B.value}return B.value},[r,B.value,B.type,B.parsedValue]);return<S style={t.entryCard}>
|
|
2
2
|
|
|
3
3
|
<S style={t.entryHeader}>
|
|
4
4
|
<S style={{flex:1,marginRight:8}}>
|
|
@@ -6,9 +6,9 @@ import we,{useState as z,useEffect as je,useMemo as N,useCallback as oe,useRef a
|
|
|
6
6
|
<C style={t.entryKey}numberOfLines={1}selectable>
|
|
7
7
|
{B.key}
|
|
8
8
|
</C>
|
|
9
|
-
<S style={[t.typeBadge,{backgroundColor
|
|
10
|
-
<C style={[t.typeBadgeText,{color
|
|
11
|
-
{
|
|
9
|
+
<S style={[t.typeBadge,{backgroundColor:$.bg,borderColor:`${$.color}33`}]}>
|
|
10
|
+
<C style={[t.typeBadgeText,{color:$.color}]}>
|
|
11
|
+
{$.label}
|
|
12
12
|
</C>
|
|
13
13
|
</S>
|
|
14
14
|
<C style={t.sizeText}>{Q}</C>
|
|
@@ -17,16 +17,16 @@ import we,{useState as z,useEffect as je,useMemo as N,useCallback as oe,useRef a
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
<S style={t.entryActions}>
|
|
20
|
-
<V hitSlop={6}onPress={()=>
|
|
21
|
-
<
|
|
20
|
+
<V hitSlop={6}onPress={()=>M(B)}style={t.entryActionBtn}>
|
|
21
|
+
<It size={12}color={e.grayText}/>
|
|
22
22
|
</V>
|
|
23
23
|
|
|
24
24
|
<V hitSlop={6}onPress={()=>q(B)}style={t.entryActionBtn}>
|
|
25
|
-
<
|
|
25
|
+
<Vt size={12}color={e.purple}/>
|
|
26
26
|
</V>
|
|
27
27
|
|
|
28
28
|
<V hitSlop={6}onPress={()=>I(B.key)}style={[t.entryActionBtn,{backgroundColor:`${e.errorColor}12`}]}>
|
|
29
|
-
<
|
|
29
|
+
<Me size={12}color={e.errorColor}/>
|
|
30
30
|
</V>
|
|
31
31
|
</S>
|
|
32
32
|
</S>
|
|
@@ -40,15 +40,15 @@ import we,{useState as z,useEffect as je,useMemo as N,useCallback as oe,useRef a
|
|
|
40
40
|
<C style={t.expandHint}>
|
|
41
41
|
{r?"Collapse":"Expand"}
|
|
42
42
|
</C>
|
|
43
|
-
<
|
|
43
|
+
<Ft direction={r?"up":"down"}size={10}color={e.purple}/>
|
|
44
44
|
</S>}
|
|
45
45
|
</V>
|
|
46
|
-
</S>});export const StorageTab=
|
|
46
|
+
</S>}),Fe=50,Le=10;export const StorageTab=ke.memo(()=>{const{t:w}=Tt(),B=Ue(null),[r,J]=z("asyncStorage"),[M,q]=z("default"),[I,$]=z([]),[Q,G]=z(!0),[P,Z]=z(""),[X,Te]=z(Fe),[xe,De]=z({});ve(()=>{Te(Fe),B.current?.scrollToOffset({offset:0,animated:!1})},[P,r,M]);const[$e,E]=z(!1),[U,Ce]=z("create"),[K,ee]=z(""),[H,_]=z(""),[R,Y]=z("string"),[te,F]=z(null),Be=N(()=>Et(),[]),W=oe(async()=>{G(!0);try{const o=await Dt(r,r==="mmkv"?M:void 0);$(o)}catch{$([])}finally{G(!1)}},[r,M]);ve(()=>(W(),Kt(W)),[W]);const Re=o=>{De(A=>({...A,[o]:!A[o]}))},We=()=>{Ce("create"),ee(""),_(""),Y("string"),F(null),E(!0)},Ee=o=>{Ce("edit"),ee(o.key),_(o.value),Y(o.type==="json"?"json":o.type==="number"?"number":o.type==="boolean"?"boolean":"string"),F(null),E(!0)},Ke=o=>{Ve.alert(w("storage.deleteKeyTitle","Delete Key"),w("storage.deleteKeyMessage",{key:o,defaultValue:`Are you sure you want to delete key "${o}"?`}),[{text:w("common.cancel","Cancel"),style:"cancel"},{text:w("common.clear","Delete"),style:"destructive",onPress:async()=>{await Rt(r,o,r==="mmkv"?M:void 0)?(D(`Deleted "${o}"`),W()):D(`Failed to delete "${o}"`)}}])},Oe=()=>{Ve.alert(w("storage.clearTitle","Clear Storage Driver"),w("storage.clearMessage",{driver:r==="asyncStorage"?"AsyncStorage":"MMKV",defaultValue:`Are you sure you want to delete all keys in ${r==="asyncStorage"?"AsyncStorage":"MMKV"}?`}),[{text:w("common.cancel","Cancel"),style:"cancel"},{text:w("storage.clearConfirm","Clear All"),style:"destructive",onPress:async()=>{await Wt(r,r==="mmkv"?M:void 0)&&(D("All storage keys wiped"),W())}}])},Ne=async()=>{if(!K.trim()){D("Key name cannot be empty");return}let o=H;if(R==="json")try{const j=JSON.parse(H);o=JSON.stringify(j)}catch(j){F("Invalid JSON: "+j.message);return}else if(R==="number"&&isNaN(Number(H))){F("Value must be a valid number");return}await $t(r,K.trim(),o,r==="mmkv"?M:void 0)?(D(U==="create"?`Added "${K.trim()}"`:`Updated "${K.trim()}"`),E(!1),W()):D("Error saving storage key")},He=()=>{try{const o=JSON.parse(H);_(JSON.stringify(o,null,2)),F(null),Y("json"),D("Formatted JSON")}catch{F("Cannot format: invalid JSON syntax")}},L=N(()=>{if(!P.trim())return I;const o=P.toLowerCase().trim().split(/\s+/).filter(Boolean);return I.filter(A=>{const j=`${A.key} ${A.value}`.toLowerCase();return o.every(Ge=>j.includes(Ge))})},[I,P]),O=N(()=>I.reduce((o,A)=>o+A.byteSize,0),[I]),je=N(()=>O<1024?`${O.toLocaleString()} B`:O<1024*1024?`${(O/1024).toLocaleString(void 0,{minimumFractionDigits:1,maximumFractionDigits:1})} KB`:`${(O/(1024*1024)).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})} MB`,[O]),we=oe(o=>{Ot(o.value,o.key),D(`Copied value of "${o.key}"`)},[]),Je=oe(({item:o})=><Ht entry={o}isExpanded={!!xe[o.key]}onToggleExpand={Re}onCopy={we}onEdit={Ee}onDelete={Ke}badge={Nt(o.type)}/>,[xe,we]);return<S style={t.container}>
|
|
47
47
|
|
|
48
48
|
<S style={t.driverTabsWrapper}>
|
|
49
|
-
<
|
|
49
|
+
<_e horizontal showsHorizontalScrollIndicator={!1}contentContainerStyle={t.driverTabsContainer}>
|
|
50
50
|
<V onPress={()=>J("asyncStorage")}style={[t.driverTabPill,r==="asyncStorage"&&{backgroundColor:e.brandPurple,borderColor:e.brandPurple},r!=="asyncStorage"&&{backgroundColor:`${e.brandPurple}12`,borderColor:`${e.brandPurple}30`}]}>
|
|
51
|
-
<
|
|
51
|
+
<Pe size={11}color={r==="asyncStorage"?e.white:e.brandPurple}/>
|
|
52
52
|
<C style={[t.driverTabText,{color:r==="asyncStorage"?e.white:e.primaryBlack}]}>
|
|
53
53
|
{w("storage.subTabs.asyncStorage","AsyncStorage")}
|
|
54
54
|
</C>
|
|
@@ -60,7 +60,7 @@ import we,{useState as z,useEffect as je,useMemo as N,useCallback as oe,useRef a
|
|
|
60
60
|
</V>
|
|
61
61
|
|
|
62
62
|
<V onPress={()=>J("mmkv")}style={[t.driverTabPill,r==="mmkv"&&{backgroundColor:e.teal600,borderColor:e.teal600},r!=="mmkv"&&{backgroundColor:`${e.teal600}12`,borderColor:`${e.teal600}30`}]}>
|
|
63
|
-
<
|
|
63
|
+
<At size={11}color={r==="mmkv"?e.white:e.teal600}/>
|
|
64
64
|
<C style={[t.driverTabText,{color:r==="mmkv"?e.white:e.primaryBlack}]}>
|
|
65
65
|
{w("storage.subTabs.mmkv","MMKV")}
|
|
66
66
|
</C>
|
|
@@ -72,111 +72,111 @@ import we,{useState as z,useEffect as je,useMemo as N,useCallback as oe,useRef a
|
|
|
72
72
|
</V>
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
{r==="mmkv"&&
|
|
76
|
-
{
|
|
77
|
-
<C style={[t.instancePillText,
|
|
75
|
+
{r==="mmkv"&&Be.length>1&&<S style={{flexDirection:"row",alignItems:"center",gap:4,marginLeft:6}}>
|
|
76
|
+
{Be.map(o=><V key={o}onPress={()=>q(o)}style={[t.instancePill,M===o&&t.instancePillActive]}>
|
|
77
|
+
<C style={[t.instancePillText,M===o&&t.instancePillTextActive]}>
|
|
78
78
|
{o}
|
|
79
79
|
</C>
|
|
80
80
|
</V>)}
|
|
81
81
|
</S>}
|
|
82
|
-
</
|
|
82
|
+
</_e>
|
|
83
83
|
</S>
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
<S style={t.actionBar}>
|
|
87
87
|
<S style={t.searchBar}>
|
|
88
|
-
<
|
|
89
|
-
<Se value={
|
|
90
|
-
{
|
|
88
|
+
<Ct size={14}color={e.grayTextWeak}/>
|
|
89
|
+
<Se value={P}onChangeText={Z}placeholder={w("storage.searchPlaceholder","Search keys, values, types...")}placeholderTextColor={e.grayTextWeak}style={t.searchInput}clearButtonMode="while-editing"/>
|
|
90
|
+
{P.length>0&&<S style={{flexDirection:"row",alignItems:"center",gap:4}}>
|
|
91
91
|
<S style={{backgroundColor:`${e.purple}20`,borderRadius:10,paddingHorizontal:6,paddingVertical:1.5}}>
|
|
92
92
|
<C style={{color:e.purple,fontSize:9.5,fontFamily:T.interBold}}>
|
|
93
93
|
{L.length}
|
|
94
94
|
</C>
|
|
95
95
|
</S>
|
|
96
|
-
<V onPress={()=>
|
|
97
|
-
<
|
|
96
|
+
<V onPress={()=>Z("")}hitSlop={8}>
|
|
97
|
+
<Ae size={13}color={e.grayTextWeak}/>
|
|
98
98
|
</V>
|
|
99
99
|
</S>}
|
|
100
100
|
</S>
|
|
101
101
|
|
|
102
102
|
|
|
103
|
-
<V onPress={
|
|
104
|
-
<
|
|
103
|
+
<V onPress={We}style={t.addKeyBtn}hitSlop={6}>
|
|
104
|
+
<Bt size={13}color={e.white}/>
|
|
105
105
|
<C style={t.addKeyBtnText}>{w("storage.add","Add")}</C>
|
|
106
106
|
</V>
|
|
107
107
|
|
|
108
108
|
<V onPress={W}style={t.actionIconBtn}hitSlop={6}>
|
|
109
|
-
<
|
|
109
|
+
<Mt size={13}color={e.grayText}/>
|
|
110
110
|
</V>
|
|
111
111
|
|
|
112
|
-
{I.length>0&&<V onPress={
|
|
113
|
-
<
|
|
112
|
+
{I.length>0&&<V onPress={Oe}style={[t.actionIconBtn,{borderColor:`${e.errorColor}33`,backgroundColor:`${e.errorColor}12`}]}hitSlop={6}>
|
|
113
|
+
<Me size={13}color={e.errorColor}/>
|
|
114
114
|
</V>}
|
|
115
115
|
</S>
|
|
116
116
|
|
|
117
117
|
|
|
118
118
|
<S style={t.statsStrip}>
|
|
119
119
|
<C style={t.statsText}>
|
|
120
|
-
{L.length.toLocaleString()} of {I.length.toLocaleString()} Keys • {
|
|
120
|
+
{L.length.toLocaleString()} of {I.length.toLocaleString()} Keys • {je}
|
|
121
121
|
</C>
|
|
122
122
|
<C style={t.statsSubtext}>
|
|
123
|
-
{r==="asyncStorage"?"SQLite Key-Value":`MMKV (${
|
|
123
|
+
{r==="asyncStorage"?"SQLite Key-Value":`MMKV (${M})`}
|
|
124
124
|
</C>
|
|
125
125
|
</S>
|
|
126
126
|
|
|
127
127
|
|
|
128
128
|
{Q?<S style={t.loadingContainer}>
|
|
129
|
-
<
|
|
129
|
+
<Xe size="small"color={e.purple}/>
|
|
130
130
|
<C style={t.loadingText}>{w("storage.loading","Loading storage entries...")}</C>
|
|
131
131
|
</S>:<>
|
|
132
|
-
<
|
|
132
|
+
<Ye ref={B}data={L.slice(0,X)}keyExtractor={o=>o.key}renderItem={Je}initialNumToRender={10}maxToRenderPerBatch={10}windowSize={5}removeClippedSubviews={Ie.OS==="android"}style={t.scrollArea}contentContainerStyle={L.length===0?t.emptyScrollContent:t.scrollContent}showsVerticalScrollIndicator={!1}ListEmptyComponent={<S style={t.emptyContainer}>
|
|
133
133
|
<S style={t.emptyIconWrap}>
|
|
134
|
-
<
|
|
134
|
+
<Pe size={28}color={e.grayTextWeak}/>
|
|
135
135
|
</S>
|
|
136
136
|
<C style={t.emptyTitle}>
|
|
137
|
-
{
|
|
137
|
+
{P.trim().length>0?"No matching keys found":`No ${r==="asyncStorage"?"AsyncStorage":"MMKV"} Keys`}
|
|
138
138
|
</C>
|
|
139
139
|
<C style={t.emptySubtitle}>
|
|
140
|
-
{
|
|
140
|
+
{P.trim().length>0?`No keys or values match "${P}"`:`Storage is auto-detected. Tap "+ Add" above to create your first ${r==="asyncStorage"?"AsyncStorage":"MMKV"} key!`}
|
|
141
141
|
</C>
|
|
142
|
-
{
|
|
142
|
+
{P.trim().length>0&&<V onPress={()=>Z("")}style={{marginTop:12,paddingHorizontal:14,paddingVertical:6,borderRadius:8,backgroundColor:e.grayBackground,borderWidth:1,borderColor:e.grayBorderSecondary}}>
|
|
143
143
|
<C style={{color:e.brandPurple,fontSize:12,fontFamily:T.interBold}}>
|
|
144
144
|
Clear Search
|
|
145
145
|
</C>
|
|
146
146
|
</V>}
|
|
147
|
-
</S>}ListFooterComponent={L.length>0?<
|
|
147
|
+
</S>}ListFooterComponent={L.length>0?<St count={Math.min(X,L.length)}totalCount={L.length}label="keys"loadMoreStep={Le}hasMore={L.length>X}onLoadMore={()=>Te(o=>o+Le)}/>:<S style={{height:60}}/>}/>
|
|
148
148
|
</>}
|
|
149
149
|
|
|
150
150
|
|
|
151
|
-
<
|
|
151
|
+
<Qe visible={$e}transparent animationType="fade"onRequestClose={()=>E(!1)}>
|
|
152
152
|
<S style={t.modalOverlay}>
|
|
153
153
|
<S style={t.modalCard}>
|
|
154
154
|
<S style={t.modalHeader}>
|
|
155
155
|
<C style={t.modalTitle}>
|
|
156
|
-
{U==="create"?"Add Storage Key":`Edit: ${
|
|
156
|
+
{U==="create"?"Add Storage Key":`Edit: ${K}`}
|
|
157
157
|
</C>
|
|
158
|
-
<V onPress={()=>
|
|
159
|
-
<
|
|
158
|
+
<V onPress={()=>E(!1)}hitSlop={8}>
|
|
159
|
+
<Ae size={16}color={e.grayText}/>
|
|
160
160
|
</V>
|
|
161
161
|
</S>
|
|
162
162
|
|
|
163
163
|
|
|
164
164
|
<S style={t.inputGroup}>
|
|
165
165
|
<C style={t.inputLabel}>{w("storage.keyName","KEY NAME").toUpperCase()}</C>
|
|
166
|
-
<Se value={
|
|
166
|
+
<Se value={K}onChangeText={ee}placeholder="e.g. user_session, auth_token"placeholderTextColor={e.grayTextWeak}editable={U==="create"}style={[t.textInput,U==="edit"&&t.textInputDisabled]}autoCapitalize="none"/>
|
|
167
167
|
</S>
|
|
168
168
|
|
|
169
169
|
|
|
170
170
|
<S style={t.inputGroup}>
|
|
171
171
|
<S style={{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:4}}>
|
|
172
172
|
<C style={t.inputLabel}>{w("storage.type","VALUE TYPE").toUpperCase()}</C>
|
|
173
|
-
{R==="json"&&<V onPress={
|
|
173
|
+
{R==="json"&&<V onPress={He}hitSlop={6}>
|
|
174
174
|
<C style={t.formatJsonBtn}>{w("storage.beautifyJson","Beautify JSON")}</C>
|
|
175
175
|
</V>}
|
|
176
176
|
</S>
|
|
177
177
|
<S style={t.typeSelectorStrip}>
|
|
178
|
-
{["string","json","number","boolean"].map(o=>{const
|
|
179
|
-
<C style={[t.typePillText,
|
|
178
|
+
{["string","json","number","boolean"].map(o=>{const A=R===o;return<V key={o}onPress={()=>{Y(o),F(null)}}style={[t.typePill,A&&t.typePillActive]}>
|
|
179
|
+
<C style={[t.typePillText,A&&t.typePillTextActive]}>
|
|
180
180
|
{o.toUpperCase()}
|
|
181
181
|
</C>
|
|
182
182
|
</V>})}
|
|
@@ -186,24 +186,24 @@ import we,{useState as z,useEffect as je,useMemo as N,useCallback as oe,useRef a
|
|
|
186
186
|
|
|
187
187
|
<S style={t.inputGroup}>
|
|
188
188
|
<C style={t.inputLabel}>{w("storage.valueContent","VALUE CONTENT").toUpperCase()}</C>
|
|
189
|
-
<Se value={H}onChangeText={o=>{
|
|
189
|
+
<Se value={H}onChangeText={o=>{_(o),te&&F(null)}}placeholder={R==="json"?'{"userId": 123, "isLoggedIn": true}':R==="number"?"42":R==="boolean"?"true":"String value..."}placeholderTextColor={e.grayTextWeak}style={[t.textInput,t.textAreaInput]}multiline textAlignVertical="top"autoCapitalize="none"/>
|
|
190
190
|
{te&&<S style={{flexDirection:"row",alignItems:"center",gap:5,marginTop:4}}>
|
|
191
|
-
<
|
|
191
|
+
<Lt size={12}color={e.errorColor}/>
|
|
192
192
|
<C style={t.errorText}>{te}</C>
|
|
193
193
|
</S>}
|
|
194
194
|
</S>
|
|
195
195
|
|
|
196
196
|
|
|
197
197
|
<S style={t.modalActions}>
|
|
198
|
-
<V onPress={()=>
|
|
198
|
+
<V onPress={()=>E(!1)}style={t.cancelBtn}>
|
|
199
199
|
<C style={t.cancelBtnText}>{w("common.cancel","Cancel")}</C>
|
|
200
200
|
</V>
|
|
201
|
-
<V onPress={
|
|
202
|
-
<
|
|
201
|
+
<V onPress={Ne}style={t.saveBtn}>
|
|
202
|
+
<Pt size={14}color={e.white}/>
|
|
203
203
|
<C style={t.saveBtnText}>{w("storage.saveKey","Save Key")}</C>
|
|
204
204
|
</V>
|
|
205
205
|
</S>
|
|
206
206
|
</S>
|
|
207
207
|
</S>
|
|
208
|
-
</
|
|
209
|
-
</S>});const t=
|
|
208
|
+
</Qe>
|
|
209
|
+
</S>});const t=Ze.create({container:{flex:1,backgroundColor:e.grayBackground},driverTabsWrapper:{backgroundColor:e.primaryLight,borderBottomWidth:1,borderBottomColor:e.dividerColor,paddingVertical:8},driverTabsContainer:{paddingHorizontal:12,flexDirection:"row",alignItems:"center",gap:6},driverTabPill:{flexDirection:"row",alignItems:"center",gap:5,paddingHorizontal:9,paddingVertical:4.5,borderRadius:8,backgroundColor:e.grayBackground,borderWidth:1,borderColor:e.grayBorderSecondary},driverTabPillActive:{backgroundColor:e.purple,borderColor:e.purple},driverTabText:{fontFamily:T.interBold,fontSize:10.5,color:e.grayText},driverTabTextActive:{color:e.white},driverCountBadge:{backgroundColor:"rgba(255, 255, 255, 0.25)",paddingHorizontal:5,paddingVertical:1,borderRadius:8},driverCountText:{fontFamily:T.interBold,fontSize:9.5,color:e.white},instancePill:{paddingHorizontal:7,paddingVertical:3,borderRadius:6,backgroundColor:`${e.purple}14`,borderWidth:1,borderColor:`${e.purple}30`},instancePillActive:{backgroundColor:e.purple,borderColor:e.purple},instancePillText:{fontFamily:T.interBold,fontSize:10,color:e.purple},instancePillTextActive:{color:e.white},actionBar:{flexDirection:"row",alignItems:"center",paddingHorizontal:12,paddingVertical:8,backgroundColor:e.primaryLight,borderBottomWidth:1,borderBottomColor:e.dividerColor,gap:6},searchBar:{flex:1,flexDirection:"row",alignItems:"center",backgroundColor:e.grayBackground,borderRadius:8,paddingHorizontal:9,paddingVertical:Ie.OS==="ios"?6:2,borderWidth:1,borderColor:e.grayBorderSecondary,gap:6},searchInput:{flex:1,fontFamily:T.interMedium,fontSize:12,color:e.primaryBlack,padding:0},addKeyBtn:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:10,paddingVertical:6,borderRadius:8,backgroundColor:e.purple},addKeyBtnText:{fontFamily:T.interBold,fontSize:11,color:e.white},actionIconBtn:{width:30,height:30,borderRadius:8,alignItems:"center",justifyContent:"center",backgroundColor:e.grayBackground,borderWidth:1,borderColor:e.grayBorderSecondary},statsStrip:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:5,backgroundColor:`${e.grayBorderSecondary}40`},statsText:{fontFamily:T.interMedium,fontSize:10,color:e.grayText},statsSubtext:{fontFamily:T.interBold,fontSize:9.5,color:e.grayTextWeak},scrollArea:{flex:1},scrollContent:{padding:12,gap:10,paddingBottom:100},emptyScrollContent:{flexGrow:1,justifyContent:"center",alignItems:"center",padding:24,paddingBottom:60},entryCard:{backgroundColor:e.primaryLight,borderRadius:10,borderWidth:1,borderColor:e.grayBorderSecondary,padding:10,gap:8,shadowColor:e.black,shadowOpacity:.02,shadowRadius:3,shadowOffset:{width:0,height:1},elevation:1},entryHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},entryKey:{fontFamily:T.interBold,fontSize:12.5,color:e.primaryBlack},typeBadge:{paddingHorizontal:5,paddingVertical:1,borderRadius:4,borderWidth:1},typeBadgeText:{fontFamily:T.interBold,fontSize:8.5},sizeText:{fontFamily:T.interRegular,fontSize:10,color:e.grayTextWeak},entryActions:{flexDirection:"row",alignItems:"center",gap:5},entryActionBtn:{padding:5,borderRadius:5,backgroundColor:e.grayBackground},valuePreviewBox:{backgroundColor:e.grayBackground,borderRadius:6,padding:8,borderWidth:1,borderColor:`${e.grayBorderSecondary}80`},valuePreviewText:{fontFamily:T.interRegular,fontSize:11,color:e.primaryBlack,lineHeight:16},expandHint:{fontFamily:T.interBold,fontSize:9.5,color:e.purple,marginTop:4},loadingContainer:{flex:1,alignItems:"center",justifyContent:"center",gap:8},loadingText:{fontFamily:T.interMedium,fontSize:12,color:e.grayText},emptyContainer:{padding:24,alignItems:"center",justifyContent:"center"},emptyIconWrap:{width:56,height:56,borderRadius:28,backgroundColor:`${e.grayBorderSecondary}40`,alignItems:"center",justifyContent:"center",marginBottom:12},emptyTitle:{fontFamily:T.interBold,fontSize:14,color:e.primaryBlack,marginBottom:4},emptySubtitle:{fontFamily:T.interRegular,fontSize:11.5,color:e.grayText,textAlign:"center",maxWidth:280},connectGuideCard:{marginTop:20,width:"100%",backgroundColor:e.primaryLight,borderRadius:10,borderWidth:1,borderColor:e.grayBorderSecondary,padding:12,gap:6},connectGuideTitle:{fontFamily:T.interBold,fontSize:11,color:e.purple},connectGuideCode:{fontFamily:T.interRegular,fontSize:10,color:e.grayText,lineHeight:15},modalOverlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center",padding:16},modalCard:{width:"100%",maxWidth:400,backgroundColor:e.primaryLight,borderRadius:14,padding:16,gap:12,shadowColor:e.black,shadowOpacity:.2,shadowRadius:10,shadowOffset:{width:0,height:4},elevation:5},modalHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",borderBottomWidth:1,borderBottomColor:e.dividerColor,paddingBottom:10},modalTitle:{fontFamily:T.interBold,fontSize:14,color:e.primaryBlack},inputGroup:{gap:4},inputLabel:{fontFamily:T.interBold,fontSize:9.5,color:e.grayTextWeak,letterSpacing:.5},textInput:{backgroundColor:e.grayBackground,borderRadius:8,paddingHorizontal:10,paddingVertical:8,fontFamily:T.interMedium,fontSize:12,color:e.primaryBlack,borderWidth:1,borderColor:e.grayBorderSecondary},textInputDisabled:{backgroundColor:`${e.grayBorderSecondary}40`,color:e.grayText},textAreaInput:{minHeight:90,maxHeight:160,fontFamily:T.interRegular,fontSize:11},typeSelectorStrip:{flexDirection:"row",alignItems:"center",gap:6},typePill:{flex:1,alignItems:"center",paddingVertical:6,borderRadius:6,backgroundColor:e.grayBackground,borderWidth:1,borderColor:e.grayBorderSecondary},typePillActive:{backgroundColor:e.purple,borderColor:e.purple},typePillText:{fontFamily:T.interBold,fontSize:10,color:e.grayText},typePillTextActive:{color:e.white},formatJsonBtn:{fontFamily:T.interBold,fontSize:10,color:e.purple},errorText:{fontFamily:T.interMedium,fontSize:10,color:e.errorColor,marginTop:2},modalActions:{flexDirection:"row",alignItems:"center",gap:10,marginTop:4},cancelBtn:{flex:1,alignItems:"center",paddingVertical:10,borderRadius:8,backgroundColor:e.grayBackground,borderWidth:1,borderColor:e.grayBorderSecondary},cancelBtnText:{fontFamily:T.interBold,fontSize:12,color:e.grayText},saveBtn:{flex:1.5,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:5,paddingVertical:10,borderRadius:8,backgroundColor:e.purple},saveBtnText:{fontFamily:T.interBold,fontSize:12,color:e.white}});export default StorageTab;
|