* Convert sharedConfig and Title blockConfig to TS
* Convert constants.tsx to TS
* Convert attributes.js to TS
* Amend attributes.ts record type
* Convert title component edit.js to TS
* Convert title component block.js to TS
* Amend product name index.tsx to prevent TS errors in product title block.tsx
* Amend product-name and base tsconfig
* Add rel to ProductName component element
* Replace ReactElement with JSX.Element
* Move TagName component to outside of the main component
* Add HTMLAttributes import
* WIP: Add props to TagName component
* Fix TagName typing
* Update TagName interface
* Replace ReactElement typing with JSX.Element
* Code review feedback amends
* Replace return type undefined to void
Co-authored-by: Michael P. Pfeiffer <michael@cssconf.eu>
* Pass classname from DOM to react components
* Actions Block ClassName support
* Form step field classname support
* Payment block className support
* Classname support for fields and totals
* Order summary classname support
* Classname support for order note block
* Express payment classname support
* Terms block custom class
* Let useBlockProps handle class in actions block
* add handleMap
* remove useValidation from cart blocks
* add namespace options to docs
* Update packages/checkout/blocks-registry/README.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* expand on the docblock
* Update packages/checkout/blocks-registry/README.md
Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Remove icons from checkout button
* Add new block type
* Register new block
* Remove unused attribute
* Add to new template
* Remove duplicate attributes
* Update Inner Block handling to use consistent appender and unlock payment methods
* Add dark mode inputs toggle to top level block
* Remove top level attributes which moved to inner blocks
* Remove unused components
* Pass down hasDarkControls and currentView via context props
* Update default empty template on server side
* template->registeredBlocks wording
* useForcedLayout: insert in correct place
* Remove test div
* Clarify inline docs
* Apply changes to cart block
* Convert product elements shared config to TypeScript
* Limit import to type
* Convert deprecated empty save function
* Add comment explaining omitted attributes and title properties
Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>
* Calculate human readable price values for the purpose of screen readers and set them as the aria values
* Calculate human readable price values for the purpose of screen readers and set them as the aria values
* Update API to add default boolean to attribute values and use this within the component to set the default attributes.
* Modify and add unit tests for isObject and getDefaultAttributes
* Sanitize attribute name to accommodate for custom attributes being default values.
* Comments for sanitized_attribute_name variable
* Remove second argument from getAttributes
* Replace context with __experimentalShareWithChildBlocks
* Switch to parent block when changing views
* Swap order of views
* Drop default, use first view
* Improve block selection after changing views
* WIP getting to work on frontend
* restore frontend.tsx
* fix layout
* support emtpy cart in frontend
* add cart tital to correct place and move useEffect
* Improve the type for callbacks registered by extensions
The previous type was CanMakePaymentCallback, used for the payment methods's own canMakePayment callbacks, which could also return Promises. In order to eliminate the confusion, a new type has been created that defines callbacks that only return true or false.
* Document registerPaymentMethodExtensionCallbacks
* Update docs/extensibility/filtering-payment-methods.md
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Add information about payment method name in documentation
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* WIP getting to work on frontend
* restore frontend.tsx
* fix layout
* remove unit tests living where they shouldn't be living
* remove skeleton
* support emtpy cart in frontend
* remove extra todo
* use fragment instead of div
* Add empty cart event
* Remove extra fragment
* Add cartCoupons to canMakePayment argument
* Add cart to the paymentMethodArgument and improve the dependencies for the effect calling refreshCanMakePayments
* Debounce refreshCanMakePayments
The initial approach was to debounce billingData and use this value as a dependency for the useEffect that runs refreshCanMakePayments.
But because the depencies array can always change we decided to debounce the callback instead, ensuring this way that callback is not called multiple times: for example when typing a field in the billing address. Debounced was chosen instead of throttle because we want to call refreshCanMakePayments once the change event has stopped, with the final value.
* Update types and docs related to canMakePaymentArgument
* Mock the /cart call when testing payment methods
* Remove unused cartCoupons key in canMakePaymentArguments' interface
* woocommerce/woocommerce-blocks#3906 screen reader fix for order summary block
* removing tabIndex and extra accesibility text
* adding aria-hidden to total price and translation comments change order
* Support express payment methods filtering by extensions
* Add tests for getCanMakePayment and fix payment tests' TS errors
* Add comments for payment-method-config-helper test