| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Modules\AtomicWidgets\CssConverter\Converters; |
| 4 |
|
| 5 |
use Elementor\Modules\AtomicWidgets\CssConverter\Conversion_Context; |
| 6 |
use Elementor\Modules\AtomicWidgets\CssConverter\Property_Converter_Base; |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; // Exit if accessed directly. |
| 10 |
} |
| 11 |
|
| 12 |
/** |
| 13 |
* Claims a property and unconditionally rejects it: the declaration is added to the `rejected` |
| 14 |
* bucket instead of `customCss`. Used for properties that are structurally incompatible with |
| 15 |
* Elementor's style system (e.g. `animation`, `@keyframes`), so the client can surface a hint |
| 16 |
* to the LLM rather than silently emitting broken CSS. |
| 17 |
*/ |
| 18 |
class Rejected_Converter extends Property_Converter_Base { |
| 19 |
private string $property; |
| 20 |
|
| 21 |
public function __construct( string $property ) { |
| 22 |
$this->property = $property; |
| 23 |
} |
| 24 |
|
| 25 |
protected function get_supported_properties(): array { |
| 26 |
return [ $this->property ]; |
| 27 |
} |
| 28 |
|
| 29 |
protected function do_convert( Conversion_Context $context, array $rule ): bool { |
| 30 |
$context->reject( $rule['declaration'] . ';' ); |
| 31 |
|
| 32 |
return true; |
| 33 |
} |
| 34 |
} |
| 35 |
|