woocommerce/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements
Manish Menaria c497190936 Product SKU: Adds support for color, typography, and spacing (https://github.com/woocommerce/woocommerce-blocks/pull/8913)
* Add color, typography, and spacing support to Product SKU block

This commit introduces a new file `supports.ts` for the Product SKU block in the WooCommerce Blocks plugin, which adds color, typography, and spacing support. The following configuration has been added:

1. In `assets/js/atomic/blocks/product-elements/sku/supports.ts`, a new `supports` object is created, which extends the shared configuration and adds support for the following properties:
  - `text` and `background` color
  - `fontSize`, `lineHeight`, `__experimentalFontWeight`, `__experimentalFontFamily`, `__experimentalFontStyle`, `__experimentalTextTransform`, `__experimentalTextDecoration`, and `__experimentalLetterSpacing` for typography
  - `margin` and `padding` for spacing

* Add color, typography, and spacing support for Product SKU block in All Products block

This commit extends the support for color, typography, and spacing to the Product SKU block when used within the All Products block. The following changes have been made:

1. In `assets/js/atomic/blocks/product-elements/sku/block.tsx`, the `useColorProps`, `useSpacingProps`, and `useTypographyProps` hooks are imported and used to add the appropriate className and style properties to the rendered SKU element.
2. In `assets/js/atomic/blocks/product-elements/sku/edit.tsx`, the `style` property is separated from `useBlockProps()` and used directly on the `div` element for the SKU block.

* Add server-side rendering class for Product SKU Gutenberg block

This commit adds the ".wp-block-woocommerce-product-sku" class to the Product SKU Gutenberg block for server-side rendering purposes. The inclusion of this class ensures consistent styling between the editor and the front-end view of the block, providing a seamless experience for users.

The class name is generated based on the Gutenberg block prefix "wp-block", the namespace "woocommerce", and the block name "product-sku", creating a unique and identifiable class for the block. This class enables developers to target the block specifically in both the editor and front-end styles, maintaining the integrity of the block's appearance and functionality across different environments.

By adding this class to the server-side rendered version of the block, we ensure a unified and coherent styling experience throughout the block's usage.

* Fix minor issues

* Gate only experimental features behind isFeaturePluginBuild flag

This commit refactors the Product SKU block supports to enable color, typography, and spacing features for all builds, while keeping experimental features specific to the feature plugin build. It also adds necessary lint and TypeScript error handling for the experimental spacing API.

* Add overflow-wrap to Product SKU block and update comment

This commit adds the overflow-wrap property to the Product SKU block styles to handle long SKU values gracefully.
It also updates the comment for the experimental spacing API to better reflect the usage check.

* Refactor Product SKU block classname and style handling

This commit refactors the Product SKU block classname and style handling. It combines classnames for better readability and removes the hardcoded textTransform style in favor of default styles.
This also fix the issue where textTransform style was not working as expected.
2023-04-06 11:30:27 +05:30
..
add-to-cart Replace react imports with wordpress/element (https://github.com/woocommerce/woocommerce-blocks/pull/8520) 2023-03-02 15:26:00 +01:00
add-to-cart-form Add to Cart Form: Replace Notice with Skeleton component (https://github.com/woocommerce/woocommerce-blocks/pull/8842) 2023-04-05 09:38:58 -03:00
button Add more Inspector controls for Product(Add to cart) button (https://github.com/woocommerce/woocommerce-blocks/pull/8781) 2023-03-24 12:38:43 +05:30
image Add padding support for `Product Image` block (https://github.com/woocommerce/woocommerce-blocks/pull/8895) 2023-03-30 12:35:32 +05:30
price Product Price: support for background color, line height, font family, letter spacing, and padding (https://github.com/woocommerce/woocommerce-blocks/pull/8906) 2023-04-04 10:08:45 +00:00
product-details Add default Single Product HTML template (https://github.com/woocommerce/woocommerce-blocks/pull/8515) 2023-03-22 15:00:48 +00:00
product-image-gallery Prevent image placeholder from going outside its wrapper (https://github.com/woocommerce/woocommerce-blocks/pull/8901) 2023-03-31 14:36:17 -03:00
product-meta Add Product Meta Block (https://github.com/woocommerce/woocommerce-blocks/pull/8484) 2023-03-09 09:42:40 +01:00
product-reviews Add Product Reviews block (https://github.com/woocommerce/woocommerce-blocks/pull/8857) 2023-03-28 19:14:13 +02:00
rating Use shared save function for all the product elements blocks (https://github.com/woocommerce/woocommerce-blocks/pull/8813) 2023-03-22 11:52:50 +00:00
related-products Related Products: Move Notice block to the Inspector Control section (https://github.com/woocommerce/woocommerce-blocks/pull/8843) 2023-03-24 14:03:12 -03:00
sale-badge Use shared save function for all the product elements blocks (https://github.com/woocommerce/woocommerce-blocks/pull/8813) 2023-03-22 11:52:50 +00:00
shared Product Price block: add support to the Single Product Template (https://github.com/woocommerce/woocommerce-blocks/pull/8609) 2023-03-06 15:14:08 +01:00
sku Product SKU: Adds support for color, typography, and spacing (https://github.com/woocommerce/woocommerce-blocks/pull/8913) 2023-04-06 11:30:27 +05:30
stock-indicator Stock Indicator Block: remove unused save function (https://github.com/woocommerce/woocommerce-blocks/pull/8832) 2023-03-23 08:43:42 +00:00
summary Convert product-elements/button to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/8003) 2022-12-23 23:01:16 +07:00
title Replace react imports with wordpress/element (https://github.com/woocommerce/woocommerce-blocks/pull/8520) 2023-03-02 15:26:00 +01:00
save.js Use shared save function for all the product elements blocks (https://github.com/woocommerce/woocommerce-blocks/pull/8813) 2023-03-22 11:52:50 +00:00