* Move text-input to checkout package
* Add support to TextInput for inputs with type number
* Add ExperimentalDiscountsMeta.Slot to Cart sidebar
* Add extra styles for Button and Panel components
* Add updateCartFromApi util to @woocommerce/blocks-checkout
* Change updateCartFromApi to TypeScript
* Stop passing contexts through the discounts slot fill
* Add CartExtensionsSchema class
* Add CartExtensions Route
* Add register_update_callback and get_update_callback fns
* Add extensionCartUpdate function
* Add applyExtensionCartUpdate action
* Make extensionCartUpdate use batching
* Add ExtensionCartUpdateArgs type definition
* Execute a success/error function after request in extensionCartUpdate
* Remove success and error functions
* Avoid including all schemas in CartExtensionsSchema instantiation
This is achieved by inheriting AbstractSchema and slightly modifying the way in which the latest cart data is returned from this endpoint.
* Update docs for extensionCartUpdate
* Handle errors from extension callbacks
* Throw better errors when incorrect namespace/functions are used
* Add tests for CartExtensions route, ExtendRestApi update callback registration
* Add dummy get_properties method to CartExtensionsSchema
* Block Widgets: add transforms for legacy widgets with a block equivalent
* Update All Reviews block transform to more closely resemble the widget
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Convert integers to boolean
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Move text-input to checkout package
* Pass validation props directly to ValidatedTextInput
* Import label relatively instead of from package
* Pass validation functions to ValidatedTextInput
This is so it doesn't need to get them from useValidationContext.
* Add InputProps to ValidatedTextInput
This will be used to control additional props on the input element of TextInput
* Spread inputProps onto <input> element of TextInput
* Export TextInput from @woocommerce/blocks-checkout
* Add @woocommerce/blocks-checkout package to tsconfig
* Allow styling to be applied to number inputs and when value is 0
* Make style order consistent
* Remove inputProps to rely on rest in TextInput
* Add specific prop for the inputErrorComponent
* Only disallow active state if value is 0 AND type is number
* Change all uses of ValidatedTextInput to also pass inputErrorComponent
* Revert "Change all uses of ValidatedTextInput to also pass inputErrorComponent"
This reverts commit ec734b99c20c4d29fcf778714246fc406ee37eaf.
* Revert "Remove inputProps to rely on rest in TextInput"
This reverts commit 1fc64cca4002206423d1fa443ff2d60130ba1ea0.
* Revert "Revert "Change all uses of ValidatedTextInput to also pass inputErrorComponent""
This reverts commit 110e3606a996668be5a32698b634b7706d16cddc.
* Revert "Revert "Remove inputProps to rely on rest in TextInput""
This reverts commit aeb03526c44b3fcc97a719a18930d08157a80baf.
* Don't pass errorMessage to ValidatedTextInput
* Add DiscountsMetaSlot
* Add ExperimentalDiscountsMeta.Slot to Cart sidebar
* Add extra styles for Button and Panel components
* Export ExperimentalDiscountsMeta from checkout package
* Add updateCartFromApi util to @woocommerce/blocks-checkout
* Add comment to updateCartFromApi
* Change updateCartFromApi to TypeScript
* Revert "Move `TextInput` to checkout package and allow it to be used for input type=number (https://github.com/woocommerce/woocommerce-blocks/pull/4238)"
This reverts commit ee9b2d20e0.
* Stop passing contexts through the discounts slot fill
* Allow ValidatedTextInput to be used for type=number
* Remove contexts from Discounts slot fill
* Update snapshots
* Stop `errorMessage` being spread onto input fields in checkout
* Add paths to tsconfig
* Remove contexts from Discounts slot
* Accept step min and max on ValidatedTextInput
* Remove "no-margin" option on buttons
* Remove spinners from input type number
* Remove `no-top-border` style from panel
* Prevent text in buttons from breaking in the middle of words
* Add checkout package to tsconfig file list
* Stop passing components through DiscountsMetaSlot
* allow for WOO_VERSION config in tests setup
* pass through WOO_VERSION environment var to container
* force specific WOO_VERSION value for phpunit test run
* try passing through environment variable via docker arg
Also set .env for controlling local runs of phpunit
* Move type defs
* Move type guards
* Fix imports
* Extract prepareTotalItems to TS file
* usePaymentMethodInterface as TS file
* Fix TS props
* Fix currency type defs
* Add return type to usePaymentMethodInterface
* Add key prop to CartTotalItem
* Fixed up js tests
* Move SymbolPosition into type-defs package
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
* Hide "including x in taxes" if tax amount is 0
* Add jest types to tsconfig
* Move SHOW_TAXES into component body
This is to make the code more testable and allows us to change values. There's no significant performance impact because of this change.
* Add tests and snapshots for TotalsFooterItem