<?php
/**
 * Global registration function for block presets.
 * Callable from any theme or plugin.
 *
 * Usage:
 *   if ( function_exists( 'brandy_register_block_preset' ) ) {
 *       brandy_register_block_preset( 'brandy/carousel', array(
 *           'name'    => 'product-slider',
 *           'title'   => 'Product Slider',
 *           'content' => '<!-- wp:brandy/carousel ... -->',
 *       ) );
 *   }
 *
 * @package Brandy\BlockSettings\BlockPresets
 */

if ( ! function_exists( 'brandy_register_block_preset' ) ) {
	/**
	 * Register a preset for a block type.
	 *
	 * @param string $block_name Block name (e.g., 'brandy/carousel', 'core/group').
	 * @param array  $preset {
	 *     Preset configuration.
	 *     @type string $name          Required. Unique preset slug.
	 *     @type string $content       Required. Block markup string.
	 *     @type string $title         Optional. Display title. Defaults to name.
	 *     @type string $description   Optional. Short description.
	 *     @type int    $viewportWidth Optional. Preview viewport width. Default 1200.
	 * }
	 */
	function brandy_register_block_preset( $block_name, $preset ) {
		\Brandy\BlockSettings\BlockPresets\Caller::register_preset( $block_name, $preset );
	}
}
