Commit Graph

637 Commits

Author SHA1 Message Date
Mike Jolley bf8715707d [Experiment] Add container to run php unit tests in docker (https://github.com/woocommerce/woocommerce-blocks/pull/2004)
* Add container to run php unit tests in docker

* Improvemnets to entrypoints

* Simplfiy dockerfile
2020-03-31 11:47:40 +01:00
Darren Ethier fb3cae67e6 Implement Stripe CC and Stripe ApplePay payment methods (https://github.com/woocommerce/woocommerce-blocks/pull/1983)
* Server side changes for payment method integrations

Including adding a stripe class temporarily

* update needed npm packages (and add some types)

* updates to contexts

* remove stepContent from payment config for payment methods

* update payment method interface and typedefs

Exposing a components property to pass along components that payment methods can use (so we keep styles consistent for them)

* add apple pay and stripe cc integration and remove paypal

* remove save payment checkbox from checkout block

It is handled by payment methods.

* Include an id prop for tabs

* fix activePaymentMethod pass through on rendered payment method element

also adds an id for the rendered tab

* add styles for payment method fields

If payment methods use these classes for their fields then the styles will get applied. It _could_ allow for consistent styling, we may have to provide design documentation for this?

These are styles in cases where payment methods have to use elements provided by the gateway (eg. Stripe elements). In future iterations we could look at providing components to payment methods to use (if they aren’t restricted by the gateway).

* fix rebase conflict

* do a test payment request for applePay to determine if the current browser supports it

* don’t console.error for stripe loading.

* Fix placeholder errors in the editor

* improve styling and add missing validation for inline card element

* update pacakge-lock

* rename payment-methods-demo folder to payment-methods-extension

* expose checkbox control on payment method interface

* export payment-methods-extension to it’s own asset build

This allows us to more accurately demonstrate how payment extensions would hook in to the blocks.

* don’t enqueue a style that doesn’t exist

* add full stop to comments and remove obsolete comment blcok

* fix spacing

* switch `activeContent` to `content` for payment method registration config
2020-03-30 08:07:49 -04:00
Darren Ethier 1648e651b4 Fix build issues for production builds (https://github.com/woocommerce/woocommerce-blocks/pull/2042)
* add payment-methods-demo config to sideEffects and install @wordpress/icons and @wordpress/primitives to be used directly.

* configure dependency extraction to ignore imports we want to use directly

* fix style issues for production builds

It looks like when a style is imported on the entrypoint of a component (or in a file with just exports), it get’s treeshaken from the final build _regardless of exception rules_.

* fix style imports from wordpress components

* fix loading skeleton showing on production builds

* fix block skeleton showing on production builds for cart

* import side effectful code

* add treatment for `@wordpress/warning` too

* fix typo

* exclude `settings/block` from sideEffects

* rollback `wordpress-components` update and keep sideEffects fixes

* remove unnecessary handle handling

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2020-03-27 16:56:48 -04:00
renovate[bot] e61a098d84 Update dependency dinero.js to v1.8.1 (https://github.com/woocommerce/woocommerce-blocks/pull/2017)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-03-25 16:40:11 +00:00
Darren Ethier 7525028fbf build storybook to github pages on pushes to master (https://github.com/woocommerce/woocommerce-blocks/pull/2006) 2020-03-22 11:40:42 -04:00
Darren Ethier 41b774a3e7 Add bundle size github workflow (https://github.com/woocommerce/woocommerce-blocks/pull/2005)
* Add bundle size github workflow

This workflow implements a bundle-size monitoring utility for our repository to give better metrics on increases in bundle-sizes. I basically copied the configuration for the WordPress gutenberg project workflow and it utilizes the [`preactjs/compressed-size-action`](https://github.com/preactjs/compressed-size-action).

If this works well, it will replace our existing bundlesize implementation.

* remove bundlewatch and related scripts

* more lint job fixes

- remove build:ci because it was only used for bundlesize check. No need to build files for linting checks.
- add lint:ci npm script for doing build lint checks
- update travis job config to use new script and update title

* change name of workflow
2020-03-21 12:10:53 -04:00
Mike Jolley 8abad3ad04 Add no payment methods placeholder (https://github.com/woocommerce/woocommerce-blocks/pull/1998)
* Update tabs and payment methods component classnames to meet standards

* Tidied up logic and added NoPaymentMethods placeholder

* Consistent "NO" placeholders

* frontend notices

* comments

* Update assets/js/base/components/payment-methods/no-payment-methods/style.scss

Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>

* Address feedback

* Moar bundle size

* Another notice

* Tweak text

Co-authored-by: Albert Juhé Lluveras <aljullu@gmail.com>
2020-03-20 12:48:11 -04:00
renovate[bot] a630ebfc2d Pin dependencies (https://github.com/woocommerce/woocommerce-blocks/pull/1985)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-03-18 18:02:55 +01:00
renovate[bot] d04296fc68 Update dependency use-debounce to v3.4.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1987)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-03-18 18:02:31 +01:00
renovate[bot] 11cff899f8 Update dependency bundlewatch to v0.2.6 (https://github.com/woocommerce/woocommerce-blocks/pull/1986)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-03-18 18:01:33 +01:00
Mike Jolley dadebfebbc Add line pricing for cart items in the API (https://github.com/woocommerce/woocommerce-blocks/pull/1979)
* Add line pricing for cart items

* Update checkout linePrice

* Fix tests

* Update schema - add dinero

* Implement dinero in cart totals

* Update preview and remove line totals

* Update package lock

* Update checkout review

* Fix preview and default data shapes
2020-03-17 15:34:33 +00:00
Darren Ethier ad4c981793 Add validation context provider and implement validation for shipping country and coupons. (https://github.com/woocommerce/woocommerce-blocks/pull/1972)
* add errormessage handling to countryinput (along with storybook)

* add types for react

* Add validation context and implement

* implement validation context for country field validation

* tweak ValidationInputError so that it can receive property name for getting error from

* improve storybook webpack config to pull from tsconfig.json

* update storybook story to cover changes with context

* Wrap Checkout Provider with Validation Context Provider

* add screen-reader-text style to storybook

* add styles for input error validation to text input

* improve styling for ValidationInputError component

* add validation error handling to TotalsCouponCode component

And story

* make sure errors are cleared on successful receive/remove item

* dispatch loading cancellation on catching errors

This is needed because loading would be cancelled before the error is thrown so any error handling after the thrown error will not be able to rely on loading.

* implement validation setting for coupon errors

* add error color to labels on inputs too

* fix borders back and force border color

* remove extra structure and improve validation error with alignment for coupon code

* add aria-describedby for text inputs

* add back in validation context provider to fix rebase issue

* rework validation so it works for both checkout and cart

* Some styling tweaks

* more style fixes

* remove unnecessary method

* make sure new function is included in context defaults

* package.lock update? seems harmless so rolling with it.
2020-03-17 12:45:33 +01:00
Darren Ethier cdfb457341 Add snackbar notices to notices system and implement for coupon ui/ux (https://github.com/woocommerce/woocommerce-blocks/pull/1973)
* 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
2020-03-16 16:57:12 -04:00
Albert Juhé Lluveras 5d1d8f0394 Add Order Summary card to Checkout sidebar (https://github.com/woocommerce/woocommerce-blocks/pull/1959)
* 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
2020-03-13 16:49:33 +01:00
renovate[bot] 47025baeb2 Update dependency webpack to v4.42.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1935)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-03-12 11:32:03 +01:00
renovate[bot] dc0878aa52 Update dependency webpack-cli to v3.3.11 (https://github.com/woocommerce/woocommerce-blocks/pull/1936)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-03-12 11:01:53 +01:00
renovate[bot] e9826817b2 Update dependency typescript to v3.8.3 (https://github.com/woocommerce/woocommerce-blocks/pull/1934)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-03-12 11:01:27 +01:00
renovate[bot] fc44104ccf Update dependency eslint-plugin-jest to v23.8.2 (https://github.com/woocommerce/woocommerce-blocks/pull/1933)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-03-12 11:00:01 +01:00
renovate[bot] 401fe1d6c5 Update dependency @types/jest to v25.1.4 (https://github.com/woocommerce/woocommerce-blocks/pull/1932)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-03-12 10:59:33 +01:00
renovate[bot] 67c6ee2e2a Update babel monorepo to v7.8.7 (https://github.com/woocommerce/woocommerce-blocks/pull/1931)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-03-12 10:58:47 +01:00
Seghir Nadir 952638a3ed Link shipping form fields to shipping rates to load them. (https://github.com/woocommerce/woocommerce-blocks/pull/1890)
* 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
2020-03-10 11:55:19 +01:00
Darren Ethier b6c0ce4299 bump up budget for checkout-frontend.js script (https://github.com/woocommerce/woocommerce-blocks/pull/1912) 2020-03-09 15:14:48 -04:00
Darren Ethier be5dfbd565 Update plugin zip build script with additional options. (https://github.com/woocommerce/woocommerce-blocks/pull/1893)
* update plugin build script to allow for development builds

* add new npm scripts to package.json

- running dev build without watch
- building a plugin zip for dev build.

* tweak script to have zip only build

* update docs to include new build options

* improve command docs
2020-03-08 21:59:31 -04:00
Seghir Nadir f872a3b605 Fix broken e2e test for Checkout block (https://github.com/woocommerce/woocommerce-blocks/pull/1869)
* fix broken e2e test - update snapshot for checkout block:
- new `use-shipping-as-billing` data attr

* add package.json script for updating e2e test snapshots
2020-03-05 10:00:39 +01:00
renovate[bot] ed09515edc Update babel monorepo to v7.8.6 (https://github.com/woocommerce/woocommerce-blocks/pull/1859)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-03-04 13:01:11 +00:00
renovate[bot] bb36890373 Update dependency config to v3.3.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1860)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-03-04 13:00:56 +00:00
renovate[bot] 0985e04494 Update dependency eslint-plugin-jest to v23.8.1 (https://github.com/woocommerce/woocommerce-blocks/pull/1861)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-03-04 13:00:39 +00:00
renovate[bot] fcf3d63d13 Update dependency react-number-format to v4.4.1 (https://github.com/woocommerce/woocommerce-blocks/pull/1862)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-03-04 13:00:29 +00:00
renovate[bot] de34bc63a3 Update dependency react-test-renderer to v16.13.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1863)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-03-04 12:59:53 +00:00
renovate[bot] b06286d887 Pin dependency @wordpress/notices to 2.0.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1858)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-03-04 12:59:39 +00:00
Mike Jolley d3a9dc3d6b Create Context Provider for Notices w/ Notices API (https://github.com/woocommerce/woocommerce-blocks/pull/1843)
* 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>
2020-03-03 10:26:02 +00:00
Darren Ethier 12a28556db Switch lint:js command to use wp-scripts and address errors. (https://github.com/woocommerce/woocommerce-blocks/pull/1837)
* switch js lint command to use wp-scripts.

* fix lint warning for improper jsdoc syntax

* fix linting errors
2020-02-28 16:54:07 -05:00
renovate[bot] d5094047ee Update dependency babel-eslint to v10.1.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1812)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-26 12:46:04 +00:00
renovate[bot] 4281fbf13d Update dependency config to v3.2.6 (https://github.com/woocommerce/woocommerce-blocks/pull/1815)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-26 12:45:29 +00:00
renovate[bot] 8dfa248a1f Update dependency eslint-plugin-jest to v23.8.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1816)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-26 12:45:13 +00:00
renovate[bot] f22ef7f7d5 Pin dependencies (https://github.com/woocommerce/woocommerce-blocks/pull/1811)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-26 12:44:43 +00:00
Darren Ethier 25e86fbc56 move jest types to devDependencies 2020-02-25 14:01:23 -05:00
Mike Jolley 6d7fdf50e0 Allow coupons to be applied and removed from the cart (https://github.com/woocommerce/woocommerce-blocks/pull/1790)
* 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
2020-02-25 11:36:53 +00:00
Darren Ethier f8d6735baf Create typedefs and add basic typescript configuration (https://github.com/woocommerce/woocommerce-blocks/pull/1796)
* 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
2020-02-24 07:52:24 -05:00
renovate[bot] edd3745f4a Update dependency downshift to v4.1.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1771)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-21 10:53:50 +01:00
renovate[bot] 05d2815cf5 Update dependency eslint-plugin-jest to v23.7.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1772)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-19 16:36:56 +00:00
renovate[bot] 8209ecabbd Update dependency puppeteer to v2.1.1 (https://github.com/woocommerce/woocommerce-blocks/pull/1773)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-19 16:36:23 +00:00
renovate[bot] cd7a34a651 Update dependency compare-versions to v3.6.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1770)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-19 16:36:06 +00:00
renovate[bot] d5df819644 Update Node.js to v12.16.1 (https://github.com/woocommerce/woocommerce-blocks/pull/1769)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-19 16:35:04 +00:00
renovate[bot] 961a5274b2 Update dependency rimraf to v3.0.2 (https://github.com/woocommerce/woocommerce-blocks/pull/1774)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-19 16:34:39 +00:00
Mike Jolley d76c3e0714 Implement __experimentalCreateInterpolateElement for translations. (https://github.com/woocommerce/woocommerce-blocks/pull/1736)
* 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>
2020-02-17 16:31:55 +00:00
Albert Juhé Lluveras 6736a9d94a Add ShippingCalculator component (https://github.com/woocommerce/woocommerce-blocks/pull/1559)
* 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
2020-02-17 12:12:15 +01:00
renovate[bot] 95abb4871a Update Node.js to v12.16.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1723)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-14 11:14:46 +00:00
Albert Juhé Lluveras 8297530e95 Fix ESLint error when commiting bin/webpack-helpers.js (https://github.com/woocommerce/woocommerce-blocks/pull/1729) 2020-02-13 14:16:16 +01:00
renovate[bot] 2320b8aa75 Update babel monorepo (https://github.com/woocommerce/woocommerce-blocks/pull/1724)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-12 08:01:30 -08:00
renovate[bot] 173a83e524 Pin dependencies (https://github.com/woocommerce/woocommerce-blocks/pull/1722)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-12 07:55:38 -08:00
renovate[bot] 2e4e51b752 Update dependency commander to v4.1.1 (https://github.com/woocommerce/woocommerce-blocks/pull/1725)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-12 07:43:36 -08:00
Mike Jolley 60d05aed19 Product search block e2e test (https://github.com/woocommerce/woocommerce-blocks/pull/1712)
* add docker files

* get tests to work

* remove irrelevant files

* add woocommerce as a dep

* remove eslintignore for tests

* undo travis chages till another PR

* remove local utils and call them directly from woocommerce

* remove travis db

* Block snapshot

* Test than the block can be inserted and interacted with

* Add snapshop

* Update snapshot

* rebase on master

* add a build script for just doing npm build on e2e tests

* just run build for e2e test job

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-02-11 12:23:23 -05:00
Darren Ethier a7cd7d6b22 Fix wp-cli container permissions issues for e2e docker test environment (https://github.com/woocommerce/woocommerce-blocks/pull/1716)
* add docker files

* get tests to work

* remove irrelevant files

* change userAgent to chrome

* add woocommerce as a dep

* add jest to eslint

* remove eslintignore for tests

* undo travis chages till another PR

* remove local utils and call them directly from woocommerce

* update deps

* add setup files to run tests

* export default wp link

* wait for select before selecting

* remove travis db

* ignore e2e tests in unit testing

* add tests

* add docker commands

* always run composer

* Make it possible to import directly from '@woocommerce/e2e-tests/utils'

* remove installing woocommerce via composer.

* add more docker npm scripts

* add custom docker config for wp-cli

* add changes to docker-composer.yml

Includes reading environment variables from `.env`

* revert customizations to .travis.yml

* move main docker file for the wordpress container to bin

* fix travis config

* rename wp install for travis builds back to original name

* use a version of docker-compose that travis supports

* add minor change to try and force travis test run

* fix incorrect command

* copy composer lock from master

* only run phpcs on /src directory

* give time for host to spin up for e2e tests

* increase sleep for waiting on container

* make sure plugin is built before running tests

* sigh fix improper command usage

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Albert Juhé Lluveras <aljullu@gmail.com>
2020-02-11 11:13:20 -05:00
renovate[bot] 43f56151cd Update wordpress monorepo (https://github.com/woocommerce/woocommerce-blocks/pull/1709)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-10 17:02:09 -05:00
renovate[bot] 1007aff626 Update dependency cross-env to v7 (https://github.com/woocommerce/woocommerce-blocks/pull/1710)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-10 16:47:41 -05:00
renovate[bot] 1e708d4ce7 Update dependency lint-staged to v10 (https://github.com/woocommerce/woocommerce-blocks/pull/1711)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-10 16:47:05 -05:00
renovate[bot] 0a6190c708 Update storybook monorepo to v5.3.12 (https://github.com/woocommerce/woocommerce-blocks/pull/1708)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-10 16:45:25 -05:00
renovate[bot] bfadae7bba Update dependency @babel/core to v7.8.4 (https://github.com/woocommerce/woocommerce-blocks/pull/1707)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-10 16:34:11 -05:00
renovate[bot] b5e9e1851c Pin dependency create-file-webpack to 1.0.2 (https://github.com/woocommerce/woocommerce-blocks/pull/1706)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-10 16:25:59 -05:00
Seghir Nadir 8e3ac17585 Introduce feature flags (https://github.com/woocommerce/woocommerce-blocks/pull/1631)
* 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
2020-01-31 21:04:37 +01:00
Seghir Nadir bfb2f33bfd add new icons and remove old ones (https://github.com/woocommerce/woocommerce-blocks/pull/1644)
* 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
2020-01-31 19:20:33 +01:00
Rua Haszard 7f44458418 Basic storybook implementation (https://github.com/woocommerce/woocommerce-blocks/pull/1636)
* 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>
2020-01-31 09:59:14 +13:00
renovate[bot] dd53b1779b Update wordpress monorepo (https://github.com/woocommerce/woocommerce-blocks/pull/1666)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-30 13:16:52 +01:00
renovate[bot] 2e78ff6187 Update dependency rimraf to v3.0.1 (https://github.com/woocommerce/woocommerce-blocks/pull/1664)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-30 12:07:06 +01:00
renovate[bot] 35c0d176df Update npm to v6.13.7 (https://github.com/woocommerce/woocommerce-blocks/pull/1665)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-30 11:58:28 +01:00
renovate[bot] 3f982ab71c Update dependency eslint-config-prettier to v6.10.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1663)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-30 11:57:52 +01:00
renovate[bot] 3306726a35 Update dependency downshift to v4.0.8 (https://github.com/woocommerce/woocommerce-blocks/pull/1662)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-30 11:53:34 +01:00
renovate[bot] c13449d5e6 Pin dependencies (https://github.com/woocommerce/woocommerce-blocks/pull/1661)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-30 11:53:22 +01:00
Darren Ethier db14accc64 Update changelog script. (https://github.com/woocommerce/woocommerce-blocks/pull/1655)
This pull:

- removes zenhub option from package.json
- installs and implement `merge-config` package. This allows for usage of environment variables and command line variables along with `package.json` configuration for the changelog generation.
- implements new variable: `devNoteLabel` for indicating what label indicates the pull has (or requires) a devnote. Pull Requests with this label will have `[DN]` appended to the changelog entry.
- adds new variable: `changelogSrcType` for indicating what source to use for generating changelogs (can be `MILESTONE` or `ZENHUB_RELEASE`). Implemented detection of this in code, defaults to `MILESTONE`.
- Modify initial setup text so if user already has api key(s) setup, then we don't give instructions again. Also improve the output when keys aren't set to make it clear what needs done.
- Make the environment variable for Zenhub Api token consistent with Github token (`ZH_API_TOKEN` instead of `ZH_API_KEY`).
- Update package.json with changelog script variation for running it with zenhub release as the source.
- Update `RELEASE.md` docs to clarify changelog script options
- Add a `README.md` doc for the changelog script.
2020-01-28 08:47:26 -05:00
Albert Juhé Lluveras 2014e6f1e2 Reorganize dependencies in package.json (https://github.com/woocommerce/woocommerce-blocks/pull/1633)
* Reorganize dependencies in package.json

* Move '@wordpress' entries back to devDependencies
2020-01-24 13:00:11 +01:00
Mike Jolley d1737e76c2 Change default rows for product grid blocks to 3 (https://github.com/woocommerce/woocommerce-blocks/pull/1613)
* 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
2020-01-22 16:58:25 +00:00
renovate[bot] 4b9d10c591 Update dependency node-sass to v4.13.1 (https://github.com/woocommerce/woocommerce-blocks/pull/1623)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-22 11:19:48 +01:00
renovate[bot] 48b510646f Update dependency downshift to v4.0.7 (https://github.com/woocommerce/woocommerce-blocks/pull/1621)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-22 11:19:40 +01:00
renovate[bot] ebcc98f43a Update dependency eslint-plugin-jest to v23.6.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1622)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-22 11:19:13 +01:00
renovate[bot] 88a9b686b9 Pin dependency @wordpress/html-entities to 2.5.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1620)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-22 11:00:50 +01:00
Albert Juhé Lluveras cad3e72769 Create CountryInput component (https://github.com/woocommerce/woocommerce-blocks/pull/1585)
* 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
2020-01-17 17:58:08 +01:00
renovate[bot] dfc963b545 Pin dependencies (https://github.com/woocommerce/woocommerce-blocks/pull/1567)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-15 15:19:06 +00:00
renovate[bot] 8f73d68904 Update dependency css-loader to v3.4.2 (https://github.com/woocommerce/woocommerce-blocks/pull/1571)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-15 10:20:06 +01:00
renovate[bot] fa188ecc85 Update babel monorepo to v7.8.3 (https://github.com/woocommerce/woocommerce-blocks/pull/1568)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-15 10:19:51 +01:00
renovate[bot] 1f8e0ffcdf Update dependency autoprefixer to v9.7.4 (https://github.com/woocommerce/woocommerce-blocks/pull/1569)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-15 10:19:31 +01:00
renovate[bot] 095b992c75 Update dependency core-js to v3.6.4 (https://github.com/woocommerce/woocommerce-blocks/pull/1570)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-15 10:15:02 +01:00
renovate[bot] 5b13fc2b1a Update dependency downshift to v4.0.5 (https://github.com/woocommerce/woocommerce-blocks/pull/1572)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-15 10:12:04 +01:00
Darren Ethier a50dab39fc Improve changelog script (https://github.com/woocommerce/woocommerce-blocks/pull/1543)
The changelog script now has the following:

- constructed more modularly for easier maintenance.
- removed coupling to blocks repository so it can be used in more contexts (potentially publishing as it's own package).
- switched to use github v4 api (graphql) to reduce number of requests (reducing the likelihood of hitting api limits)
- added support for zenhub releases instead of github milestones for what pulls to derive changelog from.
2020-01-13 10:06:32 -05:00
Albert Juhé Lluveras 6c806bacac Remove vendors-frontend from Webpack config (https://github.com/woocommerce/woocommerce-blocks/pull/1544)
* Remove vendors-frontend from Webpack config

* Increase cart-frontend.js bundlewatch limit

* Remove 'wc-vendors-frontend' from Cart block dependencies
2020-01-10 20:21:14 +01:00
Albert Juhé Lluveras bd2b8cb279 Add Cart totals to Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/1411)
* 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
2020-01-10 15:37:27 +01:00
Rua Haszard 0763655d42 Cart block: line-items front end initial work (https://github.com/woocommerce/woocommerce-blocks/pull/1333)
* 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
2020-01-10 11:50:14 +13:00
renovate[bot] 16da8d64b8 Update dependency downshift to v4 (https://github.com/woocommerce/woocommerce-blocks/pull/1511)
Co-authored-by: Renovate Bot <renovatebot@gmail.com>
2020-01-09 11:11:16 +01:00
renovate[bot] 988ba8d29c Update dependency eslint-plugin-jest to v23.3.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1509)
Co-authored-by: Renovate Bot <renovatebot@gmail.com>
2020-01-08 11:24:33 +00:00
renovate[bot] 253ee458cf Update dependency yargs to v15.1.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1510)
Co-authored-by: Renovate Bot <renovatebot@gmail.com>
2020-01-08 11:18:27 +00:00
renovate[bot] bc3099263b Update dependency css-loader to v3.4.1 (https://github.com/woocommerce/woocommerce-blocks/pull/1508)
Co-authored-by: Renovate Bot <renovatebot@gmail.com>
2020-01-08 10:53:47 +00:00
renovate[bot] 4b8cf4421c Update dependency core-js to v3.6.2 (https://github.com/woocommerce/woocommerce-blocks/pull/1507)
Co-authored-by: Renovate Bot <renovatebot@gmail.com>
2020-01-08 10:49:20 +00:00
renovate[bot] 3edab98ebc Update Node.js to v12.14.1 (https://github.com/woocommerce/woocommerce-blocks/pull/1506)
Co-authored-by: Renovate Bot <renovatebot@gmail.com>
2020-01-08 10:48:05 +00:00
Albert Juhé Lluveras 604bfb76cb Update Node.js to v12.13.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1459)
* Update Node.js to v12.13.0

* Remove npm rebuild

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2020-01-02 10:51:17 +01:00
renovate[bot] 52a3fdb3f6 Update wordpress monorepo (https://github.com/woocommerce/woocommerce-blocks/pull/1465) 2020-01-02 09:53:46 +01:00
renovate[bot] d988644ea0 Update dependency eslint-plugin-jest to v23.2.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1461) 2020-01-02 09:53:19 +01:00
renovate[bot] dd6763c929 Update npm to v6.13.4 (https://github.com/woocommerce/woocommerce-blocks/pull/1464) 2020-01-02 09:49:31 +01:00
renovate[bot] cdad0233af Update dependency webpack to v4.41.5 (https://github.com/woocommerce/woocommerce-blocks/pull/1463) 2020-01-02 09:49:02 +01:00
renovate[bot] ad5a619abd Update dependency stylelint to v12.0.1 (https://github.com/woocommerce/woocommerce-blocks/pull/1462) 2020-01-02 09:47:54 +01:00
renovate[bot] 8d755ff53e Update dependency eslint-config-prettier to v6.9.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1460) 2020-01-02 09:46:04 +01:00
Albert Juhé Lluveras e7a12cf28c Uninstall style-loader (https://github.com/woocommerce/woocommerce-blocks/pull/1445) 2019-12-31 10:08:55 +01:00
renovate[bot] 2c2736c8fb Update dependency @babel/core to v7.7.7 (https://github.com/woocommerce/woocommerce-blocks/pull/1436) 2019-12-25 12:46:50 +01:00
renovate[bot] 9aff4db748 Update dependency @octokit/rest to v16.36.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1437) 2019-12-25 12:46:22 +01:00
renovate[bot] cc0ee50685 Update dependency core-js to v3.6.1 (https://github.com/woocommerce/woocommerce-blocks/pull/1438) 2019-12-25 12:45:08 +01:00
renovate[bot] c73f5b6898 Update dependency eslint to v6.8.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1439) 2019-12-25 12:44:47 +01:00
renovate[bot] 4ab46dbb7f Update dependency mini-css-extract-plugin to v0.9.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1440) 2019-12-25 12:44:36 +01:00
renovate[bot] dbad049a6b Update dependency style-loader to v1.1.1 (https://github.com/woocommerce/woocommerce-blocks/pull/1441) 2019-12-25 12:44:22 +01:00
renovate[bot] 47d695b7ad Update dependency @octokit/rest to v16.35.2 (https://github.com/woocommerce/woocommerce-blocks/pull/1407) 2019-12-18 10:51:46 +01:00
renovate[bot] c053ea1846 Update Node.js to v10.18.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1406) 2019-12-18 10:25:27 +01:00
renovate[bot] 963118fd23 Pin dependency bundlewatch to 0.2.5 (https://github.com/woocommerce/woocommerce-blocks/pull/1405) 2019-12-18 10:24:51 +01:00
renovate[bot] 840562d846 Update dependency core-js to v3.5.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1408) 2019-12-18 10:24:26 +01:00
renovate[bot] 81397f5d39 Update dependency css-loader to v3.4.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1409) 2019-12-18 10:24:05 +01:00
renovate[bot] 6c7becc9fb Update dependency downshift to v3.4.8 (https://github.com/woocommerce/woocommerce-blocks/pull/1410) 2019-12-18 10:23:36 +01:00
Darren Ethier c285bb853f mark atomic blocks as side-effect free. (https://github.com/woocommerce/woocommerce-blocks/pull/1402) 2019-12-17 18:32:08 +01:00
Darren Ethier 5800aca3db Try bundlewatch (https://github.com/woocommerce/woocommerce-blocks/pull/1365)
* remove bundlesize config

* install bundlewatch and add config

* tighten config file

* fix pattern for vendors file
2019-12-11 11:30:54 -05:00
Darren Ethier cd25b1be07 Install bundlecop and configure in package.json size-check script (https://github.com/woocommerce/woocommerce-blocks/pull/1364)
* install bundlecop and configure in package.json size-check script

* update js doc to test bundlecop

* uninstall bundlesize package
2019-12-11 09:58:49 -05:00
Darren Ethier d153ecad2e Fix increase in some bundle sizes (https://github.com/woocommerce/woocommerce-blocks/pull/1363)
* 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!
2019-12-11 07:29:09 -05:00
renovate[bot] 9c17dff473 Update dependency @babel/core to v7.7.5 (https://github.com/woocommerce/woocommerce-blocks/pull/1359) 2019-12-11 10:11:17 +01:00
renovate[bot] 5f6507d6ba Update dependency core-js to v3.4.8 (https://github.com/woocommerce/woocommerce-blocks/pull/1360) 2019-12-11 10:11:12 +01:00
renovate[bot] 8e310e3d6e Update dependency css-loader to v3.3.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1361) 2019-12-11 10:10:56 +01:00
renovate[bot] 0fec59027d Pin dependency @wordpress/scripts to 6.0.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1358) 2019-12-11 10:09:53 +01:00
Mike Jolley 5a1bbbefb9 Update NPM dependencies and script dependency handling (https://github.com/woocommerce/woocommerce-blocks/pull/1337)
* 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).
2019-12-10 12:17:46 -05:00
renovate[bot] 2c31eb2c25 Update dependency css-loader to v3.2.1 (https://github.com/woocommerce/woocommerce-blocks/pull/1316) 2019-12-04 09:04:55 +01:00
renovate[bot] 780171af56 Update dependency autoprefixer to v9.7.3 (https://github.com/woocommerce/woocommerce-blocks/pull/1314) 2019-12-04 09:04:44 +01:00
renovate[bot] d6fc110913 Update dependency core-js to v3.4.7 (https://github.com/woocommerce/woocommerce-blocks/pull/1315) 2019-12-04 09:04:31 +01:00
renovate[bot] 274e971220 Update dependency eslint to v6.7.2 (https://github.com/woocommerce/woocommerce-blocks/pull/1317) 2019-12-04 09:04:22 +01:00
renovate[bot] 0c819caf73 Pin dependency downshift to 3.4.3 (https://github.com/woocommerce/woocommerce-blocks/pull/1313) 2019-12-04 09:03:40 +01:00
Albert Juhé Lluveras f7c807a0c6 Add dropdown display style to Attribute Filter block (https://github.com/woocommerce/woocommerce-blocks/pull/1255)
* 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
2019-12-03 14:39:11 +01:00
Darren Ethier be199a6d48 Restore back-compat loading of assets registry switch which ensures wcSettings is only loaded when necessary (https://github.com/woocommerce/woocommerce-blocks/pull/1292)
* restore back-compat switch

* update woocommerce/components dependency to latest version

* fix bug in AssetDataRegistry and add tests to guard against regressions
2019-12-02 14:53:36 -05:00
Jeff Stieler fb8a21ba81 Add getAdminLink() to shared settings export. (https://github.com/woocommerce/woocommerce-blocks/pull/1244)
* Add getAdminLink() to shared settings export.

* Import getAdminLink from @woocommerce/settings

* Uninstall @woocommerce/navigation
2019-11-28 17:33:29 +01:00
renovate[bot] 007e19eb68 Update dependency eslint to v6.7.1 (https://github.com/woocommerce/woocommerce-blocks/pull/1268) 2019-11-27 11:19:08 +01:00
renovate[bot] e326639a37 Update dependency core-js to v3.4.4 (https://github.com/woocommerce/woocommerce-blocks/pull/1267) 2019-11-27 11:19:00 +01:00
renovate[bot] 2ce6504676 Update babel monorepo to v7.7.4 (https://github.com/woocommerce/woocommerce-blocks/pull/1266) 2019-11-27 11:18:53 +01:00
renovate[bot] 18d2757665 Update dependency request-promise to v4.2.5 (https://github.com/woocommerce/woocommerce-blocks/pull/1269) 2019-11-27 10:36:34 +01:00
renovate[bot] dc13d9c8ec Update dependency react-test-renderer to v16.12.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1225) 2019-11-26 06:38:12 +01:00
renovate[bot] e5a7d1bab9 Update dependency node-sass to v4.13.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1224) 2019-11-26 06:37:57 +01:00
renovate[bot] 571254f69e Update dependency lint-staged to v9.4.3 (https://github.com/woocommerce/woocommerce-blocks/pull/1223) 2019-11-26 06:37:18 +01:00
renovate[bot] 1d3201609b Update dependency eslint-config-prettier to v6.7.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1222) 2019-11-26 06:36:56 +01:00
renovate[bot] 85ed640634 Update dependency autoprefixer to v9.7.2 (https://github.com/woocommerce/woocommerce-blocks/pull/1221) 2019-11-26 06:36:32 +01:00
Mike Jolley fc32c0a9ed Update translation handling to include core translations (https://github.com/woocommerce/woocommerce-blocks/pull/1242)
* 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
2019-11-23 16:28:54 +00:00
renovate[bot] 868db00a86 Pin dependency use-debounce to 3.1.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1220) 2019-11-21 11:51:46 +00:00
Darren Ethier 688d60d9bd update to dev version 2019-11-19 14:08:55 -05:00
Seghir Nadir 7995d56d9f Bumping version strings to new version. 2019-11-19 18:20:22 +01:00
Mike Jolley d613d2fde6 Active filters block (https://github.com/woocommerce/woocommerce-blocks/pull/1168)
* 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
2019-11-15 14:41:23 +00:00
renovate[bot] 9c9b248c6d Update dependency core-js to v3.4.1 (https://github.com/woocommerce/woocommerce-blocks/pull/1164) 2019-11-13 10:14:01 +01:00
renovate[bot] e721c2d6c7 Update dependency eslint-plugin-jest to v22.21.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1165) 2019-11-13 10:13:51 +01:00
renovate[bot] 69af13bc45 Update dependency @octokit/rest to v16.35.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1163) 2019-11-13 09:48:43 +01:00
renovate[bot] cff026bd93 Update dependency @babel/core to v7.7.2 (https://github.com/woocommerce/woocommerce-blocks/pull/1162) 2019-11-13 09:48:31 +01:00
Albert Juhé Lluveras 2f04c61223 Update dependencies order (https://github.com/woocommerce/woocommerce-blocks/pull/1146)
* 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
2019-11-08 17:30:11 +01:00
renovate[bot] 0295379b49 Update dependency @octokit/rest to v16.34.1 (https://github.com/woocommerce/woocommerce-blocks/pull/1130) 2019-11-06 11:44:26 +01:00