* Add address-related items to wc/store/cart data store
* include shippingAsBilling in return value of useCustomerData
* Add useUpdateCustomerData hook
This allows us to have a single hook responsible for updating the customer information on the server.
* Add useUpdateCustomerData hook in Checkout block
* Remove the updating customer data work from the useCustomerData hook
* Remove shippingAsBilling from previousCustomerData ref type
* Add useShippingAsBillingCheckbox hook
* Control shippingAsBilling from single hook
* Remove checkbox handling from useCheckoutAddress
* Remove CustomerDataContext typedef
* Merge with woocommerce/woocommerce-blocks#5810 changes
* Move shipping as billing to checkout state context provider
* Unused import
* Subscribe to changes
* Only receiveCartContents when updating customer data via checkout
* Cache customerDataToUpdate
* rename debounced function
* Combine customerDataType and customerDataContextType
* Change case of CustomerDataType
* debouncedUpdateCustomerData typo
* Fix notice context
* Clean up inline docs for push changes
* Comment on dirty state
* Phone is always set
* shippingAddress is never undefined
* setBillingPhone
* receiveCartContents explanation
* Tweak customerData to avoid null
* useShippingAsBilling
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
* fix Global Styles for Product Image, Product Category List and Product Tag List blocks
fix Global Styles for Product Image, Product Category List and Product Tag List blocks
* Block style font-size was applying wrong value for fontSize
* Add missing __experimentalSkipSerialization to Category List
Co-authored-by: Tomasz Tunik <tomasztunik@gmail.com>
* Pass context information about containing block to the existing Slots
* Fix images added to the Slots docs
* Use the parent's block name for the context prop passed to Slot fills
Also:
* Refactors the function to add a custom paragraph
* Add front-end test for archive template
* Use WordPress data to guarantee block presence
* Use WordPress data instead of selectors to match blocks
* Add wc-block-mini-cart__contents class for the Mini Cart block woocommerce/woocommerce-blocks#5418
Add wc-block-mini-cart__contents class for the Mini Cart block
* removed comment
* Fix All Products block pagination not showing up (https://github.com/woocommerce/woocommerce-blocks/pull/5850)
* Fix regression for Twenty Twenty-Two theme with sale prices being underlined (https://github.com/woocommerce/woocommerce-blocks/pull/5851)
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Tomasz Tunik <tomasztunik@gmail.com>
* Product title: add support global style woocommerce/woocommerce-blocks#4965
* add specific type
* add custom save function
* Rating Product block: add support for global style woocommerce/woocommerce-blocks#4965
Rating Product block: add support for global style
* add feature flag
* fix import after merge
* fix global style css generation
* restore css for classic product rating html element
* don't apply the global style to PHP blocks
* remove registration
* Product title: add support global style woocommerce/woocommerce-blocks#4965
* add specific type
* add custom save function
* move hooks in a specific folder
* Tag List block: add support for global style woocommerce/woocommerce-blocks#4965
Tag List Block: add support for global style
* add feature flag
* Product title: add support global style woocommerce/woocommerce-blocks#4965
* add specific type
* Enable global style for category list block woocommerce/woocommerce-blocks#4965
Enable global style for category list block
* fix import after merge
* add save function
* add feature flag
* Refactor maybe_return_blocks_template to get_woocommerce_block_file_template
* Remove unused method and rename get_woocommerce_block_file_template to get_block_file_template
* Account for product-archive template fallbacks
* Fix bug with clearing customizations of templates using the deprecated plugin ID
* Convert radio component to TS and support uncontrolled components
* Further radio control to typescript changes
* Combine useSelectShippingRate and useSelectShippingRates
* Remove useSelectShippingRate hook
* Move local radio checked state to PackageRates
* This is a Controlled component - update inline docs
* useSelectShippingRates -> useSelectShippingRate rename
* Add the correct appender button for non empty groups
* Revert "Add the correct appender button for non empty groups"
This reverts commit 4b41d7d7f82461813b3464d1b4f931c442bce3be.
* Force position relative for custom InnerBlocks.ButtonBlockAppender appenders.
Removing InnerBlocks.ButtonBlockAppender from renderAppender = {InnerBlocks.ButtonBlockAppender } results in the black appender button beeing shown only when the block is selected, and we need the appender to be visible by default.
* Remove api hydration for the Mini Cart Block woocommerce/woocommerce-blocks#5729
Remove api hydration for the Mini Cart Block
* fix PHP error
* send event when the button is clicked
* fix import order
* 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>
* 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.