This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,7 +143,6 @@ | |
left: 0; | ||
right: 0; | ||
position: absolute; | ||
color: #000; | ||
white-space: nowrap; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
namespace Automattic\WooCommerce\Blocks\BlockTypes; | ||
|
||
/** | ||
* ProductRating class. | ||
*/ | ||
class ProductRating extends AbstractBlock { | ||
|
||
/** | ||
* Block name. | ||
* | ||
* @var string | ||
*/ | ||
protected $block_name = 'product-rating'; | ||
|
||
/** | ||
* API version name. | ||
* | ||
* @var string | ||
*/ | ||
protected $api_version = '2'; | ||
|
||
/** | ||
* Get the editor script handle for this block type. | ||
* | ||
* @param string $key Data to get, or default to everything. | ||
* @return array|string; | ||
*/ | ||
protected function get_block_type_editor_script( $key = null ) { | ||
$script = [ | ||
'handle' => 'wc-' . $this->block_name . '-block', | ||
'path' => $this->asset_api->get_block_asset_build_path( 'atomic-block-components/rating' ), | ||
'dependencies' => [ 'wc-blocks' ], | ||
]; | ||
return $key ? $script[ $key ] : $script; | ||
} | ||
|
||
/** | ||
* Get block supports. Shared with the frontend. | ||
* IMPORTANT: If you change anything here, make sure to update the JS file too. | ||
* | ||
* @return array | ||
*/ | ||
protected function get_block_type_supports() { | ||
return array( | ||
'color' => | ||
array( | ||
'text' => true, | ||
'background' => false, | ||
'link' => false, | ||
), | ||
'__experimentalSelector' => '.wc-block-components-product-rating', | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters