Commit Graph

22 Commits

Author SHA1 Message Date
Niels Lange 6a74887464 Limit CSS styles to WooCommerce Block icons only (https://github.com/woocommerce/woocommerce-blocks/pull/5363)
* Limit CSS styles to WooCommerce Block icons only

* Update assets/css/editor.scss

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2021-12-10 21:32:44 +07:00
Niels Lange 865a0a5ffa Update icon of legacy template block (https://github.com/woocommerce/woocommerce-blocks/pull/5317)
* Update icon of legacy template block

* Display legacy block template color in Woo purple

* Display icons in white when block being selected within list view
2021-12-10 17:07:10 +07:00
Mike Jolley cfeb5558b7 Update WordPress Monorepo packages with React 17x support (https://github.com/woocommerce/woocommerce-blocks/pull/5223)
* Use npm 14

* Update WP packages

* Update non-dev wordpress dependencies

* Remove usage of @automattic/data-stores

* Moves tag, search-list-control components back into private `editor-components` to mitigate dependency conflicts with`@woocommerce/components`

* Fix tests with act()

* package-lock

* fix broken maps

* Patch 14x package

* update locks

* Revert nvmrc change

* Fix tests due to debounce

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2021-12-07 15:47:50 +00:00
Niels Lange 74bf23ce35 Twenty Twenty: Adjust font styles for filter and product grid blocks (https://github.com/woocommerce/woocommerce-blocks/pull/4749)
* Twenty Twenty: Adjust font styles for filter and product grid blocks

* Add missing CSS class for stock filter
2021-09-15 13:35:06 +02:00
Niels Lange 9428e791c9 Replace deprecated divisions with math.div($size, $base) (https://github.com/woocommerce/woocommerce-blocks/pull/4550)
* Replace deprecated SASS divisions

* Load '@use "sass:math"' before any other rules
2021-08-24 13:37:43 +02:00
Albert Juhé Lluveras c94187e450 Update @woocommerce/components (https://github.com/woocommerce/woocommerce-blocks/pull/4100)
* Add isCompact prop to components using SearchListControl

* Update @woocommerce/components to 6.1.2

* Remove legacy CSS code

* Add some CSS rules to override conflicting editor styles

* Replace showCount prop with has-count class name

* Create ExpandableSearchListItem component

* Refactor ProductControl so it uses ExpandableSearchListItem

* Update @woocommerce/components to 6.2.0

* Fix @woocommerce/components builds breaking

* Fix a11y of expandable item list children

* Set categories to an empty array by default

* Render compact control in Attribute filter sidebar

* Add countLabel to ProductAttributeTermControl

* Fix ProductTagControl selected items

* Use sentence case for countLabel

* Fix wrong margins in block editor

* Fix checkbox alignment

* Update package-lock.json

* Fix withCategories test

* Fix JS error in Filter Products by Attribute block

* Make input ids unique
2021-05-20 10:58:59 +02:00
Albert Juhé Lluveras 1e2bc1ee72 SearchListControl styles cleanup (https://github.com/woocommerce/woocommerce-blocks/pull/3604)
* Update comment about styles that have been upstreamed

* Remove code that has been upstreamed long time ago

* Fix wrong PR number in comment
2020-12-29 17:02:09 +01:00
Mike Jolley cf9dc1b6bf Fix Twenty Twenty One Button and Placeholder Styling (https://github.com/woocommerce/woocommerce-blocks/pull/3443)
* Reset product list padding

* Adjust placeholder color if css variable exists

This is 2021 specific but may become more prominant.

* FIx editor button styles in 2021

* Adjust button sizes based on columns

* Adjust padding
2020-11-23 14:21:36 -05:00
Albert Juhé Lluveras 10ceda5851 Use @wordpress/base-styles and @automattic/color-studio as a base for our styles (https://github.com/woocommerce/woocommerce-blocks/pull/3300)
* Use colors variables instead of hardcoded values when possible

* Update WC colors from @automattic/color-studio

* Decrease specificity of price-slider CSS selectors

* Update colors to WC purple

* Update bright colors

* Update grays

* Update blacks and whites

* Add @todo comment

* Remove unnecessary blank line

* Remove purple color from price slider handle

* Fix colors not shown in SVG background

* Remove unnecessary box-shadow declaration

* Add theming docs

* Refactor/remove SCSS variables

* Add @todo comment to breakpoints

* Update package-lock.json
2020-10-22 12:40:32 +02:00
Albert Juhé Lluveras 0ba29d28d4 Update placeholder styles (https://github.com/woocommerce/woocommerce-blocks/pull/2456)
* Convert several default buttons to primary

* Align primary and tertiary buttons

* Align select controls of placeholders

* Don't force a placeholder background color

* Add border to placeholder lists

* Add work-around for SearchListComponent compatibility with last version of @wordpress/components
2020-05-28 12:20:47 +02:00
Albert Juhé Lluveras 6d1cb26d63 Import TwentyTwenty block styles from Core (https://github.com/woocommerce/woocommerce-blocks/pull/2513)
* Add TwentyTwenty styles from Core

* Increase product on sale selector specificity

* Add theme class name to admin

* Fix some more style discrepancies

* Use em instead of rem
2020-05-21 19:09:50 +02:00
Mike Jolley 1942491822 Checkout Block: Add Legal links (https://github.com/woocommerce/woocommerce-blocks/pull/1881)
* Create policy component

* Create page constants

* Add toggle options

* Update assets/js/base/components/checkout/policies/style.scss

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

* Update assets/css/editor.scss

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

* Feedback

* update snapshot

Co-authored-by: Albert Juhé Lluveras <aljullu@gmail.com>
2020-03-06 12:20:17 +00:00
Rua Haszard 1ec624f2d7 Fix inconsistent heading editor styles for filter blocks (https://github.com/woocommerce/woocommerce-blocks/pull/1256)
* override title bg to transparent in editor for filter blocks
2019-11-26 11:56:14 +01:00
Mike Jolley f851a6ef9b All Products with Inner Blocks (https://github.com/woocommerce/woocommerce-blocks/pull/1032)
* 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
2019-10-28 09:53:09 -04:00
Mike Jolley 00ab1d1913 Add responsive product grid styles (https://github.com/woocommerce/woocommerce-blocks/pull/1066)
* Add responsive grid styles

* Tweak 2 column padding.

* Use mixin
2019-10-24 14:39:50 +01:00
Albert Juhé Lluveras 3829707bf9 Add error states to all components/blocks which use HOCs (https://github.com/woocommerce/woocommerce-blocks/pull/928)
* Show errors in Products Control component

* Export error formatting logic into a util
2019-08-30 11:36:06 +02:00
Mike Jolley ac74504400 Experiment: Handling API fetch errors (https://github.com/woocommerce/woocommerce-blocks/pull/679)
* error handling

* Update assets/js/blocks/featured-product/block.js

Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>

* Update assets/js/blocks/featured-product/block.js

Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>

* Move to dedicated component

* escape messages and remove debug code

* merge conflict

* move renderApiError

* Revert "move renderApiError"

This reverts commit 2d5ffdecf2fae66434ac16b71d9b349fa1b61783.

* Revert "merge conflict"

This reverts commit bdc8eb4bd0f8dd5e4525c758fe3e79ffeefff3f5.

* Update assets/js/components/api-error-placeholder/index.js

Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>

* Update error notice
2019-07-11 11:12:44 +01:00
Mike Jolley 2eb750881a Update dynamic block styles and markup for default themes (https://github.com/woocommerce/woocommerce-blocks/pull/576)
* Add missing escape

* Revise product structure and introduce woocommerce_blocks_product_grid_item_html filter

* Add missing block-button/price styles

* Add a themename body class to allow per-theme styling

* Add WC style dependencies so block styles are loaded last

* Styles with greater specificicity, for 2019

* Default theme styling

* SF styles

* Ensure dependencies exist

* Split sale badge HTML to allow it to be moved more easily

* Load stylesheet via WooCommerce filters to ensure they load later than core styles

* Make structure in the editor match the product lists on frontend so styles are inherited

* Remove quotes around single fontnames (linting rules)

* Ensure there is spacing between blocks

* Use parent theme name in body class

* Fix column alignment in editor by removing inline max width

* Put back block styles

* Started adding shared styles

* Update default styles/add missing shared styles

* lint errors

* fix indent

* No longer a need for shared since we're loading style.css in the editor too

* Update tests
2019-05-28 11:17:45 +01:00
Kelly Dwan f6e5457f4b Dynamic grid blocks: Try using ServerSideRender component for preview (https://github.com/woocommerce/woocommerce-blocks/pull/565)
* Add grid block base class to handle rendering all grid blocks

Using code from the shortcode handler to create the query, subclass into newest product to show use

* Update preview content to match rendering from the new grid block handler

* Fix the categories query builder

* Update order of rating/price

* Remove center alignment

* Extract rating & button into separate functions

* Wrap the content in a link

* Add the current class names for better theme support

* Fix some styling in editor preview & frontend

* Add back the deprecated cols support for existing blocks

* Add multiple-rows class, style tweaks

* Switch Newest Products to dynamic rendering, deprecate existing shortcode method

* Add “On Sale” flag

* Switch “On Sale Products” to dynamic rendering

* Fix reusable block preview

* Add correct classes to On Sale Products

* Remove dynamic blocks from CSS hidden content rules

Content is not output to browser now, so we don’t need to hide it

* Fix undefined parameters

* Fix attributes for on sale

* Add deprecation comment, use more descriptive function name

* Addressing review feedback

* Update test: classnames have changed, image now wrapped in div

* Disable HTML editing for dynamic blocks

* Moved rendering logic into block library

* Try using ServerSideRender component for preview

* Define the schema for contentVisibility

This ensures the API correctly uses boolean instead of “true”/“false” strings

* Move the star rating CSS to the general grid-blocks section

* Remove the list styling, which is added back by core GB styles

* Fix stylelint issues
2019-05-21 16:34:48 -04:00
Kelly Dwan a03a9d759b Try dynamic blocks for rendering content (replacing shortcode output) (https://github.com/woocommerce/woocommerce-blocks/pull/558)
* Add grid block base class to handle rendering all grid blocks

Using code from the shortcode handler to create the query, subclass into newest product to show use

* Update preview content to match rendering from the new grid block handler

* Fix the categories query builder

* Update order of rating/price

* Remove center alignment

* Extract rating & button into separate functions

* Wrap the content in a link

* Add the current class names for better theme support

* Fix some styling in editor preview & frontend

* Add back the deprecated cols support for existing blocks

* Add multiple-rows class, style tweaks

* Switch Newest Products to dynamic rendering, deprecate existing shortcode method

* Add “On Sale” flag

* Switch “On Sale Products” to dynamic rendering

* Fix reusable block preview

* Add correct classes to On Sale Products

* Remove dynamic blocks from CSS hidden content rules

Content is not output to browser now, so we don’t need to hide it

* Fix undefined parameters

* Fix attributes for on sale

* Add deprecation comment, use more descriptive function name

* Addressing review feedback

* Update test: classnames have changed, image now wrapped in div

* Disable HTML editing for dynamic blocks

* Moved rendering logic into block library

* Remove unnecessary !important on styles
2019-05-16 14:03:11 +01:00
Kelly Dwan d2f1aa6c44 Update grid blocks preview to match width of products on the frontend (https://github.com/woocommerce/woocommerce-blocks/pull/489)
* Update grid blocks preview to match width of products on the front end

* Remove max-width from CSS, set it on the preview itself so we can use the dynamic theme width

* Override block thumbnail width for multiple column layouts

Previously larger thumbnails would cause multiple column layouts to break and wrap early. This enforces the column width for those cases

* Add the thumbnail size to images, to prevent larger images in multiple col layouts

* Update snapshot to new preview markup
2019-03-15 12:48:46 -04:00
Kelly Dwan b14a37f7b5 Update CSS build process (https://github.com/woocommerce/woocommerce-blocks/pull/439)
* Split apart editor and frontend styles

* Remove the empty JS files after each build

* Pull out editor and style CSS files into two single, separate files
Rename products-grid CSS, add a “global” front end stylesheet

* Update style registration to use these two new global CSS files

* Merge style JS files into vendors before deleting them

* Remove empty file to fix lint error

* Check for file before reading from it

When watching, not all the file stubs are created, so this errors out.
2019-02-19 16:09:36 -05:00