Commit Graph

2412 Commits

Author SHA1 Message Date
Alexandre Lara a6ddae9dc3 Product Gallery block: Move inner block settings around to match the order from the design (https://github.com/woocommerce/woocommerce-blocks/pull/11170)
* Rearrange block settings to correct position

* Remove unnecessary comments

* Remove unused imports

* Fix e2e tests
2023-10-10 14:04:54 +02:00
Thomas Roberts 14b5414c36 Update wording on checkout error message to try to prevent retries (https://github.com/woocommerce/woocommerce-blocks/pull/10888) 2023-10-10 01:16:24 -07:00
Niels Lange cd1f199f1b Increase number of visible products when cart is empty (https://github.com/woocommerce/woocommerce-blocks/pull/11182) 2023-10-09 22:04:19 +07:00
Mike Jolley 3857dc6e04 WIP: Condensed Address Form Implementation (https://github.com/woocommerce/woocommerce-blocks/pull/11167)
* Add address card component

* Condensed shipping address

* Billing address

* Animations

* Fix editing state

* Toggle sections open in tests
2023-10-09 12:49:09 +01:00
Luigi Teschio 924ed3f30b Product Gallery: fix CSS leak (https://github.com/woocommerce/woocommerce-blocks/pull/11111)
* fix CSS leak

* fix css

* fix comment
2023-10-09 10:15:54 +00:00
Mike Jolley 2f9181a514 Icon should use current color (https://github.com/woocommerce/woocommerce-blocks/pull/11127) 2023-10-09 10:36:17 +01:00
Tung Du 758fdb3b46 Making filter block contextual on the front end (https://github.com/woocommerce/woocommerce-blocks/pull/10919) 2023-10-09 08:22:17 +00:00
Mike Jolley 4987a921b1 Force 100% width for combobox (https://github.com/woocommerce/woocommerce-blocks/pull/11133) 2023-10-06 11:03:48 +01:00
Alba Rincón 37623be4f2 Remove placeholder and pagination (https://github.com/woocommerce/woocommerce-blocks/pull/11145)
* Add titles to patterns and set the aligment to Wide

* Replace product query patterns with product collection ones

* Remove pagination and no results query from product query patterns

* Add aspect ratio to the product image attributes

* Add portrait aspect ratio to product X column and product gallery patterns
2023-10-06 10:51:35 +02:00
Alexandre Lara b4f07b7c5f Product Gallery > Next/Previous Buttons block: Add support to Interactivity API (https://github.com/woocommerce/woocommerce-blocks/pull/10938)
* Add interactivity API to the Pager block

* Replace Large Image when clicking on page

* Fix php cs errors

* Fix php cs errors

* Fix php cs errors

* fix php cs errors

* Add support to Interactivity API

* Fix phpcs errors

* Fix phpcs errors

* Remove unnecessary code and fix block classes

* Rename interactivity actions

* Remove unnecessary type conversion

* Fix error when clicking on page in Pager block

* Fix php cs errors

* Fix ProductGalleryUtils import

* fix php cs error

* Fix styles for next/previous buttons

* Fix styles for the next/previous buttons

* Fix php cs errors

* Fix next/previous icons when buttons are outside image

* Fix php cs errors

* Fix php cs errors

* Fix buttons not visible in Editor

* Delete src/SpeciticTemplateController.php

Delete unnecessary file that is causing php cs error
2023-10-05 18:55:52 +02:00
Luigi Teschio ad80598ab8 Pattern: fetch product id on the JS side (https://github.com/woocommerce/woocommerce-blocks/pull/11138)
* Pattern: fetch product id on the frontend side

* fix TS type
2023-10-05 07:30:50 +00:00
Alexandre Lara dec4e4fc75 Product Gallery > Pager block: Add E2E tests for the block (https://github.com/woocommerce/woocommerce-blocks/pull/11001)
* Add e2e tests for Pager block

* Fix e2e tests for Product Gallery Pager

* Fix e2e tests
2023-10-04 19:11:34 +02:00
Luigi Teschio 9dd8dd321f Product Button: use setTimeout when requestIdleCallback isn't available (https://github.com/woocommerce/woocommerce-blocks/pull/11125) 2023-10-04 10:58:23 +02:00
Luigi Teschio c47babe628 Product Gallery: fix 'Block woocommerce/product-gallery-large-image is already registered' error (https://github.com/woocommerce/woocommerce-blocks/pull/11124) 2023-10-04 10:57:45 +02:00
Luigi Teschio 29fe7cdce0 Product Gallery: Polish Gallery in full view mode (https://github.com/woocommerce/woocommerce-blocks/pull/10947)
* Product Gallery: add support for On Sale Badge Block

* add align support

* Add E2E tests

* set margin via Block Styles

* disable experimental flag

* add next previous block

* restore support file

* fix TS error

* fix layout

* change product

* change product

* Product Gallert Block: Add zoom on hover

* set to true by default

* remove block is already registered error

* remove unecessary await

* Improve zoom logic

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>

* Product Gallery Full view mode: Add the logic to render the dedicated template

* use template-part instead template

* add E2E tests

* update selectors

* add feature flag product gallery template part

* fix E2E tests

* remove not necessary file

* polish the dialog

* fix: dialog show always the selected product

* fix: not open the dialog when the user click on icon

* rename handleClick to handleCloseButtonClick

* improve style

* fix overlay css

* fix registration

* improve logic

* improve default template

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2023-10-02 14:36:48 +02:00
Niels Lange 60e5943c53 Update the sidebar notice we show for incompatible extensions (https://github.com/woocommerce/woocommerce-blocks/pull/10877)
* Adkust text of sidebar notice

* Adjust text of sidebar notice

* Rename folder to “incompatible-extension-notice”

* Rename main component and interface

* Rename constants

* Add new files for splitting logic

* WIP: Semi-hardcoded solution

* WIP: Add new data store

* Fetch incompatible extensions dynamically

* Fix broken dismiss notice functionality

* Minor refactor

* Remove data store

* Remove console.log

* Remove obsolete data store fragment

* Update package-lock.json and composer.lock

* Change wording from “might be” to “may be”

* Show single incompatible extension within notice instead of as list

* Fix *.md linting error
2023-09-29 17:39:57 +07:00
Alexandre Lara 218e47f37a Product Gallery > Pager block: Fix classname to adhere to the Coding Guidelines (https://github.com/woocommerce/woocommerce-blocks/pull/11035)
* Improve regex for directive parsing

* Fix classname when page is selected and active

* Remove unnecessary commit
2023-09-29 09:42:05 +02:00
Mike Jolley 241984a265 Fix downloads block visibility (https://github.com/woocommerce/woocommerce-blocks/pull/11056) 2023-09-27 11:56:24 +00:00
Hritik Chaudhary 91c5ff83ca Remove data attributes from being saved in html of All products block (https://github.com/woocommerce/woocommerce-blocks/pull/10032)
* Remove data attributes from being saved in html of All products block

* added old save in deprecated

* Addressed review comments

---------

Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Roy Ho <roykho77@gmail.com>
2023-09-25 07:57:59 -07:00
Alexandre Lara f4424f541c Improve regex for directive parsing (https://github.com/woocommerce/woocommerce-blocks/pull/11034) 2023-09-22 18:26:36 -03:00
Saad Tarhi 13024c88e6 Fix crash in WooExpress Cart & Checkout Editor (https://github.com/woocommerce/woocommerce-blocks/pull/11024) 2023-09-22 19:10:50 +01:00
Daniel Dudzic a7b5812703 Product Gallery Large Image: Add wrapper to fix zoom (https://github.com/woocommerce/woocommerce-blocks/pull/11023)
* Product Gallery Large Image: Add wrapper to fix zoom

* Product Gallery: Fix E2E test
2023-09-22 13:48:51 +02:00
Karol Manijak 25bac5f030 Add condition to register blocks and variation in single product temp… (https://github.com/woocommerce/woocommerce-blocks/pull/10978)
* Add condition to register blocks and variation in single product template

* Improve the fix by providing default ancestor value to block registered for single product

* add E2E test

* add insert block

---------

Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2023-09-22 08:27:12 +02:00
Alexandre Lara f8fcc41c5a Product Gallery > Pager block: Add support to interactivity API (https://github.com/woocommerce/woocommerce-blocks/pull/10736)
* Add interactivity API to the Pager block

* Replace Large Image when clicking on page

* Fix php cs errors

* Fix php cs errors

* Fix php cs errors

* fix php cs errors

* Remove unnecessary code and fix block classes

* Fix error when clicking on page in Pager block

* Fix php cs errors

* Fix styles for the block

* Fix styles and php cs errors
2023-09-21 16:35:25 -03:00
Daniel Dudzic 8b470177f4 Product Gallery: CSS styling tightening up (https://github.com/woocommerce/woocommerce-blocks/pull/10867)
* Product Gallery: Fix conflicts between block settings and CSS

* Product Gallery: Final CSS polishes

* Product Gallery: Minor CSS refactor

* Product Gallery: Revert the minor css refactor

* add custom class on the main div

* Product Gallery: Combine inner block styles and optimize them

* Product Gallery Inner Blocks: Remove imports to no longer existing stylesheet files

* Product Gallery: Change all references from wp-block to wc-block

* Product Gallery Inner Blocks: Remove loading of non-existent inner blocks stylesheet files

* Product Gallery: Add additional class to ensure correct width for single product gallery despite of the Next/Previous mode selected

* Product Gallery: Add final polishing

* fix zoom

* Product Gallery Thumbnails: Fix css

* Product Gallery Large Image Next Previous Buttons: Skip failing tests

---------

Co-authored-by: Luigi <gigitux@gmail.com>
2023-09-21 11:31:16 +00:00
Alexandre Lara 3ecd34e01a Upgrade webpack to version 5 (https://github.com/woocommerce/woocommerce-blocks/pull/8013)
* Upgrade terser-webpack-plugin to version 4.2.3

* Upgrade webpack-bundle-analyzer to 4.7.0

* Upgrade to Webpack version 5

* Upgrade @wordpress/dependency-extraction-webpack-plugin to 4.6.0

* Upgrade dependency copy-webpack-plugin to version 11.0.0

* Upgrade dependency terser-webpack-plugin to version 5.3.6

* Replace webpack-rtl-plugin with the new @automattic/webpack-rtl-plugin

* Replace module.issuer with the new ModuleGraph API

There is a warning appearing in the console when running the application. This is due to the fact that the module.issuer has been deprecated on Webpack 5 and replaced with the new ModuleGraph API. This commit replaces the deprecated API with the new one.

* Upgrade babel and babel plugins to latest version

* Replace jsonpFunction with the new uniqueName property

Add a unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals. It defaults to output.library name or the package name from package.json in the context, if both aren't found, it is set to an ''.

* Replace cacheDirectory inline configuration with options.cacheDirectory

* Upgrade @wordpress/e2e-tests dependency to version 5.6.0

* Remove babel-plugin-transform-react-jsx dependency

Remove babel-plugin-transform-react-jsx dependency because it is already included in @wordpress/babel-preset-default

* Remove unnecessary Babel dependencies

Remove some unnecessary babel dependencies that are already included in the @babel/preset-env package.

* Upgrade puppeteer dependency to version 16.2.0

* Remove caret from package.json dependencies

* Fix Storybook build error

This commit fixes the Storybook build error that was being caused because of Storybook by default uses Webpack 4, but since we are currently upgrading our webpack to version 5, we need to install some required dependencies and also explicitly tell Storybook to use Webpack 5.

* Fix package-lock.json after merging with trunk

* Add own webpack-rtl-plugin implementation to the project

Before upgrading Webpack to version 5, we were using the original `webpack-rtl-plugin` released by Romain Berger; unfortunately, this plugin is not compatible with Webpack 5, so we replaced it with `@automattic/webpack-rtl-plugin`. The problem is that `@automattic/webpack-rtl-plugin` by default generates files with the '.rtl.css' suffix and does not provide a way to change that.

This commit adds our own implementation of the `webpack-rtl-plugin` (adapted from `@automattic/webpack-rtl-plugin`) that is compatible with Webpack 5 and allows us to change the suffix of the generated files to follow the recommended way defined by Wordpress (https://codex.wordpress.org/Right-to-Left_Language_Support)

* Change conditional clause to be multiline

* Fix package-lock.json after merge with trunk

* Fix package-lock.json after merge with trunk

* Rename files to fix ESLint errors

This commit renames files that have the .js extension but contain JSX code. This is causing ESLint to throw errors because by default our Eslint configuration expects only files with the .jsx extension to contain JSX code.

* Fix package-lock.json file

* Add is-plain-obj module to the transformIgnorePatterns of jest config

* Update package-lock.json

* Fix package-lock.json

* Upgrade @wordpress/i18n dependency to version 4.31.0

* Update package-lock.json

* Update composer lock file

* Fix Webpack config for Webpack 5

* Add the package-lock.json

* Remove unsupported config from webpack

* Fix error with Webpack build

* Add wait for network idle to the tests

* Attempt to fix e2e test

* Restore promise.all

* Upgrade puppeteer to v17.1.3

* Upgrade expect-puppeteer

* Update expect-puppeteer

* Downgrade expect-puppeteer

* Revert "Upgrade puppeteer to v17.1.3"

This reverts commit 61ed52a56f131961f3970b6fb22cdd8b540bada3.

* Upgrade Puppeteer to version 17.1.3

* Fix executionContext.frame is not a function error

* Fix e2e tests

* Remove isExperimentalBuild from Product Gallery inner blocks

* Upgrade Webpack and Webpack-cli to latest version

* Upgrade postcss and mini-css plugins

* Fix error with mini-cart block

* Fix styling error with filter blocks

* Fix issue when running unit tests

* Fix storybook script not loading

* Fix a11y issue in Storybook

* Fix error when multiple isExperimentalBuild was being used

* Prevent error when layout is not present in the attributes object

* Update `chunkIds` to `named` in Webpack

* Add cache groups to the Webpack configs
2023-09-20 17:31:52 -03:00
Mike Jolley edf4a95b23 Feature Branch: Blockified Order Confirmation (https://github.com/woocommerce/woocommerce-blocks/pull/10056)
* Main block types for confirmation

* Initial blocks

* Styling and placeholders

* Make blocks experimental

* Update summary icon

* Add name/description for status block and missing text descriptions in the block.

Closes woocommerce/woocommerce-blocks#10057

* Order confirmation: Convert Order Details Templates to Blocks (https://github.com/woocommerce/woocommerce-blocks/pull/10095)

* Move code from templates into the details block

* Details -> Totals

* Downloads block

* Sample content for downloads block

* Add block icon

* Add conversion template (https://github.com/woocommerce/woocommerce-blocks/pull/10077)

* Update inner block name

* Add default title constant

* Revert "Add default title constant"

This reverts commit 1dd3bbfecc1be83c367b1ab064f5032ea58cb678.

* Add global styles for order confirmation status block (https://github.com/woocommerce/woocommerce-blocks/pull/10164)

* Implement style controls

* Prevent link color spilling over onto wrapper

* Add styles and remove class names

* Remove __experimentalWritingMode

* Add global styles for order confirmation summary block (https://github.com/woocommerce/woocommerce-blocks/pull/10179)

* Styles for summary

* Remove __experimentalWritingMode

* Add table styles for order details (https://github.com/woocommerce/woocommerce-blocks/pull/10185)

* Add table styles for order details

* __experimentalFontWeight

* Add link styles

* Handle preview link styles

* Unauthenticated views for Order Confirmation template (https://github.com/woocommerce/woocommerce-blocks/pull/10414)

* Different views by permission

* check user id matches when logged out

* Add order confirmation wrapper block (https://github.com/woocommerce/woocommerce-blocks/pull/10286)

* Add a heading wrapper block

* Register the BillingWrapper Block server side

* Fix exception 'render_content' error

* Add the Billing Wrapper Block to the template

* Fix wrong block name error

* Fix php error

* Conditionally render Billing Address within the Wrapper

* Fix parent rendering

* Clean up code (remove billing address from the template)

* Update titles, descriptions, and icons of the billing Block and inner block

* Fix broken block by removing the "parent" keyword

* Use a user-friendly title and description for the Billing Wrapper

* Update Billing Wrapper Block's title case

Co-authored-by: Mike Jolley <mike.jolley@me.com>

* Fix PHP failing unit test

---------

Co-authored-by: Mike Jolley <mike.jolley@me.com>

* Remove "thanks" for authenticated page

* Introduce shipping wrapper based on billing wrapper

Closes woocommerce/woocommerce-blocks#10053

* Order confirmation block: Verify email address for guest customers (https://github.com/woocommerce/woocommerce-blocks/pull/10567)

* Add verify step for guest orders

* Render content to pass through block content

* Revert package changes

* Customer orders cannot use email to verify

* Add style controls for order shipping and billing address blocks (https://github.com/woocommerce/woocommerce-blocks/pull/10633)

* Order confirmation block styling (https://github.com/woocommerce/woocommerce-blocks/pull/10780)

* Add missing heading to order details

* Summary block spacing

* Update css variables

* table styles

* Inherit border styles for cells

* Alignment and address styles

* Add downloads wrapper

* Style controls

* Fix typo

* Update Download Wrapper's Icon

* Fix TS error

* Disable Download Block's server side rendering in the editor

This fixes the loading after each style change from the style controls

* Clean up Downloads render functions

* Fix client side Downloads Block's table border

* Download + Total wrappers and tables styling

* small screen

* Remove server side render for previews

---------

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>

* Shorten template description

* Update test address data

* Avoid leaking order key in permission form

* Remove todo

* Make email form required.

* Remove edit page link

* Remove empty columns from address wrapper

* Remove IIFE

* typo

* Update description to mention billing

* Adjust link scss

* Fix wrapper markup and spacing controls

* Add link preview in editor

* Add initial E2E setup for the Order Confirmation Block (https://github.com/woocommerce/woocommerce-blocks/pull/10840)

* Fix WC_DateTime check

* Move form outside of block markup

* Add additional information block (https://github.com/woocommerce/woocommerce-blocks/pull/10842)

* Add block which contains hooks

* Use skeleton for placeholder instead of illustration

* Remove duplicate methods

* Remove duplicate align tag

* Update meta styles

* Tests for order confirmation conditional blocks (https://github.com/woocommerce/woocommerce-blocks/pull/10972)

* Add tests for conditional blocks

* Move setup into test

* Add E2E to the the Order Confirmation Block (https://github.com/woocommerce/woocommerce-blocks/pull/10863)

* Add editor util functions

* Update editor template E2E test

* Add the "exact" property for consistency

* Skip test

Can't get the element in the page. More investigation needed! Skipping
for now.

* Fix "transformIntoBlocks" logic

* Add tests for logged in user

* Fix "beforeAll" config

* Confirm downloads section is visible when logged in

* Create "verifyOrderConfirmationDetails" util function

* Add logged in test case

* Add Guest user test case

* Fix editor e2e testing

* Apply a proper teardown

* Fix failing tests after logout

* Ensure we are logged in before visiting the editor

* Ensure to have shipping selected

* Wait for changes to be saved on the editor

* Ensure shipping options is selected

* Remove comment

* Ensure we are logged in before going to the admin page

* Mark the Order Confirmation as a side effect test

* OrderConfirmation blocks are not experimental

* resolve merge conflict

* Revert package lock changes

* Fix enqueue_assets

* Fix CSS 404s

* Make template tests more robust

* Fix page URL for default confirmation page

* Try afterEach to log back in

* Skip guest/logout use cases

Login out causes other tests to fail. We will implement these case when
the multiple sign in roles are introduced in the codebase.

* Remove tests requiring login out & add comments

* Remove unused util functions

* Hide confirmation blocks from post editor

---------

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-09-20 13:56:00 +01:00
Sam Seay 767a093b6a Refactor frontend, frontend-container-block (of reviews) to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/10787)
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2023-09-20 04:21:26 +00:00
Mike Jolley 68064c115b Refactor Cart and Checkout Page Templates (https://github.com/woocommerce/woocommerce-blocks/pull/10773)
* Rename checkout template slug

* Remove redirect and custom title

* Classic shortcode block for checkout

* Empty title

* WIP placeholder

* Change blockified template

* Prefix cart and checkout templates with "Page: "

* Template migration routine

* Apply same treatment to cart template

* Notices

* Update placeholder text

* Classic shortcodes block

* Page content wrapper for templates

* Update default

* Do not save attributes

* Update templates

* Remove cart classic template

* Reverted endpoints for Cart & Checkout templates. This reverts PR 9406

* Migrate page content wrapper.

* Removed useless method arg. Minor tweaks.

* Skip migration if the theme has a template file for this page.

* Removed impossible condition.

* Migrate page content wrapper.

* Remove TemplateNotice in favour of DefaultNotice

* Documentation links in shortcode placeholder

* Hide cart and checkout page selector when using block themes

* Unused var

* Add tests for template changes

* Revert changes to classic-template

* Allow frontend redirect

* Unused file

* Bump version for updater

* Support x template naming as well as page-x

* Need to add item to cart to test checkout

* Fix header test by fixing utility for adding to cart

* Remove permalink tests

* Click body

* Wait for content to finish loading

* Wait for add to cart response when adding to cart without item name

* Wait for save before visiting frontend

* Set content instead of inserting block

* Perform test in site editor rather than page editor

* Prevent notice to set the default cart/checkout page from showing on the site editor.

---------

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2023-09-19 10:58:18 +01:00
Manish Menaria 890c5dbcac Transfer layout options from Toolbar to Inspector controls (https://github.com/woocommerce/woocommerce-blocks/pull/10922)
In this update, the layout options for the Product Collection block are transferred from the Toolbar to the Inspector controls. Below is the breakdown of the changes:

1. **Constants Update**
    - `LayoutOptions` enumeration has been imported into `constants.ts`, facilitating a more structured approach to managing layout types (grid and stack).
    - The default display layout type has been updated from 'flex' to reference `LayoutOptions.GRID`.
    - The `getDefaultQuery` function now uses the `getDefaultValueOfInheritQueryFromTemplate` utility to set the default `inherit` value. (This is mainly done to fix a bug)

2. **Display Layout Control Removal**
    - The `display-layout-control.tsx` file has been removed, discontinuing the previous method of layout management.

3. **New Layout Options Control**
    - A new component `LayoutOptionsControl` has been introduced in the `layout-options-control.tsx` file, utilizing the experimental `ToggleGroupControl` and `ToggleGroupControlOption` components from the WordPress package to provide a more intuitive layout selection experience.
    - The `types.ts` file has been updated to define the `LayoutOptions` enum, effectively mapping 'flex' to 'GRID' and 'list' to 'STACK'.

4. **Inspector Controls Update**
    - In `inspector-controls/index.tsx`, the obsolete `DisplayLayoutControl` has been replaced with the new `LayoutOptionsControl`, integrating it into the `ProductCollectionInspectorControls` component.
    - The `BlockControls` wrapper has been removed, and layout options have been relocated to the Inspector controls, presented as a toggle group within the ToolsPanel.

5. **Inherit Query Control Modification**
    - The `inherit-query-control.tsx` file sees a change in the reset value for the `inherit` query attribute to employ a default value which fix one bug.

These changes aim to streamline the user experience by relocating the layout options from the Toolbar to the Inspector controls, offering a centralized location for block settings. Leveraging an enum for layout options fosters code readability and maintainability.

Do note that the update uses experimental components, hence it would be prudent to keep an eye on potential alterations or deprecations in upcoming WordPress releases.
2023-09-15 15:38:48 +05:30
Luigi Teschio 11062e8600 Product Gallery Block: Add Product Gallery template to allow users to edit full mode view (https://github.com/woocommerce/woocommerce-blocks/pull/10823)
* Product Gallery: add support for On Sale Badge Block

* add align support

* Add E2E tests

* set margin via Block Styles

* disable experimental flag

* add next previous block

* restore support file

* fix TS error

* fix layout

* change product

* change product

* Product Gallert Block: Add zoom on hover

* set to true by default

* remove block is already registered error

* remove unecessary await

* Improve zoom logic

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>

* Product Gallery Full view mode: Add the logic to render the dedicated template

* use template-part instead template

* add E2E tests

* update selectors

* add feature flag product gallery template part

* fix E2E tests

* remove not necessary file

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2023-09-15 08:54:49 +00:00
Karol Manijak 4418cb7d67 Hide unexpected bullet point in Product Collection on Storefront (https://github.com/woocommerce/woocommerce-blocks/pull/10945) 2023-09-15 08:07:54 +02:00
Karol Manijak 25c0b47721 Add pattern chooser in Product Collection (https://github.com/woocommerce/woocommerce-blocks/pull/10876)
* Enable Product Collection patterns in inserter and kick off the layout control button

* Add Choose Pattern button

* Move Toolbar settings to related directory

* Display Pattern Selection modal with available patterns after clicking the button

* Make Pattern Chooser always visible

Patterns can be changed no matter if the Inherit Query from Template option in enabled or not

* Add pattern replacement mechanism

* Switch from Gutenberg styles to internal ones
2023-09-14 14:19:16 +02:00
Roy Ho 3c0498e891 Add collection filters block (https://github.com/woocommerce/woocommerce-blocks/pull/10726)
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2023-09-14 11:13:33 +07:00
Daniel Dudzic 9db927de30 Product Gallery Thumbnails: Interactivity API directives (https://github.com/woocommerce/woocommerce-blocks/pull/10776)
* Fix "On sale" badge class for shop

* Add class to sale badge

* Move the thumbnails featching logic to an utils file. Add context directive with thumbnails data to the Product Gallery block. Add on-click directives to the Thumbnails block

* Product Gallery Thumbnails: Remove the legacy thumbnail markup

* Product Gallery Thumbnails: Add Large Image replacing

* update the main image when the thumbnail is clicked

* add E2E tests

* fix typo

* fix warning on the frontend

* address feedback

* update E2E test

* improve comment

* fix indentation

* improve E2E test

* improve flaky test

* improve E2E test

* improve comments

* improve E2E test

* try now

* add comment

* skip test

* reset script

* update todo comment

---------

Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
2023-09-12 09:36:44 +02:00
Daniel Dudzic 75bba1d55d Product Gallery: Lock the Sale Badge and the Next/Prev Buttons (https://github.com/woocommerce/woocommerce-blocks/pull/10869)
* Fix "On sale" badge class for shop
* Add class to sale badge
* Apply styleProps.styles to elements using them
* Product Gallery: Lock the Sale Badge and the Next/Prev Buttons
2023-09-11 11:37:27 +00:00
Karol Manijak 7948c52b16 Change default number of columns in Related Products (https://github.com/woocommerce/woocommerce-blocks/pull/10875)
* Change default number of columns in Related Products

* Add default attributes to Product Template in Single Product template

* Revert adding attributes
2023-09-10 10:26:56 +02:00
Luigi Teschio 3c7b47b7d1 Product Gallery: fix warning (https://github.com/woocommerce/woocommerce-blocks/pull/10839)
* Product Gallery: fix warning

* address feedback

* fix logic

* rename function
2023-09-08 16:06:48 +02:00
Karol Manijak e6bd74fd3c Fix JS Lint issues (https://github.com/woocommerce/woocommerce-blocks/pull/10866) 2023-09-07 12:01:15 +02:00
Tom Cafferkey 145fdf5e9b Product Image: Fix bug that prevented block styles being applied within the editor. (https://github.com/woocommerce/woocommerce-blocks/pull/10859) 2023-09-07 09:08:31 +01:00
Luigi Teschio 43c56e5383 Product Gallery Block: Add zoom on hovering on the frontend (https://github.com/woocommerce/woocommerce-blocks/pull/10791)
* Product Gallery: add support for On Sale Badge Block

* add align support

* Add E2E tests

* set margin via Block Styles

* disable experimental flag

* add next previous block

* restore support file

* fix TS error

* fix layout

* change product

* change product

* Product Gallert Block: Add zoom on hover

* set to true by default

* remove block is already registered error

* remove unecessary await

* Improve zoom logic

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>

* Product Gallery Block: Add E2E tests for zoom while hovering setting (https://github.com/woocommerce/woocommerce-blocks/pull/10795)

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2023-09-05 15:22:17 +02:00
Alexandre Lara 2ebe7bd0c9 Product Gallery > Pager block: Fix block alignment (https://github.com/woocommerce/woocommerce-blocks/pull/10782)
* Fix block alignment with Large Image block

* Prevent error when layout is not present in the attributes object

* Add Large Image and Pager to its own group

* Fix issue when moving around the thumbnails block

* Fix e2e tests for Product Gallery block

* Change ancestor block for the Pager block
2023-09-05 09:52:19 -03:00
Luis Herranz 3a30f22dfa Product button: sync temporary number of items on instantiation (https://github.com/woocommerce/woocommerce-blocks/pull/10604)
* Add data-wc-key

* Add layout-init to sync temporary value

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2023-09-05 14:37:38 +02:00
Sam Seay abd41cae11 Fixes for jest transpilation issues. (https://github.com/woocommerce/woocommerce-blocks/pull/10788)
* Fix bug where is-plain-obj is not transpiled by Jest, update lock.
* Update packages.
* Mock useSelect for a handful of RichText selectors in test.
* Resolve react to single version to avoid invalid hook errors.
* Patch trim-html locally to avoid a bug in the released npm source.
* Mock out resizeObserver to avoid https://github.com/FezVrasta/react-resize-aware/issues/58
* Don't transpile config package: https://github.com/node-config/node-config/issues/628
2023-09-05 04:03:35 +00:00
Lucio Giannotta 578ba4725e Fix customer account icon not scaling in certain environments (https://github.com/woocommerce/woocommerce-blocks/pull/10533)
Customer Account block icon size is based on the parent `font-size`
in order to make sure they stay harmoniously together.
However, the `box-sizing` could be set by some other actor
and mess with the size of the icon.
2023-09-02 16:07:01 +02:00
Luigi Teschio 22b9f6a952 Product Gallery Block: add support for the on Sale Badge block (https://github.com/woocommerce/woocommerce-blocks/pull/10764)
* Product Gallery: add support for On Sale Badge Block

* add align support

* Add E2E tests

* set margin via Block Styles

* disable experimental flag

* add next previous block

* restore support file

* fix TS error

* fix layout

* change product
2023-08-31 18:15:31 +02:00
Alexandre Lara e9ff849e08 Add woocommerce namespace to Product Gallery block (https://github.com/woocommerce/woocommerce-blocks/pull/10769) 2023-08-31 12:13:40 -03:00
Sam Seay 44f48e41e9 Refactor errors util to TypeScript, minor typing fixes (https://github.com/woocommerce/woocommerce-blocks/pull/10754) 2023-08-30 18:56:28 +12:00
Lucio Giannotta 5c4a757b6e Convert `product-control` to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/10552)
The main aim of this PR was to convert the product-control component to TypeScript. However, since the component is coupled with many other parts (it is itself wrapped into 4 HOCs), many refactoring changes were needed to make the types work.

In particular:

* Add `convertProductResponseItemToSearchItem` utility function

The function allows to clean up the `ProductResponseItem` in order
to make its shape compatible with the `SearchListItem`, instead of
passing the entire object.

Because data from the object might need to be used in certain
circumstance (e.g. render functions), the data is now allowed to be
scoped within a `details` key.

This commit also converts `utils/products` to TypeScript.

* Fix `ProductResponseItem` type missing `slug`

The `slug` is returned by the API but didn't appear in the type def.

* Improve certain HOCs types

The `withSearchedProducts` and `withTransformSingleSelectToMultipleSelect`
HOCs are now typed in such a way that it is clear what incoming props
they expect and what they inject.

* Refactor `ProductAttrributeTermControl` for further type safety

Make sure that `count` is always a `number` as required by the
component types.

* Refactor `search-list-control.tsx` and `item.tsx`

The new `SearchItem` allows for the `details` key to be passed.
All the components are now aware of it.
2023-08-29 08:01:31 +02:00
Lucio Giannotta a898a5b5ee Fix inconsistent padding in Customer Account block (https://github.com/woocommerce/woocommerce-blocks/pull/10476) 2023-08-29 07:32:48 +02:00