sync: update from private repo (6fcb0d0)

This commit is contained in:
oss-sync
2026-06-04 03:03:12 +00:00
parent 21be01b699
commit 57685d995c
36 changed files with 2467 additions and 391 deletions
+8 -3
View File
@@ -6,10 +6,15 @@ export function usePieceList() {
return useQuery({ queryKey: ['pieces'], queryFn: fetchPieces, staleTime: STALE_TIME.SEMI_STATIC });
}
export function usePiece(name: string | undefined) {
/**
* Fetches a single piece by name (and optional source).
* Returns the full PieceFetchResult so callers can use the server-resolved source
* for authorization decisions (e.g. read-only gate in PieceEditor).
*/
export function usePiece(name: string | undefined, source?: 'builtin' | 'user-custom' | 'global-custom') {
return useQuery({
queryKey: ['piece', name],
queryFn: () => fetchPiece(name!),
queryKey: ['piece', name, source],
queryFn: () => fetchPiece(name!, source),
enabled: !!name,
staleTime: STALE_TIME.SEMI_STATIC,
});