<?php
declare(strict_types=1);

namespace PpPhp\Core\Designer\Visual;

final class DesignerSelectionOverlayRuntime
{
    public function states(): array
    {
        return [
            'hover' => ['class' => 'designer-hover', 'outline' => '1px solid rgba(37,99,235,.35)'],
            'selected' => ['class' => 'designer-selected', 'outline' => '2px solid #2563eb'],
            'parent' => ['class' => 'designer-parent', 'outline' => '1px dashed #94a3b8'],
            'dropTarget' => ['class' => 'designer-drop-target', 'outline' => '2px dashed #16a34a'],
        ];
    }

    public function target(string $id, string $type, array $parentPath = []): array
    {
        return [
            'id' => $id,
            'type' => $type,
            'parentPath' => $parentPath,
            'selector' => '[data-designer-id="' . $id . '"]',
            'states' => $this->states(),
            'classes' => [
                'base' => 'designer-selectable',
                'selected' => 'designer-selected',
                'hover' => 'designer-hover',
                'parent' => 'designer-parent',
                'dropTarget' => 'designer-drop-target',
            ],
        ];
    }
}
