<?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_action attribute for plugin discovery.
 *
 * Plugin Namespace: Plugin\MapAction.
 *
 * @see \Drupal\simple_interactive_maps\MapActionPluginManager
 * @see \Drupal\simple_interactive_maps\MapActionInterface
 * @see \Drupal\simple_interactive_maps\MapActionPluginBase
 * @see plugin_api
 */
#[\Attribute(\Attribute::TARGET_CLASS)]
final class MapAction extends Plugin {

  /**
   * Constructs a MapAction 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 $is_system
   *   (optional) Flag to make the plugin not visible to users.
   * @param int $weight
   *   (optional) Default weight for ordering plugins in 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 $is_system = FALSE,
    public readonly int $weight = 0,
    ?string $deriver = NULL,
  ) {
    parent::__construct($id, $deriver);
  }

}
