Commit Graph

5245 Commits

Author SHA1 Message Date
Luigi Teschio 4fb7da7962 Classic Product Template visible in the inserter (https://github.com/woocommerce/woocommerce-blocks/pull/9573) 2023-05-25 09:42:29 +02:00
Manish Menaria 0b3853090b Product Collection: Add 'on sale' filter and enhance settings management in product collection block (https://github.com/woocommerce/woocommerce-blocks/pull/9549)
* Add columns control to product collection block editor settings

- `InspectorControls` from './inspector-controls' is now imported in `edit.tsx` and used in the returned JSX of `Edit` function.
- A new file `columns-control.tsx` is added under 'product-collection' block's 'inspector-controls' directory which exports a `ColumnsControl` component. This component uses `RangeControl` from '@wordpress/components' to control the number of columns in the product collection display layout when the layout type is 'flex'.
- The types file (`types.ts`) for 'product-collection' block is updated. The `Attributes` interface is renamed to `ProductCollectionAttributes` and the `ProductCollectionContext` interface is removed. The `ProductCollectionAttributes` now includes 'queryContext', 'templateSlug', and 'displayLayout' properties.

* Refactor: Simplify Fallback Return in ColumnsControl Component

This commit simplifies the fallback return value of the ColumnsControl component. Instead of returning an empty fragment (<> </>), it now returns null when the condition isn't met. This change improves readability and aligns with best practices for conditional rendering in React.

* Feature: Add 'Order By' Control to Product Collection Inspector

This commit adds a new 'Order By' control to the product collection inspector. The control allows users to specify the order of products in a collection by various attributes such as title and date. To support this, a new component 'OrderByControl' has been created and included in the product collection inspector. Additionally, the types for 'order' and 'orderBy' attributes have been updated and exported for reuse.

* Add more options to OrderBy type

* Add orderby handling on frontend & editor

The main changes include:
1. Added a new property 'isProductCollectionBlock' in the block.json to denote if a block is a product collection block.
2. In the ProductCollection PHP class, a new initialization function has been defined to hook into the WordPress lifecycle, register the block, and update the query based on this block.
3. Added methods to manage query parameters for both frontend rendering and the Editor.
4. Expanded allowed 'collection_params' for the REST API to include custom 'orderby' values.
5. Defined a function to build the query based on block attributes, filters, and global WP_Query.
6. Created utility functions to handle complex query operations such as merging queries, handling custom sort values, and merging arrays recursively.

These improvements allow for more flexible and robust handling of product collections in both the front-end display and the WordPress editor. It also extends support for custom 'orderby' values in the REST API, which allows for more advanced sorting options in product collections.

* Add 'on sale' filter and enhance settings management in product collection block

This commit introduces several changes to the product collection block.
- First, it adds a new 'on sale' filter that can be used to display only the products that are currently on sale.
- It also refactors the settings management in the product collection block to use the experimental ToolsPanel component from WordPress, which provides a more flexible and intuitive way to manage block settings.
- It moves the 'Columns' control into the ToolsPanel, along with the 'Order by' control.
- A new utility function `setQueryAttribute` is introduced to simplify setting nested query parameters.
- The structure of the `ProductCollectionAttributes` and `ProductCollectionQuery` types have been adjusted to accommodate the changes.
- Finally, it makes corresponding changes in the PHP part to handle the new 'on sale' query parameter.

This should enhance the flexibility and user-friendliness of the product collection block.
2023-05-25 06:38:19 +00:00
Saad Tarhi 4bdbdbf309 Fix total shipping display info when no shipping method is available (https://github.com/woocommerce/woocommerce-blocks/pull/8819)
* Fix total shipping info when no shipping are available

* Fix a logical error for displaying shipping info

* Fix failing unit tests

* Run unit test for the Cart instead of the Checkout

The calculator is only available for the Cart Block, so it doesn't make
sense to run this test for the Checkout Block

* Fix no shipping methods and incomplete address conflict

When there are no shipping methods (except for local pickup), we would
like to inform the shopper that there are no shipping options available
even though the address is complete

The solution we found is to check the address on the Cart Block only

* Refactor code

* Check whether rate is collectible without using hardcoded id

* Correctly negate hasCollectibleRate result

* Add notice when shipping is selected but no methods are available yet (https://github.com/woocommerce/woocommerce-blocks/pull/9171)

* Create useShippingTotalWarning hook

* Show notices above checkout sidebar

* Call hook to show notice in Checkout block

* Remove unused imports

* Update hook name to useShowShippingTotalWarning

* Move hook to its own file

* Import shipping data internally (without alias)

* Remove unused imports

* Move import to correct place

* Return early to avoid if else

* Refactor useShowShippingTotalWarning

* Get shipping rates directly from the cart instead of the hook

* Show shipping cost when price information is available

* Check if the passed rates are considered selected

* Prevent errors when no rates are available

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
2023-05-25 06:31:15 +01:00
Roy Ho b858f93628 Remove trailing comma (https://github.com/woocommerce/woocommerce-blocks/pull/9593) 2023-05-24 13:43:11 -07:00
Daniel W. Robert 80bfab6d76 Update lockfile for fresh installation. (https://github.com/woocommerce/woocommerce-blocks/pull/9574) 2023-05-24 13:00:13 -04:00
Albert Juhé Lluveras 31487e01b0 Add 10.0.5 testing notes 2023-05-24 17:49:32 +02:00
Albert Juhé Lluveras 90207c7cdc Add 10.0.5 changelog 2023-05-24 17:47:55 +02:00
Albert Juhé Lluveras 480750d20c Prevent Mini-Cart dependency scripts to lazy-load if they have already been enqueued (https://github.com/woocommerce/woocommerce-blocks/pull/9587) 2023-05-24 16:57:00 +02:00
Mike Jolley e66e683625 10.4.0-dev 2023-05-24 14:28:19 +01:00
Mike Jolley fc573a816c 10.3.0 Testing instructions and Changelog 2023-05-24 14:26:55 +01:00
Hritik Chaudhary ed2c17f16c Remove `propTypes` definitions from Product Search block (https://github.com/woocommerce/woocommerce-blocks/pull/9565)
* Remove propTypes definitions for product search

* Resolved TS errors

* Addressed review comments

---------

Co-authored-by: Niels Lange <info@nielslange.de>
2023-05-24 19:24:08 +07:00
Patricia Hillebrandt e6e908c483 Restore the global variable to its original value after being overriden. (https://github.com/woocommerce/woocommerce-blocks/pull/9581) 2023-05-24 14:08:32 +02:00
Manish Menaria 376aa1ebdb Add 'products-block-post-template' class to product templates (https://github.com/woocommerce/woocommerce-blocks/pull/9569) 2023-05-24 10:01:59 +00:00
Luigi Teschio a996ab7351 update @wordpress/env package (https://github.com/woocommerce/woocommerce-blocks/pull/9572) 2023-05-23 15:45:40 +00:00
Thomas Roberts 75785ea46a Update documentation for additionalCartCheckoutInnerBlockTypes filter (https://github.com/woocommerce/woocommerce-blocks/pull/8994) 2023-05-23 02:50:13 -07:00
Albert Juhé Lluveras a04c00a79f Make Mini-Cart block work well with caching plugins (https://github.com/woocommerce/woocommerce-blocks/pull/9493)
* Make Mini-Cart block work well with caching plugins

* Add tests

* Add back aria-label to Mini-Cart menu

* Fetch Mini-Cart data before page finishes loading

* Store and retrieve Mini-Cart values from localStorage for better performance

* Update styles as early as possible

* Reorder code

* Remove overrideTotals param from updateTotals() function

* Update tests

* Initialize local storage inside a function and add act to filter tests

* Replace void with undefined types in several funtions

* Fix 0 quantity badge appearing on page load
2023-05-23 09:28:40 +02:00
Patricia Hillebrandt 0dae17510d Fix > Product details listing pattern - Ensure the editor preview is properly rendered after page refresh (https://github.com/woocommerce/woocommerce-blocks/pull/9563)
* Fix editor render for a few paragraphs within the Product Listing Pattern.

* Update spacing and fontWeight.
2023-05-22 19:41:36 +00:00
Roy Ho 3fcbf43d60 Revert "Update the logic of disabling some blocks in the widget areas and post editor (https://github.com/woocommerce/woocommerce-blocks/pull/9462)" (https://github.com/woocommerce/woocommerce-blocks/pull/9561)
This reverts commit 2a4b78c150.
2023-05-22 08:59:51 -07:00
Luigi Teschio c919466a8c Enable blockified conversation to archive templates (https://github.com/woocommerce/woocommerce-blocks/pull/9509) 2023-05-22 12:17:56 +00:00
Thomas Roberts 56879a4861 Check if package rates is an array before filtering on it (https://github.com/woocommerce/woocommerce-blocks/pull/9351)
Co-authored-by: Niels Lange <info@nielslange.de>
2023-05-22 02:43:00 -07:00
Seghir Nadir 5457145c6a Trigger the set-billing-address when editing Shipping (https://github.com/woocommerce/woocommerce-blocks/pull/8841) 2023-05-22 09:30:49 +00:00
Tarun Vijwani 90e57bca11 Add unit test cases for Min and Max price for shipping methods (https://github.com/woocommerce/woocommerce-blocks/pull/9336)
* Add unit test cases for Min and Max price for shipping methods

* Move Test for Min and Max rates to shipping-rates

- Move Test for Min and Max rates to shipping-rates.
- Use single shippingRates object throughout the test cases.

* Update assets/js/base/utils/test/shipping-rates.ts

Co-authored-by: Niels Lange <info@nielslange.de>

* Update assets/js/base/utils/test/shipping-rates.ts

Co-authored-by: Niels Lange <info@nielslange.de>

* Add helper function to generate shipping rates

* Add a test for empty shipping rates

* Remove redundant attribute values from generateRate function

---------

Co-authored-by: Niels Lange <info@nielslange.de>
2023-05-22 12:48:12 +04:00
Tarun Vijwani 296a0b4360 Fix Checkout block stepped sections numbers overlapping (https://github.com/woocommerce/woocommerce-blocks/pull/9497)
- Fix the padding for checkout-step component
2023-05-22 11:03:50 +04:00
Alexandre Lara 410e041936 Remove the fill color of the Product Meta icon (https://github.com/woocommerce/woocommerce-blocks/pull/9506) 2023-05-19 16:59:18 -03:00
Alexandre Lara 0847c20f79 Remove the fill color of the Product Details icon and move it to the icons library (https://github.com/woocommerce/woocommerce-blocks/pull/9503) 2023-05-19 12:09:13 -03:00
Albert Juhé Lluveras b0af5ac12e Update Mini-Cart block logic to use isSiteEditorPage util (https://github.com/woocommerce/woocommerce-blocks/pull/9501)
* Revert "Mini-Cart: prevent 'Mini-Cart in cart and checkout pages' toggle from showing up in the post/page editor (https://github.com/woocommerce/woocommerce-blocks/pull/9442)"

This reverts commit 0bfc1b341e.

* Update Mini-Cart block logic to use isSiteEditorPage util
2023-05-18 15:53:01 +02:00
Patricia Hillebrandt 61fbf572cb Single Product Block > Only reset the post data if `setup_postdata` was invoked. (https://github.com/woocommerce/woocommerce-blocks/pull/9474)
* Only call wp_reset_postdata() if the global post variable was changed.

* Make global_post_variable_changed static.

* rely on the output of setup_postdata for verifying if the global variable was successfully changed.

* ditch the static var and defaulting to false instead.

* Rely on static as the post reset only happens when the loop of inner blocks ends and not right away.

* Update the  variable when the postdata is reset.
2023-05-18 15:35:46 +02:00
Luigi Teschio 0bf8048bd1 Fix compatibility layer when no products are displayed (https://github.com/woocommerce/woocommerce-blocks/pull/9464)
* POC

* add compatibility with the product recommendations extension

* improve readibility key

* improve readibility code

* improve readibility

* fix compatibility layer when no products are displayed

* remove duplicate code
2023-05-18 14:19:46 +02:00
Alexandre Lara bad4c30e36 Add to Cart with Options: Fix styles that are not being applied correctly (https://github.com/woocommerce/woocommerce-blocks/pull/9472)
* Add missing WooCommerce styles to Add to Cart with Options block

* Fix input style for Add to Cart with Options block

* Add comment about the input-text css class that was added to the Add To Cart Form
2023-05-18 08:02:51 -03:00
Manish Menaria 57d4ac529e Product Collection: Add 'Order By' Control to Product Collection Inspector (https://github.com/woocommerce/woocommerce-blocks/pull/9480)
* Add columns control to product collection block editor settings

- `InspectorControls` from './inspector-controls' is now imported in `edit.tsx` and used in the returned JSX of `Edit` function.
- A new file `columns-control.tsx` is added under 'product-collection' block's 'inspector-controls' directory which exports a `ColumnsControl` component. This component uses `RangeControl` from '@wordpress/components' to control the number of columns in the product collection display layout when the layout type is 'flex'.
- The types file (`types.ts`) for 'product-collection' block is updated. The `Attributes` interface is renamed to `ProductCollectionAttributes` and the `ProductCollectionContext` interface is removed. The `ProductCollectionAttributes` now includes 'queryContext', 'templateSlug', and 'displayLayout' properties.

* Refactor: Simplify Fallback Return in ColumnsControl Component

This commit simplifies the fallback return value of the ColumnsControl component. Instead of returning an empty fragment (<> </>), it now returns null when the condition isn't met. This change improves readability and aligns with best practices for conditional rendering in React.

* Feature: Add 'Order By' Control to Product Collection Inspector

This commit adds a new 'Order By' control to the product collection inspector. The control allows users to specify the order of products in a collection by various attributes such as title and date. To support this, a new component 'OrderByControl' has been created and included in the product collection inspector. Additionally, the types for 'order' and 'orderBy' attributes have been updated and exported for reuse.

* Add more options to OrderBy type

* Add orderby handling on frontend & editor

The main changes include:
1. Added a new property 'isProductCollectionBlock' in the block.json to denote if a block is a product collection block.
2. In the ProductCollection PHP class, a new initialization function has been defined to hook into the WordPress lifecycle, register the block, and update the query based on this block.
3. Added methods to manage query parameters for both frontend rendering and the Editor.
4. Expanded allowed 'collection_params' for the REST API to include custom 'orderby' values.
5. Defined a function to build the query based on block attributes, filters, and global WP_Query.
6. Created utility functions to handle complex query operations such as merging queries, handling custom sort values, and merging arrays recursively.

These improvements allow for more flexible and robust handling of product collections in both the front-end display and the WordPress editor. It also extends support for custom 'orderby' values in the REST API, which allows for more advanced sorting options in product collections.

* fix: handle undefined index for isProductCollectionBlock

This commit addresses a potential issue where the 'isProductCollectionBlock' index might not be defined in certain situations within the 'build_query' method of the ProductCollection class.

Previously, we directly accessed 'isProductCollectionBlock' from the 'query' context of the block. Now, we use the null coalescing operator (??) to ensure that we assign a default value of false if 'isProductCollectionBlock' is not set.

This change provides a safer way to handle the scenario when the 'isProductCollectionBlock' is not defined in the block context and helps prevent undefined index warnings.
2023-05-18 10:54:08 +00:00
Mike Jolley 715e63fbfd Revert changes in woocommerce/woocommerce-blocks#9332 and instead enqueue assets in correct place depending on admin vs frontend (https://github.com/woocommerce/woocommerce-blocks/pull/9495) 2023-05-18 10:46:17 +01:00
Luigi Teschio 86bb06a9a8 Product Archive Template: Fix compatibility Layer with Product Recommendations extension (https://github.com/woocommerce/woocommerce-blocks/pull/9452)
* POC

* add compatibility with the product recommendations extension

* improve readibility key

* improve readibility code

* improve readibility

* remove duplicate logic

* improve code readability
2023-05-18 11:41:44 +02:00
Albert Juhé Lluveras 5d6397b7b5 Prevent QuantitySelector stealing focus on page load (https://github.com/woocommerce/woocommerce-blocks/pull/9487) 2023-05-18 09:17:29 +02:00
Tarun Vijwani 21a356c58c Allow Shipping method prices to inherit global styles text color (https://github.com/woocommerce/woocommerce-blocks/pull/9456)
- Remove the hardcoded color for Shipping method prices
2023-05-17 21:52:20 +04:00
Alexandre Lara 2ef37db063 Add useIsDescendentOfSingleProductBlock hook to product rating block (https://github.com/woocommerce/woocommerce-blocks/pull/9489) 2023-05-17 10:58:12 -03:00
Luigi Teschio 689b5dd22a Fix undo button (https://github.com/woocommerce/woocommerce-blocks/pull/9478)
* fix undo button

* fix label
2023-05-17 13:25:02 +00:00
Mike Jolley bb1f578002 Store API: Fix payment method validation (fixes COD) (https://github.com/woocommerce/woocommerce-blocks/pull/9375)
* Widen enum for validation before cart is loaded

* Improve error message on checkout
2023-05-17 11:17:24 +01:00
Luigi Teschio 1b71b06b33 Product Search Results Template: fix compatibility layer when the Product Catalog is not blockified (https://github.com/woocommerce/woocommerce-blocks/pull/9492) 2023-05-17 10:10:58 +00:00
Alexandre Lara f22036af89 Fix Product Rating Block not showing when manually inserted to Single Product block (https://github.com/woocommerce/woocommerce-blocks/pull/9413) 2023-05-16 15:28:11 -03:00
Alexandre Lara 90573156fe Fix Product SKU not being displayed on frontend when outside Single Product template (https://github.com/woocommerce/woocommerce-blocks/pull/9446) 2023-05-16 15:25:34 -03:00
Luigi Teschio f8d46570ae Add isSiteEditorPage util (https://github.com/woocommerce/woocommerce-blocks/pull/9468)
* Add isSiteEditorPage util

* fix logic
2023-05-16 13:59:49 +02:00
Albert Juhé Lluveras 4c8baca475 Fix Filter by Price block making a 404 request in the frontend (https://github.com/woocommerce/woocommerce-blocks/pull/9481) 2023-05-16 12:05:24 +02:00
Luigi Teschio 150cde7d56 render Product Details block when it used along the Post Content block (https://github.com/woocommerce/woocommerce-blocks/pull/9479) 2023-05-16 11:31:13 +02:00
Manish Menaria 14f87be044 Product Collection: Add columns control to product collection block editor settings (https://github.com/woocommerce/woocommerce-blocks/pull/9466)
* Add columns control to product collection block editor settings

- `InspectorControls` from './inspector-controls' is now imported in `edit.tsx` and used in the returned JSX of `Edit` function.
- A new file `columns-control.tsx` is added under 'product-collection' block's 'inspector-controls' directory which exports a `ColumnsControl` component. This component uses `RangeControl` from '@wordpress/components' to control the number of columns in the product collection display layout when the layout type is 'flex'.
- The types file (`types.ts`) for 'product-collection' block is updated. The `Attributes` interface is renamed to `ProductCollectionAttributes` and the `ProductCollectionContext` interface is removed. The `ProductCollectionAttributes` now includes 'queryContext', 'templateSlug', and 'displayLayout' properties.

* Refactor: Simplify Fallback Return in ColumnsControl Component

This commit simplifies the fallback return value of the ColumnsControl component. Instead of returning an empty fragment (<> </>), it now returns null when the condition isn't met. This change improves readability and aligns with best practices for conditional rendering in React.
2023-05-16 09:23:22 +00:00
Alba Rincón a24bf73c83 [Patterns] Improvements on `Product Collections: Featured Collection` (https://github.com/woocommerce/woocommerce-blocks/pull/9450)
* Hardcore text color

* Fix image margins
2023-05-16 11:06:04 +02:00
Albert Juhé Lluveras 3b28b74777 Mini Cart: stop using Modal component (https://github.com/woocommerce/woocommerce-blocks/pull/9345)
* Remove unused styles

* Replace usage of Modal component with custom Drawer

* Update MiniCart.php class structure

* Update tests

* Prevent focus styles to appear unnecessarily when opening the Mini Cart drawer

* Work-around issue with disabled buttons causing lose of focus inside the Mini-Cart drawer

* Revert "Work-around issue with disabled buttons causing lose of focus inside the Mini-Cart drawer"

This reverts commit 4360f77384ad1f1d90a3ba8a0385ad79da2449f2.

* QuantitySelector: focus text input field after decrease or increase button become disabled

* Move focus to the input field also when the body has focus, that fixes the issue in Chrome

* Add explanatory comment
2023-05-16 10:41:26 +02:00
Patricia Hillebrandt 0bad9c81c9 Product Gallery Block > Remove global variable overwrite and keep support for the Single Product Block. (https://github.com/woocommerce/woocommerce-blocks/pull/9475)
* Remove call to the  global variable and add support for the gallery block to continue to work within the Single Product template without any problems.

* Make essential/required changes to guarantee the Product Gallery block works as expected without the relying on the global product.
2023-05-16 10:36:33 +02:00
Patricia Hillebrandt d26936bad7 Add to Cart with Options Block > Remove global variable overwrite. (https://github.com/woocommerce/woocommerce-blocks/pull/9457)
* Remove global variable overwrite from Add to Cart Form block.

* Rename single_product to product.
2023-05-16 10:18:36 +02:00
Mike Jolley 6e3b1ac7fb Styling fixes for form step headings (https://github.com/woocommerce/woocommerce-blocks/pull/9437)
Co-authored-by: Niels Lange <info@nielslange.de>
2023-05-15 12:28:24 +01:00
Tarun Vijwani afa5406746 Fix radio control overlap when font-size is small (https://github.com/woocommerce/woocommerce-blocks/pull/9436)
Co-authored-by: Niels Lange <info@nielslange.de>
2023-05-15 14:46:42 +04:00
Manish Menaria 0e6141f5ed Foundation of New Product Collection Block (https://github.com/woocommerce/woocommerce-blocks/pull/9352)
* Add Products Collection block scaffolding

This commit adds the initial scaffolding for the new Products Collection block. It includes the creation of new files (block.json, edit.tsx, index.tsx and ProductsCollection.php) and additions to existing files (webpack-entries.js and BlockTypesController.php). The block is marked as experimental and currently displays a static "Product collection" text in both the editor and the frontend.

* Add Product Template block and integrate with Products Collection block

This commit introduces the new Product Template block and integrates it with the existing Products Collection block. The changes include:
- Creation of the Product Template block, including its block.json, edit.tsx, icon.tsx, index.tsx, and save.tsx files.
- Modification of the Products Collection block, adding an icon.tsx file and updating its edit.tsx and index.tsx files.
- Updates to the webpack-entries.js file to include the new Product Template block.
- Addition of the ProductTemplate class in the src/BlockTypes directory.
- Inclusion of the ProductTemplate class in the src/BlockTypesController.php file.

* Enhance product-template block with context and styling

This commit adds various enhancements to the product-template block. It includes:

- Introduce `usesContext` and `supports` properties to the block.json file
- Update the edit.tsx file to use BlockContextProvider and add query logic
- Add an editor.scss file for styling the product-template block in the editor
- Extend the products-collection block.json file with new properties
- Modify the products-collection edit.tsx file to include instanceId and useEffect

These changes improve the product-template block by providing better context handling and styling options.

* Add 'woocommerce/product-template' to supported inner blocks and improve product-template editing

This commit adds 'woocommerce/product-template' as a supported inner block for various product elements, including button, image, rating, sale-badge, SKU, and stock-indicator. It also improves the editing experience for the product-template block by memoizing the block previews and rendering them more efficiently. This should lead to a smoother editing experience and better performance in the block editor.

* Add product title and summary variations for Products Collection block

- Add default spacing between product elements in `style.scss`
- Register product title and summary element variations in `products-collection` block
- Create utility for registering element variations
- Extend core elements with WooCommerce namespace

* Set inherit to false by default and other improvements

This commit introduces several changes to the ProductsCollection block:
1. Set the "inherit" property to false in block.json, disabling inheritance by default.
2. Remove the default styles for inner blocks in the edit.tsx file.
3. Add a save function in the index.tsx file, and create a save.tsx file to handle saving the block.
4. Update the ProductTemplate.php file to properly render the block content based on the changes.
5. Remove the render function from the ProductsCollection.php file, as it is no longer necessary.

These changes improve the functionality and flexibility of the ProductsCollection block, allowing for better customization and control over the block's appearance and behavior.

* Fix pagination issue

* Minor code quality improvments

* Register product blocks only in experimental builds

- Wrap registerBlockType calls in product-template and products-collection with isExperimentalBuild check to enable block registration only in experimental builds.
- Update the default value for the perPage property in products-collection/block.json from null to 9, setting a default display of 9 items per page.

* Add experimental flag to PHP file

* Update documentation for feature flags

- Add Products Collection and Product Template blocks to the list of experimental flags in the feature-flags-and-experimental-interfaces.md file.
- Include references to PHP and webpack flags for both blocks.

* Change default order and orderBy values in block.json

- Update the default 'order' value from 'desc' to 'asc'.
- Update the default 'orderBy' value from 'date' to 'title'.

* Refactor experimental block registration and remove unused file

- Replace `isExperimentalBuild()` with `registerExperimentalBlockType()` in product-template/index.tsx.
- Remove unused file types.ts in product-template directory.
- Add `get_block_type_script()` function to ProductTemplate.php and ProductsCollection.php to return null.

* Update variation names in product summary and product title elements

Updated variation names for product summary and product title elements to match the new products-collection namespace. The previous variation names used the product-query namespace which will be deprecated. This change ensures that the correct variation names are used for these elements in the products-collection block.

* Rename 'Products Collection' to 'Product Collection'

- Renamed all instances of "products-collection" to "product-collection" across multiple files.
- Adjusted related types and method calls to match the new naming convention.
- Updated documentation and feature flags to reflect the name change.
- Made necessary changes in `BlockTypesController.php` and `bin/webpack-entries.js`.

* Hide product-template block from inserter

- Added "woocommerce/product-collection" to the list of parent blocks in `product-template/block.json`.
- Added `"inserter": false` to the "supports" section to disable the option of inserting this block through the editor inserter component.

* Fix Eslint error
2023-05-15 08:51:49 +00:00
Danilo Parra Jr 2a4b78c150 Update the logic of disabling some blocks in the widget areas and post editor (https://github.com/woocommerce/woocommerce-blocks/pull/9462)
* refactor: disable some blocks in widget areas and post editor

* refactor: add more checks on the disabling blocks logic
2023-05-15 08:36:06 +02:00
Daniel W. Robert 8621755f69 Update `Hero Product – Split` Pattern Color Settings (https://github.com/woocommerce/woocommerce-blocks/pull/9433)
* Update color settings to abide by designs.

* Update pattern heading to use inline style.

This ensures the heading color will be white by default and not take on
the heading color from the active theme.

* Translate and escape rendered text in pattern.
2023-05-12 11:00:16 -04:00
Roy Ho cd5490be6b Update/cleanup patterns (https://github.com/woocommerce/woocommerce-blocks/pull/9447)
* Update category cover image pattern

* Update featured category focus pattern

* Update featured category triple pattern

* Update product details pattern

* Update product hero pattern

* Update shop by price pattern

* Update testimonials single pattern
2023-05-12 06:05:36 -07:00
Mike Jolley 43eaed7620 Experiment: Replace style hooks coming from `@wordpress/block-editor` (https://github.com/woocommerce/woocommerce-blocks/pull/9251)
* Replace all style hooks with useStyleProps hook

* Remove border/color/spacing hooks

* Style Props Hook

* Make use of `change-case` package

* Tidy up block wrappers

* Attribute filter does not use frontend.ts nor styles within block

* Remove frontend from filter blocks and unused styleprops usage

* Tidy up variable names so its clearer attributes are not required specifically from blocks

* Update assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-label-block/block.tsx

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

* Update assets/js/blocks/attribute-filter/block-wrapper.tsx

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

* Update assets/js/blocks/active-filters/block-wrapper.tsx

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

* Update assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-checkout-button-block/block.tsx

Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>

* Update assets/js/blocks/rating-filter/block-wrapper.tsx

Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>

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

Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>

* Update assets/js/blocks/price-filter/block-wrapper.tsx

Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>

* Update assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-cart-button-block/block.tsx

Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>

* Simplify styleprop

* Styleprops simplify

* Fix withFeaturedItem styles

* Like the original hook, flatten props and combine with parsed styles

---------

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>
2023-05-12 13:42:16 +01:00
Alba Rincón 30dc6ca5a5 Add new `Product collections: featured collections` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9388)
* Add new `Product collections: featured collections` pattern

* Update image paths

* Add buttons

* Add colors to buttons

* Change branded image
2023-05-12 12:26:06 +02:00
Patricia Hillebrandt 2a7ac1c92b Add Product Details: product listing pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9383)
* Add the skeleton for the Product Details: product listing pattern

* Update the wp-block-woocommerce-single-product class.

* Update the product details pattern for usage with core blocks.

* Update margins for the product reviews.

* Update the styles and spacing for ratings.

* Additional changes to the editor preview for product ratings.

* update spacing between ratings and text.

* Update content padding.

* Adjust the pricing

* Make adjustments to the button

* Update styles.

* Update styles for the star ratings.

* Extra fine-tunning for reviews and font size

* Add the product details image.
2023-05-12 09:17:45 +00:00
Mike Jolley 7e06584c14 Update settings text and styling (https://github.com/woocommerce/woocommerce-blocks/pull/9440) 2023-05-12 10:11:08 +01:00
Alba Rincón 6550c830db Patterns small improvements (https://github.com/woocommerce/woocommerce-blocks/pull/9403)
* Center the menu

* Use product image block

* Change search button background to white
2023-05-12 10:41:58 +02:00
Albert Juhé Lluveras 0bfc1b341e Mini-Cart: prevent 'Mini-Cart in cart and checkout pages' toggle from showing up in the post/page editor (https://github.com/woocommerce/woocommerce-blocks/pull/9442) 2023-05-12 10:26:03 +02:00
Dennis Jonda 1add6a146e Fix alignment issue with 'Add Coupon Code' button in WooCommerce Blocks checkout page (https://github.com/woocommerce/woocommerce-blocks/pull/9392)
Co-authored-by: Niels Lange <info@nielslange.de>
2023-05-12 12:28:08 +07:00
Niels Lange 301c6891b5 Replace ‘actions-ecosystem/action-remove-labels’ with ‘mondeja/remove-labels-gh-action’ (https://github.com/woocommerce/woocommerce-blocks/pull/9173)
* Replace ‘actions-ecosystem/action-remove-labels’ with ‘mondeja/remove-labels-gh-action’

* Adjust workflow

* Add test file for woocommerce/woocommerce-blocks#9173 (https://github.com/woocommerce/woocommerce-blocks/pull/9174)

* Remove the file created for testing purpose (https://github.com/woocommerce/woocommerce-blocks/pull/9177)

---------

Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
2023-05-12 11:54:04 +07:00
Albert Juhé Lluveras d236af2a8c Only show the Mini Cart count badge when there are items in the cart (https://github.com/woocommerce/woocommerce-blocks/pull/9259)
* Only show the Mini Cart count badge when there are items in the cart

* Update badge to new design

* Add tests

* Make sure colors don't break existing themes

* Update Mini Cart e2e test
2023-05-11 17:23:36 +02:00
Alba Rincón 545cc43123 Add new `Product listing with gallery` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9347)
* Add new `Product listing with gallery` pattern

* Replace single product block pattern

* Remove ids

* Fix title and images

* Rebuild the image gallery to make it work on diff widths

* Fix image src

* Fix gallery image and align description
2023-05-11 16:45:49 +02:00
Roy Ho 47f9777f4b Add banner pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9434)
* Add banner pattern

* Hardcode the button styling
2023-05-11 07:39:36 -07:00
Albert Juhé Lluveras 2b6eef516b Update Mini-Cart block editor sidebar (https://github.com/woocommerce/woocommerce-blocks/pull/9420)
* Update Mini-Cart block editor sidebar

* Rename Mini Cart block to Mini-Cart

* Update Mini-Cart block editor sidebar (II)

* Update two instances of mini-cart to uppercase
2023-05-11 14:52:03 +02:00
Karol Manijak a9d840ec69 Bump version in several files to 10.3.0-dev 2023-05-11 14:12:41 +02:00
Karol Manijak 202799007c Add testing steps of 10.2.0 2023-05-11 14:10:51 +02:00
Karol Manijak af725d558e Update minimal WordPress version in phpcs.xml to the 6.1 2023-05-11 14:09:08 +02:00
Karol Manijak c3e4321cb6 Update minimal WordPress version to the latest 6.2 2023-05-11 14:08:30 +02:00
Karol Manijak 379bb41e9b Add changelog for 10.2.0 2023-05-11 14:08:01 +02:00
Karol Manijak ecfd94ce2b Change the button text in the pattern to make it matching the content (https://github.com/woocommerce/woocommerce-blocks/pull/9435)
* Change the button text in the pattern to make it matching the content

* Fix the image size so it's original ratio is preserved
2023-05-11 11:02:45 +02:00
Roy Ho a84cfd93d6 Update text (https://github.com/woocommerce/woocommerce-blocks/pull/9423)
* Update text

* Make shop now button black with white text to match design

* Update pattern image and text
2023-05-11 08:17:42 +02:00
Roy Ho 06cd02b88a Update pattern with images and alignment (https://github.com/woocommerce/woocommerce-blocks/pull/9414) 2023-05-10 05:44:58 -07:00
Luigi Teschio b15cb932fb Improve transform classic product template UX (https://github.com/woocommerce/woocommerce-blocks/pull/9386)
* improve transform classic product template UX

* improve layout

* not update deps

* improve logic

* add bold

* fix height and width preview on hover

* fix label

* improve logic for revert button

* fix regression
2023-05-10 13:02:33 +02:00
Patricia Hillebrandt b12cfd2d6a Add to Cart Button > Update block registration to rely on metadata and enable usage for the Single Product Block (https://github.com/woocommerce/woocommerce-blocks/pull/9404)
* Adapt the Add to Cart Button block to be registered via block.json

* Remove the legacy supports.ts file

* Ditch all registration methods from the ProductButton class as it is now registered via metadata (a block.json file)

* Update get_block_type_uses_context and register_block_type_assets
2023-05-10 10:20:40 +00:00
Karol Manijak 8d6344a07d Skip the failing test (https://github.com/woocommerce/woocommerce-blocks/pull/9405)
* Skip the failing test

* Add an explanation to the skipped test and eslint disable
2023-05-10 11:03:22 +02:00
Daniel W. Robert b6cfe080d5 Remove br in pattern heading. (https://github.com/woocommerce/woocommerce-blocks/pull/9409)
This allows the text to flow more naturally, as opposed to having
unexpected line-breaks at certain screen widths.
2023-05-09 15:22:33 -04:00
Roy Ho b05f78b66c Update pattern alignments (https://github.com/woocommerce/woocommerce-blocks/pull/9410)
* Update pattern alignments

* Add explicit margin

* Try this

* Explicitly set margins

* Remove is-light class
2023-05-09 09:25:02 -07:00
Roy Ho e6a58ab90c Add product details pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9408)
* Add product details pattern

* Replace stars image
2023-05-09 08:15:03 -07:00
Luigi Teschio 796f16880a Related Products: Fix hardcoded limit product (https://github.com/woocommerce/woocommerce-blocks/pull/9407)
* fix hardcoded limit product

* improve readibility
2023-05-09 14:59:05 +02:00
Seghir Nadir 4c2f024418 Only validate postcode if its required or filled (https://github.com/woocommerce/woocommerce-blocks/pull/9377)
* Only validate postcode if its required

* Clear postcode validation error if postcode is not required

---------

Co-authored-by: Niels Lange <info@nielslange.de>
2023-05-09 16:54:28 +07:00
Roy Ho b92bc3e7fd Update patterns images paths (https://github.com/woocommerce/woocommerce-blocks/pull/9390) 2023-05-08 07:22:30 -07:00
Lucio Giannotta 41817ea2d6 Implement Hand-Picked Products block (https://github.com/woocommerce/woocommerce-blocks/pull/7925)
Implements the ProductSelector advanced filter within the “Products (Beta)” block.
The filter allows the merchant to narrow down the exact products to which all
subsequent filters will be applied, mirroring the functionality of the existing
“Hand-picked Products” plus all the other functionalities available
from the “Products (Beta)” block.
2023-05-08 14:50:10 +02:00
Danilo Parra Jr 4c204ab578 Add color and typography styles on the mini cart title block (https://github.com/woocommerce/woocommerce-blocks/pull/9382)
* feat: added color and typography supports on the mini cart title block

* refactor: remove background support for mini cart title block
2023-05-08 13:52:25 +02:00
Alba Rincón d8c974f104 [Pattern] Add new `Hero product chessboard` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9180)
* Add new `Hero product chessboard` pattern

* Add images

* Margins in px to avoid diff behaviour on diff theme styles

* Add shop link
2023-05-08 11:35:51 +02:00
dependabot[bot] c54e60cac8 Bump dependabot/fetch-metadata from 1.3.6 to 1.4.0 (https://github.com/woocommerce/woocommerce-blocks/pull/9303)
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.3.6 to 1.4.0.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.3.6...v1.4.0)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2023-05-05 11:58:18 -03:00
dependabot[bot] 48f5dd6b72 Bump @wordpress/babel-preset-default from 7.8.0 to 7.16.0 (https://github.com/woocommerce/woocommerce-blocks/pull/9279)
Bumps [@wordpress/babel-preset-default](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default) from 7.8.0 to 7.16.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/babel-preset-default/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/babel-preset-default@7.16.0/packages/babel-preset-default)

---
updated-dependencies:
- dependency-name: "@wordpress/babel-preset-default"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2023-05-05 11:35:44 -03:00
Roy Ho 4f90c5fe85 Add shop by price pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9373) 2023-05-05 06:33:20 -07:00
Luigi Teschio 739fa60fea Improve the E2E testing process with Playwright (https://github.com/woocommerce/woocommerce-blocks/pull/9148)
* Add Playwright infrastucture

* improve documentation

* improve type

* remove puppeteer tests

* fix wp-env.json

* add link on how run E2E tests

* chore on playwright.yml

* remove unnecessary flush command

* improve stability E2E test

* remove build:e2e-test command

* Update .github/workflows/playwright.yml

Co-authored-by: Niels Lange <info@nielslange.de>

* Update .github/workflows/playwright.yml

Co-authored-by: Niels Lange <info@nielslange.de>

* Update docs/contributors/contributing/e2e-guidelines.md

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

* Update docs/contributors/contributing/e2e-guidelines.md

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

* Update docs/contributors/contributing/e2e-guidelines.md

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

* remove emptyline and fix JSDoc warning

* add link about E2E guidelines

* fix theme name

* improve style

* improve markdown

---------

Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-05-05 11:03:36 +00:00
Albert Juhé Lluveras 349ae658bb Mini Cart drawer: print width in PHP (https://github.com/woocommerce/woocommerce-blocks/pull/9329)
* Mini Cart drawer: print width in PHP

* Remove unnecessary timeout

* Make sure classic themes have a Mini Cart contents width value set up
2023-05-05 11:44:41 +02:00
Luigi c4d8e9114e Merge branch 'release/10.0.0' of https://github.com/woocommerce/woocommerce-blocks into trunk 2023-05-05 11:37:54 +02:00
github-actions[bot] 18aed7f8ae Release: 10.0.4 (https://github.com/woocommerce/woocommerce-blocks/pull/9357)
* Empty commit for release pull request

* Add 10.0.3 changelog

* Update versions to 10.0.3

* Fix image editor in Featured Product/Category blocks on WP 6.2 (https://github.com/woocommerce/woocommerce-blocks/pull/9142)

* Add 10.0.3 testing steps

* Empty commit for release pull request

* Check that the customized fallback template is archive-product before unsetting the source property (https://github.com/woocommerce/woocommerce-blocks/pull/9330)

* use 'enqueue_block_assets' is available (https://github.com/woocommerce/woocommerce-blocks/pull/9332)

* Remove esc_url() on self generated link to edit the Mini Cart template since it gets escaped in JS (https://github.com/woocommerce/woocommerce-blocks/pull/9348)

* Add changelog entries to readme.txt

* Update version number in several files

* Add testing notes for the release

* Add woocommerce/woocommerce-blocks#9332 to testing notes

* Add testing on frontend for woocommerce/woocommerce-blocks#9332

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2023-05-05 11:34:51 +02:00
Daniel W. Robert 18e4ffa741 Add permalink to plugin documentation in readme. (https://github.com/woocommerce/woocommerce-blocks/pull/9343)
The plugin's readme.txt file had a URL to the official documentation but
there was no hyperlink - only text.

This improves the page by removing the text link and hyperlinking the
"official documentation" text itself.
2023-05-04 23:15:12 -04:00
Roy Ho e788db408c Convert to use WP core blocks (https://github.com/woocommerce/woocommerce-blocks/pull/9340) 2023-05-04 06:04:24 -07:00
Roy Ho 1efa47c076 Add product hero pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9181)
* Add product hero wide pattern

* Convert to using WP core blocks
2023-05-04 06:00:15 -07:00
Luigi Teschio 145bc25100 use 'enqueue_block_assets' is available (https://github.com/woocommerce/woocommerce-blocks/pull/9332) 2023-05-04 12:32:23 +00:00
Luigi Teschio fccdb92612 Single Product Template - Related Products: fix items per page option (https://github.com/woocommerce/woocommerce-blocks/pull/9286) 2023-05-04 12:21:20 +00:00
Tom Cafferkey f11bdbe0b3 Remove esc_url() on self generated link to edit the Mini Cart template since it gets escaped in JS (https://github.com/woocommerce/woocommerce-blocks/pull/9348) 2023-05-04 10:02:46 +01:00
Albert Juhé Lluveras 4bccbb61d7 Remove duplicated code in BlockTypesController.php (https://github.com/woocommerce/woocommerce-blocks/pull/9283) 2023-05-04 10:36:35 +02:00
Albert Juhé Lluveras 19332e960d Fix Product Price styles leaking into the Mini Cart, Cart and Checkout blocks (https://github.com/woocommerce/woocommerce-blocks/pull/9276)
* Fix Product Price styles leaking into the Mini Cart

* Add support for All Products block
2023-05-04 09:32:45 +02:00
dependabot[bot] 2e4557bdb7 Bump automattic/jetpack-autoloader from 2.11.18 to 2.11.19 (https://github.com/woocommerce/woocommerce-blocks/pull/9305)
Bumps [automattic/jetpack-autoloader](https://github.com/Automattic/jetpack-autoloader) from 2.11.18 to 2.11.19.
- [Release notes](https://github.com/Automattic/jetpack-autoloader/releases)
- [Changelog](https://github.com/Automattic/jetpack-autoloader/blob/trunk/CHANGELOG.md)
- [Commits](https://github.com/Automattic/jetpack-autoloader/compare/v2.11.18...v2.11.19)

---
updated-dependencies:
- dependency-name: automattic/jetpack-autoloader
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2023-05-03 17:21:04 -03:00
Daniel W. Robert 7567475a60 Implement new `Hero Product – Split` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9191)
* Add pattern for split hero product banner.

This adds a new pattern for a hero product banner with a 50/50 split,
heading and CTA on left and product image on right.

Uses the Media + Text block.

* Update image to use Unsplash placeholder.

* Remove WooCommerce prefix in pattern title.

* Remove unneeded wrapper group block.

* Serve placeholder image from plugin directory.
2023-05-03 12:11:24 -04:00
Tom Cafferkey 150120774a Check that the customized fallback template is archive-product before unsetting the source property (https://github.com/woocommerce/woocommerce-blocks/pull/9330) 2023-05-03 15:33:03 +01:00
Roy Ho 721257d32a Add featured category cover image (https://github.com/woocommerce/woocommerce-blocks/pull/9284)
* Add featured category cover image

* Use WP core blocks

* Explicitly add meassurement type
2023-05-03 06:51:52 -07:00
Thomas Roberts fdfb445a58 Prevent email address being removed when changing shipping method/entering shipping address (https://github.com/woocommerce/woocommerce-blocks/pull/9328)
* Preserve email when rendering shipping address form for the first time

* Ensure billing email does not reset when changing form values

* Add test to ensure email does not get overwritten
2023-05-03 06:45:57 -07:00
Alba Rincón b813a98691 [Pattern] Add new `Hero product 3 split` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9319)
* Add new `Hero product 3 split` pattern

* Improve colors and margins
2023-05-03 15:44:05 +02:00
Patricia Hillebrandt 6e76fba561 Single Product Block > Ensure the product title is correct when used in a post or page (https://github.com/woocommerce/woocommerce-blocks/pull/9335)
* Ensure the product title is correct when used outside of the scope of the single product template.

* Update docblock with the details about the temporary workaround.
2023-05-03 15:08:41 +02:00
Mike Jolley 3743b024b7 Refactor klona usage (https://github.com/woocommerce/woocommerce-blocks/pull/9320)
* cloneObject in tests

* Create custom updateNested function instead of deepCloning objects

* Update type based on feedback
2023-05-03 12:09:12 +01:00
Luigi Teschio fed679cbeb Rename Add to Cart (https://github.com/woocommerce/woocommerce-blocks/pull/9315)
* rename Add to Cart

* fix E2E test
2023-05-03 10:31:59 +00:00
Luigi Teschio 0ea4dab3c9 Product Image Gallery: fix resize width when the window resize (https://github.com/woocommerce/woocommerce-blocks/pull/9299) 2023-05-03 08:44:22 +00:00
Alba Rincón 0aa8c79790 [Pattern] Add new `Product Collections: Newest Arrivals` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9240)
* Add new `Product Collections: Newest Arrivals` pattern

* Remove ID

* Improve paddings

* Use product image with thumbnail style
2023-05-03 10:03:45 +02:00
Albert Juhé Lluveras 4534beaa91 Fix Mini Cart block not respecting Add-to-Cart behaviour attribute when adding the first product (https://github.com/woocommerce/woocommerce-blocks/pull/9257) 2023-05-03 09:49:43 +02:00
Mike Jolley 1a0f209770 Fix shipping notices for multiple packages (https://github.com/woocommerce/woocommerce-blocks/pull/9285)
* Move notice to top and only show on cart page

* Missing setting on cart page prevents notice display

* Allow null in the select-shipping-rate endpoint to select all packages

* Only show the warning if different packages are selected

* Check if selected rates is an object before mapping it

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2023-05-02 16:04:29 +01:00
Roy Ho bcfc330f8a Add/featured category focus pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9322)
* Add category focus pattern

* Fix text

* Explicit add padding and make image smaller
2023-05-02 07:16:44 -07:00
Albert Juhé Lluveras bad0222385 Related Products: make Product Title a link (https://github.com/woocommerce/woocommerce-blocks/pull/9179) 2023-05-02 11:36:23 +02:00
Luigi Teschio 114ba02135 Product Image Gallery: fix inline (https://github.com/woocommerce/woocommerce-blocks/pull/9297) 2023-05-02 09:11:58 +00:00
Alexandre Lara 448f8102d9 Product Rating block: Fix review count not displaying on frontend (https://github.com/woocommerce/woocommerce-blocks/pull/9129)
* Fix review count not displaying on Product Rating

* Fix PHP CS errors

* Add Customer Reviews count to the Product Rating block on the Editor

* Remove unnecessary var_dump
2023-04-28 14:26:43 -03:00
Roy Ho 5297d93d37 Add featured category triple pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9269) 2023-04-28 05:35:54 -07:00
Alba Rincón 9524c3607d Add new `Product collections: Featured Collection` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9246)
* Add new `Product collections: Featured Collection` pattern

* Improve padding

* Set text color to white

* Make string translatable
2023-04-28 13:58:46 +02:00
Mike Jolley 2d506f9f57 Fix/you do not need lodash (https://github.com/woocommerce/woocommerce-blocks/pull/9161)
* Remove lodash `without` usage

* isNumber

* Remove lodash `difference`

* Replace lodash isEmpty with type guard

* Replace isObject with type guard

* remove lodash noop

* Replace lodash clamp

* replace lodash uniqueId

* Remove uniqueId import

* Add eslint rule to restrict lodash import

* Replace lodash range

* Replace lodash has() function

Replace lodash has

* replace omitby

* Replace lodash isEqual with fastDeepEqual

* Replace kebabCase with change-case package

* Replace lodash camelCase

Replace lodash mapKeys with function

Move mapkeys to utility

Create camelCaseKeys which replaces usage of mapKeys

* Replace lodash debounce with custom utiity

* replace lodash keyby

* Replace lodash pick with native function

* Replace lodash cloneDeep with klona

* Replace snake case keys package with change case

* Replace sortBy with fast sort package

* replace isEmpty with type guard

* Replace pickBy usage in validation reducer

* Replace groupBy usage in search list control

* Replace flatten, uniqBy usage in getProducts()

* Remove setWith and clone from updateState

* Replace custom useThrottle with useThrottledCallback from use-debounce package

* onSelectRate can use-debounce

* Fix missing flatten

* Update assets/js/data/cart/test/push-changes.ts

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>

---------

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-04-28 11:29:45 +01:00
Tom Cafferkey a22ab08410 Remove min-height and padding for WP Button elements (https://github.com/woocommerce/woocommerce-blocks/pull/9260)
* Remove min-height and padding for WP Button elements

* Remove commented out code

* Add min-height style back in for .woocommerce-block-theme-has-button-styles themes
2023-04-28 10:49:12 +01:00
Andres 98222dda09 Fix store api documentation for min_price and max_price (https://github.com/woocommerce/woocommerce-blocks/pull/9258)
* Fixed store api documentation for min_price and max_price

* Update products.md

* Update products.md

* Update src/StoreApi/docs/products.md

Co-authored-by: Karol Manijak <karol.manijak@automattic.com>

---------

Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
2023-04-28 10:56:22 +02:00
Manish Menaria 1e1b82ad63 Products block: Using nested selector to add margin between Product elements (https://github.com/woocommerce/woocommerce-blocks/pull/8993)
* Using nested selector to style Product elements in Products Block

This commit simplifies the INNER_BLOCKS_TEMPLATE array in the product-query constants.ts file by removing the style properties from the individual elements. Instead, the default styles are now managed in the style.scss file, providing a more consistent and centralized approach to styling.

In the style.scss file, a new section for default styling has been added to handle product elements inside the Products Block, adhering to the Gutenberg styling hierarchy. This ensures the lowest precedence in the hierarchy, allowing for easier overrides when needed.

* Decrease specificity of styles for product elements in Products Block

The commit changes the default styles for product elements inside the 'Products Block'. It changes the way the margin-bottom and margin-top properties are set by using the :where() selector instead of using the .products-block-post-template class selector. This is done to decrease the specificity of the CSS selector, ensuring that the styles have the lowest precedence in the hierarchy. It also removes the display: inline-block property from the a selector, and moves the styles to the .editor-styles-wrapper class selector.

* Decrease specificity of CSS selectors

In these changes, the product elements inside the Products Block have been restyled. The specificity of the CSS selector has been decreased using the :where() selector, to ensure that these styles have the lowest precedence in the hierarchy.

In constants.ts, a new class name, products-block-post-template, has been added to the inner block template for the post. This class is used to add default styles for inner blocks.

In style.scss, the CSS selector for the inner blocks has been updated to include the new class name. The :where() selector has also been used to ensure that these styles have the lowest precedence in the hierarchy.

* Update default margins and remove redundant entries

This commit updates the default margin values for the Product Title in the Products block, moving them from the style.scss file to the constants.ts file. It also removes unnecessary empty arrays in the INNER_BLOCKS_TEMPLATE and background-color property from the style.scss file.
2023-04-28 07:43:47 +00:00
Albert Juhé Lluveras d7fa7a3310 10.1.0 testing steps: move Mini Cart width items under Feature plugin section (https://github.com/woocommerce/woocommerce-blocks/pull/9263) 2023-04-28 09:17:53 +02:00
Tarun Vijwani 4934d19b6a Fix coupon code translation in e2e tests (https://github.com/woocommerce/woocommerce-blocks/pull/9247)
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-04-28 10:40:36 +04:00
Alexandre Lara aacd82c8fb Single Product block: Add wide and full-width alignments support (https://github.com/woocommerce/woocommerce-blocks/pull/8981)
* Add align support to single product block

* Fix block alignment that was not being set on the frontend

* Remove classname prop from the Single Product Edit component
2023-04-27 16:44:10 -03:00
Luigi Teschio 1d0ff02f8f Rename Add To Cart Form to Add To Cart Options (https://github.com/woocommerce/woocommerce-blocks/pull/9238) 2023-04-27 17:05:50 +00:00
Albert Juhé Lluveras 1dc7c953eb Rename docs which unnecessary mention the All Products block (https://github.com/woocommerce/woocommerce-blocks/pull/9265)
* Rename docs which unnecessary mention the All Products block

* Fix two more links
2023-04-27 18:26:18 +02:00
Alba Rincón 4cea6664a5 [Patterns]: Add new `Header Centered Search` pattern (https://github.com/woocommerce/woocommerce-blocks/pull/9081)
* Add new `Header Centered Search` pattern

* Add margin support to the customer account block

* Add margin to the customer account to separate it from the search bar

* Update margin

* Add with, fix margins

* Remove unnecessary separator

* Updates after review

* Remove ref

* Remove separator

* Bring back separator and use product search

* Remove html block and fix search border
2023-04-27 10:23:24 +02:00
Alba Rincón 2b75d821fa [Patterns] Add new `Footer with 3 menus` menu (https://github.com/woocommerce/woocommerce-blocks/pull/9175)
* Add new `Footer with 3 menus` menu

* Stack menus on mobile, remove refs

* Change the site title to a `p` tag

* Align menus to the top and add paddings

* Make the `powered by` string translatable and add padding

* Improve search
2023-04-27 10:22:43 +02:00
Paulo Arromba 7fd3063239 re added codeql-analysis.yml (https://github.com/woocommerce/woocommerce-blocks/pull/9253) 2023-04-26 21:09:55 +01:00
Paulo Arromba a50e2a91a5 Update CodeQL/Analyse (https://github.com/woocommerce/woocommerce-blocks/pull/9156)
* yaml format, typescript test

* removed codeql-analysis.yml

* typo fix for CI trigger

* Revert "removed codeql-analysis.yml"

This reverts commit 0badabe02a006fd7b1cffa9aac1eb2bc138ff964.

* re-add codeql-analysis.yml

* removed codeql-analysis.yml
2023-04-26 19:50:19 +01:00
Alexandre Lara 27b3b47edd Update plugin version 2023-04-26 14:25:17 -03:00
Alexandre Lara cdb41422ca Update changelog and testing notes with PRs woocommerce/woocommerce-blocks#9195 and woocommerce/woocommerce-blocks#9196 2023-04-26 14:22:07 -03:00
Alexandre Lara 43b58d41d6 Add PR woocommerce/woocommerce-blocks#9196 to the release notes 2023-04-26 14:21:51 -03:00
Alexandre Lara b3f6bb7a61 Update woocommerce-gutenberg-products-block.zip link 2023-04-26 14:21:39 -03:00
Alexandre Lara 0dac78f781 Add some improvements to the testing notes 2023-04-26 14:21:27 -03:00
Alexandre Lara 54059baf00 Update testing notes 2023-04-26 14:21:02 -03:00
Alexandre Lara 3349140955 Add testing notes for the release 2023-04-26 14:20:49 -03:00
Alexandre Lara 7e1be7ab29 Increase WordPress and WooCommerce minimum versions 2023-04-26 14:20:32 -03:00
Alexandre Lara 59c6885476 Update version number in several files 2023-04-26 14:20:11 -03:00
Alexandre Lara 968337cc51 Add changelog entries to readme.txt 2023-04-26 14:18:54 -03:00
Mike Jolley 61bc923949 Add examples for adding variations to the cart (https://github.com/woocommerce/woocommerce-blocks/pull/9086)
Fixes woocommerce/woocommerce-blocks#8626
2023-04-26 16:24:33 +01:00
Albert Juhé Lluveras 0dae33e4b9 Use currentColor for Mini Cart footer border (https://github.com/woocommerce/woocommerce-blocks/pull/9245) 2023-04-26 16:59:35 +02:00
Luigi Teschio 8e0709eb9a Update the icon and description for the Product Details block (https://github.com/woocommerce/woocommerce-blocks/pull/9241)
* Update icon and description for the Product Details block

* fix alt
2023-04-26 16:19:01 +02:00
Luigi Teschio 2ca2287cb8 Update icon and description for the Product Meta block (https://github.com/woocommerce/woocommerce-blocks/pull/9243)
* Update icon and description for the Product Meta block

* fix alt
2023-04-26 12:16:54 +00:00
Albert Juhé Lluveras cb8040f7b0 Mini Cart Contents block: fix wide width not being applied in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/9201) 2023-04-26 12:16:43 +02:00
Daniel W. Robert aa219a1aa1 Fix Semgrep Security Scan Issues (https://github.com/woocommerce/woocommerce-blocks/pull/9204)
* Add late escaping to  call in MiniCart.

* Add escaping to  call in AssetsController.

* Add escaping to  calls in StoreAPI pagination utils.

* Add ignore line to file require - OK.

* Minor update to grammar in code comment.
2023-04-25 21:41:26 -04:00
Albert Juhé Lluveras 96bd0432cd Mini Cart Contents block: set minimum width (https://github.com/woocommerce/woocommerce-blocks/pull/9196)
* Mini Cart Contents block: set minimum width

* Mini Cart Contents block: allow changing the width only in the feature plugin

* Allow resetting the Mini Cart Contents width to the default

* Update assets/js/blocks/mini-cart/mini-cart-contents/edit.tsx

Co-authored-by: Karol Manijak <karol.manijak@automattic.com>

---------

Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
2023-04-25 18:54:35 +02:00