* Clarify docs for STARTED
* Clarify docs for setActivePaymentMethod
* Remove useActivePaymentMethod hook (this held state for active methods and tokens)
* Update type defs
* Enhance setActivePaymentMethod action to accept method data
* SET_ACTIVE_PAYMENT_METHOD action
* Add setActivePaymentMethod dispatcher and make "started" status only
* Update setActivePaymentMethod usage in express methods
* Set radio control defaults
* Consolodate tokens and methods
* Update assets/js/base/context/providers/cart-checkout/payment-methods/reducer.ts
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* Spacing
* Split saved cards tests from regular, since saved cards are checked by default
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* add view switcher for mini cart contents block
* editor view switcher
* update mini cart template file
* render the empty state template parts for the Mini Cart Block woocommerce/woocommerce-blocks#4674
render the empty state template parts for the Mini Cart Block woocommerce/woocommerce-blocks#4674
* update selector
* allow empty mini cart block to add all blocks
* fix tests; improve code style
* install @wordpress/block-editor package
* fix warning on frontend side
* block-editor package is not necessary
* merge attributes object
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Fix link to edit the Mini Cart template part in WP 5.9
* Use wp_is_block_theme() function
* Add protection against overwriting isSiteEditorAvailable setting
* Rename isSiteEditorAvailable to isBlockTheme
* Update icon of legacy template block
* Display legacy block template color in Woo purple
* Display icons in white when block being selected within list view
* ship component stories for storybook
* Refactor RemovableChip for Storybook
* Implement lucio feedback changes
* RemovableChip is part of the Chip story
* Typedefs and cartData for the payment interface
* fix case on noticeContexts
* typeof for enums
* immutable note
* Add cartData to docs table
* Rebase docs
* Update packages to latest Storybook deps
* Migrate `ReadMore` component and its utils to TypeScript
* Add type definitions for `trim-html` package
* Migrate `ReadMore` stories to newest Storybook
Fixeswoocommerce/woocommerce-blocks#5254
* WIP
* Converted block-error-boundary to TS
* Convert CheckboxList to TS
* Converted Chip and Removable Chip components to TS
* Change type to React.FC<T>
* Fix tests
* Implement Lucio feedback
* Mini Cart block: Add label for tax when it should be visible in accordance with WC settings woocommerce/woocommerce-blocks#4849
Mini Cart block: Add label for tax when it should be visible in accordance with WC settings
* improve the tax label handling
* fix code after conflict
* fix tax label handling when it is added the first product
* add another check for avoid PHP error
* rename variables; add test for the function getSettingWithCoercion
* add margin-right for tax-label; add test to check if type guard works correctly
* Convert `ErrorPlaceholder` and `ErrorMessage` to TypeScript
* Add stories for `ErrorPlaceholder` and `ErrorMessage` (https://github.com/woocommerce/woocommerce-blocks/pull/5255)
Stories include:
* Default generic error
* API error
* Unknown error
* Error without possibility to retry
* Base Error atom
Where applicable, the **Retry** button will not only trigger the appropriate
action, but also simulate the loading state of the error component.
* Update references to `ErrorMessage` component to leave the file extension out
Fixwoocommerce/woocommerce-blocks#5255
Refs woocommerce/woocommerce-blocks#5249
* Add global style for product categories list block woocommerce/woocommerce-blocks#4965
Add global style for product categories list block
* add support for link color
* add feature flag
* fix code style and PHP warning
* update doc comment
* remove empty space
* refactor StyleAttributesUtils (https://github.com/woocommerce/woocommerce-blocks/pull/5277)
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Mini Cart Block: add link to edit template part from sidebar woocommerce/woocommerce-blocks#5186
Mini Cart Block: add link to edit template part from sidebar
* fix e2e tests
* Product details metadata now accepts as a default prop, with as an optional alternative
* Updated product details test snapshot
* Don't overwrite key prop
* One of key or value must be entered in ProductItemResponseData type
* Convert ReturnToCartButton component to TS
* Convert FormStep component to TS
* Remoe proptypes from FormStep and AddressFormn components
* Converted order-summary component to TS
* Convert product-price component to TS
* alias path to type-defs
* Fix errors
* Changes from Thomas feedback
* Change minPrice maxPrice logic to be more robust
* Changed types from inline to interface in ReturnToCartButton component
* Check for string type in order-summary-item
* add missing isString check
Within the editor, the checkbox appeared aligned at the bottom of the paragraph, while
on the front-end it would appear aligned at the top. The alignment was actually correct
but a top margin was assigned to checkboxes in the backend.
Instead of removing that globally, this commit resets it for checkboxes within the checkout
block.
* Fix wrong event prefix in doc comment
* Make className prop in CartLineItemsTableProps optional
* Mini Cart as template part
* Remove BlockTemplatePartsController and instead use BlockTemplatesController
* Remove old code
* Clean up frontend rendering
* Update tests
* Improve if clause
* Fix wrong tests title
* Fix wrong variable name
* Make sure Mini Cart contents block is unmounted whem mini cart closes or unmounts
* Remove unnecessary waitFor
* Fix PaymentMethodDataProvider wrong children type
* TypeScript fixes
* Make comment shorter
* Remove test code
* Fix contant unmounts of Mini Cart contents block
* Fix wrong template_type passed
* Set Template part area to 'uncategorized'
* Set Template part area to the correct value
* Move template dir check outside loop
Previously, our legacy template block was locked to prevent the users from
removing it. The block could however be removed by erasing the parent, so
this change allows the user to directly remove the block itself.
Also:
Closeswoocommerce/woocommerce-blocks#5163Closeswoocommerce/woocommerce-blocks#5109
* Fix error on the Cart block
* Created a cartIsHydrated variable in useStoreCart hook and used this to update the billing address in the internal state of the useCustomerData hook
* Fix the country is required error on the Cart page using refs
* Separate api calls to update shipping and billingUpdate billing and shipping addresses only when needed in API calls
* Remove redundant check for customerDataToUpdate
* remove use of refs in initial values
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
* Added a placeholder to the product search block editor to indicate that the user can change the placeholder on the front end
* Changed the placeholder to be translatable