* Rename billingData to billingAddress
* Add unit test to ensure billingData remains accessible
* add integration tests for slots
* Keep billingData in usePaymentMethodRegistration for backwards compatibility
* Gate `billingData` in deprecation gate
* Replace deprecation call
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Gutenberg uses two different attributes for text colors:
* `style.color.text`, and
* `textColor`
However, the second one is used only when a color from the default
palette is selected AND the post is saved and reloaded.
With this fix we use the human readable string from the default palette
as a CSS variable.
Please note that while Gutenberg correctly assigns the appropriate CSS
class to render the right color, the problem is that if the color is
handled by a class, it can be overridden for example by themes.
See woocommerce/woocommerce-blocks#6492
Also:
* Refactored some composed components into one inclusive HOC,
called `withUpdateButtonAttributes`.
* The HOC `withTransformSingleSelectToMultipleSelect` allows for the wrong
type to be passed to its wrapped component: if a single element is
passed, that is wrapped into an array.
This didn't play well with TypeScript which obviously complains about
the wrong type being passed to the component.
So we now allow for arrays to be passed as props and ignored by the HOC
* Use wp store directly instead of React Context
We are using now actions directly from wp store in 'useStoreCartCoupons'
hook to apply and remove coupon.
* Remove unused "useStoreSnackbarNotices" related
files
* Add NoticeContext TS definition
* Remove the Provider references and refactor code
* Fix snackbar notice creation bug
* Fix "clear out snackbar coupon notice" bug
* Update "notices" API documentation
Remove snackbar hooks mentions since it's not used anymore
* DIsable the locking/unlocking mechansism for the cart-items-block so it cannot be unlocked and deleted
* Update all locked inner blocks with support: { lock: false } to disable locking/unlocking the blocks
* Convert `Products by Attribute` block to TS
* Small tweaks after review
* Extract InspectorControls and EditMode into components
* Refactor: move the edit related code to the edit.jsx file
* Remove the `editMode` attribute and control the edit mode inside the edit component
* Remove edit mode
* Change `isEditing` depending on attributes are selected or not
* Improved interfaces/props after review
* Add enum allowed values to `attrOperator` and `orderby` on the `block.json`
* Move `withSpokenMessages` to wrap the whole Edit block
* Convert `Handpicked Products` block to TS
* Extract InspectorControls and EditMode into components
* Refactor edit and remove the `editMode` attribute
* Change `isEditing` default depending on products selected or not
* Improve interfaces/props after review
* Move withSpokenMessages to wrap the whole Edit block
* Start using the block.json metadata file for `Products by Tag`
* Remove comment
* Add version, schema, and text domain
* Add defaults
* Remove wrong keyword
* Add tag icon when registering the block
This PR creates a new directory called `featured-items` which includes both blocks.
All the shared code lives at the top level of that directory.
Individual blocks still have their own directories, with their `block.json` and all other relevant configuration.
All the functionalities have been refactored out into their own files, accepting configuration when relevant, but mostly de-duplicating all the code.
Styles have also been refactored using mixins and extends and they mostly live in one place.
* Add requireExactMatch prop to ComboBox & only run onChange if value matches
* Set requireExactMatch to true for Country and State inputs
* Add unit tests for ComboBox
* Update expected value for onChange call
* Re-add autocomplete option to country input
* Use correct case for autoComplete in country input
* Add `Fixed` and `Repeated` background controls to `Featured Product`
* Add `Repeated background` feature when the toggle is activated
* Extract `get_image_url` function
* Add the styles for rendering the repeated image on the frontend
* Add `hasParallax` and `isRepeated` to the `block.json` file
* Adjust styles
* Remove unused function, improve phpdoc
* Use alt and product name
Fix error rebasing master
* Hide alt if isRepeat is true
When isRepeated is true, the image is a background so it does not
make sense to have an alt attribute.
* Add `Fixed image` behaviour
* Remove unnecessary single quotes
* Remove duplicated const due to rebasing
* Fix focal point getting lost after enabling Fixed bg
* Fix duotone for fixed and repeated images
* Fix duotone for fixed and repeated images on the front end
* Don't allow alt if the image is a bg not an img element
* Start using the `block.json` metadata file for `Handpicked products`
* Add the `properties` attribute to properly parse booleans
* Remove comment
* Add schema, delete version
* Parse categories coming from the back-end as a json array
The category ids that come from php are in json array format (e.g. '[40,41]'),
so it's necessary to parse them and convert them into a js array before
processing them. Otherwise the api request will fail.
* Only parse category ids if not undefined
This PR adds image editing controls to the Featured Product block. In particular, user can now:
* Rotate the image
* Crop the image
* Change the aspect ratio of the image
* Zoom the image
Each edit gets saved in the database as a new image.
* Start using the `block.json` metadata file for the `Featured Category` block
* Get default attributes from the `block.json` file
* Remove unnecessary `get_block_metadata_defaults` function
* Add alt attribute to the block.json file
* Remove unused imports
* Start using the `block.json` metadata file for the `Feature Product` block
* Get default attributes from the block.json file
* Add removed comment
* Remove unnecessary `get_block_metadata_defaults` function
* Add alt default to block.json
* Add new `alt` attribute to Media Settings
Allow to define an alt text for the Feature Product block
* Simplify on change
* Improve alt description and use name instead of short description
Short description can contain html and images, so it's not adequate to use on the alt attribute