<?php
/** Narrow, live-schema-bound attribute policy for supported builder blocks. */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * This list models only the empirically verified product surface. Every value
 * is additionally checked against the live server-side WP_Block_Type schema.
 *
 * @return array<string,array<string,array<string,array<string,mixed>>>>
 */
function wpagent_builder_block_attribute_policy(): array {
	return array(
		'generateblocks' => array(
			'generateblocks/query-page-numbers' => array(
				'midSize' => array( 'type' => 'integer', 'minimum' => 0, 'maximum' => 10 ),
				'tagName' => array( 'type' => 'string', 'values' => array( 'div', 'section', 'nav' ) ),
			),
			'generateblocks/query' => array(
				'paginationType' => array( 'type' => 'string', 'values' => array( 'standard', 'instant' ) ),
				'tagName' => array( 'type' => 'string', 'values' => array( 'div', 'section', 'article', 'aside', 'header', 'footer', 'nav', 'main' ) ),
			),
			'generateblocks/text' => array(
				'tagName' => array( 'type' => 'string', 'values' => array( 'p', 'span', 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ) ),
			),
			'generateblocks/element' => array(
				'tagName' => array( 'type' => 'string', 'values' => array( 'div', 'section', 'article', 'aside', 'main' ) ),
			),
		),
		'kadence' => array(
			'kadence/advancedheading' => array(
				'level' => array( 'type' => 'integer', 'minimum' => 1, 'maximum' => 6 ),
				'align' => array( 'type' => 'string', 'values' => array( 'left', 'center', 'right' ) ),
				'tabletAlign' => array( 'type' => 'string', 'values' => array( 'left', 'center', 'right' ) ),
				'mobileAlign' => array( 'type' => 'string', 'values' => array( 'left', 'center', 'right' ) ),
				'textTransform' => array( 'type' => 'string', 'values' => array( 'none', 'capitalize', 'uppercase', 'lowercase' ) ),
				'fontStyle' => array( 'type' => 'string', 'values' => array( 'normal', 'italic', 'oblique' ) ),
				'fontWeight' => array( 'type' => 'string', 'values' => array( '100', '200', '300', '400', '500', '600', '700', '800', '900' ) ),
				'size' => array( 'type' => 'integer', 'minimum' => 8, 'maximum' => 200 ),
				'tabSize' => array( 'type' => 'integer', 'minimum' => 8, 'maximum' => 200 ),
				'mobileSize' => array( 'type' => 'integer', 'minimum' => 8, 'maximum' => 200 ),
				'sizeType' => array( 'type' => 'string', 'values' => array( 'px' ) ),
				'lineHeight' => array( 'type' => 'number', 'minimum' => 8, 'maximum' => 300 ),
				'tabLineHeight' => array( 'type' => 'number', 'minimum' => 8, 'maximum' => 300 ),
				'mobileLineHeight' => array( 'type' => 'number', 'minimum' => 8, 'maximum' => 300 ),
				'lineType' => array( 'type' => 'string', 'values' => array( 'px' ) ),
				'letterSpacing' => array( 'type' => 'number', 'minimum' => -10, 'maximum' => 50 ),
				'tabletLetterSpacing' => array( 'type' => 'number', 'minimum' => -10, 'maximum' => 50 ),
				'mobileLetterSpacing' => array( 'type' => 'number', 'minimum' => -10, 'maximum' => 50 ),
				'letterSpacingType' => array( 'type' => 'string', 'values' => array( 'px' ) ),
				'topMargin' => array( 'type' => 'number', 'minimum' => -500, 'maximum' => 500 ),
				'rightMargin' => array( 'type' => 'number', 'minimum' => -500, 'maximum' => 500 ),
				'bottomMargin' => array( 'type' => 'number', 'minimum' => -500, 'maximum' => 500 ),
				'leftMargin' => array( 'type' => 'number', 'minimum' => -500, 'maximum' => 500 ),
				'marginType' => array( 'type' => 'string', 'values' => array( 'px' ) ),
				'color' => array( 'type' => 'string', 'pattern' => '/^#[a-f0-9]{6}$/Di' ),
				'background' => array( 'type' => 'string', 'pattern' => '/^#[a-f0-9]{6}$/Di' ),
				'iconColor' => array( 'type' => 'string', 'pattern' => '/^#[a-f0-9]{6}$/Di' ),
				'iconColorHover' => array( 'type' => 'string', 'pattern' => '/^#[a-f0-9]{6}$/Di' ),
				'iconSide' => array( 'type' => 'string', 'values' => array( 'left', 'right' ) ),
				'iconVerticalAlign' => array( 'type' => 'string', 'values' => array( 'flex-start', 'center', 'flex-end' ) ),
			),
			'kadence/spacer' => array(
				'spacerHeight' => array( 'type' => 'integer', 'minimum' => 1, 'maximum' => 2000 ),
				'tabletSpacerHeight' => array( 'type' => 'integer', 'minimum' => 1, 'maximum' => 2000 ),
				'mobileSpacerHeight' => array( 'type' => 'integer', 'minimum' => 1, 'maximum' => 2000 ),
				'spacerHeightUnits' => array( 'type' => 'string', 'values' => array( 'px', 'rem', 'vh' ) ),
				'dividerStyle' => array( 'type' => 'string', 'values' => array( 'solid', 'dashed', 'dotted' ) ),
				'dividerOpacity' => array( 'type' => 'integer', 'minimum' => 0, 'maximum' => 100 ),
				'dividerColor' => array( 'type' => 'string', 'pattern' => '/^#[a-f0-9]{6}$/Di' ),
				'dividerWidth' => array( 'type' => 'integer', 'minimum' => 1, 'maximum' => 3000 ),
				'dividerWidthUnits' => array( 'type' => 'string', 'values' => array( 'px', '%' ) ),
				'tabletDividerWidth' => array( 'type' => 'integer', 'minimum' => 1, 'maximum' => 3000 ),
				'mobileDividerWidth' => array( 'type' => 'integer', 'minimum' => 1, 'maximum' => 3000 ),
			),
			'kadence/progress-bar' => array(
				'hAlign' => array( 'type' => 'string', 'values' => array( 'space-between', 'center', 'left', 'right' ) ),
				'thAlign' => array( 'type' => 'string', 'values' => array( 'space-between', 'center', 'left', 'right' ) ),
				'mhAlign' => array( 'type' => 'string', 'values' => array( 'space-between', 'center', 'left', 'right' ) ),
				'progressAmount' => array( 'type' => 'integer', 'minimum' => 0, 'maximum' => 100 ),
				'progressMax' => array( 'type' => 'integer', 'minimum' => 1, 'maximum' => 100 ),
				'progressWidth' => array( 'type' => 'integer', 'minimum' => 1, 'maximum' => 20 ),
				'progressWidthTablet' => array( 'type' => 'integer', 'minimum' => 1, 'maximum' => 20 ),
				'progressWidthMobile' => array( 'type' => 'integer', 'minimum' => 1, 'maximum' => 20 ),
				'progressColor' => array( 'type' => 'string', 'pattern' => '/^#[a-f0-9]{6}$/Di' ),
				'barBackground' => array( 'type' => 'string', 'pattern' => '/^#[a-f0-9]{6}$/Di' ),
				'displayLabel' => array( 'type' => 'boolean' ),
				'label' => array( 'type' => 'string', 'pattern' => '/\A[^\x00-\x1F\x7F<>{}]{0,200}\z/uD' ),
				'ariaLabel' => array( 'type' => 'string', 'pattern' => '/\A[^\x00-\x1F\x7F<>{}]{0,200}\z/uD' ),
				'numberPrefix' => array( 'type' => 'string', 'pattern' => '/\A[^\x00-\x1F\x7F<>{}]{0,80}\z/uD' ),
				'numberSuffix' => array( 'type' => 'string', 'pattern' => '/\A[^\x00-\x1F\x7F<>{}]{0,80}\z/uD' ),
				'labelPosition' => array( 'type' => 'string', 'values' => array( 'above', 'inside', 'below' ) ),
				'decimal' => array( 'type' => 'string', 'values' => array( 'none', 'one', 'two' ) ),
			),
			'kadence/countup' => array(
				'start' => array( 'type' => 'number', 'minimum' => -1000000, 'maximum' => 1000000 ),
				'end' => array( 'type' => 'number', 'minimum' => -1000000, 'maximum' => 1000000 ),
				'duration' => array( 'type' => 'number', 'minimum' => 0.1, 'maximum' => 60 ),
				'prefix' => array( 'type' => 'string', 'pattern' => '/\A[^\x00-\x1F\x7F<>{}]{0,40}\z/uD' ),
				'suffix' => array( 'type' => 'string', 'pattern' => '/\A[^\x00-\x1F\x7F<>{}]{0,40}\z/uD' ),
				'separator' => array( 'type' => 'string', 'values' => array( '', ',', '.', ' ' ) ),
				'decimal' => array( 'type' => 'string', 'values' => array( '', '.', ',' ) ),
				'decimalSpaces' => array( 'type' => 'integer', 'minimum' => 0, 'maximum' => 6 ),
				'numberColor' => array( 'type' => 'string', 'pattern' => '/^#[a-f0-9]{6}$/Di' ),
			),
		),
	);
}
