feat: native context menus, sharing, functional menus
This commit is contained in:
1 parent
98977a8d91
commit
827e71f833
18 files changed
+863
-422
No files matched your search
@@ -10,7 +10,9 @@
|
||||
"supportsTablet": true,
|
||||
"bundleIdentifier": "com.abunchofknowitalls.otunes",
|
||||
"infoPlist": {
|
||||
"UIBackgroundModes": ["audio"]
|
||||
"UIBackgroundModes": [
|
||||
"audio"
|
||||
]
|
||||
}
|
||||
},
|
||||
"android": {
|
||||
@@ -26,7 +28,8 @@
|
||||
"microphonePermission": false,
|
||||
"enableBackgroundPlayback": true
|
||||
}
|
||||
]
|
||||
],
|
||||
"expo-sharing"
|
||||
],
|
||||
"experiments": {
|
||||
"typedRoutes": true
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
import { useQuery } from "convex/react"
|
||||
import { Stack, useLocalSearchParams } from "expo-router"
|
||||
import { useState } from "react"
|
||||
import { Pressable, ScrollView, StyleSheet, Text, View } from "react-native"
|
||||
import { Ionicons } from "@expo/vector-icons"
|
||||
|
||||
import { CoverImage } from "@/components/cover-image"
|
||||
|
||||
import { MediaActionsSheet, type MediaAction } from "@/components/media-actions-sheet"
|
||||
import {
|
||||
MediaActionMenu,
|
||||
MediaContextMenu,
|
||||
} from "@/components/media-actions-sheet"
|
||||
import { Button, LoadingView } from "@/components/ui/primitives"
|
||||
import { contentBottomInset } from "@/components/player"
|
||||
import { useAddToPlaylist } from "@/contexts/add-to-playlist"
|
||||
import { useFavorites } from "@/contexts/favorites"
|
||||
import { usePlayback } from "@/contexts/playback"
|
||||
import { useServerConfig } from "@/contexts/server-config"
|
||||
import { useMediaMenuActions } from "@/hooks/use-media-menu-actions"
|
||||
import { api } from "@otunes/convex/_generated/api"
|
||||
import type { Id } from "@otunes/convex/_generated/dataModel"
|
||||
import type { BrowseAlbumTrack } from "@otunes/convex/types"
|
||||
@@ -31,9 +33,9 @@ export default function AlbumScreen() {
|
||||
typeof id === "string" ? { id: id as Id<"albums"> } : "skip"
|
||||
)
|
||||
const { playAlbum, playAlbumShuffled, playFromSong } = usePlayback()
|
||||
const { isAlbumFavorite, toggleAlbumFavorite } = useFavorites()
|
||||
const { openAddAlbumToPlaylist } = useAddToPlaylist()
|
||||
const [actionsOpen, setActionsOpen] = useState(false)
|
||||
const { isAlbumFavorite, toggleAlbumFavorite, isSongFavorite } = useFavorites()
|
||||
const { handleAlbumDetailAction, handleAlbumTrackAction, isAlbumFavorite: isAlbumFav } =
|
||||
useMediaMenuActions()
|
||||
|
||||
if (album === undefined || !config) {
|
||||
return <LoadingView />
|
||||
@@ -47,23 +49,9 @@ export default function AlbumScreen() {
|
||||
)
|
||||
}
|
||||
|
||||
const songIds = album.tracks.map((track: BrowseAlbumTrack) => track.id)
|
||||
const songIds = album.tracks.map((track: BrowseAlbumTrack) => track.id as Id<"songs">)
|
||||
const metadata = formatMetadata(album.genre, album.year)
|
||||
|
||||
function handleAlbumAction(action: MediaAction) {
|
||||
if (!album) return
|
||||
switch (action) {
|
||||
case "playlist":
|
||||
void openAddAlbumToPlaylist(album.id)
|
||||
break
|
||||
case "favorite":
|
||||
void toggleAlbumFavorite(album.id)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack.Screen
|
||||
@@ -71,9 +59,18 @@ export default function AlbumScreen() {
|
||||
title: "",
|
||||
headerLargeTitle: false,
|
||||
headerRight: () => (
|
||||
<Pressable onPress={() => setActionsOpen(true)} hitSlop={8}>
|
||||
<Ionicons name="ellipsis-horizontal" size={22} color={colors.foreground} />
|
||||
</Pressable>
|
||||
<MediaActionMenu
|
||||
selectedCount={album.tracks.length}
|
||||
favorited={isAlbumFav(album.id)}
|
||||
share={{ type: "album", albumId: album.id }}
|
||||
onAction={(action) =>
|
||||
void handleAlbumDetailAction(album.id as Id<"albums">, songIds, action)
|
||||
}
|
||||
>
|
||||
<Pressable hitSlop={8}>
|
||||
<Ionicons name="ellipsis-horizontal" size={22} color={colors.foreground} />
|
||||
</Pressable>
|
||||
</MediaActionMenu>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
@@ -109,39 +106,44 @@ export default function AlbumScreen() {
|
||||
</View>
|
||||
|
||||
{album.tracks.map((track: BrowseAlbumTrack, index: number) => (
|
||||
<Pressable
|
||||
<MediaContextMenu
|
||||
key={track.id}
|
||||
style={[styles.trackRow, { borderBottomColor: colors.border }]}
|
||||
onPress={() => void playFromSong(track.id, songIds)}
|
||||
favorited={isSongFavorite(track.id)}
|
||||
navigation={{
|
||||
artist: { id: album.artist.id },
|
||||
album: { id: album.id },
|
||||
}}
|
||||
share={{
|
||||
type: "song",
|
||||
albumId: album.id,
|
||||
songId: track.id,
|
||||
}}
|
||||
onAction={(action) => void handleAlbumTrackAction(track, album, action)}
|
||||
>
|
||||
<Text style={[styles.trackNumber, { color: colors.mutedForeground }]}>
|
||||
{track.track || index + 1}
|
||||
</Text>
|
||||
<View style={styles.trackMeta}>
|
||||
<Text style={[styles.trackTitle, { color: colors.foreground }]} numberOfLines={1}>
|
||||
{track.title}
|
||||
<Pressable
|
||||
style={[styles.trackRow, { borderBottomColor: colors.border }]}
|
||||
onPress={() => void playFromSong(track.id, songIds)}
|
||||
>
|
||||
<Text style={[styles.trackNumber, { color: colors.mutedForeground }]}>
|
||||
{track.track || index + 1}
|
||||
</Text>
|
||||
{track.artists ? (
|
||||
<Text style={{ color: colors.mutedForeground }} numberOfLines={1}>
|
||||
{track.artists.join(", ")}
|
||||
<View style={styles.trackMeta}>
|
||||
<Text style={[styles.trackTitle, { color: colors.foreground }]} numberOfLines={1}>
|
||||
{track.title}
|
||||
</Text>
|
||||
) : null}
|
||||
</View>
|
||||
<Text style={{ color: colors.mutedForeground }}>
|
||||
{formatDuration(track.durationSeconds)}
|
||||
</Text>
|
||||
</Pressable>
|
||||
{track.artists ? (
|
||||
<Text style={{ color: colors.mutedForeground }} numberOfLines={1}>
|
||||
{track.artists.join(", ")}
|
||||
</Text>
|
||||
) : null}
|
||||
</View>
|
||||
<Text style={{ color: colors.mutedForeground }}>
|
||||
{formatDuration(track.durationSeconds)}
|
||||
</Text>
|
||||
</Pressable>
|
||||
</MediaContextMenu>
|
||||
))}
|
||||
</ScrollView>
|
||||
|
||||
<MediaActionsSheet
|
||||
visible={actionsOpen}
|
||||
title={album.title}
|
||||
favorited={isAlbumFavorite(album.id)}
|
||||
showNavigation={false}
|
||||
onClose={() => setActionsOpen(false)}
|
||||
onAction={handleAlbumAction}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
import { useQuery } from "convex/react"
|
||||
import { Stack, useLocalSearchParams } from "expo-router"
|
||||
import { useState } from "react"
|
||||
import { Pressable, ScrollView, StyleSheet, Text, View } from "react-native"
|
||||
import { Ionicons } from "@expo/vector-icons"
|
||||
|
||||
import { CoverImage } from "@/components/cover-image"
|
||||
|
||||
import { MediaGrid } from "@/components/media-cards"
|
||||
import { MediaActionsSheet, type MediaAction } from "@/components/media-actions-sheet"
|
||||
import { MediaActionMenu } from "@/components/media-actions-sheet"
|
||||
import { Button, LoadingView } from "@/components/ui/primitives"
|
||||
import { contentBottomInset } from "@/components/player"
|
||||
import { useAddToPlaylist } from "@/contexts/add-to-playlist"
|
||||
import { useFavorites } from "@/contexts/favorites"
|
||||
import { usePlayback } from "@/contexts/playback"
|
||||
import { useServerConfig } from "@/contexts/server-config"
|
||||
import { useMediaMenuActions } from "@/hooks/use-media-menu-actions"
|
||||
import { api } from "@otunes/convex/_generated/api"
|
||||
import type { Id } from "@otunes/convex/_generated/dataModel"
|
||||
import { artistCoverUrl } from "@/lib/urls"
|
||||
@@ -26,8 +25,7 @@ export default function ArtistScreen() {
|
||||
const data = useQuery(api.library.browseArtistDetail, { id: id as Id<"artists"> })
|
||||
const { playArtist, playArtistShuffled } = usePlayback()
|
||||
const { isArtistFavorite, toggleArtistFavorite } = useFavorites()
|
||||
const { openAddArtistToPlaylist } = useAddToPlaylist()
|
||||
const [actionsOpen, setActionsOpen] = useState(false)
|
||||
const { handleArtistAction, isArtistFavorite: isArtistFav } = useMediaMenuActions()
|
||||
|
||||
if (data === undefined || !config) {
|
||||
return <LoadingView />
|
||||
@@ -41,20 +39,6 @@ export default function ArtistScreen() {
|
||||
)
|
||||
}
|
||||
|
||||
function handleAction(action: MediaAction) {
|
||||
if (!data) return
|
||||
switch (action) {
|
||||
case "playlist":
|
||||
void openAddArtistToPlaylist(data.artist.id)
|
||||
break
|
||||
case "favorite":
|
||||
void toggleArtistFavorite(data.artist.id)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack.Screen
|
||||
@@ -62,9 +46,16 @@ export default function ArtistScreen() {
|
||||
title: "",
|
||||
headerLargeTitle: false,
|
||||
headerRight: () => (
|
||||
<Pressable onPress={() => setActionsOpen(true)} hitSlop={8}>
|
||||
<Ionicons name="ellipsis-horizontal" size={22} color={colors.foreground} />
|
||||
</Pressable>
|
||||
<MediaActionMenu
|
||||
selectedCount={data.albums.length}
|
||||
favorited={isArtistFav(data.artist.id)}
|
||||
share={{ type: "artist", artistId: data.artist.id }}
|
||||
onAction={(action) => void handleArtistAction(data.artist, action)}
|
||||
>
|
||||
<Pressable hitSlop={8}>
|
||||
<Ionicons name="ellipsis-horizontal" size={22} color={colors.foreground} />
|
||||
</Pressable>
|
||||
</MediaActionMenu>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
@@ -97,14 +88,6 @@ export default function ArtistScreen() {
|
||||
<MediaGrid content={data.albums} />
|
||||
</View>
|
||||
</ScrollView>
|
||||
|
||||
<MediaActionsSheet
|
||||
visible={actionsOpen}
|
||||
title={data.artist.name}
|
||||
favorited={isArtistFavorite(data.artist.id)}
|
||||
onClose={() => setActionsOpen(false)}
|
||||
onAction={handleAction}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import { useQuery } from "convex/react"
|
||||
import { Pressable, ScrollView, StyleSheet, Text } from "react-native"
|
||||
|
||||
import { MediaContextMenu } from "@/components/media-context-menu"
|
||||
import { CoverImage } from "@/components/cover-image"
|
||||
|
||||
import { LoadingView } from "@/components/ui/primitives"
|
||||
import { contentBottomInset } from "@/components/player"
|
||||
import { useServerConfig } from "@/contexts/server-config"
|
||||
import { useAppNavigation } from "@/lib/app-navigation"
|
||||
import { useMediaMenuActions } from "@/hooks/use-media-menu-actions"
|
||||
import { api } from "@otunes/convex/_generated/api"
|
||||
import type { BrowseArtist } from "@otunes/convex/types"
|
||||
import { artistCoverUrl } from "@/lib/urls"
|
||||
@@ -17,6 +18,7 @@ export default function ArtistsScreen() {
|
||||
const colors = useThemeColors()
|
||||
const { config } = useServerConfig()
|
||||
const artists = useQuery(api.library.browseArtists)
|
||||
const { handleArtistAction, isArtistFavorite } = useMediaMenuActions()
|
||||
|
||||
if (artists === undefined || !config) {
|
||||
return <LoadingView />
|
||||
@@ -29,18 +31,24 @@ export default function ArtistsScreen() {
|
||||
contentInsetAdjustmentBehavior="automatic"
|
||||
>
|
||||
{artists.map((artist: BrowseArtist) => (
|
||||
<Pressable
|
||||
<MediaContextMenu
|
||||
key={artist.id}
|
||||
style={[styles.row, { borderBottomColor: colors.border }]}
|
||||
onPress={() => push(`/artist/${artist.id}`)}
|
||||
favorited={isArtistFavorite(artist.id)}
|
||||
share={{ type: "artist", artistId: artist.id }}
|
||||
onAction={(action) => void handleArtistAction(artist, action)}
|
||||
>
|
||||
<CoverImage
|
||||
uri={artistCoverUrl(config.serverUrl, artist.id)}
|
||||
hasCover={artist.photo != null}
|
||||
style={styles.avatar}
|
||||
/>
|
||||
<Text style={[styles.name, { color: colors.foreground }]}>{artist.name}</Text>
|
||||
</Pressable>
|
||||
<Pressable
|
||||
style={[styles.row, { borderBottomColor: colors.border }]}
|
||||
onPress={() => push(`/artist/${artist.id}`)}
|
||||
>
|
||||
<CoverImage
|
||||
uri={artistCoverUrl(config.serverUrl, artist.id)}
|
||||
hasCover={artist.photo != null}
|
||||
style={styles.avatar}
|
||||
/>
|
||||
<Text style={[styles.name, { color: colors.foreground }]}>{artist.name}</Text>
|
||||
</Pressable>
|
||||
</MediaContextMenu>
|
||||
))}
|
||||
</ScrollView>
|
||||
)
|
||||
|
||||
@@ -1,33 +1,24 @@
|
||||
import { usePaginatedQuery } from "convex/react"
|
||||
import { useState } from "react"
|
||||
import { FlatList, Pressable, StyleSheet, Text, View } from "react-native"
|
||||
import { FlatList, StyleSheet } from "react-native"
|
||||
|
||||
import {
|
||||
MediaActionsSheet,
|
||||
type MediaAction,
|
||||
} from "@/components/media-actions-sheet"
|
||||
import { contentBottomInset, SongRow } from "@/components/player"
|
||||
import { LoadingView } from "@/components/ui/primitives"
|
||||
import { useAddToPlaylist } from "@/contexts/add-to-playlist"
|
||||
import { useFavorites } from "@/contexts/favorites"
|
||||
import { usePlayback } from "@/contexts/playback"
|
||||
import { useMediaMenuActions } from "@/hooks/use-media-menu-actions"
|
||||
import { api } from "@otunes/convex/_generated/api"
|
||||
import type { Id } from "@otunes/convex/_generated/dataModel"
|
||||
import type { BrowseSong } from "@otunes/convex/types"
|
||||
import { showSuccess } from "@/lib/toast"
|
||||
import { spacing, useThemeColors } from "@/lib/theme"
|
||||
import { spacing } from "@/lib/theme"
|
||||
|
||||
const PAGE_SIZE = 50
|
||||
|
||||
export default function SongsScreen() {
|
||||
const colors = useThemeColors()
|
||||
const { playFromLibrarySong, addToQueueNext, addToQueueLast, playShuffled } =
|
||||
usePlayback()
|
||||
const { openAddToPlaylist } = useAddToPlaylist()
|
||||
const { isSongFavorite, toggleSongFavorite } = useFavorites()
|
||||
const { playFromLibrarySong } = usePlayback()
|
||||
const { isSongFavorite } = useFavorites()
|
||||
const { handleSongAction } = useMediaMenuActions()
|
||||
const [sortKey, setSortKey] = useState<"title" | "artist" | "album">("title")
|
||||
const [sortDirection, setSortDirection] = useState<"asc" | "desc">("asc")
|
||||
const [actionSong, setActionSong] = useState<BrowseSong | null>(null)
|
||||
|
||||
const { results, status, loadMore } = usePaginatedQuery(
|
||||
api.library.browseSongsPaginated,
|
||||
@@ -35,80 +26,45 @@ export default function SongsScreen() {
|
||||
{ initialNumItems: PAGE_SIZE }
|
||||
)
|
||||
|
||||
function cycleSort(key: "title" | "artist" | "album") {
|
||||
if (sortKey === key) {
|
||||
setSortDirection((d) => (d === "asc" ? "desc" : "asc"))
|
||||
} else {
|
||||
setSortKey(key)
|
||||
setSortDirection("asc")
|
||||
}
|
||||
}
|
||||
|
||||
function handleAction(action: MediaAction) {
|
||||
if (!actionSong) return
|
||||
const songIds = [actionSong.id]
|
||||
switch (action) {
|
||||
case "playlist":
|
||||
openAddToPlaylist(songIds)
|
||||
break
|
||||
case "play-next":
|
||||
void addToQueueNext(songIds).then(() =>
|
||||
showSuccess("Queued to play next")
|
||||
)
|
||||
break
|
||||
case "play-last":
|
||||
void addToQueueLast(songIds).then(() =>
|
||||
showSuccess("Queued to play last")
|
||||
)
|
||||
break
|
||||
case "shuffle":
|
||||
void playShuffled(songIds)
|
||||
break
|
||||
case "favorite":
|
||||
void toggleSongFavorite(actionSong.id)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (results === undefined) {
|
||||
return <LoadingView />
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<FlatList
|
||||
data={results}
|
||||
keyExtractor={(item) => item.id}
|
||||
contentContainerStyle={{ paddingBottom: contentBottomInset }}
|
||||
contentInsetAdjustmentBehavior="automatic"
|
||||
onEndReached={() => {
|
||||
if (status === "CanLoadMore") loadMore(PAGE_SIZE)
|
||||
}}
|
||||
onEndReachedThreshold={0.5}
|
||||
renderItem={({ item }) => (
|
||||
<SongRow
|
||||
song={item}
|
||||
onPress={() =>
|
||||
void playFromLibrarySong(item.id as Id<"songs">, {
|
||||
sortKey,
|
||||
sortDirection,
|
||||
})
|
||||
}
|
||||
onLongPress={() => setActionSong(item)}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
|
||||
<MediaActionsSheet
|
||||
visible={Boolean(actionSong)}
|
||||
title={actionSong?.title ?? ""}
|
||||
favorited={actionSong ? isSongFavorite(actionSong.id) : false}
|
||||
onClose={() => setActionSong(null)}
|
||||
onAction={handleAction}
|
||||
/>
|
||||
</>
|
||||
<FlatList
|
||||
data={results}
|
||||
keyExtractor={(item) => item.id}
|
||||
contentContainerStyle={{ paddingBottom: contentBottomInset }}
|
||||
contentInsetAdjustmentBehavior="automatic"
|
||||
onEndReached={() => {
|
||||
if (status === "CanLoadMore") loadMore(PAGE_SIZE)
|
||||
}}
|
||||
onEndReachedThreshold={0.5}
|
||||
renderItem={({ item }) => (
|
||||
<SongRow
|
||||
song={item}
|
||||
onPress={() =>
|
||||
void playFromLibrarySong(item.id as Id<"songs">, {
|
||||
sortKey,
|
||||
sortDirection,
|
||||
})
|
||||
}
|
||||
contextMenu={{
|
||||
favorited: isSongFavorite(item.id),
|
||||
navigation: {
|
||||
artist: { id: item.artist.id },
|
||||
album: { id: item.album.id },
|
||||
},
|
||||
share: {
|
||||
type: "song",
|
||||
albumId: item.album.id,
|
||||
songId: item.id,
|
||||
},
|
||||
onAction: (action) => void handleSongAction(item, action),
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
import { useMutation, useQuery } from "convex/react"
|
||||
import { Stack, useLocalSearchParams, useRouter } from "expo-router"
|
||||
import { useState } from "react"
|
||||
import { Pressable, ScrollView, StyleSheet, Text, View } from "react-native"
|
||||
import { Ionicons } from "@expo/vector-icons"
|
||||
|
||||
import { CoverImage } from "@/components/cover-image"
|
||||
|
||||
import { MediaActionsSheet, type MediaAction } from "@/components/media-actions-sheet"
|
||||
import { MediaActionMenu } from "@/components/media-actions-sheet"
|
||||
import { Button, LoadingView } from "@/components/ui/primitives"
|
||||
import { contentBottomInset, SongRow } from "@/components/player"
|
||||
import { useAddToPlaylist } from "@/contexts/add-to-playlist"
|
||||
import { useFavorites } from "@/contexts/favorites"
|
||||
import { usePlayback } from "@/contexts/playback"
|
||||
import { useServerConfig } from "@/contexts/server-config"
|
||||
import { useMediaMenuActions } from "@/hooks/use-media-menu-actions"
|
||||
import { api } from "@otunes/convex/_generated/api"
|
||||
import type { Id } from "@otunes/convex/_generated/dataModel"
|
||||
import type { BrowseSong } from "@otunes/convex/types"
|
||||
@@ -29,14 +28,12 @@ export default function PlaylistScreen() {
|
||||
id: id as Id<"playlists">,
|
||||
})
|
||||
const { playPlaylist, playPlaylistShuffled, playFromSong } = usePlayback()
|
||||
const { openAddToPlaylist, openAddPlaylistToPlaylist } = useAddToPlaylist()
|
||||
const { isSongFavorite, toggleSongFavorite } = useFavorites()
|
||||
const { isSongFavorite } = useFavorites()
|
||||
const { handleSongAction, handlePlaylistDetailAction } = useMediaMenuActions()
|
||||
const subscribe = useMutation(api.playlists.subscribeToPlaylist)
|
||||
const unsubscribe = useMutation(api.playlists.unsubscribeFromPlaylist)
|
||||
const deletePlaylist = useMutation(api.playlists.deletePlaylist)
|
||||
const removeSongs = useMutation(api.playlists.removeSongsFromPlaylist)
|
||||
const [actionSong, setActionSong] = useState<BrowseSong | null>(null)
|
||||
const [menuOpen, setMenuOpen] = useState(false)
|
||||
|
||||
if (playlist === undefined || !config) {
|
||||
return <LoadingView />
|
||||
@@ -78,21 +75,6 @@ export default function PlaylistScreen() {
|
||||
}
|
||||
}
|
||||
|
||||
function handleSongAction(action: MediaAction) {
|
||||
if (!actionSong) return
|
||||
const ids = [actionSong.id]
|
||||
switch (action) {
|
||||
case "playlist":
|
||||
openAddToPlaylist(ids)
|
||||
break
|
||||
case "favorite":
|
||||
void toggleSongFavorite(actionSong.id)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack.Screen
|
||||
@@ -100,9 +82,21 @@ export default function PlaylistScreen() {
|
||||
title: "",
|
||||
headerLargeTitle: false,
|
||||
headerRight: () => (
|
||||
<Pressable onPress={() => setMenuOpen(true)} hitSlop={8}>
|
||||
<Ionicons name="ellipsis-horizontal" size={22} color={colors.foreground} />
|
||||
</Pressable>
|
||||
<MediaActionMenu
|
||||
selectedCount={songIds.length}
|
||||
playlistLabel="Add to Another Playlist"
|
||||
share={{
|
||||
type: "playlist",
|
||||
playlistId: playlist.id ?? "favorites",
|
||||
}}
|
||||
onAction={(action) =>
|
||||
void handlePlaylistDetailAction(songIds, action)
|
||||
}
|
||||
>
|
||||
<Pressable hitSlop={8}>
|
||||
<Ionicons name="ellipsis-horizontal" size={22} color={colors.foreground} />
|
||||
</Pressable>
|
||||
</MediaActionMenu>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
@@ -144,7 +138,20 @@ export default function PlaylistScreen() {
|
||||
key={song.id}
|
||||
song={song}
|
||||
onPress={() => void playFromSong(song.id, songIds)}
|
||||
onLongPress={() => setActionSong(song)}
|
||||
contextMenu={{
|
||||
favorited: isSongFavorite(song.id),
|
||||
playlistLabel: "Add to Another Playlist",
|
||||
navigation: {
|
||||
artist: { id: song.artist.id },
|
||||
album: { id: song.album.id },
|
||||
},
|
||||
share: {
|
||||
type: "song",
|
||||
albumId: song.album.id,
|
||||
songId: song.id,
|
||||
},
|
||||
onAction: (action) => void handleSongAction(song, action),
|
||||
}}
|
||||
trailing={
|
||||
playlist.isOwner && playlist.id ? (
|
||||
<Pressable
|
||||
@@ -161,26 +168,6 @@ export default function PlaylistScreen() {
|
||||
/>
|
||||
))}
|
||||
</ScrollView>
|
||||
|
||||
<MediaActionsSheet
|
||||
visible={Boolean(actionSong)}
|
||||
title={actionSong?.title ?? ""}
|
||||
favorited={actionSong ? isSongFavorite(actionSong.id) : false}
|
||||
onClose={() => setActionSong(null)}
|
||||
onAction={handleSongAction}
|
||||
/>
|
||||
|
||||
<MediaActionsSheet
|
||||
visible={menuOpen}
|
||||
title={playlist.title}
|
||||
showFavorite={false}
|
||||
onClose={() => setMenuOpen(false)}
|
||||
onAction={(action) => {
|
||||
if (action === "playlist" && playlist.id) {
|
||||
void openAddPlaylistToPlaylist(playlist.id)
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,22 +1,14 @@
|
||||
import { useQuery } from "convex/react"
|
||||
import { useState } from "react"
|
||||
import { Pressable, ScrollView, StyleSheet, Text, View } from "react-native"
|
||||
import { ScrollView, StyleSheet, Text, View } from "react-native"
|
||||
|
||||
import { CoverImage } from "@/components/cover-image"
|
||||
|
||||
import {
|
||||
MediaActionsSheet,
|
||||
type MediaAction,
|
||||
} from "@/components/media-actions-sheet"
|
||||
import { Button, LoadingView } from "@/components/ui/primitives"
|
||||
import { contentBottomInset, SongRow } from "@/components/player"
|
||||
import { useAddToPlaylist } from "@/contexts/add-to-playlist"
|
||||
import { useFavorites } from "@/contexts/favorites"
|
||||
import { usePlayback } from "@/contexts/playback"
|
||||
import { useServerConfig } from "@/contexts/server-config"
|
||||
import { useMediaMenuActions } from "@/hooks/use-media-menu-actions"
|
||||
import { api } from "@otunes/convex/_generated/api"
|
||||
import type { BrowseSong } from "@otunes/convex/types"
|
||||
import { playlistCoverUrl } from "@/lib/urls"
|
||||
import { radius, spacing, useThemeColors } from "@/lib/theme"
|
||||
import { Ionicons } from "@expo/vector-icons"
|
||||
import { Stack } from "expo-router"
|
||||
@@ -26,9 +18,8 @@ export default function FavoritesScreen() {
|
||||
const { config } = useServerConfig()
|
||||
const favorites = useQuery(api.favorites.browseFavoritesPlaylistDetail)
|
||||
const { playInOrder, playShuffled, playFromSong } = usePlayback()
|
||||
const { openAddToPlaylist } = useAddToPlaylist()
|
||||
const { isSongFavorite, toggleSongFavorite } = useFavorites()
|
||||
const [actionSong, setActionSong] = useState<BrowseSong | null>(null)
|
||||
const { isSongFavorite } = useFavorites()
|
||||
const { handleSongAction } = useMediaMenuActions()
|
||||
|
||||
if (favorites === undefined || !config) {
|
||||
return <LoadingView />
|
||||
@@ -46,20 +37,6 @@ export default function FavoritesScreen() {
|
||||
|
||||
const songIds = favorites.songs.map((song: BrowseSong) => song.id)
|
||||
|
||||
function handleSongAction(action: MediaAction) {
|
||||
if (!actionSong) return
|
||||
switch (action) {
|
||||
case "playlist":
|
||||
openAddToPlaylist([actionSong.id])
|
||||
break
|
||||
case "favorite":
|
||||
void toggleSongFavorite(actionSong.id)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack.Screen
|
||||
@@ -109,18 +86,23 @@ export default function FavoritesScreen() {
|
||||
key={song.id}
|
||||
song={song}
|
||||
onPress={() => void playFromSong(song.id, songIds)}
|
||||
onLongPress={() => setActionSong(song)}
|
||||
contextMenu={{
|
||||
favorited: isSongFavorite(song.id),
|
||||
playlistLabel: "Add to Another Playlist",
|
||||
navigation: {
|
||||
artist: { id: song.artist.id },
|
||||
album: { id: song.album.id },
|
||||
},
|
||||
share: {
|
||||
type: "song",
|
||||
albumId: song.album.id,
|
||||
songId: song.id,
|
||||
},
|
||||
onAction: (action) => void handleSongAction(song, action),
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</ScrollView>
|
||||
|
||||
<MediaActionsSheet
|
||||
visible={Boolean(actionSong)}
|
||||
title={actionSong?.title ?? ""}
|
||||
favorited={actionSong ? isSongFavorite(actionSong.id) : true}
|
||||
onClose={() => setActionSong(null)}
|
||||
onAction={handleSongAction}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ import Slider from "@react-native-community/slider"
|
||||
import { BlurView } from "expo-blur"
|
||||
import { useRouter } from "expo-router"
|
||||
import * as Haptics from "expo-haptics"
|
||||
import { useState } from "react"
|
||||
import {
|
||||
Platform,
|
||||
Pressable,
|
||||
@@ -14,7 +13,8 @@ import {
|
||||
import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context"
|
||||
import { StatusBar } from "expo-status-bar"
|
||||
|
||||
import { MediaActionsSheet, type MediaAction } from "@/components/media-actions-sheet"
|
||||
import { MediaActionMenu, type MediaAction } from "@/components/media-actions-sheet"
|
||||
import { useMediaMenuActions } from "@/hooks/use-media-menu-actions"
|
||||
import { CoverImage } from "@/components/cover-image"
|
||||
import { useFavorites } from "@/contexts/favorites"
|
||||
import { usePlayback } from "@/contexts/playback"
|
||||
@@ -31,7 +31,7 @@ export default function PlayerScreen() {
|
||||
const player = usePlayerTheme()
|
||||
const { config } = useServerConfig()
|
||||
const { isSongFavorite, toggleSongFavorite } = useFavorites()
|
||||
const [actionsOpen, setActionsOpen] = useState(false)
|
||||
const { handleSongAction } = useMediaMenuActions()
|
||||
const {
|
||||
currentSong,
|
||||
isPlaying,
|
||||
@@ -48,9 +48,6 @@ export default function PlayerScreen() {
|
||||
cycleRepeat,
|
||||
skipNext,
|
||||
skipPrevious,
|
||||
addToQueueNext,
|
||||
addToQueueLast,
|
||||
playShuffled,
|
||||
} = usePlayback()
|
||||
|
||||
if (!currentSong || !config) {
|
||||
@@ -64,29 +61,8 @@ export default function PlayerScreen() {
|
||||
const { colors } = player
|
||||
|
||||
async function handleAction(action: MediaAction) {
|
||||
setActionsOpen(false)
|
||||
switch (action) {
|
||||
case "favorite":
|
||||
await toggleSongFavorite(currentSong!.id)
|
||||
break
|
||||
case "play-next":
|
||||
await addToQueueNext([currentSong!.id])
|
||||
break
|
||||
case "play-last":
|
||||
await addToQueueLast([currentSong!.id])
|
||||
break
|
||||
case "shuffle":
|
||||
await playShuffled([currentSong!.id])
|
||||
break
|
||||
case "go-artist":
|
||||
push(`/artist/${currentSong!.artist.id}`)
|
||||
break
|
||||
case "go-album":
|
||||
push(`/album/${currentSong!.album.id}`)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
if (!currentSong) return
|
||||
await handleSongAction(currentSong, action)
|
||||
}
|
||||
|
||||
function togglePlayback() {
|
||||
@@ -153,13 +129,29 @@ export default function PlayerScreen() {
|
||||
color={favorited ? appleMusic.pink : colors.foreground}
|
||||
/>
|
||||
</Pressable>
|
||||
<Pressable
|
||||
onPress={() => setActionsOpen(true)}
|
||||
hitSlop={10}
|
||||
style={[styles.circleButton, { backgroundColor: player.buttonSurface }]}
|
||||
<MediaActionMenu
|
||||
favorited={favorited}
|
||||
navigation={{
|
||||
artist: { id: currentSong.artist.id },
|
||||
album: { id: currentSong.album.id },
|
||||
}}
|
||||
includeActions={[
|
||||
"play-next",
|
||||
"play-last",
|
||||
"shuffle",
|
||||
"favorite",
|
||||
"go-artist",
|
||||
"go-album",
|
||||
]}
|
||||
onAction={handleAction}
|
||||
>
|
||||
<Ionicons name="ellipsis-horizontal" size={20} color={colors.foreground} />
|
||||
</Pressable>
|
||||
<Pressable
|
||||
hitSlop={10}
|
||||
style={[styles.circleButton, { backgroundColor: player.buttonSurface }]}
|
||||
>
|
||||
<Ionicons name="ellipsis-horizontal" size={20} color={colors.foreground} />
|
||||
</Pressable>
|
||||
</MediaActionMenu>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@@ -241,15 +233,6 @@ export default function PlayerScreen() {
|
||||
</View>
|
||||
</View>
|
||||
</SafeAreaView>
|
||||
|
||||
<MediaActionsSheet
|
||||
visible={actionsOpen}
|
||||
title={currentSong.title}
|
||||
favorited={favorited}
|
||||
showNavigation
|
||||
onClose={() => setActionsOpen(false)}
|
||||
onAction={handleAction}
|
||||
/>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,111 +1,7 @@
|
||||
import { Ionicons } from "@expo/vector-icons"
|
||||
import { Modal, Pressable, StyleSheet, Text, View } from "react-native"
|
||||
|
||||
import { useThemeColors, spacing, radius } from "@/lib/theme"
|
||||
|
||||
export type MediaAction =
|
||||
| "playlist"
|
||||
| "play-next"
|
||||
| "play-last"
|
||||
| "shuffle"
|
||||
| "favorite"
|
||||
| "go-artist"
|
||||
| "go-album"
|
||||
|
||||
export function MediaActionsSheet({
|
||||
visible,
|
||||
title,
|
||||
selectedCount = 1,
|
||||
favorited,
|
||||
showFavorite = true,
|
||||
showNavigation = false,
|
||||
onClose,
|
||||
onAction,
|
||||
}: {
|
||||
visible: boolean
|
||||
title: string
|
||||
selectedCount?: number
|
||||
favorited?: boolean
|
||||
showFavorite?: boolean
|
||||
showNavigation?: boolean
|
||||
onClose: () => void
|
||||
onAction: (action: MediaAction) => void
|
||||
}) {
|
||||
const colors = useThemeColors()
|
||||
|
||||
const items: { action: MediaAction; label: string; icon: keyof typeof Ionicons.glyphMap }[] = [
|
||||
{ action: "playlist", label: `Add to Playlist${selectedCount > 1 ? ` (${selectedCount})` : ""}`, icon: "list" },
|
||||
{ action: "play-next", label: `Play Next${selectedCount > 1 ? ` (${selectedCount})` : ""}`, icon: "arrow-down-circle-outline" },
|
||||
{ action: "play-last", label: `Play Last${selectedCount > 1 ? ` (${selectedCount})` : ""}`, icon: "arrow-up-circle-outline" },
|
||||
{ action: "shuffle", label: `Shuffle${selectedCount > 1 ? ` (${selectedCount})` : ""}`, icon: "shuffle" },
|
||||
]
|
||||
|
||||
if (showFavorite) {
|
||||
items.push({
|
||||
action: "favorite",
|
||||
label: favorited ? "Remove from Favorites" : "Add to Favorites",
|
||||
icon: favorited ? "star" : "star-outline",
|
||||
})
|
||||
}
|
||||
|
||||
if (showNavigation) {
|
||||
items.push(
|
||||
{ action: "go-artist", label: "Go to Artist", icon: "person" },
|
||||
{ action: "go-album", label: "Go to Album", icon: "disc" }
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<Modal visible={visible} transparent animationType="fade" onRequestClose={onClose}>
|
||||
<Pressable style={styles.overlay} onPress={onClose}>
|
||||
<Pressable
|
||||
style={[styles.sheet, { backgroundColor: colors.card, borderColor: colors.border }]}
|
||||
onPress={(event) => event.stopPropagation()}
|
||||
>
|
||||
<Text style={[styles.title, { color: colors.foreground }]} numberOfLines={2}>
|
||||
{title}
|
||||
</Text>
|
||||
{items.map((item) => (
|
||||
<Pressable
|
||||
key={item.action}
|
||||
style={styles.row}
|
||||
onPress={() => {
|
||||
onAction(item.action)
|
||||
onClose()
|
||||
}}
|
||||
>
|
||||
<Ionicons name={item.icon} size={20} color={colors.foreground} />
|
||||
<Text style={{ color: colors.foreground, fontSize: 16 }}>{item.label}</Text>
|
||||
</Pressable>
|
||||
))}
|
||||
</Pressable>
|
||||
</Pressable>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
overlay: {
|
||||
flex: 1,
|
||||
backgroundColor: "rgba(0,0,0,0.45)",
|
||||
justifyContent: "flex-end",
|
||||
},
|
||||
sheet: {
|
||||
borderTopLeftRadius: radius.lg,
|
||||
borderTopRightRadius: radius.lg,
|
||||
borderWidth: 1,
|
||||
padding: spacing.lg,
|
||||
gap: spacing.xs,
|
||||
},
|
||||
title: {
|
||||
fontSize: 16,
|
||||
fontWeight: "700",
|
||||
marginBottom: spacing.sm,
|
||||
},
|
||||
row: {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
gap: spacing.md,
|
||||
paddingVertical: spacing.md,
|
||||
},
|
||||
})
|
||||
export type { MediaAction, MediaMenuConfig, MediaNavigation } from "@/components/media-context-menu"
|
||||
export type { MediaShareContext } from "@/lib/media-links"
|
||||
export {
|
||||
buildMediaMenuActions,
|
||||
MediaActionMenu,
|
||||
MediaContextMenu,
|
||||
} from "@/components/media-context-menu"
|
||||
@@ -2,6 +2,8 @@ import { Ionicons } from "@expo/vector-icons"
|
||||
import { Pressable, ScrollView, StyleSheet, Text, View } from "react-native"
|
||||
|
||||
import { CoverImage } from "@/components/cover-image"
|
||||
import { MediaContextMenu } from "@/components/media-context-menu"
|
||||
import { useMediaMenuActions } from "@/hooks/use-media-menu-actions"
|
||||
import { useServerConfig } from "@/contexts/server-config"
|
||||
import { useAppNavigation } from "@/lib/app-navigation"
|
||||
import type { BrowseAlbum, BrowseArtist, PlaylistSummary } from "@otunes/convex/types"
|
||||
@@ -20,9 +22,10 @@ export function AlbumCard({
|
||||
const { push } = useAppNavigation()
|
||||
const { config } = useServerConfig()
|
||||
const colors = useThemeColors()
|
||||
const { handleAlbumAction, isAlbumFavorite } = useMediaMenuActions()
|
||||
if (!config) return null
|
||||
|
||||
return (
|
||||
const card = (
|
||||
<Pressable
|
||||
style={[styles.card, { width }]}
|
||||
onPress={() => push(`/album/${album.id}`)}
|
||||
@@ -40,6 +43,17 @@ export function AlbumCard({
|
||||
</Text>
|
||||
</Pressable>
|
||||
)
|
||||
|
||||
return (
|
||||
<MediaContextMenu
|
||||
favorited={isAlbumFavorite(album.id)}
|
||||
navigation={{ artist: { id: album.artist.id } }}
|
||||
share={{ type: "album", albumId: album.id }}
|
||||
onAction={(action) => void handleAlbumAction(album, action)}
|
||||
>
|
||||
{card}
|
||||
</MediaContextMenu>
|
||||
)
|
||||
}
|
||||
|
||||
export function ArtistCard({
|
||||
@@ -52,9 +66,10 @@ export function ArtistCard({
|
||||
const { push } = useAppNavigation()
|
||||
const { config } = useServerConfig()
|
||||
const colors = useThemeColors()
|
||||
const { handleArtistAction, isArtistFavorite } = useMediaMenuActions()
|
||||
if (!config) return null
|
||||
|
||||
return (
|
||||
const card = (
|
||||
<Pressable
|
||||
style={[styles.card, { width }]}
|
||||
onPress={() => push(`/artist/${artist.id}`)}
|
||||
@@ -69,6 +84,16 @@ export function ArtistCard({
|
||||
</Text>
|
||||
</Pressable>
|
||||
)
|
||||
|
||||
return (
|
||||
<MediaContextMenu
|
||||
favorited={isArtistFavorite(artist.id)}
|
||||
share={{ type: "artist", artistId: artist.id }}
|
||||
onAction={(action) => void handleArtistAction(artist, action)}
|
||||
>
|
||||
{card}
|
||||
</MediaContextMenu>
|
||||
)
|
||||
}
|
||||
|
||||
export function PlaylistCard({
|
||||
@@ -81,9 +106,10 @@ export function PlaylistCard({
|
||||
const { push } = useAppNavigation()
|
||||
const { config } = useServerConfig()
|
||||
const colors = useThemeColors()
|
||||
const { handlePlaylistAction } = useMediaMenuActions()
|
||||
if (!config) return null
|
||||
|
||||
return (
|
||||
const card = (
|
||||
<Pressable
|
||||
style={[styles.card, { width }]}
|
||||
onPress={() => push(`/playlist/${playlist.id}`)}
|
||||
@@ -101,6 +127,16 @@ export function PlaylistCard({
|
||||
</Text>
|
||||
</Pressable>
|
||||
)
|
||||
|
||||
return (
|
||||
<MediaContextMenu
|
||||
showFavorite={false}
|
||||
share={{ type: "playlist", playlistId: playlist.id }}
|
||||
onAction={(action) => void handlePlaylistAction(playlist, action)}
|
||||
>
|
||||
{card}
|
||||
</MediaContextMenu>
|
||||
)
|
||||
}
|
||||
|
||||
function renderMediaItem(item: MediaItem, width: number) {
|
||||
|
||||
@@ -0,0 +1,191 @@
|
||||
import { MenuView, type MenuAction } from "@expo/ui/community/menu"
|
||||
import type { ReactNode } from "react"
|
||||
import type { StyleProp, ViewStyle } from "react-native"
|
||||
|
||||
import { useServerConfig } from "@/contexts/server-config"
|
||||
import type { MediaShareContext } from "@/lib/media-links"
|
||||
import { shouldShowShare } from "@/lib/media-links"
|
||||
import { shareMediaLink } from "@/lib/share-media-link"
|
||||
|
||||
export type MediaAction =
|
||||
| "share"
|
||||
| "playlist"
|
||||
| "play-next"
|
||||
| "play-last"
|
||||
| "shuffle"
|
||||
| "favorite"
|
||||
| "go-artist"
|
||||
| "go-album"
|
||||
|
||||
export type MediaNavigation = {
|
||||
artist?: { id: string }
|
||||
album?: { id: string }
|
||||
}
|
||||
|
||||
export type MediaMenuConfig = {
|
||||
selectedCount?: number
|
||||
playlistLabel?: string
|
||||
favorited?: boolean
|
||||
showFavorite?: boolean
|
||||
navigation?: MediaNavigation
|
||||
share?: MediaShareContext
|
||||
includeActions?: MediaAction[]
|
||||
onAction: (action: MediaAction) => void
|
||||
}
|
||||
|
||||
type MediaMenuWrapperProps = MediaMenuConfig & {
|
||||
children: ReactNode
|
||||
style?: StyleProp<ViewStyle>
|
||||
}
|
||||
|
||||
const QUEUE_ACTIONS: MediaAction[] = ["play-next", "play-last", "shuffle"]
|
||||
|
||||
const MEDIA_ACTION_ITEMS: {
|
||||
action: MediaAction
|
||||
label: (
|
||||
countSuffix: string,
|
||||
favorited: boolean | undefined,
|
||||
playlistLabel: string
|
||||
) => string
|
||||
image: NonNullable<MenuAction["image"]> & string
|
||||
}[] = [
|
||||
{
|
||||
action: "playlist",
|
||||
label: (countSuffix, _favorited, playlistLabel) =>
|
||||
`${playlistLabel}${countSuffix}`,
|
||||
image: "text.badge.plus",
|
||||
},
|
||||
{
|
||||
action: "play-next",
|
||||
label: (countSuffix) => `Play Next${countSuffix}`,
|
||||
image: "text.line.first.and.arrowtriangle.forward",
|
||||
},
|
||||
{
|
||||
action: "play-last",
|
||||
label: (countSuffix) => `Play Last${countSuffix}`,
|
||||
image: "text.line.last.and.arrowtriangle.forward",
|
||||
},
|
||||
{
|
||||
action: "shuffle",
|
||||
label: (countSuffix) => `Shuffle${countSuffix}`,
|
||||
image: "shuffle",
|
||||
},
|
||||
{
|
||||
action: "go-artist",
|
||||
label: () => "Go to Artist",
|
||||
image: "person",
|
||||
},
|
||||
{
|
||||
action: "go-album",
|
||||
label: () => "Go to Album",
|
||||
image: "opticaldisc",
|
||||
},
|
||||
{
|
||||
action: "favorite",
|
||||
label: (countSuffix, favorited) =>
|
||||
`${favorited ? "Unfavorite" : "Favorite"}${countSuffix}`,
|
||||
image: "star",
|
||||
},
|
||||
]
|
||||
|
||||
function isActionIncluded(
|
||||
action: MediaAction,
|
||||
config: Omit<MediaMenuConfig, "onAction">
|
||||
): boolean {
|
||||
if (config.includeActions) {
|
||||
return config.includeActions.includes(action)
|
||||
}
|
||||
|
||||
if (action === "share") {
|
||||
return shouldShowShare(config.share, config.selectedCount ?? 1)
|
||||
}
|
||||
|
||||
if (action === "favorite" && config.showFavorite === false) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (action === "go-artist" && !config.navigation?.artist) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (action === "go-album" && !config.navigation?.album) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
export function buildMediaMenuActions(
|
||||
config: Omit<MediaMenuConfig, "onAction">
|
||||
): MenuAction[] {
|
||||
const {
|
||||
selectedCount = 1,
|
||||
favorited,
|
||||
playlistLabel = "Add to Playlist",
|
||||
} = config
|
||||
const countSuffix = selectedCount > 1 ? ` (${selectedCount})` : ""
|
||||
|
||||
const actions: MenuAction[] = []
|
||||
|
||||
if (isActionIncluded("share", config)) {
|
||||
actions.push({
|
||||
id: "share",
|
||||
title: "Share",
|
||||
image: "square.and.arrow.up",
|
||||
})
|
||||
}
|
||||
|
||||
for (const item of MEDIA_ACTION_ITEMS) {
|
||||
if (!isActionIncluded(item.action, config)) {
|
||||
continue
|
||||
}
|
||||
|
||||
actions.push({
|
||||
id: item.action,
|
||||
title: item.label(countSuffix, favorited, playlistLabel),
|
||||
image:
|
||||
item.action === "favorite" && favorited ? "star.fill" : item.image,
|
||||
})
|
||||
}
|
||||
|
||||
return actions
|
||||
}
|
||||
|
||||
function MediaMenuBase({
|
||||
children,
|
||||
style,
|
||||
shouldOpenOnLongPress,
|
||||
onAction,
|
||||
share,
|
||||
...actionConfig
|
||||
}: MediaMenuWrapperProps & { shouldOpenOnLongPress?: boolean }) {
|
||||
const { config } = useServerConfig()
|
||||
|
||||
return (
|
||||
<MenuView
|
||||
shouldOpenOnLongPress={shouldOpenOnLongPress}
|
||||
actions={buildMediaMenuActions({ ...actionConfig, share })}
|
||||
onPressAction={(event) => {
|
||||
const action = event.nativeEvent.event as MediaAction
|
||||
if (action === "share" && share && config) {
|
||||
void shareMediaLink(config.serverUrl, share)
|
||||
return
|
||||
}
|
||||
onAction(action)
|
||||
}}
|
||||
style={[{ alignSelf: "stretch" }, style]}
|
||||
>
|
||||
{children}
|
||||
</MenuView>
|
||||
)
|
||||
}
|
||||
|
||||
export function MediaContextMenu(props: MediaMenuWrapperProps) {
|
||||
return <MediaMenuBase {...props} shouldOpenOnLongPress />
|
||||
}
|
||||
|
||||
export function MediaActionMenu(props: MediaMenuWrapperProps) {
|
||||
return <MediaMenuBase {...props} />
|
||||
}
|
||||
|
||||
export const MEDIA_QUEUE_ACTIONS = QUEUE_ACTIONS
|
||||
@@ -11,26 +11,32 @@ import {
|
||||
} from "@/lib/theme"
|
||||
import { Pressable, StyleSheet, Text, View } from "react-native"
|
||||
|
||||
import {
|
||||
MediaContextMenu,
|
||||
type MediaMenuConfig,
|
||||
} from "@/components/media-context-menu"
|
||||
|
||||
export function SongRow({
|
||||
song,
|
||||
onPress,
|
||||
onLongPress,
|
||||
contextMenu,
|
||||
trailing,
|
||||
}: {
|
||||
song: BrowseSong
|
||||
onPress?: () => void
|
||||
onLongPress?: () => void
|
||||
contextMenu?: Omit<MediaMenuConfig, "onAction"> & {
|
||||
onAction: MediaMenuConfig["onAction"]
|
||||
}
|
||||
trailing?: React.ReactNode
|
||||
}) {
|
||||
const { config } = useServerConfig()
|
||||
const colors = useThemeColors()
|
||||
if (!config) return null
|
||||
|
||||
return (
|
||||
const row = (
|
||||
<Pressable
|
||||
style={[styles.row, { borderBottomColor: colors.border }]}
|
||||
onPress={onPress}
|
||||
onLongPress={onLongPress}
|
||||
>
|
||||
<CoverImage
|
||||
uri={albumCoverUrl(config.serverUrl, song.album.id)}
|
||||
@@ -51,6 +57,16 @@ export function SongRow({
|
||||
{trailing}
|
||||
</Pressable>
|
||||
)
|
||||
|
||||
if (!contextMenu) {
|
||||
return row
|
||||
}
|
||||
|
||||
return (
|
||||
<MediaContextMenu {...contextMenu}>
|
||||
{row}
|
||||
</MediaContextMenu>
|
||||
)
|
||||
}
|
||||
|
||||
export const tabContentBottomInset = spacing.lg
|
||||
|
||||
@@ -5,7 +5,9 @@ import { ScrollView, StyleSheet, Text, View } from "react-native"
|
||||
import { ContentCarousel } from "@/components/media-cards"
|
||||
import { tabContentBottomInset, SongRow } from "@/components/player"
|
||||
import { LoadingView } from "@/components/ui/primitives"
|
||||
import { useFavorites } from "@/contexts/favorites"
|
||||
import { usePlayback } from "@/contexts/playback"
|
||||
import { useMediaMenuActions } from "@/hooks/use-media-menu-actions"
|
||||
import { api } from "@otunes/convex/_generated/api"
|
||||
import type { BrowseSong } from "@otunes/convex/types"
|
||||
import { spacing, useThemeColors } from "@/lib/theme"
|
||||
@@ -13,6 +15,8 @@ import { spacing, useThemeColors } from "@/lib/theme"
|
||||
function SearchResultsBody({ searchQuery }: { searchQuery: string }) {
|
||||
const colors = useThemeColors()
|
||||
const { playFromSong } = usePlayback()
|
||||
const { isSongFavorite } = useFavorites()
|
||||
const { handleSongAction } = useMediaMenuActions()
|
||||
const hasQuery = searchQuery.length > 0
|
||||
|
||||
const results = useQuery(
|
||||
@@ -85,6 +89,19 @@ function SearchResultsBody({ searchQuery }: { searchQuery: string }) {
|
||||
results.songs.map((s: BrowseSong) => s.id)
|
||||
)
|
||||
}
|
||||
contextMenu={{
|
||||
favorited: isSongFavorite(song.id),
|
||||
navigation: {
|
||||
artist: { id: song.artist.id },
|
||||
album: { id: song.album.id },
|
||||
},
|
||||
share: {
|
||||
type: "song",
|
||||
albumId: song.album.id,
|
||||
songId: song.id,
|
||||
},
|
||||
onAction: (action) => void handleSongAction(song, action),
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</View>
|
||||
|
||||
@@ -0,0 +1,255 @@
|
||||
import { useConvex, useMutation } from "convex/react"
|
||||
import { useCallback } from "react"
|
||||
|
||||
import type { MediaAction } from "@/components/media-context-menu"
|
||||
import { useAddToPlaylist } from "@/contexts/add-to-playlist"
|
||||
import { useFavorites } from "@/contexts/favorites"
|
||||
import { usePlayback } from "@/contexts/playback"
|
||||
import { useAppNavigation } from "@/lib/app-navigation"
|
||||
import { showSuccess } from "@/lib/toast"
|
||||
import { api } from "@otunes/convex/_generated/api"
|
||||
import type { Id } from "@otunes/convex/_generated/dataModel"
|
||||
import type {
|
||||
BrowseAlbum,
|
||||
BrowseAlbumDetail,
|
||||
BrowseAlbumTrack,
|
||||
BrowseArtist,
|
||||
BrowseSong,
|
||||
PlaylistSummary,
|
||||
} from "@otunes/convex/types"
|
||||
|
||||
export function useMediaMenuActions() {
|
||||
const convex = useConvex()
|
||||
const { push } = useAppNavigation()
|
||||
const { openAddToPlaylist, openAddAlbumToPlaylist, openAddArtistToPlaylist, openAddPlaylistToPlaylist } =
|
||||
useAddToPlaylist()
|
||||
const {
|
||||
isAlbumFavorite,
|
||||
isArtistFavorite,
|
||||
toggleAlbumFavorite,
|
||||
toggleArtistFavorite,
|
||||
toggleSongFavorite,
|
||||
} = useFavorites()
|
||||
const { addToQueueNext, addToQueueLast, playShuffled } = usePlayback()
|
||||
const favoriteSongs = useMutation(api.favorites.favoriteSongs)
|
||||
|
||||
const runQueueAction = useCallback(
|
||||
async (action: MediaAction, songIds: Id<"songs">[]) => {
|
||||
if (songIds.length === 0) return
|
||||
switch (action) {
|
||||
case "play-next":
|
||||
await addToQueueNext(songIds)
|
||||
showSuccess("Queued to play next")
|
||||
break
|
||||
case "play-last":
|
||||
await addToQueueLast(songIds)
|
||||
showSuccess("Queued to play last")
|
||||
break
|
||||
case "shuffle":
|
||||
await playShuffled(songIds)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
[addToQueueLast, addToQueueNext, playShuffled]
|
||||
)
|
||||
|
||||
const handleSongAction = useCallback(
|
||||
async (song: BrowseSong, action: MediaAction) => {
|
||||
const songIds = [song.id as Id<"songs">]
|
||||
switch (action) {
|
||||
case "playlist":
|
||||
openAddToPlaylist(songIds)
|
||||
break
|
||||
case "play-next":
|
||||
case "play-last":
|
||||
case "shuffle":
|
||||
await runQueueAction(action, songIds)
|
||||
break
|
||||
case "favorite":
|
||||
await toggleSongFavorite(song.id as Id<"songs">)
|
||||
break
|
||||
case "go-artist":
|
||||
push(`/artist/${song.artist.id}`)
|
||||
break
|
||||
case "go-album":
|
||||
push(`/album/${song.album.id}`)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
[openAddToPlaylist, push, runQueueAction, toggleSongFavorite]
|
||||
)
|
||||
|
||||
const handleAlbumAction = useCallback(
|
||||
async (album: BrowseAlbum, action: MediaAction) => {
|
||||
switch (action) {
|
||||
case "playlist":
|
||||
await openAddAlbumToPlaylist(album.id as Id<"albums">)
|
||||
break
|
||||
case "favorite":
|
||||
await toggleAlbumFavorite(album.id as Id<"albums">)
|
||||
break
|
||||
case "play-next":
|
||||
case "play-last":
|
||||
case "shuffle": {
|
||||
const songIds = await convex.query(api.playlists.getAlbumSongIds, {
|
||||
albumId: album.id as Id<"albums">,
|
||||
})
|
||||
await runQueueAction(action, songIds)
|
||||
break
|
||||
}
|
||||
case "go-artist":
|
||||
push(`/artist/${album.artist.id}`)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
[
|
||||
convex,
|
||||
openAddAlbumToPlaylist,
|
||||
push,
|
||||
runQueueAction,
|
||||
toggleAlbumFavorite,
|
||||
]
|
||||
)
|
||||
|
||||
const handleArtistAction = useCallback(
|
||||
async (artist: BrowseArtist, action: MediaAction) => {
|
||||
switch (action) {
|
||||
case "playlist":
|
||||
await openAddArtistToPlaylist(artist.id as Id<"artists">)
|
||||
break
|
||||
case "favorite":
|
||||
await toggleArtistFavorite(artist.id as Id<"artists">)
|
||||
break
|
||||
case "play-next":
|
||||
case "play-last":
|
||||
case "shuffle": {
|
||||
const songIds = await convex.query(
|
||||
api.playlists.getOrderedArtistSongIds,
|
||||
{ artistId: artist.id as Id<"artists"> }
|
||||
)
|
||||
await runQueueAction(action, songIds)
|
||||
break
|
||||
}
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
[
|
||||
convex,
|
||||
openAddArtistToPlaylist,
|
||||
runQueueAction,
|
||||
toggleArtistFavorite,
|
||||
]
|
||||
)
|
||||
|
||||
const handlePlaylistAction = useCallback(
|
||||
async (playlist: PlaylistSummary, action: MediaAction) => {
|
||||
switch (action) {
|
||||
case "playlist":
|
||||
await openAddPlaylistToPlaylist(playlist.id as Id<"playlists">)
|
||||
break
|
||||
case "play-next":
|
||||
case "play-last":
|
||||
case "shuffle": {
|
||||
const songIds = await convex.query(api.playlists.getPlaylistSongIds, {
|
||||
playlistId: playlist.id as Id<"playlists">,
|
||||
})
|
||||
await runQueueAction(action, songIds)
|
||||
break
|
||||
}
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
[convex, openAddPlaylistToPlaylist, runQueueAction]
|
||||
)
|
||||
|
||||
const handleAlbumDetailAction = useCallback(
|
||||
async (
|
||||
albumId: Id<"albums">,
|
||||
songIds: Id<"songs">[],
|
||||
action: MediaAction
|
||||
) => {
|
||||
switch (action) {
|
||||
case "favorite":
|
||||
await toggleAlbumFavorite(albumId)
|
||||
break
|
||||
case "playlist":
|
||||
openAddToPlaylist(songIds)
|
||||
break
|
||||
case "play-next":
|
||||
case "play-last":
|
||||
case "shuffle":
|
||||
await runQueueAction(action, songIds)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
[openAddToPlaylist, runQueueAction, toggleAlbumFavorite]
|
||||
)
|
||||
|
||||
const handleAlbumTrackAction = useCallback(
|
||||
async (
|
||||
track: BrowseAlbumTrack,
|
||||
album: BrowseAlbumDetail,
|
||||
action: MediaAction
|
||||
) => {
|
||||
const song: BrowseSong = {
|
||||
id: track.id,
|
||||
title: track.title,
|
||||
durationSeconds: track.durationSeconds,
|
||||
artist: album.artist,
|
||||
album: {
|
||||
id: album.id,
|
||||
title: album.title,
|
||||
cover: album.cover,
|
||||
},
|
||||
}
|
||||
await handleSongAction(song, action)
|
||||
},
|
||||
[handleSongAction]
|
||||
)
|
||||
|
||||
const handlePlaylistDetailAction = useCallback(
|
||||
async (songIds: Id<"songs">[], action: MediaAction) => {
|
||||
switch (action) {
|
||||
case "favorite":
|
||||
if (songIds.length > 0) {
|
||||
await favoriteSongs({ songIds })
|
||||
showSuccess("Added to favorites")
|
||||
}
|
||||
break
|
||||
case "playlist":
|
||||
openAddToPlaylist(songIds)
|
||||
break
|
||||
case "play-next":
|
||||
case "play-last":
|
||||
case "shuffle":
|
||||
await runQueueAction(action, songIds)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
[favoriteSongs, openAddToPlaylist, runQueueAction]
|
||||
)
|
||||
|
||||
return {
|
||||
handleSongAction,
|
||||
handleAlbumAction,
|
||||
handleArtistAction,
|
||||
handlePlaylistAction,
|
||||
handleAlbumDetailAction,
|
||||
handleAlbumTrackAction,
|
||||
handlePlaylistDetailAction,
|
||||
isAlbumFavorite,
|
||||
isArtistFavorite,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
export type MediaShareContext =
|
||||
| { type: "album"; albumId: string }
|
||||
| { type: "song"; albumId: string; songId: string }
|
||||
| { type: "playlist"; playlistId: string; isFavorites?: boolean }
|
||||
| { type: "artist"; artistId: string }
|
||||
|
||||
export function shouldShowShare(
|
||||
share: MediaShareContext | undefined,
|
||||
selectedCount: number
|
||||
) {
|
||||
if (!share) {
|
||||
return false
|
||||
}
|
||||
if (share.type === "song") {
|
||||
return selectedCount === 1
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
export function mediaShareUrl(
|
||||
serverUrl: string,
|
||||
share: MediaShareContext
|
||||
): string {
|
||||
const origin = serverUrl.replace(/\/+$/, "")
|
||||
|
||||
switch (share.type) {
|
||||
case "album":
|
||||
return `${origin}/album/${share.albumId}`
|
||||
case "song":
|
||||
return `${origin}/album/${share.albumId}?s=${share.songId}`
|
||||
case "playlist":
|
||||
if (share.isFavorites) {
|
||||
return `${origin}/playlist/favorites`
|
||||
}
|
||||
return `${origin}/playlist/${share.playlistId}`
|
||||
case "artist":
|
||||
return `${origin}/artist/${share.artistId}`
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import * as Sharing from "expo-sharing"
|
||||
import { Platform, Share } from "react-native"
|
||||
|
||||
import type { MediaShareContext } from "@/lib/media-links"
|
||||
import { mediaShareUrl } from "@/lib/media-links"
|
||||
import { showError } from "@/lib/toast"
|
||||
|
||||
export async function shareMediaLink(
|
||||
serverUrl: string,
|
||||
share: MediaShareContext
|
||||
) {
|
||||
const url = mediaShareUrl(serverUrl, share)
|
||||
|
||||
try {
|
||||
if (Platform.OS === "web") {
|
||||
if (!(await Sharing.isAvailableAsync())) {
|
||||
showError("Sharing is not available on this device")
|
||||
return
|
||||
}
|
||||
await Sharing.shareAsync(url, { dialogTitle: "Share" })
|
||||
return
|
||||
}
|
||||
|
||||
await Share.share(
|
||||
Platform.OS === "ios" ? { url } : { message: url }
|
||||
)
|
||||
} catch (error) {
|
||||
if (error instanceof Error && /cancel/i.test(error.message)) {
|
||||
return
|
||||
}
|
||||
showError(error instanceof Error ? error.message : "Failed to share link")
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@convex-dev/auth": "^0.0.93",
|
||||
"@expo/ui": "~56.0.17",
|
||||
"@expo/vector-icons": "^15.0.2",
|
||||
"@otunes/convex": "workspace:*",
|
||||
"@react-native-async-storage/async-storage": "2.2.0",
|
||||
@@ -29,6 +30,7 @@
|
||||
"expo-linking": "~56.0.14",
|
||||
"expo-router": "~56.2.10",
|
||||
"expo-secure-store": "~56.0.4",
|
||||
"expo-sharing": "~56.0.18",
|
||||
"expo-status-bar": "~56.0.4",
|
||||
"expo-symbols": "~56.0.6",
|
||||
"react": "19.2.3",
|
||||
|
||||
Generated
+52
@@ -20,6 +20,9 @@ importers:
|
||||
'@convex-dev/auth':
|
||||
specifier: ^0.0.93
|
||||
version: 0.0.93(@auth/core@0.37.4)(convex@1.41.0(react@19.2.3))(react@19.2.3)
|
||||
'@expo/ui':
|
||||
specifier: ~56.0.17
|
||||
version: 56.0.17(@babel/core@7.29.7)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(expo@56.0.11)(react-dom@19.2.4(react@19.2.3))(react-native-reanimated@4.3.1(react-native-worklets@0.8.3(@babel/core@7.29.7)(@react-native/metro-config@0.86.0(@babel/core@7.29.7))(react-native@0.85.3(@babel/core@7.29.7)(@react-native/metro-config@0.86.0(@babel/core@7.29.7))(@types/react@19.2.17)(react@19.2.3))(react@19.2.3))(react-native@0.85.3(@babel/core@7.29.7)(@react-native/metro-config@0.86.0(@babel/core@7.29.7))(@types/react@19.2.17)(react@19.2.3))(react@19.2.3))(react-native-worklets@0.8.3(@babel/core@7.29.7)(@react-native/metro-config@0.86.0(@babel/core@7.29.7))(react-native@0.85.3(@babel/core@7.29.7)(@react-native/metro-config@0.86.0(@babel/core@7.29.7))(@types/react@19.2.17)(react@19.2.3))(react@19.2.3))(react-native@0.85.3(@babel/core@7.29.7)(@react-native/metro-config@0.86.0(@babel/core@7.29.7))(@types/react@19.2.17)(react@19.2.3))(react@19.2.3)
|
||||
'@expo/vector-icons':
|
||||
specifier: ^15.0.2
|
||||
version: 15.1.1(expo-font@56.0.6)(react-native@0.85.3(@babel/core@7.29.7)(@react-native/metro-config@0.86.0(@babel/core@7.29.7))(@types/react@19.2.17)(react@19.2.3))(react@19.2.3)
|
||||
@@ -68,6 +71,9 @@ importers:
|
||||
expo-secure-store:
|
||||
specifier: ~56.0.4
|
||||
version: 56.0.4(expo@56.0.11)
|
||||
expo-sharing:
|
||||
specifier: ~56.0.18
|
||||
version: 56.0.18(expo@56.0.11)(react-native@0.85.3(@babel/core@7.29.7)(@react-native/metro-config@0.86.0(@babel/core@7.29.7))(@types/react@19.2.17)(react@19.2.3))(react@19.2.3)(typescript@6.0.3)
|
||||
expo-status-bar:
|
||||
specifier: ~56.0.4
|
||||
version: 56.0.4(expo@56.0.11)(react-native@0.85.3(@babel/core@7.29.7)(@react-native/metro-config@0.86.0(@babel/core@7.29.7))(@types/react@19.2.17)(react@19.2.3))(react@19.2.3)
|
||||
@@ -942,9 +948,15 @@ packages:
|
||||
'@expo/config-plugins@56.0.8':
|
||||
resolution: {integrity: sha512-phTuyBhgVLfqUHMjQkAfRtbyoY6yTxoKja1awtpVnEkoJDxPJuXx1KX5uvq1eZtt4bJQ08OBJ6P95INqRSHpRg==}
|
||||
|
||||
'@expo/config-plugins@56.0.9':
|
||||
resolution: {integrity: sha512-/6a/S9USwx8OC9tGjHxbviLFiBHyueN3aoNWMLvWDEJoZ1CIVW800ZBzwXq/FYNK2qzcN1LxFmQtzD1zeFQKNA==}
|
||||
|
||||
'@expo/config-types@56.0.5':
|
||||
resolution: {integrity: sha512-GsAHO/MwW9ZRdgnmyfRXqVGLCP/zejD6rWnp5OROp8mBGRObKm4HfrjlUyT1skjMwCj1OrURx9ZfIc6yeBAkIA==}
|
||||
|
||||
'@expo/config-types@56.0.6':
|
||||
resolution: {integrity: sha512-4Y6Aum5J4Re5NnxGVofRNe1aDwUBOmWhQYkynZsqzRtX/zEA1ADUeyHXuEckv9YD9djiyT7bKtLt5gKL3mA6VQ==}
|
||||
|
||||
'@expo/config@56.0.9':
|
||||
resolution: {integrity: sha512-/lqFeWGSrhpKJVP8tTN8LjuoIe8u8q2w7FzBL0C+wHgl+WM8l1qUIEYWy/sMvsG/NbpUIUsDHJRhQvOkU58eIw==}
|
||||
|
||||
@@ -3807,6 +3819,13 @@ packages:
|
||||
resolution: {integrity: sha512-SmM2p2g3Jrktpiazcst+OxhjSzOHXKAY4BPURHYHXvApzzoybMmrNF4IEZ8DKZ145BhSe4ydAmlEFCRTsdtgUQ==}
|
||||
engines: {node: '>=20.16.0'}
|
||||
|
||||
expo-sharing@56.0.18:
|
||||
resolution: {integrity: sha512-45w4BWNFmdTczp+fJX6YfwJrn9sX+VeRWz2VWLhauygcCrym44HtVDXX5yVYPB9TW9ZesLcEI+CCrCBNWL7smQ==}
|
||||
peerDependencies:
|
||||
expo: '*'
|
||||
react: '*'
|
||||
react-native: '*'
|
||||
|
||||
expo-status-bar@56.0.4:
|
||||
resolution: {integrity: sha512-IGs/fDfkHXofy2ZQrGiXayhFK04HB85FZXorhcEhDZEcqASKgSqpak+HwUtAaR0MeTJwWyHNF7I6VmVbbp8EcA==}
|
||||
peerDependencies:
|
||||
@@ -7100,8 +7119,29 @@ snapshots:
|
||||
- supports-color
|
||||
- typescript
|
||||
|
||||
'@expo/config-plugins@56.0.9(typescript@6.0.3)':
|
||||
dependencies:
|
||||
'@expo/config-types': 56.0.6
|
||||
'@expo/json-file': 10.2.0
|
||||
'@expo/plist': 0.7.0
|
||||
'@expo/require-utils': 56.1.3(typescript@6.0.3)
|
||||
'@expo/sdk-runtime-versions': 1.0.0
|
||||
chalk: 4.1.2
|
||||
debug: 4.4.3
|
||||
getenv: 2.0.0
|
||||
glob: 13.0.6
|
||||
semver: 7.8.4
|
||||
slugify: 1.6.9
|
||||
xcode: 3.0.1
|
||||
xml2js: 0.6.0
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
- typescript
|
||||
|
||||
'@expo/config-types@56.0.5': {}
|
||||
|
||||
'@expo/config-types@56.0.6': {}
|
||||
|
||||
'@expo/config@56.0.9(typescript@6.0.3)':
|
||||
dependencies:
|
||||
'@expo/config-plugins': 56.0.8(typescript@6.0.3)
|
||||
@@ -10557,6 +10597,18 @@ snapshots:
|
||||
|
||||
expo-server@56.0.5: {}
|
||||
|
||||
expo-sharing@56.0.18(expo@56.0.11)(react-native@0.85.3(@babel/core@7.29.7)(@react-native/metro-config@0.86.0(@babel/core@7.29.7))(@types/react@19.2.17)(react@19.2.3))(react@19.2.3)(typescript@6.0.3):
|
||||
dependencies:
|
||||
'@expo/config-plugins': 56.0.9(typescript@6.0.3)
|
||||
'@expo/config-types': 56.0.6
|
||||
'@expo/plist': 0.7.0
|
||||
expo: 56.0.11(@babel/core@7.29.7)(@expo/dom-webview@56.0.5)(@expo/metro-runtime@56.0.15)(expo-router@56.2.10)(react-dom@19.2.4(react@19.2.3))(react-native-worklets@0.8.3(@babel/core@7.29.7)(@react-native/metro-config@0.86.0(@babel/core@7.29.7))(react-native@0.85.3(@babel/core@7.29.7)(@react-native/metro-config@0.86.0(@babel/core@7.29.7))(@types/react@19.2.17)(react@19.2.3))(react@19.2.3))(react-native@0.85.3(@babel/core@7.29.7)(@react-native/metro-config@0.86.0(@babel/core@7.29.7))(@types/react@19.2.17)(react@19.2.3))(react@19.2.3)(typescript@6.0.3)
|
||||
react: 19.2.3
|
||||
react-native: 0.85.3(@babel/core@7.29.7)(@react-native/metro-config@0.86.0(@babel/core@7.29.7))(@types/react@19.2.17)(react@19.2.3)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
- typescript
|
||||
|
||||
expo-status-bar@56.0.4(expo@56.0.11)(react-native@0.85.3(@babel/core@7.29.7)(@react-native/metro-config@0.86.0(@babel/core@7.29.7))(@types/react@19.2.17)(react@19.2.3))(react@19.2.3):
|
||||
dependencies:
|
||||
expo: 56.0.11(@babel/core@7.29.7)(@expo/dom-webview@56.0.5)(@expo/metro-runtime@56.0.15)(expo-router@56.2.10)(react-dom@19.2.4(react@19.2.3))(react-native-worklets@0.8.3(@babel/core@7.29.7)(@react-native/metro-config@0.86.0(@babel/core@7.29.7))(react-native@0.85.3(@babel/core@7.29.7)(@react-native/metro-config@0.86.0(@babel/core@7.29.7))(@types/react@19.2.17)(react@19.2.3))(react@19.2.3))(react-native@0.85.3(@babel/core@7.29.7)(@react-native/metro-config@0.86.0(@babel/core@7.29.7))(@types/react@19.2.17)(react@19.2.3))(react@19.2.3)(typescript@6.0.3)
|
||||
|
||||
Reference in new issue
Block a user