| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Modules\AtomicWidgets\PlainResolvers; |
| 4 |
|
| 5 |
if ( ! defined( 'ABSPATH' ) ) { |
| 6 |
exit; |
| 7 |
} |
| 8 |
|
| 9 |
/** |
| 10 |
* Converts a plain LLM-supplied value into a form the walker can attach to a `Prop_Type` tree. |
| 11 |
* |
| 12 |
* Implementations MAY return either: |
| 13 |
* - A **raw value** (scalar or shape-only array) — leaves like `String`, `Number`, `Html_V3` |
| 14 |
* do this. `Plain_Values_Resolver::normalize_resolver_output` will wrap the result with |
| 15 |
* `Prop_Type::generate()` to produce the `{ $$type, value }` envelope. |
| 16 |
* - A **fully-formed envelope** (`[ '$$type' => ..., 'value' => ... ]`) — composite resolvers like |
| 17 |
* `Dynamic` do this when the resolver alone knows the exact key/shape and short-circuits the walker. |
| 18 |
* |
| 19 |
* Return `null` to signal that the input can't be resolved for this prop type; the walker will |
| 20 |
* treat it as a skip (or drop the field from the parent object/array). |
| 21 |
*/ |
| 22 |
abstract class Plain_Resolver_Base { |
| 23 |
abstract public function resolve( $plain_value ); |
| 24 |
} |
| 25 |
|