* add new withSearchedProducts hoc
includes tests
* convert to functional component and wrap with new hoc
* remove dependency between tests
* Fix typo with PropTypes bool
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* remove unnecessary specific import
* fix bug introduced on refactor for selected prop recalc
* fix tests that were testing the wrong expectation
- also improved mocks a bit so they are a bit more realistic for the purpose of the test coverage.
* remove unnecessary Fragment
* tweak propType definitions and remove defaults
- this keeps argument expectations in sync with wrapped component and reduces chance of unexpected behaviour if `SearchListControl` logic changes.
* remove lodash.find dependency.
* Reset 'loaded' state in Featured Product and Category blocks
* Minor code improvements
* Remove state from ApiErrorPlaceholder
* Move getProduct to a HOC
* Undo changes in Featured Category
* Update proptypes
* Move error messages to <ApiErrorPlaceholder>
* Reorder props
* Move lifecycle methods to HOC
* Make <FeaturedProduct> component presentational
* Move withProduct to js/hocs
* Create NAMESPACE constant in utils
* Create getProduct util function
* Set 'error' and 'product' state to null instead of 'false' when they have no value
* Prevent getImageSrcFromProduct and getImageIdFromProduct returning an error when 'product' is not an object
* Add HOC tests
* Use 'toBe' and 'toBeNull' jest expect methods instead of 'toEqual' when possible
* Export HOCs from index
* Move mock implementation to beforeEach
* 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
* 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
* Duplicate SearchListControl into ProductSearchListControl component
* Undo control copy; it's not needed
* Variation search + counts showing
* Dropdown styling (also fixed SVG icon markup in SCSS file)
* Style the variation count
* Handle variation display on frontend and backend
* Fixed selection callbacks hooray
* Extend v3 api to return name. Use v3 API for featured product block.
* Switch description based on type
* Fix isSelected check
* Define a11yProps
* Variations rest endpoint
* Remove isTertiary
* REST endpoints with variation handling
* Handle variation data frontend
* Handle variation data in editor
* renamed description schema
* tweak variation display
* Update assets/js/components/product-control/style.scss
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* Flip icon direction
* Use classnames
* fix isSingle warning
* standards
* Only try to load variations if product has them
* 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>
* 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
* Update testing framework
* Update package name
* Classname changes from master
* Indent
* Add alignButtons handling and styling to grid-base
* Add ToggleControl and alignButtons attribute to handpicked products
* Pass alignButtons to the blocks with sharedattributes
* Add alignButtons to shared-attributes.js
* Add alignButtons to products-by-attributes block
* Add alignButtons to attributes on the PHP side
* Add alignButtons control to grid-layout-control
* Remove alignButtons from deprecated definitions
* has-aligned-buttons
* Update comment
* package lock
* Product Categories List: add a placeholder on save
This is saved to the database so that we have a placeholder view while waiting for the categories component to render.
* Use `classList.remove` for better readability
Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com>
* Add the hierarchy display to the dropdown
* Add navigation for when a category is selected in the dropdown
* Use forEach from lodash for ie11 compat
* Switch to a button-click navigation pattern for better keyboard support
* Try the hidden attribute on option
* Add `isPreview` prop to be used when in editor preview
* Add product category link to the categories object
* Add the link to the `a` if we're not in the preview mode
* 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
* Use the `name` prop in place of writing out the string
* Pull out `orderby` schema into reusable function
* Correct version tag
* Extract some more schema property defs into shared functions
* Move the `print_script_settings` function so the schema-related functions follow the block registration
* Set all the schema functions to be `protected`
* Remove version tags from docs
* Fix default rows fallback value
* Move the contentVisibility schema into a separate function
This attribute is common even amongst blocks that don’t use shareAttributes, so we should make it reusable
* Add dynamic rendering + SSR to Hand-picked Products block
* Add block deprecation
* Update the posts_per_page to include all selected products
* 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
* 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