diff --git a/web-player/src/lib/components/music/library/CoauthorsDialog.svelte b/web-player/src/lib/components/music/library/CoauthorsDialog.svelte new file mode 100644 index 0000000..11cce62 --- /dev/null +++ b/web-player/src/lib/components/music/library/CoauthorsDialog.svelte @@ -0,0 +1,214 @@ + + + +

+ Los usuarios que invites aparecerán como coautores cuando acepten la invitación. +

+ + {#if error} + {error} + {/if} + +
+ {#if invites.length > 0} + + {:else} +

Todavía no has invitado a nadie.

+ {/if} +
+ +
+ + {#each selected as user (user.id)} + + {/each} + + ({ id: user.id, label: user.name }))} + bind:value={search} + oninput={onSearchInput} + onadd={() => { + if (candidates.length > 0) select(candidates[0]); + }} + onremove={deselect} + /> +
    + {#each candidates as user (user.id)} +
  • + +
  • + {/each} +
+
+ + +
+ +
diff --git a/web-player/src/lib/components/music/library/LibraryTracksSection.svelte b/web-player/src/lib/components/music/library/LibraryTracksSection.svelte index 0638b96..71cc45b 100644 --- a/web-player/src/lib/components/music/library/LibraryTracksSection.svelte +++ b/web-player/src/lib/components/music/library/LibraryTracksSection.svelte @@ -32,6 +32,7 @@ import SearchInput from '$lib/components/ui/primitives/SearchInput.svelte'; import ChipGroup from '$lib/components/ui/primitives/ChipGroup.svelte'; import ConfirmDialog from '$lib/components/ui/overlay/ConfirmDialog.svelte'; + import CoauthorsDialog from '$lib/components/music/library/CoauthorsDialog.svelte'; import ManageTrackList from '$lib/components/music/library/ManageTrackList.svelte'; interface Props { @@ -65,6 +66,8 @@ let publishValue = $state('true'); let timer: ReturnType | undefined; + let coauthorTrackId = $state(''); + let coauthorsOpen = $state(false); let hiddenIds = $state([]); let overrides = $state>({}); let deleteError = $state(''); @@ -162,6 +165,7 @@ }; }; + const coauthorTrack = $derived(items.find((track) => track.id === coauthorTrackId)); const hasFilters = $derived(query !== '' || filter !== 'all'); const counters = $derived(filterCounts(counts)); const filterOptions = $derived( @@ -206,6 +210,11 @@ else publish([track]); } + function openCoauthors(track: LibraryTrack) { + coauthorTrackId = track.id; + coauthorsOpen = true; + } + function unpublishSelected() { pendingUnpublish = selected.filter((track) => track.published); } @@ -274,6 +283,7 @@ bind:selectedIds onPlay={togglePlay} onPublish={requestToggle} + onCoauthors={openCoauthors} onDelete={(track) => (pendingDelete = [track])} /> {/if} +{#if coauthorTrack} + (coauthorsOpen = false)} + track={coauthorTrack} + /> +{/if} + 0} onClose={() => { diff --git a/web-player/src/lib/components/music/library/ManageTrackList.svelte b/web-player/src/lib/components/music/library/ManageTrackList.svelte index f62ed51..1ad357e 100644 --- a/web-player/src/lib/components/music/library/ManageTrackList.svelte +++ b/web-player/src/lib/components/music/library/ManageTrackList.svelte @@ -18,12 +18,14 @@ class: `${TEXT} tabular-nums` }, { id: 'publish', width: COL.publish }, + { id: 'coauthors', width: COL.action, mobile: COL.actionMobile }, { id: 'delete', width: COL.action, mobile: COL.actionMobile } ];