<?php

declare(strict_types=1);

namespace Drupal\flowdrop_session\Constants;

/**
 * Allowed values for server-emitted playground message annotations.
 *
 * Mirrors the contract published by @flowdrop/flowdrop 1.13.0:
 * - `hierarchy`: ordered path rendered as a chevron-separated trail
 *   (e.g. workflow > sub-workflow > iteration).
 * - `tags`: classification chips with closed-enum color and variant.
 * - `display`: layout hint that overrides the role-based default.
 *
 * Values outside these enums are dropped silently by the wire
 * serializer rather than rejected, so an older or malformed emitter
 * cannot break the playground response.
 *
 * @internal
 */
final class MessageAnnotation {

  public const DISPLAY_BUBBLE = 'bubble';
  public const DISPLAY_LOG = 'log';
  public const DISPLAY_NOTICE = 'notice';
  public const DISPLAY_CARD = 'card';

  public const DISPLAYS = [
    self::DISPLAY_BUBBLE,
    self::DISPLAY_LOG,
    self::DISPLAY_NOTICE,
    self::DISPLAY_CARD,
  ];

  public const COLOR_MUTED = 'muted';
  public const COLOR_PRIMARY = 'primary';
  public const COLOR_SUCCESS = 'success';
  public const COLOR_WARNING = 'warning';
  public const COLOR_ERROR = 'error';
  public const COLOR_INFO = 'info';

  public const COLORS = [
    self::COLOR_MUTED,
    self::COLOR_PRIMARY,
    self::COLOR_SUCCESS,
    self::COLOR_WARNING,
    self::COLOR_ERROR,
    self::COLOR_INFO,
  ];

  public const VARIANT_SOLID = 'solid';
  public const VARIANT_OUTLINE = 'outline';
  public const VARIANT_SUBTLE = 'subtle';

  public const VARIANTS = [
    self::VARIANT_SOLID,
    self::VARIANT_OUTLINE,
    self::VARIANT_SUBTLE,
  ];

  /**
   * Metadata key carrying the hierarchy trail before the serializer lifts it.
   */
  public const METADATA_KEY_HIERARCHY = 'hierarchy';

  /**
   * Metadata key that carries the classification tag list.
   */
  public const METADATA_KEY_TAGS = 'tags';

  /**
   * Metadata key that carries the layout hint.
   */
  public const METADATA_KEY_DISPLAY = 'display';

}
