* Add schema/GET endpoint
* Customer data updates + create tests
* Update docs
* Unused method
* Use ID from the customer object, rather than checking logged in user
* PHP 5.6 incompatibility
* Correct docblock
* Implement coupons endpoint with add/delete/get functionality
* Add totals
* Use money formatting
* Added tests for new endpoints
* Add coupons to main cart endpoint and update docs to match
* Fix indenting in readme
* is_a to instanceof
* Update coupon_exists logic
* Documentation/tidy class
* Update currency responses for coupon totals w/ tests
* 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
* Implement basic version of MoneyValue with decimal conversion
* Implement MoneyValue in cart classes
* Add minor unit to schema
* Update tests
* Add tests
* Tweak minor unit description
* Replace pow
* Dump rounding mode and use constant values
* Only return strings
* prepare_money_response method
* Update types back to string
* Remove unnecessary parentheses
* Feedback; force integer rounding mode to prevent notices
* add more pricing detail to cart line items api:
- total line price, before any coupon/discount
- saving, aka discount amount (if any)
- boolean if saving > 0
* add new cart price info properties to schema
* tidy field naming – line subtotal=pre discounts, line total=discounted
* remove saving / discount fields from API – could be calculated on client
* return numbers (not string) for price fields
* rename API field "price" to product price for clarity
* fix schema type for total fields (now float)
* Total descriptions in schema
* Format all costs as strings to follow core rest api
* Add totals to cart schema
* Update tests
* tax_lines
* import svg directly to avoid pulling all dependencies
* revert unnecessary change with sideEffects figured out.
* add sideEffects to package json.
This results in a ~60% reduction in bundle sizes!
* 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
* Update Domain/Package so plugin file is not required, only a path.
* remove WC_BLOCKS_PLUGIN_FILE constant and add more inline docs
* Update tests
* Remove WC_BLOCKS_PLUGIN_FILE constant
* 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
* restore back-compat switch
* update woocommerce/components dependency to latest version
* fix bug in AssetDataRegistry and add tests to guard against regressions
* 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
* Remove language files and po2json generation scripts
* Add action filter and function to load core translations
* Use pre_load_script_translations
* Remove script actions
* docblock
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'
* Show notices when PHP or WP versions are not met
* Update version-changes.sh so it updates versions in woocommerce-gutenberg-products-block.php
* Convert constants to normal variables
* Remove error_log calls
* Remove button with PHP update link
* Show notices only in plugins and WooCommerce pages
* 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 version change script so it accounts for the new version setting in Package
* fix hardcoded version string in replacement script
* change version registration block
* improve specificity of version string change
* 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
* Introduce filter hook `woocommerce_blocks_product_grid_hash_args`
This filter allows to extend the hash arguments depending on the context
(e.g. a specific language with WPML).
* BlocksWpQuery class to wrap WP Query
* Use BlocksWpQuery
* Use query_vars for hash and add inline docs
* 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
* Add previews for Reviews blocks
* Use double negation instead of Boolean
* Refactor withReviews to use class properties
* Fix tests
* Make example data translatable
* install compare-versions and export on `@woocommerce/settings` external
* expose `wp_version` on wcSettings
* export a compareWithWpVersion function for easier version checking
* improve semver coercing for wp version check
also add tests
* fix for code standards around imports
* switch to camelcase for version option
* install directory-named-webpack-plugin
* create new plugin for fallback legacy imports
* implement webpack configuration for fallback legacy imports and legacy builds
Note: legacy builds are currently disabled, we can enable by just commenting out when we need them.
* removed unused webpack plugin experimented with in earlier iteration
* prettier fixes
* add legacy folder with readme for explanation
* add some info on legacy builds to `CONTRIBUTING.md`
* refactor imports to use new aliases
* fix link in doc
* update jest test config for new aliases
* use native string.startsWith instead of custom function
* reformat file for spacing/code style
* add slash to alias
* clean up webpack config and make things more dry
* update indent style for json files to be tab not spaces
- adjusts editorconfig rules
- reformat jest.config.json
* simplify conditional
* Update ProductControl to use HOCs
* Only show variations in certain ProductControls
* Cleanup
* Refactor withSingleSelected selected prop logic
* Fix selected values not being respected
* Fix wrong propTypes notation
* Set parent: 0 in getProducts util func
* Use static properties in withProductVariations
* Move messages outside of the functional component
* Check that variations is an array
* Fix debounced search
* Fix broken tests
* Rename withSingleSelected to withTransformSingleSelectToMultipleSelect