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>