* refactor: move util functions to their own files
* refactor: replace hook with function
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* chore: remove unnecessary prop
* fix: default clear button attribute not being respected
* refactor: make the blocks respect the default clearButton attribute
* refactor: remove code duplication
* Rename getCSSVar util function
---------
Co-authored-by: github-actions <github-actions@github.com>
* feat: Add related by setting to related products collection
This commit adds a new setting to the related products collection that allows
users to control how products are related. Users can choose to relate products
by categories, tags, or attributes.
* Remove attributes from related by control
This commit removes the attributes option from the related by control in the
Product Collection block. This option was not being used in the backend and
was potentially misleading to users.
Changes made:
- Removed attributes checkbox from RelatedByControl component
- Removed attributes from RelatedBy type definition
- Cleaned up PHP code by using PHP_INT_MAX instead of magic number
* feat: Set default values for related by setting
This commit sets the default values for the relatedBy setting in the Product
Collection block. By default, products will be related by both categories and
tags.
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
* Add tracking for related-by filter
* Add e2e test for "Related by" setting in Related Products collection
* Remove unused import for VStack
* Add optional chaining operator for query.relatedBy
Since relatedBy is an optional prop, add the optional chaining operator to
safely access it and prevent potential undefined property access errors.
* Add tracking for related by changes in Product Collection block
This commit adds tracking for when users change the "Related by" settings in
the Product Collection block inspector controls. It records whether categories
and tags are enabled or disabled.
* Update panel title from "Relate by" to "Related by"
* Remove `blocks_product_collection_inspector_control_related_by_changed` track event
---------
Co-authored-by: github-actions <github-actions@github.com>
* gridify input + button add to cart
* changelog
* css hacl to ensure full witdh when no children
* increse the CSS selectors to apply the grid
* avoid apply styles for steppers
* apply styles only to input in block editor context
* hack to align input + button at left
* fit content only for grouped products
* apply high span to align input + button elems
* ensure to define pseudo element
* fix eslint issues
* fix linting issues
* use a var to define whole width in grid
* Do not repeat rendering the shipping calculator button on the cart page.
* Lint fix: remove unused import
* Revert "Ensure local state is not overwritten by server when using `extensionCartUpdate` (#49311)"
This reverts commit 4861ec250e.
* Revert changes that didn't render shipping calc and instead check hasrates before rendering ShippingVia, ShippingAddress
* Revert "Revert "Ensure local state is not overwritten by server when using `extensionCartUpdate` (#49311)""
This reverts commit feec5709c5.
* Remove redunant change in import ordering
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
---------
Co-authored-by: github-actions <github-actions@github.com>
* Remove experimental flags
* changelog
* Check theme is block theme
* adjust test since this setting is only visible with block themes
* Hide dark mode option if password input is disabled
* Normalize cart on load in Store API
* Remove change notices; this cannot happen with normalised API endpoints
* Add test to verify normalization works
* changelog
* Remove test for removed notices
* Fix test linting
* Check $cart_item['data'] is a product
* Update ExtensionCartUpdateArgs to allow overwriting dirty data
* Set isCustomerDataDirty when updating billing/shipping addresses
* Update docs
* Add e2e test to ensure overwriting dirty state isn't possible
* Organise tests better and add check pushed data isn't overwritten
* Check if data is changing when updating shipping/billing addresses
* Check input values in test
* Add test to ensure data can still be overwritten by extensions
* Add changelog
* Fix lint errors
* Remove rogue console log
* Remove unused import
* Update plugins/woocommerce-blocks/assets/js/data/cart/reducers.ts
* Fix lint error
* Remove unneeded mdlint ignore
* Update test to select a value instead of fill
* Add methods to get/set dirty customer data in local storage
* Push all customer data, not just dirty fields
* Update e2e test
* Update push changes unit test
* Update keys in mock expected arg
* Align localstorage key name with Gutenberg uppercase style
* Fix lost code after merge conflict
* Remove unnecessary metadata set in reducer
* Reimplement TS changes
* Debounce writing to localStorage
* Only update localStorage if billing/shipping changed
* Remove localStorage key when checkout is complete
* Remove unused import
* Remove clear button when setting is disabled
* Add clear button when setting is enabled
* Move logic to a React hook
* Fix error preventing clear button from being inserted after full page reload
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* Add e2e test
* Fix ancestor
* Fix clear button settings for the Status filter
* Move hook to the root Product Filters folder
* refactor: divide the logic into multiple functions
* refactor: move util functions to their own files
* feat: add clear button hook to all individual filters
* test: add e2e test to the Product Filter Price block
* fix: block being created with the wrong default attributes
* fix: eslint errors
---------
Co-authored-by: github-actions <github-actions@github.com>
* Add To Cart With Options - Stepper layout: implement feature under feature flag
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce, woocommerce/client/admin
* fix E2E tests
* fix E2E test
* fix E2E test
* use setFeatureFlag across e2e test suite
* use the right feature flag
---------
Co-authored-by: github-actions <github-actions@github.com>
* Remove inspector notice
* Replace placeholder with generic version
* Implement new placeholder
* Fix shipping method count so it excludes rows which do not link to installed payment method
* changelog
* Set default so tests pass
* unused vars
* unused import
* Remove return type and fix import warnings
* add color block attributes
* add constant to define the color attributes
* centralize Color type
* define color types
* use UpperCase for Edit component
* render colors panel. save color values in attrs
* add a doc about colors validation
* save CSS vars and classes in the block markup
* pick and apply colors to the styles
* update markup with block colors
* firx eslint issue
* changelog
* reset all colors properly
* 80 cols
* set Color type peroperties like optional
* apply color to slider background
* Add to Cart Form: Ensure Compliance with min, max, and step HTML Attributes
* add comment
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* improve fallback value
* remove only
* add aria-label
* remove extra space
* Update plugins/woocommerce/changelog/52487-fix-add-to-cart-form-interactivity-api
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
* improve variable naming
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
* Merge branch 'trunk' of github.com:woocommerce/woocommerce into fix/add-to-cart-form-interactivity-api
* improve code style
* improve E2E tests
* improve fallback value
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Add To Cart Form - Stepper Layout: remove flex
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
---------
Co-authored-by: github-actions <github-actions@github.com>
* Fix: Product collection inspector control showing empty section
Previously, the inspector controls were always rendering a PanelBody element even
when the collection type wasn't hand-picked, resulting in an empty section being
displayed. This change moves the PanelBody inside the conditional rendering so
it only appears when hand-picked products are being used.
Also adds missing placeholder text to the Hand-Picked products control to improve
user experience.
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
---------
Co-authored-by: github-actions <github-actions@github.com>
* Hide product grid blocks from inserter
* Expose collections in the inserter
* Arrange collections imports alphabetically and registering by usage
* Add new keywords to collections
* Update tests
* Update block references
* Add changelog
* Update docs manifest
* Fix typo in collection name in test
* MAke adjsutments and cleanup of collections keywords
* Add one more keyword
* Hide Related Products from inserter
* Replace legacy Related Products with collection when transforming classic template into block one
* Replace legacy Related Products with collection in blockified Single Product Template
* Update block references and doc manifest
* Update block references
* Update tests to reflect new collection names
* Bring back pnpm-lock to original state
* Update Related Products E2E tests
* Fix the last Related Products test
* Add default queryId to Related Products pattern
* Regenerate block references and docs manifest
* Update product filters active block to new structure
* Build active chips items
* Add changelog
* Remove unneeded line-height
* Fix linting
* Fix e2e tests
* Refactor removeText
* Clean up
* Add clear button even without group
* Fix stock status name in e2e test
* Remove heading block
* Remove unused i18n module
* Remove period
* Add clear button variation description
* Fix typo
* Rename active chips to removable chips
* Extract data items from removable chips to make it reusable
* Fix e2e tests
* Add frontend script loading to null
* Don't render the block if no active filters
* Disable clear button by default
* Clean up
* Hide with iAPI
* Fix linting and e2e
* fix: add hidden tag serverside
---------
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Use WP 6.7 RC2 for Blocks env
* Update edited template heading selector
* Change selector in revertTemplate util due to issue in GB (WP 6.7)
* Update edited template heading selector in another suite
* Use page instead of editor.canvas to access components-popover
* Add changelog
* Update editor heading selector
* Update editor heading selector
* Product Collection: Add "Rating, low to high" and "Rating, high to low" sorting options
This commit adds a new sorting option to the Product Collection block that allows
sorting products by rating from low to high. The existing "Top Rated" option has
also been renamed to "Rating, high to low" for consistency.
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
---------
Co-authored-by: github-actions <github-actions@github.com>
* introduce file to define collection data types
* do not define `results` always like an array
* update passing types to useCollection intances
* allow to set the useCollectionData response type
* reuse RatingValues type
* tidy collection types in status filter
* clean types defined in type-defs pck
* change changelog type
* update attribute filter
* move Collection Data types to product-collection folder
* update WCStoreV1ProductsCollectionProps path
* improve defining the results type for the collection
* update path to import product collection types
* fix path to import RatingValues type
* Avoiding shipping calculator prop drilling with context
* Add changefile(s) from automation for the following project(s): woocommerce-blocks
* useCallback for update functions
---------
Co-authored-by: github-actions <github-actions@github.com>