woocommerce/plugins/woocommerce-blocks/assets/js/blocks
Daniel W. Robert b2f98c2f51 Layout Updates to Active Filters Block (https://github.com/woocommerce/woocommerce-blocks/pull/6905)
* Reverse ordter of filter item name and close btn.

* Update layout & typography styles for block items

* Update chip ui view styles.

Additionally, add editor styles to have the editor match the rendered
frontend.

* Update additional remove button styles.

- Add hover state to remove button on chip layout.
- Update disabled styles to remove button in both layouts (mainly relevant
to the editor view).

* Adjust remove button colors.

Set hover states to shades of grey. Also set chip color and text to
match selected text color of the block.

* Update e2e test to account for new element order.

Since we're moving the remove button in the list view from the last
child node to the first child node, we need to adjust the expected order
of the active filter item text.

* Design and copy updates on the block settings

Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
2022-08-26 09:11:23 -04:00
..
active-filters Layout Updates to Active Filters Block (https://github.com/woocommerce/woocommerce-blocks/pull/6905) 2022-08-26 09:11:23 -04:00
attribute-filter Fix z-index issue in Filter by Attribute dropdowns (https://github.com/woocommerce/woocommerce-blocks/pull/6981) 2022-08-25 13:55:33 +02:00
cart add side effect to package (https://github.com/woocommerce/woocommerce-blocks/pull/6904) 2022-08-16 16:21:26 +05:30
cart-checkout-shared Add dismissible compatibility notice to sidebar when editing Cart and Checkout (https://github.com/woocommerce/woocommerce-blocks/pull/6869) 2022-08-12 15:23:08 +01:00
checkout Add _blank to terms link (https://github.com/woocommerce/woocommerce-blocks/pull/6908) 2022-08-16 15:59:21 +01:00
classic-template Show classic template in the inserter only for specific templates (https://github.com/woocommerce/woocommerce-blocks/pull/6539) 2022-06-29 09:42:02 +02:00
featured-items Select the correct inner button for the "Featured Item" button to update its url (https://github.com/woocommerce/woocommerce-blocks/pull/6741) 2022-07-26 14:30:18 +02:00
handpicked-products Upgrade wp-prettier to 2.6.2 and reformat the codebase (https://github.com/woocommerce/woocommerce-blocks/pull/6566) 2022-06-15 11:56:52 +02:00
mini-cart Add Style Attributes Hooks to blocks/hooks Directory. (https://github.com/woocommerce/woocommerce-blocks/pull/6870) 2022-08-10 20:04:12 -04:00
price-filter `Filter by Attribute` block design updates (https://github.com/woocommerce/woocommerce-blocks/pull/6920) 2022-08-25 12:01:41 +02:00
product-best-sellers Start using `block.json` and convert to TS the `Product Best Sellers` block (https://github.com/woocommerce/woocommerce-blocks/pull/6683) 2022-07-20 11:29:49 +02:00
product-categories Add global styles to Product Categories List block in WC core (https://github.com/woocommerce/woocommerce-blocks/pull/6906) 2022-08-16 09:42:38 +02:00
product-category Start using `block.json` and convert to TS the `Product by Category` block (https://github.com/woocommerce/woocommerce-blocks/pull/6680) 2022-07-19 15:09:46 +02:00
product-new Remove custom `Icon` component in favour of `@wordpress/icons` where possible (https://github.com/woocommerce/woocommerce-blocks/pull/5599) 2022-02-01 16:54:38 +00:00
product-on-sale Remove custom `Icon` component in favour of `@wordpress/icons` where possible (https://github.com/woocommerce/woocommerce-blocks/pull/5599) 2022-02-01 16:54:38 +00:00
product-query Product Query Block POC (Phase 1) (https://github.com/woocommerce/woocommerce-blocks/pull/6812) 2022-08-18 10:02:21 +02:00
product-search Product search block as core/search variation (https://github.com/woocommerce/woocommerce-blocks/pull/6191) 2022-08-23 23:06:17 +07:00
product-tag Upgrade wp-prettier to 2.6.2 and reformat the codebase (https://github.com/woocommerce/woocommerce-blocks/pull/6566) 2022-06-15 11:56:52 +02:00
product-top-rated Remove custom `Icon` component in favour of `@wordpress/icons` where possible (https://github.com/woocommerce/woocommerce-blocks/pull/5599) 2022-02-01 16:54:38 +00:00
products All Products block: Migrate to block.json (https://github.com/woocommerce/woocommerce-blocks/pull/6754) 2022-07-28 12:26:36 +02:00
products-by-attribute Upgrade wp-prettier to 2.6.2 and reformat the codebase (https://github.com/woocommerce/woocommerce-blocks/pull/6566) 2022-06-15 11:56:52 +02:00
reviews Remove the ToggleButtonControl in favor of ToggleGroupControl (https://github.com/woocommerce/woocommerce-blocks/pull/5967) 2022-04-11 13:33:46 +02:00
single-product Update @woocmmerce/eslint-plugin to 2.0.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6203) 2022-04-08 14:47:19 +01:00
stock-filter `Filter by Attribute` block design updates (https://github.com/woocommerce/woocommerce-blocks/pull/6920) 2022-08-25 12:01:41 +02:00
README.md Format Markdown files using wp-scripts (https://github.com/woocommerce/woocommerce-blocks/pull/6462) 2022-06-09 14:43:17 +02:00

README.md

Blocks

Our blocks are generally made up of up to 4 files:

|- block.js
|- editor.scss
|- index.js
|- style.scss

The only required file is index.js, this sets up the block using registerBlockType. Each block has edit and save functions.

The scss files are split so that things in style are added to the editor and frontend, while styles in editor are only added to the editor. Most of our blocks should use core components that won't need CSS though.

Editing

A simple edit function can live in index.js, but most blocks are a little more complicated, so the edit function instead returns a Block component, which lives in block.js. By using a component, we can use React lifecycle methods to fetch data or save state.

The Newest Products block is a good example to read over, this is a simple block that fetches the products and renders them using the ProductPreview component.

We include settings in the sidebar, called the Inspector in gutenberg. See an example of this.

Other blocks have the concept of an "edit state", like when you need to pick a product in the Featured Product block, or pick a category in the Products by Category block.