Commit Graph

1711 Commits

Author SHA1 Message Date
Saad Tarhi d53551d4a7 Fix/cart button focus hover states (https://github.com/woocommerce/woocommerce-blocks/pull/5712)
* Add hover & focus styles for component buttons

We are using an old version of the "@wordpress/component" package,
that's why we are not getting the latest style fixes from Gutenberg.

The reason to not using the latest version is that we had some issues
with the bundle size.

The current solution is to set our own focus & hover styles

* Replace raw value with Sass variable

* Fix hover style for the mini cart block

We don't have the outlined button yet. This styles is unique for the
mini cart button.

To refactor this code, maybe we should create a reusable outlined button

* Add variant to the Woo Block Button component

To refactor our code, adding a "variant" prop looks logical since we are
have already "contained" & "outlined" buttons. So, for future need for an
outlined button, no need to manually apply the same style again.

The "contained" variant is set by default for legacy reasons. Our Button
component was first built as a contained one.

* Fix height difference: oulined & contained buttons

The outlined buttons have more height because of the added border value.

To fix it we can replace the border with the inner shadow.

Co-authored-by: Saad Tarhi <saad.tarhi@automattic.com>
2022-02-09 18:32:05 +01:00
Luigi Teschio 62cabea003 Set focus on Empty Mini Cart Contents Block (https://github.com/woocommerce/woocommerce-blocks/pull/5744)
* Set focus on Empty Mini Cart Contents Block woocommerce/woocommerce-blocks#4618

Set focus on Empty Mini Cart Contents Block

* fix useEffect logic
2022-02-09 10:51:30 +01:00
Tomasz Tunik ee6d1b5ae3 Add to cart button ignored redirect to cart setting (https://github.com/woocommerce/woocommerce-blocks/pull/5708)
* Expose products settings in wcSettings

For the time being we expose only what is used by the blocks
which is `cartRedirectAfterAdd`. In the future more can be added
as needed. Setting is accessible via `getSetting( 'productsSettings' )`.

We namespace the settings under productsSettigns to reflect
the domain and how settings are organised in Woo admin and to
inform that this is an object with more settings within.

This setting normally was available **only** if AJAX add to cart was set
as a js global `wc_add_to_cart_params.cart_redirect_after_add`.
By accessing the option directly we ensure it’s exposed
to blocks regardless of if AJAX option is enabled.

* update AddToCartButton to respect cartRedirectAfterAdd

This adds the redirect directly on the AddToCartButton after succesful
add to cart action. This follows convention that redirects or other side
effects shouldn’t happen as part of the action but rather be part of the
control that triggers such flow.
2022-02-09 09:26:25 +01:00
Thomas Roberts 3c16e7f533 Spread metadata when loading block in frontend (https://github.com/woocommerce/woocommerce-blocks/pull/5732) 2022-02-08 10:33:27 +00:00
Alex Florisca 16d5e773bc Reformatted prettier files (https://github.com/woocommerce/woocommerce-blocks/pull/5735) 2022-02-07 16:59:44 +00:00
Alex Florisca 9b3fdbb0b0 Ts blocks (https://github.com/woocommerce/woocommerce-blocks/pull/5668)
* filter-element-label -> ts

* filter-submit-button -> ts

* form -> ts

* load-more-button -> ts

* loading-mask -> ts

* pagination -> ts

* ProductList -> ts (in progress)

* ProductList -> ts continued

* ProductList -> ts - done + fix some ts errors

* ProductList -> ts continued

* ProductList -> ts

* Tidy up

* Extract type for RegisteredBlockComponent

* Feedback from Mike

* Fix unit tests
2022-02-07 09:34:30 +00:00
Tom Cafferkey d533ae42e7 Add a Remove Image option to the Featured Category block (https://github.com/woocommerce/woocommerce-blocks/pull/5719) 2022-02-07 08:35:02 +00:00
Tomasz Tunik 729de5ea05 Revert "fix: accessibility of search products block (https://github.com/woocommerce/woocommerce-blocks/pull/5691)" (https://github.com/woocommerce/woocommerce-blocks/pull/5717)
This reverts commit d4d3f18453.
2022-02-04 11:26:34 +01:00
Daniel Dudzic 0b28bdf0dd Add stories for Button component woocommerce/woocommerce-blocks#5250 (https://github.com/woocommerce/woocommerce-blocks/pull/5706)
* Add stories for Button component woocommerce/woocommerce-blocks#5250

Add stories for Button component
Co-authored-by: gigitux <gigitux@gmail.com>

* Button: Change With Spinner story title to Loading
2022-02-03 13:29:06 +01:00
Tomasz Tunik d4d3f18453 fix: accessibility of search products block (https://github.com/woocommerce/woocommerce-blocks/pull/5691)
When output with php the block had correct accessibility on
the frontend but in the editor or when rendered as block
the correct aria label was missing because of misspelled
aria-label attribute.

Also fixed wrong value type provided for tabIndex in editor
while at it.
2022-02-02 19:56:56 +01:00
Luigi Teschio 86bbf5a037 Attribute Filter block: Enable global style (https://github.com/woocommerce/woocommerce-blocks/pull/5557)
* Product title: add support global style woocommerce/woocommerce-blocks#4965

* add specific type

* add custom save function

* move hooks in a specific folder

* fix crash on WP 5.8

* Featured Category block: Add support for global style woocommerce/woocommerce-blocks#4965

Featured Category block: Add support for global style

* fix border color

* Attribute Filter block: enable global style woocommerce/woocommerce-blocks#4965

Attribute Filter block: enable global style woocommerce/woocommerce-blocks#4965

* fix eslint error

* fix test

* add comments about !important
2022-02-02 18:41:39 +01:00
Tomasz Tunik d68f6d25b8 Fix Twenty Twenty-Two Products by Category block item tile styling issues (https://github.com/woocommerce/woocommerce-blocks/pull/5684)
* fixes products by category added to cart style

fixes woocommerce/woocommerce-blocks#5285 - View cart after adding item to cart was squeezed
in on the same line as the Add to Cart button

* fixes products by category sale price styles

fixes woocommerce/woocommerce-blocks#5286 - sale price was underlined because of the default
styles on the used ins HTML element
2022-02-02 18:21:39 +01:00
Tomasz Tunik eb54c4bec0 fix: Category List element not visible on all products item edit (https://github.com/woocommerce/woocommerce-blocks/pull/5688)
fixes woocommerce/woocommerce-blocks#5674 - item edit relied on data from @woocommerce/previews
productsPreview which was missing mock data for product category
2022-02-02 12:57:52 +01:00
Mike Jolley 2b5f115d41 Remove custom `Icon` component in favour of `@wordpress/icons` where possible (https://github.com/woocommerce/woocommerce-blocks/pull/5599)
* Remove atom icon

* Swap icon usage to WordPress package

* remove unused icons from library

* Use @wordpress/primitives

* Product cats block to listView

* On-sale to use percent instead of tag icon

* add to cart button use button icon

* on sale products block icon

* Handpicked products use stack icon

* Products by stock box icon

* Make sparkles woo purple

* Fix icon name

* Correct more tag name

* fix path to icons

* Update snaps

* Update readme to explain updated usage

* Import SVG and path from primitives

* Missing isFeaturePluginBuild

* Update assets/js/icons/README.md

Co-authored-by: Raluca Stan <raluca.stan@automattic.com>

* Update assets/js/icons/README.md

Co-authored-by: Raluca Stan <raluca.stan@automattic.com>

* Update assets/js/icons/README.md

Co-authored-by: Raluca Stan <raluca.stan@automattic.com>

* update lock

Co-authored-by: Raluca Stan <raluca.stan@automattic.com>
2022-02-01 16:54:38 +00:00
Tung Du 995d41e2a9 Fix: Empty Mini Cart contents overflow issue (https://github.com/woocommerce/woocommerce-blocks/pull/5635)
* fix: add wrapper for empty mini cart contents inner blocks. Allow inner content to be scrollable

* fix overflow issue for the editor

* add padding for the empty cart view
2022-02-01 17:19:41 +01:00
Luigi Teschio 9d1464baf3 Featured Product: Enable global style (https://github.com/woocommerce/woocommerce-blocks/pull/5555)
* Product title: add support global style woocommerce/woocommerce-blocks#4965

* add specific type

* add custom save function

* move hooks in a specific folder

* fix crash on WP 5.8

* Featured Category block: Add support for global style woocommerce/woocommerce-blocks#4965

Featured Category block: Add support for global style

* fix border color

* Featured Product block: enable global style woocommerce/woocommerce-blocks#4965

Featured Product block: enable global style

* fix border color

* fix eslint error

* fix opacity

* fix border radius

* fix opacity

* disable font-size support

* restore height for featured product and featured category
2022-02-01 15:01:31 +01:00
Luigi Teschio 2438fcd434 Disable font-size for the Featured Category block woocommerce/woocommerce-blocks#5681 (https://github.com/woocommerce/woocommerce-blocks/pull/5682)
Disable font-size for the Featured Category block
2022-01-31 18:03:54 +01:00
Manos Psychogyiopoulos 6ed7034223 Add inner wrapper div in 'td.wc-block-cart-item__product' (https://github.com/woocommerce/woocommerce-blocks/pull/5240)
* Add inner wrapper div in td.wc-block-cart-item__product

Adding this wrapper element is necessary in order to be able to "fake" item grouping in a theme-agnostic manner: https://user-images.githubusercontent.com/1783726/118831630-97855600-b8c8-11eb-8906-c7f9ada769e7.png

* Whoops

* Remove classnames function

* Update indentation for QuantitySelector

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2022-01-31 15:18:29 +00:00
Niels Lange 83ae876898 Keep top margin for create account section in editor (https://github.com/woocommerce/woocommerce-blocks/pull/5633) 2022-01-31 22:15:46 +07:00
Tomasz Tunik 54ca9e16b0 Fix ReadMore component maxLines prop reactivity (https://github.com/woocommerce/woocommerce-blocks/pull/5673)
when changing property value of maxLines component would not
update until remounted or reloaded with new settings
2022-01-31 13:56:19 +01:00
Thomas Roberts c7aa3a75b9 Update tests to use `useEvent` (https://github.com/woocommerce/woocommerce-blocks/pull/5573)
* Update payment-method-data-context tests to use userEvent

* Update mini cart block tests to use userEvent

* Update payment methods tests to use userEvent
2022-01-31 10:53:21 +00:00
Thomas Roberts afd9d42805 Add Checkout Order Summary inner block tests (https://github.com/woocommerce/woocommerce-blocks/pull/5675)
* Add fake items fixture

* Add test for rendering items in sidebar

* Add test for items with addons

* Add textContentMatcherAccrossSiblings helper

This is needed to match text when it's spread over a few elements

* Add test to ensure subtotal renders correctly

* Add test to ensure discounts are rendered correctly

* Add test to ensure fees are shown correctly

* Add test to check coupon entry form isn't present when coupons disabled

* Add more mock data to useStoreCart

* Mock useShippingDataContext

* Rename useStoreCartValue to useStoreCartReturnValue

* Remove unnecessary coupon button test

This should be tested within the TotalsCoupon component

* Add tests for shipping presence

* Add test for coupons

* Remove cart items fixtures

These are no longer needed

* Move the findByText utils to the utils folder

* Move inner blocks test to correct directory
2022-01-31 10:53:08 +00:00
Thomas Roberts a46f13c6c5 Move Checkout block attributes into metadata (`block.json`) (https://github.com/woocommerce/woocommerce-blocks/pull/5594)
* Add block title to AbstractBlock class

* Add block title to Checkout block

* Include all block.json files in tsconfig

* Add get_block_title method to Checkout.php

* Remove redundant block_title field

* Add block.json and remove static attributes from attributes.ts

* Register block using attributes from block.json

* Add metadata_path to AbstractBlock

* Add function to AssetsApi to get the metadata path from the plugin root

* Register the block using metadata if it's set in the block's class

* Remove get_block_title method

* Only add supports and attributes to the block when not registering with metadata

* Change get_block_metadata to get_block_metadata_path

* Change indentation to tabs in block.json

* Update comment to clarify why attributes and supports are set later

* Check if path to metadata is not empty instead of set and not empty

* Move checkout block out of cart-checkout directory

* Update get_block_metadata_path function to find block.json automatically

* Remove metadata path from AbstractBlock

* Check if there's a metadata file and register blocks with metadata if so

* Move deprecated attributes out of metadata and into attributes.ts

* Re-add deprecated attributes to checkout index

* Move order notes test

* Move test for checkout phone number in edito

* Fix indentation in checkout/block.json

* Move checkout terms tests

* Try forcing storefront theme in e2e tests

* Revert "Try forcing storefront theme in e2e tests"

This reverts commit 5b0fd47a2c39aadb0141a4ed28cbc0e6baa89625.

* Try capturing screenshot on test failures

* Try uploading error in try catch

* Try uploading artefacts on error

* Test uploading artefacts

* Screenshot just before looking for edit post layout

* Revert "Screenshot just before looking for edit post layout"

This reverts commit 61dff027789ce13a0d84e7b6f11e431637c5a450.

* Revert "Test uploading artefacts"

This reverts commit adf5cc55bcdb677f889bf5a62803b4150d98e665.

* Revert "Try uploading artefacts on error"

This reverts commit 7441a832a113a95fef89cc1b8db6dc79271be516.

* Revert "Try uploading error in try catch"

This reverts commit ca412ce505d56286b164f588a201a451f6bceeb6.

* Revert "Try capturing screenshot on test failures"

This reverts commit 0de6e97df19b116091a7bb3b8652713867d2d80f.

Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
2022-01-28 16:37:06 +00:00
Thomas Roberts b7560ebed5 Add tests for Checkout Terms block (https://github.com/woocommerce/woocommerce-blocks/pull/5621)
* Install @wordpress/block-editor package

* Add test for checkout terms frontend block

* Add tests for checkout terms in editor

* Add tests for Checkout Terms in editor

* Use void 0 as function's return type

* Update tests to use toBeInTheDocument and split checkbox test in two

* Use void 0 for empty function
2022-01-27 12:34:52 +00:00
Tung Du 6f4c00a2fd Fix: Exclude Mini Cart and other blocks inside the Mini Cart Contents block (https://github.com/woocommerce/woocommerce-blocks/pull/5616) 2022-01-27 17:10:53 +07:00
Tom Cafferkey 9934533375 Revert "Allow LegacyTemplate block to be reinserted, only on WooCommerce block templates. (https://github.com/woocommerce/woocommerce-blocks/pull/5545)" (https://github.com/woocommerce/woocommerce-blocks/pull/5643)
This reverts commit cf9c82e02e.
2022-01-27 09:45:00 +00:00
Luigi Teschio 2370ce4378 Featured Category block: add support for global style (https://github.com/woocommerce/woocommerce-blocks/pull/5542)
* Product title: add support global style woocommerce/woocommerce-blocks#4965

* add specific type

* add custom save function

* move hooks in a specific folder

* fix crash on WP 5.8

* Featured Category block: Add support for global style woocommerce/woocommerce-blocks#4965

Featured Category block: Add support for global style

* fix border color

* fix opacity

* fix border radius

* fix order rules css
2022-01-26 18:16:50 +01:00
Alex Florisca 4ba300d6d1 Prevent third party blocks from breaking the entire checkout/cart block (https://github.com/woocommerce/woocommerce-blocks/pull/5297)
* Prevent third party blocks from breaking the entire checkout block

* Fixed types and block error boundary around forced blocks

* Move InnerBlocksComponentWrapper and remove extra }

* Allow HTML nodes to be rendered in the component tree, not just eleents
2022-01-25 12:01:19 +00:00
Niels Lange 59c8ddc531 Show single express payment button in full width (https://github.com/woocommerce/woocommerce-blocks/pull/5601)
* Show single express payment button in full width

* Change :first-child:nth-last-child(1) to :only-child
2022-01-24 10:22:02 +07:00
Tung Du 718f2dbc6f Mini Cart Contents: Support link and text colors (https://github.com/woocommerce/woocommerce-blocks/pull/5566) 2022-01-22 00:39:04 +07:00
Thomas Roberts aaaf6787a3 Add tests for phone field on checkout (https://github.com/woocommerce/woocommerce-blocks/pull/5604) 2022-01-21 13:24:48 +00:00
Mike Jolley c25f8ec531 Manually update dependencies (https://github.com/woocommerce/woocommerce-blocks/pull/5602)
* Add markdown-it and follow-redirects to package.

* fix eslint warning
2022-01-21 12:09:07 +00:00
Thomas Roberts 0d7b8ab95a Add tests for order notes component (https://github.com/woocommerce/woocommerce-blocks/pull/5605) 2022-01-21 12:07:36 +00:00
Mike Jolley bcba16e4a5 Prevent Redirect URL leaking between payment gateways (https://github.com/woocommerce/woocommerce-blocks/pull/5560)
* Reset redirectUrl to blank if not included in response.

* Force redirect URL for successful responses

* Revert "Force redirect URL for successful responses"

This reverts commit 61aae8b459843237b5428be8fa0cdb9500cd0485.
2022-01-20 11:25:40 +00:00
Luigi Teschio dd36c00180 Restore correct font style when the block is loaded in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/5600)
* Restore correct font style when the block is loaded in the editor

Restore correct font style when the block is loaded in the editor

* fix style on Twenty Twenty theme
2022-01-20 10:02:17 +01:00
Luigi Teschio 5f37425c90 Fix global style for Product Summary block, Product Stock Indicator block, and Product Title block (https://github.com/woocommerce/woocommerce-blocks/pull/5595)
* Fix global style for Product Summary block, Product Stock Indicator block, and ProductTitle block

Fix global style for Product Summary block, Product Stock Indicator block, and ProductTitle block

* add feature flag

* fix lint errors

* fix global style bugs on Product Title block
2022-01-19 15:02:30 +01:00
Mike Jolley c492a97d83 Fix default `stockStatusOptions` in tag and attribute blocks (https://github.com/woocommerce/woocommerce-blocks/pull/5590)
* Fix default stockStatusOptions in tag and attribute blocks

These should be an array of keys, not objects.

* Fix stockStatus definition on PHP side

* Swap state to debounce.

* Improve presentation of stock filters

* Remove state usage for display options

* Remove debounce

* Consistent panel titles
2022-01-19 11:42:21 +00:00
Tom Cafferkey cf9c82e02e Allow LegacyTemplate block to be reinserted, only on WooCommerce block templates. (https://github.com/woocommerce/woocommerce-blocks/pull/5545)
* Set attribute of legacy template block when block is inserted

* Allow inserter on Woo templates only

* Allow correct legacy block straight from the inserter

* Use WP Data store outside component to register block

* Pass in all attribute data when registering block

* Accommodate templates targetted at specific products or taxonomies

* Replace beginsWith with startsWith

* Replace test data with production data

* Conditionally use stores selector if it exists

* Unsubscribe if the store does not exist

Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
2022-01-17 10:50:57 +00:00
Luigi Teschio 2a2aee49df Stock Indicator block: Add support for global style (https://github.com/woocommerce/woocommerce-blocks/pull/5525)
* Product title: add support global style woocommerce/woocommerce-blocks#4965

* add specific type

* add custom save function

* Stock indicator block: add support for global style woocommerce/woocommerce-blocks#4965

Stock indicator block: add support for global style

* fix import after merge
2022-01-17 10:11:26 +01:00
Luigi Teschio dfa98dcb5e Price Filter block: enable global style woocommerce/woocommerce-blocks#4965 (https://github.com/woocommerce/woocommerce-blocks/pull/5559)
Price Filter block: enable global style woocommerce/woocommerce-blocks#4965
2022-01-17 10:10:26 +01:00
Niels Lange 599e395dc1 Fix inconsistent HTML of rating section (https://github.com/woocommerce/woocommerce-blocks/pull/5552) 2022-01-14 18:32:28 +07:00
Thomas Roberts c950f29400 Remove extra padding for cart sidebar (https://github.com/woocommerce/woocommerce-blocks/pull/5430)
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
2022-01-13 17:10:18 +00:00
Raluca Stan b1bef86632 Fix Using / for division is deprecated warnings seen when building the project (https://github.com/woocommerce/woocommerce-blocks/pull/5556) 2022-01-13 15:01:36 +01:00
Alex Florisca a8d979c47b Default all product images to "cropped" and actual image width (https://github.com/woocommerce/woocommerce-blocks/pull/5551)
* Default imageSizing for the all products block to 'cropped'

* set max-width:100%, width: auto on product grid images
2022-01-12 17:50:48 +00:00
Luigi Teschio d2ef7143d9 Summary Product block: Add support for global style (https://github.com/woocommerce/woocommerce-blocks/pull/5524)
* Product title: add support global style woocommerce/woocommerce-blocks#4965

* add specific type

* add custom save function

* Summary Product block: add support for global style woocommerce/woocommerce-blocks#4965

Summary Product block: add support for global style

* add color global style under feature flag

* fix import after merge

* fix typo
2022-01-12 16:31:25 +01:00
Luigi Teschio 9ad060b352 Product Title block: add support global style (https://github.com/woocommerce/woocommerce-blocks/pull/5515)
* Product title: add support global style woocommerce/woocommerce-blocks#4965

* add specific type

* add custom save function

* move hooks in a specific folder

* fix crash on WP 5.8

* fix global style title color (https://github.com/woocommerce/woocommerce-blocks/pull/5548)

Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2022-01-12 14:33:46 +01:00
Luigi Teschio cba17c2ef9 Mini Cart block: re-enable background support woocommerce/woocommerce-blocks#4965 (https://github.com/woocommerce/woocommerce-blocks/pull/5539)
Mini Cart block: re-enable background support woocommerce/woocommerce-blocks#4965
2022-01-11 15:08:16 +01:00
Mike Jolley a5bd8f0564 Fix All Products Block Tests due to incorrect Stock Filter addition (https://github.com/woocommerce/woocommerce-blocks/pull/5541)
* Remove stock filter from all products block

* Add missing stock filter to product-category block
2022-01-11 11:25:05 +00:00
Mike Jolley a1695861f2 Add minimum quantity, maximum quantity, and step (multiple_of) to the Cart Block and Store API (https://github.com/woocommerce/woocommerce-blocks/pull/5406)
* add min and step to Store API

* add min and step support

* typo

* Update assets/js/base/components/quantity-selector/index.tsx

* Update assets/js/base/components/quantity-selector/index.tsx

* Fix debounce callback

* Style qty input to show steps

* Implement quantity_limits in API

* Quantity validation

* Update product API

* Normalize on + -

* Separate add to cart events from cart item events in regards to limits

* Prevent qty change for editable line items

* Unify filters

* Remove step number indicator from buttons ¯\_(ツ)_/¯

* Normalize on mount

* Update docs

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2022-01-11 11:09:59 +00:00
Mike Jolley e19abbc0c2 Remove Built-in Stripe Integration in favour of Stripe Extension (https://github.com/woocommerce/woocommerce-blocks/pull/5449)
* Remove Stripe from PHP side

* Remove stripe from client

* fix const name in tests

* Update docs
2022-01-11 10:53:38 +00:00
Thomas Roberts df6e27e22f Add margin below shipping packages in checkout (https://github.com/woocommerce/woocommerce-blocks/pull/5529)
* Add margin below shipping packages in checkout

* Add margin below shipping packages in checkout but not in cart
2022-01-11 10:27:37 +00:00
jonny-bull 87cb033cbd Add stock level filter to product blocks (https://github.com/woocommerce/woocommerce-blocks/pull/4943) 2022-01-10 13:39:24 +00:00
Tung Du 14c1017feb Mini Cart Contents block improvements (https://github.com/woocommerce/woocommerce-blocks/pull/5446) 2022-01-08 08:19:01 +07:00
Tung Du 4b159f0fcd Allow inserting blocks to filled mini cart (https://github.com/woocommerce/woocommerce-blocks/pull/5527) 2022-01-08 07:51:20 +07:00
Raluca Stan 5c232fa7a1 Force a string token property for the activePaymentMethod (https://github.com/woocommerce/woocommerce-blocks/pull/5535) 2022-01-07 14:41:25 +01:00
Luigi Teschio c54440d0e1 Add wide and full alignment support for legacy template block (https://github.com/woocommerce/woocommerce-blocks/pull/5433)
* add align wide and full support for legacy template block

* fix PHP warning

* add a comment on get_markup_with_classes_by_attributes

* rename function

* add align wide and full support for legacy template block

* fix PHP warning

* add a comment on get_markup_with_classes_by_attributes

* rename function

* fix regex

* update regex

* update regex

* fix code styling
2022-01-07 10:47:48 +01:00
Luigi Teschio 340669bb90 Filter Products By Price block: don't allow to insert negative values on inputs (https://github.com/woocommerce/woocommerce-blocks/pull/5123)
* Don't allow to insert negative values on input for Filter Products By Price block woocommerce/woocommerce-blocks#2695

Don't allow to insert negative values on input for Filter Products By Price block

* renaming util functions and add comments
2022-01-06 15:30:34 +01:00
Luigi Teschio 549e10fabb Mini Cart Block: The color of the badge reflects the global style (https://github.com/woocommerce/woocommerce-blocks/pull/5477)
* Mini Cart Block: the color of the badge reflects the global style woocommerce/woocommerce-blocks#4965

Mini Cart Block: the color of the badge reflects the global style woocommerce/woocommerce-blocks#4965

* disable background
2022-01-06 09:47:34 +01:00
Lucio Giannotta 78a25b235f Legacy Template: Add warning about block removal (https://github.com/woocommerce/woocommerce-blocks/pull/5208)
Legacy blocks were previous locked for removal to avoid unintended
consequences. However, this would lock the ability to move the block within
other e.g. layout blocks and unnecessarily limit merchant customization ability.

Now that we have reverted this decision, merchants could delete this block,
which is likely **not** what they want to do. While we investigate other, more
long-term, solutions, we are adding a warning notice.

Refs woocommerce/woocommerce-blocks#5180. Fixes woocommerce/woocommerce-blocks#5207.

* Rename legacy blocks to avoid confusion with the term “Template”
2022-01-05 19:18:23 +01:00
Malith Senaweera 65835d3689 Fix duplicated error notices (https://github.com/woocommerce/woocommerce-blocks/pull/5476)
* Fix duplicated error notices

StoreNoticeProvider is already being used within Block component. This
removal prevents duplicated error notices within the Payment Options
section

* Move StoreNoticeProvider from payment block

Remove StoreNoticeProvider from payment block and move it to the parent
frontend block to avoid unnecessarily loading the notice provider
2022-01-04 17:37:46 +00:00
Luigi Teschio 723eabee80 Add global style for Active Filters block (https://github.com/woocommerce/woocommerce-blocks/pull/5465)
* Enable global style for active filters block

* show blacklisted blocks in full site editing side

* fix test

* --amend

* fix check
2022-01-03 10:41:19 +01:00
Mike Jolley 0e53cea85c Fix initial population of address data in `useCustomerData` hook (https://github.com/woocommerce/woocommerce-blocks/pull/5473)
* Re-init customer data once cart has loaded

* Tweak typedef

* Track changes without capturing blank initial state in useCheckoutAddress
2021-12-31 16:10:43 +01:00
Thomas Roberts a8e094473c Revert "Remove extra padding for cart sidebar (https://github.com/woocommerce/woocommerce-blocks/pull/5247)" (https://github.com/woocommerce/woocommerce-blocks/pull/5429)
This reverts commit a60cd66692.
2021-12-30 12:24:18 +00:00
Thomas Roberts 5036c69638 Add E2E tests for Filter blocks (Price, Attribute, and Active Filters) (https://github.com/woocommerce/woocommerce-blocks/pull/4562)
* Add clear and fill input test util

* Add tests for Filter Products by Price

* Add class name to filter products by price block in editor

* Update wp-env

* Fix formatting

* Update lock

* Revert "Update lock"

This reverts commit f4e809e000430eea3972c94fd2aea0a19ba6961b.

* Create product attributes during setup

* Remove product attributes during teardown

* Add attributes in fixture-data

* Add two new products, for attribute testing

* Load attributes into store and apply them to products

* Add class to Filter by Attribute when editing

This is so it can be targeted in E2E tests more easily.

* Add tests for Filter Product by Attribute

* Fix formatting in attribute-filter.test.js

* Add tests for active filters block

* Add doc block for ensuteCleanAttributes

* Update wording of title test in all filter block E2E

* Update test wording to read better

* Update snapshots

* Use pptr-testing-library selectors to click elements

This makes the tests easier to reason with, and lets us take a step back from the implementation details (classnames etc.)

* Add saveOrPublish test util

* Use pptr-testing-library selectors to click elements in attribute filter

* Use pptr-testing-library selectors to click elements in price filter

* Add `puppeteer-testing-library`

* Use puppeteer-testing-library API to look for H6 button

* Use correct argument in jest-puppeteer.dev.config

* Update package.json & package-lock.json

* remove tests for 5.3

* remove snapshots

* Remove ensureCleanAttributes

* Remove puppeteer-testing-library, install missing expect-puppeteer package and update tests

The puppeteer-testing-library, although added by gutenberg is not actively used.
I have removed it and realised that the added functionality can be easily replaced by expect-puppeteer.
This is a package that we specify in the jest configuration but it was not part of our package.json.
The selectors from puppeteer-testing-library have been replaced with .toClick and the utility clearAndFillInput with .toFill

The Filter by Attribute block has been skiped until tests are fixed.

* Add back setupPageSettings to jest setup

* Fix filter by attribute block test

* Fix linting error

Co-authored-by: Raluca Stan <ralucastn@gmail.com>
2021-12-23 17:26:10 +01:00
Thomas Roberts 20cac18474 Don't show shipping price when no options are available (https://github.com/woocommerce/woocommerce-blocks/pull/5444)
* Add isCheckout prop to NoShippingPlaceholder and TotalsShipping

* Pass isCheckout to TotalsShipping in Checkout sidebar

* Show the NoShippingPlaceholder if no rates are found

* Show better error message when no shipping is available in checkout
2021-12-23 13:24:08 +00:00
Tung Du b2eecf3bb0 Fix: Mini Cart: Default content for empty state (https://github.com/woocommerce/woocommerce-blocks/pull/5421) 2021-12-22 18:03:58 +07:00
Niels Lange 9a1cd85779 Remove text decorations from product filter (https://github.com/woocommerce/woocommerce-blocks/pull/5384) 2021-12-22 15:33:37 +07:00
Lucio Giannotta 35adae3fa4 Add Storybook documentation and remove deprecated knobs (https://github.com/woocommerce/woocommerce-blocks/pull/5407)
* Remove Storybook knobs

They are now fully replaced by controls

* Update Storybook to 6.4.9
* Add Storybook documentation and VSCode snippets
* Add VSCode snippets
* Convert stories from checkout packages and include them in Storybook
2021-12-21 18:08:57 +01:00
Alex Florisca a60cd66692 Remove extra padding for cart sidebar (https://github.com/woocommerce/woocommerce-blocks/pull/5247) 2021-12-21 13:46:49 +00:00
Mike Jolley 469223fa54 Remove validateOnMount in favour of validation on state change (https://github.com/woocommerce/woocommerce-blocks/pull/5381)
* Remove validateOnMount in favour of validation on state change.

* Use useEffect

* test
2021-12-20 12:16:41 +00:00
Niels Lange ee45d9d9cf Remove full-width mode from cart and checkout block (https://github.com/woocommerce/woocommerce-blocks/pull/5315) 2021-12-20 11:27:51 +00:00
Tung Du 50066455c0 Fix: Mini Cart block: divide contents into three inner blocks (https://github.com/woocommerce/woocommerce-blocks/pull/5386)
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2021-12-20 14:57:55 +07:00
Albert Juhé Lluveras bffbc491a8 Add correct class to Legacy Template block icon (https://github.com/woocommerce/woocommerce-blocks/pull/5400) 2021-12-16 13:29:55 +01:00
Alex Florisca e61eb3b0a4 Fix extra network request on cart (https://github.com/woocommerce/woocommerce-blocks/pull/5394) 2021-12-16 10:30:23 +00:00
M. L. Giannotta 1db7ede31e Migrate storybook entries of ProductPrice component (https://github.com/woocommerce/woocommerce-blocks/pull/5371)
Closes woocommerce/woocommerce-blocks#5368
2021-12-15 19:07:49 +01:00
M. L. Giannotta 5524c0aa91 Storybook and TS migration of `PriceSlider` component (https://github.com/woocommerce/woocommerce-blocks/pull/5253) (https://github.com/woocommerce/woocommerce-blocks/pull/5293)
* Add full documentation to the component props in Storybook
* Fix `FormattedMonetaryAmount` TypeScript errors

Since this component is passing on props to `NumberFormat`,
it needs to extend all of its original props, except for `onValueChange`
which we wrap in order to accept only `number`s.

* Convert `constrainRangeSliderValues` to TypeScript
* Add docs to `Currency` types
* Convert `PriceSlider` to TypeScript

*Note:* All TypeScript errors were fixed during the conversion,
except for the IE workaround which wasn't clear to me at this time.
Opened an issue: woocommerce/woocommerce-blocks#5276

* Fix Price Slider story (https://github.com/woocommerce/woocommerce-blocks/pull/5253)
* Migrate stories for `ProductName` to latest Storybook

Also add props documentation and add named export.
2021-12-15 17:54:49 +01:00
M. L. Giannotta 703051b1bc Storybook and TS migration of some cart checkout components (https://github.com/woocommerce/woocommerce-blocks/pull/5324)
* Migrate stories for `ProductName` to latest Storybook. Also add props
documentation and add named export.
* Migrate `TotalsFooterItem` to TypeScript and latest Storybook
* Add a `LooselyMustHave` utility type.
* Export `allSettings` so that they can be manipulated in stories and tests

* Implement a way to easily define and reuse Storybook controls

Implement a currency control for a common use-case of selecting currencies.
It currently implements EUR and USD as they have different properties.

* Migrate `TotalsDiscount` to TypeScript and implement stories
* Migrate `TotalsCoupon` to TypeScript and fix stories
* Change Coupon name within Storybook
* Nicer handling of removal of a coupon from Storybook

It now dynamically calculates the discount from the actual coupons.
2021-12-15 17:30:17 +01:00
M. L. Giannotta 91c2ca2143 Migrate storybook entries of QuantitySelector component (https://github.com/woocommerce/woocommerce-blocks/pull/5370)
* Add experimental Emotion11 compatibility

Revert the changes introduced in woocommerce/woocommerce-blocks#5354. The team over at Storybook
has recently implemented a workaround to enable Emotion11 compatibility
in 6.x releases.

See: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#emotion11-quasi-compatibility

* Add `QuantitySelector` property docs and migrate stories

*Note:* Because of a Storybook bug, the number input on the control panel of the
story, is not going to get updated by the component.

See: https://github.com/storybookjs/storybook/issues/15924
2021-12-15 17:03:02 +01:00
Mike Jolley c5e07b8dd2 Move class removal to render callback (https://github.com/woocommerce/woocommerce-blocks/pull/5364) 2021-12-14 10:39:14 +00:00
Tung Du b0623a8b52 Mini Cart: only display the editing link to users with site editing permission (https://github.com/woocommerce/woocommerce-blocks/pull/5372) 2021-12-14 07:54:23 +07:00
Tung Du 0350268b82 Switch to correct view if inner block is selected (https://github.com/woocommerce/woocommerce-blocks/pull/5358) 2021-12-14 07:46:10 +07:00
Mike Jolley 3fc597775c Trigger validation on change (https://github.com/woocommerce/woocommerce-blocks/pull/5373) 2021-12-13 16:44:28 +00:00
Mike Jolley 226780107a Add error message for fetch errors on checkout (https://github.com/woocommerce/woocommerce-blocks/pull/5341)
* Add error message for fetch errors on checkout

* Update message text

* revert gitignore change

* Remove errorNotice variable
2021-12-13 15:31:49 +00:00
Mike Jolley 661896ce9e Loading animation (https://github.com/woocommerce/woocommerce-blocks/pull/5362) 2021-12-13 13:57:59 +00:00
Seghir Nadir 772ee23faa Update item quantity if server result is different from client (https://github.com/woocommerce/woocommerce-blocks/pull/5352)
* respect when quantity changes from up

* add test
2021-12-10 16:26:57 +01:00
Mike Jolley 70106d45d3 Revise checkout payment statuses to avoid data loss on error (https://github.com/woocommerce/woocommerce-blocks/pull/5350)
* Clarify docs for STARTED

* Clarify docs for setActivePaymentMethod

* Remove useActivePaymentMethod hook (this held state for active methods and tokens)

* Update type defs

* Enhance setActivePaymentMethod action to accept method data

* SET_ACTIVE_PAYMENT_METHOD action

* Add setActivePaymentMethod dispatcher and make "started" status only

* Update setActivePaymentMethod usage in express methods

* Set radio control defaults

* Consolodate tokens and methods

* Update assets/js/base/context/providers/cart-checkout/payment-methods/reducer.ts

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>

* Spacing

* Split saved cards tests from regular, since saved cards are checked by default

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2021-12-10 16:26:16 +01:00
Niels Lange 6a74887464 Limit CSS styles to WooCommerce Block icons only (https://github.com/woocommerce/woocommerce-blocks/pull/5363)
* Limit CSS styles to WooCommerce Block icons only

* Update assets/css/editor.scss

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2021-12-10 21:32:44 +07:00
Luigi Teschio 13deb1b09e Mini Cart Block: render the empty state set on template parts (https://github.com/woocommerce/woocommerce-blocks/pull/5338)
* add view switcher for mini cart contents block

* editor view switcher

* update mini cart template file

* render the empty state template parts for the Mini Cart Block woocommerce/woocommerce-blocks#4674

render the empty state template parts for the Mini Cart Block woocommerce/woocommerce-blocks#4674

* update selector

* allow empty mini cart block to add all blocks

* fix tests; improve code style

* install @wordpress/block-editor package

* fix warning on frontend side

* block-editor package is not necessary

* merge attributes object

Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2021-12-10 12:11:59 +01:00
Albert Juhé Lluveras 29fa0a61e6 Fix Mini Cart template part link on WP 5.9 (https://github.com/woocommerce/woocommerce-blocks/pull/5348)
* Fix link to edit the Mini Cart template part in WP 5.9

* Use wp_is_block_theme() function

* Add protection against overwriting isSiteEditorAvailable setting

* Rename isSiteEditorAvailable to isBlockTheme
2021-12-10 11:23:16 +01:00
Niels Lange 865a0a5ffa Update icon of legacy template block (https://github.com/woocommerce/woocommerce-blocks/pull/5317)
* Update icon of legacy template block

* Display legacy block template color in Woo purple

* Display icons in white when block being selected within list view
2021-12-10 17:07:10 +07:00
Seghir Nadir 8e62dea95d Wait until carts load before calling `canMakePayment` (https://github.com/woocommerce/woocommerce-blocks/pull/5337)
* wait till cart loads before calling canMakePayment

* fix tests
2021-12-08 13:41:31 +00:00
Alex Florisca 311a531826 Chip component stories for storybook (https://github.com/woocommerce/woocommerce-blocks/pull/5322)
* ship component stories for storybook

* Refactor RemovableChip for Storybook

* Implement lucio feedback changes

* RemovableChip is part of the Chip story
2021-12-08 12:17:49 +00:00
Mike Jolley cfeb5558b7 Update WordPress Monorepo packages with React 17x support (https://github.com/woocommerce/woocommerce-blocks/pull/5223)
* Use npm 14

* Update WP packages

* Update non-dev wordpress dependencies

* Remove usage of @automattic/data-stores

* Moves tag, search-list-control components back into private `editor-components` to mitigate dependency conflicts with`@woocommerce/components`

* Fix tests with act()

* package-lock

* fix broken maps

* Patch 14x package

* update locks

* Revert nvmrc change

* Fix tests due to debounce

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2021-12-07 15:47:50 +00:00
M. L. Giannotta 77c237d6a2 Storybook migration of `CountryInput` component (https://github.com/woocommerce/woocommerce-blocks/pull/5312)
* Enable `exactOptionalPropertyTypes` in TS config

This option will create more strict types out of optional properties.
Read more: https://devblogs.microsoft.com/typescript/announcing-typescript-4-4-beta/#exact-optional-property-types

* Extract `ComboBoxProps` as own interface

This way we can export it to use it somewhere else. In this specific case,
I'll need to use it as a base to extend the `CountryInputProps`.

Also fixed some types to be optional, as the component requires.

* Fix stories and props for `CountryInput` (https://github.com/woocommerce/woocommerce-blocks/pull/5252)
2021-12-07 16:07:21 +01:00
Tung Du 185f1d5bd9 Fix: Mini Cart block button should be disabled in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/5308) 2021-12-07 21:29:56 +07:00
Tung Du 90a54b6cf0 Mini Cart Contents block: implement view switcher in editor (https://github.com/woocommerce/woocommerce-blocks/pull/5304) 2021-12-07 21:07:53 +07:00
Mike Jolley 7fd25d4b37 Typedefs and cartData for `usePaymentMethodInterface` (https://github.com/woocommerce/woocommerce-blocks/pull/5177)
* Typedefs and cartData for the payment interface

* fix case on noticeContexts

* typeof for enums

* immutable note

* Add cartData to docs table

* Rebase docs
2021-12-07 13:02:57 +00:00
Albert Juhé Lluveras b927ca6a9f Convert renderFrontend to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/5238)
* Rename render-frontend file to tsx

* Add types to renderFrontend

* Reorder code

* Use PascalCase for types

* add generics

* fix TS error

* restore interface

Co-authored-by: Luigi <gigitux@gmail.com>
2021-12-07 11:07:32 +01:00
M. L. Giannotta 4651f64341 Storybook and TS migration of ReadMore component (https://github.com/woocommerce/woocommerce-blocks/pull/5300)
* Update packages to latest Storybook deps

* Migrate `ReadMore` component and its utils to TypeScript

* Add type definitions for `trim-html` package

* Migrate `ReadMore` stories to newest Storybook

Fixes woocommerce/woocommerce-blocks#5254
2021-12-06 18:00:33 +01:00
Albert Juhé Lluveras b7051c8cd0 Fix JS error in Filter Products by Attribute block (https://github.com/woocommerce/woocommerce-blocks/pull/5301) 2021-12-06 11:03:18 +01:00
Alex Florisca 0a8415e3a6 More ts conversions (https://github.com/woocommerce/woocommerce-blocks/pull/5263)
* WIP

* Converted block-error-boundary to TS

* Convert CheckboxList to TS

* Converted Chip and Removable Chip components to TS

* Change type to React.FC<T>

* Fix tests

* Implement Lucio feedback
2021-12-03 17:23:25 +00:00
Albert Juhé Lluveras 48a29c5bba Refactor Mini Cart contents block unmount to fix ESLint warning (https://github.com/woocommerce/woocommerce-blocks/pull/5216) 2021-12-03 11:37:15 +01:00
Luigi Teschio 2358c0c90b Mini Cart block: Add label for tax when it should be visible in accordance with WC settings (https://github.com/woocommerce/woocommerce-blocks/pull/5184)
* Mini Cart block: Add label for tax when it should be visible in accordance with WC settings woocommerce/woocommerce-blocks#4849

Mini Cart block: Add label for tax when it should be visible in accordance with WC settings

* improve the tax label handling

* fix code after conflict

* fix tax label handling when it is added the first product

* add another check for avoid PHP error

* rename variables; add test for the function getSettingWithCoercion

* add margin-right for tax-label; add test to check if type guard works correctly
2021-12-03 10:45:06 +01:00
Alex Florisca e8b4b3467c Fix Featured Product Search not working for large stores (https://github.com/woocommerce/woocommerce-blocks/pull/5156)
* Remove the dependency from the getProducts useEffect

* using ref instead of empty dependency array for useEffect
2021-12-02 18:51:46 +00:00
M. L. Giannotta 12bb68d970 Storybook and TS migration of `Icon` component (https://github.com/woocommerce/woocommerce-blocks/pull/5291)
* Migrate icons to TypeScript

* Fix `Icons` stories (https://github.com/woocommerce/woocommerce-blocks/pull/5257)

* Enable the correct controls
* Include a base story with a default icon and all controls
* Include a second story with the filterable icons library (no controls)

Fix woocommerce/woocommerce-blocks#5257
2021-12-02 17:56:53 +01:00
M. L. Giannotta bee06b6005 Storybook and TS migration of `ErrorPlaceholder` component (https://github.com/woocommerce/woocommerce-blocks/pull/5294)
* Convert `ErrorPlaceholder` and `ErrorMessage` to TypeScript

* Add stories for `ErrorPlaceholder` and `ErrorMessage` (https://github.com/woocommerce/woocommerce-blocks/pull/5255)

Stories include:

* Default generic error
* API error
* Unknown error
* Error without possibility to retry
* Base Error atom

Where applicable, the **Retry** button will not only trigger the appropriate
action, but also simulate the loading state of the error component.

* Update references to `ErrorMessage` component to leave the file extension out

Fix woocommerce/woocommerce-blocks#5255
Refs woocommerce/woocommerce-blocks#5249
2021-12-02 17:56:03 +01:00
M. L. Giannotta 66454293c1 Fix `ExternalLinkCard` story (https://github.com/woocommerce/woocommerce-blocks/pull/5256) (https://github.com/woocommerce/woocommerce-blocks/pull/5292) 2021-12-02 17:38:39 +01:00
Luigi Teschio dfef363e15 Add global style for Product Categories List block (https://github.com/woocommerce/woocommerce-blocks/pull/5133)
* Add global style for product categories list block woocommerce/woocommerce-blocks#4965

Add global style for product categories list block

* add support for link color

* add feature flag

* fix code style and PHP warning

* update doc comment

* remove empty space

* refactor StyleAttributesUtils (https://github.com/woocommerce/woocommerce-blocks/pull/5277)

Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2021-11-30 16:28:45 +01:00
Luigi Teschio 67ad9e4f27 Mini Cart Block: add link to edit template part from sidebar (https://github.com/woocommerce/woocommerce-blocks/pull/5201)
* Mini Cart Block: add link to edit template part from sidebar woocommerce/woocommerce-blocks#5186

Mini Cart Block: add link to edit template part from sidebar

* fix e2e tests
2021-11-30 10:42:07 +01:00
Alex Florisca a9fbc828c0 Product details component accepts `key` or `name` as props (https://github.com/woocommerce/woocommerce-blocks/pull/5165)
* Product details metadata now accepts  as a default prop, with  as an optional alternative

* Updated product details test snapshot

* Don't overwrite key prop

* One of key or value must be entered in ProductItemResponseData type
2021-11-30 09:39:55 +00:00
Alex Florisca d9bf1ba94c Convert components to Typescript (https://github.com/woocommerce/woocommerce-blocks/pull/5241)
* Convert ReturnToCartButton component to TS

* Convert FormStep component to TS

* Remoe proptypes from FormStep and AddressFormn components

* Converted order-summary component to TS

* Convert product-price component to TS

* alias path to type-defs

* Fix errors

* Changes from Thomas feedback

* Change minPrice maxPrice logic to be more robust

* Changed types from inline to interface in ReturnToCartButton component

* Check for string type in order-summary-item

* add missing isString check
2021-11-26 17:03:12 +00:00
Mike Jolley c067e990b4 Introduce `<Noninteractive>` component to disable form elements non-visually (https://github.com/woocommerce/woocommerce-blocks/pull/5157)
* Noninteractive component based on Disabled

* Implement in cart/checkout

* Pass down props

* Update 'use-debounce' library

* aria disabled
2021-11-26 14:47:37 +00:00
Tung Du 1225b2680b Mini Cart block: allow left, right and center alignment (https://github.com/woocommerce/woocommerce-blocks/pull/5171) 2021-11-23 06:40:24 +07:00
Seghir Nadir d345a0004a replace synchronizeBlocksWithTemplate with createBlocksFromInnerBlocksTemplate (https://github.com/woocommerce/woocommerce-blocks/pull/5040) 2021-11-22 12:45:48 +00:00
Mike Jolley 128ef97010 Fix manual entry within Quantity Inputs (https://github.com/woocommerce/woocommerce-blocks/pull/5197)
* Use Number.isNaN to cast strings

* Avoid changing type function
2021-11-22 12:09:00 +00:00
M. L. Giannotta 06f635bcf7 Checkout Terms Block: Fix Terms and Conditions checkbox position in editor (https://github.com/woocommerce/woocommerce-blocks/pull/5150) (https://github.com/woocommerce/woocommerce-blocks/pull/5191)
Within the editor, the checkbox appeared aligned at the bottom of the paragraph, while
on the front-end it would appear aligned at the top. The alignment was actually correct
but a top margin was assigned to checkboxes in the backend.

Instead of removing that globally, this commit resets it for checkboxes within the checkout
block.
2021-11-22 11:12:13 +01:00
Raluca Stan edbef32a6f Pass to registered payments a wrapper component to handle the loading state (https://github.com/woocommerce/woocommerce-blocks/pull/5135) 2021-11-22 10:41:54 +01:00
Mike Jolley 3b1bedd15f Checkbox Component Styling Fix (https://github.com/woocommerce/woocommerce-blocks/pull/5164)
* Wrap label in div to prevent clickable area growing too large

* Prevent pointer events on svg

* Double gap in editor
2021-11-22 09:52:43 +01:00
Tung Du 84039af8b3 Fix: use custom compatibility notice style (https://github.com/woocommerce/woocommerce-blocks/pull/5147) 2021-11-22 08:48:27 +07:00
Albert Juhé Lluveras bbaa4d8798 Mini Cart as template part (https://github.com/woocommerce/woocommerce-blocks/pull/5025)
* Fix wrong event prefix in doc comment

* Make className prop in CartLineItemsTableProps optional

* Mini Cart as template part

* Remove BlockTemplatePartsController and instead use BlockTemplatesController

* Remove old code

* Clean up frontend rendering

* Update tests

* Improve if clause

* Fix wrong tests title

* Fix wrong variable name

* Make sure Mini Cart contents block is unmounted whem mini cart closes or unmounts

* Remove unnecessary waitFor

* Fix PaymentMethodDataProvider wrong children type

* TypeScript fixes

* Make comment shorter

* Remove test code

* Fix contant unmounts of Mini Cart contents block

* Fix wrong template_type passed

* Set Template part area to 'uncategorized'

* Set Template part area to the correct value

* Move template dir check outside loop
2021-11-19 12:47:48 +01:00
Seghir Nadir 65233c4e86 Move Checkout i1 -> i2 migration code to registerBlockType (https://github.com/woocommerce/woocommerce-blocks/pull/5140)
* move migration code to registerBlockType

* fix name and account for default value

* check for isset
2021-11-19 11:49:33 +01:00
M. L. Giannotta ae4856b92b Legacy Template Block: Remove the deletion lock (https://github.com/woocommerce/woocommerce-blocks/pull/5166) (https://github.com/woocommerce/woocommerce-blocks/pull/5176)
Previously, our legacy template block was locked to prevent the users from
removing it. The block could however be removed by erasing the parent, so
this change allows the user to directly remove the block itself.

Also:
Closes woocommerce/woocommerce-blocks#5163
Closes woocommerce/woocommerce-blocks#5109
2021-11-17 17:15:18 +01:00
Tung Du 2b7d906133 Add global style support to Mini Cart (button) (https://github.com/woocommerce/woocommerce-blocks/pull/5100) 2021-11-17 22:39:07 +07:00
Albert Juhé Lluveras ca3734b8bf Remove feature gate condition for Legacy Template block (https://github.com/woocommerce/woocommerce-blocks/pull/5158) 2021-11-16 17:55:08 +01:00
Seghir Nadir 888ea29ce1 Make order note block removable (https://github.com/woocommerce/woocommerce-blocks/pull/5139)
* unforce order note

* show block in inserter
2021-11-16 20:12:25 +07:00
Alex Florisca 78c846bddc Fix 'Country is required' error on the Cart block when updating shipping address (https://github.com/woocommerce/woocommerce-blocks/pull/5129)
* Fix  error on the Cart block

* Created a cartIsHydrated variable in useStoreCart hook and used this to update the billing address in the internal state of the useCustomerData hook

* Fix the country is required error on the Cart page using refs

* Separate api calls to update shipping and billingUpdate billing and shipping addresses only when needed in API calls

* Remove redundant check for customerDataToUpdate

* remove use of refs in initial values

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2021-11-16 12:39:43 +00:00
Thomas Roberts 5626d4aeec Re-add experimental discounts meta slot to checkout (https://github.com/woocommerce/woocommerce-blocks/pull/5149) 2021-11-16 11:00:44 +00:00
Alex Florisca 6946750ea3 Added a placeholder to the product search block editor (https://github.com/woocommerce/woocommerce-blocks/pull/5122)
* Added a placeholder to the product search block editor to indicate that the user can change the placeholder on the front end

* Changed the placeholder to be translatable
2021-11-12 14:58:30 +00:00
Niels Lange 545c58cf3c Prevent justified texts due to accessibility reasons (https://github.com/woocommerce/woocommerce-blocks/pull/5120) 2021-11-12 19:57:11 +07:00
Luigi Teschio b5875d13ca Improve title for edit button (https://github.com/woocommerce/woocommerce-blocks/pull/5113)
* Improve title for edit button woocommerce/woocommerce-blocks#1689

Improve title for edit button

* fix edit title for Product By Attribute and All Products blocks
2021-11-10 14:53:07 +01:00
Mike Jolley a76e00bd83 Move checkbox control to checkout package (https://github.com/woocommerce/woocommerce-blocks/pull/5045)
* Move checkbox control to checkout package

* Revert import change in editor
2021-11-09 16:47:46 +00:00
Seghir Nadir 6592796ff0 Add cart item classname filter (https://github.com/woocommerce/woocommerce-blocks/pull/4992)
* Add cartItemClass filter for cart line items

* Add cartItemClass, originally implemented in 96f18443bc

* add filter to order summary items

Co-authored-by: Manos Psychogyiopoulos <psyx@somewherewarm.net>
2021-11-09 15:15:35 +00:00
Mike Jolley 70f0c06bf9 Fix e2e tests welcome guide/m1 mac support (https://github.com/woocommerce/woocommerce-blocks/pull/5096)
* Bump dependencies to fix e2e on m1 macs

* Disable welcome guide more reliably - see 3da717b8d0/packages/e2e-test-utils/src/create-new-post.js

* Update selectors and fixture data for cart block

* unused dep

* Remove duplicate block wrapper

* Remove unused jest configuration files

* More robust click in view switcher test

* Revert fixture data change
2021-11-09 13:18:55 +00:00
Niels Lange ae9de9ea32 Fix text domain validation problems (https://github.com/woocommerce/woocommerce-blocks/pull/5095)
* Ignore validation of text domain 'woocommerce-gateway-stripe'
* Add missing 'woo-gutenberg-products-block' textdomain
2021-11-08 21:07:42 +07:00
Niels Lange 1a0706052e Correct textdomain from 'woo-gutenberg-product-blocks' to 'woo-gutenberg-products-blocks' (https://github.com/woocommerce/woocommerce-blocks/pull/5020)
* Correct text domain
2021-11-08 19:43:51 +07:00
Ovidiu Liuta 5a9638044e Twenty Nineteen: Price slider track fix padding/border (https://github.com/woocommerce/woocommerce-blocks/pull/4925)
* woocommerce/woocommerce-blocks#3902 price slider track fix padding/border

* adding css comments for the change

* Update style.scss
2021-11-05 15:29:30 +01:00
Luigi Teschio 935c8df275 Product Search: Fix Search label alignment on the edit page (https://github.com/woocommerce/woocommerce-blocks/pull/5072)
* Fix product search margin style on edit page woocommerce/woocommerce-blocks#3083

Fix product search margin style on edit page

* fix button size
2021-11-05 15:24:37 +01:00
Seghir Nadir bcd1d69c46 pass blockWrapper to forcedBlocks (https://github.com/woocommerce/woocommerce-blocks/pull/5069) 2021-11-04 13:42:30 +01:00
Ovidiu Liuta 7535fb1531 fixing checkout block shipping method encoding (https://github.com/woocommerce/woocommerce-blocks/pull/5030) 2021-11-04 12:00:22 +00:00
Luigi Teschio 820996235e Fix conflict between mini-cart and navigation blocks (https://github.com/woocommerce/woocommerce-blocks/pull/5051)
fix conflict between mini-cart and navigation blocks
2021-11-04 12:31:56 +01:00
Mike Jolley 72cf5eade8 Remove hydration hocs in favour of apiFetch Middlewares (https://github.com/woocommerce/woocommerce-blocks/pull/5022)
* Remove withRestApiHydration

* Preload checkout data via setting - server data is required for this block

* Handle cart hydration using createPreloadingMiddleware which removes the need for HOCs

* Rename variable

* Remove withStoreCartApiHydration and timestamp checking

* Empty test file
2021-11-04 11:05:58 +00:00
Seghir Nadir d70c309c37 expose with-filtered-attributes (https://github.com/woocommerce/woocommerce-blocks/pull/5058) 2021-11-04 11:03:33 +00:00
Michael P. Pfeiffer fa58d34da4 Store Editing Templates v1: add basic taxonomy block templates (https://github.com/woocommerce/woocommerce-blocks/pull/5063)
* Add taxonomy block templates

* Change Category template display name

* Check for product category/tag taxonomy explicitely

* Group archive templates in LegacyTemplate
2021-11-03 17:55:52 +01:00
Luigi Teschio e1b1267e27 Fix sale badge alignment on smaller screen (https://github.com/woocommerce/woocommerce-blocks/pull/5061)
fix sale badge alignment on smaller screen
2021-11-03 14:48:57 +01:00
Tom Cafferkey 927af6ea26 Add Single Product Block Template (https://github.com/woocommerce/woocommerce-blocks/pull/5054)
* Add single-product.html template to render core PHP template

* Update placeholder SVG
2021-11-03 09:31:47 +00:00
Michael P. Pfeiffer 5cc32dbfae Store Editing Templates v1: add a basic Product Archive block template (https://github.com/woocommerce/woocommerce-blocks/pull/5049)
* Add the Archive Product block template

* Use template slug if no template title is set

* Add page icon as per design

* Add the basic archive product block template
2021-11-02 15:42:07 +01:00
Tom Cafferkey be3ce8423e Abstract LegacyTemplate block (https://github.com/woocommerce/woocommerce-blocks/pull/4991)
* Legacy Template block

* Return render_single_product value

* Make placeholder text translatable

* Don't allow removing the block

* Update block title

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2021-10-29 08:31:50 +01:00
Tung Du 587a7018da Fix: Mini Cart block: update button style (https://github.com/woocommerce/woocommerce-blocks/pull/4907)
Co-authored-by: Michael P. Pfeiffer <frontdevde@users.noreply.github.com>
2021-10-29 09:35:17 +07:00
Tung Du 9b1a289683 Add global styles to Product Title block (https://github.com/woocommerce/woocommerce-blocks/pull/5009)
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2021-10-28 22:51:25 +07:00
Tung Du e60405689d Mini Cart block: add footer (subtotal, cart & checkout buttons and payment method icons) (https://github.com/woocommerce/woocommerce-blocks/pull/4982)
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2021-10-28 22:48:39 +07:00
Ovidiu Liuta 5b2d24da36 Fix: Adding a visual border to products image placeholder (https://github.com/woocommerce/woocommerce-blocks/pull/4950)
* fixing all products image placeholder border

* fixing grid placeholder image border

* fixing cart checkout product image placeholder border

* order summary product image placeholder border fix

* revert fixing cart checkout product image placeholder border

* fixing product elements atomic block placeholder border

* fixing failing tests for cart-checkout test and class rename

* adding border style mixin

* newline addon

* linting fix and esc_attr addon

* adding border color to _colors.scss abstracts

* fixing cart-checkout block scss color

* removing class names from product-elements atomic block placeholder images

* css linting fix

* css linting fix

* css linting fix

* fixing empty className in cart-checkout

* adding cart-checkout fallback alt text to product name and css changes empty alt placeholder

* adding image fallback alt to AbstractProductGrid

* updating checkout snapshot to include alt

* code style changes

* removing unused scss code

* adding img alt style fix to prevent global changes
2021-10-28 13:57:20 +01:00
Seghir Nadir ad133ba901 Return an element instead of a component in useViewSwitcher (https://github.com/woocommerce/woocommerce-blocks/pull/5016)
* return element instead of component in viewSwitcher

* use ToolbarGroup instead of Toolbar
2021-10-27 16:41:57 +01:00
Mike Jolley 04cd927195 Add inline note around displayWithTax to clarify why prices change (https://github.com/woocommerce/woocommerce-blocks/pull/4979)
* Add inline note around displayWithTax to clarify why prices change

* update snaps

* Snap update

* Clarify docs further for displayCartPricesIncludingTax

* Update assets/js/previews/cart.ts

Co-authored-by: Michael P. Pfeiffer <frontdevde@users.noreply.github.com>

Co-authored-by: Michael P. Pfeiffer <frontdevde@users.noreply.github.com>
2021-10-26 15:03:51 +02:00
Seghir Nadir 3ce06eb87b migrate aligment options (https://github.com/woocommerce/woocommerce-blocks/pull/4986) 2021-10-25 17:42:31 +01:00
Albert Juhé Lluveras 4253a5fe10 Make Mini Cart block react to removed_from_cart events (https://github.com/woocommerce/woocommerce-blocks/pull/4947)
* Make Mini Cart block react to removed_from_cart events

* Move listening to add to cart and remove from cart events to the useStoreCart hook

* Add tests
2021-10-25 18:05:01 +02:00
Seghir Nadir dc1f979ae1 Add custom className support to Cart Inner Blocks (https://github.com/woocommerce/woocommerce-blocks/pull/4985)
* move empty cart

* remove Cart and rename Cart i2 to Cart

* graduate blocks

* setup template migration from Cart i1 to Cart i2

* back to js so we have a good diff

* add migration

* fix bug in empty cart template

* add useForceLayout hook to edit

* migrate from old block to new block

* migrate styles

* respect align

* add tests

* Include latest cart line item improvements from cart-i1

* Missing changes from cart-i1

* Line items table should be disabled

* Fix e2e tests for cart i2

* update tests to adapt for inner blocks

* update select to resolveSelect to remove warning checker

* rename test/block to test/index

* move blocks to their own file

* undo rename to keep diff clean

* remove .tsx and update jest config

* Revert "update select to resolveSelect to remove warning checker"

This reverts commit 79d55de30edcfe36bbdfe7506df7a09460824f03.

* revert resolveControl

* Fix empty cart editor E2E test by scrolling to the view switch

* parse attributes for order summary block

* migrate attributes when resaving

* Update documentation

Automatic update after running npm run build:docs

* add classname support to accepted payment methods block

* add classname support to express payment methods block

* add classname support to cart items  block

* add classname support to cart line items block

* add classname support to order summary block

* add classname support to totals block

* add classname support to empty cart  block

* add classname support to filled cart block

* add classname support to proceed to checkout block

* type edit

Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Raluca Stan <ralucastn@gmail.com>
2021-10-25 16:31:22 +01:00
Raluca Stan 357a1265cb Add a loading state to Cart i2 (https://github.com/woocommerce/woocommerce-blocks/pull/4980)
* Add a loading state to Cart i2

We use CSS and the is-loading class to hide empty state and show regular state

* Lint cart/style.scss
2021-10-25 16:31:12 +01:00
Seghir Nadir 2408e34faa Migrate Cart i1 to Cart i2 (https://github.com/woocommerce/woocommerce-blocks/pull/4973)
* move empty cart

* remove Cart and rename Cart i2 to Cart

* graduate blocks

* setup template migration from Cart i1 to Cart i2

* back to js so we have a good diff

* add migration

* fix bug in empty cart template

* add useForceLayout hook to edit

* migrate from old block to new block

* migrate styles

* respect align

* add tests

* Include latest cart line item improvements from cart-i1

* Missing changes from cart-i1

* Line items table should be disabled

* Fix e2e tests for cart i2

* update tests to adapt for inner blocks

* update select to resolveSelect to remove warning checker

* rename test/block to test/index

* move blocks to their own file

* undo rename to keep diff clean

* remove .tsx and update jest config

* Revert "update select to resolveSelect to remove warning checker"

This reverts commit 79d55de30edcfe36bbdfe7506df7a09460824f03.

* revert resolveControl

* Fix empty cart editor E2E test by scrolling to the view switch

* parse attributes for order summary block

* migrate attributes when resaving

* Update documentation

Automatic update after running npm run build:docs

* add align options to filled cart and empty cart

* append instead of replcae

* import style.scss in frontend

Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Raluca Stan <ralucastn@gmail.com>
2021-10-25 15:46:34 +01:00
Tung Du bd3e7126f8 Mini Cart block: display a compatibility notice when the user first adds the block in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/4945) 2021-10-21 16:07:20 +07:00
Tom Cafferkey b8fbb56055 Convert Title component to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/4891)
* Convert sharedConfig and Title blockConfig to TS

* Convert constants.tsx to TS

* Convert attributes.js to TS

* Amend attributes.ts record type

* Convert title component edit.js to TS

* Convert title component block.js to TS

* Amend product name index.tsx to prevent TS errors in product title block.tsx

* Amend product-name and base tsconfig

* Add rel to ProductName component element

* Replace ReactElement with JSX.Element

* Move TagName component to outside of the main component

* Add HTMLAttributes import

* WIP: Add props to TagName component

* Fix TagName typing

* Update TagName interface

* Replace ReactElement typing with JSX.Element

* Code review feedback amends

* Replace return type undefined to void

Co-authored-by: Michael P. Pfeiffer <michael@cssconf.eu>
2021-10-21 09:58:03 +01:00
Mike Jolley 5cd05b6d99 Add custom className support to Checkout Inner Blocks (https://github.com/woocommerce/woocommerce-blocks/pull/4978)
* Pass classname from DOM to react components

* Actions Block ClassName support

* Form step field classname support

* Payment block className support

* Classname support for fields and totals

* Order summary classname support

* Classname support for order note block

* Express payment classname support

* Terms block custom class

* Let useBlockProps handle class in actions block
2021-10-20 17:18:13 +01:00
Mike Jolley c4be7ca307 Styling (margin and padding) tweaks (https://github.com/woocommerce/woocommerce-blocks/pull/4974) 2021-10-20 17:02:05 +01:00
Raluca Stan a1046eb95e Add empty cart to Cart i2 (https://github.com/woocommerce/woocommerce-blocks/pull/4976) 2021-10-20 15:42:57 +01:00
Niels Lange 02dbd8bf4f Correct WooCommerce branding color (https://github.com/woocommerce/woocommerce-blocks/pull/4959) 2021-10-20 10:30:16 +01:00
Seghir Nadir 7c8becccd7 Move shared code between Cart and Checkout into single folder. (https://github.com/woocommerce/woocommerce-blocks/pull/4961)
* move shared code out of checkout into shared folder

* move code from cart i2 to shared folder

* move columns

* move viewSwitcher

* code cleanup inside Cart i2
2021-10-19 15:29:12 +01:00
Seghir Nadir 91296b09cc Update blocks-registry docs (https://github.com/woocommerce/woocommerce-blocks/pull/4946)
* add handleMap

* remove useValidation from cart blocks

* add namespace options to docs

* Update packages/checkout/blocks-registry/README.md

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* expand on the docblock

* Update packages/checkout/blocks-registry/README.md

Co-authored-by: Mike Jolley <mike.jolley@me.com>

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
2021-10-19 14:05:26 +01:00
Mike Jolley 3840462cf0 Add Accepted Payment Methods Block (https://github.com/woocommerce/woocommerce-blocks/pull/4944)
* Remove icons from checkout button

* Add new block type

* Register new block

* Remove unused attribute

* Add to new template

* Remove duplicate attributes

* Update Inner Block handling to use consistent appender and unlock payment methods
2021-10-19 12:23:33 +01:00
Mike Jolley dad8331242 Cart i2 Attribute Audit (https://github.com/woocommerce/woocommerce-blocks/pull/4956)
* Add dark mode inputs toggle to top level block

* Remove top level attributes which moved to inner blocks

* Remove unused components

* Pass down hasDarkControls and currentView via context props
2021-10-18 17:12:36 +01:00
Niels Lange 3f530ac755 Add e2e tests for Best Selling Products (https://github.com/woocommerce/woocommerce-blocks/pull/4785) 2021-10-18 15:06:48 +01:00
Tung Du 277a20cca3 Fix: Spilled icecream error with Filter Products by Attribute when no attribute was selected (https://github.com/woocommerce/woocommerce-blocks/pull/4847) 2021-10-15 21:50:47 +07:00
hafhaf10 4d0ba20d6d Fix correct branding color (https://github.com/woocommerce/woocommerce-blocks/pull/4911)
* Correct WooCommerce branding color

* Correct WooCommerce branding color

* Fixed lowercase colors

* Changed color in more files
2021-10-15 15:27:59 +01:00
Albert Juhé Lluveras c5bf549d9f Add Mini Cart block tests (https://github.com/woocommerce/woocommerce-blocks/pull/4938) 2021-10-15 12:53:44 +02:00
Mike Jolley 901a78979e Fix positioning of default locked blocks in the editor and frontend (https://github.com/woocommerce/woocommerce-blocks/pull/4937)
* Update default empty template on server side

* template->registeredBlocks wording

* useForcedLayout: insert in correct place

* Remove test div

* Clarify inline docs

* Apply changes to cart block
2021-10-15 10:48:57 +01:00
Raluca Stan 05dc130d21 Register as experimental the Cart i2 blocks and update the feature flag documentation (https://github.com/woocommerce/woocommerce-blocks/pull/4936)
* Use registerExperimentalBlockType for registering Cart i2 related blocks

* Update feature flags and experimental interfaces doc
2021-10-14 13:44:46 +01:00
Ovidiu Liuta eb0ddbe29a Add a label to the textarea from the editor view of the Product search block (https://github.com/woocommerce/woocommerce-blocks/pull/4905)
* woocommerce/woocommerce-blocks#1682 fixing product search accesibility label

* fix duplicate text annoncement

* removing aria-hidden from label
2021-10-14 11:27:05 +01:00
Niels Lange 63b7766586 Increase error message spacing (https://github.com/woocommerce/woocommerce-blocks/pull/4896) 2021-10-14 12:05:13 +07:00
Tom Cafferkey 0f4161aff9 Convert CategoryList to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/4909)
* Converted config files

* Converted constants file

* Converted attributes file

* Coverted edit file

* Convert block file

* Remove space from config
2021-10-12 09:21:00 +01:00
Ovidiu Liuta ae603f3e82 WordPress Coding Standards fix for .scss files (https://github.com/woocommerce/woocommerce-blocks/pull/4918)
* adding timerange limit

* woocommerce/woocommerce-blocks#3739 fixing scss coding standard and removing spaces from parantheses values

* removing unrelated changes

* fixing further instances for parantheses
2021-10-11 14:18:32 +01:00
Michael P. Pfeiffer e39f175a0f Convert product elements shared config to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/4908)
* Convert product elements shared config to TypeScript

* Limit import to type

* Convert deprecated empty save function

* Add comment explaining omitted attributes and title properties

Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>
2021-10-07 15:42:49 +02:00
Tom Cafferkey c7e966fd28 Fix/price slider aria values (https://github.com/woocommerce/woocommerce-blocks/pull/4839)
* Calculate human readable price values for the purpose of screen readers and set them as the aria values

* Calculate human readable price values for the purpose of screen readers and set them as the aria values
2021-10-06 09:48:17 +01:00
Tom Cafferkey ee84901ab8 AttributePicker: Set default values if they exist (https://github.com/woocommerce/woocommerce-blocks/pull/4815)
* Update API to add default boolean to attribute values and use this within the component to set the default attributes.

* Modify and add unit tests for isObject and getDefaultAttributes

* Sanitize attribute name to accommodate for custom attributes being default values.

* Comments for sanitized_attribute_name variable

* Remove second argument from getAttributes
2021-10-06 09:48:13 +01:00
Tung Du edce72e2fb Mini Cart block: improve button accessibility (https://github.com/woocommerce/woocommerce-blocks/pull/4852) 2021-10-04 10:54:28 +07:00
Tung Du 0f2c035423 Fix: remove IntersectionObserver shim (https://github.com/woocommerce/woocommerce-blocks/pull/4808) 2021-09-30 22:58:32 +07:00
Tung Du c1dc6dbc39 Fix: Filter button is not aligned with the input field (https://github.com/woocommerce/woocommerce-blocks/pull/4814)
* fix: filter button alignment

* fix: add dipsplay style class to .wc-block-attribute-filter for easier styling

* fix: overflow inside colum
2021-09-30 11:09:15 +02:00
github-actions[bot] cd5e31d9ba Release: 6.0.0 (https://github.com/woocommerce/woocommerce-blocks/pull/4850)
* Empty commit for release pull request

* add changelog

* change minimum_supported_wp_version to 5.6

* add testing instructions

* update testing steps with new code

* add terms and condition block testing steps

* Checkout i2: Show a notice if terms and conditions page (https://github.com/woocommerce/woocommerce-blocks/pull/4859)

* Make Terms block insertable

* add a notice to setup pages

* push updated error design in editor

* fix default text

* remove outline from checkbox-control in error

* update testing docs

* Update readme.txt

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

* Update readme.txt

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

* Update docs/testing/releases/600.md

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

* Update docs/testing/releases/600.md

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2021-09-29 11:23:49 +01:00
Seghir Nadir f01072fda1 Checkout i2: Show a notice if terms and conditions page (https://github.com/woocommerce/woocommerce-blocks/pull/4859)
* Make Terms block insertable

* add a notice to setup pages

* push updated error design in editor

* fix default text
2021-09-28 16:01:48 +01:00
Mike Jolley 1aaa00ed2a Cart i2: view switcher shared to children (https://github.com/woocommerce/woocommerce-blocks/pull/4817)
* Replace context with __experimentalShareWithChildBlocks

* Switch to parent block when changing views

* Swap order of views

* Drop default, use first view

* Improve block selection after changing views
2021-09-24 16:13:39 +01:00
Seghir Nadir 8e38c6b857 add blockProps to T&C block (https://github.com/woocommerce/woocommerce-blocks/pull/4843) 2021-09-24 15:59:41 +01:00
Seghir Nadir 244a2baa48 remove duplicate context (https://github.com/woocommerce/woocommerce-blocks/pull/4832) 2021-09-24 15:37:16 +01:00
Seghir Nadir 7769e437ef remove sample block (https://github.com/woocommerce/woocommerce-blocks/pull/4841) 2021-09-24 15:28:09 +01:00
Seghir Nadir f1c936b7d1 Add Cart Totals to cart i2 (https://github.com/woocommerce/woocommerce-blocks/pull/4823)
* WIP getting to work on frontend

* restore frontend.tsx

* fix layout

* support emtpy cart in frontend

* add cart tital to correct place and move useEffect
2021-09-24 15:23:10 +01:00
Seghir Nadir 1d75435820 scope changes to checkout steps only (https://github.com/woocommerce/woocommerce-blocks/pull/4827) 2021-09-24 15:11:51 +01:00
Mike Jolley 04387a7726 Checkout i2: Handle text nodes in inner block rendering (https://github.com/woocommerce/woocommerce-blocks/pull/4822)
* Handle text nodes

* Tidy and add inline doc
2021-09-24 15:06:21 +01:00
Seghir Nadir f9f70893e0 Update Cart & Checkout i2 temporarily locking to be on the parent block (https://github.com/woocommerce/woocommerce-blocks/pull/4837)
* update locking to be on parent, not block

* include cart as well
2021-09-24 14:44:05 +01:00
Raluca Stan a2f39d07f1 Add documentation for registerPaymentMethodExtensionCallbacks (https://github.com/woocommerce/woocommerce-blocks/pull/4834)
* Improve the type for callbacks registered by extensions

The previous type was CanMakePaymentCallback, used for the payment methods's own canMakePayment callbacks, which could also return Promises. In order to eliminate the confusion, a new type has been created that defines callbacks that only return true or false.

* Document registerPaymentMethodExtensionCallbacks

* Update docs/extensibility/filtering-payment-methods.md

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Add information about payment method name in documentation

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2021-09-24 14:34:07 +01:00
Raluca Stan 8a657c32da Improve mocking of useStoreCart (https://github.com/woocommerce/woocommerce-blocks/pull/4826) 2021-09-24 10:47:05 +01:00
Seghir Nadir b6167bc179 Cart i2: Render filled and empty Carts on frontend (https://github.com/woocommerce/woocommerce-blocks/pull/4802)
* WIP getting to work on frontend

* restore frontend.tsx

* fix layout

* remove unit tests living where they shouldn't be living

* remove skeleton

* support emtpy cart in frontend

* remove extra todo

* use fragment instead of div

* Add empty cart event

* Remove extra fragment
2021-09-23 16:38:30 +01:00
Raluca Stan 27600b3309 Update canMakePayment to receive cart as argument and make it react to changes in billingData. (https://github.com/woocommerce/woocommerce-blocks/pull/4776)
* Add 	cartCoupons to canMakePayment argument

* Add cart to the paymentMethodArgument and improve the dependencies for the effect calling refreshCanMakePayments

* Debounce refreshCanMakePayments

The initial approach was to debounce billingData and use this value as a dependency for the useEffect that runs refreshCanMakePayments.
But because the depencies array can always change we decided to debounce the callback instead, ensuring this way that callback is not called multiple times: for example when typing a field in the billing address. Debounced was chosen instead of throttle because we want to call refreshCanMakePayments once the change event has stopped, with the final value.

* Update types and docs related to canMakePaymentArgument

* Mock the /cart call when testing payment methods

* Remove unused cartCoupons key in canMakePaymentArguments' interface
2021-09-23 16:27:02 +01:00
Ovidiu Liuta 63582e47b2 woocommerce/woocommerce-blocks#3906 screen reader fix for order summary block accessibility (https://github.com/woocommerce/woocommerce-blocks/pull/4810)
* woocommerce/woocommerce-blocks#3906 screen reader fix for order summary block

* removing tabIndex and extra accesibility text

* adding aria-hidden to total price and translation comments change order
2021-09-23 17:20:32 +02:00
Albert Juhé Lluveras d677ce2c70 Fix infinite recursion when removing an attribute filter from the Active filters block (https://github.com/woocommerce/woocommerce-blocks/pull/4816) 2021-09-23 13:53:24 +02:00
Raluca Stan 9f2cf245b9 Add support for extensions to filter express payment methods (https://github.com/woocommerce/woocommerce-blocks/pull/4774)
* Support express payment methods filtering by extensions

* Add tests for getCanMakePayment and fix payment tests' TS errors

* Add comments for payment-method-config-helper test
2021-09-23 10:09:55 +01:00
Mike Jolley 2c412b2b3b Cart i2: Toolbar based view switcher (https://github.com/woocommerce/woocommerce-blocks/pull/4811)
* New icons

* Add new view switcher

* Context to pass down component controls

* Implement switcher
2021-09-22 16:00:19 +01:00
Mike Jolley 2af90f301c Add/empty and fillted cart wrapper (https://github.com/woocommerce/woocommerce-blocks/pull/4803)
* Update area/types

* Add empty and filled block wrappers

* Add missing useBlockProps

* Add templates and inner block structure
2021-09-21 16:41:09 +01:00
Seghir Nadir 614c7205ef add CartCheckoutFeedbackPrompt to cart i2 (https://github.com/woocommerce/woocommerce-blocks/pull/4801) 2021-09-21 14:42:12 +01:00
Albert Juhé Lluveras bbbb280b4f Open Mini Cart drawer when adding to cart from the All Products block (https://github.com/woocommerce/woocommerce-blocks/pull/4772)
* Open Mini Cart drawer when adding to cart from the All Products block

* Rename param from invalidateCartData to preserveCartData
2021-09-21 15:25:44 +02:00
Seghir Nadir a459360dc1 Add Express Checkout block for Cart i2 (https://github.com/woocommerce/woocommerce-blocks/pull/4791)
* setup basic column blocks

* fix classnames

* move hacks back

* dubplciate columns

* add express payment block

* adjust styles

* fix locking after rebase
2021-09-21 13:38:56 +01:00
Seghir Nadir f2af87226c Adds Proceed to Checkout block to Cart i2 (https://github.com/woocommerce/woocommerce-blocks/pull/4783)
* setup basic column blocks

* fix classnames

* move hacks back

* dubplciate columns

* add proceed to checkout block

* dub code
2021-09-21 13:20:42 +01:00
Seghir Nadir aeb43084f7 Add Cart Summary block in cart i2 (https://github.com/woocommerce/woocommerce-blocks/pull/4782)
* setup basic column blocks

* fix classnames

* move hacks back

* dubplciate columns

* add summary block

* dub code
2021-09-21 12:58:36 +01:00
Mike Jolley cdc730836a Validate state on options change (https://github.com/woocommerce/woocommerce-blocks/pull/4761) 2021-09-21 11:48:39 +01:00
Seghir Nadir 91f9f160d9 Add Cart Line Items Block to Cart i2 (https://github.com/woocommerce/woocommerce-blocks/pull/4781)
* setup basic column blocks

* fix classnames

* move hacks back

* dubplciate columns

* add cart line items block

* dub code
2021-09-21 11:47:20 +01:00
Seghir Nadir 56551347a6 Setup basic column blocks for Cart i2 (https://github.com/woocommerce/woocommerce-blocks/pull/4780)
* setup basic column blocks

* fix classnames

* fix broken block.json in cart items block

* move hacks back

* dubplciate columns
2021-09-21 11:18:27 +01:00
Mike Jolley f9b9679d62 Switch to external icon for shipping/payment methods (https://github.com/woocommerce/woocommerce-blocks/pull/4760) 2021-09-21 11:01:12 +01:00
Mike Jolley 99f5a5aab3 Add object type to lock attributes (https://github.com/woocommerce/woocommerce-blocks/pull/4790) 2021-09-20 17:10:06 +01:00
Seghir Nadir f44784ffca Create Cart i2 block (https://github.com/woocommerce/woocommerce-blocks/pull/4718) 2021-09-17 16:29:58 +01:00
Mike Jolley da21021255 Show message if user has not yet calculated shipping (https://github.com/woocommerce/woocommerce-blocks/pull/4765) 2021-09-17 12:07:01 +01:00
Albert Juhé Lluveras c07fef9e57 Make All Reviews block honor 'ratings enabled' and 'show avatars' preferences (https://github.com/woocommerce/woocommerce-blocks/pull/4764)
* Make All Reviews block honor 'ratings enabled' and 'show avatars' preferences

* Only add space for image if image is rendered
2021-09-17 11:19:22 +02:00
Seghir Nadir 686bb662ad Update feature flags and experimental interfaces document. (https://github.com/woocommerce/woocommerce-blocks/pull/4750)
* add missing blocks and update old links

* features behind a feature flag

* update filters and JS methods

* Apply suggestions from code review

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2021-09-16 14:50:33 -04:00
Mike Jolley 5c08c75612 Update Checkout to Checkout i2 (https://github.com/woocommerce/woocommerce-blocks/pull/4745)
* Remove i2 from build

* Remove i2 php registration

* Rename old checkout dir

* Rename i2 dir

* Migrate i1 to i2 code

* Register block metadata to fix frontend rendering when migrating to i2

* Register in correct order

* Missing styles

* add register-components to side effectful list

* wrong block class in e2e test

* wp prefix missing on selector

* Fix top level block test

* Reselect labels to work around rerendering

* missing empty cart styles

* Consolodate duplicate styles

* remove init code

* update selectBlockByName

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2021-09-16 13:16:21 +01:00
Tom Cafferkey c967f72507 Products by Category: Move renderEmptyResponsePlaceholder to separate method (https://github.com/woocommerce/woocommerce-blocks/pull/4751)
* Move renderEmptyResponsePlaceholder to separate method

* Move EmptyResponsePlaceholder to its own separate component
2021-09-16 12:13:37 +01:00
Albert Juhé Lluveras 17c7fe95c4 Update Reviews blocks so they use block styles (https://github.com/woocommerce/woocommerce-blocks/pull/4323)
* Update Reviews blocks so they use block styles

* Don't allow changing link color in Reviews blocks

* Resize review image based on font size
2021-09-16 11:32:48 +02:00
Raluca Stan 615b939383 Add Typescript to /blocks-registry/payment-methods (https://github.com/woocommerce/woocommerce-blocks/pull/4702)
* Type payment method under /block-registry

* Type assertions and add them back to PaymentMethodConfig

* Type ExpressPaymentMethodConfig

* Fix comment on payments types

* Fix CanMakePayment type

* Fix assertion for payment methods and the savedTokenComponent property

Because class properties come from the config object, they will never be null except if somebody explicitly adds them the the object with a value of null.
Which is not the case for savedTokenComponent for example, because it's optional and that's why we check it like this paymentMethods[ activePaymentMethod ]?.savedTokenComponent

* Add the complete CanMakePaymentReturnType and account for null for PaymentMethod.icons

- canMakePayment can also return a Promise and this was not included in the type definition
- in PaymentMethodConfig's constructor we also need to account for extensions passing {icons: null}.

* Revert Fix assertion for payment methods and the savedTokenComponent property

* Fix failing tests because of savedTokenComponent

I've reverted my changes and left the initialization of savedTokenComponent as it was.

* Rename types for more clarity

* Fix ExtensionNamespace and PaymentMethodName types

* Rename Supports and *PaymentMethodOptions type for better clarity
2021-09-15 18:36:02 +02:00
Albert Juhé Lluveras e17be06287 Add types to legacy-events.js (https://github.com/woocommerce/woocommerce-blocks/pull/4742) 2021-09-15 17:28:34 +01:00
Mike Jolley cb185fabe5 Remove absolute positioning on error message (https://github.com/woocommerce/woocommerce-blocks/pull/4734) 2021-09-15 14:03:21 +01:00
Thomas Roberts 117b9dec7f Add tests for filtering payment methods (https://github.com/woocommerce/woocommerce-blocks/pull/4696)
* Add tests for registerPaymentMethodExtensionCallbacks

* Use the console mocks from @wordpress/jest-console

Overriding console.error with my own mock was unnecessary.

* Add tests for canMakePaymentWithExtensions

* Add tests for payment-method-config

* Apply suggestions from code review

Co-authored-by: Raluca Stan <raluca.stan@automattic.com>

* Apply suggestions from code review

* Change file types to .ts and .tsx

* Add test to check namespace is not overwritten

* Move overwriting test to new test case

This assertion feels different enough to warrant its own test case.

Co-authored-by: Raluca Stan <raluca.stan@automattic.com>
2021-09-15 14:40:40 +02:00
Albert Juhé Lluveras e042beaff3 Move Mini Cart block component into its own file (https://github.com/woocommerce/woocommerce-blocks/pull/4737) 2021-09-15 13:40:36 +02:00
Niels Lange 74bf23ce35 Twenty Twenty: Adjust font styles for filter and product grid blocks (https://github.com/woocommerce/woocommerce-blocks/pull/4749)
* Twenty Twenty: Adjust font styles for filter and product grid blocks

* Add missing CSS class for stock filter
2021-09-15 13:35:06 +02:00
Albert Juhé Lluveras e216a7c90c Fix calculation of number of reviews in Reviews by Category block (https://github.com/woocommerce/woocommerce-blocks/pull/4729)
* Remove unused code

* Fix incorrect number of reviews in Reviews by Category block

* Add error handling around get_term_children()
2021-09-15 11:58:00 +02:00
Thomas Roberts a2772a1cad Add E2E and Unit (PHP and JS) tests for Filter by Stock block. (https://github.com/woocommerce/woocommerce-blocks/pull/4682)
* Add back end E2E tests for Filter by Stock

* Add unit/snapshot tests for Filter by stock block

* Refactor Filter by Stock block to load stock statuses in the block body

This is required to make the code easier to test, since the mocked settings were being applied immediately after the block was imported, which didn't give time to let the `allSettings` override take place in the unit tests.

* Add PHP Unit tests for test_custom_stock_counts of ProductQueryFilters

* Remove useMemo from stock filter block

This felt like an overoptimisation, it's very inexpensive to run this every render. The result is less complex code, so it's better this way imo.

* Move initial stock options and the values they are derived from into useState

* Add class name to block in editor
2021-09-15 09:20:31 +01:00
Mike Jolley b543ee55cb Make h2 fill width of container (https://github.com/woocommerce/woocommerce-blocks/pull/4732) 2021-09-14 12:31:41 +01:00
Mike Jolley ad6521d250 Add focus styles to form elements (https://github.com/woocommerce/woocommerce-blocks/pull/4721) 2021-09-14 12:26:41 +01:00
Albert Juhé Lluveras 95ab1f3fc4 Improve accessibility when removing items from cart (https://github.com/woocommerce/woocommerce-blocks/pull/4673)
* Add custom close button label to Mini Cart drawer

* Add screen reader notice when removing an item from cart

* Focus next item from cart when an item is removed

* Add back CSS to hide close button label

* Don't focus previous item after the last one is removed

* Remove period from button label

* Don't show the number of items in Cart if Mini Cart is loading

This prevents displaying outdated data. That's specially important
for screen readers, because they were reading the outdated value
before it was replaced by the new one.

* Focus cart items table when last item in list is removed

* Use a ref to focus cart items table

* Use a ref to focus cart item table rows

* Fix empty cart if Mini Cart items have been removed

* Update snapshots
2021-09-14 08:09:45 +02:00
Albert Juhé Lluveras e95ad4ff43 Avoid exposing receiveCart to extensions (https://github.com/woocommerce/woocommerce-blocks/pull/4730) 2021-09-13 15:49:46 +02:00
Seghir Nadir 7d5d123340 wrap order summary block in disabled (https://github.com/woocommerce/woocommerce-blocks/pull/4720) 2021-09-10 16:51:45 +01:00
Mike Jolley a2cc77bd21 Hide tax row if totals are 0 (https://github.com/woocommerce/woocommerce-blocks/pull/4719) 2021-09-10 16:42:29 +01:00
Mike Jolley 40e438da35 Fix Checkout i2 mobile styling (https://github.com/woocommerce/woocommerce-blocks/pull/4699)
* Align fields based on mobile vs desktop views

* Improve string appearance in form steps

* Remove comment

* fix wrapper in editor
2021-09-10 15:04:42 +01:00
Seghir Nadir 148cb91a1e Expose Validation to 3PD blocks. (https://github.com/woocommerce/woocommerce-blocks/pull/4685)
* introduce useValidation hook

* remove the hook return

* simplfy validation to avoid infinit setState

* remove extra todo
2021-09-09 16:35:53 +01:00
Raluca Stan 3e96caaa3a Add extensibility point for extensions to filter payment methods (https://github.com/woocommerce/woocommerce-blocks/pull/4668)
* Add extensionsConfig when registering a payment method

The extension config has its own canMakePayment where extensions can add callback using a payment method's name.

* Make canMakePayment a getter on PaymentMethodConfig

Because extensions can register canMakePayment callbacks for a payment method before it is registered we need to transform
canMakePayment into a getter so that it's always recalculating it's value based on the registered callbacks/

* Rename extension related config and method

* Format comments

* Add an extension namespace to registerPaymentMethodExtensionCallback utility

 This commit changes the API for how extensions will register their own callbacks to canMakePayment, so that they can add their namespace and also callbacks for multiple payment methods.

* Format comments

* Update assets/js/blocks-registry/payment-methods/payment-method-config.js

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Update assets/js/blocks-registry/payment-methods/registry.js

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Update assets/js/blocks-registry/payment-methods/payment-method-config-helper.js

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Update assets/js/blocks-registry/payment-methods/payment-method-config-helper.js

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Update assets/js/blocks-registry/payment-methods/registry.js

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Fix eslint warning

* Handle errors at registerPaymentMethodExtensionCallbacks level

* Update assets/js/blocks-registry/payment-methods/registry.js

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Fix formatting issues

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2021-09-08 12:29:29 +01:00
Albert Juhé Lluveras fe18b218a6 Mini Cart block: add ?ver= query param to script URLs (https://github.com/woocommerce/woocommerce-blocks/pull/4689) 2021-09-08 13:17:30 +02:00
Mike Jolley 12aa09c72c Remove the Lock Attribute from the Checkout Sample Block
This prevents the sample block being injected by default when using Checkout i2.
2021-09-08 11:50:52 +01:00
Mike Jolley c891beab82 Update checkout block registration API to consume Block Metadata (https://github.com/woocommerce/woocommerce-blocks/pull/4684)
* Update registry to register components with block JSON metadata

* Use updated registration API in sample block

* remove editorScript

* Rename area and allow forced blocks to do it's thing without defining a template manually

* More naming consistency

* Validate a registered checkout block has at least one valid parent
2021-09-07 17:01:14 +01:00
Albert Juhé Lluveras decfe6c501 Open Mini Cart block when adding a product to cart via an AJAX call (https://github.com/woocommerce/woocommerce-blocks/pull/4666) 2021-09-07 10:27:16 +02:00
Mike Jolley b385d4005c Refactor Checkout Inner Block Registration and Render frontend forced blocks (https://github.com/woocommerce/woocommerce-blocks/pull/4671)
* Append forced blocks

* Fix child detection

* Improve render logic to remove clone element

* Areas instead of block names

* Revert "Areas instead of block names"

This reverts commit c8d68e6424313ed15ca1eb1f91a3edfc24d06a8d.

* revert area change

* Registration system

* Refactor block registration to handle components + forcing

* Remove need for atomic block registration

* add attributes to namespaced blocks only

* Update area names to new format

* Avoid passing custom props to DOM

* Put back usage of cloneelement for DOM elements

* correct case of innerBlockAreas

* Inline documentation for renderParentBlock

* Play nice with other attributes when registering forced blocks
2021-09-03 14:25:09 +01:00
Mike Jolley 7e7cf87dc0 Enqueue frontend assets on frontend only (https://github.com/woocommerce/woocommerce-blocks/pull/4675) 2021-09-03 10:04:21 +01:00
Mike Jolley 8631039550 Add missing checkout i2 inner block icons (https://github.com/woocommerce/woocommerce-blocks/pull/4655)
* Add column icons to wrapper blocks

* Order summary - totals icon

* Add fields icon and checkout actions icon

* Update block descriptions for consistency
2021-09-02 13:53:23 +01:00
Albert Juhé Lluveras f3ec10a89c Add Drawer component (https://github.com/woocommerce/woocommerce-blocks/pull/4608)
* Add Drawer component

* Use element dataset instead of a window global

* Rename miniCartOverlay to miniCartDrawerPlaceholder

* Refactor styles so screen overlay covers the entire screen

* Use rem instead of em for the drawer title size to keep it consistent between renders

* Keep focus when replacing the mini cart button

* Match overlay colors from designs

* Use is-loading class like several other blocks

* Add more doc comments

* Don't listen to clicks on Mini Cart button when it's open

* Update Drawer component styles
2021-09-02 11:44:25 +02:00
Albert Juhé Lluveras 794e50e53f Extract function from lazyLoadScript to simplify code (https://github.com/woocommerce/woocommerce-blocks/pull/4631)
* Extract function from lazyLoadScript to simplify code

* Prevent TS errors when assigning attributes to script element

* Update assets/js/base/utils/lazy-load-script.ts

Co-authored-by: Michael P. Pfeiffer <frontdevde@users.noreply.github.com>

* Update assets/js/base/utils/lazy-load-script.ts

Co-authored-by: Michael P. Pfeiffer <frontdevde@users.noreply.github.com>

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Michael P. Pfeiffer <frontdevde@users.noreply.github.com>
2021-09-02 08:46:08 +02:00
Seghir Nadir a269dd882c Checkout i2: Handle forced blocks in editor (https://github.com/woocommerce/woocommerce-blocks/pull/4606)
* force insert blocks

* add force attribute

* delete console.log

* make sure we don't override move

* polish force system in editor

* get sample block to show on frontend

* add force to frontend

* remove force on blocks

* move ref to function

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2021-08-31 13:38:51 +01:00
Mike Jolley 64fffd7051 Experimental newsletter subscription checkbox block POC and Store API supporting changes (https://github.com/woocommerce/woocommerce-blocks/pull/4607)
* remove todo from sample block

* Add newsletter block

* Block registration

* Move provider/processor so separate them from context providers

* customData implementation for setting customData for requests

* Make data and schema callbacks optional in extendrestapi class

* schema_type should be data_type

* Allow checkout endpoint to be extended

* Support validation, sanitization, and defaults on nested REST properties

* Experimental endpoint data for newsletter field

* Add extension data to requests

* SET_EXTENSION_DATA

* Update types

* Add todo

* move check within hook function

* Remove newsletter block

This is because we're testing with the integration being done in a separate extension

* Delete newsletter subscription block

* Pass the result of hooks down to the children blocks

We need to do this to allow extension blocks to modify the extensionData (so they can send custom input to the REST api when submitting the checkout form).

* Remove newsletter signup block

* remove checkoutSubmitData

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2021-08-30 15:35:20 +01:00
Albert Juhé Lluveras 2b2631d7ab Add Mini Cart block in experimental builds (https://github.com/woocommerce/woocommerce-blocks/pull/4510)
* Create MiniCart block prototype

* Use window.onload instead of DOMContentLoaded

* Don't load translations for scripts without localized strings

* Don't try to load cart instance in API requests

* Remove PHP pre-rendering

* Fix some typos

* Move Mini Cart block files under 'cart-checkout' directory

* Update selectors to follow guidelines

* Only enable the MiniCart block in experimental builds

* Fix wrong translations element selector

* Improve lazyLoadScript and preloadScript documentation

* Move lazy-load-script and preload-script to base-utils

* Add function to check if script tag is already in the DOM
2021-08-25 17:42:55 +02:00
Niels Lange ea55000792 Rename productLink to showProductLink (https://github.com/woocommerce/woocommerce-blocks/pull/4630)
* Rename productLink to showProductLink

* Add explicit prop value
2021-08-25 14:45:10 +02:00
Niels Lange 9428e791c9 Replace deprecated divisions with math.div($size, $base) (https://github.com/woocommerce/woocommerce-blocks/pull/4550)
* Replace deprecated SASS divisions

* Load '@use "sass:math"' before any other rules
2021-08-24 13:37:43 +02:00
grogou 32d76543cf Add "Filter Products by Stock" block (https://github.com/woocommerce/woocommerce-blocks/pull/4145)
* Added Stock Status filter

* Pre pull request clean up code

* Reverted package-lock.json ( downgraded node version to 12 )

* Coped package-lock.json from trunk

* Fix label includ path

* Created new component for Filters elements labels

* Removed hideOutOfStock from AllProducts and realized hide out of stock functionality from SQL query

* Linter fix

* Review suggestion changes

* Update index.js

* Fixed preview part for stock and attribute filters

* Update assets/js/blocks/stock-filter/block.js

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Bring back removed css

* Allow custom stock statuses

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Escape statuses for sql query

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

Co-authored-by: aaron <aaron.yor@gmail.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2021-08-20 16:56:14 +01:00
Thomas Roberts c04aced323 Revert "Add "Filter Products by Stock" block (https://github.com/woocommerce/woocommerce-blocks/pull/4145)"
This reverts commit 3542b3907e.
2021-08-20 16:14:59 +01:00
Thomas Roberts 3542b3907e Add "Filter Products by Stock" block (https://github.com/woocommerce/woocommerce-blocks/pull/4145)
commit 4a14c226b739f3d88f99647206627ff351ef01ad
Merge: 8f2bc114 4fccfd88
Author: Thomas Roberts <thomas.roberts@automattic.com>
Date:   Fri Aug 20 16:06:19 2021 +0100

    Merge branch 'add/stock-filter' of git://github.com/NovemBit/woocommerce-gutenberg-products-block-fork into NovemBit-add/stock-filter

commit 4fccfd88998fde20b603d99d9866d3cb08cf7bf4
Merge: 8012b2b4 e7bd0e6e
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Fri Aug 20 13:17:42 2021 +0000

    Merge from trunk

commit 8012b2b40e95b90e507698de677fba059ca9ef0a
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Fri Aug 20 16:53:56 2021 +0400

    Escape statuses for sql query

    Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

commit 304348aeb5448153ad3365ff09ca37f265af87cc
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Fri Aug 20 16:53:18 2021 +0400

    Allow custom stock statuses

    Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

commit b2f01e4ed6738ef3091afbac7d4131c984b33bc7
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Wed Jul 28 06:22:04 2021 +0000

    Bring back removed css

commit caafffda5de6d3f31b817ab4886847958f693e24
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Tue Jul 27 23:35:15 2021 +0400

    Update assets/js/blocks/stock-filter/block.js

    Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

commit ae381de8aa49d0b16d2dabff7b6ecffedc511460
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Thu Jul 15 06:50:06 2021 +0000

    Fixed preview part for stock and attribute filters

commit 7df5feab0a33f93786a29a625c1f27a4737c25bc
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Wed Jul 14 20:15:05 2021 +0400

    Update index.js

commit af0294ce6a21a0032c7eeb00fe986eddda188574
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Wed Jul 14 15:43:06 2021 +0000

    Review suggestion changes

commit 16da25340fd7438e0fedd62b3e8b52bc33b80852
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Wed Jul 14 15:40:52 2021 +0000

    Linter fix

commit 594125a68c5c0d854418d5f3e76fb0e18c23b0a4
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Wed Jul 14 15:37:41 2021 +0000

    Removed hideOutOfStock from AllProducts and realized hide out of stock functionality from SQL query

commit 94a54e3c7c8cb94323d41a11c6bb603d0648792e
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Wed Jul 14 15:21:51 2021 +0000

    Created new component for Filters elements labels

commit e3d7fb2aad4b123693f0104c2ffd9af2a1273900
Author: aaron <aaron.yor@gmail.com>
Date:   Wed Jun 2 11:57:06 2021 +0400

    Fix label includ path

commit c9e3d02d5bf03614cbfd2d17ec1558dacc3252f1
Author: Seghir Nadir <nadir.seghir@gmail.com>
Date:   Tue Jun 1 09:46:02 2021 +0100

    remove usage of mustBeString (https://github.com/woocommerce/woocommerce-blocks/pull/4294)

commit b8923390e5d5433ef2c8a14891684b907051cd7e
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon May 31 16:07:59 2021 +0100

    Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/4290)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 6de68e41e2053a79cdce3e9d820c9b5656072685
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Thu May 27 12:57:49 2021 +0100

    Check if product can be added to cart before adding ajax class to button (https://github.com/woocommerce/woocommerce-blocks/pull/4265)

commit a1ccaf4143dd9cd86f0f88ce956bcf7edb5e419a
Author: Thomas Roberts <thomas.roberts@automattic.com>
Date:   Wed May 26 16:10:43 2021 +0100

    Update version for next release

commit 24f882f5d53776abe2ee6440d68485083b5a8340
Author: Thomas Roberts <thomas.roberts@automattic.com>
Date:   Wed May 26 15:42:21 2021 +0100

    Bumping version strings to new version.

commit e1fd0825b72d7cc87c6f26329359cc39278cc760
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Wed May 26 15:31:37 2021 +0100

    Update link to testing zip

commit 35521e54b756bf265cf6d61437cd5f55629fc2d4
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Wed May 26 14:04:42 2021 +0100

    Fix display of itemised taxes (https://github.com/woocommerce/woocommerce-blocks/pull/4279)

    * Add price to itemised tax rates & hide Total when itemised taxes are on

    * Update snapshots for taxes in sidebar

commit 7f3a1e629f04dcb71d3fb4313b3012aef13feb5f
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 26 08:52:31 2021 +0000

    Update dependency downshift to v6.1.3 (https://github.com/woocommerce/woocommerce-blocks/pull/4272)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 593ef2b07f71341b3d0fc143876c24a4d50a64fb
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 26 05:04:55 2021 +0000

    Update dependency @types/react to v16.14.8 (https://github.com/woocommerce/woocommerce-blocks/pull/4270)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 21f16d6d4ef10ada3f1631f72b4fb7dec1f4af72
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 26 03:47:54 2021 +0000

    Update dependency @woocommerce/e2e-utils to v0.1.5 (https://github.com/woocommerce/woocommerce-blocks/pull/4271)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 444256ea70c8b9ac89b4f4d5913396da9f4334cd
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 26 02:30:17 2021 +0000

    Update dependency @types/lodash to v4.14.170 (https://github.com/woocommerce/woocommerce-blocks/pull/4269)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 5f9df572aed0b07606c7a4e5b684122a48862f94
Author: Thomas Roberts <thomas.roberts@automattic.com>
Date:   Tue May 25 15:31:03 2021 +0100

    Create 5.2.0 testing notes

commit 45abda651a668ddc4b1d36e8c76cf19d365d94c8
Author: Thomas Roberts <thomas.roberts@automattic.com>
Date:   Tue May 25 14:52:37 2021 +0100

    Update package.json

    npm ci was not working correctly this will fix it.

commit c3daa6ce4c71b956e08200442626a0e29a3e5daf
Author: Thomas Roberts <thomas.roberts@automattic.com>
Date:   Tue May 25 14:26:32 2021 +0100

    Update changelog and WC tested up to

commit 61283092b32425450f4450d5224e156d24aa38ba
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Thu May 20 17:56:56 2021 +0100

    Revert "Move `TextInput` to checkout package and allow it to be used for input type=number (https://github.com/woocommerce/woocommerce-blocks/pull/4238)"

    This reverts commit ee9b2d20e0.

commit 193267b041e8e0fb9fe89bb68ad972b1f5b4b941
Author: Mike Jolley <mike.jolley@me.com>
Date:   Tue May 25 12:49:13 2021 +0100

    Add key to each `CartTotalItem` (https://github.com/woocommerce/woocommerce-blocks/pull/4240)

    * Move type defs

    * Move type guards

    * Fix imports

    * Extract prepareTotalItems to TS file

    * usePaymentMethodInterface as TS file

    * Fix TS props

    * Fix currency type defs

    * Add return type to usePaymentMethodInterface

    * Add key prop to CartTotalItem

    * Fixed up js tests

    * Move SymbolPosition into type-defs package

    Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>

commit c15e5123e47952f445fe159522f72cef290c9276
Author: Seghir Nadir <nadir.seghir@gmail.com>
Date:   Tue May 25 10:46:28 2021 +0100

    Fix duplicate plugins by using wp.components global in the editor. (https://github.com/woocommerce/woocommerce-blocks/pull/4211)

    * fix duplicate slotProvider

    * load file on demand

    * add comment and load components in blocks as well

    * add todo block

commit e2cf0baad0ee91f892a1cb1919ad0edbab0122c3
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Tue May 25 08:43:46 2021 +0100

    Hide "including X in taxes" when the amount of tax is 0 (https://github.com/woocommerce/woocommerce-blocks/pull/4262)

    * Hide "including x in taxes" if tax amount is 0

    * Add jest types to tsconfig

    * Move SHOW_TAXES into component body

    This is to make the code more testable and allows us to change values. There's no significant performance impact because of this change.

    * Add tests and snapshots for TotalsFooterItem

commit 9b44c884fc68d81d6211f40f13409fac8503c2e3
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon May 24 18:14:37 2021 +0100

    Update dependency @octokit/graphql to v4.6.2 (https://github.com/woocommerce/woocommerce-blocks/pull/4230)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 4973132a90ddc88e075d6d421c8677cf032c3264
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon May 24 16:40:05 2021 +0100

    Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/4253)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit b7eabf54bad4b7e08c7f4ef1484f7fea7ab64f20
Author: Michael P. Pfeiffer <frontdevde@users.noreply.github.com>
Date:   Fri May 21 09:53:46 2021 +0200

    Block Widgets: hide legacy widgets with a feature-complete block equivalent (https://github.com/woocommerce/woocommerce-blocks/pull/4237)

    * Block Widgets: hide legacy widgets with block equivalent

    * Unhide Products and Products by Rating widgets

commit 47556b9a39125423409dea8a3ae8c8ac34396fc0
Author: Michael P. Pfeiffer <frontdevde@users.noreply.github.com>
Date:   Fri May 21 09:52:27 2021 +0200

    Block Widgets: hide All Products and Filter blocks in the Customizer (https://github.com/woocommerce/woocommerce-blocks/pull/4225)

commit 208b21281763652bdcddb7390dfe955bddff4728
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Thu May 20 17:56:56 2021 +0100

    Move `TextInput` to checkout package and allow it to be used for input type=number (https://github.com/woocommerce/woocommerce-blocks/pull/4238)

    * Move text-input to checkout package

    * Pass validation props directly to ValidatedTextInput

    * Import label relatively instead of from package

    * Pass validation functions to ValidatedTextInput

    This is so it doesn't need to get them from useValidationContext.

    * Add InputProps to ValidatedTextInput

    This will be used to control additional props on the input element of TextInput

    * Spread inputProps onto <input> element of TextInput

    * Export TextInput from @woocommerce/blocks-checkout

    * Add @woocommerce/blocks-checkout package to tsconfig

    * Allow styling to be applied to number inputs and when value is 0

    * Make style order consistent

    * Remove inputProps to rely on rest in TextInput

    * Add specific prop for the inputErrorComponent

    * Only disallow active state if value is 0 AND type is number

    * Change all uses of ValidatedTextInput to also pass inputErrorComponent

    * Revert "Change all uses of ValidatedTextInput to also pass inputErrorComponent"

    This reverts commit ec734b99c20c4d29fcf778714246fc406ee37eaf.

    * Revert "Remove inputProps to rely on rest in TextInput"

    This reverts commit 1fc64cca4002206423d1fa443ff2d60130ba1ea0.

    * Revert "Revert "Change all uses of ValidatedTextInput to also pass inputErrorComponent""

    This reverts commit 110e3606a996668be5a32698b634b7706d16cddc.

    * Revert "Revert "Remove inputProps to rely on rest in TextInput""

    This reverts commit aeb03526c44b3fcc97a719a18930d08157a80baf.

    * Don't pass errorMessage to ValidatedTextInput

commit 55f5bfd8cd720022380de1e811e8d1abb622209b
Author: Mike Jolley <mike.jolley@me.com>
Date:   Thu May 20 15:07:12 2021 +0100

    Create LICENSE (https://github.com/woocommerce/woocommerce-blocks/pull/4235)

commit 0b10f75ddf3d01c837f466f9d3f85dbc760b3d7b
Author: Albert Juhé Lluveras <contact@albertjuhe.com>
Date:   Thu May 20 10:58:59 2021 +0200

    Update @woocommerce/components (https://github.com/woocommerce/woocommerce-blocks/pull/4100)

    * Add isCompact prop to components using SearchListControl

    * Update @woocommerce/components to 6.1.2

    * Remove legacy CSS code

    * Add some CSS rules to override conflicting editor styles

    * Replace showCount prop with has-count class name

    * Create ExpandableSearchListItem component

    * Refactor ProductControl so it uses ExpandableSearchListItem

    * Update @woocommerce/components to 6.2.0

    * Fix @woocommerce/components builds breaking

    * Fix a11y of expandable item list children

    * Set categories to an empty array by default

    * Render compact control in Attribute filter sidebar

    * Add countLabel to ProductAttributeTermControl

    * Fix ProductTagControl selected items

    * Use sentence case for countLabel

    * Fix wrong margins in block editor

    * Fix checkbox alignment

    * Update package-lock.json

    * Fix withCategories test

    * Fix JS error in Filter Products by Attribute block

    * Make input ids unique

commit 587be17d62db7b956c980fac4766456511243e10
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Wed May 19 10:55:15 2021 +0100

    Convert TextInput and ValidatedTextInput to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/4226)

    * Change index file from base/context to .ts

    This is to stop TS complaining when importing things from here.

    * Convert ValidatedTextInput to TypeScript

    * Convert TextInput to TypeScript

    * Ensure Label accepts correct HTML Attributes Props

    * Remove PropTypes from TextInput and ValidatedTextInput

    No longer needed because of TypeScript

    * Use correct error id to show validation message

    * Use HTMLElement instead of a specific element type for LabelProps

    * Update assets/js/base/components/text-input/validated-text-input.tsx

    Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

    * Update assets/js/base/components/text-input/validated-text-input.tsx

    * Use correct formatting in ValidatedTextInput

    Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

commit 731c75e03100695131b4ec6afa8994e6cf9f4c00
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 19 07:36:46 2021 +0000

    Update dependency @testing-library/react-hooks to v5.1.3 (https://github.com/woocommerce/woocommerce-blocks/pull/4233)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit ef6ad8882310dff6d1aa4ae847289acddc0dfebb
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 19 04:36:44 2021 +0000

    Update dependency @types/lodash to v4.14.169 (https://github.com/woocommerce/woocommerce-blocks/pull/4234)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 096463ea4bf1bddc7d61e1b04320886ee2f21770
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 19 03:46:21 2021 +0000

    Update dependency @testing-library/react to v11.2.7 (https://github.com/woocommerce/woocommerce-blocks/pull/4232)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 8722839350e6725ea80da994bb8387966b75061c
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 19 02:48:45 2021 +0000

    Update dependency @stripe/react-stripe-js to v1.4.1 (https://github.com/woocommerce/woocommerce-blocks/pull/4231)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 2f7e8edfebff59eeeeeb18d65fd658d5f432419e
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 19 01:32:34 2021 +0000

    Pin dependency @types/wordpress__deprecated to 2.4.2 (https://github.com/woocommerce/woocommerce-blocks/pull/4229)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 72e851a28c88653204ed8e4eff10c6bb2cb40c68
Author: Raluca Stan <raluca.stan@automattic.com>
Date:   Tue May 18 15:09:30 2021 +0200

    Fix e2e checkout tests and adjust jest setup (https://github.com/woocommerce/woocommerce-blocks/pull/4216)

    * Fix checkout test
    - make tests independent & test also for empty cart case
    - make sure the Order summary is expanded with a better selector
    * Remove unnecessary localStorage operations from tests
    * Go to cart page before removing an item from cart
    * Remove logging observing before tests
    This removes unnecessary console.log interception. A big part of the logic was done for Puppeteer 1.6.1, but since 3.0.0 message.text() returns string. We allow console.error messages to surface in our tests. Although they don't cause the test to fail it might be a good addition for debugging purposes.

commit 7b7119cfb0cfce5e1718804ca590a6b161d555f2
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Tue May 18 11:27:27 2021 +0100

    Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/4212)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 5f84e7dabbc788b769646a9bcba5a15a57b03e33
Author: Mike Jolley <mike.jolley@me.com>
Date:   Tue May 18 10:37:31 2021 +0100

    Convert checkout state context provider to Typescript (https://github.com/woocommerce/woocommerce-blocks/pull/4200)

    * git move to ts files

    * Type the checkout state provider

    * Restore for loop for error handling

    * Types not needed

    * Consolodate response handling

    * Unused import

    * Fix defaults for onCheckoutAfterProcessingWithSuccess etc

    * Type useEmitResponse and remove isObject checks

    * useEmitResponse as const

    * Check that redirectUrl is string

    * Define actions as const

    * data.redirectUrl should be truthy

    * Add redirectURL todo item as followup

    * remove null fallback

commit fccc72bedb0f320995f62ee5d91b1c8e2e9c2fa1
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Tue May 18 09:10:31 2021 +0100

    Move Button and Label components to `@woocommerce/blocks-checkout` package (https://github.com/woocommerce/woocommerce-blocks/pull/4222)

    * Move Button to checkout package

    * Move Label to Components Package

commit 0b91fbeac282f729dbc8e8056d2e934392f401c0
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Mon May 17 15:00:57 2021 +0100

    Update design of cart and checkout sidebars (https://github.com/woocommerce/woocommerce-blocks/pull/4180)

    * Update cart/coupon/shipping design

    * Add order summary heading

    * Move and style discounts on checkout sidebar

    * Add rate to tax lines

    * Ensure the option to display taxes itemised is available to Cart block

    * Output individual tax items below the total & add styles for this

    * Add success notice under coupon input on successful coupon addition

    * Add border to bottom of Totals footer

    * Show success message when adding coupon

    * Add padding to cart item rows

    * Add preview data to cart for when taxes are enabled

    * Add rate to cart response type

    * Add showRateAfterTaxName attribute to Cart block

    * Add control to cart block to show rate percentage after rate name

    * Add rate % in cart totals only if option is toggled on

    * Pass showRateAfterTaxName attribute down to TotalsTaxes

    * Add showRateAfterTaxName to Checkout block

    * Add control to block editor for showRateAfterTaxName on Checkout

    * Pass showRateAfterTaxName down to TotalsTaxes in Checkout

    * Change label for showing tax rates in cart and checkout blocks

    * Add test to ensure Taxes section shows in Cart block

    * Add tests for cart sidebar and rate percentages

    * Remove order summary title from checkout sidebar

    * Check if taxes are enabled before rendering the option to show rate %s

    * Add ShippingVia component to show the selected rate in sidebar

    * Remove value from individual tax rates

    * Remove bold from Shipping via label

    * Remove coupon added successfully message

    * Ensure panel headings that are h2s are the same colour as others

    * Clean up eslint warnings

    * Show rate %s by default

    * Update snapshots following design changes

    Co-authored-by: Mike Jolley <mike.jolley@me.com>

commit 0464883ec668332db5a6399569880e7b3fa3ab3f
Author: Albert Juhé Lluveras <contact@albertjuhe.com>
Date:   Sun May 16 20:00:06 2021 +0200

    Don't default to fallback in getSetting if value is falsy (https://github.com/woocommerce/woocommerce-blocks/pull/4202)

commit f95f12d3215caf30f1f49e1d29c5826156914a33
Author: Mike Jolley <mike.jolley@me.com>
Date:   Sun May 16 18:59:32 2021 +0100

    Fix es lint warnings (https://github.com/woocommerce/woocommerce-blocks/pull/4206)

    * Un-used PropTypes import

    * Avoid global and use ownerDocument

    * receiveCart return type

    * ignoreRestSiblings when destructuring for @typescript-eslint/no-unused-vars

    * Replace lodash find

    * Use global rather than window

    * Remove lodash map

    * move rule to overrides

commit db589e7e7f4809504b1aa83144116506a50bdd38
Author: Raluca Stan <raluca.stan@automattic.com>
Date:   Sun May 16 19:41:34 2021 +0200

    Fix cart and checkout frontend e2e tests (https://github.com/woocommerce/woocommerce-blocks/pull/4199)

    * Wip: fix e2e fe tests

    * Test that navigation ends

    * Fix waitForNavigation

    * comment out failing php test

    * click the dom element

    * Ensure navigation happens by waiting for it. Test page title.

    * remove skip and update docs

    * Revert "comment out failing php test"

    This reverts commit 7c40e8caf3aa32e35e3b70eb32051251b06e0613.

    * Fix USD from merge conflict

    * Add missing check for page title

    * Try page.waitForFunction for text search

    * test to see checkout page title is correct

    * test checkout page url on CI

    * unde jest config change

    * Fix assertion for checkout page

    * remove extra localStorage item remove call

    Co-authored-by: Mike Jolley <mike.jolley@me.com>
    Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>

commit b9b66f93adb5b0fdc22fc4ed9560eb6e2c1c72d9
Author: Mike Jolley <mike.jolley@me.com>
Date:   Thu May 13 11:49:39 2021 +0100

    Set order status to pending when no payment is needed (https://github.com/woocommerce/woocommerce-blocks/pull/4186)

commit 8ed63f765418ae8e7b2ee58004b4a9b1306eaeef
Author: Mike Jolley <mike.jolley@me.com>
Date:   Thu May 13 11:21:21 2021 +0100

    Remove the need for the `canMakePayment` callback in the editor context (https://github.com/woocommerce/woocommerce-blocks/pull/4188)

    * Force can pay true in editor context

    * Update docs

commit 90499cb3191137264ffde07cf082db8c4d6f77de
Author: Mike Jolley <mike.jolley@me.com>
Date:   Thu May 13 11:20:37 2021 +0100

    Sync customer data during checkout with draft orders. (https://github.com/woocommerce/woocommerce-blocks/pull/4197)

    * Update store when email changes

    * Add pluckEmail helper and convert to TS

    * improve guard

    * sync draft order with customer data

commit a813c931bb5f85f139429aa3bf094b2327a7f8cd
Author: Albert Juhé Lluveras <contact@albertjuhe.com>
Date:   Thu May 13 12:14:15 2021 +0200

    Set default store currency to USD in tests (https://github.com/woocommerce/woocommerce-blocks/pull/4203)

commit b1408933f75ca47dc39335984bfc1fe570a72aaa
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Thu May 13 10:16:04 2021 +0200

    Update dependency config to v3.3.6 (https://github.com/woocommerce/woocommerce-blocks/pull/4195)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit d68bb11bb56d882f8755162ae6657cad76dfd16f
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Thu May 13 10:15:35 2021 +0200

    Update dependency cssnano to v4.1.11 (https://github.com/woocommerce/woocommerce-blocks/pull/4196)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit beadbab90fe0813c0f36cc25a9e0b14a8f8e96d2
Author: Seghir Nadir <nadir.seghir@gmail.com>
Date:   Wed May 12 13:32:05 2021 +0100

    Add cart data to filters (https://github.com/woocommerce/woocommerce-blocks/pull/4164)

    * add cart data to filters

    * add extensions back to footer filter

commit c10fdf26bc37b1efb6b22d045e3aed72f5541a2a
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 12 13:04:44 2021 +0100

    Pin dependency lodash to 4.17.21 (https://github.com/woocommerce/woocommerce-blocks/pull/4193)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit f92aac55f1a6fd67fba3885311ec74bcdb41034e
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 12 13:04:13 2021 +0100

    Update dependency chalk to v4.1.1 (https://github.com/woocommerce/woocommerce-blocks/pull/4194)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 27cff5109889c0abca24124c1dabcb0b78da4929
Author: Mike Jolley <mike.jolley@me.com>
Date:   Wed May 12 13:02:26 2021 +0100

    Should be using value rather than name (https://github.com/woocommerce/woocommerce-blocks/pull/4187)

commit 560972a7eb306b6a27c298b7e3218df92a848e79
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Tue May 11 13:57:02 2021 +0100

    Add checkout filter for coupon names (https://github.com/woocommerce/woocommerce-blocks/pull/4166)

    * Make extensions optional, not all filters will need to pass this through

    For example the CartCouponSchema has no option for extensibility (and I don't think it's needed at any rate) so extensions will always be an empty object. Rather than explicitly specifying this when running the filter, we can let it default to an empty object.

    * Add filter for coupon code

commit 556ceb4b8a222466a73aae1ee0eac545e00802b4
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Tue May 11 11:45:02 2021 +0100

    Check if variation data is iterable before formatting (https://github.com/woocommerce/woocommerce-blocks/pull/4182)

commit 4279db88057e83eff8af077a96eeb19dd247a8d2
Author: Darren Ethier <darren@roughsmootheng.in>
Date:   Mon May 10 11:21:01 2021 -0400

    update package-lock (version change mostly)

commit f71b24ad0f634c2cb8aeac8ae80e0ccd139a4fcd
Author: Darren Ethier <darren@roughsmootheng.in>
Date:   Mon May 10 11:16:58 2021 -0400

    update version string to dev version

commit 7f9c1b2913f9c06f4d755519ef2689c56703a2c0
Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Date:   Mon May 10 11:14:05 2021 -0400

    Release: 5.1.0 (https://github.com/woocommerce/woocommerce-blocks/pull/4185)

    * Empty commit for release pull request

    * Add changelog

    * update testing notes

    * Bumping version strings to new version.

    Co-authored-by: github-actions <github-actions@github.com>
    Co-authored-by: Darren Ethier <darren@roughsmootheng.in>

commit 80c27354e1eb83d027eb9670aed59885c2097d3d
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon May 10 14:38:04 2021 +0200

    Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/4184)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 90074cf871d8691d0adf5808e59a75b9ace98fa7
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Mon May 10 10:03:30 2021 +0100

    Convert shipping components to typescript (https://github.com/woocommerce/woocommerce-blocks/pull/4135)

    * Add type defs for customer

    Taken from 194ecccf78/assets/js/type-defs/customer.ts

    * Convert ShippingCalculatorAddress to TypeScript

    * Convert ShippingCalculator to TypeScript

    * Convert ShippingLocation to TypeScript

    * Allow packageId to be a number or string in useSelectShippingRate(s)

    * Convert ShippingRatesControl to TypeScript

    * Convert ShippingOptionsStep to TypeScript

    * Allow package_id to be a string or number

    This is because of Subscriptions using strings for package IDs

    * Change to use CartShippingRateItemShippingRate instead of Rate

    * Add extra props to PackageProps type

    * Make ShippingAddress have the correct type

    * Use CartShippingRateItemShippingRate instead of Rate

    * Remove Rate type

    * Set return types to JSX.Element

    * Change type of props.renderOption in ShippingRatesControl

    * Remove customer type defs and relocate aliases to default-address-fields

    * Add EnteredAddress type

    * Import EnteredAddress from new location

    * Remove unnecessary eslint ignore

    * Remove unused variable

    * Remove confusing use of word Item in Shipping types

    * Remove confusing use of word Item in Shipping types

commit 3f1be394d076bdc2a407c05d1fbf290a17c55c43
Author: Albert Juhé Lluveras <contact@albertjuhe.com>
Date:   Mon May 10 10:00:14 2021 +0200

    Feature gate PaymentApi (https://github.com/woocommerce/woocommerce-blocks/pull/4176)

    * Feature gate PaymentApi

    * Improve payment method missing dependencies error message so it's clear it only affects blocks

    * Add PaymentApi feature flags to list of feature flags in docs

commit ed7eded4d7134d1b69d0fd206cd1315fd9d2d40f
Author: Darren Ethier <darren@roughsmootheng.in>
Date:   Fri May 7 16:39:28 2021 -0400

    Improvements to `emitEventWithAbort`. (https://github.com/woocommerce/woocommerce-blocks/pull/4158)

    * modify emitEventWithAbort to change return value

    `emitEventWithAbort` now returns an array of responses up to the first response that triggered an error or fail response instead of aborting on success responses too.

    * update add to cart form context provider

    * update checkout state context provider

    * update payment method data context provider

    * update tests and fix thrown error handling.

commit 2be9a4ea4405d5df427f4e97025aa5433019b72f
Author: Raluca Stan <raluca.stan@automattic.com>
Date:   Fri May 7 15:50:55 2021 +0200

    Add lodash as a devDependency (https://github.com/woocommerce/woocommerce-blocks/pull/4179)

commit 69b3679a7e585abc8a5068df3bd2457714149939
Author: Seghir Nadir <nadir.seghir@gmail.com>
Date:   Wed May 5 12:59:30 2021 +0100

    Don't clear email and phone fields when using separate billing address. (https://github.com/woocommerce/woocommerce-blocks/pull/4162)

    * preseve-billing-data

    * pluck empty email and phone

    * add issue number

commit 214014750c0a1414e89ce47d84754d278e5a164f
Author: Raluca Stan <raluca.stan@automattic.com>
Date:   Wed May 5 13:52:27 2021 +0200

    Fix/cart backend test (https://github.com/woocommerce/woocommerce-blocks/pull/4153)

    * Fix backend cart e2e test

    * Adjust test structure

    * Fix e2e checkout backend test.

    Make sure the confirmation window is closed

commit f8d9b9084c091f97b281f58a64f98622765a80e3
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 5 10:08:45 2021 +0000

    Update dependency @stripe/stripe-js to v1.14.0 (https://github.com/woocommerce/woocommerce-blocks/pull/4170)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 2391a40ab24439b14f56d1d6416beaf0c2d94c53
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Wed May 5 10:41:48 2021 +0100

    Add documentation for filters (https://github.com/woocommerce/woocommerce-blocks/pull/4167)

    * Rename the argument in the CheckoutFilterFunction type

    This only exists as an extra descriptive hint to anyone using this type, the value `label` was never used by anything so it does not need to be changed anywhere else.

    * Create Available Filters document

    * Add available filters to the extensibility README

    * Update docs/extensibility/available-filters.md to fix typographical error

    Co-authored-by: Mike Jolley <mike.jolley@me.com>

    Co-authored-by: Mike Jolley <mike.jolley@me.com>

commit f4af89b2fce203c4f173845244724f58669a04f9
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 5 08:10:24 2021 +0000

    Update dependency @woocommerce/e2e-utils to v0.1.4 (https://github.com/woocommerce/woocommerce-blocks/pull/4172)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 6c9e786c407fd1bd6861bde3b435cec0663b8399
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 5 03:31:52 2021 +0000

    Update dependency @types/react to v16.14.6 (https://github.com/woocommerce/woocommerce-blocks/pull/4171)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 3ba4d9ed6a46f3700a7190d09eff2ba53d1bcb60
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 5 02:23:13 2021 +0000

    Update babel monorepo (https://github.com/woocommerce/woocommerce-blocks/pull/4169)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 35f71df36f92028cfb880e314623b33c077a384d
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Tue May 4 14:07:05 2021 +0100

    Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/4163)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 4c65211b375e40691aeea7273eec34f3f54a0b3b
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Wed Apr 28 14:09:28 2021 +0000

    Coped package-lock.json from trunk

commit 703cb65efb8fd4ced58234d5174dc198e225e07a
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Wed Apr 28 14:00:32 2021 +0000

    Reverted package-lock.json ( downgraded node version to 12 )

commit 41dfd79715d4b4f1e5cebd0e7dccfc1573ba4d36
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Wed Apr 28 11:12:45 2021 +0000

    Pre pull request clean up code

commit 75fc62e99ed63389c158352b73ae898c986d92bd
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Tue Apr 27 13:03:24 2021 +0000

    Added Stock Status filter

commit e7bd0e6e1e171a041ac17b8b11abc812585f7645
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Fri Aug 20 16:53:56 2021 +0400

    Escape statuses for sql query

    Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

commit 29c8493aaeb6dca6b3cf5e1954a39564ea304d87
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Fri Aug 20 16:53:18 2021 +0400

    Allow custom stock statuses

    Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

commit 63ecd04bf09a53049bdb10d3919acf6ced7ead8a
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Wed Jul 28 06:22:04 2021 +0000

    Bring back removed css

commit 27e0233cb67f60f650856455a0ff32c6d73c35e3
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Tue Jul 27 23:35:15 2021 +0400

    Update assets/js/blocks/stock-filter/block.js

    Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

commit 136c32ddd3f485be5aeab274c675743a235a8c25
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Thu Jul 15 06:50:06 2021 +0000

    Fixed preview part for stock and attribute filters

commit ef89751b634bf223f065067f47f726b662d75ef3
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Wed Jul 14 20:15:05 2021 +0400

    Update index.js

commit a63dbcef7058ffd858a71931b6fc2ead0583ae03
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Wed Jul 14 15:43:06 2021 +0000

    Review suggestion changes

commit 6b0f5d2206d010c1822ab7eaf4edea9a0b79526d
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Wed Jul 14 15:40:52 2021 +0000

    Linter fix

commit 791b38b31782367864e1bb8f26716b7fef0e63a8
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Wed Jul 14 15:37:41 2021 +0000

    Removed hideOutOfStock from AllProducts and realized hide out of stock functionality from SQL query

commit 1a7a002d5eac271c6f2331e3e66411f3127282b1
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Wed Jul 14 15:21:51 2021 +0000

    Created new component for Filters elements labels

commit d9b7fae24d4235a0f8f424e7e74cd250e62bc897
Author: aaron <aaron.yor@gmail.com>
Date:   Wed Jun 2 11:57:06 2021 +0400

    Fix label includ path

commit 5311584362dca4c6e5a91de5fdfbff29297799ea
Merge: 92a0da3f 1b87589f
Author: aaron <aaron.yor@gmail.com>
Date:   Wed Jun 2 11:52:48 2021 +0400

    Merge remote-tracking branch 'core/trunk' into add/stock-filter

    # Conflicts:
    #	package-lock.json

commit d8e6dabaa3282855c6c91c908d6a1443ea9732f1
Merge: 583113e3 2b695215
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Fri Apr 30 12:28:09 2021 +0400

    Merge pull request woocommerce/woocommerce-blocks#1 from woocommerce/trunk

    Fork update

commit 92a0da3f8c37aa46ce2330cb8095ab7077d01555
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Wed Apr 28 14:09:28 2021 +0000

    Coped package-lock.json from trunk

commit ae0d12b57a5be6f1a39577404c017174489345f8
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Wed Apr 28 14:00:32 2021 +0000

    Reverted package-lock.json ( downgraded node version to 12 )

commit 5e0c7f9fe36bc9358743b7af7d9e47ce66f8ac08
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Wed Apr 28 11:12:45 2021 +0000

    Pre pull request clean up code

commit 105b3f75a2b42f12f6924091f51bfa91c84b4984
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Tue Apr 27 13:03:24 2021 +0000

    Added Stock Status filter
2021-08-20 16:07:14 +01:00
Thomas Roberts 8f2bc114a4 Revert "Add "Filter Products by Stock" block (https://github.com/woocommerce/woocommerce-blocks/pull/4145)"
This reverts commit 44db8317a7.
2021-08-20 16:05:38 +01:00
Thomas Roberts 44db8317a7 Add "Filter Products by Stock" block (https://github.com/woocommerce/woocommerce-blocks/pull/4145)
commit 4fccfd88998fde20b603d99d9866d3cb08cf7bf4
Merge: 8012b2b4 e7bd0e6e
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Fri Aug 20 13:17:42 2021 +0000

    Merge from trunk

commit 8012b2b40e95b90e507698de677fba059ca9ef0a
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Fri Aug 20 16:53:56 2021 +0400

    Escape statuses for sql query

    Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

commit 304348aeb5448153ad3365ff09ca37f265af87cc
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Fri Aug 20 16:53:18 2021 +0400

    Allow custom stock statuses

    Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

commit b2f01e4ed6738ef3091afbac7d4131c984b33bc7
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Wed Jul 28 06:22:04 2021 +0000

    Bring back removed css

commit caafffda5de6d3f31b817ab4886847958f693e24
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Tue Jul 27 23:35:15 2021 +0400

    Update assets/js/blocks/stock-filter/block.js

    Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

commit ae381de8aa49d0b16d2dabff7b6ecffedc511460
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Thu Jul 15 06:50:06 2021 +0000

    Fixed preview part for stock and attribute filters

commit 7df5feab0a33f93786a29a625c1f27a4737c25bc
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Wed Jul 14 20:15:05 2021 +0400

    Update index.js

commit af0294ce6a21a0032c7eeb00fe986eddda188574
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Wed Jul 14 15:43:06 2021 +0000

    Review suggestion changes

commit 16da25340fd7438e0fedd62b3e8b52bc33b80852
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Wed Jul 14 15:40:52 2021 +0000

    Linter fix

commit 594125a68c5c0d854418d5f3e76fb0e18c23b0a4
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Wed Jul 14 15:37:41 2021 +0000

    Removed hideOutOfStock from AllProducts and realized hide out of stock functionality from SQL query

commit 94a54e3c7c8cb94323d41a11c6bb603d0648792e
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Wed Jul 14 15:21:51 2021 +0000

    Created new component for Filters elements labels

commit e3d7fb2aad4b123693f0104c2ffd9af2a1273900
Author: aaron <aaron.yor@gmail.com>
Date:   Wed Jun 2 11:57:06 2021 +0400

    Fix label includ path

commit c9e3d02d5bf03614cbfd2d17ec1558dacc3252f1
Author: Seghir Nadir <nadir.seghir@gmail.com>
Date:   Tue Jun 1 09:46:02 2021 +0100

    remove usage of mustBeString (https://github.com/woocommerce/woocommerce-blocks/pull/4294)

commit b8923390e5d5433ef2c8a14891684b907051cd7e
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon May 31 16:07:59 2021 +0100

    Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/4290)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 6de68e41e2053a79cdce3e9d820c9b5656072685
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Thu May 27 12:57:49 2021 +0100

    Check if product can be added to cart before adding ajax class to button (https://github.com/woocommerce/woocommerce-blocks/pull/4265)

commit a1ccaf4143dd9cd86f0f88ce956bcf7edb5e419a
Author: Thomas Roberts <thomas.roberts@automattic.com>
Date:   Wed May 26 16:10:43 2021 +0100

    Update version for next release

commit 24f882f5d53776abe2ee6440d68485083b5a8340
Author: Thomas Roberts <thomas.roberts@automattic.com>
Date:   Wed May 26 15:42:21 2021 +0100

    Bumping version strings to new version.

commit e1fd0825b72d7cc87c6f26329359cc39278cc760
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Wed May 26 15:31:37 2021 +0100

    Update link to testing zip

commit 35521e54b756bf265cf6d61437cd5f55629fc2d4
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Wed May 26 14:04:42 2021 +0100

    Fix display of itemised taxes (https://github.com/woocommerce/woocommerce-blocks/pull/4279)

    * Add price to itemised tax rates & hide Total when itemised taxes are on

    * Update snapshots for taxes in sidebar

commit 7f3a1e629f04dcb71d3fb4313b3012aef13feb5f
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 26 08:52:31 2021 +0000

    Update dependency downshift to v6.1.3 (https://github.com/woocommerce/woocommerce-blocks/pull/4272)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 593ef2b07f71341b3d0fc143876c24a4d50a64fb
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 26 05:04:55 2021 +0000

    Update dependency @types/react to v16.14.8 (https://github.com/woocommerce/woocommerce-blocks/pull/4270)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 21f16d6d4ef10ada3f1631f72b4fb7dec1f4af72
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 26 03:47:54 2021 +0000

    Update dependency @woocommerce/e2e-utils to v0.1.5 (https://github.com/woocommerce/woocommerce-blocks/pull/4271)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 444256ea70c8b9ac89b4f4d5913396da9f4334cd
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 26 02:30:17 2021 +0000

    Update dependency @types/lodash to v4.14.170 (https://github.com/woocommerce/woocommerce-blocks/pull/4269)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 5f9df572aed0b07606c7a4e5b684122a48862f94
Author: Thomas Roberts <thomas.roberts@automattic.com>
Date:   Tue May 25 15:31:03 2021 +0100

    Create 5.2.0 testing notes

commit 45abda651a668ddc4b1d36e8c76cf19d365d94c8
Author: Thomas Roberts <thomas.roberts@automattic.com>
Date:   Tue May 25 14:52:37 2021 +0100

    Update package.json

    npm ci was not working correctly this will fix it.

commit c3daa6ce4c71b956e08200442626a0e29a3e5daf
Author: Thomas Roberts <thomas.roberts@automattic.com>
Date:   Tue May 25 14:26:32 2021 +0100

    Update changelog and WC tested up to

commit 61283092b32425450f4450d5224e156d24aa38ba
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Thu May 20 17:56:56 2021 +0100

    Revert "Move `TextInput` to checkout package and allow it to be used for input type=number (https://github.com/woocommerce/woocommerce-blocks/pull/4238)"

    This reverts commit ee9b2d20e0.

commit 193267b041e8e0fb9fe89bb68ad972b1f5b4b941
Author: Mike Jolley <mike.jolley@me.com>
Date:   Tue May 25 12:49:13 2021 +0100

    Add key to each `CartTotalItem` (https://github.com/woocommerce/woocommerce-blocks/pull/4240)

    * Move type defs

    * Move type guards

    * Fix imports

    * Extract prepareTotalItems to TS file

    * usePaymentMethodInterface as TS file

    * Fix TS props

    * Fix currency type defs

    * Add return type to usePaymentMethodInterface

    * Add key prop to CartTotalItem

    * Fixed up js tests

    * Move SymbolPosition into type-defs package

    Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>

commit c15e5123e47952f445fe159522f72cef290c9276
Author: Seghir Nadir <nadir.seghir@gmail.com>
Date:   Tue May 25 10:46:28 2021 +0100

    Fix duplicate plugins by using wp.components global in the editor. (https://github.com/woocommerce/woocommerce-blocks/pull/4211)

    * fix duplicate slotProvider

    * load file on demand

    * add comment and load components in blocks as well

    * add todo block

commit e2cf0baad0ee91f892a1cb1919ad0edbab0122c3
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Tue May 25 08:43:46 2021 +0100

    Hide "including X in taxes" when the amount of tax is 0 (https://github.com/woocommerce/woocommerce-blocks/pull/4262)

    * Hide "including x in taxes" if tax amount is 0

    * Add jest types to tsconfig

    * Move SHOW_TAXES into component body

    This is to make the code more testable and allows us to change values. There's no significant performance impact because of this change.

    * Add tests and snapshots for TotalsFooterItem

commit 9b44c884fc68d81d6211f40f13409fac8503c2e3
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon May 24 18:14:37 2021 +0100

    Update dependency @octokit/graphql to v4.6.2 (https://github.com/woocommerce/woocommerce-blocks/pull/4230)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 4973132a90ddc88e075d6d421c8677cf032c3264
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon May 24 16:40:05 2021 +0100

    Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/4253)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit b7eabf54bad4b7e08c7f4ef1484f7fea7ab64f20
Author: Michael P. Pfeiffer <frontdevde@users.noreply.github.com>
Date:   Fri May 21 09:53:46 2021 +0200

    Block Widgets: hide legacy widgets with a feature-complete block equivalent (https://github.com/woocommerce/woocommerce-blocks/pull/4237)

    * Block Widgets: hide legacy widgets with block equivalent

    * Unhide Products and Products by Rating widgets

commit 47556b9a39125423409dea8a3ae8c8ac34396fc0
Author: Michael P. Pfeiffer <frontdevde@users.noreply.github.com>
Date:   Fri May 21 09:52:27 2021 +0200

    Block Widgets: hide All Products and Filter blocks in the Customizer (https://github.com/woocommerce/woocommerce-blocks/pull/4225)

commit 208b21281763652bdcddb7390dfe955bddff4728
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Thu May 20 17:56:56 2021 +0100

    Move `TextInput` to checkout package and allow it to be used for input type=number (https://github.com/woocommerce/woocommerce-blocks/pull/4238)

    * Move text-input to checkout package

    * Pass validation props directly to ValidatedTextInput

    * Import label relatively instead of from package

    * Pass validation functions to ValidatedTextInput

    This is so it doesn't need to get them from useValidationContext.

    * Add InputProps to ValidatedTextInput

    This will be used to control additional props on the input element of TextInput

    * Spread inputProps onto <input> element of TextInput

    * Export TextInput from @woocommerce/blocks-checkout

    * Add @woocommerce/blocks-checkout package to tsconfig

    * Allow styling to be applied to number inputs and when value is 0

    * Make style order consistent

    * Remove inputProps to rely on rest in TextInput

    * Add specific prop for the inputErrorComponent

    * Only disallow active state if value is 0 AND type is number

    * Change all uses of ValidatedTextInput to also pass inputErrorComponent

    * Revert "Change all uses of ValidatedTextInput to also pass inputErrorComponent"

    This reverts commit ec734b99c20c4d29fcf778714246fc406ee37eaf.

    * Revert "Remove inputProps to rely on rest in TextInput"

    This reverts commit 1fc64cca4002206423d1fa443ff2d60130ba1ea0.

    * Revert "Revert "Change all uses of ValidatedTextInput to also pass inputErrorComponent""

    This reverts commit 110e3606a996668be5a32698b634b7706d16cddc.

    * Revert "Revert "Remove inputProps to rely on rest in TextInput""

    This reverts commit aeb03526c44b3fcc97a719a18930d08157a80baf.

    * Don't pass errorMessage to ValidatedTextInput

commit 55f5bfd8cd720022380de1e811e8d1abb622209b
Author: Mike Jolley <mike.jolley@me.com>
Date:   Thu May 20 15:07:12 2021 +0100

    Create LICENSE (https://github.com/woocommerce/woocommerce-blocks/pull/4235)

commit 0b10f75ddf3d01c837f466f9d3f85dbc760b3d7b
Author: Albert Juhé Lluveras <contact@albertjuhe.com>
Date:   Thu May 20 10:58:59 2021 +0200

    Update @woocommerce/components (https://github.com/woocommerce/woocommerce-blocks/pull/4100)

    * Add isCompact prop to components using SearchListControl

    * Update @woocommerce/components to 6.1.2

    * Remove legacy CSS code

    * Add some CSS rules to override conflicting editor styles

    * Replace showCount prop with has-count class name

    * Create ExpandableSearchListItem component

    * Refactor ProductControl so it uses ExpandableSearchListItem

    * Update @woocommerce/components to 6.2.0

    * Fix @woocommerce/components builds breaking

    * Fix a11y of expandable item list children

    * Set categories to an empty array by default

    * Render compact control in Attribute filter sidebar

    * Add countLabel to ProductAttributeTermControl

    * Fix ProductTagControl selected items

    * Use sentence case for countLabel

    * Fix wrong margins in block editor

    * Fix checkbox alignment

    * Update package-lock.json

    * Fix withCategories test

    * Fix JS error in Filter Products by Attribute block

    * Make input ids unique

commit 587be17d62db7b956c980fac4766456511243e10
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Wed May 19 10:55:15 2021 +0100

    Convert TextInput and ValidatedTextInput to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/4226)

    * Change index file from base/context to .ts

    This is to stop TS complaining when importing things from here.

    * Convert ValidatedTextInput to TypeScript

    * Convert TextInput to TypeScript

    * Ensure Label accepts correct HTML Attributes Props

    * Remove PropTypes from TextInput and ValidatedTextInput

    No longer needed because of TypeScript

    * Use correct error id to show validation message

    * Use HTMLElement instead of a specific element type for LabelProps

    * Update assets/js/base/components/text-input/validated-text-input.tsx

    Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

    * Update assets/js/base/components/text-input/validated-text-input.tsx

    * Use correct formatting in ValidatedTextInput

    Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

commit 731c75e03100695131b4ec6afa8994e6cf9f4c00
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 19 07:36:46 2021 +0000

    Update dependency @testing-library/react-hooks to v5.1.3 (https://github.com/woocommerce/woocommerce-blocks/pull/4233)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit ef6ad8882310dff6d1aa4ae847289acddc0dfebb
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 19 04:36:44 2021 +0000

    Update dependency @types/lodash to v4.14.169 (https://github.com/woocommerce/woocommerce-blocks/pull/4234)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 096463ea4bf1bddc7d61e1b04320886ee2f21770
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 19 03:46:21 2021 +0000

    Update dependency @testing-library/react to v11.2.7 (https://github.com/woocommerce/woocommerce-blocks/pull/4232)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 8722839350e6725ea80da994bb8387966b75061c
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 19 02:48:45 2021 +0000

    Update dependency @stripe/react-stripe-js to v1.4.1 (https://github.com/woocommerce/woocommerce-blocks/pull/4231)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 2f7e8edfebff59eeeeeb18d65fd658d5f432419e
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 19 01:32:34 2021 +0000

    Pin dependency @types/wordpress__deprecated to 2.4.2 (https://github.com/woocommerce/woocommerce-blocks/pull/4229)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 72e851a28c88653204ed8e4eff10c6bb2cb40c68
Author: Raluca Stan <raluca.stan@automattic.com>
Date:   Tue May 18 15:09:30 2021 +0200

    Fix e2e checkout tests and adjust jest setup (https://github.com/woocommerce/woocommerce-blocks/pull/4216)

    * Fix checkout test
    - make tests independent & test also for empty cart case
    - make sure the Order summary is expanded with a better selector
    * Remove unnecessary localStorage operations from tests
    * Go to cart page before removing an item from cart
    * Remove logging observing before tests
    This removes unnecessary console.log interception. A big part of the logic was done for Puppeteer 1.6.1, but since 3.0.0 message.text() returns string. We allow console.error messages to surface in our tests. Although they don't cause the test to fail it might be a good addition for debugging purposes.

commit 7b7119cfb0cfce5e1718804ca590a6b161d555f2
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Tue May 18 11:27:27 2021 +0100

    Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/4212)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 5f84e7dabbc788b769646a9bcba5a15a57b03e33
Author: Mike Jolley <mike.jolley@me.com>
Date:   Tue May 18 10:37:31 2021 +0100

    Convert checkout state context provider to Typescript (https://github.com/woocommerce/woocommerce-blocks/pull/4200)

    * git move to ts files

    * Type the checkout state provider

    * Restore for loop for error handling

    * Types not needed

    * Consolodate response handling

    * Unused import

    * Fix defaults for onCheckoutAfterProcessingWithSuccess etc

    * Type useEmitResponse and remove isObject checks

    * useEmitResponse as const

    * Check that redirectUrl is string

    * Define actions as const

    * data.redirectUrl should be truthy

    * Add redirectURL todo item as followup

    * remove null fallback

commit fccc72bedb0f320995f62ee5d91b1c8e2e9c2fa1
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Tue May 18 09:10:31 2021 +0100

    Move Button and Label components to `@woocommerce/blocks-checkout` package (https://github.com/woocommerce/woocommerce-blocks/pull/4222)

    * Move Button to checkout package

    * Move Label to Components Package

commit 0b91fbeac282f729dbc8e8056d2e934392f401c0
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Mon May 17 15:00:57 2021 +0100

    Update design of cart and checkout sidebars (https://github.com/woocommerce/woocommerce-blocks/pull/4180)

    * Update cart/coupon/shipping design

    * Add order summary heading

    * Move and style discounts on checkout sidebar

    * Add rate to tax lines

    * Ensure the option to display taxes itemised is available to Cart block

    * Output individual tax items below the total & add styles for this

    * Add success notice under coupon input on successful coupon addition

    * Add border to bottom of Totals footer

    * Show success message when adding coupon

    * Add padding to cart item rows

    * Add preview data to cart for when taxes are enabled

    * Add rate to cart response type

    * Add showRateAfterTaxName attribute to Cart block

    * Add control to cart block to show rate percentage after rate name

    * Add rate % in cart totals only if option is toggled on

    * Pass showRateAfterTaxName attribute down to TotalsTaxes

    * Add showRateAfterTaxName to Checkout block

    * Add control to block editor for showRateAfterTaxName on Checkout

    * Pass showRateAfterTaxName down to TotalsTaxes in Checkout

    * Change label for showing tax rates in cart and checkout blocks

    * Add test to ensure Taxes section shows in Cart block

    * Add tests for cart sidebar and rate percentages

    * Remove order summary title from checkout sidebar

    * Check if taxes are enabled before rendering the option to show rate %s

    * Add ShippingVia component to show the selected rate in sidebar

    * Remove value from individual tax rates

    * Remove bold from Shipping via label

    * Remove coupon added successfully message

    * Ensure panel headings that are h2s are the same colour as others

    * Clean up eslint warnings

    * Show rate %s by default

    * Update snapshots following design changes

    Co-authored-by: Mike Jolley <mike.jolley@me.com>

commit 0464883ec668332db5a6399569880e7b3fa3ab3f
Author: Albert Juhé Lluveras <contact@albertjuhe.com>
Date:   Sun May 16 20:00:06 2021 +0200

    Don't default to fallback in getSetting if value is falsy (https://github.com/woocommerce/woocommerce-blocks/pull/4202)

commit f95f12d3215caf30f1f49e1d29c5826156914a33
Author: Mike Jolley <mike.jolley@me.com>
Date:   Sun May 16 18:59:32 2021 +0100

    Fix es lint warnings (https://github.com/woocommerce/woocommerce-blocks/pull/4206)

    * Un-used PropTypes import

    * Avoid global and use ownerDocument

    * receiveCart return type

    * ignoreRestSiblings when destructuring for @typescript-eslint/no-unused-vars

    * Replace lodash find

    * Use global rather than window

    * Remove lodash map

    * move rule to overrides

commit db589e7e7f4809504b1aa83144116506a50bdd38
Author: Raluca Stan <raluca.stan@automattic.com>
Date:   Sun May 16 19:41:34 2021 +0200

    Fix cart and checkout frontend e2e tests (https://github.com/woocommerce/woocommerce-blocks/pull/4199)

    * Wip: fix e2e fe tests

    * Test that navigation ends

    * Fix waitForNavigation

    * comment out failing php test

    * click the dom element

    * Ensure navigation happens by waiting for it. Test page title.

    * remove skip and update docs

    * Revert "comment out failing php test"

    This reverts commit 7c40e8caf3aa32e35e3b70eb32051251b06e0613.

    * Fix USD from merge conflict

    * Add missing check for page title

    * Try page.waitForFunction for text search

    * test to see checkout page title is correct

    * test checkout page url on CI

    * unde jest config change

    * Fix assertion for checkout page

    * remove extra localStorage item remove call

    Co-authored-by: Mike Jolley <mike.jolley@me.com>
    Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>

commit b9b66f93adb5b0fdc22fc4ed9560eb6e2c1c72d9
Author: Mike Jolley <mike.jolley@me.com>
Date:   Thu May 13 11:49:39 2021 +0100

    Set order status to pending when no payment is needed (https://github.com/woocommerce/woocommerce-blocks/pull/4186)

commit 8ed63f765418ae8e7b2ee58004b4a9b1306eaeef
Author: Mike Jolley <mike.jolley@me.com>
Date:   Thu May 13 11:21:21 2021 +0100

    Remove the need for the `canMakePayment` callback in the editor context (https://github.com/woocommerce/woocommerce-blocks/pull/4188)

    * Force can pay true in editor context

    * Update docs

commit 90499cb3191137264ffde07cf082db8c4d6f77de
Author: Mike Jolley <mike.jolley@me.com>
Date:   Thu May 13 11:20:37 2021 +0100

    Sync customer data during checkout with draft orders. (https://github.com/woocommerce/woocommerce-blocks/pull/4197)

    * Update store when email changes

    * Add pluckEmail helper and convert to TS

    * improve guard

    * sync draft order with customer data

commit a813c931bb5f85f139429aa3bf094b2327a7f8cd
Author: Albert Juhé Lluveras <contact@albertjuhe.com>
Date:   Thu May 13 12:14:15 2021 +0200

    Set default store currency to USD in tests (https://github.com/woocommerce/woocommerce-blocks/pull/4203)

commit b1408933f75ca47dc39335984bfc1fe570a72aaa
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Thu May 13 10:16:04 2021 +0200

    Update dependency config to v3.3.6 (https://github.com/woocommerce/woocommerce-blocks/pull/4195)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit d68bb11bb56d882f8755162ae6657cad76dfd16f
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Thu May 13 10:15:35 2021 +0200

    Update dependency cssnano to v4.1.11 (https://github.com/woocommerce/woocommerce-blocks/pull/4196)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit beadbab90fe0813c0f36cc25a9e0b14a8f8e96d2
Author: Seghir Nadir <nadir.seghir@gmail.com>
Date:   Wed May 12 13:32:05 2021 +0100

    Add cart data to filters (https://github.com/woocommerce/woocommerce-blocks/pull/4164)

    * add cart data to filters

    * add extensions back to footer filter

commit c10fdf26bc37b1efb6b22d045e3aed72f5541a2a
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 12 13:04:44 2021 +0100

    Pin dependency lodash to 4.17.21 (https://github.com/woocommerce/woocommerce-blocks/pull/4193)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit f92aac55f1a6fd67fba3885311ec74bcdb41034e
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 12 13:04:13 2021 +0100

    Update dependency chalk to v4.1.1 (https://github.com/woocommerce/woocommerce-blocks/pull/4194)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 27cff5109889c0abca24124c1dabcb0b78da4929
Author: Mike Jolley <mike.jolley@me.com>
Date:   Wed May 12 13:02:26 2021 +0100

    Should be using value rather than name (https://github.com/woocommerce/woocommerce-blocks/pull/4187)

commit 560972a7eb306b6a27c298b7e3218df92a848e79
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Tue May 11 13:57:02 2021 +0100

    Add checkout filter for coupon names (https://github.com/woocommerce/woocommerce-blocks/pull/4166)

    * Make extensions optional, not all filters will need to pass this through

    For example the CartCouponSchema has no option for extensibility (and I don't think it's needed at any rate) so extensions will always be an empty object. Rather than explicitly specifying this when running the filter, we can let it default to an empty object.

    * Add filter for coupon code

commit 556ceb4b8a222466a73aae1ee0eac545e00802b4
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Tue May 11 11:45:02 2021 +0100

    Check if variation data is iterable before formatting (https://github.com/woocommerce/woocommerce-blocks/pull/4182)

commit 4279db88057e83eff8af077a96eeb19dd247a8d2
Author: Darren Ethier <darren@roughsmootheng.in>
Date:   Mon May 10 11:21:01 2021 -0400

    update package-lock (version change mostly)

commit f71b24ad0f634c2cb8aeac8ae80e0ccd139a4fcd
Author: Darren Ethier <darren@roughsmootheng.in>
Date:   Mon May 10 11:16:58 2021 -0400

    update version string to dev version

commit 7f9c1b2913f9c06f4d755519ef2689c56703a2c0
Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Date:   Mon May 10 11:14:05 2021 -0400

    Release: 5.1.0 (https://github.com/woocommerce/woocommerce-blocks/pull/4185)

    * Empty commit for release pull request

    * Add changelog

    * update testing notes

    * Bumping version strings to new version.

    Co-authored-by: github-actions <github-actions@github.com>
    Co-authored-by: Darren Ethier <darren@roughsmootheng.in>

commit 80c27354e1eb83d027eb9670aed59885c2097d3d
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon May 10 14:38:04 2021 +0200

    Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/4184)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 90074cf871d8691d0adf5808e59a75b9ace98fa7
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Mon May 10 10:03:30 2021 +0100

    Convert shipping components to typescript (https://github.com/woocommerce/woocommerce-blocks/pull/4135)

    * Add type defs for customer

    Taken from 194ecccf78/assets/js/type-defs/customer.ts

    * Convert ShippingCalculatorAddress to TypeScript

    * Convert ShippingCalculator to TypeScript

    * Convert ShippingLocation to TypeScript

    * Allow packageId to be a number or string in useSelectShippingRate(s)

    * Convert ShippingRatesControl to TypeScript

    * Convert ShippingOptionsStep to TypeScript

    * Allow package_id to be a string or number

    This is because of Subscriptions using strings for package IDs

    * Change to use CartShippingRateItemShippingRate instead of Rate

    * Add extra props to PackageProps type

    * Make ShippingAddress have the correct type

    * Use CartShippingRateItemShippingRate instead of Rate

    * Remove Rate type

    * Set return types to JSX.Element

    * Change type of props.renderOption in ShippingRatesControl

    * Remove customer type defs and relocate aliases to default-address-fields

    * Add EnteredAddress type

    * Import EnteredAddress from new location

    * Remove unnecessary eslint ignore

    * Remove unused variable

    * Remove confusing use of word Item in Shipping types

    * Remove confusing use of word Item in Shipping types

commit 3f1be394d076bdc2a407c05d1fbf290a17c55c43
Author: Albert Juhé Lluveras <contact@albertjuhe.com>
Date:   Mon May 10 10:00:14 2021 +0200

    Feature gate PaymentApi (https://github.com/woocommerce/woocommerce-blocks/pull/4176)

    * Feature gate PaymentApi

    * Improve payment method missing dependencies error message so it's clear it only affects blocks

    * Add PaymentApi feature flags to list of feature flags in docs

commit ed7eded4d7134d1b69d0fd206cd1315fd9d2d40f
Author: Darren Ethier <darren@roughsmootheng.in>
Date:   Fri May 7 16:39:28 2021 -0400

    Improvements to `emitEventWithAbort`. (https://github.com/woocommerce/woocommerce-blocks/pull/4158)

    * modify emitEventWithAbort to change return value

    `emitEventWithAbort` now returns an array of responses up to the first response that triggered an error or fail response instead of aborting on success responses too.

    * update add to cart form context provider

    * update checkout state context provider

    * update payment method data context provider

    * update tests and fix thrown error handling.

commit 2be9a4ea4405d5df427f4e97025aa5433019b72f
Author: Raluca Stan <raluca.stan@automattic.com>
Date:   Fri May 7 15:50:55 2021 +0200

    Add lodash as a devDependency (https://github.com/woocommerce/woocommerce-blocks/pull/4179)

commit 69b3679a7e585abc8a5068df3bd2457714149939
Author: Seghir Nadir <nadir.seghir@gmail.com>
Date:   Wed May 5 12:59:30 2021 +0100

    Don't clear email and phone fields when using separate billing address. (https://github.com/woocommerce/woocommerce-blocks/pull/4162)

    * preseve-billing-data

    * pluck empty email and phone

    * add issue number

commit 214014750c0a1414e89ce47d84754d278e5a164f
Author: Raluca Stan <raluca.stan@automattic.com>
Date:   Wed May 5 13:52:27 2021 +0200

    Fix/cart backend test (https://github.com/woocommerce/woocommerce-blocks/pull/4153)

    * Fix backend cart e2e test

    * Adjust test structure

    * Fix e2e checkout backend test.

    Make sure the confirmation window is closed

commit f8d9b9084c091f97b281f58a64f98622765a80e3
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 5 10:08:45 2021 +0000

    Update dependency @stripe/stripe-js to v1.14.0 (https://github.com/woocommerce/woocommerce-blocks/pull/4170)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 2391a40ab24439b14f56d1d6416beaf0c2d94c53
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date:   Wed May 5 10:41:48 2021 +0100

    Add documentation for filters (https://github.com/woocommerce/woocommerce-blocks/pull/4167)

    * Rename the argument in the CheckoutFilterFunction type

    This only exists as an extra descriptive hint to anyone using this type, the value `label` was never used by anything so it does not need to be changed anywhere else.

    * Create Available Filters document

    * Add available filters to the extensibility README

    * Update docs/extensibility/available-filters.md to fix typographical error

    Co-authored-by: Mike Jolley <mike.jolley@me.com>

    Co-authored-by: Mike Jolley <mike.jolley@me.com>

commit f4af89b2fce203c4f173845244724f58669a04f9
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 5 08:10:24 2021 +0000

    Update dependency @woocommerce/e2e-utils to v0.1.4 (https://github.com/woocommerce/woocommerce-blocks/pull/4172)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 6c9e786c407fd1bd6861bde3b435cec0663b8399
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 5 03:31:52 2021 +0000

    Update dependency @types/react to v16.14.6 (https://github.com/woocommerce/woocommerce-blocks/pull/4171)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 3ba4d9ed6a46f3700a7190d09eff2ba53d1bcb60
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed May 5 02:23:13 2021 +0000

    Update babel monorepo (https://github.com/woocommerce/woocommerce-blocks/pull/4169)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 35f71df36f92028cfb880e314623b33c077a384d
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Tue May 4 14:07:05 2021 +0100

    Lock file maintenance (https://github.com/woocommerce/woocommerce-blocks/pull/4163)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 4c65211b375e40691aeea7273eec34f3f54a0b3b
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Wed Apr 28 14:09:28 2021 +0000

    Coped package-lock.json from trunk

commit 703cb65efb8fd4ced58234d5174dc198e225e07a
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Wed Apr 28 14:00:32 2021 +0000

    Reverted package-lock.json ( downgraded node version to 12 )

commit 41dfd79715d4b4f1e5cebd0e7dccfc1573ba4d36
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Wed Apr 28 11:12:45 2021 +0000

    Pre pull request clean up code

commit 75fc62e99ed63389c158352b73ae898c986d92bd
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Tue Apr 27 13:03:24 2021 +0000

    Added Stock Status filter

commit e7bd0e6e1e171a041ac17b8b11abc812585f7645
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Fri Aug 20 16:53:56 2021 +0400

    Escape statuses for sql query

    Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

commit 29c8493aaeb6dca6b3cf5e1954a39564ea304d87
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Fri Aug 20 16:53:18 2021 +0400

    Allow custom stock statuses

    Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

commit 63ecd04bf09a53049bdb10d3919acf6ced7ead8a
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Wed Jul 28 06:22:04 2021 +0000

    Bring back removed css

commit 27e0233cb67f60f650856455a0ff32c6d73c35e3
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Tue Jul 27 23:35:15 2021 +0400

    Update assets/js/blocks/stock-filter/block.js

    Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

commit 136c32ddd3f485be5aeab274c675743a235a8c25
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Thu Jul 15 06:50:06 2021 +0000

    Fixed preview part for stock and attribute filters

commit ef89751b634bf223f065067f47f726b662d75ef3
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Wed Jul 14 20:15:05 2021 +0400

    Update index.js

commit a63dbcef7058ffd858a71931b6fc2ead0583ae03
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Wed Jul 14 15:43:06 2021 +0000

    Review suggestion changes

commit 6b0f5d2206d010c1822ab7eaf4edea9a0b79526d
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Wed Jul 14 15:40:52 2021 +0000

    Linter fix

commit 791b38b31782367864e1bb8f26716b7fef0e63a8
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Wed Jul 14 15:37:41 2021 +0000

    Removed hideOutOfStock from AllProducts and realized hide out of stock functionality from SQL query

commit 1a7a002d5eac271c6f2331e3e66411f3127282b1
Author: groguo <eriktadevosyan07@gmail.com>
Date:   Wed Jul 14 15:21:51 2021 +0000

    Created new component for Filters elements labels

commit d9b7fae24d4235a0f8f424e7e74cd250e62bc897
Author: aaron <aaron.yor@gmail.com>
Date:   Wed Jun 2 11:57:06 2021 +0400

    Fix label includ path

commit 5311584362dca4c6e5a91de5fdfbff29297799ea
Merge: 92a0da3f 1b87589f
Author: aaron <aaron.yor@gmail.com>
Date:   Wed Jun 2 11:52:48 2021 +0400

    Merge remote-tracking branch 'core/trunk' into add/stock-filter

    # Conflicts:
    #	package-lock.json

commit d8e6dabaa3282855c6c91c908d6a1443ea9732f1
Merge: 583113e3 2b695215
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Fri Apr 30 12:28:09 2021 +0400

    Merge pull request woocommerce/woocommerce-blocks#1 from woocommerce/trunk

    Fork update

commit 92a0da3f8c37aa46ce2330cb8095ab7077d01555
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Wed Apr 28 14:09:28 2021 +0000

    Coped package-lock.json from trunk

commit ae0d12b57a5be6f1a39577404c017174489345f8
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Wed Apr 28 14:00:32 2021 +0000

    Reverted package-lock.json ( downgraded node version to 12 )

commit 5e0c7f9fe36bc9358743b7af7d9e47ce66f8ac08
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Wed Apr 28 11:12:45 2021 +0000

    Pre pull request clean up code

commit 105b3f75a2b42f12f6924091f51bfa91c84b4984
Author: grogou <eriktadevosyan07@gmail.com>
Date:   Tue Apr 27 13:03:24 2021 +0000

    Added Stock Status filter
2021-08-20 15:49:11 +01:00
Thomas Roberts 852333c867 Update `PaymentMethodIcons`, and `CheckoutButton` components to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/4376)
* Change PlaceOrderButton to TypeScript

* Change type on Icon to allow attributes from image/svg elements

* Convert PaymentMethodLabel to TypeScript

* Add PaymentMethodIcon type

* Update utils (normalizeIconConfig) to TypeScript

* Update CheckoutButton to TypeScript

* Add types folder to tsconfig

* Convert PaymentMethodIcon to TypeScript

* Convert PaymentMethodIcons to TypeScript

* Convert common-icons to TypeScript
2021-08-20 07:55:30 -04:00
Mike Jolley 15456624c9 Create a NoExpressPaymentMethodsPlaceholder component (https://github.com/woocommerce/woocommerce-blocks/pull/4603) 2021-08-20 12:30:38 +01:00
Albert Juhé Lluveras 3f55ed5566 Make SortSelect components controlled (https://github.com/woocommerce/woocommerce-blocks/pull/4580)
* Make ReviewSortSelect controlled

* Remove defaultValue prop from SortSelect and ProductSortSelect
2021-08-18 09:33:13 +02:00
Mike Jolley 976e3d057a Fix eslint notice in BlockTitle component 2021-08-17 17:09:04 +01:00
Tom Cafferkey 4420819a1f Add label for Block Title component to satisfy accessibility (https://github.com/woocommerce/woocommerce-blocks/pull/4585) 2021-08-17 16:21:07 +01:00
Mike Jolley 717465ed99 Combobox patch to prevent the suggestion list being left open after browser autocomplete (https://github.com/woocommerce/woocommerce-blocks/pull/4590)
* Combobox patch

* Update a package to invalidate CI cache

* Update cache handling

* revert eslint package change
2021-08-17 13:25:11 +01:00
Mike Jolley 71851f25a5 Add padding in 2020 and 2021 (https://github.com/woocommerce/woocommerce-blocks/pull/4588)
* Add padding in 2020 and 2021

* add todo
2021-08-17 12:03:07 +01:00
Mike Jolley 4d72866925 Remove top rule so validation messages are positioned correctly below the fields (https://github.com/woocommerce/woocommerce-blocks/pull/4582) 2021-08-16 13:46:37 +01:00
Seghir Nadir 0d6bb11135 Call validation before submitting the order (https://github.com/woocommerce/woocommerce-blocks/pull/4561)
* run validation again on submit

* hook into onCheckoutValidationBeforeProcessing instead

* back to isBeforeProcessing

* add todo
2021-08-16 12:53:26 +01:00
Seghir Nadir 5a0840506e update Checkout i2 locks to attributes. (https://github.com/woocommerce/woocommerce-blocks/pull/4571)
* update locks to attributes instead

* remove lock from support attribute
2021-08-16 11:20:27 +01:00
Albert Juhé Lluveras 70ec1f8b31 Add optimizations around checkout filter calls (https://github.com/woocommerce/woocommerce-blocks/pull/4570)
* Extract productPriceValidation out of the component

* Extract checkout filter args outside of component

* Remove unnecessary default fallback

* Mark ProductName optional props as not required

* Use an empty array constant for the filteredNotices default value when there are no notices

* Refactor Panel component so hidden contents are not rendered

* Prevent extensions changing on each call of __experimentalApplyCheckoutFilter if it was an empty object

* Add missing line break

* Update tests
2021-08-13 15:42:09 +02:00
Albert Juhé Lluveras ff9c73bec5 Implement memoization in several selectors and hooks (https://github.com/woocommerce/woocommerce-blocks/pull/4548)
* Memoize cartErrors from useStoreCart

* Implement memoization to other selectors

* Use EMPTY_ARRAY in more cases

* Create getArrayOrEmptyConstant function

* Remove DEFAULT_EMPTY_ARRAY constant and use EMPTY_ARRAY instead

* Wrap removeItem into useCallback

* Fix tests

* Do not default to empty array/object for values that should exist and use different constant for empty values

* Type two empty array constants from default-states.ts
2021-08-13 15:28:41 +02:00
Niels Lange 5ec99c15f0 Reviews by Category: Show review count instead of product count (https://github.com/woocommerce/woocommerce-blocks/pull/4552) 2021-08-13 12:02:15 +01:00
Mike Jolley a7d7ea32bb Fix unfiltered html usage of blocks (https://github.com/woocommerce/woocommerce-blocks/pull/4551)
* SSR search

* deprecation handling for search

* Update snaps

* Fix duplicate class and align class property
2021-08-12 17:39:38 +01:00
Mike Jolley a40893ae3a Switch from Select to Combobox for Country and State Inputs (https://github.com/woocommerce/woocommerce-blocks/pull/4369)
* Add combobox control

* Implement in country and state

* mobile styling

* styling across themes

* Remove validated select component

* Use focus-within

* Update tests

* Use @wordpress/compose

* Move field clearing to effect hook

* Patch combobox component

PR https://github.com/WordPress/gutenberg/pull/33928

* patch package after install

* update package

* Prevent autofill handling impacting manual input

* Add todo

* combo requires option to be selected
2021-08-12 17:30:42 +01:00
Brett Shumaker 946e05d70b Fix store notice classes (https://github.com/woocommerce/woocommerce-blocks/pull/4568)
The `StoreNoticesContainer` component is using an incorrect class name for a "success" notice and also applying the general `woocommerce-message` (what's used by WC core for the "success" notice) to all notices. In some instances, this could cause the general `woocommerce-message` styles to be applied instead of the `woocommerce-error` or `woocommerce-info` styles.

This PR changes the use of `woocommerce-success` to `woocommerce-message` and prevents `woocommerce-message` from being applied to all notices.
2021-08-12 14:43:35 +02:00
Sandip Mondal e831faa007 Enable re-select category for Featured Category block (https://github.com/woocommerce/woocommerce-blocks/pull/4559)
* Enable re-select category for featured category block

* update shop now button url on re-select

* Update comments

Co-authored-by: Albert Juhé Lluveras <aljullu@gmail.com>

Co-authored-by: Albert Juhé Lluveras <aljullu@gmail.com>
2021-08-09 14:09:48 +02:00
Mike Jolley f0fb1af7d3 Fix handpicked product selections when a store has over 100 products. (https://github.com/woocommerce/woocommerce-blocks/pull/4534)
* Convert withSearchedProducts to typescript

* isLargeCatalog query needs no limit

* Pass tests
2021-08-06 14:25:12 +01:00
Niels Lange cbe9afd38e Twenty Twenty: Fix broken sale badge left alignment (https://github.com/woocommerce/woocommerce-blocks/pull/4549)
* Twenty Twenty: Fix broken sale badge left alignment

* Twenty Twenty: Refactor sale badge alignment fix
2021-08-06 10:37:24 +02:00
Niels Lange 7b57028b77 Twenty Twenty-One: Adjust removable chip background color (https://github.com/woocommerce/woocommerce-blocks/pull/4547)
* Twenty Twenty-One: Adjust removable chip background color

* Twenty Twenty-One: Remove GitHub reference from implementation
2021-08-05 14:50:06 +02:00
Mike Jolley b941b0c332 Update Dependencies to Latest Versions supporting React 16x (https://github.com/woocommerce/woocommerce-blocks/pull/4532)
* Update storybook to 6.3.6

* @storybook/addon-knobs

* Remove need for wordpress-compose imports

This functionality exists in WP 5.5 so we don't need to import the package any more.

* Update to latest non 17x packages

* Composer update

* Fix for @babel/plugin-proposal-nullish-coalescing-operator and spinner style

* onSelect was called before init

* Add back env

* Update locks

* Revert browserlist config increase (ie11 support dropped needs separate discussion)

* update locks

* SVG can come from the external

* Import from components package where possible (5.5 has Gutenberg 9.2.0) and revert component package version change

* Revert component imports. Import from wordpress-components in the frontend context. This removes `wp-components`  dependency from all -frontend asset files.
2021-08-05 10:26:00 +01:00
Niels Lange b601055db4 Use hidden HTML element instead of .screen-reader-text for CSS class toggling helper texts (https://github.com/woocommerce/woocommerce-blocks/pull/4530) 2021-08-04 10:07:48 +02:00
Albert Juhé Lluveras db9b84d837 Update pagination class names to match our coding guidelines (https://github.com/woocommerce/woocommerce-blocks/pull/4528) 2021-08-02 13:36:46 +02:00
Seghir Nadir 420b400f8d fix possible memory leak (https://github.com/woocommerce/woocommerce-blocks/pull/4524) 2021-08-02 10:19:07 +01:00
Mike Jolley 7ff3dac568 Fix e2e tests: Remove paypal from fixture data (https://github.com/woocommerce/woocommerce-blocks/pull/4507)
* Remove paypal from fixture data

* Fix scroll hoc tests

* Missing return type in cart causing TS error

* update e2e utils

* Replace searchForBlock method in e2e utils

* Single block update insert block

* Use insertBlockDontWaitForInsertClose
2021-07-26 15:05:09 +01:00
Thomas Roberts fb846c5b78 Update `snackbarNotices` filter to `snackbarNoticeVisibility` (https://github.com/woocommerce/woocommerce-blocks/pull/4417)
* Change snackbarNotices filter to snackbarNoticeVisibility

* Add deprecation notice to snackbarNotices

* Rename noticesToDisplay to visibleNotices

* Update link in deprecated message
2021-07-26 09:13:54 +01:00
Seghir Nadir 45bbe80259 move SlotFillProvider before pluginArea (https://github.com/woocommerce/woocommerce-blocks/pull/4501) 2021-07-23 15:08:29 +01:00
Mike Jolley ea007aea6a Add checkout term field validation (https://github.com/woocommerce/woocommerce-blocks/pull/4496)
* Add notice if terms is unchecked when processing checkout

* Type StoreNotices and correctly scroll to error

* Checkbox error styles

* Hide input fields are invalid notice - validation notices are inline

* Scroll to error inputs

* Working inline validation for terms

* Add todo for exposing data

* update todo

* ensure checkbox is enabled before validating
2021-07-23 14:21:59 +01:00
Mike Jolley f78da3c355 WIP - Checkout i2 Feature Branch Tracking (https://github.com/woocommerce/woocommerce-blocks/pull/4268)
* Duplicate checkout block

* Contact information block

* form step block

* shipping address block

* Setup atomic blocks

* Container structure

* More formal steps rather than generic form step

* Add billing and shipping forms

* add checkout actions block

* add order note block

* Add order summary

* add payment block

* Add inspector controls for address fields

* frontend WIP

* move attributes

* wrap shipping with form step

* PhoneNumber to typescript

* Remove column block

* form steps

* move payment logic to frontend

* Express block

* inline payment block

* Add shipping method block

* Render inner blocks (not standalone blocks) and add classes to Atomic Block list on php side

* lazy again

* Add more wrappers from old frontend file

* add layout

* Checkout wrappers were missing

* Enqueue payment methods for new block

* Add missing classnames

* Move shipping as billing state to context provider

* express payments rendering

* try/block-registry

* Remove atomic components (unused)

* Fix attribute persistance due to template locking

* Fix shipping display when not needed

* Set correct parent blocks for inner blocks

* pass data to blocks

* demo/newsletter

* Skeleton styling

* only apply styles to loading state for now

* shipping method block frontend

* rename express block

* lock template

* fix ts warning for __webpack_public_path__

* Refactor to avoid duplicating atomic block logic

* remove changes in save method

* Add zones and shipping methods to the sidebar for the shipping inner block

Closes woocommerce/woocommerce-blocks#4320

* Fix script handles

* Fix method display when there are none

* Add shipping phone

* Add phone to api and sync with billing correctly

* Clear hidden fields on load

* fix requirePhoneField property

* Enable shipping and billing phone fields

* readonly field support

* Handle context attributes

* Fix createInterpolateElement usage

* add totalswrapper

* Implement Terms and Conditions block for Checkout i2  (https://github.com/woocommerce/woocommerce-blocks/pull/4436)

* Setup atomic blocks

* frontend WIP

* Express block

* try/block-registry

* Set correct parent blocks for inner blocks

* Skeleton styling

* Refactor to avoid duplicating atomic block logic

* add block locking

* add terms and conditions block

* hardcore settings image

* lock blocks from being deleted

* hide original checkout block

* mark blocks as side effectful

* move variations to block register function

* prevent core checkout blocks from needlessly showing in the inserter

* enable checkout i1

* fix broken rebase

* move save back

* Localise default text

Co-authored-by: Mike Jolley <mike.jolley@me.com>

* Add add-hoc Block locking from WooCommerce Blocks side. (https://github.com/woocommerce/woocommerce-blocks/pull/4454)

* add locking

* use subscribe instead

* fix condition

* add locking to blocks

* check if the item is not a text field

* Tidy up hacks CSS class handling

* Fix error if node is undefined

* Hide menu when move is disabled

* update package lock

* Add todo and fix issue where selector returns null

* split todos

* move todo

* edit comment

Co-authored-by: Mike Jolley <mike.jolley@me.com>

* Un-disable the billing checkbox in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/4457)

* Add missing Slot fill provider on frontend

Fixes woocommerce/woocommerce-blocks#4441 by adding the slot fill provider to the checkout-i2 block.

* Use column style appender

* Add padding/styles to actions

* Add/update icon library

* Multiline checkbox alignment

* Icons and copy changes for i2 blocks

* Add terms by default

* Add notice if text is missing links (https://github.com/woocommerce/woocommerce-blocks/pull/4466)

* Swap variations for toggle

* Add payment settings to inspector

* Update package lock

* Add inline docs to block registry

* Add inner block areas below each form step.

This does not include the form step contents, just adds inner blocks after existing content. Moving content within the inner block area is a separate discussion.

This closes woocommerce/woocommerce-blocks#4306

* Sample block registration + docs

* Add tests for registerCheckoutBlock

* Fix lazy component detection in tests

* Add basic transform between i1 and i2

* remove template lock todo

* Update scroll to top hoc

* Move shared settings to new context providers

Closes woocommerce/woocommerce-blocks#4472

* Remove readonly field support (unused)

* Remove context code

* Experimental

* remove invalid typedef

* FIx scrolling on validation due to misplaced context provider

* Update assets/js/base/context/providers/cart-checkout/checkout-state/index.tsx

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>

* Update comment to remove reference to phone

* Update packages/checkout/blocks-registry/README.md

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>

* Rename ScrollToTopComponent

* Add explicit list of expectedType in TypeScript definition

* Add todo to remove custom shipping phone handling

* Remove dangerouslySetInnerHTML in External Link Card Component

* Add ExternalLinkCard to storybook

* update todo wording

* Refactor withScrollToTop to remove useCallback and use typescript

* Support children on CheckboxControl, with added Typescript

* Spread getRegisteredBlocks return value

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2021-07-22 12:03:00 +01:00
Albert Juhé Lluveras 99e273078b Remove dead files (https://github.com/woocommerce/woocommerce-blocks/pull/4471) 2021-07-19 10:22:32 +01:00
Raluca Stan 4907ddcd5d Fix all review memory leak on block transform (https://github.com/woocommerce/woocommerce-blocks/pull/4428) 2021-07-12 14:58:10 +03:00
Mike Jolley 870a8c0b93 Switch arrow unicode characters (https://github.com/woocommerce/woocommerce-blocks/pull/4364)
* Switch arrow unicode characters

* flip arrow with css
2021-07-12 12:32:45 +01:00
Thomas Roberts f735f698e0 Add camelcase rule to eslint config (https://github.com/woocommerce/woocommerce-blocks/pull/4382)
* Add rules to allow camelCase variables as object properties

* Remove disable camelcase comments

* remove disable camelcase comments

* Remove space from eslint ignore rule
2021-07-09 17:53:45 +01:00
Seghir Nadir 2f440bbe20 Move SlotFillProvider to frontend only (https://github.com/woocommerce/woocommerce-blocks/pull/4437)
* Move SlotFillProvider to frontend only

* remove extra config for editor scripts

* update tests
2021-07-08 16:04:13 +01:00
Mike Jolley b9d07173d4 Import `createInterpolateElement ` from `@wordpress/element` (https://github.com/woocommerce/woocommerce-blocks/pull/4368)
* change import for interpolate element

* remove dependency

* fix package lock

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2021-07-07 13:27:50 +01:00
Thomas Roberts 15fdc41e8f Add styles to stop totals items being padded inside panels (https://github.com/woocommerce/woocommerce-blocks/pull/4435)
* Add styles to stop totals items being padded inside panels

* Remove extra linebreak

* Use padding shorthand

* Move style into already established sidebar selector
2021-07-07 13:20:26 +01:00
Thomas Roberts c17cfb7db8 Make payment method icons display well even if theme tries to override their height/width (https://github.com/woocommerce/woocommerce-blocks/pull/4427)
* Make payment method icons display well even if theme tries to override

* Update flex justification for alignment styles

* Ensure payment method icons are displayed correctly in Checkout

* Remove center from object-position
2021-07-06 09:30:02 +01:00
Michael P. Pfeiffer b6a1edd62a Ensure product grids display as intended in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/4424) 2021-07-05 11:58:48 +02:00
Thomas Roberts 522f722b2b Create `StoreNoticesWithSnackbarProvider` (https://github.com/woocommerce/woocommerce-blocks/pull/4407)
* Add StoreNoticesWithSnackbarProvider component

* Remove snackbar from regular StoreNoticesProvider

* Create useStoreNoticesWithSnackbar hook

* Remove anything snackbar related from StoreNoticesContext

* Remove snackbar styles from store-notices

* Make checkout use store notices with snackbar context

* Move snackbar notices container to new directory

* Make useStoreCartCoupons use the notices with snackbar context

* Update tests

* Rename path and remove addSnackbarNotice

* Use StoreSnackbarNoticesProvider in Cart and Checkout blocks

* Update snackbar tests

* Update paths

* Update tests

* Create store notice provider for snackbar notices only

* Update context functions to include the word snackbar

* Change nesting in checkout

* Remove unused file
2021-07-05 09:38:08 +01:00
Michael P. Pfeiffer 719a8952ff Block Widgets: fix product grid display (https://github.com/woocommerce/woocommerce-blocks/pull/4419) 2021-07-05 08:58:00 +02:00
Thomas Roberts c3f4310fe2 Add `TotalsWrapper` component (https://github.com/woocommerce/woocommerce-blocks/pull/4415)
* Add TotalsWrapper component and associated styling

* Add TotalsWrapper around the subtotal, fees and discount

* Remove margins/paddings/borders from sidebar elements

This is to allow TotalsWrapper to be the component responsible for handling spacing and borders.

* Update styles to allow components to be wrapped in TotalsWrapper

* Move TotalsWrapper to checkout package

* Wrap all parts of Cart sidebar in TotalsWrapper

* Remove border from coupon panel

* Add has-bottom-border option to TotalsWrapper

* Wrap checkout sidebar components in TotalsWrapper

* Remove border/padding from order summary

* Add hasValidFills function

This will be used to check if a Slot has any fills that return truthy values.

* Remove borderSize and hasBottomBorder props from TotalsWrapper

* Wrap Slots in TotalsWrapper

* Update hasValidFills to check length of array

* Update tests and snapshots

* Only render tax totals if tax is more than 0
2021-07-02 15:56:39 +01:00
Thomas Roberts 589f6923d6 Export `Button` and `Label` from `wc-blocks-checkout` package (https://github.com/woocommerce/woocommerce-blocks/pull/4406)
* Remove snackbar filtering

* Revert "Move Button and Label components to `@woocommerce/blocks-checkout` package (https://github.com/woocommerce/woocommerce-blocks/pull/4222)"

This reverts commit 983ce48cad.

* Export Label and Button from the wc-blocks-checkout package

* Reorder exports

This is so the diff is smaller in the PR

* Revert "Remove snackbar filtering"

This reverts commit 8e598436e871aa56f89740fbe6fbe522fd02db1d.
2021-07-02 10:24:07 +01:00
Thomas Roberts 93b750ee19 Change `couponName` filter to `coupons` and update documentation (https://github.com/woocommerce/woocommerce-blocks/pull/4312)
* Rework coupon filters to not be applied individually

* Add a `text` property to the coupons in the cart

This is needed to allow extensions to change the text without affecting the code.

* Output coupon text instead of code

* Add coupons filter documentation

* Add deprecation warning when extension uses couponName filter

* Change couponName filter to coupons

* Add label to Cart item definition

* Change coupon.text to coupon.label

* Update coupon.label in coupon aria-label

* Update image and coupon.text in docs

* Add filter registration example
2021-07-01 14:12:46 +01:00
Mike Jolley 686a6f4ece Audit and Move Image Assets, update error state (https://github.com/woocommerce/woocommerce-blocks/pull/4389)
* Remove avatar.jpg

* Inline grid block preview svg

* Replace spilled icecream error icon with generic icon

* Inline single product block preview

* Improve block error styling and icon

* Move payment method icons

* Replace WC_BLOCKS_ASSET_URL usage

* Remove unused images

* update snaps
2021-06-29 15:04:24 +01:00
Mike Jolley a2cbc97b17 Add screen reader text to price range (https://github.com/woocommerce/woocommerce-blocks/pull/4367) 2021-06-23 11:51:46 +01:00
Mike Jolley 5ba5722a49 Allow HTML in the All Products Block Product Titles (https://github.com/woocommerce/woocommerce-blocks/pull/4363)
* Render titles as HTML in ProductName component and use Typescript

* Update snaps
2021-06-23 11:51:32 +01:00
Mike Jolley b2da9f602a Append SKU to name for SearchListControl (https://github.com/woocommerce/woocommerce-blocks/pull/4366)
* Append skus to name

* Update assets/js/editor-components/products-control/index.js

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* formatting

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2021-06-17 11:30:57 +01:00
Thomas Roberts 995d6f0f82 Update `AddressForm` and related components to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/4365)
* Add type argument to getSetting

* Convert prepareAddressFields to TypeScript

* Add State and Country Input prop types

* Type country input

* Type state input

* Convert AddressForm to TypeScript

* Add SHIPPING_COUNTRIES, ALLOWED_COUNTRIES (and states) to constants.ts

* Add return types to components

* Remove shipping-country-input JS file

* Fix type of CountryInputWithCountriesProps

* Use type argument in constants.ts

* Remove unnecessary braces on onChange function

* Use correct case for allowedCountries
2021-06-17 09:35:24 +01:00
Thomas Roberts 984c5a0eb1 Add type argument to getSetting (https://github.com/woocommerce/woocommerce-blocks/pull/4361) 2021-06-17 08:50:52 +01:00
Mike Jolley 84718840d6 Update Express Payments Loading UI (https://github.com/woocommerce/woocommerce-blocks/pull/4228)
* Separate button spinner to separate component for reuse

* Use block checkout spinner in loading mask

* Block pointer events within loading mask

* Give the useRef within useShallowEqual a default value

This prevents the potential of having an undefined value returned.

* State setter and dispatch are stable

These do not need to be used as dependencies.

* Prevent re-renders of children when using loading mask.

This prevents children being rerendered and losing state. Loading styles are applied instead using a classname, but leaving the divs in place.

* Use memoization to to prevent excessive express payment rerenders

* Wrap express payment in loading mask

* Show loading state after submission

* remove eslint exclusion

* Move spinner to base components so it's available outside of the checkout package

* Avoid extra is-loading classname

* Update snaps/fix tests

* Remove memorization of payment method content due to stale data

* Express payment error handling

* Split up payment method context to make it more manageable

* Add blocking logic to cart

* Update snap

* Restore useRef

* Fix missing function removed by accident

* Fix setActivePaymentMethod and started status (so saved methods still allow express to be initialized)

* Loading Mask Todo

* Remove boolean shallow equals

* Missing dep

* Memoize typo

* Document changes in useStoreEvents

* Replace expressPaymentMethodActive

* setExpressPaymentError deprecation

* Only change status if an error is passed

* Track disabled state via useCheckoutSubmit

* useCallback on error message functions

* Fix mocks in test
2021-06-16 13:44:40 +01:00
Albert Juhé Lluveras 0c5cd9eea0 Make Product Categories List links unclickable in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/4339) 2021-06-15 07:33:16 +02:00
Rua Haszard 8fb7ab7821 Add storybook demo for Chip (https://github.com/woocommerce/woocommerce-blocks/pull/3029)
* add stories for Chip

* Add more knobs to Chip storybook

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2021-06-14 16:53:44 +01:00
Albert Juhé Lluveras efc9d44b11 Fix Product Categories List display issues in WP 5.8 (https://github.com/woocommerce/woocommerce-blocks/pull/4335) 2021-06-12 11:44:41 +02:00
Thomas Roberts 77e5dafbf9 Add DiscountsMeta slot to Checkout sidebar (https://github.com/woocommerce/woocommerce-blocks/pull/4310)
* Add DiscountsMeta slot to Checkout sidebar

* Update Checkout snapshot
2021-06-11 15:37:19 +01:00
Mike Jolley a815993b40 Refactor Render Parent Block (https://github.com/woocommerce/woocommerce-blocks/pull/4325) 2021-06-11 09:54:18 +01:00
Thomas Roberts a20f3425b1 Add cart/extensions endpoint to allow third party extensions to process server-side and get a new cart (https://github.com/woocommerce/woocommerce-blocks/pull/4298)
* Move text-input to checkout package

* Add support to TextInput for inputs with type number

* Add ExperimentalDiscountsMeta.Slot to Cart sidebar

* Add extra styles for Button and Panel components

* Add updateCartFromApi util to @woocommerce/blocks-checkout

* Change updateCartFromApi to TypeScript

* Stop passing contexts through the discounts slot fill

* Add CartExtensionsSchema class

* Add CartExtensions Route

* Add register_update_callback and get_update_callback fns

* Add extensionCartUpdate function

* Add applyExtensionCartUpdate action

* Make extensionCartUpdate use batching

* Add ExtensionCartUpdateArgs type definition

* Execute a success/error function after request in extensionCartUpdate

* Remove success and error functions

* Avoid including all schemas in CartExtensionsSchema instantiation

This is achieved by inheriting AbstractSchema and slightly modifying the way in which the latest cart data is returned from this endpoint.

* Update docs for extensionCartUpdate

* Handle errors from extension callbacks

* Throw better errors when incorrect namespace/functions are used

* Add tests for CartExtensions route,  ExtendRestApi update callback registration

* Add dummy get_properties method to CartExtensionsSchema
2021-06-07 12:16:47 +03:00
Thomas Roberts bafa5c2827 Add snackbar filter (https://github.com/woocommerce/woocommerce-blocks/pull/4313) 2021-06-07 11:41:33 +03:00
Michael P. Pfeiffer 20f70b6626 Block Widgets: add block transforms for legacy widgets with a block equivalent (https://github.com/woocommerce/woocommerce-blocks/pull/4292)
* Block Widgets: add transforms for legacy widgets with a block equivalent

* Update All Reviews block transform to more closely resemble the widget

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

* Convert integers to boolean

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2021-06-04 16:47:30 +02:00
Thomas Roberts ffa77f26f7 Add Slot/Fill to discounts area in cart sidebar (https://github.com/woocommerce/woocommerce-blocks/pull/4248)
* Move text-input to checkout package

* Pass validation props directly to ValidatedTextInput

* Import label relatively instead of from package

* Pass validation functions to ValidatedTextInput

This is so it doesn't need to get them from useValidationContext.

* Add InputProps to ValidatedTextInput

This will be used to control additional props on the input element of TextInput

* Spread inputProps onto <input> element of TextInput

* Export TextInput from @woocommerce/blocks-checkout

* Add @woocommerce/blocks-checkout package to tsconfig

* Allow styling to be applied to number inputs and when value is 0

* Make style order consistent

* Remove inputProps to rely on rest in TextInput

* Add specific prop for the inputErrorComponent

* Only disallow active state if value is 0 AND type is number

* Change all uses of ValidatedTextInput to also pass inputErrorComponent

* Revert "Change all uses of ValidatedTextInput to also pass inputErrorComponent"

This reverts commit ec734b99c20c4d29fcf778714246fc406ee37eaf.

* Revert "Remove inputProps to rely on rest in TextInput"

This reverts commit 1fc64cca4002206423d1fa443ff2d60130ba1ea0.

* Revert "Revert "Change all uses of ValidatedTextInput to also pass inputErrorComponent""

This reverts commit 110e3606a996668be5a32698b634b7706d16cddc.

* Revert "Revert "Remove inputProps to rely on rest in TextInput""

This reverts commit aeb03526c44b3fcc97a719a18930d08157a80baf.

* Don't pass errorMessage to ValidatedTextInput

* Add DiscountsMetaSlot

* Add ExperimentalDiscountsMeta.Slot to Cart sidebar

* Add extra styles for Button and Panel components

* Export ExperimentalDiscountsMeta from checkout package

* Add updateCartFromApi util to @woocommerce/blocks-checkout

* Add comment to updateCartFromApi

* Change updateCartFromApi to TypeScript

* Revert "Move `TextInput` to checkout package and allow it to be used for input type=number (https://github.com/woocommerce/woocommerce-blocks/pull/4238)"

This reverts commit ee9b2d20e0.

* Stop passing contexts through the discounts slot fill

* Allow ValidatedTextInput to be used for type=number

* Remove contexts from Discounts slot fill

* Update snapshots

* Stop `errorMessage` being spread onto input fields in checkout

* Add paths to tsconfig

* Remove contexts from Discounts slot

* Accept step min and max on ValidatedTextInput

* Remove "no-margin" option on buttons

* Remove spinners from input type number

* Remove `no-top-border` style from panel

* Prevent text in buttons from breaking in the middle of words

* Add checkout package to tsconfig file list

* Stop passing components through DiscountsMetaSlot
2021-06-04 09:44:26 +01:00
Seghir Nadir 749406ecb9 load controls in cart (https://github.com/woocommerce/woocommerce-blocks/pull/4291) 2021-06-04 09:17:13 +01:00
Seghir Nadir 44f31606c3 set is calculating correctly (https://github.com/woocommerce/woocommerce-blocks/pull/4293) 2021-06-02 14:52:32 +01:00
Seghir Nadir 1b87589f82 remove usage of mustBeString (https://github.com/woocommerce/woocommerce-blocks/pull/4294) 2021-06-01 09:46:02 +01:00
Thomas Roberts 61755f0f01 Fix display of itemised taxes (https://github.com/woocommerce/woocommerce-blocks/pull/4279)
* Add price to itemised tax rates & hide Total when itemised taxes are on

* Update snapshots for taxes in sidebar
2021-05-26 14:04:42 +01:00
Thomas Roberts b187f9f466 Revert "Move `TextInput` to checkout package and allow it to be used for input type=number (https://github.com/woocommerce/woocommerce-blocks/pull/4238)"
This reverts commit ee9b2d20e0.
2021-05-25 14:13:29 +01:00
Mike Jolley cf8ab9fa93 Add key to each `CartTotalItem` (https://github.com/woocommerce/woocommerce-blocks/pull/4240)
* Move type defs

* Move type guards

* Fix imports

* Extract prepareTotalItems to TS file

* usePaymentMethodInterface as TS file

* Fix TS props

* Fix currency type defs

* Add return type to usePaymentMethodInterface

* Add key prop to CartTotalItem

* Fixed up js tests

* Move SymbolPosition into type-defs package

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2021-05-25 12:49:13 +01:00
Thomas Roberts c8f6f5e372 Hide "including X in taxes" when the amount of tax is 0 (https://github.com/woocommerce/woocommerce-blocks/pull/4262)
* Hide "including x in taxes" if tax amount is 0

* Add jest types to tsconfig

* Move SHOW_TAXES into component body

This is to make the code more testable and allows us to change values. There's no significant performance impact because of this change.

* Add tests and snapshots for TotalsFooterItem
2021-05-25 08:43:46 +01:00
Thomas Roberts ee9b2d20e0 Move `TextInput` to checkout package and allow it to be used for input type=number (https://github.com/woocommerce/woocommerce-blocks/pull/4238)
* Move text-input to checkout package

* Pass validation props directly to ValidatedTextInput

* Import label relatively instead of from package

* Pass validation functions to ValidatedTextInput

This is so it doesn't need to get them from useValidationContext.

* Add InputProps to ValidatedTextInput

This will be used to control additional props on the input element of TextInput

* Spread inputProps onto <input> element of TextInput

* Export TextInput from @woocommerce/blocks-checkout

* Add @woocommerce/blocks-checkout package to tsconfig

* Allow styling to be applied to number inputs and when value is 0

* Make style order consistent

* Remove inputProps to rely on rest in TextInput

* Add specific prop for the inputErrorComponent

* Only disallow active state if value is 0 AND type is number

* Change all uses of ValidatedTextInput to also pass inputErrorComponent

* Revert "Change all uses of ValidatedTextInput to also pass inputErrorComponent"

This reverts commit ec734b99c20c4d29fcf778714246fc406ee37eaf.

* Revert "Remove inputProps to rely on rest in TextInput"

This reverts commit 1fc64cca4002206423d1fa443ff2d60130ba1ea0.

* Revert "Revert "Change all uses of ValidatedTextInput to also pass inputErrorComponent""

This reverts commit 110e3606a996668be5a32698b634b7706d16cddc.

* Revert "Revert "Remove inputProps to rely on rest in TextInput""

This reverts commit aeb03526c44b3fcc97a719a18930d08157a80baf.

* Don't pass errorMessage to ValidatedTextInput
2021-05-20 17:56:56 +01:00
Albert Juhé Lluveras c94187e450 Update @woocommerce/components (https://github.com/woocommerce/woocommerce-blocks/pull/4100)
* Add isCompact prop to components using SearchListControl

* Update @woocommerce/components to 6.1.2

* Remove legacy CSS code

* Add some CSS rules to override conflicting editor styles

* Replace showCount prop with has-count class name

* Create ExpandableSearchListItem component

* Refactor ProductControl so it uses ExpandableSearchListItem

* Update @woocommerce/components to 6.2.0

* Fix @woocommerce/components builds breaking

* Fix a11y of expandable item list children

* Set categories to an empty array by default

* Render compact control in Attribute filter sidebar

* Add countLabel to ProductAttributeTermControl

* Fix ProductTagControl selected items

* Use sentence case for countLabel

* Fix wrong margins in block editor

* Fix checkbox alignment

* Update package-lock.json

* Fix withCategories test

* Fix JS error in Filter Products by Attribute block

* Make input ids unique
2021-05-20 10:58:59 +02:00
Thomas Roberts 26a84cedde Convert TextInput and ValidatedTextInput to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/4226)
* Change index file from base/context to .ts

This is to stop TS complaining when importing things from here.

* Convert ValidatedTextInput to TypeScript

* Convert TextInput to TypeScript

* Ensure Label accepts correct HTML Attributes Props

* Remove PropTypes from TextInput and ValidatedTextInput

No longer needed because of TypeScript

* Use correct error id to show validation message

* Use HTMLElement instead of a specific element type for LabelProps

* Update assets/js/base/components/text-input/validated-text-input.tsx

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

* Update assets/js/base/components/text-input/validated-text-input.tsx

* Use correct formatting in ValidatedTextInput

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2021-05-19 10:55:15 +01:00
Mike Jolley c123dfdeba Convert checkout state context provider to Typescript (https://github.com/woocommerce/woocommerce-blocks/pull/4200)
* git move to ts files

* Type the checkout state provider

* Restore for loop for error handling

* Types not needed

* Consolodate response handling

* Unused import

* Fix defaults for onCheckoutAfterProcessingWithSuccess etc

* Type useEmitResponse and remove isObject checks

* useEmitResponse as const

* Check that redirectUrl is string

* Define actions as const

* data.redirectUrl should be truthy

* Add redirectURL todo item as followup

* remove null fallback
2021-05-18 10:37:31 +01:00
Thomas Roberts 983ce48cad Move Button and Label components to `@woocommerce/blocks-checkout` package (https://github.com/woocommerce/woocommerce-blocks/pull/4222)
* Move Button to checkout package

* Move Label to Components Package
2021-05-18 09:10:31 +01:00
Thomas Roberts 57c5b0c532 Update design of cart and checkout sidebars (https://github.com/woocommerce/woocommerce-blocks/pull/4180)
* Update cart/coupon/shipping design

* Add order summary heading

* Move and style discounts on checkout sidebar

* Add rate to tax lines

* Ensure the option to display taxes itemised is available to Cart block

* Output individual tax items below the total & add styles for this

* Add success notice under coupon input on successful coupon addition

* Add border to bottom of Totals footer

* Show success message when adding coupon

* Add padding to cart item rows

* Add preview data to cart for when taxes are enabled

* Add rate to cart response type

* Add showRateAfterTaxName attribute to Cart block

* Add control to cart block to show rate percentage after rate name

* Add rate % in cart totals only if option is toggled on

* Pass showRateAfterTaxName attribute down to TotalsTaxes

* Add showRateAfterTaxName to Checkout block

* Add control to block editor for showRateAfterTaxName on Checkout

* Pass showRateAfterTaxName down to TotalsTaxes in Checkout

* Change label for showing tax rates in cart and checkout blocks

* Add test to ensure Taxes section shows in Cart block

* Add tests for cart sidebar and rate percentages

* Remove order summary title from checkout sidebar

* Check if taxes are enabled before rendering the option to show rate %s

* Add ShippingVia component to show the selected rate in sidebar

* Remove value from individual tax rates

* Remove bold from Shipping via label

* Remove coupon added successfully message

* Ensure panel headings that are h2s are the same colour as others

* Clean up eslint warnings

* Show rate %s by default

* Update snapshots following design changes

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2021-05-17 15:00:57 +01:00
Albert Juhé Lluveras b14b557c91 Don't default to fallback in getSetting if value is falsy (https://github.com/woocommerce/woocommerce-blocks/pull/4202) 2021-05-16 19:00:06 +01:00
Mike Jolley bcac811d7c Fix es lint warnings (https://github.com/woocommerce/woocommerce-blocks/pull/4206)
* Un-used PropTypes import

* Avoid global and use ownerDocument

* receiveCart return type

* ignoreRestSiblings when destructuring for @typescript-eslint/no-unused-vars

* Replace lodash find

* Use global rather than window

* Remove lodash map

* move rule to overrides
2021-05-16 18:59:32 +01:00
Mike Jolley 286d52befb Remove the need for the `canMakePayment` callback in the editor context (https://github.com/woocommerce/woocommerce-blocks/pull/4188)
* Force can pay true in editor context

* Update docs
2021-05-13 11:21:21 +01:00
Mike Jolley 87bb095f1f Sync customer data during checkout with draft orders. (https://github.com/woocommerce/woocommerce-blocks/pull/4197)
* Update store when email changes

* Add pluckEmail helper and convert to TS

* improve guard

* sync draft order with customer data
2021-05-13 11:20:37 +01:00
Seghir Nadir 0c42322dba Add cart data to filters (https://github.com/woocommerce/woocommerce-blocks/pull/4164)
* add cart data to filters

* add extensions back to footer filter
2021-05-12 13:32:05 +01:00
Mike Jolley a90988aebf Should be using value rather than name (https://github.com/woocommerce/woocommerce-blocks/pull/4187) 2021-05-12 13:02:26 +01:00
Thomas Roberts 1dcbddc0bd Add checkout filter for coupon names (https://github.com/woocommerce/woocommerce-blocks/pull/4166)
* Make extensions optional, not all filters will need to pass this through

For example the CartCouponSchema has no option for extensibility (and I don't think it's needed at any rate) so extensions will always be an empty object. Rather than explicitly specifying this when running the filter, we can let it default to an empty object.

* Add filter for coupon code
2021-05-11 13:57:02 +01:00
Thomas Roberts 6ffa778729 Convert shipping components to typescript (https://github.com/woocommerce/woocommerce-blocks/pull/4135)
* Add type defs for customer

Taken from 194ecccf78/assets/js/type-defs/customer.ts

* Convert ShippingCalculatorAddress to TypeScript

* Convert ShippingCalculator to TypeScript

* Convert ShippingLocation to TypeScript

* Allow packageId to be a number or string in useSelectShippingRate(s)

* Convert ShippingRatesControl to TypeScript

* Convert ShippingOptionsStep to TypeScript

* Allow package_id to be a string or number

This is because of Subscriptions using strings for package IDs

* Change to use CartShippingRateItemShippingRate instead of Rate

* Add extra props to PackageProps type

* Make ShippingAddress have the correct type

* Use CartShippingRateItemShippingRate instead of Rate

* Remove Rate type

* Set return types to JSX.Element

* Change type of props.renderOption in ShippingRatesControl

* Remove customer type defs and relocate aliases to default-address-fields

* Add EnteredAddress type

* Import EnteredAddress from new location

* Remove unnecessary eslint ignore

* Remove unused variable

* Remove confusing use of word Item in Shipping types

* Remove confusing use of word Item in Shipping types
2021-05-10 10:03:30 +01:00
Darren Ethier c85654f579 Improvements to `emitEventWithAbort`. (https://github.com/woocommerce/woocommerce-blocks/pull/4158)
* modify emitEventWithAbort to change return value

`emitEventWithAbort` now returns an array of responses up to the first response that triggered an error or fail response instead of aborting on success responses too.

* update add to cart form context provider

* update checkout state context provider

* update payment method data context provider

* update tests and fix thrown error handling.
2021-05-07 16:39:28 -04:00
Seghir Nadir 037dc09f62 Don't clear email and phone fields when using separate billing address. (https://github.com/woocommerce/woocommerce-blocks/pull/4162)
* preseve-billing-data

* pluck empty email and phone

* add issue number
2021-05-05 12:59:30 +01:00
Thomas Roberts 803ed0a0bd Convert Product summary to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/4099)
* Add WordCountType type

* Convert Summary to TypeScript

* Convert ProductSummary to TypeScript
2021-04-27 17:39:20 +01:00
Mike Jolley 1166ff3a51 Switch to `rest_preload_api_request` for API hydration in cart and checkout blocks. (https://github.com/woocommerce/woocommerce-blocks/pull/4090)
* Introduce hydrate_api_request

* Consume preloadedApiRequests

* no need to set false here
2021-04-27 11:16:23 +01:00
Raluca Stan 8ee5e816a0 Rename onCheckoutBeforeProcessing to onCheckoutValidationBeforeProcessing (https://github.com/woocommerce/woocommerce-blocks/pull/4039) 2021-04-26 17:27:22 +02:00
Thomas Roberts 10d11e0748 Convert Product components to TS (https://github.com/woocommerce/woocommerce-blocks/pull/4098)
* Update package-lock.json

* Move Block Type Settings into Block Type Classes (https://github.com/woocommerce/woocommerce-blocks/pull/4059)

* BLOCK SETTINGS: Remove unused constants/settings

* AssetDataRegistry: Helpers to check for settings that exist, and registering page ID/permalinks

* Move checkout and cart block settings to checkout and cart blocktypes

* Move isShippingCalculatorEnabled to cart block

* Remove HAS_DARK_EDITOR_STYLE_SUPPORT and IS_SHIPPING_CALCULATOR_ENABLED in favour of getSetting

* Move displayCartPricesIncludingTax to blocktypes, and implement getSetting

* Move block settings to core settings and blocktypes

* Fix namespace usage

* Move review settings

* move tag settings

* Keep productCount in core data

* Move min and default height

* Improve storePages code

* Move attributes to attribute filter block type

* Move $word_count_type outside of settings array

* Remove unneeded setting in preview data (shippingCostRequiresAddress)

* Move min/max settings dependency from GridLayoutControl to Blocks themselves and use getSettings

* DEFAULT_COLUMNS and ROWS to settings

* Move product columns/rows to block types

* Add grid settings to AllProducts block

* Correct default rows

* correct min rows default

* Move hasDarkEditorStyleSupport

* Move hideOutOfStockItems to block type settings

* Move build settings to inline script dependency

* Pass data through asset api and move restApiRoutes

* Export all core settings as constants

* Remove WORD_COUNT_TYPE from core settings

* Move some other core settings to assets

* Update constants

* Make settings use TypeScript

* Update CURRENT_USER_IS_ADMIN usage

* WORD_COUNT_TYPE

* REST_API_ROUTES

* REVIEW_RATINGS_ENABLED and SHOW_AVATARS

* Remove REVIEW_RATINGS_ENABLED and SHOW_AVATARS constants

* Remove MIN_HEIGHT

* Remove DEFAULT_HEIGHT

* PLACEHOLDER_IMG_SRC

* LIMIT_TAGS

* HAS_PRODUCTS

* HOME_URL

* HAS_TAGS

* COUPONS_ENABLED

* SHIPPING_ENABLED

* TAXES_ENABLED

* DISPLAY_ITEMIZED_TAXES

* SHIPPING_COST_REQUIRES_ADDRESS

* SHIPPING_STATES and SHIPPING_COUNTRIES

* STORE_PAGES

* ALLOWED_COUNTRIES

* ALLOWED_STATES

* SHIPPING_METHODS_EXIST

* PAYMENT_GATEWAY_SORT_ORDER

* CHECKOUT_SHOW_LOGIN_REMINDER

* CHECKOUT_ALLOWS_GUEST and CHECKOUT_ALLOWS_SIGNUP

* ATTRIBUTES

* DISPLAY_CART_PRICES_INCLUDING_TAX

* DISPLAY_CART_PRICES_INCLUDING_TAX

* update build for TS files

* fix build dir

* Move blocks build config params

* Move placeholderImgSrc to core settings

* Move rest api hydration hoc to shared hocs and provide it restApiRoutes directly to avoid asset data registration

* Move wordCountType to abstract block

* Remove WORD_COUNT_TYPE in favour of getSetting

* Move IS_LARGE_CATALOG and PRODUCT_COUNT to abstract block type and use getSetting inline

* Add wcBlocksConfig

* fix tests

* Remove unused $asset_data_registry

* remove console.log

* Move build settings to abstract block

* Trigger build again

* Move hydration back to regular hocs for compatibility with trunk (merge conflict)

* Removed wcSharedHocsConfig

* esc home url

* Update search fixture

* Update search snap

* 40000 timeout

* hasProducts -> productCount

* Product Count is part of blocks config

* update mocks

* Use version comparison to determine if batching is enabled

* Change isWpVersion

* scrollTo button

* Rename product backorder badge to tsx

* Rename Policies component to tsx

* Convert Product badge to TS

* Convert Product Details to TypeScript

* Convert ProductImage to TypeScript

* Convert ProductLowStockBadge to TypeScript

* Move ItemData into ProductResponse type def file

* Add type defs directory to tsconfig

* Import types for ProductResponseItemData in ProductDetails

* Convert ProductMetaData to TypeScript

* Convert ProductSaleBadge to TypeScript

* Type component props to their interfaces

* Ensure components have an explicit return type of JSX.Element set

* Export PLACEHOLDER_IMG_SRC as string

* Add null to component return type

* Import PLACEHOLDER_IMG_SRC from correct location

Co-authored-by: Mike Jolley <mike.jolley@me.com>
2021-04-26 13:20:30 +01:00
Thomas Roberts 5871d86d7f Update `Button` component to ts (https://github.com/woocommerce/woocommerce-blocks/pull/4091)
* Convert Button to TypeScript

* Add alias of @types/wordpress__components

* Make ButtonProps extend the wp/components button's base props

* Update package-lock.json

* Extend Button.ButtonProps instead of only BaseProps

* Add return type to Button component
2021-04-26 10:49:57 +01:00
Thomas Roberts 558525aa6e Prevent unwanted parts of address being displayed (https://github.com/woocommerce/woocommerce-blocks/pull/4038)
* Add emptyHiddenAddressFields function

* Add tests for emptyHiddenAddressFields

* Remove address fields that should be hidden before processing checkout

* Empty hidden address fields before displaying in shipping calculator

* Refactor emptyHiddenAddressFields so we only iterate once

* Fix test for emptyHiddenAddressFields

* Import default address fields from @woocommerce/settings

* Import emptyHiddenAddressFields

* Copy address first before emptying fields

* Modify address directly instead of copying it

* Copy address variable instead of mutating it directly

* Add files to TS project

* Return the new address rather than the parameter

* Don't clean address fields in the presentation layer

* Clean address in useStoreCart before it gets sent to components
2021-04-23 10:42:36 +01:00
Thomas Roberts bc750438c2 Convert Cart Table to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/4088)
* Convert CartLineItemsTitle to TypeScript

* Add type guards

* Change CartLineItemRow extension to .tsx

* Remove parseInt from price precision

This is because the API sends it as a number, so it will never be a string, so no need to parse it.

* Add dinero.js types

* Type QuantitySelector and add types for @wordpress/keycodes

* Make __experimentalApplyCheckoutFilter use generic types

* Add catalog_visibility type & change types of CartItem

* Add isNumber and isString to type guards

* Type ProductLowStockBadge

* Ensure type returned by a filter function is the same it received

* Include type guards and hooks in tsconfig

* Add more type safety to useStoreCartItemQuantity

* Make className optional on QuantitySelector

* Type CartLineItemRow

* Type CartLineItemsTable

* Type Cart

* Add extra keys to CartResponseItem

* Clean aria-hidden logic

* Export type-guards from module

* Use aliases to import types in CartLineItemRow

* Remove unused prop types and specify return type of function

* Specify return type of component

* Use JSX.Element instead of ReactNode

* Remove unused variables & set return type of components

* Remove PropTypes
2021-04-23 10:15:17 +01:00
Mike Jolley dbbb99d55e Move Block Type Settings into Block Type Classes (https://github.com/woocommerce/woocommerce-blocks/pull/4059)
* BLOCK SETTINGS: Remove unused constants/settings

* AssetDataRegistry: Helpers to check for settings that exist, and registering page ID/permalinks

* Move checkout and cart block settings to checkout and cart blocktypes

* Move isShippingCalculatorEnabled to cart block

* Remove HAS_DARK_EDITOR_STYLE_SUPPORT and IS_SHIPPING_CALCULATOR_ENABLED in favour of getSetting

* Move displayCartPricesIncludingTax to blocktypes, and implement getSetting

* Move block settings to core settings and blocktypes

* Fix namespace usage

* Move review settings

* move tag settings

* Keep productCount in core data

* Move min and default height

* Improve storePages code

* Move attributes to attribute filter block type

* Move $word_count_type outside of settings array

* Remove unneeded setting in preview data (shippingCostRequiresAddress)

* Move min/max settings dependency from GridLayoutControl to Blocks themselves and use getSettings

* DEFAULT_COLUMNS and ROWS to settings

* Move product columns/rows to block types

* Add grid settings to AllProducts block

* Correct default rows

* correct min rows default

* Move hasDarkEditorStyleSupport

* Move hideOutOfStockItems to block type settings

* Move build settings to inline script dependency

* Pass data through asset api and move restApiRoutes

* Export all core settings as constants

* Remove WORD_COUNT_TYPE from core settings

* Move some other core settings to assets

* Update constants

* Make settings use TypeScript

* Update CURRENT_USER_IS_ADMIN usage

* WORD_COUNT_TYPE

* REST_API_ROUTES

* REVIEW_RATINGS_ENABLED and SHOW_AVATARS

* Remove REVIEW_RATINGS_ENABLED and SHOW_AVATARS constants

* Remove MIN_HEIGHT

* Remove DEFAULT_HEIGHT

* PLACEHOLDER_IMG_SRC

* LIMIT_TAGS

* HAS_PRODUCTS

* HOME_URL

* HAS_TAGS

* COUPONS_ENABLED

* SHIPPING_ENABLED

* TAXES_ENABLED

* DISPLAY_ITEMIZED_TAXES

* SHIPPING_COST_REQUIRES_ADDRESS

* SHIPPING_STATES and SHIPPING_COUNTRIES

* STORE_PAGES

* ALLOWED_COUNTRIES

* ALLOWED_STATES

* SHIPPING_METHODS_EXIST

* PAYMENT_GATEWAY_SORT_ORDER

* CHECKOUT_SHOW_LOGIN_REMINDER

* CHECKOUT_ALLOWS_GUEST and CHECKOUT_ALLOWS_SIGNUP

* ATTRIBUTES

* DISPLAY_CART_PRICES_INCLUDING_TAX

* DISPLAY_CART_PRICES_INCLUDING_TAX

* update build for TS files

* fix build dir

* Move blocks build config params

* Move placeholderImgSrc to core settings

* Move rest api hydration hoc to shared hocs and provide it restApiRoutes directly to avoid asset data registration

* Move wordCountType to abstract block

* Remove WORD_COUNT_TYPE in favour of getSetting

* Move IS_LARGE_CATALOG and PRODUCT_COUNT to abstract block type and use getSetting inline

* Add wcBlocksConfig

* fix tests

* Remove unused $asset_data_registry

* remove console.log

* Move build settings to abstract block

* Trigger build again

* Move hydration back to regular hocs for compatibility with trunk (merge conflict)

* Removed wcSharedHocsConfig

* esc home url

* Update search fixture

* Update search snap

* 40000 timeout

* hasProducts -> productCount

* Product Count is part of blocks config

* update mocks

* Use version comparison to determine if batching is enabled

* Change isWpVersion

* scrollTo button
2021-04-22 12:37:27 +01:00
Mike Jolley 171642b8a5 Rest API batching support (2) (https://github.com/woocommerce/woocommerce-blocks/pull/4075)
* Add batch route

* Register batch route

* Allow batching on writable endpoints

* Batch in client

* Batch non-GET requests

* Batching support with typescript defs

* Remove unused hook

* Prevent multiple fragment updates

* Only use batch route if detected

* Correct var name

* Move nonce check to validate_callback so it runs before requests are completed

* remove unused imports

* updateCartFragments function as const

* Add phpunit tests for batching functionality

* Reduce batch delay

* increase timeout

* Update isCartUpdatePostRequest for batch support

* Update Endpoint used in test

* Move nonce check back inline - custom headers are not returned otherwise

* Fix error handling

* Back to 30s

* Update assets/js/middleware/cart-update.ts

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* whitespace

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2021-04-20 16:44:49 +01:00
Darren Ethier 309b3614c5 Revert "Rest API batching support (https://github.com/woocommerce/woocommerce-blocks/pull/3899)"
This reverts commit 5b65a02297.

This commit broke cart updates for the cart block (surfaced with changing quantity)

There were also legit e2e test fails for the cart-update middleware behaviour that weren’t addressed.
2021-04-18 11:58:51 -04:00
Mike Jolley 5b65a02297 Rest API batching support (https://github.com/woocommerce/woocommerce-blocks/pull/3899)
* Add batch route

* Register batch route

* Allow batching on writable endpoints

* Batch in client

* Batch non-GET requests

* Batching support with typescript defs

* Remove unused hook

* Prevent multiple fragment updates

* Only use batch route if detected

* Correct var name

* Move nonce check to validate_callback so it runs before requests are completed

* remove unused imports

* updateCartFragments function as const

* Add phpunit tests for batching functionality

* Reduce batch delay

* increase timeout
2021-04-16 13:45:56 +01:00
Mike Jolley 7556d47b5c Fix TwentyX styling issues for cart/checkout form fields (https://github.com/woocommerce/woocommerce-blocks/pull/4046)
* Fix checkbox styling in 2020 and 2017 themes by setting input font size

* 2017 button hover style fixes

* Fix editor dark inputs

* Restore dark color
2021-04-12 12:03:36 +02:00