* 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 back icon
* Add cart URL constant
* Add button components
* Implement button components into checkout
* Update checkout styles to match mockup incl updates to margins and padding
* Add options to control return to cart link
* Use checkout context
* Update snapshot
* Update context
* href
* Color/arrow styling
* Implement select instead of open URL field
* Add notice and updated settings control
* Show notice conditonally
* Store permalinks to avoid extra API requests, and get pages via API
* Update snapshots
* Fix double layout conflict
* Switch back to ID and add permalink via block setting
* snaps
* Fix snapshot; add default shape for pages
* Feedback
* Better undefined handling
* Update assets/js/blocks/cart-checkout/checkout/block.js
Co-Authored-By: Darren Ethier <darren@roughsmootheng.in>
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
* Fix address form layout broken because select was occupying too much space
* Fix shipping rates appearing in the Checkout sidebar
* Center button text
* add a hook for throwing errors in a hook callback.
* implement new useThrowError hook
* throw errors when selected shipping rate results in a rest error
* add error handling for various shipping rate error response types
* fix borked merge conflict resolution
* remove throwing error and use correct property for coupons
* add missing default address in use-store-cart
* add missing notices provider
* Include shipping and billing address data in cart schema
* update cart hook (and data api) with new properties from endpoint
* add use-shipping-address hook and implement in use-shipping-rates
* update usages of useShippingRates through code
* update tests for use-shipping-rates
* update use-payment-method-interface and typedef to remove country field
This is provided reliably via the shippingAddress now.
* restore pluck comparison to effect.
Also added some clarification docs for why `iniitalAddress` is not included in the effect dependencies.
* remove billingAddress from cart schema
* clear city and postcode when changing country
* Update REST Api schemas aftere rebase
- CustomerSchema no longer exists
- Added ShippingAddressSchema implemented by Cart and Order schemas
- fix broken js because of bad merge conflict resolution.
* remove duplicate keys
* 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
* Refactor useShippingRates so it doesn't use Object.fromEntries
* Refactor Checkout form CSS so it doesn't use grid autopositioning
* Fix Payment Methods title occupying too much space in IE11
* Fix payment methods tab icons not centered in IE11
* Move cart attributes to attributes file
* Stop feedback prompt jumping around; consolodate strings
* Update option labels and descriptions
* Match checkout save function
* hasShippingRate helper
* Refactor full cart/frontend views for shipping calc
* Add hasShippingAddress to useShippingRates hook
* Initial shipping calculator in totals row implementation
* Create cart context
* Update preview data to match API response
* Use context provider for cart
* Provide default cart item for placeholder with correct shape
* Remove outdated shape validation from cartlineitemrow
* Use preview data in editor context
* Tidy up components
* Tests/lint
* Update assets/js/base/components/totals/totals-shipping-item/has-shipping-rate.js
Co-Authored-By: Seghir Nadir <nadir.seghir@gmail.com>
* No need to camel case previewdata
* Use isValidElement
* Implement EditorContext
* Use select if no post is given
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* Set min-height to 0 for Country & State hidden inputs
* Fix button styles broken in the Cart block in editor
* Avoid having editor.scss specific stylesheets for button and totals
* Move Button inside cart-checkout subfolder
* add valueWithTax to CartTotalItem typedef
* Finish off `prepareTotalItems` to include totals with taxes and also add tests
* add whether prices should include tax to the payment method interface
* only export the hook, not the util function
* Indicate values are in subunits
* rename property so it’s consistent with typedef and implement
* remove throwing errors if there’s an error in state.
These type of errors should be surfaced to user as needed via an error notice, not as a blocking error boundary. Error boundary should only be for non-recoverable errors.
* prevent default behaviour for applyCoupon button
* add various hooks and improve hooks folder structure
- Also restructures hooks directory to make things a bit more organized
- Add useStoreOrder placeholder (followed up in future pull)
- Add useBillingData hook.
* implement usePaymentMethodInterface hook in payment method components
* remove obsolete hooks and implement new checkout context hooks
- add useCheckoutSubmit which exposes checkout submit button interface
- add useCheckoutRedirectUrl which exposes checkout redirect url interface
* add alias for `@woocommerce/base-utils` to jest config
* use consistent variable names for payment method id
* sticky footer checkout submit button on mobile
* fix storefront footer icons overlaying sticky checkout CTA footer:
- bump z-index of sticky CTA container
- storefront icons have weird z-index due to css opacity
* hide storefront footer on woo cart page only
* remove storefront specific bug fix for sticky cart footer:
- will log this issue separately
* add isEditor to checkotu context and implement in provider usage
* modify configuration expectations for payment method registration api
* update registration of payment methods in demo
* implement new configuration in payment method components
* fix argument order and update jsdocs
* fix proptypes declaration.
This ensures that when `lowStockRemaining` is included it’s either null or a number.
* Ensure backorders_allowed value is boolean.
* add missing properties to cart preview
- restructures `@woocommerce/base-context` imports so it pulls from `index.js` in the `base/context` folder. That way tree-shaking will be used if possible. This also helps with organizing the folder structure a bit better for the new contexts.
- Fixes all the various imports through the code due to the above change.
- Adds `CheckoutContextProvider`, `useCheckoutContext` and related files.
- Adds `PaymentMethodDataProvider`, `usePaymentMethodDataContext` and related files.
- Adds `ShippingMethodDataProvider`, `useShippingMethodDataContext` and related files.
- Adds typedefs used for the various context interfaces.
* default to the first state
* Update assets/js/base/components/state-input/state-input.js
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
Co-authored-by: Albert Juhé Lluveras <aljullu@gmail.com>
- `useStoreCartItemQuantity` now receives the cartItem instead of the `cartItemKey` as an argument. I didn't notice in previous reviews how it's used in the context where we already have a cartItem so implementing this reduces complexity and makes the hook more precise for it's purpose.
- Add `backorders_allowed` to the CartItem schema for the API. This allows for client to have correct logic for maximum quantity when this value is true.
- Implement the above in the `CartLineItemRow` so that quantity picker is limited by the amount of stock remaining if that is available (`lowStockRemaining`) and the `backorders_allowed` is false.
- maximum quantity is currently hardcoded to a (filtered) value of `99` when other conditions don't apply (see related issue in woocommerce/woocommerce-blocks#1913)
* Avoid importing @wordpress/components in icon library
* Avoid @wordpress/compose and @wordpress/components in `base`
* Move hocs used on frontend to base
* Revert "Move hocs used on frontend to base"
This reverts commit bf09016fdc2fc1bea2f465018fecc76945f69d5e.
* 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
* tidy cart totals layout on mobile:
- totals column is full width
- reset container (card) borders and padding
* increase specificity of mobile cart styles to ensure skeleton hides after load
* use "not loading" && "not skeleton" approach for more readable mobile style selector
* Move default address fields to blocks; normalise address i18n
* Use optionalLabel and other props from addressFields
* Fix apartment field display
* Country address fields
* Fix default field order
* Update for countries with no states
* Add type defs
* add typedefs for CartItem
* remove cartItem from StoreCartItem typedef
* Implement new typedef and fix defaults as well as returned object.
Now that `cartItem` is only used internally, the default set on the state only has to be the properties required internally in the hook.
* add typedefs for shared settings and implement typedef comments.
* change hook name
* rework the quantity change generator action so the UI updates quick:
- work in progress - still need to figure out how to debounce API call
- add new action for updating quantity for an item
- don't set cart item as pending while quantity is updating
- this leaves QuantitySelector enabled so user can click more/less
- use receiveCartItemQuantity to update quantity in UI before sending request
* debounce line item quantity first cut:
- use local state for quantity, so ui allows multiple clicks up/down
- debounce store updates (and server/API call)
* correct comment on cart item quantity reducer
* remove recieveCartItemQuantity - no longer needed
* remove delegation for deleted RECEIVE_CART_ITEM_QUANTITY
* only update quantity in component sideffect if it has changed:
- reduces unnecessary renders
* factor out debounced quantity update into cartItem hook (hat tip @senadir)
* use quantity from store, instead of passing in to hook +
+ fix latent bug in useStoreCartItem - the cartItem value is now object:
- was previously single-item array
- (note no client code is using this at present)
* tidy/refactor cart item hook - separate dispatch from select
* remove dud reset of item pending flag (came back in rebase)
* add quantity to StoreCartItem hook return value typedef
* fix js error when adding cart block in editor – cartItem not found
* fix typedef
* fix logic for debouncing
* don’t update quantity on server unnecessarily
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
* add select shipping endpoint to router
* add select shipping method
* add selected rates to cart
* better select rates
* move schema function to seperate function
* move validation to Cart Controller
* fix wrong session key
* Update shipping/cart endpoints (https://github.com/woocommerce/woocommerce-blocks/pull/1833)
* Items should not have keys in API response
* Include package ID in response (this is just a basic index)
* /cart/select-shipping-rate/package_id
* Add package_id to package array
* Update responses and add shipping-rates to main cart endpoint
* update-shipping endpoint
* Add querying selected shipping rate to the store (https://github.com/woocommerce/woocommerce-blocks/pull/1829)
* add selecting shipping to store
* directly call useSelectShippingRate
* refactor cart keys transformation to reducer
* remove selecting first result and accept selecting
* move update shipping to new endpoint
* pass selected rates down
* select shipping right directly and fix editor issues
* fix some broken prop types
* key -> package id
* Update and fix cart/shipping-rate tests
* fix case for when rates are set
* Update useShippingRates test
* add args to rest endpoint
* move selecting shipping rate logic to hook
* fix some naming issues
* update propTypes
* update action call
* fully watch cart state
* address review issues
* fix prop type issues
* fix issue with rates not loading in checkout
* remove extra package for shipping
* move ShippingCalculatorOptions to outside
Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Albert Juhé Lluveras <aljullu@gmail.com>
* ensure cart totals update when items are removed (prototype):
- return complete cart object from DELETE cart/items/:key
- use receiveCart on client to update whole cart including total
* move API endpoint for removing cart items to cart controller:
- returns full cart schema so should be part of cart controller
- is now a POST request with param - not strict REST
- fix up client action to use new API
* move API test for removing cart items (API has moved)
* use correct path for remove API in tests (doh!)
* add extra API test for remove_cart_item with bad key => 404 (experiment)
* experiment: delete test_remove_cart_item, does test_remove_bad_cart_item work?
* reinstate test_remove_cart_item with single valid request
* remove unnecessary newline
* tidy comments in PHP api tests, rerun travis?
* remove test_remove_cart_item which may be causing problems
* reinstate troublesome remove cart item api test (experiment):
- see if this works now travis issue is resolved
* whitespace
* show correct total when changing cart item quantity:
- move update cart item quantity API to cart controller
- & return full cart response
- update js action to new API route & receive full cart response
* simplify test_remove_cart_item API test - now just tests a valid remove succeeds
* remove test_update_item (API has moved) +
+ experimentally remove test_remove_bad_cart_item
- testing if cart remove tests interact with each other
* fix tests (🤞) - pass params in body, not as query params
* reinstate test for re-deleting same item
* update API docs - update/delete cart item have moved to /cart
* add response data checks to new cart API tests:
- extra protection against expected 404 "false positives"
* reinstate API test for changing cart item quantity
* fix remove cart item body tests - MIA items return error code, not cart
* fix test - quantity param is int not string
* attempt fix 404ing test_update_item:
- only allow POST, remove trailing `/`
- align array equals for good measure :)
* fix action for update-item - method=POST, now takes body params
* fix response body asserts in test_update_item
* reinstate update_item and delete_item on CartItems controller
* typos + examples in new cart items API docs
* reorder previous cart item docs to minimise diff/churn
* reinstate tabs in docs response example
* Fix background overlap of feedback box
* TS notices
* Add company name toggle
* Implement new attributes and toggles in editor
* Handle field config in address component
* Remove other hoc rule from tsconfig
* map -> forEach
* Remove return from forEach
* Export and extend field config
* Fix optional text for all field types
* unit text
* Update snapshot
* add a smaller min-width for cart column on smaller screens
* ensure full price is inline on mobile (when visible)
* ensure line item totals are bottom aligned even if quantity cell is huge
* revert price vertical alignment - in design they are aligned with quantity digit
* Create useShippingAsBilling attribute
* Fix missing prop
* Refactor FormStep so stepNumber is generated by CSS instead of being passed as a prop
* Add billing address form
* Add text before controls
* Remove old @todo comment
* 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>
* first cut - removing an item from cart:
- add actions to cart store for removing an item and keeping track of
pending removal API call
- add reducer logic for storing pending state on an item, and removing
an item
- expose removeCartItem on new useStoreCartItems hook
- hook it up to remove link / trashcan icon in row item
* disable cart quantity picker/remove link while API request in progress:
- expose cart item pending status from store using selector
- use selector to disable quantity related components in line item row
* add typedef for cart items store object provided by hook
* allow user to change quantity of cart items (first cut):
- add action for replacing a cart item in the store
- add generator action for changing quantity
- expose change quantity action on useStoreCartItems hook
- hook up to quantity UI in cart block
(work in progress)
* post-rebase fixes & fix broken typedef:
- rework cart item change quantity callback - now supplies item key like
remove callback
- fix hook StoreCartItem return value typedef - single item with
specified key, was array of all items
- add quantity JSDoc for changeCartItemQuantity action
- remove changeQuantity callback from UI (currently infinite looping)
* fix bug in recieveCartItem reducer - check keys for equality:
- was key === object
* fix invalid url in POST cart/items/quantity request
* hook up cart line item quantity to API:
- remove internal state/ref for QuantitySelector, is now a controlled
component
- call changeQuantity action from QuantitySelector change callback
* QuantitySelector no longer needs a ref to wrangle number input value
* hoist quantity state out of QuantitySelector into story (fix storybook)
* add product sold_individually option to cart item API response
* limit sold_individually items to 1 per cart/order:
- support optional max value in QuantitySelector
- set maximum dependent on sold_individually API field
* prevent user from requesting zero x cart item (API 500 errors):
- add minimum limit to QuantitySelector
- default limit to 1
+ fix bug with limiting to maximum value in number input change handler
* remove useStoreCartItems, zombie hook coming back from rebase 🧟♂️
* address various review feedback:
- inline undefined check, don't use lodash
- quantityInputOnKeyDown callback hook depends on canIncrease/canDecrease
- also removed undefined check for minimum, as minimum has default 0
* use safer typeof check for presence of maximum prop
* Fix Product search block in last Gutenberg release
* Convert ProductSearchBlock to a functional component
* Split ProductSearchBlock into two components
* first cut - removing an item from cart:
- add actions to cart store for removing an item and keeping track of
pending removal API call
- add reducer logic for storing pending state on an item, and removing
an item
- expose removeCartItem on new useStoreCartItems hook
- hook it up to remove link / trashcan icon in row item
* disable cart quantity picker/remove link while API request in progress:
- expose cart item pending status from store using selector
- use selector to disable quantity related components in line item row
* fix jsdoc - getCartItem returns undefined if not found
* add typedef for cart items store object provided by hook
* fix rebase error - key prop went awol
* orient useStoreCartItem hook to single cart item:
- simplify interface for client component
- isPending bool (was callback)
- removeItem callback no need to specify item key
+ reinstate disabled prop on remove link when updating (lost in rebase)
* move cart item pending state out of cartItems, preserve API state shape:
- pending is now stored as array of keys
- fix isItemQuantityPending selector (now much simpler)
* ensure react knows that our useSelect depends on cartItemKey
* add basic story for QuantitySelector (so can easily test disabled)
* add disabled prop to QuantitySelector:
- apply to all input controls
- add storybook knob for testing
- use disabled grey for number edit when disabled
* fix indentation of jsdoc comment (linter is coming)
* use self-closing tag in QuantitySelector story
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
Co-authored-by: Albert Juhé Lluveras <aljullu@gmail.com>
* Persist previous shipping rates while loading
* Refactor ShippingRatesControl LoadingMask
* Show package name
* Simplify CSS to avoid using the adjacent selector
* Add comment to explain why 'selected' is hardcoded in the editor
* Rename package 'index' to 'key'
* Chip componet and styling
* Tests
* Move coupon code for API requests to body - fixes issues with coupon codes containing special characters
* Implement chip component in cart page
* Revert "Move coupon code for API requests to body - fixes issues with coupon codes containing special characters"
This reverts commit ac5a72f55d51d939bb989f3936e28cf993af19a6.
* Update comment
* prevent overflow
* Add screen reader text for coupon name
* Adjust icon alignment and padding/hit box
* update string
* Checkout block: don't show message of missing shipping options if they are already set
* Use 'wc_get_shipping_method_count' to check if shipping methods are created
* Fix frontend error
* Check exists before calling a method on it
* Fix Configure Shipping Options button mispositioned in last Gutenberg release
* Tidied up source code for line item row and fixed image placeholder support
* Return null if not rendering
* Add is loading state and className to cart block
* Hide title if there are no items
* Add placeholder rows when there are not items and cart is loading
* Pass though isLoading to cart
* Set defaults for cart item rows
* Style the placeholder elements
* Move placeholderRows
* Remove getPriceNumber
* Move decodeEntities
* Split up utils
* Move coupon code for API requests to body - fixes issues with coupon codes containing special characters
* Use wc_format_coupon_code when applying/removing coupons via the cart endpoint
* Add tests
* calculate regular price for line item and return in API `line_subtotal`
* restore `line_subtotal` api field to previous behaviour
* correctly handle discounts on cart line items:
- return product `prices` in cart items endpoint
- calculate full price and discount on client using product
regular_price * quantity in cart
* add product prices to preview cart API data
* show product sale price discount in "save" badge:
- previously we were displaying any effective discount, e.g. from coupons which apply to whole cart
- now this badge will only display discount due to product on sale - much simpler
* rename sale badge class (discount => sale)
* clarify docs for line_subtotal - includes sale prices, not coupons
* clarify line_total docs
* add prices to schema (fix unit test)
* fix schema unit test - return `prices` as object, consistent with `totals`
* Further line total rewording
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* 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
* Add product name and quantity to cart shipping rates endpoint
* Make text accessible
* Add styling
* Create Packages component
* Add preview shipping rates to editor
* Add onChange default value
* Order props
* Use CSS instead of JS to render commas between package elements
* Change quantity type to number instead of integer
* 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
* add cart settings
* address typos
* update how settings should work
* get settings from woo and pass them to frontend
* reapply condition
* fix issue with attributes not presisting
* abstract shipping control
* rename constants
* update props in frontend
* fix bug with attributes not presisting
* conditionally display prices
* use country to decide to show prices
* disable shipping if shipping is not enabled
* enable coupons by default
* Add support for image for product categories block.
* Resolve feedback and style images, w/ thumbnails
* Toggle visibility of option based on list style
* Remove image size variable
* hasImage false by default
* reset styles
Co-authored-by: strarsis <strarsis@gmail.com>
* Add autocomplete support for textinput
* Add autocomplete fields to forms
* Prefix default ids
* Hack for autocomplete on custom select components
* Restore labels and avoid reset of state
* State field autocomplete
* Fix calculator autocomplete
* Simplify existance of hidden field
* move label on autofill preview in chrome
* Put back state clearance
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* hook up cart items to API data in front end (first cut)
* correctly decode entities in product attributes in cart:
+ support unnamed attributes
* correctly render markup in cart line item descriptions:
- description api field is html, so use dangerouslySetInnerHTML
* fix PropTypes - cartItems, not items
* hook up cart totals area to API data +
+ move editor preview totals data to resource-previews (to match API)
* tweak/tidy todo comments for cart front end
* use shorter summary field for cart line item blurb
* render empty cart inner blocks on front end when shopper cart is empty
* ensure empty cart doesn't show while cart contents is loading
* decode entities in attribute names when rendering cart items
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* factor out cart data to a custom hook + exit earlier while loading
* wrap preview/sample cart variation data for translation
* use RawHTML component for rendering cart line item summary +
+ linter whitespace tweak
Co-authored-by: Albert Juhé Lluveras <aljullu@gmail.com>
* Implement last modified header for the products endpoint.
* Invalidation handling
* Freshness
* indenting correction
* Remove freshness and resolve feedback for last modified handling
* Remove getCollectionTimestamp
* Move logic to resolver
* Handle state during INVALIDATE_RESOLUTION_FOR_STORE
* Improved placeholders of translatable string
* Improved one more string
* Include wordpress element package
* Implement __experimentalCreateInterpolateElement for translations
* Dump fragments
Co-authored-by: Claudio Sanches <contato@claudiosanches.com>
* Create ShippingCalculatorAddress block
* Make 'change address' button to open/close the address form
* Create ShippingCalculator component
* Use CountryInput and CountyInput instead of TextInputs
* Fix city value not being set
* Fix shipping rate not appearing when there was only one option
* Unify postalCode and postCode to postcode
* Rename 'county' to 'state'
* Add reset styles for popular themes
* Increase cart-frontend.js max size
* Split CountryInput and Select
* Create County Input
* Show text input when there are no county options
* Reset county value when changing country
* Fix keyboard navigation
* Hide checkmark
* Add reset styles for several popular themes
* Add country prop to ShippingCountyInput
* Create ShippingMethodsControl component
* Hook up shipping methods to API
* Add support for several packages
* Add tests to useShippingRates
* Fix shipping_rates property name
* Only show the products list if there are several packages
* Use <FormattedMonetaryAmount> to display shipping rate prices
* Make 'country' optional in CartShippingRates
* Make CartShippingRate API return currency info
* Minor improvements
* Fix shipping fields hidden in editor
* Fix missing currency in Checkout shipping rates selector
* Add links to issues in @todo comments
* Improve ShippingRatesControl useEffect
* Remove unnecessary tab
* Remove unnecessary id in RadioControl
* API: Add error when country is invalid
* Debounce shipping rates API requests
* 'Country key' -> 'Country code'
* Don't display radio input when there is only one option
* Add message when there are no results
* Minor enhacements
* Remove unnecessary Fragment
* Simplify RadioControlOption export
* Refactor 'renderOptions' and split it into several components
* Prevent Card sidebar from taking too much width
* Move country request check outside of the loop
* Fix failing test
* introduce feature flags
* move config to webpack-helper
* add flag to deploy command
* remove package default
* add cross-env
* add gating to frontendConfig and coreConfig
* exclude entries from being built on stable mode
* add feature gating to PHP
* add flag to start command
* add flags to travis
* add endpoints
* add better defaults for php
* move code to Bootstrap.php
* no need to spread single object
* ignore blocks.ini
* type check feature flag
* remove blocks.ini
* sanitize flag
* remove flag from npm start
* format condition
* keep spaces for package-lock.json
* check for env before going to block ini
* add env vars to travis
* whitelist env var
* add new icons and remove old ones
* add docs
* add notes and remove gridicons
* update to folderStarred
* typos
* reorder imports
* update prop name to srcElement
* validate element
* fix bad import
* lowecase folderStarred
* add propTypes
* initial experiment for fetch error handling
* throw error from api response error (this allows for catching it in the stream)
* Add ERROR action type
* Controls: resolve with an error response object rather than throw exception
* remove try catch from resolver; just yield correct object based on presence of any errors
* Make the use collection hook return an error.
* Small tidy up in use-store-products
* Throw exception from Use Collection - useState is needed for the exception to work inside a hook (see comments)
* Show error code from API in error message
* Update assets/js/base/components/block-error-boundary/block-error.js
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Update assets/js/base/components/block-error-boundary/style.scss
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Remove comment
* Handle api error in boundry
* Use reject in promise
* Return error message by default which may be undefined (this is ok)
* Update mocks so tests pass again
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
Co-authored-by: Albert Juhé Lluveras <aljullu@gmail.com>
* Add And/or labelling
* Revised design
* Update assets/js/blocks/active-filters/utils.js
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Add prefix so name is not changed - fixes duplicate items
* Update BEM css classes
* Update styling to handle nested lists
* Remove extra padding within chips
Co-authored-by: Albert Juhé Lluveras <aljullu@gmail.com>
* install & configure storybook (via magic npx script)
* fix indentation in storybook generated files
* eslint ignore generated storybook files (for now at least)
* unhide storybook folder, consistent with Gutenberg project
* demo story for one of our components (with no css/styles)
* hack in scss webpack config & add story for button:
- fixes scss imports breaking storybook build
- note scss / styling doesn't work yet
+ organise our component stories into folder
* git ignore storybook-static build folder
* pin dependencies for storybook
* piggy-back off main webpack config for storybook module.rules (for scss)
* use gutenberg (wp-components) styles in storybook
* use system font for storybook, consistent with wp-admin/gberg and reasonable default for components in front end
* add --ci flag to prevent storybook opening new browser tab…
- see also https://github.com/storybookjs/storybook/issues/6201
* rename default stories to Default (following Gutenberg pattern)
* add story for ErrorPlaceholder
* failing ProductPreview story (committing to PR as an example for discussion)
* storybook for components/icons
* fix aliased dependencies in components for storybook:
append our webpack aliases to storybook webpack config
* basic story for PriceSlider (looks right but interaction broken)
* fix PriceSlider user interaction:
- PriceSlider expects client to handle onChange and pass in new min/max
* add comment about priceslider max/min (todoish)
* remove default stories from storybook scaffolding
* organise stories by module (aka folder in codebase)
* package-lock update after rebase
* remove unnecessary ignores (default stories are gone)
* delete experimental/risky/broken stories:
- icons components are changing in woocommerce/woocommerce-blocks#1644
- we need to refactor/do more work to get ProductPreview working (settings globals)
* remove unnecessary import
* clarify PriceSlider component intended usage comment in story
* remove redundant wrapper divs from stories
* add common storybook addons (used by Gutenberg storybook)
* rebuild package.lock after rebase
* remove unnecessary wrapper div
* package fixes after rebase
* add configuration for storybook source loader
* add decorators for a11y and knobs plugins
* remove unnecessary react import & import useState from WP
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
* Add aria-label to All Products ratings
* Add specific screen reader text to some buttons
* Increase All Products regular price color constrast
* Remove invalid CSS declaration
* Make styleint-disable comment more specific
* Attributes Filter: make input non-focusable if we display the 'change filter' button
* Improve translator documentation
* Hide price slider from screen readers if price inputs are enabled
* Linting fixes
* Price slider: make it non-focusable if input fields are displayed
* All Products: announce how many products were found
* All Products: announce when a filter is removed
* Revert "All Products: announce when a filter is removed"
This reverts commit 2c861bf1b988155313ad44bafbcaf3f4f1549296.
* Pagination component: improve screen reader texts
* Filter submit button: improve screen reader texts
* Remove unnecessary text
* Improve comment
* Use %d for numeric values
* Add label and screenReaderLabel props to FilterSubmitButton component
* Audit atomic block labels
* Add summary, descrtiption, and short description to API and use for summary block
* Add summary to cart item api
* Respect short description
* Tweak label of summary block
* Revert product rating label
* One description vs 3
* Update sample content with more appropriate values, and match in cart items sample
* Move summary generation to class
* Tests
* Prevent extending `ProductSummary`
* Tweak $paragraph handling
* More accurate word counting
* add tear down for filter
* Avoid looping through attributes after defaults have been set.
* remove extra method I missed and fix when state updates happen
* don’t update state if we’re not in woo blocks
This prevents non woo blocks from being re-rendered unnecessarily with the state update.
* avoid re-renders and use class property instead
* Change default rows to 3
* Handle all products rows change via deprecation
* Prevent errors if object is undefined
* HOC to set default attribute values
* Separate default attributes from attribute definitions
* Filters to set defaults
* Fix deprecation so attributes are not reordered
* Move flters to index file and limit which blocks are affected
* Fix object assign
* Use typeof for undefined checks
* Move hoc to filter file so it has context
* Fix up comment
* Avoid mutating props
* Prevent multiple `attributes` by cloning props
* Force attributes to be saved to HTML in a specific order, and handle migration
* useEffect to set attributes and avoid prop mutation
* Switch to class component
* Style mobile qty selector
* Add dedicated column for image and remove duplicate elements
* Tweak column headers
* Refactor cart styles to use CSS grid, and use nesting for organisation
* adjust column widths
* Remove unused div
* Fix wrapping and flexbox styles
* Add decodeEntities to alt attribute
* Use % basis
* Tweak min widths
* Create initial CountryInput component
* Create ShippingCountryInput
* Create BillingCountryInput
* Make backgrounds white
* Correctly align options
* Add CSS resets for 20xy themes
* Fix wrong defaults in countries constants
* Make CountryInput respect 'prefers-reduced-motion'
* Reverse prefers-reduced-motion check
* Set max-width to CountryInput dropdown
* Use decodeEntities to print country names
* Avoid unnecessary JSON enconding and later parsing
* Make sure country name is also encoded when selected
* Fix countries default value
* correct typography styles for remove link (based on design)
* add trashcan icon from material icons, for removing cart items on mobile
* add & style trash icon for remove cart item on mobile
* a11y - use darker grey for trashcan icon button to improve contrast
* rename IconDelete -> IconTrash
* remove unnecessary div
* use <button> for remove action buttons + add link-button scss mixin
* fix editor styles for cart line items - total column should be right-aligned
* fix various visual issues with cart line items table in editor:
- rows should align hard left and right (first/last child no padding)
- totals should be align-bottom on small screen
- correct vertical padding on column headings
- re-add row border separator lines
* View switcher on cart block
* Dedicated component and styling
* Views and selected should be required
* Rename to ViewSwitcher
* Implement views via render prop
* Remove defaults for required props
* show discount on cart line items (no styling)
* style line item discount badge + use correct colors for prices
* show full price inline on mobile
* move all responsive tweaks for cart prices to explicit breakpoints
* add nowrap to FormattedMoneyAmount so prices don't ever wrap
* fix misaligned full price on mobile when prices are large (edge case):
- if price strings are long, the full price stacks above line total
- previous right-margin on full price showed prices misaligned
* allow client code to add class(es) to FormattedMonetaryAmount
* add nowrap so discount badge doesn't wrap
* remove unnecessary span from discount badge +
+ more explicit `display` style for different price column elements
* show product variation attributes in cart line item + styling:
+ adjust font sizes & colors to match design
* show product description in cart line items…
- this commit also adds descriptions to test cart-items data
- note API does not currently return description/excerpt
* add a class to product attributes to allow custom styling
* Add Cart totals to Cart block
* Accessibility improvements
* Load vendors styles separately
* Use same shipping placeholders for cart and checkout
* Refactor how we import @wordpress/components styles so only panel styles are imported
* Remove style-loader from vendors styles build process
* Add htmlFor attribute to TotalsCouponCodeInput
* Update totalItems shape to match API
* Fix wrong total items shape using numbers instead of strings
* Rename wc-blocks classes to wc-block
* Remove unnecessary parseInt()
* Add radix to parseInt()
* Rename totalRows to totalRowsConfig
* Move placeholder content out of the component
* Use Card component for cart's sidebar (https://github.com/woocommerce/woocommerce-blocks/pull/1423)
* Use Card component for cart's sidebar
* Split RadioControl component
* No need to use Label in RadioControlOption
* Remove no longer valid @todo comment
* Use 'checked' prop instead of 'selected' in RadioControlOption
* Rename wc-blocks classes to wc-block
* Rename wc-blocks classes to wc-block (II)
* Make sure radio control ids are unique using withComponentId
* Load PanelBody and PanelRow from last version of @wordpress/components
* Create vendors-frontend.js file
* Load wordpress-component instead of @wordpress/components from <Button> component
* Only load 'withRestApiHydration' HOC
* Make vendors-frontend a dependency of cart-frontend script
* Revert "Only load 'withRestApiHydration' HOC"
This reverts commit 9f9b9759a98047b26e7d8f04189ffe78c1d5bb06.
* Fix fieldset background
* render block on front end, add `Shopping cart` heading (baby steps)
* fake data for editing full cart + show line count in header
* add note about core/html using `is-active` class for toggle state
* reinstate work-in-progress full cart component (lost in rebase)
* reinstate full cart from master
* component for full cart title & item count + margin tweaks:
- add margin between main cart & sidebar
- add margin after cart block
* add cart items sample data + factor sample product image to module
* use sample cart data for item count
* basic table of cart line items (no styling)
* prettification
* show images for cart line items + initial table styling
* cart quantity selector component (work in progress)
* use state for cart product quantity, allow incr/decr from UI (WIP)
* replace WIP custom quantity control with number edit (temporary)
* correctly format cart line item total price
* align cart item columns with headings + indent image on desktop
* tweak css for cart line item padding on mobile so it's more explicit
* show cart line item full price if discounted
* add placeholder for cart remove item link
* switch cart table to flex layout (was table)…
This will allow us to move things around for mobile/responsive layout.
* only show cart items table header on desktop
* more cart items styling - row borders, appropriate padding +
+ move image width to variable
+ fix class name plurality for row (item not items)
* use standard $gap instead of 1em for padding/margins
* responsive (mobile) layout for cart line items:
- shift line $ total to bottom right
- stack quantity selector in product info column
* remove extraneous cart table padding on mobile
* comment about unused styles for quantity selector component
* add follow up issue for todo
* remove inappropriate href
* render srcset & sizes for cart line item product image
* remove todo comment
* switch back to table markup for cart items (in progress):
- table is more semantic, associates headers with columns
* cart line items column widths - product column is larger (60%)
* reinstate table row borders
* bottom-align line item price on mobile
* cart contents heading should be H2 + prettify
* remove unused QuantitySelector code/styles, rename main class in line with BEM
* defaults for QuantitySelector props
* variable/property name tidies - match conventions/API
* fix bug: line total price is only bottom-align on small screen
* move QuantitySelector to root of components, intended to be generally useful
* use lineItem directly for cart, specify shape in PropTypes
* rename cart components to align with "line item" rather than "product"
* rejig class names to better align with new component names & BEM style
* show cart item image correct size:
- use single column for product image and info, with flex container
- specify image width (rem instead of px)
* fix safari issue - cart product images displaying vertically stretched
* shift product name left margin from image, to account for no-image case
* experiment: bump bundlewatch size limit for cart temporarily:
- our fake data inline image is heavy
- when we switch to real API we will no longer need it
* fix issue introduced when moving margin from image to details div:
- product details needs margin on left (not right)
* fix react props issues:
- explicitly destructure image props for srcSet (vs srcset)
- use API key field for line item key instead of id, fix duplicate test id
- CartLineItemsTable takes an array of lineItems (incorrect PropTypes)
* remove redundant divs + use conventional `null` (when no full price)
* override editor styles to ensure cart product image is correct size
* move cart items editor style override to editor.css
* add an explicit readable heading for cart heading to match visual layout
* Set default value to TextInput component
* Set TextInput label transition origin
* Set default onChange function prop to noop
* Fix wrong propType name
* Remove default onChange and set it required
* Rename checkout classes from 'wc-blocks-checkout' to 'wc-block-checkout'
* Rename form components classes from 'wc-blocks-checkout' to 'wc-block-checkout'
* Rename 'wc-components' class names to 'wc-block'
* Consistent currency data and formatting for product prices
* Consistent get_store_currency_properties usage
* Update tests with schema changes
* min_price and max_price to subunit format
* Product query of min and max prices using subunit
* Cart item totals
* Collection data schema object and currency data inclusion
* Handle subunits and new API in product prices
* Update price slider to format numbers using library and new API responses for subunits
* Product query of min and max prices using subunit
* Fix indents in readme
* Add todo for currency formatting
* Handle step for subunits, fixes min/max constraints
* Handle subunit conversion on display, using consistent currency object and wrapped NumberFormat component.
* Prettier ran
* Update usePriceConstraints tests so rounding doesn't make all values be 0
* Rename to minorUnitValue
* Move currencyToNumberFormat to index file
* siteCurrencySettings to constant rather than function
* remove cents term
* cents->minor unit
* typo in todo note
* Switch to FormattedMonetaryAmount
* Formatting
* wrong case
* initial commit at fields
* add radio control
* change input to be uncotrolled
* tweak styles
* populate block with boilerplate
* update aria in radio
* remove comment
* fix typo
* add missing colors
* put reminder to put Disabled back
* wrap text in i18n __
* reorder styles
* rename wc-components to wc-blocks
* use value instead of index for keys
* add no shipping placeholder
* change isEditor default to false
* fix problem with responsive
* Typo
* Save previous constraint while loading
* Add tests for formatPrice
* Small code refactor
* Refactor usePriceConstraints to DRY and add tests
* Add base-hooks to jest config
* Add Feedback Prompt in Cart & Checkout blocks sidebar
* Add border
* Move getInspectorControls out of the component function
* Move feedback prompt to a HOC
* Add @todo comment to feedback link
* Use filter for withFeedbackPrompt
* Export withFeedbackPrompt from hocs index.js
* Typo
* Try moving the feedback texts to context
* Revert "Try moving the feedback texts to context"
This reverts commit 21f889b021ceea6fef722efab9663799829bc769.
* Revert "Use filter for withFeedbackPrompt"
This reverts commit 96bba029d61a383eafa2c0a1c08f7988e319b50d.
* Set feedback text in the HOC function
* Use arrow-function to simplify code
* Refactor
* Update NPM packages
* Switch JSON dependencies to new PHP files
* include->require
* include->require
* Remove from package and run audit fix
* Update wp-prettier
* Use version from asset file
* Fix eslint issues and test failures
* Update OriginalComponent docblocks
* Props are objects, not arrays
* Array to Object
* fix tests throwing unhandled rejection errors in node.
These tests were all testing Promise.rejects but then not properly catching the reject in the assertions.
* exclude rule for no short array syntax allowed
This is a WordPress core standard that we choose to ignore because it’s silly in our context to follow that rule (and we’re being consistent with WooCommerce Admin).
* Add Empty Cart View with inner blocks
* Add logic so empty cart is always saved and only displayed when cart is empty
* Make cart hidden until the correct display is loaded
* Add missing propTypes
* Remove is-loading class
* Import InnerBlocks from @wordpress/block-editor
* Add explanation for always rendering EmptyCart in the editor
* introduce form steps
* add last step
* add prop types
* fix css color variable naming
* add label for a11y
* use :last-child
* white space
* use direct args in classnames
* typo
* rename ids for steps
* fix line height to match title
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* heading-content
* rename css var
* move vars to file
* move components within file
* move imports
* rename prop name to kebabCase
* update prop name
* make components responsive with storefront
* fix some compatiblity problems with 2020
* battle in the CSS ground
* move import to correct place
* turn stepHeadingContent to render prop
* styling
* allow merchant to toggle cart empty/full modes in block editor
* use text `Button` for empty/full toolbar buttons
* fix highlighting of current cart state (empty/full) in editor:
- use new custom TextToolbarButton for empty/full mode buttons
* use color variables from css/abstracts/_colors
* Update assets/js/components/text-toolbar-button/index.js
Co-Authored-By: Seghir Nadir <nadir.seghir@gmail.com>
* fix className now props is separated out
* Add 'AND' display format to Attribute filter dropdown
* Add translators comments
* Remove 'assertive' from speak calls
* Wrap some functions in useCallback
* Only filter available filters if style=list and query=and
* Show placeholder in AND query type
* Add default cursor to list-item elements
* Fix issues with 20xx themes
* Fix issues with 20xx themes (II)
* basic empty cart block
* use a real placeholder for placeholder editor content
* remove unnecessary Fragment
* updates to config and frontend script
* enqueue frontend script
* add example config to block registration
* change name typo
* Add dropdown display style to Attribute Filter block
* Unify filter blocks margin
* Show attribute label inside dropdown input
* Minor CSS reorganization
* Refactor code to smaller files
* Preserve input values on blur
* Only save data-display-style if it's different than 'list'
* Remove inputRef prop in DropdownSelectorInputWrapper
* Accessibility: fix missing label
* Prevent input field being unselected when removing an item with the backspace
* Remove isLoading styles and don't set isDisabled when it's not actually disabled
* Accessibility: increase color contrast
* Add package-lock.json
* Prevent input field being unfocused when removing an item with its chip card
* Don't show menu when input is unfocused
* fix bug with add to cart
* prettier
* migrate to Event
* prettier
* Update assets/js/atomic/components/product/button/index.js
update to fix on sequential adds
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Avoid dispatching cart update event on initial mount
* add condition to check if Event is defined
* Add context for collection data query
* Introduce useCollectionData hook
* Implement hook in filter blocks
* Update API to handle nuances of counts instead of client side
* Clone requests so original is untouched
* Prevent dupe requests is working
* Cleanup
* Update assets/js/base/hooks/use-collection-data.js
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Update assets/js/base/hooks/use-collection-data.js
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Feedback
* Remove context
* Helper to get namespace routes from the REST Api
* Add routes to store settings
* HydrateRestApiData component
* Correct usage of useSelect
* Remove lodash
* Move code to HOC
There was no need to have a const for the default state and also needed to make sure we’re not mutating it because it would result in the mutation of the default state. This in turn meant that on the initial reducing action, the default state in the store would have a ghost value.
* Only do instant updates if filter button is disabled
* Update assets/js/blocks/price-filter/block.js
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Remove minConstraint and maxConstraint from price filter state
* Remove 'useMemo' from minConstraint and maxConstraint
* Make sure minConstraint and maxConstraint are numbers before updating min/max prices
* Make sure non-valid price constraints don't make it to usePrevious
* Remove again track min/max constraint useEffect
* All Products block with filters: avoid showing loading placeholders if there are no results
* Hide sort select and show message when no products are available
* Add no result templates
* Remove product-grid
* Move images to assets dir
* Update images
* Switch functions to Components
* Capitals
* add missing context
* Add reviews to Category endpoint
* add option to show categories with reviews
* update label text if we're using reviews for counting
* update reviews count to use raw sql
* add flag before querying review count
* add review_count to collection data & schema
* fix PR code review problems
* update tests to it expects the new collection param
* add note about review_count is schema
* Use same query for headers collection
* All Products: avoid pagination disappearing when switching pages/changing sort value (take 2)
* Cleanup
* fixes after rebase
* Make it work after last rebase
* only do page change when queryState.page has changed.
* Fixwoocommerce/woocommerce-blocks#1198 again
* Remove previousPage and isInitialized checks
* Enable preview for price filter block
Using the defaults works fine, so no options required.
* Attribute preview via block attribute
* Add sample content for preview
* remove unnecessary key
* remove unneeded export
* Basic block construction
* Register on PHP side
* wc-active-filters script
* Price utils
* Refactor price slider so state reflects the query
Moves some logic from the component to the block so that min and max price can change (via query) and be reflected by the price sliders.
This allows the active filters block to change the query and have those new values reflected by the slider.
* Fix type checking of numbers
* Styles for filter block
* Improved attribute helper for getting attribute taxonomy data from ID/taxonomy
* Refactor attribute filter to use updateAttributeFilter helper
* Disable checkboxes when loading to avoid multiple queries
* Add todos - this is blocked
* Remove checked state from Attribute Filter so it gets updated from the store (https://github.com/woocommerce/woocommerce-blocks/pull/1170)
* isLoading check
* active price filtering rendering
* Block heading
* Implement block options; chip display with clear button
* Clear all should remove all attributes
* Enable previews
* Introduce a component to look up terms from slugs using collections (which are cached)
* Correct all docblocks
* activePriceFilters null return
* renderRemovableListItem
* Remove useMemo for hasFilters
* Switch classnames notation
* Ensure slug is array in removeAttributeFilterBySlug
* null -> undefined return types for attributes
* Remove fragment
* Check we have a termObject in ActiveAttributeFilters
* Refactor formatPriceRange return statements
* Ensure query array index will exist
* Only sort when adding a query
* Remove aria-label with dupe text
* hasFilters is function
* Update useQueryStateByKey usage
* More doc block fixes
* Update getAttributeFromTaxonomy return and docblock
* getAttributeFromID return/docblock
* Add block error boundary to All Products and Reviews blocks
* Add block error boundary to Price Filter and Attributes Filter blocks
* Add image
* Make block error component use props instead of hardcoded values
* Add props to BlockErrorBoundary
* Change 'text' prop to 'content'
* Add docs to proptypes
* Replace 'content' prop with 'text'
* ensure useProductLayoutContext actually returns the context!
* add query state context and export provider and hook.
* implement useQueryStateContext in existing querySTate hooks and refactor other implementations
* add back in documentation removed in rebase
* default layout context to empty string (no need to add additional classes by default
* fix jsdoc
* add a context value validator and tests
This handles validation incoming value prop on a context provider with an object.
* implement context validator and fix related bugs
* rename context to better match it’s purpose
* correct spelling
* Update assets/js/base/context/utils.js
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* tighten up the iteration
* Update dependencies order
* Create eslint WooCommerce plugin with dependency group rule
* Update WCPackageLocality definition so it only includes External and Internal
* Rename WPPackageLocality to WCPackageLocality
* Delete old typedef
* add missing `add_to_cart` properties to product schema
Also camelcase properties.
* switch namespace to `/wc/store/`
* add experimental action for perisisting and item to a given collection
* refactor ProductButton to use hooks (initial pass)
This is just the initial refactor to figure out the logic. I’m going to do another pass to see about extracting some of this to a custom hook (because it’s kind of gnarly to have to repeat… and it’s possible it can be simplified as well).
* add new properties to tests and ensure test is using the same product instance values as the rest request
* refactor to add custom internal only useAddToCart hook.
* fix value extraction from product object
* revert casing changes
* install dompurify and use to sanitize product title for reviews
* remove dompurify
* remove dompurify implementation and add jsdoc covering what data is trusted
* Basic component setup
* Working slider
* Validation
* styling
* Update webpack config to fix ie11
* ie progress
* styling improvements
* improve events
* IE shim
* Fix samsung internet styles
* Add aria
* remove old methods
* event handling
* Tweak size and width of inputs
* reset progress
* shorthand notation for setstate
* Inline comment for textare usage
* Remove pointless comparison
* destruct from state
* zindex comment
* Move out currency settings and validation
* enforce int for min and max state
* Use woocommerce/settings
* showInputFields prop
* Filter Products by Price: Block creation (https://github.com/woocommerce/woocommerce-blocks/pull/865)
* Prevent interaction with slider
* Show input fields toggle
* Placeholder content and icons
* Update dependency rimraf to v2.7.0 (https://github.com/woocommerce/woocommerce-blocks/pull/858)
* placeholder styling
* remove unnecessary config (https://github.com/woocommerce/woocommerce-blocks/pull/862)
* Filter button and styling
* Show/hide placeholder based on product count
* Update dependency rimraf to v2.7.1 (https://github.com/woocommerce/woocommerce-blocks/pull/867)
* Use correct parameter order for implode. Solves deprecation notice in PHP 7.4 (https://github.com/woocommerce/woocommerce-blocks/pull/857)
* Add description to blocks added in last releases (https://github.com/woocommerce/woocommerce-blocks/pull/869)
* Limit max width
* Prevent wrap
* handles src file
* Introduce withCategory HOC for featured category block (https://github.com/woocommerce/woocommerce-blocks/pull/846)
* Introduce withCategory hoc
* Refactor featured category to use new hoc
* Update docblocks
* Add README note for PHP deprecation notices
* Remove screen-reader-text css rules (https://github.com/woocommerce/woocommerce-blocks/pull/849)
* Align stars left (https://github.com/woocommerce/woocommerce-blocks/pull/866)
* bool
* Create Reviews by Product block (https://github.com/woocommerce/woocommerce-blocks/pull/658)
* Create Reviews by Product block
* Honor Content settings
* Fix wrong className
* Load new wc-packages file
* Add reviews-by-product JS files to webpack config
* Cleanup
* Remove error messages
* Add Reviews by Product icon
* Update sort options
* Allow additional CSS classes attribute
* Refactor block styles
* Fix wrong default for reviews_orderby
* Don't enforce CSS chunks
* Add reviews count to Reviews by Product controls (https://github.com/woocommerce/woocommerce-blocks/pull/671)
* Add label to Reviews by Product controls count (https://github.com/woocommerce/woocommerce-blocks/pull/677)
* Add reviews count to Reviews by Product controls
* Add label to Reviews by Product controls count
* Add label to Reviews by Product controls count
* Update components package
* Review ordering and placeholders (https://github.com/woocommerce/woocommerce-blocks/pull/688)
* Add support for comment_count ordering and add to productcontrol
* Add a placeholder if rating count is 0
* Update assets/js/components/utils/index.js
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update assets/js/blocks/reviews-by-product/block.js
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* grammar
* Fix some linting errors and warnings (https://github.com/woocommerce/woocommerce-blocks/pull/693)
* Create Reviews by Product block placeholder (https://github.com/woocommerce/woocommerce-blocks/pull/691)
* Create Reviews by Product block placeholder
* Reviews by Product: load and render reviews with JS (https://github.com/woocommerce/woocommerce-blocks/pull/696)
* Reviews by Product: load and render reviews with JS
* Add dangerouslySetInnerHTML explanatory comment
* Fix wrong dependency source
* Debounce getReviews call when creating the Reviews by Product block
* Rename 'Reviewer Picture' with 'Avatar' (https://github.com/woocommerce/woocommerce-blocks/pull/702)
* Lint errors
* Replace stringify query with addQueryArgs (https://github.com/woocommerce/woocommerce-blocks/pull/707)
* Add reviews endpoint (https://github.com/woocommerce/woocommerce-blocks/pull/705)
* Prevent state updates on unmounted components (https://github.com/woocommerce/woocommerce-blocks/pull/715)
* Add Order by and Load more controls in Reviews by Product frontend (https://github.com/woocommerce/woocommerce-blocks/pull/716)
* Export IconReviewsByProduct (https://github.com/woocommerce/woocommerce-blocks/pull/721)
* Fix Reviews by Product layout in IE11 (https://github.com/woocommerce/woocommerce-blocks/pull/723)
* Set minimum to per page input field (https://github.com/woocommerce/woocommerce-blocks/pull/731)
* Hide avatars in Reviews by Products if 'show_avatars' settings is false (https://github.com/woocommerce/woocommerce-blocks/pull/730)
* Blocks API - Reviews endpoint with rating sort and category filtering (https://github.com/woocommerce/woocommerce-blocks/pull/726)
* Move file to correct location
* We are only using the reviews endpoint not revioews/id
* Remove sensistive data and make endpoint public
* Allow guest access to approved reviews
* Add support for rating sorting
* category filtering
* update arg name
* fix category query
* Reviews by Product: add placeholders when loading reviews (https://github.com/woocommerce/woocommerce-blocks/pull/732)
* Add placeholder animation (https://github.com/woocommerce/woocommerce-blocks/pull/733)
* Hook up Reviews by Product 'Order by' with endpoint (https://github.com/woocommerce/woocommerce-blocks/pull/736)
* Hook up Reviews by Product 'Order by' with endpoint
* Use onChange instead of onBlur in select control
* Reviews by Product: Hide ratings if they are disabled in settings (https://github.com/woocommerce/woocommerce-blocks/pull/740)
* Hide ratings in Reviews by Product if disabled in settings
* Hide order by select if ratings are disabled
* Reviews by Product cleanup (https://github.com/woocommerce/woocommerce-blocks/pull/773)
* Fix wrong method name
* Reduce the number of dependencies used in Reviews by Product (https://github.com/woocommerce/woocommerce-blocks/pull/774)
* Reduce the number of dependencies used in Reviews by Product
* Use 'withComponentId' HOC
* Remove debounce
* Fix wrong proptype
* Get rid of JS warning
* Load render from react-dom
* Add formatted_date_created item schema (https://github.com/woocommerce/woocommerce-blocks/pull/788)
* Fix import of WithComponentID
* Add new settings to Reviews by Product block (https://github.com/woocommerce/woocommerce-blocks/pull/787)
* Add new settings to Reviews by Product block
* Remove helpText and add notices
* Use RangeControl for numeric settings
* Prevent fetching new reviews if all were already fetched
* Enable product image in reviews
* Remove unnecessary catch
* Refactor getReviews
* Move getReviews back to block's code
* Cleanup
* Fix wrong order in editor
* Hide 'Load More Reviews' if showLoadMore is false
* Move getReviews to utils.js
* Add @woocommerce/navigation to package.json
* Make notices non-dismissable
* Reviews by Product: prevent importing all HOCs and import only withComponentId (https://github.com/woocommerce/woocommerce-blocks/pull/811)
* Reviews by product: Update review styling and content (https://github.com/woocommerce/woocommerce-blocks/pull/806)
* Add new settings to Reviews by Product block
* Remove helpText and add notices
* Use RangeControl for numeric settings
* Prevent fetching new reviews if all were already fetched
* Enable product image in reviews
* Remove unnecessary catch
* Refactor getReviews
* Move getReviews back to block's code
* Cleanup
* Fix wrong order in editor
* Hide 'Load More Reviews' if showLoadMore is false
* Move getReviews to utils.js
* Add @woocommerce/navigation to package.json
* Make notices non-dismissable
* Review design/layout
* verified icons
* Read more component
* remove comment
* expanded -> isExpanded
* Localise and change default elipses
* Simplify ReadMore
* Support children rather than passing content
* remove outside
* remove list style
* Update assets/js/components/read-more/index.js
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update assets/js/components/read-more/index.js
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* merge set state
* Add missing parameter doc in renderReview (https://github.com/woocommerce/woocommerce-blocks/pull/820)
* Fix Reviews by Product order by select not honoring default setting (https://github.com/woocommerce/woocommerce-blocks/pull/818)
* Read more component - change how clamped content is shown (https://github.com/woocommerce/woocommerce-blocks/pull/821)
* Pass review as components
* Build summary from content and track both
* Toggle display after inital load
* remove unused variable
* remove componentDidUpdate
* Simplify clampLines
* Put back componentDidUpdate, but store final summary in state
* clampEnabled
* Call clampLines from componentDidMount (https://github.com/woocommerce/woocommerce-blocks/pull/826)
* truncate html tests
* implement trimHTML and pass test
* Feedback
* test short content
* Use withProduct HOC in ReviewsByProductEditor (https://github.com/woocommerce/woocommerce-blocks/pull/828)
* Use withProduct HOC
* Convert ReviewsByProductEditor to a functional component
* Add loading and error states
* Prevent loading screen appearing when changing products
* Reviews: only save wrapper element to post (https://github.com/woocommerce/woocommerce-blocks/pull/830)
* Fix bundlesize config not picking frontend files (https://github.com/woocommerce/woocommerce-blocks/pull/840)
* Reviews by Product: split 'block.js' into smaller chunks (https://github.com/woocommerce/woocommerce-blocks/pull/841)
* Split 'block.js' into smaller chunks
* Move frontend blocks to their specific folder
* Order imports
* Typo
* Add frontend components proptypes
* Fix indentation
* Call 'this.getDefaultArgs' directly inside 'getReviews'
* Move access to wc_product_block_data to the top of the file
* Rename 'frontend' folder to 'base'
* Rename base components and move styles to their folder
* Fix Reviews by Product using rating count instead of review count (https://github.com/woocommerce/woocommerce-blocks/pull/860)
* Improve Reviews by Product accessibility (https://github.com/woocommerce/woocommerce-blocks/pull/861)
* Improve Reviews by Product accessibility
* Make 'onClick' prop not required in <LoadMoreButton>
* Wrap Reviews by Product editor block with <Disabled>
* Reviews: fix reviews without rating not appearing when sorting by rating (https://github.com/woocommerce/woocommerce-blocks/pull/863)
* Update assets/css/style.scss
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* Pin dependencies (https://github.com/woocommerce/woocommerce-blocks/pull/872)
* Update dependency webpack to v4.39.2 (https://github.com/woocommerce/woocommerce-blocks/pull/855)
* Update dependency @woocommerce/components to v3.2.0 (https://github.com/woocommerce/woocommerce-blocks/pull/875)
* Update Reviews styles so it looks the same in the editor and the frontend (https://github.com/woocommerce/woocommerce-blocks/pull/871)
* Update Node.js to v10.16.3 (https://github.com/woocommerce/woocommerce-blocks/pull/874)
* Move wc_product_block_data variables to constants file (https://github.com/woocommerce/woocommerce-blocks/pull/870)
* Update dependency webpack-cli to v3.3.7 (https://github.com/woocommerce/woocommerce-blocks/pull/880)
* Add changelog script (https://github.com/woocommerce/woocommerce-blocks/pull/878)
* Add changelog script
* Adapt changelog script to WooCommerce Blocks
* Minor improvements
* Update dependency lint-staged to v9.2.3 (https://github.com/woocommerce/woocommerce-blocks/pull/879)
* Pin dependencies (https://github.com/woocommerce/woocommerce-blocks/pull/883)
* Update dependency eslint to v6.2.0 (https://github.com/woocommerce/woocommerce-blocks/pull/881)
* Reviews by category block (https://github.com/woocommerce/woocommerce-blocks/pull/804)
* Create Reviews by Product block
* Honor Content settings
* Fix wrong className
* Load new wc-packages file
* Add reviews-by-product JS files to webpack config
* Cleanup
* Remove error messages
* Add Reviews by Product icon
* Update sort options
* Allow additional CSS classes attribute
* Refactor block styles
* Fix wrong default for reviews_orderby
* Don't enforce CSS chunks
* Add reviews count to Reviews by Product controls (https://github.com/woocommerce/woocommerce-blocks/pull/671)
* Add label to Reviews by Product controls count (https://github.com/woocommerce/woocommerce-blocks/pull/677)
* Add reviews count to Reviews by Product controls
* Add label to Reviews by Product controls count
* Add label to Reviews by Product controls count
* Update components package
* Review ordering and placeholders (https://github.com/woocommerce/woocommerce-blocks/pull/688)
* Add support for comment_count ordering and add to productcontrol
* Add a placeholder if rating count is 0
* Update assets/js/components/utils/index.js
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update assets/js/blocks/reviews-by-product/block.js
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* grammar
* Fix some linting errors and warnings (https://github.com/woocommerce/woocommerce-blocks/pull/693)
* Create Reviews by Product block placeholder (https://github.com/woocommerce/woocommerce-blocks/pull/691)
* Create Reviews by Product block placeholder
* Reviews by Product: load and render reviews with JS (https://github.com/woocommerce/woocommerce-blocks/pull/696)
* Reviews by Product: load and render reviews with JS
* Add dangerouslySetInnerHTML explanatory comment
* Fix wrong dependency source
* Debounce getReviews call when creating the Reviews by Product block
* Rename 'Reviewer Picture' with 'Avatar' (https://github.com/woocommerce/woocommerce-blocks/pull/702)
* Lint errors
* Replace stringify query with addQueryArgs (https://github.com/woocommerce/woocommerce-blocks/pull/707)
* Add reviews endpoint (https://github.com/woocommerce/woocommerce-blocks/pull/705)
* Prevent state updates on unmounted components (https://github.com/woocommerce/woocommerce-blocks/pull/715)
* Add Order by and Load more controls in Reviews by Product frontend (https://github.com/woocommerce/woocommerce-blocks/pull/716)
* Export IconReviewsByProduct (https://github.com/woocommerce/woocommerce-blocks/pull/721)
* Fix Reviews by Product layout in IE11 (https://github.com/woocommerce/woocommerce-blocks/pull/723)
* Set minimum to per page input field (https://github.com/woocommerce/woocommerce-blocks/pull/731)
* Hide avatars in Reviews by Products if 'show_avatars' settings is false (https://github.com/woocommerce/woocommerce-blocks/pull/730)
* Blocks API - Reviews endpoint with rating sort and category filtering (https://github.com/woocommerce/woocommerce-blocks/pull/726)
* Move file to correct location
* We are only using the reviews endpoint not revioews/id
* Remove sensistive data and make endpoint public
* Allow guest access to approved reviews
* Add support for rating sorting
* category filtering
* update arg name
* fix category query
* Reviews by Product: add placeholders when loading reviews (https://github.com/woocommerce/woocommerce-blocks/pull/732)
* Add placeholder animation (https://github.com/woocommerce/woocommerce-blocks/pull/733)
* Hook up Reviews by Product 'Order by' with endpoint (https://github.com/woocommerce/woocommerce-blocks/pull/736)
* Hook up Reviews by Product 'Order by' with endpoint
* Use onChange instead of onBlur in select control
* Reviews by Product: Hide ratings if they are disabled in settings (https://github.com/woocommerce/woocommerce-blocks/pull/740)
* Hide ratings in Reviews by Product if disabled in settings
* Hide order by select if ratings are disabled
* Reviews by Product cleanup (https://github.com/woocommerce/woocommerce-blocks/pull/773)
* Fix wrong method name
* Reduce the number of dependencies used in Reviews by Product (https://github.com/woocommerce/woocommerce-blocks/pull/774)
* Reduce the number of dependencies used in Reviews by Product
* Use 'withComponentId' HOC
* Remove debounce
* Fix wrong proptype
* Get rid of JS warning
* Load render from react-dom
* Add formatted_date_created item schema (https://github.com/woocommerce/woocommerce-blocks/pull/788)
* Inital block setup
* Fix import of WithComponentID
* Render the category reviews
* Add new settings to Reviews by Product block (https://github.com/woocommerce/woocommerce-blocks/pull/787)
* Add new settings to Reviews by Product block
* Remove helpText and add notices
* Use RangeControl for numeric settings
* Prevent fetching new reviews if all were already fetched
* Enable product image in reviews
* Remove unnecessary catch
* Refactor getReviews
* Move getReviews back to block's code
* Cleanup
* Fix wrong order in editor
* Hide 'Load More Reviews' if showLoadMore is false
* Move getReviews to utils.js
* Add @woocommerce/navigation to package.json
* Make notices non-dismissable
* Reviews by Product: prevent importing all HOCs and import only withComponentId (https://github.com/woocommerce/woocommerce-blocks/pull/811)
* Reviews by product: Update review styling and content (https://github.com/woocommerce/woocommerce-blocks/pull/806)
* Add new settings to Reviews by Product block
* Remove helpText and add notices
* Use RangeControl for numeric settings
* Prevent fetching new reviews if all were already fetched
* Enable product image in reviews
* Remove unnecessary catch
* Refactor getReviews
* Move getReviews back to block's code
* Cleanup
* Fix wrong order in editor
* Hide 'Load More Reviews' if showLoadMore is false
* Move getReviews to utils.js
* Add @woocommerce/navigation to package.json
* Make notices non-dismissable
* Review design/layout
* verified icons
* Read more component
* remove comment
* expanded -> isExpanded
* Localise and change default elipses
* Simplify ReadMore
* Support children rather than passing content
* remove outside
* remove list style
* Update assets/js/components/read-more/index.js
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update assets/js/components/read-more/index.js
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* merge set state
* Add missing parameter doc in renderReview (https://github.com/woocommerce/woocommerce-blocks/pull/820)
* Fix Reviews by Product order by select not honoring default setting (https://github.com/woocommerce/woocommerce-blocks/pull/818)
* Read more component - change how clamped content is shown (https://github.com/woocommerce/woocommerce-blocks/pull/821)
* Pass review as components
* Build summary from content and track both
* Toggle display after inital load
* remove unused variable
* remove componentDidUpdate
* Simplify clampLines
* Put back componentDidUpdate, but store final summary in state
* clampEnabled
* Call clampLines from componentDidMount (https://github.com/woocommerce/woocommerce-blocks/pull/826)
* truncate html tests
* implement trimHTML and pass test
* Feedback
* test short content
* Use withProduct HOC in ReviewsByProductEditor (https://github.com/woocommerce/woocommerce-blocks/pull/828)
* Use withProduct HOC
* Convert ReviewsByProductEditor to a functional component
* Add loading and error states
* Prevent loading screen appearing when changing products
* Reviews: only save wrapper element to post (https://github.com/woocommerce/woocommerce-blocks/pull/830)
* Update based on product reviews
* Cleanup after master merge
* Implement content hiding and placeholder states for reviews blocks
* Output product names and adjust css
* Review permalink
* Remove old read-more component which was moved
* showProductName is already part of passed attributes
* CSS tweaks for missing elements
* Move dir
* Move product reviews block
* Move shared uitils
* update paths
* frontend paths
* Update paths
* shared attributes
* switch to constants
* Shared review block code
* Replace constants
* Fix hidden content bug
* star alignment
* Update dependency eslint to v6.2.1 (https://github.com/woocommerce/woocommerce-blocks/pull/890)
* remove JSON parse
* remove comment
* No need for important rules
* Fix error appearing on Reviews by Product when there were no reviews (https://github.com/woocommerce/woocommerce-blocks/pull/884)
* Fix error appearing on Reviews by Product when there were no reviews
* Revert "Fix error appearing on Reviews by Product when there were no reviews"
This reverts commit 73e95b39aa9a318888d08bb51faeff8bb51259d7.
* Move withProduct() HOC to editor-block.js
* Revert "Move withProduct() HOC to editor-block.js"
This reverts commit ae9515792d4870cc5cf1d92a2d6acc91198b5f62.
* Move renderNoReviews back to edit.js
* Move no reviews placeholder to its own component
* Remove usage of 'RawHTML'
* Fix propTypes
* Remove unnecessary escapeHTML
* revise labels
* Move component to base
* Add price text
* Update design to latest figma
* update from master
* Fixed merge conflicts with settings
* Fix formatting
* Update to use react hooks
* Progress hooking up price slider
* Fixes usage of data store for min/max
* Added loading state
* Fix useQueryStateByKey setter
* Product list integration
* Inital state and preventing too many queries
* Style fixes
* Button loading styles
* Package conflict
* useCallback
* Remove duplication
* variable name feedback
* Implement useCallback on functions
* useMemo for getProgressStyle
* Block feedback
* Use get_block_asset_build_path
* Remove old settings from merge conflict
* Move sketch file to .prefixed dir
* Removed render methods
* Exclude price filter from legacy build
* Feedback
* add use-collection hook and tests
* Add use-collection-header hook
* update use-store-products hook to implement useCollection and useCollection header under the hood
* Inital block creation
* Update labels
* Columns, rows, sample data json
* Output data from API
* thumbnail_html
* Split into smaller components of grid
* Price handling
* Image handling
* Remove !
* frontend
* Work on cart api
* Cart error handling and product type conditions
* innerblock progress
* Implement layoutConfig as set from innerblocks shape.
Note:
- this is just a poc
- where things are configured likely needs changed
- will still need to work out how this gets persisted for the frontend and how things get displayed there (but likely will work fairly similar in terms of mapping to components).
* use correct prop name
* Working edit button
* Clean up block controls and edit view
* Add link with innerblocks
* update link description
* correctly handle components with inner blocks as children
* Re-organise atomic components and blocks into own directories
* Unique keys for components
* Fix default layout when inserting block for first time
* Working layoutconfig save
* Save attributes
* Move sale badge to image component
* Add disabled to render preview and blocks
* icons
* Editor view styling
* Update withComponetId to stop component ID incrementing too many times
Co-Authored-By: Darren Ethier <darren@roughsmootheng.in>
* Improve key generation
* done/cancel buttons on edit
* Create withProducts HOC for All Products block (https://github.com/woocommerce/woocommerce-blocks/pull/994)
* Create withProducts HOC for All Products block
* Add order select and pagination to All Products block
* Go to first page when changing order
* Add HOC test
* Make sure block is updated whem columns/rows change in the editor
* Fix 'SALE' badge positioning
* Remove unnecessary key
* Honor 'perPage' value when generating placeholders
* Make placeholder sizes match rendered block item
* Several CSS improvements
* Remove unused CSS properties
* Move getProducts to hocs utils
* Remove All Products sample-data.json
* Fix order select wrong margin in the editor
* Refactor how loading image gets its size
* Clear products when loadProducts start
* Enhance pagination logic
* Fix placeholder width
* Fix regular_price check
* Set product link max-width
* Implement querystrings for the All Products block (https://github.com/woocommerce/woocommerce-blocks/pull/997)
* Implement querystrings for the All Products block
* Create withWindow HOC
* Add with-window tests
* Use renderFrontend util in All Products block (https://github.com/woocommerce/woocommerce-blocks/pull/1003)
* Add with-window tests
* Use renderFrontend util in All Products block
* Rename properties and components from 'order' to 'sort' (https://github.com/woocommerce/woocommerce-blocks/pull/1012)
* Rename properties and components from 'order' to 'sort'
* Rename onOrderChange to onSortChange
* Remove unnecessary stylint-disable-line (https://github.com/woocommerce/woocommerce-blocks/pull/1016)
* Create withBrowserLocation and withBrowserHistory HOC (https://github.com/woocommerce/woocommerce-blocks/pull/1022)
* Create withBrowserWindowProp HOC
* Remove unnecessary expect's
* Always pass window prop to propMap if it exists
* Scroll to top when switching pages in All Products block (https://github.com/woocommerce/woocommerce-blocks/pull/1011)
* Scroll to top when switching pages in All Pages block
* Improve keyboard navigation in the All Products block
* Create withScrollToTop HOC
* Fix variable name typo
* Update paths with aliases
* Avoid first and last page being included in pagination 'pagesToDisplay' (https://github.com/woocommerce/woocommerce-blocks/pull/1015)
* Update lock
* constants
* linting
* Clean up styling
* Prettier
* Block options for title/image
* Prettier
* Remove shared content controls
* Update atomic block descriptions
* Summary block
* Prettier
* Impoved template edit appearance and added inline tips
* Apply prettier
* Reset and cancel buttons
* Improved keys
* Tweak tip placement
* Remove incorrect comments
* Remove disabled ofr non interactive elements
* Fragment not needed
* Update assets/js/atomic/components/product-list/title/index.js
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* Move componentId hoc
* Comment
* Implement onImageLoaded
* Pagination: disable first/last page if they are active (https://github.com/woocommerce/woocommerce-blocks/pull/1041)
* Update assets/js/atomic/components/product-list/rating/index.js
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* Sale badges refactoring
Adds sale badges blocks and improves how the default blocks are defined.
* revert changes in withComponentId
* fix flexbox alignment
* Create withQueryStringValues HOC and use it in ProductGrid component (https://github.com/woocommerce/woocommerce-blocks/pull/1040)
* Create withQueryStringValues HOC and use it in ProductGrid component
* Add tests
* Add comment explaining urlParameterSuffix
* Don't destructure props if only used once
* Move dependencies check outside the HOC
* Update test description
* Remove HOCs no longer used
* Update assets/js/atomic/blocks/product-list/image/index.js
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update assets/js/atomic/components/product-list/sale-badge/index.js
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update assets/js/atomic/utils/index.js
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update assets/js/atomic/utils/index.js
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* Feedback
* Grid to List
* Improved badge handling
* update package-lock after merge from master
* Add wp.data store for schema and lists. (https://github.com/woocommerce/woocommerce-blocks/pull/1008)
* install @wordpress/data-controls and deepFreeze
* add schema store
* add query-state store
* add collections store
* add bundle entry point (and export store keys and constants)
* add master README.md for new stores
* add bundle configuration and register asset php side
* Add missing param name
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* code style fixes
* remove unnecessary period from test description
* Simplify conditional
* reorder imports (code style)
* reorder imports and codestyle
* refactor using lodash for state utils
* reorder imports
* reorder imports
* reorder dependencies
* reorder dependnecies an remove duplication block
* remove errant tab
* reorder dependencies
* Modify collections store to add headers to the store state. (https://github.com/woocommerce/woocommerce-blocks/pull/1073)
* add control for getting unparsed response from apiFetch
* Modify action so it recieves a response object.
* modify reducer to handle response object
* improve selectors to make headers accessible
- modifys existing `getCollection` to retrieve items from state.
- adds `getCollectionHeader` selector
* update resolvers to handle full response from request
- also adds resolver for `getCollectionHeader`
* update docs for changes
* Improve spacing in doc
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Fix spacing in inline docs
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* change `getFromState` to receive an object instead of arguments list.
* Prepare All Products block to accept extension inner blocks (https://github.com/woocommerce/woocommerce-blocks/pull/1047)
* Simplify BLOCK_MAP
* Prepare All Products block to accept extension inner blocks
* Change filter name
* Update filter name
* Add check that block exists in BLOCK_MAP
* Create REVERSED_BLOCK_MAP instead of searching blocks each time
* Change how child blocks are registered for All Products block
* Refactor All Products block so reverse map isn't needed
* Remove getDefaultBlocks
* Make sure getRegisteredInnerBlocks always returns an object and add checks to registerInnerBlock
* Add missing blockName arg
* Add inline docs to block registry
* Move 'blockName' prop to context
* Typos
* Improve registerInnerBlock error messages and create a validation function
* Refactor context
* Rename validateOption to assertOption
* refactor where new context lives and add alias for base-context
* fix doc block
* remove todo block (there’s an issue for it)
* rename context
* Update assets/js/atomic/components/product-list/sale-badge/index.js
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* HeadingToolbar comment
* Tweak bool comparison
* Improve how default layouts are set so all blocks can be removed and the no-content message is correct
* Sale centering
* Fix default template
* Product example switch to preview
* Update preview schema and image data to match latest schema
* Add @woocommerce/atomic-components alias
* Alias for previews to prevent need for relative paths
* Drop `align` for sale block
Align disrupts other blocks in unexpected and unavoidable ways. Drop support so the sale block is a block level item.
* Rename atomic components and blocks (and create ProductLayoutContext) (https://github.com/woocommerce/woocommerce-blocks/pull/1089)
* rename atomic blocks and components to be more generic (drop list)
* create new context for productlayout and implement provider
* Rename ProductSalesBadge to ProductSaleBadge
* Add php5.3 restriction for All Products block (https://github.com/woocommerce/woocommerce-blocks/pull/1090)
* enable legacy builds and add handling for AllProducts to be wp5.3 only
* fix legacy builds
* Prevent filemtime notice
* Implement new data stores with All Products block (https://github.com/woocommerce/woocommerce-blocks/pull/1067)
* add new hooks and tests and alias for hooks
* various fixes for stores after implementation tests
* implement new stores for ProductList component
* add doc blocks for useStoreProducts hooks
* fix typo in property on returned object