react-native-inapp-inspector 2.5.1 → 2.5.2
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.ar.md +151 -53
- package/README.de.md +150 -52
- package/README.es.md +139 -42
- package/README.fr.md +151 -53
- package/README.hi.md +141 -43
- package/README.ja.md +150 -69
- package/README.ko.md +153 -55
- package/README.md +73 -14
- package/README.pt-BR.md +152 -54
- package/README.ru.md +153 -55
- package/README.zh-CN.md +95 -219
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +154 -9
- package/dist/commonjs/capture.d.ts +5 -2
- package/dist/commonjs/capture.js +1 -1
- package/dist/commonjs/components/Inspector/FabLauncher.js +12 -12
- package/dist/commonjs/components/Inspector/FloatingCaptureWidget.js +17 -17
- package/dist/commonjs/components/Inspector/InspectorHeader.js +41 -41
- package/dist/commonjs/components/Inspector/MainScreen.js +15 -15
- package/dist/commonjs/components/Inspector/MediaGalleryTab.js +52 -34
- package/dist/commonjs/components/Inspector/MediaPreviewModal.d.ts +20 -18
- package/dist/commonjs/components/Inspector/MediaPreviewModal.js +744 -304
- package/dist/commonjs/components/NetworkIcons.d.ts +12 -0
- package/dist/commonjs/components/NetworkIcons.js +56 -3
- package/dist/commonjs/constants/telemetryConfig.d.ts +3 -3
- package/dist/commonjs/constants/telemetryConfig.js +1 -1
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/i18n/locales/ar.json +1 -1
- package/dist/commonjs/i18n/locales/bn.json +1 -1
- package/dist/commonjs/i18n/locales/de.json +1 -1
- package/dist/commonjs/i18n/locales/en.json +1 -1
- package/dist/commonjs/i18n/locales/es.json +1 -1
- package/dist/commonjs/i18n/locales/fr.json +1 -1
- package/dist/commonjs/i18n/locales/gu.json +1 -1
- package/dist/commonjs/i18n/locales/hi.json +1 -1
- package/dist/commonjs/i18n/locales/id.json +1 -1
- package/dist/commonjs/i18n/locales/it.json +1 -1
- package/dist/commonjs/i18n/locales/ja.json +1 -1
- package/dist/commonjs/i18n/locales/kn.json +1 -1
- package/dist/commonjs/i18n/locales/ko.json +1 -1
- package/dist/commonjs/i18n/locales/ml.json +1 -1
- package/dist/commonjs/i18n/locales/mr.json +1 -1
- package/dist/commonjs/i18n/locales/nl.json +1 -1
- package/dist/commonjs/i18n/locales/pa.json +1 -1
- package/dist/commonjs/i18n/locales/pl.json +1 -1
- package/dist/commonjs/i18n/locales/pt.json +1 -1
- package/dist/commonjs/i18n/locales/ru.json +1 -1
- package/dist/commonjs/i18n/locales/ta.json +1 -1
- package/dist/commonjs/i18n/locales/te.json +1 -1
- package/dist/commonjs/i18n/locales/tr.json +1 -1
- package/dist/commonjs/i18n/locales/vi.json +1 -1
- package/dist/commonjs/i18n/locales/zh.json +1 -1
- package/dist/commonjs/index.js +1 -1
- package/dist/commonjs/native/NativeInspector.d.ts +4 -0
- package/dist/commonjs/native/NativeInspector.js +1 -1
- package/dist/commonjs/native/NativeNetworkInspector.d.ts +1 -0
- package/dist/commonjs/types/interfaces.d.ts +2 -0
- package/dist/esm/capture.d.ts +5 -2
- package/dist/esm/capture.js +1 -1
- package/dist/esm/components/Inspector/FabLauncher.js +37 -37
- package/dist/esm/components/Inspector/FloatingCaptureWidget.js +30 -30
- package/dist/esm/components/Inspector/InspectorHeader.js +34 -34
- package/dist/esm/components/Inspector/MainScreen.js +51 -51
- package/dist/esm/components/Inspector/MediaGalleryTab.js +100 -82
- package/dist/esm/components/Inspector/MediaPreviewModal.d.ts +20 -18
- package/dist/esm/components/Inspector/MediaPreviewModal.js +774 -334
- package/dist/esm/components/NetworkIcons.d.ts +12 -0
- package/dist/esm/components/NetworkIcons.js +256 -203
- package/dist/esm/constants/telemetryConfig.d.ts +3 -3
- package/dist/esm/constants/telemetryConfig.js +1 -1
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/i18n/locales/ar.json +1 -1
- package/dist/esm/i18n/locales/bn.json +1 -1
- package/dist/esm/i18n/locales/de.json +1 -1
- package/dist/esm/i18n/locales/en.json +1 -1
- package/dist/esm/i18n/locales/es.json +1 -1
- package/dist/esm/i18n/locales/fr.json +1 -1
- package/dist/esm/i18n/locales/gu.json +1 -1
- package/dist/esm/i18n/locales/hi.json +1 -1
- package/dist/esm/i18n/locales/id.json +1 -1
- package/dist/esm/i18n/locales/it.json +1 -1
- package/dist/esm/i18n/locales/ja.json +1 -1
- package/dist/esm/i18n/locales/kn.json +1 -1
- package/dist/esm/i18n/locales/ko.json +1 -1
- package/dist/esm/i18n/locales/ml.json +1 -1
- package/dist/esm/i18n/locales/mr.json +1 -1
- package/dist/esm/i18n/locales/nl.json +1 -1
- package/dist/esm/i18n/locales/pa.json +1 -1
- package/dist/esm/i18n/locales/pl.json +1 -1
- package/dist/esm/i18n/locales/pt.json +1 -1
- package/dist/esm/i18n/locales/ru.json +1 -1
- package/dist/esm/i18n/locales/ta.json +1 -1
- package/dist/esm/i18n/locales/te.json +1 -1
- package/dist/esm/i18n/locales/tr.json +1 -1
- package/dist/esm/i18n/locales/vi.json +1 -1
- package/dist/esm/i18n/locales/zh.json +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/native/NativeInspector.d.ts +4 -0
- package/dist/esm/native/NativeInspector.js +1 -1
- package/dist/esm/native/NativeNetworkInspector.d.ts +1 -0
- package/dist/esm/types/interfaces.d.ts +2 -0
- package/ios/NetworkInspectorModule.mm +487 -224
- package/package.json +1 -1
- package/react-native-inapp-inspector.podspec +1 -1
- package/src/native/NativeInspector.ts +22 -0
- package/src/native/NativeNetworkInspector.ts +1 -1
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/9.2.0/checksums/checksums.lock +0 -0
- package/android/.gradle/9.2.0/fileChanges/last-build.bin +0 -0
- package/android/.gradle/9.2.0/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/9.2.0/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/9.2.0/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.settings/org.eclipse.buildship.core.prefs +0 -13
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
import{useState as
|
|
2
|
-
`);et(i,`${e.length} Media URIs`)
|
|
1
|
+
import{useState as $,useEffect as je,useMemo as ae,useCallback as ne}from"react";import{Dimensions as Ee,FlatList as Ne,Image as Ce,RefreshControl as _e,Share as Te,StyleSheet as qe,Text as S,TouchableOpacity as I,View as C}from"react-native";import{AppColors as t}from"../../styles/AppColors";import{AppFonts as z}from"../../styles/AppFonts";import Se from"../TouchableScale";import Je from"../EmptyState";import{CameraRollIcon as Ie,CheckIcon as Be,CopyIcon as Q,FilmIcon as L,GifIcon as X,GridIcon as Qe,ImageIcon as U,ListIcon as Xe,PlayIcon as Re,ScreencastIcon as Ye,ShareIcon as Ge,TrashIcon as Y}from"../NetworkIcons";import{MediaPreviewModal as Ze}from"./MediaPreviewModal";import{ScreenCapture as A}from"../../capture";import{copyImageOrMediaToClipboard as Ke,copyToClipboard as et,formatBytes as H}from"../../helpers";import{showToast as M}from"../../helpers/toast";import{useTranslation as tt}from"../../i18n";import{useInspector as ot}from"./InspectorContext";import{ConfirmationModal as Ct}from"./ConfirmationModal";export const MediaGalleryTab=()=>{const{t:r}=tt(),{refreshMediaCount:D,switchActiveTab:N,previewMediaItem:Z,setPreviewMediaItem:j}=ot(),[x,K]=$([]),[Ve,ee]=$(!1),[v,Me]=$("all"),[B,E]=$(new Set),[R,te]=$("grid"),[P,F]=$({visible:!1,title:"",message:"",onConfirm:()=>{}}),oe=async()=>{try{const e=v==="image"?"image":v==="video"?"video":"any",i=await A.pickMedia({mediaType:e});i&&(await G(),D?.().catch(()=>{}),M(i.type==="video"?r("mediaGallery.importedVideo","Video imported from Camera Roll"):r("mediaGallery.importedPhoto","Photo imported from Camera Roll")),j(i))}catch{M(r("mediaGallery.importFailed","Failed to import media"))}},G=ne(async()=>{try{const e=await A.getMediaList();K(e),D?.().catch(()=>{})}catch{K([])}},[D]);je(()=>{G()},[G]);const De=async()=>{ee(!0),await G(),ee(!1)},V=ae(()=>v==="all"?x:x.filter(e=>e.type===v),[x,v]),_=ae(()=>x.reduce((e,i)=>e+(i.sizeBytes||0),0),[x]),ie=ne(e=>{E(i=>{const l=new Set(i);return l.has(e)?l.delete(e):l.add(e),l})},[]),re=async e=>{await A.deleteMedia(e.uri),E(l=>{const T=new Set(l);return T.delete(e.id),T}),await G(),await D?.()===0&&N("apis"),M(r("mediaGallery.deleted"))},le=e=>{e?.uri&&Ke(e.uri,e.type==="image"?"Image":"Media")},We=()=>{const e=x.filter(l=>B.has(l.id));if(e.length===0)return;const i=e.map(l=>l.uri).join(`
|
|
2
|
+
`);et(i,`${e.length} Media URIs`),M(`${e.length} file URIs copied to clipboard`)},Pe=async e=>{try{const i=e.uri.startsWith("file://")||e.uri.startsWith("content://")||e.uri.startsWith("http")?e.uri:`file://${e.uri}`;await Te.share({url:i,title:e.filename,message:e.filename})}catch{M(r("mediaGallery.shareUnavailable","Sharing not available on this device"))}},$e=async()=>{const e=x.filter(i=>B.has(i.id));if(e.length!==0)try{const i=e[0],l=i.uri.startsWith("file://")||i.uri.startsWith("content://")||i.uri.startsWith("http")?i.uri:`file://${i.uri}`;await Te.share({url:l,title:i.filename,message:e.length===1?i.filename:`${e.length} items: ${e.map(T=>T.filename).join(", ")}`})}catch{M(r("mediaGallery.shareUnavailable","Sharing not available on this device"))}},Ae=()=>{const e=B.size;e!==0&&F({visible:!0,title:r("mediaGallery.deleteSelectedTitle","Delete Selected Media"),message:r("mediaGallery.deleteSelectedMessage",{count:e,defaultValue:`Are you sure you want to permanently delete ${e} media items?`}),confirmText:r("mediaGallery.delete","Delete"),cancelText:r("common.cancel","Cancel"),onConfirm:async()=>{F(T=>({...T,visible:!1}));const i=x.filter(T=>B.has(T.id));for(const T of i)await A.deleteMedia(T.uri);E(new Set),await G(),await D?.()===0&&N("apis"),M(r("mediaGallery.deletedCount",{count:i.length}))}})},Fe=()=>{F({visible:!0,title:r("mediaGallery.purgeTitle","Purge Gallery"),message:r("mediaGallery.purgeMessage",{count:x.length,size:H(_),defaultValue:`Are you sure you want to delete all ${x.length} media files (${H(_)})? This cannot be undone.`}),confirmText:r("common.clearAll","Clear All"),cancelText:r("common.cancel","Cancel"),onConfirm:async()=>{F(e=>({...e,visible:!1})),await A.clearAllMedia(),E(new Set),await G(),await D?.(),N("apis"),M(r("mediaGallery.allPurged"))}})},Oe=async e=>{await A.convertToGif(e.uri,{fps:12,width:480})&&(await G(),D?.().catch(()=>{}))},Le=(e,i)=>{const l=i?t.sky400:t.slate400,T=12;switch(e){case"all":return<Ye size={T}color={l}/>;case"image":return<U size={T}color={l}/>;case"video":return<L size={T}color={l}/>;case"gif":return<X size={T}color={l}/>}},Ue=({item:e})=>{if(!e)return null;const i=e.type==="video",l=e.type==="gif",T=i&&e.thumbnailUri||e.uri,W=!!(e.id&&B.has(e.id)),q=(e.format||(i?"mp4":l?"gif":"png")).toUpperCase(),J=e.filename||(e.uri?e.uri.split("/").pop():"")||"Capture",O=e.timestamp?new Date(e.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"";return<Se onPress={()=>j(e)}style={[o.card,W&&o.cardSelected]}>
|
|
3
3
|
<C style={o.thumbnailContainer}>
|
|
4
|
-
{
|
|
5
|
-
{i?<
|
|
4
|
+
{T?<Ce source={{uri:T}}style={o.thumbnail}resizeMode="cover"/>:<C style={o.thumbnailFallback}>
|
|
5
|
+
{i?<L size={26}color={t.sky400}/>:<U size={26}color={t.slate400}/>}
|
|
6
6
|
</C>}
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
<I onPress={()=>e.id&&ie(e.id)}style={[o.checkbox,
|
|
10
|
-
{
|
|
9
|
+
<I onPress={()=>e.id&&ie(e.id)}style={[o.checkbox,W&&o.checkboxSelected]}hitSlop={{top:8,bottom:8,left:8,right:8}}>
|
|
10
|
+
{W&&<Be size={12}color={t.white}/>}
|
|
11
11
|
</I>
|
|
12
12
|
|
|
13
13
|
{i&&<C style={o.miniPlayCircle}>
|
|
14
|
-
<
|
|
14
|
+
<Re size={14}color={t.white}/>
|
|
15
15
|
</C>}
|
|
16
16
|
<C style={o.typeBadge}>
|
|
17
|
-
{i?<
|
|
18
|
-
<
|
|
19
|
-
{
|
|
20
|
-
</
|
|
17
|
+
{i?<L size={11}color={t.sky400}/>:l?<X size={11}color={t.warningAmber}/>:<U size={11}color={t.emerald500}/>}
|
|
18
|
+
<S style={o.typeBadgeText}>
|
|
19
|
+
{q}
|
|
20
|
+
</S>
|
|
21
21
|
</C>
|
|
22
22
|
</C>
|
|
23
23
|
|
|
24
24
|
<C style={o.cardInfo}>
|
|
25
|
-
<
|
|
26
|
-
{
|
|
27
|
-
</
|
|
25
|
+
<S style={o.cardTitle}numberOfLines={1}>
|
|
26
|
+
{J}
|
|
27
|
+
</S>
|
|
28
28
|
<C style={o.cardMetaRow}>
|
|
29
29
|
<C style={{flexDirection:"row",alignItems:"center",gap:4,flex:1,minWidth:0}}>
|
|
30
|
-
<
|
|
30
|
+
<S style={o.cardMeta}numberOfLines={1}>
|
|
31
31
|
{H(e.sizeBytes||0)}
|
|
32
|
-
</
|
|
33
|
-
{
|
|
34
|
-
<
|
|
35
|
-
<
|
|
36
|
-
{
|
|
37
|
-
</
|
|
32
|
+
</S>
|
|
33
|
+
{O?<>
|
|
34
|
+
<S style={o.cardMetaDot}>•</S>
|
|
35
|
+
<S style={o.cardMeta}numberOfLines={1}>
|
|
36
|
+
{O}
|
|
37
|
+
</S>
|
|
38
38
|
</>:null}
|
|
39
39
|
</C>
|
|
40
40
|
<I onPress={()=>le(e)}style={o.gridCopyBtn}hitSlop={{top:6,bottom:6,left:6,right:6}}>
|
|
41
|
-
<
|
|
41
|
+
<Q size={11}color={t.slate400}/>
|
|
42
42
|
</I>
|
|
43
43
|
</C>
|
|
44
44
|
</C>
|
|
45
|
-
</Se>},
|
|
45
|
+
</Se>},He=({item:e})=>{if(!e)return null;const i=e.type==="video",l=e.type==="gif",T=i&&e.thumbnailUri||e.uri,W=!!(e.id&&B.has(e.id)),q=(e.format||(i?"mp4":l?"gif":"png")).toUpperCase(),J=e.filename||(e.uri?e.uri.split("/").pop():"")||"Capture",O=e.timestamp?`${new Date(e.timestamp).toLocaleDateString([],{month:"short",day:"numeric"})} ${new Date(e.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`:"";return<Se onPress={()=>j(e)}style={[o.listRow,W&&o.listRowSelected]}>
|
|
46
46
|
|
|
47
|
-
<I onPress={()=>e.id&&ie(e.id)}style={[o.listCheckbox,
|
|
48
|
-
{
|
|
47
|
+
<I onPress={()=>e.id&&ie(e.id)}style={[o.listCheckbox,W&&o.checkboxSelected]}hitSlop={{top:8,bottom:8,left:8,right:8}}>
|
|
48
|
+
{W&&<Be size={12}color={t.white}/>}
|
|
49
49
|
</I>
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
<C style={o.listThumbContainer}>
|
|
53
|
-
{
|
|
54
|
-
{i?<
|
|
53
|
+
{T?<Ce source={{uri:T}}style={o.listThumb}resizeMode="cover"/>:<C style={o.listThumbFallback}>
|
|
54
|
+
{i?<L size={18}color={t.sky400}/>:<U size={18}color={t.slate400}/>}
|
|
55
55
|
</C>}
|
|
56
56
|
{i&&<C style={o.listMiniPlay}>
|
|
57
|
-
<
|
|
57
|
+
<Re size={10}color={t.white}/>
|
|
58
58
|
</C>}
|
|
59
59
|
</C>
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
<C style={o.listInfo}>
|
|
63
|
-
<
|
|
64
|
-
{
|
|
65
|
-
</
|
|
63
|
+
<S style={o.listTitle}numberOfLines={1}>
|
|
64
|
+
{J}
|
|
65
|
+
</S>
|
|
66
66
|
<C style={o.listMetaRow}>
|
|
67
67
|
<C style={o.listBadge}>
|
|
68
|
-
{i?<
|
|
69
|
-
<
|
|
70
|
-
{
|
|
71
|
-
</
|
|
68
|
+
{i?<L size={10}color={t.sky400}/>:l?<X size={10}color={t.warningAmber}/>:<U size={10}color={t.emerald500}/>}
|
|
69
|
+
<S style={o.listBadgeText}>
|
|
70
|
+
{q}
|
|
71
|
+
</S>
|
|
72
72
|
</C>
|
|
73
|
-
<
|
|
73
|
+
<S style={o.cardMeta}>
|
|
74
74
|
{H(e.sizeBytes||0)}
|
|
75
|
-
</
|
|
76
|
-
{
|
|
77
|
-
<
|
|
78
|
-
<
|
|
79
|
-
{
|
|
80
|
-
</
|
|
75
|
+
</S>
|
|
76
|
+
{O?<>
|
|
77
|
+
<S style={o.cardMetaDot}>•</S>
|
|
78
|
+
<S style={o.cardMeta}>
|
|
79
|
+
{O}
|
|
80
|
+
</S>
|
|
81
81
|
</>:null}
|
|
82
82
|
</C>
|
|
83
83
|
</C>
|
|
@@ -85,86 +85,104 @@ import{useState as V,useEffect as He,useMemo as ae,useCallback as ne}from"react"
|
|
|
85
85
|
|
|
86
86
|
<C style={o.listActionsRow}>
|
|
87
87
|
<I onPress={()=>le(e)}style={o.listCopyBtn}hitSlop={{top:8,bottom:8,left:8,right:8}}>
|
|
88
|
-
<
|
|
88
|
+
<Q size={13}color={t.slate200}/>
|
|
89
89
|
</I>
|
|
90
90
|
|
|
91
|
-
<I onPress={()=>
|
|
92
|
-
<
|
|
91
|
+
<I onPress={()=>Pe(e)}style={o.listShareBtn}hitSlop={{top:8,bottom:8,left:8,right:8}}>
|
|
92
|
+
<Ge size={13}color={t.sky400}/>
|
|
93
93
|
</I>
|
|
94
94
|
|
|
95
95
|
<I onPress={()=>re(e)}style={o.listDeleteBtn}hitSlop={{top:8,bottom:8,left:8,right:8}}>
|
|
96
|
-
<
|
|
96
|
+
<Y size={13}color={t.red500}/>
|
|
97
97
|
</I>
|
|
98
98
|
</C>
|
|
99
99
|
</Se>};return<C style={o.container}>
|
|
100
100
|
|
|
101
101
|
<C style={o.filterBar}>
|
|
102
102
|
<C style={o.chipGroup}>
|
|
103
|
-
{["all","image","video","gif"].map(e=>{const i=
|
|
104
|
-
{
|
|
105
|
-
<
|
|
103
|
+
{["all","image","video","gif"].map(e=>{const i=v===e,l=e==="all"?r("mediaGallery.all",{count:x.length}):r(e==="image"?"mediaGallery.photos":e==="video"?"mediaGallery.videos":"mediaGallery.gifs");return<I key={e}onPress={()=>Me(e)}style={[o.chip,i&&o.chipActive]}>
|
|
104
|
+
{Le(e,i)}
|
|
105
|
+
<S style={[o.chipText,i&&o.chipTextActive]}>
|
|
106
106
|
{l}
|
|
107
|
-
</
|
|
107
|
+
</S>
|
|
108
108
|
</I>})}
|
|
109
109
|
</C>
|
|
110
110
|
|
|
111
111
|
|
|
112
|
-
<C style={o.
|
|
113
|
-
<I onPress={
|
|
114
|
-
<
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
<C style={o.rightControls}>
|
|
113
|
+
<I onPress={oe}style={o.importBtn}accessibilityLabel="Open Camera Roll"hitSlop={{top:6,bottom:6,left:6,right:6}}>
|
|
114
|
+
<Ie size={12}color={t.sky400}/>
|
|
115
|
+
<S style={o.importBtnText}>
|
|
116
|
+
{v==="image"?"Photos":v==="video"?"Videos":"Import"}
|
|
117
|
+
</S>
|
|
118
118
|
</I>
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
<C style={o.viewToggleContainer}>
|
|
122
|
+
<I onPress={()=>te("grid")}style={[o.viewToggleBtn,R==="grid"&&o.viewToggleBtnActive]}>
|
|
123
|
+
<Qe size={13}color={R==="grid"?t.white:t.slate400}/>
|
|
124
|
+
</I>
|
|
125
|
+
<I onPress={()=>te("list")}style={[o.viewToggleBtn,R==="list"&&o.viewToggleBtnActive]}>
|
|
126
|
+
<Xe size={13}color={R==="list"?t.white:t.slate400}/>
|
|
127
|
+
</I>
|
|
128
|
+
</C>
|
|
119
129
|
</C>
|
|
120
130
|
</C>
|
|
121
131
|
|
|
122
132
|
|
|
123
|
-
{
|
|
133
|
+
{x.length>0&&<C style={o.subBar}>
|
|
124
134
|
<C style={o.resultCountWrapper}>
|
|
125
|
-
<
|
|
126
|
-
{
|
|
127
|
-
</
|
|
135
|
+
<S style={[o.resultCountText,B.size>0&&o.resultCountTextSelected]}>
|
|
136
|
+
{B.size>0?r("mediaGallery.selectedOfResults",{selected:B.size,total:V.length,defaultValue:`Selected ${B.size} of ${V.length} results`}):V.length!==x.length?r("mediaGallery.showingFilteredResults",{count:V.length,total:x.length,defaultValue:`Showing ${V.length} of ${x.length} results`}):r("mediaGallery.showingResults",{count:V.length,defaultValue:`Showing ${V.length} results`})}
|
|
137
|
+
</S>
|
|
128
138
|
</C>
|
|
129
139
|
|
|
130
140
|
<C style={o.actionsGroup}>
|
|
131
|
-
{
|
|
132
|
-
<I onPress={
|
|
133
|
-
<
|
|
134
|
-
<
|
|
141
|
+
{B.size>0&&<>
|
|
142
|
+
<I onPress={We}style={o.copySelectedBtn}hitSlop={{top:8,bottom:8,left:8,right:8}}>
|
|
143
|
+
<Q size={12}color={t.slate200}/>
|
|
144
|
+
<S style={o.copySelectedBtnText}>
|
|
135
145
|
{r("mediaGallery.copyUri","Copy URI")}
|
|
136
|
-
</
|
|
146
|
+
</S>
|
|
137
147
|
</I>
|
|
138
148
|
|
|
139
|
-
<I onPress={
|
|
140
|
-
<
|
|
141
|
-
<
|
|
149
|
+
<I onPress={$e}style={o.shareSelectedBtn}hitSlop={{top:8,bottom:8,left:8,right:8}}>
|
|
150
|
+
<Ge size={12}color={t.sky400}/>
|
|
151
|
+
<S style={o.shareSelectedBtnText}>
|
|
142
152
|
{r("mediaGallery.share","Share")}
|
|
143
|
-
</
|
|
153
|
+
</S>
|
|
144
154
|
</I>
|
|
145
155
|
|
|
146
|
-
<I onPress={
|
|
147
|
-
<
|
|
148
|
-
<
|
|
149
|
-
{r("mediaGallery.deleteSelected",{count:
|
|
150
|
-
</
|
|
156
|
+
<I onPress={Ae}style={o.deleteBtn}hitSlop={{top:8,bottom:8,left:8,right:8}}>
|
|
157
|
+
<Y size={13}color={t.red500}/>
|
|
158
|
+
<S style={o.deleteBtnText}>
|
|
159
|
+
{r("mediaGallery.deleteSelected",{count:B.size})}
|
|
160
|
+
</S>
|
|
151
161
|
</I>
|
|
152
162
|
</>}
|
|
153
163
|
|
|
154
164
|
<I onPress={Fe}style={o.clearBtn}hitSlop={{top:8,bottom:8,left:8,right:8}}>
|
|
155
|
-
<
|
|
156
|
-
<
|
|
157
|
-
{r("mediaGallery.purge",{size:H(
|
|
158
|
-
</
|
|
165
|
+
<Y size={13}color={t.red500}/>
|
|
166
|
+
<S style={o.clearBtnText}>
|
|
167
|
+
{r("mediaGallery.purge",{size:H(_)})}
|
|
168
|
+
</S>
|
|
159
169
|
</I>
|
|
160
170
|
</C>
|
|
161
171
|
</C>}
|
|
162
172
|
|
|
163
173
|
|
|
164
|
-
<
|
|
174
|
+
<Ne key={R}data={V}keyExtractor={e=>e.id}renderItem={R==="grid"?Ue:He}numColumns={R==="grid"?2:1}columnWrapperStyle={R==="grid"?o.columnWrapper:void 0}style={{flex:1}}contentContainerStyle={[o.listContent,{flexGrow:1}]}nestedScrollEnabled={!0}keyboardShouldPersistTaps="handled"refreshControl={<_e refreshing={Ve}onRefresh={De}tintColor={t.sky400}/>}ListEmptyComponent={<C style={o.emptyContainer}>
|
|
175
|
+
<Je customTitle={v==="image"?"No Photos Found":v==="video"?"No Videos Found":r("mediaGallery.noMediaTitle")}customSub={v==="image"?"Take a screenshot or import photos from Camera Roll.":v==="video"?"Record a video or import videos from Camera Roll.":r("mediaGallery.noMediaDesc")}showReload={!1}/>
|
|
176
|
+
<I onPress={oe}style={o.emptyImportBtn}activeOpacity={.8}>
|
|
177
|
+
<Ie size={14}color={t.white}/>
|
|
178
|
+
<S style={o.emptyImportBtnText}>
|
|
179
|
+
{v==="image"?r("mediaGallery.importPhotos","Import Photos from Camera Roll"):v==="video"?r("mediaGallery.importVideos","Import Videos from Camera Roll"):r("mediaGallery.openCameraRoll","Open Camera Roll")}
|
|
180
|
+
</S>
|
|
181
|
+
</I>
|
|
182
|
+
</C>}/>
|
|
165
183
|
|
|
166
184
|
|
|
167
|
-
<Ze item={
|
|
185
|
+
<Ze item={Z}visible={!!Z}onClose={()=>j(null)}onDelete={re}onConvertToGif={Oe}/>
|
|
168
186
|
|
|
169
|
-
<Ct visible={
|
|
170
|
-
</C>};const{width:Tt}=
|
|
187
|
+
<Ct visible={P.visible}title={P.title}message={P.message}confirmText={P.confirmText}cancelText={P.cancelText}isDestructive={!0}icon="trash"onConfirm={P.onConfirm}onCancel={()=>F(e=>({...e,visible:!1}))}/>
|
|
188
|
+
</C>};const{width:Tt}=Ee.get("window"),St=(Tt-36)/2,o=qe.create({container:{flex:1,backgroundColor:t.slate850},filterBar:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:9,borderBottomWidth:1,borderBottomColor:t.borderGlassLight,gap:8},chipGroup:{flexDirection:"row",alignItems:"center",gap:6,flexShrink:1},chip:{flexDirection:"row",alignItems:"center",gap:4.5,paddingHorizontal:8,paddingVertical:4.5,borderRadius:6,backgroundColor:t.whiteAlpha06,borderWidth:1,borderColor:t.whiteAlpha10},chipActive:{backgroundColor:`${t.sky400}2E`,borderColor:t.sky400},chipText:{fontFamily:z.interMedium,fontSize:11,color:t.slate400},chipTextActive:{fontFamily:z.interBold,color:t.sky400},subBar:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:7,backgroundColor:`${t.slate900}99`,borderBottomWidth:1,borderBottomColor:t.borderGlassLight,gap:8},resultCountWrapper:{flexDirection:"row",alignItems:"center",flexShrink:1},resultCountText:{fontFamily:z.interMedium,fontSize:11,color:t.slate400},resultCountTextSelected:{fontFamily:z.interSemiBold,color:t.sky400},actionsGroup:{flexDirection:"row",alignItems:"center",gap:6},rightControls:{flexDirection:"row",alignItems:"center",gap:6},importBtn:{flexDirection:"row",alignItems:"center",gap:5,backgroundColor:`${t.sky500}1F`,borderColor:`${t.sky400}44`,borderWidth:1,paddingHorizontal:8,paddingVertical:4.5,borderRadius:6},importBtnText:{fontFamily:z.interSemiBold,fontSize:11,color:t.sky400},emptyContainer:{alignItems:"center",justifyContent:"center",paddingVertical:36},emptyImportBtn:{flexDirection:"row",alignItems:"center",gap:7,backgroundColor:t.sky500,paddingHorizontal:16,paddingVertical:10,borderRadius:8,marginTop:18,shadowColor:t.sky500,shadowOffset:{width:0,height:2},shadowOpacity:.35,shadowRadius:6,elevation:3},emptyImportBtnText:{fontFamily:z.interSemiBold,fontSize:13,color:t.white},viewToggleContainer:{flexDirection:"row",alignItems:"center",backgroundColor:t.whiteAlpha06,borderRadius:6,padding:2,borderWidth:1,borderColor:t.whiteAlpha10},viewToggleBtn:{paddingHorizontal:7,paddingVertical:4,borderRadius:4,alignItems:"center",justifyContent:"center"},viewToggleBtnActive:{backgroundColor:`${t.violet600}80`},deleteBtn:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:4,borderRadius:6,backgroundColor:`${t.red500}26`,borderWidth:1,borderColor:`${t.red500}80`},deleteBtnText:{fontFamily:z.interBold,fontSize:10.5,color:t.red500},clearBtn:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:4,borderRadius:6,backgroundColor:`${t.red500}1F`,borderWidth:1,borderColor:`${t.red500}4D`},clearBtnText:{fontFamily:z.interMedium,fontSize:10.5,color:t.red500},listContent:{padding:12,gap:10},columnWrapper:{gap:12},card:{width:St,backgroundColor:t.slate800,borderRadius:8,borderWidth:1,borderColor:t.borderGlassLight,overflow:"hidden"},cardSelected:{borderColor:t.violet600,borderWidth:1.5},thumbnailContainer:{width:"100%",height:110,backgroundColor:t.slate850,position:"relative"},thumbnail:{width:"100%",height:"100%"},thumbnailFallback:{width:"100%",height:"100%",alignItems:"center",justifyContent:"center",backgroundColor:t.slate900},checkbox:{position:"absolute",top:6,left:6,width:22,height:22,borderRadius:5,borderWidth:1.5,borderColor:"rgba(255, 255, 255, 0.65)",backgroundColor:"rgba(15, 23, 42, 0.65)",alignItems:"center",justifyContent:"center",zIndex:10},checkboxSelected:{backgroundColor:t.violet600,borderColor:t.violet600},miniPlayCircle:{position:"absolute",top:"50%",left:"50%",width:32,height:32,marginTop:-16,marginLeft:-16,borderRadius:16,backgroundColor:`${t.sky400}D9`,alignItems:"center",justifyContent:"center",paddingLeft:2,shadowColor:t.black,shadowOffset:{width:0,height:2},shadowOpacity:.4,shadowRadius:4,elevation:4},typeBadge:{position:"absolute",top:6,right:6,flexDirection:"row",alignItems:"center",gap:3,backgroundColor:t.badgeGlassDark,paddingHorizontal:5,paddingVertical:2,borderRadius:4,borderWidth:1,borderColor:t.borderGlassMedium},typeBadgeText:{fontFamily:z.interBold,fontSize:9,color:t.slate200},cardInfo:{padding:8,gap:3},cardTitle:{fontFamily:z.interMedium,fontSize:11.5,color:t.white},cardMetaRow:{flexDirection:"row",alignItems:"center",gap:4},cardMeta:{fontFamily:z.interRegular,fontSize:10,color:t.slate400},cardMetaDot:{fontSize:10,color:t.whiteAlpha30},listRow:{flexDirection:"row",alignItems:"center",backgroundColor:t.slate800,borderRadius:8,borderWidth:1,borderColor:t.borderGlassLight,padding:8,gap:10},listRowSelected:{borderColor:t.violet600,borderWidth:1.5,backgroundColor:`${t.violet600}14`},listCheckbox:{width:20,height:20,borderRadius:4,borderWidth:1.5,borderColor:"rgba(255, 255, 255, 0.65)",backgroundColor:"rgba(15, 23, 42, 0.65)",alignItems:"center",justifyContent:"center"},listThumbContainer:{width:46,height:46,borderRadius:6,backgroundColor:t.slate850,overflow:"hidden",position:"relative"},listThumb:{width:"100%",height:"100%"},listThumbFallback:{width:"100%",height:"100%",alignItems:"center",justifyContent:"center",backgroundColor:t.slate900},listMiniPlay:{position:"absolute",top:"50%",left:"50%",width:20,height:20,marginTop:-10,marginLeft:-10,borderRadius:10,backgroundColor:`${t.sky400}D9`,alignItems:"center",justifyContent:"center",paddingLeft:1},listInfo:{flex:1,gap:4,minWidth:0},listTitle:{fontFamily:z.interMedium,fontSize:12,color:t.white},listMetaRow:{flexDirection:"row",alignItems:"center",gap:6,flexWrap:"wrap"},listBadge:{flexDirection:"row",alignItems:"center",gap:3,backgroundColor:t.badgeGlassDark,paddingHorizontal:4,paddingVertical:1.5,borderRadius:4,borderWidth:1,borderColor:t.borderGlassMedium},listBadgeText:{fontFamily:z.interBold,fontSize:8.5,color:t.slate200},gridCopyBtn:{padding:3,borderRadius:4,backgroundColor:t.whiteAlpha08},listActionsRow:{flexDirection:"row",alignItems:"center",gap:6},listCopyBtn:{padding:6,borderRadius:6,backgroundColor:t.whiteAlpha10,borderWidth:1,borderColor:t.whiteAlpha15},listShareBtn:{padding:6,borderRadius:6,backgroundColor:`${t.sky400}18`,borderWidth:1,borderColor:`${t.sky400}40`},listDeleteBtn:{padding:6,borderRadius:6,backgroundColor:`${t.red500}14`,borderWidth:1,borderColor:`${t.red500}33`},copySelectedBtn:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:4,borderRadius:6,backgroundColor:t.whiteAlpha10,borderWidth:1,borderColor:t.whiteAlpha20},copySelectedBtnText:{fontFamily:z.interSemiBold,fontSize:10.5,color:t.slate200},shareSelectedBtn:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:4,borderRadius:6,backgroundColor:`${t.sky400}20`,borderWidth:1,borderColor:`${t.sky400}60`},shareSelectedBtnText:{fontFamily:z.interBold,fontSize:10.5,color:t.sky400}});
|
|
@@ -1,25 +1,34 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CapturedMediaItem } from '../../capture';
|
|
3
|
-
export type EditorTool = 'none' | 'crop' | '
|
|
4
|
-
export type
|
|
3
|
+
export type EditorTool = 'none' | 'crop' | 'adjust' | 'draw' | 'text' | 'resize' | 'preview' | 'trim' | 'audio' | 'speed' | 'gif' | 'snapshot';
|
|
4
|
+
export type DrawModeOption = 'brush' | 'highlighter' | 'arrow' | 'rect' | 'circle' | 'spotlight' | 'step' | 'redact' | 'pixelate';
|
|
5
|
+
export type AdjustModeOption = 'brightness' | 'contrast' | 'saturation' | 'warmth' | 'exposure' | 'vignette';
|
|
6
|
+
export type PhotoFilterPreset = 'none' | 'vibrant' | 'mono' | 'sepia' | 'vintage' | 'noir' | 'cool' | 'warm' | 'fade';
|
|
7
|
+
export interface ImageAdjustments {
|
|
8
|
+
brightness: number;
|
|
9
|
+
contrast: number;
|
|
10
|
+
saturation: number;
|
|
11
|
+
warmth: number;
|
|
12
|
+
exposure: number;
|
|
13
|
+
vignette: number;
|
|
14
|
+
}
|
|
5
15
|
export type AspectRatioOption = 'free' | '1:1' | '4:3' | '16:9' | '9:16' | '3:2';
|
|
6
16
|
export interface InkStroke {
|
|
7
17
|
id: string;
|
|
18
|
+
type: DrawModeOption;
|
|
8
19
|
points: Array<{
|
|
9
20
|
x: number;
|
|
10
21
|
y: number;
|
|
11
22
|
}>;
|
|
12
23
|
color: string;
|
|
13
24
|
strokeWidth: number;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
height: number;
|
|
22
|
-
color: string;
|
|
25
|
+
rect?: {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
};
|
|
31
|
+
stepNumber?: number;
|
|
23
32
|
}
|
|
24
33
|
export interface TextItem {
|
|
25
34
|
id: string;
|
|
@@ -29,13 +38,6 @@ export interface TextItem {
|
|
|
29
38
|
color: string;
|
|
30
39
|
bgColor: string;
|
|
31
40
|
}
|
|
32
|
-
export interface BlurBox {
|
|
33
|
-
id: string;
|
|
34
|
-
x: number;
|
|
35
|
-
y: number;
|
|
36
|
-
width: number;
|
|
37
|
-
height: number;
|
|
38
|
-
}
|
|
39
41
|
interface MediaPreviewModalProps {
|
|
40
42
|
item: CapturedMediaItem | null;
|
|
41
43
|
visible: boolean;
|