* Server side changes for payment method integrations
Including adding a stripe class temporarily
* update needed npm packages (and add some types)
* updates to contexts
* remove stepContent from payment config for payment methods
* update payment method interface and typedefs
Exposing a components property to pass along components that payment methods can use (so we keep styles consistent for them)
* add apple pay and stripe cc integration and remove paypal
* remove save payment checkbox from checkout block
It is handled by payment methods.
* Include an id prop for tabs
* fix activePaymentMethod pass through on rendered payment method element
also adds an id for the rendered tab
* add styles for payment method fields
If payment methods use these classes for their fields then the styles will get applied. It _could_ allow for consistent styling, we may have to provide design documentation for this?
These are styles in cases where payment methods have to use elements provided by the gateway (eg. Stripe elements). In future iterations we could look at providing components to payment methods to use (if they aren’t restricted by the gateway).
* fix rebase conflict
* do a test payment request for applePay to determine if the current browser supports it
* don’t console.error for stripe loading.
* Fix placeholder errors in the editor
* improve styling and add missing validation for inline card element
* update pacakge-lock
* rename payment-methods-demo folder to payment-methods-extension
* expose checkbox control on payment method interface
* export payment-methods-extension to it’s own asset build
This allows us to more accurately demonstrate how payment extensions would hook in to the blocks.
* don’t enqueue a style that doesn’t exist
* add full stop to comments and remove obsolete comment blcok
* fix spacing
* switch `activeContent` to `content` for payment method registration config
* add payment-methods-demo config to sideEffects and install @wordpress/icons and @wordpress/primitives to be used directly.
* configure dependency extraction to ignore imports we want to use directly
* fix style issues for production builds
It looks like when a style is imported on the entrypoint of a component (or in a file with just exports), it get’s treeshaken from the final build _regardless of exception rules_.
* fix style imports from wordpress components
* fix loading skeleton showing on production builds
* fix block skeleton showing on production builds for cart
* import side effectful code
* add treatment for `@wordpress/warning` too
* fix typo
* exclude `settings/block` from sideEffects
* rollback `wordpress-components` update and keep sideEffects fixes
* remove unnecessary handle handling
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* Add bundle size github workflow
This workflow implements a bundle-size monitoring utility for our repository to give better metrics on increases in bundle-sizes. I basically copied the configuration for the WordPress gutenberg project workflow and it utilizes the [`preactjs/compressed-size-action`](https://github.com/preactjs/compressed-size-action).
If this works well, it will replace our existing bundlesize implementation.
* remove bundlewatch and related scripts
* more lint job fixes
- remove build:ci because it was only used for bundlesize check. No need to build files for linting checks.
- add lint:ci npm script for doing build lint checks
- update travis job config to use new script and update title
* change name of workflow
* add errormessage handling to countryinput (along with storybook)
* add types for react
* Add validation context and implement
* implement validation context for country field validation
* tweak ValidationInputError so that it can receive property name for getting error from
* improve storybook webpack config to pull from tsconfig.json
* update storybook story to cover changes with context
* Wrap Checkout Provider with Validation Context Provider
* add screen-reader-text style to storybook
* add styles for input error validation to text input
* improve styling for ValidationInputError component
* add validation error handling to TotalsCouponCode component
And story
* make sure errors are cleared on successful receive/remove item
* dispatch loading cancellation on catching errors
This is needed because loading would be cancelled before the error is thrown so any error handling after the thrown error will not be able to rely on loading.
* implement validation setting for coupon errors
* add error color to labels on inputs too
* fix borders back and force border color
* remove extra structure and improve validation error with alignment for coupon code
* add aria-describedby for text inputs
* add back in validation context provider to fix rebase issue
* rework validation so it works for both checkout and cart
* Some styling tweaks
* more style fixes
* remove unnecessary method
* make sure new function is included in context defaults
* package.lock update? seems harmless so rolling with it.
* add snackbarnotices to notices system
* implement snackbar notices for coupon code ui
* improve styles with mobile styles as well
* some more css fixes
* use native filter
* remove usage of lodash filter and dont’ output container if there are no regular notices
* remove unnecessary duplication of styles
- load default snackbar styles from WordPress components
- override for frontend to make them fixed to the window (including mobile treatement).
* simplify css class generation (save some bytes)
* improve proptypes definition
h/t: @aljullu
* consistent style handle name
* increase bundle size budget
* Add missing props to sidebar-layout components
* Move specific CSS class to checkout block
* Add comment on top of @wordpress/components styles in webpack entry
* Make it so our styles load after vendor styles
* Remove unnecessary @todo comment
* Add Order Summary card to Checkout sidebar
* Improve responsive layout
* Increase cart.js bundlewatch size
* Remove wrong comment
* Remove unnecessary usage of useStoreCartItemQuantity
* Refactor layout so the product description can occupy more width
* Move paddings to the button so focus styles look better
* add plukedAddress util function in order to use it for shallowEqual
* refactor useShipping so it accepts and returns the address
* refactor fields
* fix test and return shippingRates to hook
* remove unneeded shippingAddress from ShippingRatesControl
* move keys logic to hook
* refactor tests again
* increase cart size
* update plugin build script to allow for development builds
* add new npm scripts to package.json
- running dev build without watch
- building a plugin zip for dev build.
* tweak script to have zip only build
* update docs to include new build options
* improve command docs
* fix broken e2e test - update snapshot for checkout block:
- new `use-shipping-as-billing` data attr
* add package.json script for updating e2e test snapshots
* Working on store provider
* Working on store provider
* Reducer implementation
* Implement core/notices
* Add notices to store coupon hook with context
* Improve store notice text and styling
* Improve JS side API for notices
* Wrap functions with context additon
* Update test to []
* Implement props feedback and useInstanceId
* Update assets/js/base/context/store-notices-context.js
Co-Authored-By: Darren Ethier <darren@roughsmootheng.in>
* Update assets/js/base/context/store-notices-context.js
Co-Authored-By: Darren Ethier <darren@roughsmootheng.in>
* remove instance id
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
* useStoreCartCoupons hook
* Apply coupon w/ basic error handling for the fetch
* Basic store specifically for cart data
* Working on error states
* Show error on coupon fail
* removeCoupon action
* Added extra endpoints for more efficient cart queries
* Apply/remove coupons working
* Track applying/removing state
* StoreCartCoupon typedef
* Use coupon code on index
* Remove custom controls definition
* Adjust storecartcoupons mapper and remove ref
* Move cartData defaults and remove ref
* Call API directly, avoid schema lookup
* Improved selectors
* StoreCart typedef
* Split up cart state data and add more typedefs
* Add API tests for apply/remove coupon
* Jest tests
* Move default cart data to constant
* Comment indentation
* install typescript and add typedef support
* add typedefs for Cart things
* improve typescript config
- adds more base config
- add our aliases
* fix error caught by typescript!
* Tweak typescript configuration
* Add missing `@woocommerce/settings` alias to ts config
* Add alias for type-defs