Commit Graph

2732 Commits

Author SHA1 Message Date
Alexandre Lara 7ec1b7f3a1
Product Gallery block: Add logic to trap keyboard focus within the Product Gallery Pop-Up (#44439)
* Add logic to trap keyboard focus inside the Product Gallery Pop-Up

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* Remove unnecessary condition

* Fix issue with keyboard focus trap not working within the Pop-Up

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-09 13:43:51 -03:00
Alexandre Lara 74c6fcad2d
Product Gallery block > Pop-Up: Fix overlay sizing issue (#44479)
* Fix overlay issue when Product Gallery Pop-Up is open

* Fix stylelint error

* Add changelog

* Fix e2e tests for Product Gallery Pop-Up
2024-02-09 11:38:41 -03:00
Karol Manijak db082421ad
Product Collection: fix assymmetrical padding in Editor (#44403)
* Import editor.scss styles of Product Templayte and increase specificity

* Add changelog

* Add ts ignore

* Revert changing eslint-disable as it conficts with another rule creating more errors
2024-02-09 09:42:29 +01:00
Chris Lilitsas 60c17eb126
Include the selected collection in the product collection block context (#43247)
* Include collection attribute in the block context

* add 'collection' to useContext for Product Template

* Changelog

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2024-02-08 10:55:05 +02:00
Alexandre Lara f7b92e8b6b
Product Gallery block: Focus should return to trigger element when closing pop-up (#44414)
* Return focus to trigger element when closing pop-up

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* Fix php cs error

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-07 17:18:41 -03:00
Alexandre Lara 0654fa1997
Product Gallery block: Announce Pop-Up Opening with Voiceovers (#44332)
* Add aria attributes to product gallery pop-up

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* Fix Interactivity API store import

* Announce Dialog opening with VoiceOver

* fix php cs lint error

* Remove unnecessary data-wc-watch directive from Product Gallery block

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-06 14:28:33 -03:00
Mike Jolley 45923dc5f3
[Experiment] Handle customer session meta data (#44181)
* Update data store to bail if there is no customer ID

* Use WC_Data meta functions

* Save and load meta in session class

* Customer session handling

* CheckoutFields - only persist customer data to accounts

* Inline docs for session handling

* Handle meta data in session

* Document wc->customer inline

* Store only additional fields in session

* Prevent notice in WC_Data

* Organise keys and remove duplicates

* Correctly save fields to account

* Fix notices on checkout

* Remove unnecessary diff

* Changelog

* Go back to previous way to loading session handler to avoid 3rd party breakage

* No need to track is_session

* white space

* Remove changes to customer data store

* Update class-wc-customer-data-store.php

* Populate client from additional values from api

* Additional fields in session

* Add woocommerce_customer_allowed_session_meta_keys hook

* Put back legacy keys for tests

* Remove key fixes

* Don't save additional fields to customer object

* Remove duplicate init call

* Only persist contact fields
2024-02-06 15:16:00 +00:00
Alexandre Lara b4928ed46a
Product Gallery block: Enable keyboard navigation for thumbnails (#44236)
* Add ability to select thumbnails using keyboard

* Add ability to open the Product Gallery pop up using the keyboard

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* Fix outline border not showing on Thumbnails on some browsers

* Prevent firefox browser from focusing on UL tag of the Large Image block

* Enable usage of 'Space' and 'NumpadEnter' keys to navigate between the thumbnails

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-06 08:55:03 -03:00
Mike Jolley 35630bb52b
Update combobox validation message to be more generic (#44229)
* Update combobox validation message

* Changelog
2024-02-06 11:51:09 +00:00
Alexandre Lara 560f0e933d
Product Gallery block: Prevent block error when a user inputs a decimal number for the Number of Thumbnails setting (#44282)
* fix error on decimal input for the Number of Thumbnails setting

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-05 15:17:35 -03:00
Manish Menaria 1d8007b822
Product Collection: Return to top after page change (#43817)
* Initial working version

* Update scrolling behavior in product collection block frontend

This commit updates the scrolling behavior in the product collection block's frontend script.

Previously, the code focused on the first anchor or button within a product collection block. This approach was taken to maintain accessibility and ensure that the focused element was scrolled into view. However, this behavior has been changed to improve the user experience.

The updated code now directly scrolls to the first product in the collection. This is achieved by selecting the product using a new selector that targets the `.wc-block-product` class within the `.wc-block-product-template` of the specified `data-wc-navigation-id`. Once the product is selected, the `scrollIntoView` method is used with smooth behavior and start block alignment, offering a more visually appealing scroll effect.

This change enhances the user experience by smoothly directing attention to the beginning of the product collection, making it easier for users to browse products.

* Remove code related to animation

* Fix the issue related to pagination block rendering

- I have improved the code by breaking it into smaller functions
- Added unique `data-wc-key` to each anchor tag

* Enhance Product Collection Block with Interactive Prefetching

* Refine Prefetch Logic & other improvements

This commit further refines the prefetch logic and interactivity in the Product Collection block. It focuses on enhancing code clarity and improving the prefetch behavior based on user interactions.

Key changes include:
1. Renamed 'isPrefetchNextAndPreviousLink' to 'isPrefetchNextOrPreviousLink' in ProductCollectionStoreContext for better readability and accuracy.
2. Modified the scrollToFirstProductIfNotVisible function to accept a wcNavigationId as a parameter instead of a reference
3. Introduced checks for the existence of wcNavigationId in scrollToFirstProductIfNotVisible to prevent unnecessary executions.
4. Updated comments throughout frontend.tsx for enhanced clarity, explaining the prefetch logic and its triggers in detail.
5. Adjusted the logic in the navigate and prefetch functions to align with the new context structure and prefetch strategy.
6. In ProductCollection.php, updated data attributes to align with the revised prefetch strategy.
7. Refined the attribute setting in process_pagination_links function to correctly implement the updated interactivity and prefetch logic.

These changes aim to optimize the prefetch functionality, reduce unnecessary prefetching on initial page load, and ensure a smoother and more efficient navigation experience within the Product Collection block.

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* Improve comments

* Use wp_json_encode for data-wc-interactive attribute

This commit updates the `ProductCollection` class to use `wp_json_encode` for setting the `data-wc-interactive` attribute value. Previously, the attribute value was hardcoded as a JSON string. Now, by utilizing `wp_json_encode`, we ensure the JSON encoding is handled correctly by WordPress standards, enhancing readability and maintainability of the code.

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-02 12:07:29 +05:30
Karol Manijak 84f2de633d
Fix incorrect product data displayed in Product Collection in context of Single Product block (#44123)
* Initial approach to fix incorrect product data displayed in Product Collection in context of Single Product block

* Remove the BlockCOntextProvider

* Add Block context for title and summary

* Add changelog

* Improve typing

* Add E2E test with Product Collection inside Single Product block

* Improve insertBLock function description

* Make productPrices selector in Product Collectionmore specific

* Extract components props into a types
2024-02-01 17:55:38 +01:00
Thomas Roberts 1130380f73
[Experimental] Allow Additional Information block to be moved but not removed (#44193)
Co-authored-by: github-actions <github-actions@github.com>
2024-02-01 02:58:05 -08:00
Thomas Roberts 77d2dd9453
Make combobox suggestions have same border as main input (#44183)
Co-authored-by: github-actions <github-actions@github.com>
2024-02-01 02:57:57 -08:00
Sam Seay 08d5cc05aa
[Experimental] Fix a bug where new attribute filter block flickers in editor. (#44147) 2024-01-31 01:10:12 +13:00
Sam Seay cfd8f36578
[Experimental] Utilize WP generated class names to style rating filter block. (#44072) 2024-01-29 19:50:47 +13:00
Sam Seay 067cdef753
[Experimental] Utilize WP generated class names to style interactivity stock filter block. (#44073) 2024-01-26 19:29:39 +13:00
Sam Seay 1ce39d98fb
[Experimental] Utilize WP generated class names when styling new active filters block. (#44069) 2024-01-26 19:06:50 +13:00
Tung Du 1abefd5eee
[Experimental] Filter block: replace custom upgrade panel by Transforms API (#44024) 2024-01-25 15:28:09 +07:00
Tung Du b50431d9af
[Experimental] Filter block: refactor visibility control, context passing, and filter data processing (#43996) 2024-01-25 13:55:45 +07:00
Tarun Vijwani 0c79d1b6a7
Display shipping calculator link in the Cart block when fallback shipping options available (#43803)
* Hide the shipping rates in editor to match front-end

- If there are no shipping rates, hide the shipping rates in editor to match front-end.

* Add get_shipping_zones method to CartCheckoutUtils

* Display change address like for fallback shipping zone

- If cart has multiple and default shipping zones without shopper address, display the change address link

* Update shipping address label

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* Fix linting errors

* Update plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/totals/shipping/shipping-address.tsx

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

* Display shipping calculator for locations outside all other zones

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* Update typescript for activeShippingZones

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2024-01-24 20:40:53 +04:00
Sam Seay 42e77d4938
[Experimental] Product Filter - Reintroduce Wrapper Block (#43688) 2024-01-23 18:29:24 +13:00
Tarun Vijwani 139150134f
Add store notices to the Cart and Checkout block templates (#43753)
* Fix session notices in Cart and Checkout block pages

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* Update plugins/woocommerce-blocks/assets/js/base/components/notice-banner/style.scss

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

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2024-01-22 21:25:42 +04:00
Thomas Roberts 7dabf2b031
[Experimental] Add `$request` to additional fields validation filter (#43789)
* Add $request to additional fields filter

* Add changelog entry

* Add data to additional message
2024-01-19 23:21:47 -08:00
Niels Lange 32282a00ce
Add tracking for incompatible extensions (#42816)
* Add tracking for incompatible extensions

* Separate tracking data
2024-01-19 13:03:33 +07:00
Thomas Roberts bf61e57ce4
Ensure "email" field id does not include the section ID (#43734)
Co-authored-by: github-actions <github-actions@github.com>
2024-01-18 04:33:50 -08:00
Manish Menaria 8c284a5074
[Product Collection] Add unique ID attribute (#43314)
* Add unique ID attribute to Product Collection block

In this update, we introduced a unique identifier for each instance of the Product Collection block. This change involves several key modifications:

1. **Block JSON Update**: Added a new `id` attribute in `block.json` to store the unique identifier for each block instance.

2. **Product Collection Content Update**: In `product-collection-content.tsx`, we utilized the `uuid` library to generate a unique ID. This is done in a `useEffect` hook, ensuring that each block instance receives a distinct ID upon initialization.

3. **Type Definitions**: The `ProductCollectionAttributes` interface in `types.ts` was updated to include the new `id` attribute, aligning with our enhanced data structure.

4. **Package Dependencies**: To support this feature, `@types/uuid` and `uuid` were added to `package.json`, ensuring we have the necessary tools for ID generation.

This enhancement is pivotal for uniquely identifying each Product Collection block, paving the way for more robust and individualized block handling in the future.

* Rename uniqueId to id

* Add lock file

* Add 'id' context to product collection and template

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

* Merge trunk with 42861-introduce-a-unique-identifier-for-each-product-collection-block

* Regenerate the lockfile

* Remove autogenerated change in plugins/woocommerce/package.json

* Regenerate lock file

* Rerun CI actions

* Delete pnpm-lock.yaml file & regenerate it using pnpm install command

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-18 15:30:57 +05:30
Alexandre Lara 8258919e22
Product Gallery block: Remove the experimental flag from the Product Gallery block (#43586)
* Remove the experimental flag from the Product Gallery block

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-16 21:05:47 -03:00
Mike Jolley 1dee94362f
[Experimental] Surface additional checkout fields on Order Confirmation page (#43449)
* Get default attributes on front end

* Remove console log

* Show notice about 0 registered fields in editor

* Do not show block in editor if no fields are registered

* Wrapper block

* Styling/spacing

* Update webpack config

* Register heading pattern

* Wrapper block type definition

* get_fields_for_location return fields in array format

* Use wrapper in default content

* Separate fields from the hook block

* Hide when no custom fields exist

* Address and contact fields

* Shared form fields in settings

* remove info block from wrapper

* Revert render_content to original

* rename block

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* Update styling

* Create shared get_order_additional_fields_with_values to format values

* Update block names and descriptions

* Show address placeholders

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* Unused import

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-01-16 13:17:28 +00:00
Thomas Roberts c776fb63bc
[Experimental] Add custom validation hooks for additional checkout fields (#43435)
Co-authored-by: github-actions <github-actions@github.com>
2024-01-16 03:01:51 -08:00
Karol Manijak c531067daf
Improve the selector determining the products are loaded in Product Collection tests (#43464)
* Improve the selector determining the products are loaded in Product Collection tests

* Add changelog

* Update plugins/woocommerce/changelog/test-42038-make-product-collection-e2e-tests-more-robust

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2024-01-16 08:31:22 +01:00
Thomas Roberts 23db3eff69
[Experimental] Handle adding attributes during fields registration (#43379)
Co-authored-by: github-actions <github-actions@github.com>
2024-01-15 14:59:36 -08:00
Danny Dudzic 43be71a52f
[Experimental] Product Gallery: Update div elements to ul/li for better accessibility (#43612)
* Product Gallery: Update div elements to ul and li for better accessibility

* Product Gallery: Add changelog files

---------

Co-authored-by: roykho <roykho77@gmail.com>
2024-01-15 13:04:03 -08:00
Alexandre Lara 4b5c6982e4
[Experimental] Product Gallery block: Prevent page from scrolling when pop-up is open (#43378)
* Prevent body from scrolling when pop-up is open

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

* Add namespace to the modal-open css class

* Fix class name for the Product Gallery block

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-12 15:10:33 -03:00
Albert Juhé Lluveras aa661f2234
Fix Mini-Cart price disappearing on hover (#43550)
* Fix Mini-Cart price disappearing on hover

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-12 13:39:34 +01:00
Roy Ho 5d87130b43
[Experimental] Product gallery/remove default (#43487)
* Remove Product Gallery block as default

* Add beta label to Product Gallery block title

* Add changelog files
2024-01-11 18:03:58 -08:00
Sam Seay 5fdbe63530
[Experimental] Rename Collection Filters to Product Filters (#43363)
---------
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2024-01-12 00:27:33 +13:00
Thomas Roberts d8331dc3f1
Add additional information block for custom checkout fields (#43274)
Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-01-10 06:20:06 -08:00
Chris Lilitsas e24aabff04
Introduce a new block style for the Product Details block and set it as default (#42965)
* Introduce the minimal block style for productDetails block

* Change the default style in the template

* Change the default template when using the transform-to-blocks button

* Cleanup

* Organize CSS selectors

* Add opacity on hover

* Fix specificity and add explanation

* Cleanup

* Changelog
2024-01-10 14:08:48 +02:00
Karol Manijak 30888d7f1b
Product Collection: Rename "Inherit query from template" option and make description contextual (#43270)
* Update the copy of Inherit Query from template and make it contextual

* Add changelog
2024-01-10 12:40:05 +01:00
Daniel Dudzic 3be8264c5d
[Experimental] Product Gallery Pager: Improve accessibility (#43348)
* Product Gallery Pager: Improve accessibility

* Product Gallery Pager: Fix number pager styling
2024-01-09 10:48:49 +01:00
Alexandre Lara 65d9c6764c
[Experimental] Product Gallery block: Rename media setting to "Open pop-up when clicked" (#43302)
* Rename media setting to "Open pop-up when clicked"

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-08 16:58:27 -03:00
Karol Manijak 8d4f1cecec
Product Collection: Make sure all variations are taken into account when choosing collection (#43273)
* Make sure all variations are taken into account when choosing collection

* Add changelog
2024-01-08 10:55:42 +01:00
Tung Du aab950e27a
[Experimental] Add: Filter blocks migration (#43218)
* add: upgrade panel

* add: toolbar upgrade button

* add: downgrade panel

* chore: changelog

* refactor: move the upgrade component to `Collection Filters` block
2024-01-08 16:31:06 +07:00
Tung Du 823a35a9f2
[Experimental] Add: notice informing users about the usage of filter blocks (#43262) 2024-01-08 13:43:12 +07:00
Sam Seay 1eba9c62a8
Add lint config to blocks to lint imports (#43310) 2024-01-08 18:32:15 +13:00
Seghir Nadir e50e7799c0
Support additional fields in the Contact step for Checkout (#43088)
* add custom fields to contact info step

* fix linting

* add changelog

* adjust fields validation

* address review changes

* address sanization and validation

* fix billing address shape

* address schema issues

* cast address to array

* dont sanitize stuff that will validated

* fix linting issues

* fix cart unit test

* revert test

* fix the email issue
2024-01-05 18:35:28 +01:00
Roy Ho 8bbb35d63e
[Experimental] Product Gallery: Use @container rule to adjust overlay link count font size (#43294)
* Product Gallery: Use @container rule to adjust overlay link count font size

* Add changelogs

* Remove em from line height

* Make view all link smaller
2024-01-05 07:23:19 -08:00
Tung Du af2dedb137
[Experimental] Filter blocks: add the navigate function back (#43287)
* fix: add the navigate function back

* fix: move the navigate function to a dedicate file only for frontend use
2024-01-05 14:33:43 +07:00
Tarun Vijwani 2b0da27fd0
Update generic incompatibility notice (#42751)
* Move the switch to classic shortcode block button to separate component

- Move modal component file from incompatible-extension-notice component folder to switch-to-classic-shortcode-button folder.
- Rename modal component file to model-content component file.
- Move the switch to classic shortcode block button to separate component folder

* Update generic incompatibility notice

- Update the notice description.
- Add switch to classic shortcode block button to the notice.

* Fix margin in editor.scss

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

* Update class names in switch-to-classic-shortcode-button component

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

* Update plugins/woocommerce-blocks/assets/js/editor-components/switch-to-classic-shortcode-button/editor.scss

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

* Refactor SwitchToClassicShortcodeButton component

* Fix css lint erros

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

* Add type property to notice events

* Refactor switch to classic shortcode button logic

* Use isCart for switchButtonLabel and snackbarLabel

* Remove empty div in sidebar compatibility notice component

* Refactor switch to classic shortcode button event handling

* Adjust wording

* Adjust marging and readability

* Introduce union for SwitchToClassicShortcodeButtonProps type prop

* Simplify logic

* Use proposed text

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2024-01-05 10:47:34 +07:00
Karol Manijak 4128bff64c
Fix incorrect layout of Product Collection placeholder on Firefox (#43264)
* Fix incorrect layout of Product Collection placeholder on Firefox

* Add changelog
2024-01-04 11:20:57 +01:00
Sam Seay faf1c6f09e
[Experimental] Use variations to provide all the product filters wrapped by CollectionFilters block (#43216)
---------
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2024-01-04 18:33:59 +13:00
Tung Du de1d60ebe4
[Experimental] Add Widget support to new collection filter blocks (#43153) 2024-01-04 11:56:24 +07:00
Sam Seay 73160b3c41
[Experimental] Filter out filter options that would result in 0 products. (#43220) 2024-01-04 17:23:40 +13:00
Daniel Dudzic 7163d610e5
Product Gallery: Fix Large Image snapping position on window resize (#43251)
* Product Gallery: Fix Large Image snapping position on window resize

* Product Gallery Snap Fix: Add changelog
2024-01-03 17:46:43 +01:00
Sam Seay 187780905f
[Experimental] Use CheckboxList component in interactivity attribute filter (#43217) 2024-01-03 22:58:57 +13:00
Sam Seay 161bf51bd3
[Experimental] Allow overriding placeholder in interactivity Dropdown::render (#43211)
* add: multiple select support to attribute dropdown
* fix: remove active filter from dropdown
* chore: remove unused extractBuiltinColor

---------
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2024-01-03 20:52:45 +13:00
Tung Du 97e4c55aeb
[Experimental] Rating Filter block: fix wrong import path (#43198) 2024-01-03 09:31:50 +07:00
Sam Seay 5de0f4a274
[Experimental] Refactor the interactivity dropdown to remove dependence on FormTokenField (#43183)
* Also fix https://github.com/woocommerce/woocommerce/issues/43154
2024-01-02 17:13:27 +13:00
Tung Du bd9ddc830a
[Experimental] Add: QueryFilters class to calculate filter data for product queries (#42811)
* add: query filters count class

* chore: method comments

* refactor: rename class to QueryFilters

* fix: price filter count

* fix: price filter url

* chore: remove unnecessary transformation

* chore: remove unused meta query filter

* chore: put public methods on the top of the class

* fix: passing $wp_query

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* fix: stock query clause

* fix: handle and query type for attribute filter

* fix: ensure passing non null value to floor/ceil

* [Experimental] Collection Filter blocks: ensure the namespace is always rendered (#43112)

* fix: ensure the namespace is always rendered

* fix: target only wc queries

* fix: properly reset part of query to make new filter blocks work with Product Collection block
2024-01-01 10:18:50 +07:00
Albert Juhé Lluveras c58b0cf936
Fix error when adding to cart from the Product Collection block if Google Analytics plugin is enabled (II) (#43177)
* Revert "Trigger event `experimental__woocommerce_blocks-cart-add-item` in the SSR Product Button vis Interactivity API (#42946)"

This reverts commit 4fec136da1.

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-29 17:23:35 +01:00
Alexandre Lara 4efd2123a3
[Docs] Update links from WooCommerce.com to Woo.com for the Woo Blocks documentation (#43055)
* Update woocommerce.com URLs in documentation and code files

* Add changelog

* Fix github repository link in extend-rest-api-add-custom-fields.md

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

* Add github reporter (#42974)

* Add github reporter

* Add changelog

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>

* Fix product task redirect to support grouped and external products (#43051)

* Rearrange product redirection logic to better accept grouped and external produc types

* Add changelog

* Modify feedback modal actions (#43005)

* Adapt feedback modal actions

* Add changelogs

* Modify comments

* Fix tests

* Fix test

* Update class-wc-gateway-bacs.php (#43054)

* Update class-wc-gateway-bacs.php

Fix typo in textdomain

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>

* [Product Block Editor]: Add `Linked product` tab (#43009)

* add linked-products to group IDs

* add Linked Products tab

* tweak hideConditions condition

* changelog

* fix typo in doc comment

* Introduce a product type selection within the new experience (#41823)

* Create a relation between the product type and the product block template

* Add 'patterns' to name the kind of products that can be created for a specific template

* Resolve template using its id as a template query param

* Rename ProductEditPattern to ProductTemplate

* Rename get_patterns hook to woocommerce_product_editor_get_product_templates

* Return the list of templates to the client

* Set layout template events as array

* Register the layout template based on the product template or the post type in case of product variations

* Registering non supported product types

* Create and register the woocommerce/product-details-section-description block

* Add the product type to the section description

* Create product type selector

* Fix menu item style

* Highlight selected menu item

* Set the selected product template

* Set product template title to lowercase in the content description

* Rename blocks by blockTemplates under the AbstractBlockTemplate class

* Rename to woocommerce_product_editor_product_templates filter

* Remove product_template_ prefix from the supported_product_types map

* Rename get_formatted to to_JSON and convert the props to client side like

* Refactor get_product_templates

* Fix icon resolution

* Add a confirmation modal for unsupported product templates

* Add changelog files

* Remove product types using for testing

* Fix redirection when changing to a non supported product template

* Set the change button state to busy when it is saving the product

* Fix php linter errors

* Fix rebase conflict

* Move ProductTemplate to Automattic\WooCommerce\Admin\Features\ProductBlockEditor namespace

* Add the to_json definition to the BlockTemplateInterface

* Create default product template by custom product type if it does not have a template associated yet

* Fix some comments and product template creation validation

* Add support to load the product template icon from an external resource

* Fix php linter

* Fix the changelog description

* [Experimental] Interactivity Dropdown multi-select mode, ratings filter and introduce each directive (#42981)


---------
Co-authored-by: David Arenas <david.arenas@automattic.com>

* Introduce the transient files engine (#42877)

Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>

* Change marketplace install API request to POST instead of GET (#43033)

* Change marketplace install API to using POST instead of GET
* Fix linting error
* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>

* Prep trunk for 8.6 cycle (#43021)

Prep trunk for 8.6 cycle with version bump to 8.6.0-dev

Co-authored-by: WooCommerce Bot <no-reply@woo.com>

* Add Playwright tests for All Reviews, Reviews by Product and Reviews by Category blocks (#42903)

* Remove Reviews blocks Puppeteer tests

* Minor code cleanup

* Typos

* Create publishAndVisitPost() editor util

* Fix subcategories when importing products in Playwright and add reviews

* Add Reviews blocks tests in Playwright

* More typos

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

* Create a 'reviews' object in data.ts so we can store reviews data in one single place

* Update test so instead of creating a new post in each test, we go to the already-created post

* Add source comments to reviews data to match it with the script

---------

Co-authored-by: github-actions <github-actions@github.com>

* Release: Remove 8.5 change files (#43022)

Delete changelog files from 8.5 release

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
Co-authored-by: Alex López <alex.lopez@automattic.com>

* Delete changelog files based on PR 43033 (#43079)

Delete changelog files for 43033

Co-authored-by: WooCommerce Bot <no-reply@woo.com>

* Delete changelog files based on PR 43051 (#43081)

Delete changelog files for 43051

Co-authored-by: WooCommerce Bot <no-reply@woo.com>

* Interactive Price Filter: use `context` instead of `state` (#42980)

* feat: use context instead of state

* fix: temporary move the context to inner element for diffing to work

* fix: update context before navigation for optimistic UI

* Load google analytics gtag script asynchronously in WooCommerce Blocks (#43040)

Co-authored-by: github-actions <github-actions@github.com>

* set WOOCOMMERCE_BLOCKS_PHASE to 1 for the production build (#43074)

* set WOOCOMMERCE_BLOCKS_PHASE to 1 for the production build

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>

* Revert "Fix schedule sales error" (#43094)

Revert "Fix schedule sales error (#42700)"

This reverts commit 9b800aa179.

* [Product Block Editor]: add Linked product sections. First approach. (#43013)

* add Linked products, Upsell section

* changelog

* add Cross-lens section

* add links to the Upsell sections

* changelog

* fix lint issues

* fix lint issus

* fix linting issue :-|

* check whether the linked product group is defined

* [Product Block Editor]: introduce ShoppingBags component (#43042)

* add ShoppingBags component

* Add ShoppingBag story

* changelog

* Fix: Collection data being leaked between Collection Filters blocks (#43044)

* fix: CYS - change heading color (#43076)

* fix: CYS - change heading color

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>

* Delete changelog files based on PR 43074 (#43118)

Delete changelog files for 43074

Co-authored-by: WooCommerce Bot <no-reply@woo.com>

* [Product Block Editor]: fix feature flag to hide the Linked products (#43119)

* fix flag to hide/show product editor

* changelog

* Add changelog

---------

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Jonathan Lane <lanej0@users.noreply.github.com>
Co-authored-by: Jon Lane <jon.lane@automattic.com>
Co-authored-by: louwie17 <lourensschep@gmail.com>
Co-authored-by: Fernando Marichal <fernando.marichal@automattic.com>
Co-authored-by: Marc Guay <marc.guay@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Damián Suárez <rdsuarez@gmail.com>
Co-authored-by: Maikel David Pérez Gómez <maikel.perez@automattic.com>
Co-authored-by: Sam Seay <samueljseay@gmail.com>
Co-authored-by: Néstor Soriano <konamiman@konamiman.com>
Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
Co-authored-by: Kyle Nel <22053773+kdevnel@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: WooCommerce Bot <no-reply@woo.com>
Co-authored-by: Alex López <alex.lopez@automattic.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2023-12-29 12:28:11 -03:00
Manish Menaria 1ed5d0872a
Fix: Enable Pagination Block Visibility in Product Collection Block (#43132)
* Fix: Enable Pagination Block Visibility in Product Collection Block

This commit resolves an issue where the Pagination block was not visible in the block insertor within the Product Collection block.

- The core query pagination block name, initially hardcoded, is now declared as a constant `coreQueryPaginationBlockName` in `constants.ts`. This change not only improves code readability but also ensures consistency in using the block name across different files.

- In `index.tsx`, the `addProductCollectionBlockToParentOfPaginationBlock` utility function from `utils.tsx` is imported and executed. This function plays a crucial role in the fix. It dynamically adds the Product Collection block to the parent array of the Core Pagination block, ensuring the latter's visibility in the insertor when editing the Product Collection block.

- The utility function employs WordPress hooks and version checks to gracefully handle different WordPress environments. This careful approach maintains backward compatibility while addressing the current issue.

With these changes, merchants can now easily add a Pagination block from the insertor while working on the Product Collection block, enhancing the user experience and functionality.

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-29 15:45:29 +05:30
Sam Seay eabb27c72b
[Experimental] Add block text color support to interactivity filter blocks (#43068)
* [Experimental] Render headings as inner blocks of collection filters (#43109)
2023-12-29 03:06:35 +13:00
Niels Lange 8e7c5cca1c
Show rating stars for the cross-sells products (#43069)
* Show rating stars for the cross-sells products

* Fix typo introduced in #43116 (#43148)

* Fix typo introduced in #43116

* Add changefile(s) from automation for the following project(s): @woocommerce/product-editor

---------

Co-authored-by: github-actions <github-actions@github.com>

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-28 16:20:07 +07:00
Karol Manijak 37155abb0c
New flow of adding Product Collection and basic set of Collections (#42696)
* Migrate PR to Core

* Migrate test changes

* Add Custom Collection with inherit query attribute disabled

* Update copy of Product Catalog collection

* Don't choose default active collection in polaceholder and remove highlight

* Remove inherit query option from inspector controls

* Add collection names to Product Catalog and Custom one

* Unify Collection Chooser between Modal and Placeholder

* Bring back util removed by accident

* Replace the translations domain with woocommerce

* Remove leftovers after merge

* Add pagination and no results to Product Catalog and Custom collections

* Revert textdomain change

* Fix lint error

* Add changelog entry

* Change collection label

* Bring back Inherit query from template

* Remove Custom collection and bring back single Product Collection

* Simplify applying collection

* Make sure Inherit query from template is enabled in archive templates by default and disbaled in posts/pages

* Change incorrect Playwright locator

* Add test for Product Catalog inheriting the query in product archive

* Add tests for recommendation collection hiding the predefined filters

* Add reviews to multiple products

* Update expected products in Top Rated

* Remove rating creation in test env and skip undeterministic tests

* Add skip to Best Sellers test

* Update README.md

* Add more keywords to collections, like 'product collection' to recommendation collections

* Rephrase the README note about Collections registration

* Simplify types

* Rename unchangeableFilters to hideControls

* Fix typo in file name

* Remove 'pattern' references from toolbar files

* Replace hardcoded SCSS color with wc variable

* Remove changelog file from different PR

* Move hideControls to Product Collection ayttributes

* Improve responsiveness of columns in Product Collection Placeholder

* Use admin color pallette in Product Collection Placeholder

* Move Inherit query from template to the top of Inspector Controls

* Change the Collection prefix to woocommerce rather than woocommerce-blocks

* Simplify Placeholder and Modal styles
2023-12-27 11:07:27 +01:00
Tung Du 0c5d01a6ac
Interactive Price Filter: use `context` instead of `state` (#42980)
* feat: use context instead of state

* fix: temporary move the context to inner element for diffing to work

* fix: update context before navigation for optimistic UI
2023-12-22 22:05:31 +07:00
Sam Seay 3eeeddfdb3
[Experimental] Interactivity Dropdown multi-select mode, ratings filter and introduce each directive (#42981)
---------
Co-authored-by: David Arenas <david.arenas@automattic.com>
2023-12-22 13:34:28 +13:00
Manish Menaria ba4f3d4d29
Add price range filter to Product Collection block (#42858)
* Add price range filter to Product Collection block

This update introduces a price range filter feature to Product Collection. Changes include:

1. Constants Update:
   - Added `priceRange` as undefined in `DEFAULT_QUERY` and `DEFAULT_FILTERS` in `constants.ts`.

2. Style Adjustments:
   - Added CSS for `.wc-block-product-price-range-control` in `editor.scss` to align the input text to the end.

3. Component Integration:
   - In `inspector-controls/index.tsx`, the `PriceRangeControl` component is now imported and integrated.

4. New Components:
   - `PriceTextField.tsx` and `PriceRangeControl/index.tsx` have been created to handle price range inputs in the Product Collection block.

5. Backend Integration:
   - `PriceRange` interface added in `types.ts` for type support.
   - In `ProductCollection.php`, a filter (`add_price_range_filter`) is added to modify the main query based on the price range, including adjustments for tax considerations.

Overall, this enhancement allows users to filter products within a specific price range. The backend adjustments ensure that the filtering respects tax settings and displays accurate prices.

* Fix formatting

* Fix: Price range filter not working on Editor

* Improve: Share logic between Frontend & Editor

* Add changelog

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* Remove duplicate changelog file

* Enhanced Input Control for Price Fields

Key changes include:

1. **Switch to Input Control**: Replaced the NumberControl component with the more versatile InputControl. This offers better handling of currency formatting and user input.

2. **Currency Formatting Logic**: Added robust logic for formatting numbers according to the currency settings. This includes handling thousand separators, decimal places, and currency symbols.

3. **String-to-Number Conversion**: Implemented a function to convert user-entered strings back to numbers, accounting for currency symbols and separators. This ensures accurate parsing of user input for processing.

4. **Input Handling Improvements**: Modified the onChange handlers for minimum and maximum price inputs. Now, they correctly handle edge cases like undefined or zero values, maintaining consistency in the user interface and data processing.

* Refactor price range query handling

1. Introduction of a new method `get_price_range_query_args()` to encapsulate the logic for handling price range queries, especially for the two edge cases:
   - Prices excluding tax displayed including tax.
   - Prices including tax displayed excluding tax.

2. Removal of direct conditionals in the `get_query_results()` method, replacing them with a call to the new `get_price_range_query_args()` method. This makes the code more modular and easier to understand.

This refactor enhances readability and maintainability of the code, ensuring that special cases in price range filtering are handled more effectively.

* Remove unnecessary suffix prop

* Refactor PriceTextField formatting logic for currency

1. Conditional application of thousand separators: The code now checks for the existence of `currency.thousandSeparator` before applying it. This prevents potential errors when the separator is undefined.

2. Simplified decimal separator handling: Introduced a fallback for the decimal separator, defaulting to a period ('.') if not specified by the currency settings.

3. Enhanced readability and documentation: Added comments to clarify the purpose of code blocks, especially where currency symbols are added or removed, and where value normalization occurs.

4. Function renaming for clarity: Renamed `formatValueWithCurrencySymbol` to `formatCurrency`, which better reflects its purpose.

* Fix onBlur issue with PriceTextField component

Refactored the PriceTextField component to utilize useState for better state management. This change introduces a local state variable, 'newValue', to store the current value. The state updates occur in the handleOnChange function, ensuring that the component's state is managed efficiently. Additionally, a new function, handleOnBlur, is implemented to handle the onBlur event, updating the component's state when focus is lost. The handleEnterKeyPress function captures the 'Enter' key press, providing a more user-friendly experience by allowing users to confirm their input with the Enter key.

* Fix linting error

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-21 12:45:20 +05:30
Niels Lange 49d6b2058a
Link cross-sells product image to product page (#42904)
* Link cross-sells product image to product page

* Add changelog entry

---------

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-12-21 11:13:47 +07:00
Daniel Dudzic 7122669d44
Product Gallery: Simplify the Product Gallery Pop-up (#42797)
* Product Gallery Pop-up: Simplify the pop-up for v1

* Product Gallery Pop-up: Update the Product Gallery template part contents

* Product Gallery Pop-up: Add changelog entry

* Product Gallery: Fix CSS linting errors

* Product Gallery Pop-up: Add an additional changelog entry

* Product Gallery Pop-up: Update changelog message

* Product Gallery Pop-up: Fix logic error
2023-12-20 19:03:01 +01:00
Karol Manijak 4fec136da1
Trigger event `experimental__woocommerce_blocks-cart-add-item` in the SSR Product Button vis Interactivity API (#42946)
* Trigger event experimental__woocommerce_blocks-cart-add-item in the SSR Product Button vis Interactivity API

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

* Update code comment and add reference to the followup issue

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-20 13:50:43 +01:00
Thomas Roberts 7768ef5b5c
Prevent "Use same address for billing" being checked by default if addresses differ (#42967)
* Don't access the keys of what is now just an array

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-20 14:47:59 +07:00
Albert Juhé Lluveras 06e5b43d52
Reviews by Product block: fix encoded in input aria-label (#42944)
* Reviews by Product block: fix encoded in input aria-label

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-19 13:05:18 +01:00
Tung Du c651b10b3d
Add: Active Filters block powered by Interactivity API (#42008)
* add: active filters block

* update text domain

* chore: linting

* use template string instead of concat

* add experimental flag to register block type calls

* chore: update comments

* feat: register active rating filter data

* fix: unique navigation id when collection filters are added outside product collection

* fix: active filter rating id

* fix: return the href

* chore: phpcs
2023-12-19 17:29:33 +07:00
Tarun Vijwani 82a6611144
Move the switch to classic shortcode block button to separate component (#42724)
* Move the switch to classic shortcode block button to separate component

- Move modal component file from incompatible-extension-notice component folder to switch-to-classic-shortcode-button folder.
- Rename modal component file to model-content component file.
- Move the switch to classic shortcode block button to separate component folder

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

* Update class names in switch-to-classic-shortcode-button component

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

* Update plugins/woocommerce-blocks/assets/js/editor-components/switch-to-classic-shortcode-button/editor.scss

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

* Refactor SwitchToClassicShortcodeButton component

* Fix css lint erros

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2023-12-19 11:44:09 +04:00
Daniel Dudzic 11b8276a29
Product Gallery: Add Group block labels (#42868)
* Product Gallery: Add Group block labels

* Product Gallery Group Labels: Add changelog entry

* Product Gallery Group Labels: Add an additional changelog entry

* Product Gallery Group block labels: Update changelog message
2023-12-18 22:24:30 +01:00
Seghir Nadir 8ecfcfb9a0
Add Checkbox support for Additional Fields in Checkout Block (#42780)
* Introduce Additional Fields API for Checkout Block https://github.com/woocommerce/woocommerce-blocks/pull/12073

* revert test to what it was

* Default to text, if the type supplied is not supported throw an error

* Add type for options

* Return null if somehow the select made it through without options

* Make select fields type enum and add options to schema

* Lint fixes

* Update plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/address-form/address-form.tsx

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

* Update plugins/woocommerce/src/Blocks/Domain/Services/CheckoutFields.php

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

* Update checks to log errors and fail gracefully

* Add field id to class names

* Fix lint error

* Fix short array use

* Introduce Additional Fields API for Checkout Block https://github.com/woocommerce/woocommerce-blocks/pull/12073

* Default to text, if the type supplied is not supported throw an error

* Lint fixes

* Introduce Additional Fields API for Checkout Block https://github.com/woocommerce/woocommerce-blocks/pull/12073

* add support for registering checkboxes

* remove extra error log

* add styling

* fix rebase conflit

* fix rebase conflit 2

* fix linter errors

* address review comments

* add warning for checkbox

* fix changes

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2023-12-18 13:21:36 +01:00
Alba Rincón d5a46a1cfb
Remove padding for the products query when background is added (#42817)
* Remove padding for the products query with background

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
2023-12-18 11:14:43 +01:00
Sam Seay 6d4c69850c
Experimental Collection Rating Filter (#41999)
Introduce Experimental Collection Rating Filter, CheckboxList interactivity component.
2023-12-18 22:47:24 +13:00
Roy Ho d15bfd2398
Product Gallery: reset main image when variations are cleared (#42830)
* Product Gallery: reset main image when variations are cleared

* Add changelog for woo core

* Update event name to be more descriptive
2023-12-15 13:22:10 -08:00
Thomas Roberts 0c6a943c42
Add select field type for custom checkout fields (#42758)
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
2023-12-15 06:39:22 -08:00
Seghir Nadir 12572ce08c
Introduce Additional Fields extensibility API (#42695)
* Introduce Additional Fields API for Checkout Block https://github.com/woocommerce/woocommerce-blocks/pull/12073

* add changelog

* Auto load the Blocks/Domain/Services/functions.php file

* add changelog

* revert test to what it was

* Update text domain for translations

* Ensure address data is added on the cart block too

* fix lint problem

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2023-12-15 13:45:38 +01:00
Roy Ho 255f1ff919
Product gallery/legacy/transform (#42719)
* Product Image Gallery: Add transform to Product Gallery block

* Single Product Template: Transform to blocks with new Product Gallery block

* Ensure we first check for block existance

* Add changelog

* Add/delete changelog file
2023-12-14 05:47:48 -08:00
Mike Jolley 2abd0422a8 Allow HTML in built in payment method descriptions 2023-12-13 14:37:21 +00:00
Christopher Allford ec9b7852f9
Fixed Blocks Linting Errors (#42727) 2023-12-12 15:05:20 -08:00
Ron Rennick 4fddface47
update text domain in plugins/woocommerce-blocks (#42717)
Co-authored-by: Ron Rennick <ronald.rennick@automattic.com>
2023-12-12 14:12:36 -08:00
Christopher Allford e34361695d Fixed Image Asset Paths 2023-12-09 21:26:49 -08:00
Christopher Allford cf357e809b Fixed Blocks Asset Constant Path 2023-12-09 21:20:21 -08:00
Christopher Allford 1d056b3b37 Update Blocks Text Domain 2023-12-09 05:44:54 -08:00
Arsany Benyamine 0672f73723 replace old props with variant prop (https://github.com/woocommerce/woocommerce-blocks/pull/11933)
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
2023-12-09 00:30:33 +01:00
Tarun Vijwani 62dbd8f70d Convert PaymentMethodErrorBoundary to Class component (https://github.com/woocommerce/woocommerce-blocks/pull/12088)
* Convert PaymentMethodErrorBoundary to class component

* Remove unused expressPaymentMethodId variable
2023-12-08 16:28:55 +00:00
Mike Jolley 1535caac84 Update product category controls to use typescript (https://github.com/woocommerce/woocommerce-blocks/pull/11909)
* ProductControl is now defined in typescript. Remove todo

* Update components to typescript

* Update lifecycle test
2023-12-08 11:39:31 +00:00
Karol Manijak 31905b97f2 Make Featured Category centred horizontally (https://github.com/woocommerce/woocommerce-blocks/pull/12063) 2023-12-08 10:11:34 +01:00
Roy Ho 4992b77e49 Remove styling from sale badge (https://github.com/woocommerce/woocommerce-blocks/pull/12077)
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
2023-12-07 18:24:18 -08:00
Tarun Vijwani 29b4217f15 Update the border colors in the Cart and Checkout blocks (https://github.com/woocommerce/woocommerce-blocks/pull/11474)
* Change border color to Gutenberg 100 for Cart and Checkout blocks

* Change form input color to Gutenberg 900 for Cart and Checkout blocks

* Fix additional border colors of Checkout block

* Update borders and form field colors in Cart Block

* Change border color to $universal-border-light

* Change border color for cart line items to $universal-border-light

* Change  form input fields border color to $universal-border-dark

- Add $universal-border-dark color variable for woocommerce/woocommerce-blocks#1e1e1e on white.

* Fix colors of text area border and form steps

* Change  form input fields border color to $universal-border-dark

- Add $universal-border-dark color variable for woocommerce/woocommerce-blocks#1e1e1e on white.

* Fix form steps

* Update universal dark border rgba value

- Update universal dark border rgba value from rgba(0, 0, 0, 0.882) to rgba(17, 17, 17, .80) to keep it consistent with universal-border colors

* Update $universal-border-light color

* Update the opacity of the borders

* Update the border color to rgba (17, 17, 17, 0.12)

* Roll back $universal-border-light value to the original value: 0.115

* Remove Opacity and pass it as argument in with-translucent-border

- We have with-translucent-border option that accepts border and opacity for pseudo elements.

* Remove additional spaces

* Replace with-translucent-border with normal border

- Since we're are not mixing the opacity to the border color so we don't need to use mixin with-translucent-border.

* Fix applied css and add low contrast Color usage details

-  Fix minor CSS as per the standards.
- Add comments for universal border colors that they're low contrast colors and should be used for decorative elements only

* Fix border gap and double border for multiple shipping packages

* Fix payment method borders and Cart line items borders

- Change border bottom to border-top for cart line items.
- Fix payment method radio control borders.

* Fix local pickup border

- Local pickup was using  with-translucent-borders so it has some opacity, changed it to border-bottom.

* Add border-bottom to cart items

* Remove additional border from Cart items

* Fix radio and checkbox borders as per the design

* Fix shipping method borders and background color as per the design.

* Force align left on the description for the local pickup options.

* Update border color in quantity selector component

* Fix Shipping options radio selection alignment

- Add left padding to wc-block-components-shipping-rates-control__package element.

* Update colors and variables

* Change checkbox and radio button colors

- Change checkbox and radio button colors from  rgba(25, 23, 17, 0.3) to  rgba(25, 23, 17, 0.48).

* Remove bottom property from express payment style
2023-12-07 21:37:48 +04:00
Niels Lange ab766273ff Fix font weight of cart totals title in site editor (https://github.com/woocommerce/woocommerce-blocks/pull/12051)
* Fix font weight of cart totals title in site editor

* Set explicit font-weight for th in cart line items
2023-12-07 15:55:47 +07:00
Mike Jolley 14cdc5e6f5 Use locale in isAddressComplete (https://github.com/woocommerce/woocommerce-blocks/pull/11888) 2023-12-06 16:33:15 +00:00
Karol Manijak 71640ef347 Restructure Product Collection editor files (https://github.com/woocommerce/woocommerce-blocks/pull/11981)
* Move Product Collection editor experience components into /edit directory

* Move Product Collection Inner Blocks structure to constants

* Improve the Product Collection's variations names
2023-12-06 15:50:24 +01:00
Niels Lange 69ef1b96e8 Enable new notice styles for all themes (https://github.com/woocommerce/woocommerce-blocks/pull/12043)
* Enable new notice styles

* Fix Twenty Twenty-One button background color issue
2023-12-06 15:46:22 +07:00
Luigi Teschio 1f410bdd04 fix: Product Collection: Featured Products 5 Columns improve spacing (https://github.com/woocommerce/woocommerce-blocks/pull/12041) 2023-12-06 09:05:49 +01:00
Roy Ho 6df846d11a Product gallery/fix/view all link (https://github.com/woocommerce/woocommerce-blocks/pull/11995)
* Center align view all link

* Add thumbnail count specific styling

* Product Gallery Thumbnails: Improve the responsiveness of the View All overlay text

---------

Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
2023-12-05 16:25:41 +01:00
Albert Juhé Lluveras 9371318292 Revert "Remove unused Add to Cart product element (https://github.com/woocommerce/woocommerce-blocks/pull/11948)" (https://github.com/woocommerce/woocommerce-blocks/pull/12033)
This reverts commit 6a397d65f9.
2023-12-04 17:28:58 +01:00
Darren Ethier 795f008952 Implement the Block Hooks API to automatically inject the Mini-Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/11745)
* Change the default for Mini Cart block

The Block Hooks API currently doesn’t allow for setting the default state of the block injected into content so this ensures the mini-cart block has a better default state for injection. The current default (displaying total value in cart) takes up more width increasing the risk of poor layout.

* Utilize Block Hooks to automatically inject mini-cart block.

* include experimental prefix on filters

* Fix filter name.

* remove experimental prefix.

On thinking about this, I don’t think these need to be experimental. They are intentionally provided as escape hatches for hosts/themes that want to opt-in/out so we’ll have to support them when this is shipped (at least until its no longer needed!)

* fix variable name!

* fix unit tests because of new default

* remove another incorrect text expectation

Defaults for the block affect this expectation.

* fix E2E tests

* Mini Cart Block: improve E2E test

* fix: improve check for the Product Collection block

---------

Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2023-12-04 17:27:27 +01:00
Tung Du 2bc48e4e4a Fix: Ensure new filter blocks work with inherited query context (https://github.com/woocommerce/woocommerce-blocks/pull/12022)
* make the collection filters block available globally

* make query optional

* remove unnecessary editor contextual
2023-12-04 21:05:09 +07:00
Niels Lange 1c7d995e97 Decrease modal width (https://github.com/woocommerce/woocommerce-blocks/pull/12003) 2023-12-02 02:54:39 +00:00
Seghir Nadir 226d7de6d6 import checkbox from single place (https://github.com/woocommerce/woocommerce-blocks/pull/12015) 2023-12-01 19:40:04 +01:00
Seghir Nadir 42ee5522f9 Remove page view tracking in favor of jetpack (https://github.com/woocommerce/woocommerce-blocks/pull/12010) 2023-12-01 08:26:01 -08:00
Paulo Arromba 4e6fb96c8e Update Feedback link on Cart and Checkout blocks (https://github.com/woocommerce/woocommerce-blocks/pull/12006)
* Update feedback link

* Remove default url link, and make the param required
2023-12-01 13:01:42 +00:00
Paulo Arromba a07e3815c1 Update feedback link (https://github.com/woocommerce/woocommerce-blocks/pull/11999) 2023-12-01 10:16:57 +00:00
Manish Menaria 630c79adf7 Product Collection - Fix HTML Entity Decoding in Taxonomy Controls (https://github.com/woocommerce/woocommerce-blocks/pull/11982) 2023-12-01 15:11:41 +05:30
Niels Lange 7ea98576bc Limit number of visible incompatible extensions in sidebar notice (https://github.com/woocommerce/woocommerce-blocks/pull/11972)
* Limit number of visible incompatible extensions in sidebar notice

* Adjust link text

* Ensure text-decoration works in Safari

* Minor CSS tweaks

* Refactor constant names

* Adjust chevron position for opened state

* Revert "Adjust chevron position for opened state"

This reverts commit ff5142427738626837be887dd8d7e5d94c2432d4.
2023-11-30 06:37:19 -08:00
Niels Lange e1efae2fe2 Improve readability of order note (https://github.com/woocommerce/woocommerce-blocks/pull/11944) 2023-11-29 21:39:07 +07:00
Albert Juhé Lluveras a8c44eb4c7 Reviews by Product: fix reviews count not appearing in product selector (https://github.com/woocommerce/woocommerce-blocks/pull/11976) 2023-11-29 11:13:18 +01:00
Sam Seay dea8b734a6 Migrate attribute-filter block to use new interactivity store API (https://github.com/woocommerce/woocommerce-blocks/pull/11911) 2023-11-29 18:27:38 +13:00
Sam Seay 58c6339ac9 Update interactivity price filter block to use latest Interactivity Store API (https://github.com/woocommerce/woocommerce-blocks/pull/11943) 2023-11-29 17:04:35 +13:00
Karol Manijak 6a397d65f9 Remove unused Add to Cart product element (https://github.com/woocommerce/woocommerce-blocks/pull/11948)
* Remove unused Add to Cart product element

* Remove entry about Product Add to Cart product element from MD file
2023-11-28 08:34:12 +01:00
Karol Manijak 2ab440b806 Reorganise Columns controls and fix undefined problem in Product Collection settings (https://github.com/woocommerce/woocommerce-blocks/pull/11937)
* Reorganise Columns controls and fix undefined problem in Product Collection settings

* Remove type condition in hasValue of Columns control

* Adjust the E2E tests locator to new changes
2023-11-28 08:33:31 +01:00
Niels Lange 5f0c4726a8 Investigate E2E CI caching issue (https://github.com/woocommerce/woocommerce-blocks/pull/11874)
* Try env:restart instead of env:start

* Change env:restart to env:start again

* Try env:restart instead of env:start

* Change env:restart to env:start again

* Adjust heading level of cart and checkout template

* Replace button selector with label selector

* Try env:restart instead of env:start

* Change env:restart to env:start again

* Ensure to close welcome guide modal

* Adjust heading level of default template content

* Try env:restart instead of env:start

* Change env:restart to env:start again

* Try env:restart instead of env:start

* Change env:restart to env:start again

* Address existing TS issues

* View template in edit mode

* Keep certain tests skipped

* Fix broken tests after addressing TS issues
2023-11-28 14:16:45 +07:00
Roy Ho 58c130af79 Remove unneeded block type check (https://github.com/woocommerce/woocommerce-blocks/pull/11964) 2023-11-27 13:11:51 -08:00
Mike Jolley 4a13e5faf0 Switch to NoticeBanner component inside Store Notices Block placeholder (https://github.com/woocommerce/woocommerce-blocks/pull/11920) 2023-11-27 13:43:42 +00:00
Arsany Benyamine fa1f2896fb replace Stories root Dir to "External Components" (https://github.com/woocommerce/woocommerce-blocks/pull/11910) 2023-11-27 04:14:58 -08:00
Alba Rincón 1c325c3ea9 Convert to tsx and replace proptypes by ts definitions (https://github.com/woocommerce/woocommerce-blocks/pull/10471)
* Convert to tsx and replace proptypes by ts definitions

* Fix imports

* Fix noReviewsPlaceholder type

* Fix ts errors

* Use createHigherOrderComponent in withReviews

* Revert hoc change

---------

Co-authored-by: Niels Lange <info@nielslange.de>
2023-11-27 12:08:17 +01:00
Manish Menaria 53944beeb3 [Product Collection] Fix: HTML entity decoding for product names in Hand-Picked Products (https://github.com/woocommerce/woocommerce-blocks/pull/11927)
* Add HTML entity decoding for product names in Hand-Picked Products control

In the Hand-Picked Products control within the product-collection inspector controls, a function for decoding HTML entities in product names has been added.

- A new utility function `decodeHTMLEntities` has been implemented. This function decodes HTML entities in a string, ensuring that special characters are correctly displayed in their human-readable form.
- The `transformTokenIntoProductName` function has been updated to utilize `decodeHTMLEntities`. Now, when a product name is fetched (either directly as a token or via a product ID), the HTML entities within the name are decoded.
- This enhancement ensures that product names containing characters like ampersands or other HTML entities are accurately displayed in the UI.

This change improves the readability and accuracy of product names within the Hand-Picked Products control, enhancing the user experience for store managers using WooCommerce Blocks.

* Update label and hide description

This commit updates the `HandPickedProductsControl` component. Specifically, the user-facing label for product selection has been changed from 'Pick some products' to 'Hand-picked Products'. Additionally, the `__experimentalShowHowTo` property has been added with a `false` value, to hide description. Corresponding changes have been made in the E2E test file `product-collection.block_theme.spec.ts`, where the filter name is updated to match the new label.

* Refactor: Replace custom HTML entity decoder with `@wordpress/html-entities`

Rationale:
- The shift to `@wordpress/html-entities` aligns with standard WordPress practices, ensuring consistency across the platform.
- Enhances maintainability by relying on a well-supported library rather than custom code.
- Simplifies the codebase by removing a redundant utility function.

This change enhances the robustness of our code and aligns with best practices in WordPress development.
2023-11-27 12:27:04 +05:30
Sam Seay 1cd4df5b19 Migrate interactivity stock filter to new store API, add improvements and bugfixes (https://github.com/woocommerce/woocommerce-blocks/pull/11827) 2023-11-27 17:26:01 +13:00
Daniel Dudzic 590263543f Product Gallery Thumbnails: Add support for cropping (https://github.com/woocommerce/woocommerce-blocks/pull/11718)
* Product Gallery Thumbnails: Refactor sizing in the editor and the front end

* Product Gallery Thumbnails: Change default vertical alignment to top and better control the width of the thumbnails

* Product Gallery Thumbnails: Fix thumbnails cropping based on the 'Crop images to fit' setting

* Product Gallery Thumbnails: Revert thumbnails styling from woocommerce/woocommerce-blocks#11665

* Product Gallery Thumbnails: Update the default value of the cropImages setting to false
2023-11-24 23:49:44 +01:00
Daniel Dudzic 38b0001735 Product Gallery Thumbnails: Fix overflow issues and improve responsiveness (https://github.com/woocommerce/woocommerce-blocks/pull/11665)
* Product Gallery Thumbnails: Refactor sizing in the editor and the front end

* Product Gallery Thumbnails: Change default vertical alignment to top and better control the width of the thumbnails

* Product Gallery Thumbnails: Restrict the bottom position thumbnails width based on the total number of thumbnails set

* Product Gallery: Remove hardcoded width for Thumbnails and the Large Image and update the width inside of the Dialog

* Product Gallery Thumbnails: Introduce thumbnails scaling based on the number of thumbnails

* Product Gallery Thumbnails: Fix editor thumbnails scaling

* Product Gallery Thumbnails: Remove unused column gap variable

* Product Gallery Thumbnails: Fix styling for vertical images

* Product Gallery: Remove the unused editor.scss file

* Product Gallery: Fix the placement of the Thumbnails block in the block template

* Product Gallery Dialog: Reset changes to the dialog

* update @wordpress/e2e-test-utils-playwright package

* don't update node version

* remove waitForSiteEditorFinishLoading function

* use visitSiteEditor util

* Product Gallery Thumbnails: Add code comments

* Product Gallery Thumbnails E2E: Fix the test checking the default position of the thumbnails

* Product Gallery E2E: Fix the test checking if the cropping setting works correctly

* Product Gallery Thumbnails: Hide the Thumbnails block if there aren't at least 2 thumbnails to display

---------

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2023-11-24 21:31:02 +01:00
Sam Seay 9168b47f33 Translate the prefixes passed to post-terms in product-meta. (https://github.com/woocommerce/woocommerce-blocks/pull/11811) 2023-11-24 17:33:28 +13:00
Albert Juhé Lluveras c422227341 Fix an issue that caused the Order by select in Reviews blocks to always be disabled (https://github.com/woocommerce/woocommerce-blocks/pull/11918) 2023-11-23 12:59:14 +01:00
Karol Manijak b5e91ee460 Enable shrink columns option in Product Collection by default (https://github.com/woocommerce/woocommerce-blocks/pull/11821)
* Enable shrink columns option in Product Collection by default

* Improve tests about responsiveness

* Make regex allowing for floating pixels

* Related products should not use sticky and author attribute or have hardcoded queryId

* Bring back properties for Related Products as it's based on Propducts block, not Product Collection

* Enable shrink columns to fit by default in patterns
2023-11-23 10:10:19 +01:00
Karol Manijak 41d5a4bda6 Prevent shrinkColumns value when switching the layout type of Product Collection (https://github.com/woocommerce/woocommerce-blocks/pull/11905) 2023-11-23 08:17:35 +01:00
Roy Ho 82583fa3fb Don't register or unregister if block can't be found (https://github.com/woocommerce/woocommerce-blocks/pull/11872) 2023-11-22 12:50:56 +00:00
Niels Lange a0592778b6 Update notice for default cart and checkout (https://github.com/woocommerce/woocommerce-blocks/pull/11861)
* Update notice for default cart and checkout

* Show full translatable string
2023-11-21 21:23:13 +07:00
Thomas Roberts 409988881b Move `CheckboxControl` to components package and leave alias in checkout package (https://github.com/woocommerce/woocommerce-blocks/pull/11662) 2023-11-21 10:55:42 +00:00
David Arenas 9e9f0341e2 Interactivity API: implement the new `store()` API (https://github.com/woocommerce/woocommerce-blocks/pull/11071)
* Sync Interactivity API code with Gutenberg

* New store() API

* Store raw actions

* Update wc-interactivity-store implementation

* Replace `wc_store` with `wc_initial_state`

* Parse and populate initial state

* Allow store parts in `store()`

* Accept namespaces in directive paths

* Add $$namespace to directives' object values

* Make namespace parsing more robust

* Use DeepPartial type for store parts

* Do not pass `rawStore` to `afterLoad` callbacks

* Simplify `store()` a bit

* Implement `privateStore()`

* Sync context directive with Gutenberg

* Refactor scope and extract getters per scope

* Add namespace to getters and actions

* Remove current privateStore implementation

* Remove `afterLoad` option from `store`

* Use same proxy handlers for ns, getters and actions

* Set scope inside `evaluate`

* Refactor proxy handlers

* Improve types a bit

* Catch errors in async actions

* Implement stacks for scopes and namespaces

* Implement `getElement`

* Change directives object structure

* Remove unnecessary import

* Implement private stores

* Return value from sync actions

* Minor optimizations and improved comments

* Don't use async inside `data-wp-watch`

* Use a single Provider in context directive

* Remove DeepPartial type

* Do not check if element exists

* Add the `current` prop of state inside the scope

* Move getters outside scope

* Fix wc-key assignment

* Fix missing `navigate` in directives

* Fix namespace not being picked in the same element

* Deep merge raw stores instead of proxied ones

* Fix namespace assignment

* Allow forward slashes in namespaces

* Migration of Product Collection and Product Button blocks to the new `store()` API (https://github.com/woocommerce/woocommerce-blocks/pull/11558)

* Refactor Product Button with new store() API

* Use `wc_initial_state` in Product Button

* Fix namespace

* Remove unnecessary state

* Test namespaces in directive paths

* Add test context with namespace

* Simplify woo-test context

* Move addToCart and animations to a file

* Do not pass `rawStore` to `afterLoad` callbacks

* Move callbacks and actions back to the main file

Because the animation was broken.

* Remove selectors in favor of state

* Use default ns in `getContext` for state and actions

* Remove `afterLoad` callback

* Remove unnecessary ns

* Fix getContext in add-to-cart

* Replace namespace and delete unnecessary store

* Pass context types only once

* Use an alternative for requestIdleCallback

* Add previous react code for notices

* Add namespace to Product Collection block

* Replace getTextButton with getButtonText

* Add block name to the ProductCollection namespace

* fix style HTML code

* Remove circular deps error on the Interactivity API

* Product Gallery block: Migrate to new Interactivity API store (https://github.com/woocommerce/woocommerce-blocks/pull/11721)

* Migrate Product Gallery block to new Interactivity API store

* Fix some references

* Add missing data-wc-interactive

* Fix an additional namespace

* Remove unnecessary click handler

* Dialog working

* Refactor action names

* Reindex PHP array

There was some missing indexes, which turned the array into an object in JS.

* Remove unused event handlers

* Move next/previous logic to external function

* Move StorePart util to the types folder

* Rename namespace to `woocommerce/product-gallery`

* Undo product collection namespace renaming

* Remove unnecessary namespace

* Don't hide the large image on page load

* Minor refactorings

* Fix eslint error

* Fix php cs errors with spacing and double arrows alignment

* Disable no-use-before-define rule for eslint

* Disable @typescript-eslint/ban-types rule for eslint

* Fix parsed context error in e2e tests

* Fix context parser for Thumbnail image

* Move store to the top of the frontend file

* Add interactivity api utils to the @woocommerce/utils alias

* Replace deprecated event attribute

---------

Co-authored-by: Luis Herranz <luisherranz@gmail.com>
Co-authored-by: David Arenas <david.arenas@automattic.com>
Co-authored-by: roykho <roykho77@gmail.com>

---------

Co-authored-by: David Arenas <david.arenas@automattic.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: roykho <roykho77@gmail.com>

* Fix error when closing product gallery dialog with keyboard escape key

* use wc_initial_state instead of wc_store

---------

Co-authored-by: Luis Herranz <luisherranz@gmail.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: roykho <roykho77@gmail.com>
2023-11-21 11:46:15 +01:00
Tung Du 3b31aa715c add: default template for Collection Filters block (https://github.com/woocommerce/woocommerce-blocks/pull/11805) 2023-11-21 16:25:43 +07:00
Tung Du 182e821539 MVP: Attribute filter block powered interactivity API (https://github.com/woocommerce/woocommerce-blocks/pull/11749)
* Update Interactivity API JS files

* Disable TS checks in the Interactivity API for now

* Add new SSR files

* Replace wp_ prefixes with wc_ ones

* Replace wp- prefix with wc-

* Replace guternberg_ prefix with woocommerce_

* Remove file comments from Gutenberg

* Rename files with `wp` prefix

* Fix code to load Interactivity API php files

* Remove TODO comments

* Replace @wordpress with @woocommerce

* Update Webpack configuration

* Fix directive prefix

* Remove interactivity folder from tsconfig exclude

* Add client-side navigation meta tag code

* Remove unneeded blocks.php file

* Fix store tag id

* Register Interactivity API runtime script

* Fix Interactivity API runtime registering

* Add Simple Price Filter block

* Remove all files related to directive processing in PHP

* Use values directly for SimplePriceFilter SSR

* Reset pages to 0 when changing filter

Note: we also need to do this with `/page/x`

* wip

* phpcs

* register price filter as inner block

* try: render block using save

* add types

* use min range var instead of 0

* inject dynamic data

* query price data in editor

* better injecting interactivity data

* remove rounding

* Product Collection Data endpoint doesn't care about current query so we remove the context for now

* extract data injecting as a method, possbily a trait in the future

* add sidebar setting

* duplicating the markup in php render callback for safety

* remove directive from edit component

* show prices without decimal

* use final class

* use sample collection data response

* prepare for multiple styles support

* use collection data from context

* cleanup props and props passing

* pass only necessary states

* retire heredoc in favor of late escaping

* reorganize style

* inherit style from current price filter react component, pre extract the component for multiple display style support

* keep minPrice smaller than max

* remove unnecessary active handler logic

* update folder structure

* avoid whitespace change

* clean up

* title

* move inspector to component folder, ready to be extracted to inner block

* block icon

* block name

* name

* use inner block for view

* inner block view switcher

* try: process data in Collection Filtes block only

* wip: query collection data from collection filters block only

* provide all context from collection filters block

* simplify context passing

* feat: use default attribute to define filter type of view block

* rename

* remove price block

* rename price slider to price, default price filter should be a slider

* type cleanup

* fix ancestor block name

* only passing the collection data down

* wip

* recusive

* editor preview

* refactor: data fetching, context passing, and code organization

* initial attribute filter block

* feat: attribute selector

* inspector control

* wip

* break the edit into smaller components

* wip: editor component

* extract checkbox list

* wip editor preview

* show count checkbox list

* fix param aggregation for attribute filter blocks

* post merge fix

* fix param aggregation for attribute filters

* fix: set correct selected attribute

* WIP checkbox list

* WIP checkbox list

* avoid action name conflicts

* Checkbox list front end

* phpcs

* update context on input, navigate on change

* fix: attribute selection

* dropdown

* remove isDeepEqual

* add: warning when attribute has no products or no attribute is selected

* update type

* update type

---------

Co-authored-by: David Arenas <david.arenas@automattic.com>
Co-authored-by: Luis Herranz <luisherranz@gmail.com>
2023-11-21 14:22:20 +07:00
Manish Menaria 26550194d3 Product Collection - New 'No Results' block with default UI (https://github.com/woocommerce/woocommerce-blocks/pull/11783)
* Add custom 'No Results' block for Product Collection

This commit introduces a new 'No Results' block, replacing the default core 'query-no-results' block within product collection block. The 'No Results' block provides a tailored experience for WooCommerce stores, displaying a custom message when no products are found in a query.

Key changes include:
- A new block type 'woocommerce/no-results' is registered with a complete configuration and content structure.
- Edit and save functions are implemented for the block, allowing for custom content and styles within the block editor and on the front end.
- Webpack entries are updated to include the new block in the build process.
- A PHP class NoResults is added for server-side rendering, which only displays the block when the product query returns no results, enhancing performance.
- The ProductCollectionUtils utility class is extended to support the new block's query needs.

The new block enriches the user experience by providing clearer communication when no products match the collection criteria and allows store owners to customize the message and presentation.

* Update description

* Rename 'no-results' block to 'product-collection-no-results'

Changes include:
- Updating the block name in `edit.tsx` within the `product-collection` directory.
- Modifying the block.json file in the `no-results` inner block to reflect the new name.
- Adjusting the className in `edit.tsx` for the `no-results` inner block.
- Altering the webpack entries in `webpack-entries.js` to recognize the new block name.
- Renaming the block in `NoResults.php` to align with this update.

This renaming aims to make the block's purpose more clear and to maintain a consistent naming scheme within our product collection blocks.

* Rename NoResults to ProductCollectionNoResults for clarity

This commit renames the `NoResults` class to `ProductCollectionNoResults`. The change aims to enhance clarity and specificity about the class's purpose, indicating that it specifically handles no-result scenarios within product collections.

Changes made:
- Renamed `NoResults.php` to `ProductCollectionNoResults.php`.
- Updated the class name from `NoResults` to `ProductCollectionNoResults` in the file.
- Modified the reference in `BlockTypesController.php` to use the new class name.

This renaming ensures better readability and understanding of the class's role in the context of product collections. The primary change is the renaming, with no significant alterations in the class functionality.

* Update No-Results Message Formatting in Product Collection Block

This commit simplifies the layout and message content for the 'No results found' message in the product collection block's no-results edit component. The changes include:

1. Removal of the full stop in the 'No results found' string for consistency.
2. Replacing the 'core/group' block with a 'core/paragraph' block.
3. Streamlining the message content to be more concise and integrated into fewer text blocks.
4. Direct links for 'clearing any filters' and navigating to the 'store's home' are now included in the same paragraph.

---------

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-11-20 13:18:59 +00:00
Niels Lange e6a885283b Increase CSS specificity for local pickup address (https://github.com/woocommerce/woocommerce-blocks/pull/11772)
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-11-20 13:07:00 +00:00
Thomas Roberts cc84383730 Move all totals components into components package (https://github.com/woocommerce/woocommerce-blocks/pull/11773)
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-11-20 12:53:41 +00:00
Mike Jolley 1f1808e616 Fix strings in classic-checkout modal window (https://github.com/woocommerce/woocommerce-blocks/pull/11771)
* Fix strings in modal window

* Update assets/js/editor-components/incompatible-extension-notice/modal.tsx

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

---------

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2023-11-20 12:36:49 +00:00
dependabot[bot] 471b9a1b60 Bump @wordpress/icons from 6.1.1 to 9.36.0 (https://github.com/woocommerce/woocommerce-blocks/pull/11611)
* Bump @wordpress/icons from 6.1.1 to 9.36.0

Bumps [@wordpress/icons](https://github.com/WordPress/gutenberg/tree/HEAD/packages/icons) from 6.1.1 to 9.36.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/icons/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/icons@9.36.0/packages/icons)

---
updated-dependencies:
- dependency-name: "@wordpress/icons"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Add sparkles icon to codebase

* Fix failing JS-unit tests

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2023-11-16 17:40:53 +00:00
Mike Jolley 377a3d9931 Make "Use same address for billing" visible by default (https://github.com/woocommerce/woocommerce-blocks/pull/11804) 2023-11-16 16:41:52 +00:00
Alexandre Lara c8ef0fb3af Product Gallery block: Restrict block to be available only on the Single Product template or the Product Gallery template part (https://github.com/woocommerce/woocommerce-blocks/pull/11664)
* WIP: experimenting with strategy pattern for block registration

* Add TemplateChangeDetector to BlocksRegistrationManager

* Handle blocks registration

* Fix issue causing blocks to be registered multiple times

* Allow register/unregister blocks when on pages or posts

* Add BlockRegistrationStrategy logic

* Fix import error

* Add doc comments for BlockRegistrationManager class

* Add doc comments to TemplateChangeDetector class

* Fix eslint errors

* Import domReady from @wordpress/dom-ready

* Prevent error when using blockName for registerBlockType function

* Add e2e tests to check for block availability in different contexts

* Add e2e tests to cover block availability on different contexts
2023-11-16 15:03:58 +00:00
Roy Ho 8f3f630522 Product gallery/dialog/enhancement (https://github.com/woocommerce/woocommerce-blocks/pull/11755)
* Hide pager in dialog

* Product Gallery: reset main image when dialog closes

* Product Gallery block: Add product title to dialog

* Align double arrow

* Use H2 to be more semantic

* Use product title block in template part

* Default pager to off

* Remove pager only in dialog

* Remove unused param

* Default pager to off instead of removing
2023-11-15 13:05:51 -08:00
Mike Jolley fd4675aa6a Refactor default editing state for customer address fields (https://github.com/woocommerce/woocommerce-blocks/pull/11765)
* Refactor default editing state for customer address fields

* Exclude email from invalid props check

* Merge conflict
2023-11-15 15:22:36 +00:00
Sam Seay d62b950aae Add a stock filter block powered by the interactivity API (https://github.com/woocommerce/woocommerce-blocks/pull/11663) 2023-11-15 16:50:05 +13:00
Seghir Nadir 49579f4aa0 Move phone to default fields section instead of being handled inline. (https://github.com/woocommerce/woocommerce-blocks/pull/11651)
* Move phone to default fields section

* remove unused files and actions
2023-11-14 18:30:23 +00:00
Alex Florisca 9ad8323851 Move Button, StoreNotice and StoreNoticesContainer components into the components package (https://github.com/woocommerce/woocommerce-blocks/pull/11766)
* Move Button, StoreNotice and StoreNoticesContainer components into the components package

* Delete the button folder and leave alias in index.ts

* Update references from @woocommerce/blocks-checkout to @woocommerce/blocks-components
2023-11-14 16:32:53 +00:00
Thomas Roberts cb468c8ade Move `TextInput`, `ValidatedTextInput` and `ValidationInputError` to the `@woocommerce/blocks-components` package. (https://github.com/woocommerce/woocommerce-blocks/pull/11654) 2023-11-14 14:52:14 +00:00