<?php
/**
 * Universal Bricks style controls shared by every element (level 1).
 *
 * @package LolaCoreForBricks
 */

declare(strict_types=1);

namespace LolaCoreForBricks\Support;

/**
 * Writable keys from Bricks elements/base.php, excluding separators and info-only rows.
 */
final class UniversalControls
{
    /**
     * @var string[]
     */
    private const KEYS = [
        '_content',
        '_margin',
        '_padding',
        '_width',
        '_widthMin',
        '_widthMax',
        '_height',
        '_heightMin',
        '_heightMax',
        '_aspectRatio',
        '_position',
        '_top',
        '_right',
        '_bottom',
        '_left',
        '_zIndex',
        '_order',
        '_display',
        '_visibility',
        '_overflow',
        '_opacity',
        '_cursor',
        '_isolation',
        '_mixBlendMode',
        '_pointerEvents',
        '_perspective',
        '_perspectiveOrigin',
        '_gridItemJustifySelf',
        '_flexDirection',
        '_alignSelf',
        '_justifyContent',
        '_alignItems',
        '_gap',
        '_flexGrow',
        '_flexShrink',
        '_flexBasis',
        '_useMasonry',
        '_masonryColumn',
        '_masonryGutter',
        '_masonryHorizontalOrder',
        '_masonryTransitionDuration',
        '_masonryTransitionMode',
        '_typography',
        '_background',
        '_shapeDividers',
        '_gradient',
        '_border',
        '_boxShadow',
        '_transform',
        '_transformOrigin',
        '_motionElementParallax',
        '_motionElementParallaxSpeedX',
        '_motionElementParallaxSpeedY',
        '_motionBackgroundParallax',
        '_motionBackgroundParallaxSpeed',
        '_motionStartVisiblePercent',
        '_cssCustom',
        '_cssClasses',
        '_cssId',
        '_cssFilters',
        '_cssTransition',
        '_attributes',
        '_animation',
        '_animationDuration',
        '_animationDurationCustom',
        '_animationDelay',
    ];

    /**
     * @return string[]
     */
    public static function keys(): array
    {
        return self::KEYS;
    }

    public static function isUniversal(string $baseKey): bool
    {
        return in_array($baseKey, self::KEYS, true);
    }
}
