Merged in feature/117-dev-dev01 (pull request #8)
auto-patch 117-dev-dev01-2023-12-15T16_09_06 * auto-patch 117-dev-dev01-2023-12-15T16_09_06
This commit is contained in:
@@ -31,6 +31,11 @@ interface BlockInterface {
|
||||
*/
|
||||
public const HIDE_CONDITIONS_KEY = 'hideConditions';
|
||||
|
||||
/**
|
||||
* Key for the block disable conditions in the block configuration.
|
||||
*/
|
||||
public const DISABLE_CONDITIONS_KEY = 'disableConditions';
|
||||
|
||||
/**
|
||||
* Get the block name.
|
||||
*/
|
||||
@@ -110,6 +115,29 @@ interface BlockInterface {
|
||||
*/
|
||||
public function get_hide_conditions(): array;
|
||||
|
||||
/**
|
||||
* Add a disable condition to the block.
|
||||
*
|
||||
* The disable condition is a JavaScript-like expression that will be evaluated on the client to determine if the block should be disabled.
|
||||
* See [@woocommerce/expression-evaluation](https://github.com/woocommerce/woocommerce/blob/trunk/packages/js/expression-evaluation/README.md) for more details.
|
||||
*
|
||||
* @param string $expression An expression, which if true, will disable the block.
|
||||
* @return string The key of the disable condition, which can be used to remove the disable condition.
|
||||
*/
|
||||
public function add_disable_condition( string $expression ): string;
|
||||
|
||||
/**
|
||||
* Remove a disable condition from the block.
|
||||
*
|
||||
* @param string $key The key of the disable condition to remove.
|
||||
*/
|
||||
public function remove_disable_condition( string $key );
|
||||
|
||||
/**
|
||||
* Get the disable conditions of the block.
|
||||
*/
|
||||
public function get_disable_conditions(): array;
|
||||
|
||||
/**
|
||||
* Get the block configuration as a formatted template.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user