* install transform-react-remove-prop-types babel plugin
* use `@wordpress/babel-preset-default` not `@wordpress/default` (name change)
* add configuration for new plugin (removing prop-types on production builds)
* unqiueID helper to replace compose
* move get categories function to own file
* fix svg styling
* remove lodash dependency
* Refactor block/edit to use less dependencies
* Babel config to skip wp.element
* update comments
* Update assets/js/blocks/product-categories/frontend.js
ie11 compatible for each on nodelist
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* move id generation to constructor
* simplify webpack config
* Remove components CSS dependency
* use HOC for component ID
* Correct case on ComponentId
* Load frontend scripts only when required
* Typo
* Use register_script from Assets
* Remove vendors as a frontend dependency
* Simplify webpack config
* Introduced WGPB_Extend_Core class to modify shortcodes and API requests of core
* Require the new class
* WC_REST_Blocks_Products_Controller_V2 to override the wc-blocks API to support new tags properties
* Register new products by tag block type
* Modify utils to support tags and tag_operators
* Add ProductTagControl to handle tag searching
* Add the actual products by tag block
* Set limitTags to 100
* Create Package class and use in main plugin file
* Move and refactor library class - split asset methods into new Assets class.
* Add jetpack autoloader dependency
* fix tests
* Update from master
* AbstractBlock class for general block registration
* remove test autoloader so tests do not break
* Create AbstractProductGrid
* FeaturedProduct
* HandpickedProducts
* ProductBestSellers
* ProductCategory
* ProductNew
* ProductOnSale
* ProductTopRated
* ProductsByAttribute
* Remove old base and render functions
* Allow non-dynamic blocks and register category block
* Fix products-by-attribute due to wrong naming
* Remove no dev
* test phpunit dir
* Update testing framework
* Update with new abstract classes and build in API
* Undo edit to attribute block
* Move edit mode
* No need to support shortcodes
* correct linting errors
* Update tests/bootstrap.php
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Update code comment to make more sense.
* Correct test package
* docblock
* Fix cancel button class
* Fix classname schema
* Set loading state so spinner is shown
* Add placeholder element when no tags are selected
* No tags placeholder
* Update rest endpoints
* Create Package class and use in main plugin file
* Move and refactor library class - split asset methods into new Assets class.
* Add jetpack autoloader dependency
* fix tests
* Update from master
* AbstractBlock class for general block registration
* remove test autoloader so tests do not break
* Create AbstractProductGrid
* FeaturedProduct
* HandpickedProducts
* ProductBestSellers
* ProductCategory
* ProductNew
* ProductOnSale
* ProductTopRated
* ProductsByAttribute
* Remove old base and render functions
* Allow non-dynamic blocks and register category block
* Fix products-by-attribute due to wrong naming
* Remove no dev
* test phpunit dir
* Update testing framework
* Update package name
* Classname changes from master
* get_schema_string/classname from master
* Update tests/bootstrap.php
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Update src/BlockTypes/AbstractProductGrid.php
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Add initial work for Product Categories List block
* Add empty category toggle
* Add option to show list as a dropdown
* Fix console warnings
* Only show proptypes linter warning if the component declares proptypes
* Add frontend script to render the product categories
* Split wcSettings & wc_product_block_data globals so that the later can be used from the frontend
* Remove wp dependencies, these are added by the webpack script now
* Capture all "woo packages" into a separate script chunk
These require `wcSettings`, which can't be available on the frontend - but we do need vendors on the frontend.
* Rewrite component into a function
* Fix validation error on editor reload
* remove php insertion of block category
* Add an SVG icon for the woo logo
* Add block-category.js to import into blocks
This creates the category icon complete with a Woo SVG icon
* Import block-category to all blocks that use it
* Style woocommerce blocks in woo purple
* Lint error
* fillRule case
* Update propTypes
* Use foreground prop instead of css
* Convert Woo Logo to ICON type component
* Add shared blocks.js to house the category code
* Calculate width from height
* Move query path into constant
* Add catalog size as a preloaded setting
* Pass a search callback to SearchListControl
This will limit the number of products loaded, and update the product list via an API call, when there are over 200 products
* Extract the API requests into a separate file
* Fix proptype warning
* Only trigger the selected request if there are selected products
* Add new `@wordpress/*` dependencies from wc package bumps
* Move the "large catalog" check to the server side
* Update to components@2.0.0
* Remove legacy block
This removes the legacy products block and sets the version to
v2.0.0-dev
* Remove legacy product block test
* Update plugin header version
* Component: GridContentControl for controlling visibility of product content
* Add the content control to all grid blocks
* Use CSS to hide the content on the front end
* Fix missing translation functions
* 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.
* Add splitchunks to webpack config to combine node_modules imports into a vendors script
* Move legacy CSS into legacy folder
* Get components css without needing to use relative path
* Add vendors css file
* Add a prop to turn on “single choice” mode
* Create new ProductControl to select a single product
* Remove align from shared attributes
This is given to us by default for using supports.align
* Add Featured Product block
* Fix spelling mistake & copy-paste issue
* Fix lint warning
* Add featured product script to build process, register block in PHP
This lets us use the functionality of `register_block_type` to automatically enqueue the scripts and styles used by blocks in the editor, and eventually, styles on the frontend as well. Also adds cssnano to minify our CSS.
* Move from a JS file per block registration to one file registering all blocks
This will let webpack combine shared libraries, like gridicons
* Move global block settings to the “before all scripts” section
These shouldn’t be tied to a specific block file, since they’re used across all blocks
* Register both block types
We can also remove the scripts, since we enqueue these below
* Update getShortcode & getQuery to handle different block types
* Pass block type name to getQuery
* Update shared attributes - edit_mode is not a universal option, but categories will be
Categories is shared, but orderby is not
* Add “Best Selling Products” block
* Add a shared class name for product grid blocks
* Fix failing tests
* Add new components for ProductCategoryControl, using a reusable SearchListControl
* Add sass variables from wc-admin
* Finish styling
* Save selected categories as selected for the block
* Style sidebar version of control
* Filter the categories list, highlight search term in result
* Filter out selected items in the filter list function
* Add spacing in the placeholder, remove unnecessary stylesheet
* Add a more descriptive label for screen readers
* Remove category references from list item options
* Switch to a configurable object of messages, so SearchListControl can be more customizable
* Add screen-reader message for toggling “done” and moving into preview
* Remove call to getProductCategoryControl
The component is simple enough to just drop in now :)
* Add documentation for all props
* Add padding to placeholder
* Rename fallbackrenderItem to defaultRenderItem
* Add a variable to save the selected count
* Add `isDestructive` to make link red
* Update item style
* Add a hover/focus background color
* Add a second block, for “products by category”
* Fetch products in the given category, when attributes change
* Display the resulting products
* Style the product preview
* Create utils folder, move shared attributes
* Move getQuery to shared utils folder
* Create a helper function to get the shortcode string
* Support the menu_order setting
* Support center/wide/full alignment
* Update PropTypes
* Add tests
* Add text domain to translation functions
* Add eslint configuration
* Run eslint auto-fixer to cover fixable issues
* Use wp.element’s component to prevent undefined React error
* Add products data global to eslint config
* Fix remaining eslint errors by hand
* Fix eslint errors in webpack
* Remove duplicate rule
* Add api-fetch dependency
* Remove compiled files from the repo
* Update build process, remove grunt
* Import CSS into block, as we now extract CSS via webpack to build
* Update enqueue scripts to reflect new build locations
* Detect if build files don’t exist, and instruct users to build project
* Update readme with build instructions
* Clarify where to run npm commands in info notice
* Only enqueue our JS files if we know they exist
* Clarify version compatibility between WC and WP 5.0