Commit Graph

841 Commits

Author SHA1 Message Date
Seghir Nadir 66523872f3
Support controlling address card state from data store in Checkout block (#51386)
* fix line height

* Support controlling address card from data store

* expand billing address on unsync

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

* disable linter rule

* remove empty section

* remove used vars

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-17 10:56:15 +00:00
Mike Jolley b0401ef25d
[Experimental] Delayed Account Creation Block (#50934)
* Add block to templates

* Register block type with php

* Create block type class

* Update webpack

* Move password strength meter component

* Add button styles when disabled

* Move password strength component

* Block WIP

* CSRF token handling

* Put new block behind feature flag

* Add experimental flag docs

* Update icon + description

* Changelog

* Lint errors

* Style controls

* Adjust icon markup

* subsctring match

* More specific import

* Fix test fail caused by layout shift

* Wording changes from Figma

* Check if logged in, not just if the current email is registered

* Use opacity for disabled button text

* Sync order data with customer after account creation

* Add id/fragment to form
2024-09-12 11:18:13 +01:00
DAnn2012 b72e07c605
Fix typos (WooCommrece) (#50333)
* Update README.md

* Update 722.md

* Update 741.md

* Update docs-manifest.json

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

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Roy Ho <roykho77@gmail.com>
2024-09-10 08:15:36 -07:00
Gabriel Manussakis 91b6e972e3
[Accessibility] Fix misspelling in plugins/woocommerce-blocks/docs (#48562)
* Fix "overriden" typo

* Fix "prequisites" typo

* Fix "overriden" typo

* Fix "recieve" typo

* Fix "differnt" typo

* Fix "revew" typo

* Fix "resetted" typo

* Fix "overriden" typo

* Fix "overriden" typo

* Fix "Appearence" typo

* Fix "Producto" typo

* Fix "tha" and "modifed" typos

* Fix "Boundry" typo

* Fix "boths" typo

* Fix "visibile" typo

* Fix "overriden" typo

* Fix "Apperance" typo

* Fix "returing" typo

* Fix "extration" typo

* Fix "brough" typo

* Fix "teh" typo

* Fix "fileds" typo

* Fix "arry" typo

* Add changelog file

* Revert change of "Producto" word

* Revert change of "Producto" word
2024-08-28 10:00:01 -04:00
Karol Manijak 5a80d5e1da
Update Block Reference and make it public doc (#50906)
* Update Block References doc

* Move the Block References to public Docs

* Change the place Block Reference is generated to

* Add changelog

* Update docs manifest file

* Update manifest
2024-08-27 09:04:15 +02:00
DAnn2012 8387b0a842
Fix typo (1140.md) (#50160)
* Update 1140.md

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

* Update 1140.md

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2024-08-20 12:37:13 +01:00
piinthecloud 5098bb1169
create block theme folder (#50638)
* create block theme folder

* add changelog

* update titles
2024-08-20 13:19:47 +02:00
Caleb Mazalevskis 50900d9d4e
Fix markdown typos. (#50282)
* Fix markdown typos.

* Re-fix typos.

* Add changelogs (#issuecomment-2296573205).
2024-08-19 14:59:10 -03:00
Mike Jolley a932ceb59f
Fix extensionCartUpdates not surfacing errors to cart and checkout (#49762)
* Add context to type

* Clean up notifyerrors helpers

* Notify and clear top level cart errors

* changelog

* Make extensionCartUpdate surface the errors

* No automatic clearing of notice

* Handle generic errors only, add docs

* Rename param

* Fix linting in readme

* Update toc

* test coverage

* Unused import

* We're only dealing with arrays of errors so simplify logic
2024-08-14 15:24:44 +01:00
Luigi Teschio 9ae7485039
Compatibility Layer: fix 'woocommerce_before_single_product_summary' hook position (#50392)
* Compatibility Layer: fix 'woocommerce_before_single_product_summary' hook position

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-07 14:53:11 +02:00
piinthecloud f7f280fd1b
create product collection category and move to main docs folder (#50368)
* create product collection category and move to main docs folder

* add readme

* update title

* update title

* add changelog and remove emojis

* Update docs/product-collection-block/register-product-collection.md

Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>

---------

Co-authored-by: Shani <shanibanerjee@gmail.com>
Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
2024-08-05 11:51:32 -04:00
DAnn2012 162874a408
Fix typos (920.md) (#50335)
* Update 920.md

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

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2024-08-05 15:56:35 +02:00
Luigi Teschio 854c81d9ad
Compatibility Layer: fix documentation (#50348)
* Compatibility Layer: fix documentation

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

* Update plugins/woocommerce-blocks/docs/internal-developers/blockified-templates/compatibility-layer.md

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

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2024-08-05 09:59:25 +00:00
piinthecloud d92161cbd1
Move checkout docs to main v2 (#49984)
* move checkout docs with front matter to main folder (#49186)

* move checkout docs with front matter to main folder

---------

Co-authored-by: Jacklyn Biggin <hi@jacklyn.dev>

* initial commit to reapply changes from PR #49186

* update html tags to unicode and clean up hashlinks

* revert unicode

* remove emoji

* update manifest

* test readme page

* remove avail-filters since it is now redundant with the readme

* update links

* test htmlentity

* pdate links

* typo fix

* update readme with actual doc

* fix links

---------

Co-authored-by: Jacklyn Biggin <hi@jacklyn.dev>
2024-08-02 20:12:06 +02:00
Manish Menaria a73c6e5546
Product Collection: Enable Context-Aware Previews by Adding `usesReference` to `registerProductCollection` (#49796)
* Allow registering custom collections with various context references

Implemented the registration of product collections with different context references using the `usesReference` property. These custom collections are now registered with specific contexts such as product, cart, order, and archive.

This enhancement allows for more tailored previews and functionality based on the specific context in which the product collection is used.

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

* Support multiple references for usesReference

* docs: update documentation to include `usesReference`

Enhanced the `register-product-collection` documentation to include details about the new `usesReference` property. This property allows collections to specify required references, enhancing their contextual relevance and preview capabilities.

- Added `usesReference` description to the collection fields section.
- Included examples demonstrating the usage of `usesReference` with single and multiple references.
- Clarified the behavior when required references are unavailable on the editor side but available on the frontend.

This documentation update provides third-party developers with the necessary information to utilize the `usesReference` property effectively in their custom product collections.

* test: add e2e tests for `usesReference`

Added end-to-end tests to verify the functionality of the `usesReference` property in product collections. These tests ensure that the appropriate preview labels are displayed.

- Created multiple custom product collections with different `usesReference` values: `product`, `cart`, `order`, `archive`, and combinations of these.
- Verified that collections show the correct preview label when the required reference is present.
- Ensured that the preview label is not shown in irrelevant contexts, such as posts or product catalog templates.

This addition enhances test coverage and ensures the robustness of the `usesReference` feature.

* Fixed issue with preview label showing in Specific Product and Archive templates.

* Handle cases when termId or productId is 0

This also improves the readability of the code by using better variable names.

* Make PC use postId context so location can be recognised correctly (#50152)

* Fix TS errors

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
2024-08-01 15:33:27 +05:30
Seghir Nadir 0dcd359b25
Add validation to select fields and add placeholder option to additional fields API (#49929)
* Add validation and empty value to select components

* address feedback

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

* remove console log

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/additional-checkout-fields.md

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

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/additional-checkout-fields.md

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

* remove test

* Fix tests

* also move select to parent

* fix tests

* add empty enum to schema

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2024-07-26 16:38:44 +00:00
Manish Menaria 7e54c5a589
Fix tip block syntax in register-product-collection.md (#49785)
* Fix tip block syntax in register-product-collection.md

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

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-23 13:58:42 +05:30
Karol Manijak d85acc7e09
Product Collection: allow custom collections hiding each of the filters (#49713)
* Allow hiding all of the filter controls in PC block

* Add new test

* Add changelog

* Update documentation with information about hideControls values
2024-07-23 09:03:27 +02:00
piinthecloud cae3937ee6
Revert move docs (#49354)
* revert moving docs to main folder ahead of issues with subcategories

* add changelog

* add changelog
2024-07-10 17:33:15 +02:00
piinthecloud ec82b3f08f
move checkout docs with front matter to main folder (#49186)
* move checkout docs with front matter to main folder

* add manifest

* add core changelog

* Remove emojis, unsupported links and table of contents

* pr comments

* update folder name and remove toc

* title fix

---------

Co-authored-by: Jacklyn Biggin <hi@jacklyn.dev>
2024-07-10 16:53:52 +02:00
Manish Menaria fa11141726
Expose `__experimentalRegisterProductCollection` in @woocommerce/blocks-registry Package (#48141)
* Expose registerProductCollection in @woocommerce/blocks-registry Package

This commit exposes the `registerProductCollection` function as part of the `@woocommerce/blocks-registry` package. This enhancement facilitates the registration of new product collections by 3PDs, promoting better modularity and extensibility within the WooCommerce Blocks ecosystem.

Changes include:
- Migration of `register-product-collection.tsx` to `packages/checkout/blocks-registry`.
- Export `registerProductCollection` from `@woocommerce/blocks-registry/index.ts`.
- Updated related imports and references to the new path.

This update enables 3PDs to register product collections more seamlessly, enhancing the extensibility of Product Collection block.

* Replace @woocommerce/blocks-checkout with @woocommerce/blocks-registry

* Add __experimental prefix

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

* Improve registerproductcollection for 3pds

* Set isDefault value to false

* Don't export all the types

* Update changelog

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

* Add plugin to test __experimentalRegisterProductCollection

* Add E2E tests

* Fix Lint errors

* Improve E2E tests for __experimentalRegisterProductCollection

- Reduced preview timeout from 2000ms to 1000ms.
- Expanded E2E tests to cover new attributes and preview functionalities.

* Refactor code to improve readability and maintainability

- Added a warning comment to indicate that `__experimentalRegisterProductCollection` is an experimental API.
- Refactored variable names and imports in `register-product-collection.tsx` and `index.tsx` for clarity.
- Simplified and reorganized type definitions and imports in `types.ts` and `utils.tsx`.
- Renamed function in `register-product-collection-tester.php` for consistency.

* E2E: Also test the Frontend

* Use alias for import statement

* Don't pass isActive to registerProductCollection

Now it's handle by registerProductCollection itself.

* Update registerproductcollection API structure

Refactored the product collection block to enhance attribute management and ensure consistency in query defaults. This change includes:
- Importing `DEFAULT_QUERY` from constants and using it to set default query attributes.
- Removing `DEFAULT_ATTRIBUTES` from specific collections and directly defining required attributes.
- Ensuring `postType` and `isProductCollectionBlock` are set to default values in the query object.
- Setting `inherit` attribute to `false` by default in all collections.

* Hide inherit control in collections

Ensure the "inherit" control is always hidden, as collections should not be able to change this attribute. This includes:
- Adding `CoreFilterNames.INHERIT` to the `hideControls` set in `register-product-collection.tsx`.
- Adjusting the `hideControls` attribute in individual collection files to remove redundant hiding of the `INHERIT` control.

* Fix: Filters not showing in inspector controls

* Set inherit to false for all collections

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

* Product Collection: Add validation for `__experimentalRegisterProductCollection` arguments (#48513)

* Add validation for `__experimentalRegisterProductCollection` arguments

Introduced comprehensive validation for the `ProductCollectionConfig` object in `__experimentalRegisterProductCollection` to ensure correct data types and values, enhancing error handling and robustness.

- Added a new function `isValidProductCollectionConfig` to perform various checks on the `ProductCollectionConfig` object.
- Validates properties such as `name`, `title`, `description`, `category`, `keywords`, `icon`, `isDefault`, `innerBlocks`, `example`, `scope`, `isActive`, `attributes`, and `preview`.
- Ensures correct data types and provides detailed console error messages for invalid configurations.
- Updated `__experimentalRegisterProductCollection` to use the validation function before proceeding with the registration process.

**Impact**
- Improves stability and prevents invalid configurations from causing runtime errors.
- Provides clearer error messages for developers, aiding in quicker debugging and development.

* Fix typo

* Refactor: Replace console.error with console.warn

Updated the error logging in the isValidProductCollectionConfig function to use console.warn instead of console.error for invalid configuration properties. This address the feedback from the PR review.

- Replaced console.error with console.warn for various validation checks in isValidProductCollectionConfig.
- Removed redundant return statements after console.warn calls.
- Improved logging messages to better inform about invalid configuration properties without treating them as critical errors.
- Simplified the logic in __experimentalRegisterProductCollection by combining query and attribute properties and ensuring defaults are set properly.

* Refactor: Rename isValidProductCollectionConfig to isValidCollectionConfig

Updated the function name from isValidProductCollectionConfig to isValidCollectionConfig for better clarity and consistency. Also, renamed related variables for improved readability.

* Add validation for name property

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

* Title is required for new collection

* Update comments

* Fix E2E tests

* Address PR feedback

---------

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

* Add README file for __experimentalRegisterProductCollection

* Add screenshots in README file

* Try to fix lint issue

* Docs: add example for collection with inner blocks

Enhanced the documentation for `__experimentalRegisterProductCollection` to include an example demonstrating how to define a collection with inner blocks. This example shows how to create a custom collection with nested blocks, including a heading and product elements, providing a clear guide for developers.

New content added:
- Example 4: Collection with inner blocks
- Sample code for defining a collection with inner blocks
- Tips and links to further resources on inner blocks and core collection definitions

* Fix Lint errors

* Address PR feedback

* Reduce number of JS files on /shop page

**Problem:** There was increase in number of JS files on /shop page after exposing `registerProductCollection` function in `@woocommerce/blocks-registry` package. This package is loaded on the frontend. For example, previously 45 JS files were loaded on /shop page but now 55 JS files are loaded on /shop page.

**Solution:**
1. After a bit of debugging I found out that constant file which we are importing i.e. `plugins/woocommerce-blocks/assets/js/blocks/product-collection/constants.ts` contain some heavy dependencies & it's not pure. Therefore, I decided to split this file into two files. I moved all the constants that are used in `registerProductCollection` function to a new file i.e. `plugins/woocommerce-blocks/assets/js/blocks/product-collection/constants-register-product-collection.ts`. This way, we don't need to load all the constants on the frontend i.e. /shop page.
  - This reduced 4 JS files i.e. 51 JS files are loaded on /shop page.

2. After some more investigation, I found out that importing `registerBlockVariation` function is increasing number of JS files on Frontend. Therefore, I decided to use global `wp` object to call `registerBlockVariation` function. This way, we don't need to import it. This reduced last 6 files i.e. 45 JS files are loaded on /shop page.

This way, I was able to reduce number of JS files on /shop page from 55 to 45, which is same as before this PR.

* Refactor: product collection constants

- Moved constants from `constants-register-product-collection.ts` to `constants.ts`
- Deleted `constants-register-product-collection.ts`
- Updated import paths in relevant files to reflect the changes
- Moved utility functions to `utils.ts`

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-05 16:55:35 +05:30
piinthecloud 025b5f1a8f
add front matter and cleanup docs in V1 migration for docs site (#49010)
* add front matter and cleanup docs in V1 migration for docs site

* add changelog entry and fix remaining HTML tables to markdown

* bypass linter rules

* update rule

* rever rule change for incorrect file

* rever rule change for incorrect file

* lint filtering-payment-methods.md rule

* address comments

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/migrated-hooks.md

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

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/migrated-hooks.md

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

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-payment-methods/payment-method-integration.md

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

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-payment-methods/filtering-payment-methods.md

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

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/available-filters/totals-footer-item.md

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

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/available-filters/checkout-and-place-order-button.md

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

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/available-filters/additional-cart-checkout-inner-block-types.md

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

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/available-filters/cart-line-items.md

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

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/additional-checkout-fields.md

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

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/how-checkout-processes-an-order.md

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

---------

Co-authored-by: Niels Lange <info@nielslange.de>
2024-07-04 13:54:43 +02:00
Bart Kalisz f8011713a0
Fix e2e-guidelines.md syntax (#49018) 2024-07-03 11:01:14 +02:00
Albert Juhé Lluveras 0205513556
Fix Classic Template block registration on WP 6.6 (#48730)
* Fix Classic Template block registration on WP 6.6

* Update Compatibility Layer docs

* Add changelog file

* Remove unused function

* Simplify logic
2024-06-26 12:20:22 +02:00
Tung Du 921e86e6ab
[Experimental] Product Filters: add layout and block spacing support (#48429)
* add: layout and block spacing support

* chore: changelog

* add: vertical aligment controls

* fix: update test to check for inspector styles controls

* test: ensure the block spacing setting is visible

* test: ensure the layout settings is rendered

* test: default layout settings

* test: justification setting

* test: orientation

* test: block spacing

* test: remove unnecessary util

* test: store selector in blockData

* test: use layout matching
2024-06-21 04:37:46 +00:00
netzkollektiv c76438906b
clarify the `name` property needs to match between JS and PHP (#48219)
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-06-13 05:57:36 -07:00
Karol Manijak d49db0486e
Update Compatibility Layer docs (#48456)
* Update compatibility layer docs to mention Product Collection

* Add changelog

* Update plugins/woocommerce-blocks/docs/internal-developers/blockified-templates/compatibility-layer.md

Improve my English

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

---------

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2024-06-13 09:57:51 +02:00
Albert Juhé Lluveras fe611abc7e
Clean up theming sections in WooCommerce blocks docs (#48420)
* Clean up theming sections in WooCommerce blocks docs

* Add changelog file

* Change intro text

* Fix TOC
2024-06-12 16:29:42 +02:00
Albert Juhé Lluveras 54854f16cf
Document template parts used by the Classic Template block (#48183)
* Document template parts used by the Classic Template block

* Add changelog file

* More changes

* Change image

* More changes (II)

* Update plugins/woocommerce-blocks/docs/internal-developers/templates/README.md

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

* Update plugins/woocommerce-blocks/docs/internal-developers/templates/classic-template.md

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

* Make image smaller and centered

* Change PHP template parts section format

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2024-06-12 09:36:55 +02:00
Albert Juhé Lluveras 545e48e05a
Expand block templates documentation (#48247)
* Expand block templates documentation

* Add changelog file

* New manifest

* Minor changes

* Add Page: Coming soon template
2024-06-11 10:04:48 +02:00
Karol Manijak 9b3879f7cf
Add "(Experimental)" suffix to experimental blocks (#48071)
* Add (Experimental) suffix to experimental blocks

* Add comments reminding to update feature flags doc

* Update feature flag doc

* Add changelog

* Provide links to all feature flags

* Add JS flag for Product Filter: Rating (Experimental)

* Bring back linting in PHP file

* Update block references

* Update variation names

* Update tests

* Update test

* Add notification that block is not available in inserter to block references doc

* Add missing feature flag

* Remove information about block not being exposed in inserter from block references

* Update block references
2024-06-10 15:12:10 +02:00
Thomas Roberts 89bcbc7915
Apply lint fixes to payment method integration documentation (#48226) 2024-06-07 04:26:09 -07:00
Sam Seay 2d4295469d
Remove all usage of WOOCOMMERCE_BLOCKS_PHASE and introduce BUNDLE_EXPERIMENTAL_BLOCKS (#47807) 2024-06-05 20:14:16 +12:00
Roy Ho b85e1aa402
Use correct AND expression (#48011)
* Use correct AND expression

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-05-31 05:23:57 -07:00
Albert Juhé Lluveras fae960c7bf
Fix typo in some tests and comments: 'blockbased' > 'block-based' (#47851)
* Fix typo in some tests and comments: 'blockbased' > 'block-based'

* Add changelog file

* Add JSDocs types

* Replace 'block based' with 'block-based' in stock-reservation.md
2024-05-27 19:21:10 +02:00
Bart Kalisz 460d73eee0
Blocks E2E: Streamline E2E utils implementation (#47660) 2024-05-27 14:54:06 +00:00
Seghir Nadir 6c136e4e1a
normalize IDs for form fields in Checkout (#47650)
* normalize IDs for form fields and fix types

* update docs as well

* update rest of docs

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

* fix linting for document

* also align classnames

* revert to correct classname

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-05-22 22:54:03 +02:00
Karol Manijak 313ab0eb74
Rename classic template blocks to avoid confusion (#44931)
* Rename  blocks to  to distinguish them from new blocks

* Add changelog

* Change the naming convention to XYZ (Classic)

* Update classic templates descriptions

* Fix package.json lint error
2024-05-22 10:53:43 +02:00
Niels Lange 5168a21920
Block-based checkout - Update address fields display logic (#47160)
* Add “Address line 2” toggle

* Allow apartment field to be required

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

* Rename “Apartment, suite, etc.” to “Address line 2”

* Remove unused dependency

* Add key to fragment

* Simplify keys

* Address failing e2e tests

* Change “Optional (Recommended)” to “Optional”

* Toggle address line 2 visibility in editor

* Add e2e tests

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

* Update e2e tests

* Update e2e tests

* Ensure the address 2 field stays open when the seller empties it

* Optimise hasAddress2FieldValue

* Move address 2 filed related functionality into separate component

* Rmove + sign from address 2 field links

* WIP: Introduce AddressField component

* Update AddressFields component

* Refactor AddressFields and Address2Field components

* Fix CSS lint error

* Fix JS lint error

* Fix failing e2e tests

* Fix typo in e2e tests

* Improve e2e selector

* Fix core e2e tests

* Use address line 2 label for the link text

* Lazy initialise the “isFieldVisible” state

* Remove obsolete code

* Add inline comments for clarity

* Fix JS lint error

* Improve e2e tests

* Revert "Remove obsolete code"

This reverts commit 027d6adc89.

* Adjust visibility toggle

* Delete obsolete changelog file

* Add inline comment

* Fix TS error

* Remove obsolete parts

* Solve TS warning

* Remove obsolete “fieldsRef”

* Remove obsolete “setHasFieldBeenModified”

* Address various TS warnings

* Fix link styling issue on mobile

* Fix JS lint error

* Refactor and simplify address components

* Optimise Address2Field component

* Improve inline docs

* Move ‘+’ from CSS to i18n

* Rename rest of values and pass correct onChange

* force component to remount

* remove unsed useEffect

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2024-05-21 15:48:24 +07:00
Karol Manijak 929564da82
Product Collection: remove Beta label (#47572)
* Remove Beta label from Product Collection

* Remove unnecessary dependency in Product Collection page object

* Add changelog

* Udpate block references
2024-05-21 08:36:40 +02:00
Sam Seay fcc421d550
Update cart/checkout usage of the @wordpress/components Slot Fill (#47105) 2024-05-16 21:46:24 +12:00
Albert Juhé Lluveras 8da8a70839
Update docs about blocks styling to clearly state global styles are the recommended approach (#47269)
* Update docs about blocks styling to clearly state global styles are the recommended approach

* Markdown formatting fixes

* Add changelog file

* Add styling the Product Price block example

* Markdown formatting fixes (II)

* Update plugins/woocommerce-blocks/docs/designers/theming/README.md

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

* Update plugins/woocommerce-blocks/docs/designers/theming/README.md

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

---------

Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2024-05-13 18:26:50 +02:00
Seghir Nadir ccba86a616
Update additional fields document's TOC and link to it from another document. (#47137)
* update docs

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

* fix linting

* update manifest

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-05-13 15:46:46 +00:00
Ramon Ahnert 49c379c5a7
Fix typo in the Exposing your data in the Store API documentation (#43488)
* Fix basic usage code snippet example in extend-rest-api-add-data.md

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-05-13 15:20:07 +07:00
Albert Juhé Lluveras 8b47443a1c
Remove unnecessary links to an ephemeral site (#47270)
* Remove unnecessary links to an ephemeral site

* Add changelog file

* Disable markdown lint in some lines
2024-05-08 15:24:25 +02:00
Albert Juhé Lluveras f2bb11ffc3
Update block templates documentation (#47110)
* Update block templates documentation

* Add changelog file

* Linting

* Replace 'the' with 'a' to improve understandability
2024-05-06 11:06:40 +02:00
ianlv 6ff0463f24
chore: remove repetitive words (#47158)
* chore: remove repetitive words

Signed-off-by: ianlv <sunlvyun@outlook.com>

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

---------

Signed-off-by: ianlv <sunlvyun@outlook.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-05-06 03:43:39 +00:00
Roy Ho d6a48ecaf5
Add autogeneration of block list reference documentation (#46479)
* Add autogeneration of block list reference documentation

* Fix typo

* Revert this change

* Fix typo

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

* Add blanklines to surrounding markdown headings

* Generate blocks references markdown

* Add space to header markdown

* Add ancestor information

* Use native Object.keys instead of lodash

* Remove the use of fast-glob

* Revert pnpm lock file changes

* Update plugins/woocommerce-blocks/bin/gen-block-list-doc.js

Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>

* Update doc title

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
2024-04-25 06:03:41 -07:00
Seghir Nadir 2054353f91
Add hooks when reading and writing additional fields (#46870)
* add new filters for reading and writing fields

* rename functions

* add test for action

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

* update docs

* fix typo in test and linting issues

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-04-24 17:38:15 +02:00
Seghir Nadir 742cbbda9d
Graduate Additional Fields to stable and rename it. (#46805)
* graduate woocommerce_blocks_register_checkout_field

* graduate filters

* Migrate Additional to Order and Other

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

* fix markdown lint

* update tests to use old value

* fix lint issue

* pass field options by reference

* update test helpers

* update tests to use latest api

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-04-23 16:47:32 +02:00