<?php

namespace Mtc\Plugins\BlockManager\Http\Controllers;

use Illuminate\Http\JsonResponse;
use Illuminate\Routing\Controller;
use Mtc\Plugins\BlockManager\Services\DesignTokenService;

/**
 * Read-only JSON endpoint exposing design tokens parsed from
 * sites/default/css/variables.less. Consumed by the Designer view's
 * property-panel token pickers.
 */
class DesignTokenController extends Controller
{
    public function __construct(private DesignTokenService $tokens)
    {
    }

    public function index(): JsonResponse
    {
        return response()->json(['data' => $this->tokens->list()]);
    }
}
