<?php

declare(strict_types=1);

namespace Drupal\simple_interactive_maps\Attribute;

use Drupal\Component\Plugin\Attribute\Plugin;
use Drupal\Core\StringTranslation\TranslatableMarkup;

/**
 * Defines a map_definition attribute for plugin discovery.
 *
 * Plugin Namespace: Plugin\MapDefinition.
 *
 * @see \Drupal\simple_interactive_maps\MapDefinitionPluginManager
 * @see \Drupal\simple_interactive_maps\MapDefinitionInterface
 * @see \Drupal\simple_interactive_maps\MapDefinitionPluginBase
 * @see plugin_api
 */
#[\Attribute(\Attribute::TARGET_CLASS)]
final class MapDefinition extends Plugin {

  /**
   * Constructs a MapDefinition attribute.
   *
   * @param string $id
   *   The plugin ID.
   * @param \Drupal\Core\StringTranslation\TranslatableMarkup $label
   *   The human-readable name of the plugin.
   * @param \Drupal\Core\StringTranslation\TranslatableMarkup $description
   *   The description of the plugin.
   * @param bool $uses_default_tooltip
   *   (optional) Flag to indicate if the map sets up a default tooltip on
   *   creation.
   * @param string $default_tooltip
   *   (optional) The default tooltip text.
   * @param string $map_category
   *   (optional) Category for grouping maps within the UI.
   * @param class-string|null $deriver
   *   (optional) The deriver class.
   */
  public function __construct(
    string $id,
    public readonly TranslatableMarkup $label,
    public readonly TranslatableMarkup $description,
    public readonly bool $uses_default_tooltip = FALSE,
    public readonly string $default_tooltip = '',
    public readonly string $map_category = '',
    ?string $deriver = NULL,
  ) {
    parent::__construct($id, $deriver);
  }

}
