* Add image alts to the ai prompt if available
* Update images index and remove randomness
* Update pattern with missing content
* Add image alts to the pattern array
* Improve prompt
* Fix typo
* Use the correct business_description in both the scheduled action and the endpoint
* Remove block level options in favour of settings
* Remove calculator toggle test
* Update assets/js/blocks/cart/inner-blocks/cart-order-summary-shipping/block.tsx
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
* Remove unused attributes
---------
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
This commit addresses an issue where layout attributes could become undefined during the block migration process. Alongside this fix, several updates were made to align the migration logic with the new `ProductCollectionDisplayLayout` types:
- Added logic to handle `undefined` layout attributes, defaulting to `DEFAULT_ATTRIBUTES.displayLayout`.
- Removed `ProductGridLayout` and `ProductGridLayoutTypes` from the types file.
- Imported `LayoutOptions` and `ProductCollectionDisplayLayout` from the product-collection module.
- Updated the `mapLayoutType` and `mapLayoutPropertiesFrom...` functions to use the new layout types.
- Updated transformation functions like `transformProductTemplate` and `transformPostSummary` to use the new types.
These changes not only resolve the issue with undefined layout attributes but also align the codebase with the new layout options, enhancing code maintainability.
* Add titles to patterns and set the aligment to Wide
* Replace product query patterns with product collection ones
* Add group and spacing to the 3-cols and social patterns
* Fix alignment issue in the testimonals 3 in the editor
* Add padding to the featured catergory triple pattern
* 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
* Fix PHP warning and remove the padding for the Testimonials 3 Columns pattern.
* Ensure the Just Arrived Full Hero pattern can have an AI managed image assigned to it and update the content assignment.
* Add background dim
* Update dim to 30
* Add aspect ratio to the Social: Follow us on social media
* Update the icons color to primary
* Update the default title for the Follow us on social media pattern within the dictionary.
* Update text for the main header.
---------
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
* Add titles to patterns and set the aligment to Wide
* Replace product query patterns with product collection ones
* Add group and spacing to the 3-cols and social patterns
* Fix alignment issue in the testimonals 3 in the editor
* Add padding to the featured catergory triple pattern
* 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
* Fix PHP warning and remove the padding for the Testimonials 3 Columns pattern.
* Ensure the Just Arrived Full Hero pattern can have an AI managed image assigned to it and update the content assignment.
* Add background dim
* Update dim to 30
* Update text for the main header.
---------
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
* Add titles to patterns and set the aligment to Wide
* Replace product query patterns with product collection ones
* Add group and spacing to the 3-cols and social patterns
* Fix alignment issue in the testimonals 3 in the editor
* Add padding to the featured catergory triple pattern
* 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
* Fix PHP warning and remove the padding for the Testimonials 3 Columns pattern.
* Update text for the main header.
---------
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
* 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
* Add titles to patterns and set the aligment to Wide
* Replace product query patterns with product collection ones
* Add group and spacing to the 3-cols and social patterns
* Fix alignment issue in the testimonals 3 in the editor
* Add padding to the featured catergory triple pattern
* Introduce the new Product Collection 4 Columns pattern as a replacement for 1:1 Image 4-Column Product Row
* Introduce the new Product Collection 5 Columns pattern as a replacement for Minimal 5-Column Product Row
* Update the slug for the Product Collection 5 Columns pattern
* Introduce the new Product Collection 3 Columns pattern as a replacement for 3-Column Product Row
* Ditch the block types from the docblock
* Introduce the new Product Collection: Featured Products 5 Columns pattern as a replacement for Featured Products 5-Item Grid
* Update the patterns dictionary.
* remove block types from the Product Collection: Featured Products 5 Columns pattern
* Remove outdated patterns.
* Remove unnecessary queryId
* Reintroduce the Featured Category Cover Image pattern.
* Update styles for the pattern to match the new ones.
* Update the patterns dictionary to include the Featured Category Cover Image.
* Remove bold from h3 tag
* remove the fonts customization for the button
* Drop the medium fontsize for the paragraph.
* 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
* 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>
* Remove order and checkout order endpoint feature flag
* Remove Order Route and Checkout Order Route from experimental flag list
* Remove order and checkout order endpoint feature flag
* Remove Order Route and Checkout Order Route from experimental flag list
* Update e2e tests selector
* Revert "Update e2e tests selector"
This reverts commit 2a6b561a883c701be1da2ffc39200cd19a85f1e3.
---------
Co-authored-by: Niels Lange <info@nielslange.de>
* Fix bug, it was always returning {'ai_content_generated':true} even in case of error
* Refactor PatternImages to extract static helper method to PatternImagesHelper and rename to PatternUpdater
* Fix use on patterns
* Update the pattern content using AI as well
* Make API requests in parallel
* Fix prompt and update patterns with generated content
* Return default content if patterns content is empty
* Fix patterns and failed responses
* Add timeout to the request multiple function
* Replace square by landscape
* Remove todo
* Return error on content update error
* Ensure the pattern content exists within the wc_blocks_patterns_content option: if it doesn't exist, fetch the default content from the default dictionary instead.
---------
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
* 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>
* 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>
* 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
* 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.
Closeswoocommerce/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
Closeswoocommerce/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>
* Add escaping to unescaped style attribute variable
* Empty commit for release pull request
* update testing instructions
* bump version to 11.1.1
* add zip link
---------
Co-authored-by: Daniel W. Robert <danielwrobert@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
* Fix "On sale" badge class for shop
* Add class to sale badge
* Product Gallery Thumbnails: Remove empty markup from the frontend when no thumbnails are present
* Product Gallery Thumbnails: Minor null coalescing operator improvement
* Product Gallery Thumbnails: Remove the Thumbnails markup if there's only one image present
* Product Gallery Thumbnails: Minor null coalescing operator improvement
---------
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
* Features Flags and Experimental Interfaces doc: Update blocks behind the experimental flag
* Product Gallery Next Previous: Add missing experimental flag
* 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>
* Prevent changes in the selected shipping method when new rates are added or removed.
* Fix spacing as per the coding standards
* Remove additional new line space.
* Add the Verticals API client
* Add tests
* Refactor error handling
* Create first version of the prompt class
* Improve Vertical selector and add tests
* Remove testing code
* Update class comment
* Add PatternImages class
* Pass the dictionary as param
* Add tests
* Add `get_pattern_images` function and use it on patterns
* Add the Jetpack Connection Package as a dependency for WooCommerce Blocks.
* Introduce the new Configuration Class for registering and enabling the Jetpack connection for sites and users.
* Introduce the Connection class for making requests to the GPT AI API.
* Update the get_jwt_token method.
* Update the error messages for the get_jwt_token method.
* Update the register_site method.
* Update the Configuration class structure and add Dependency Injection.
* Update structure for the Connection Class.
* Update the return type for the get_jwt_token method.
* Update method visibility for get_site_id
* Update the name and params for methods within the Connection Class
* Add tests for the Connecction class.
* Update the Constructor for the Configuration class.
* Add the Patterns class.
* Move the get_image_url function to the PatternImages class and update the call in all patterns to address errors.
* Remove the functions.php file
* Update the VerticalsSelector class.
* Update the constructor for PatternImages.
* Update the Store API Route for Patterns.
* Update the create_patterns_content method to ensure it returns the results of update_option.
* Add the new Patterns route to the RoutesController class.
* Update the route path and remove the business description validation as that is done via create_patterns_content
* Introduce the PatternsSchema
* Update the prompt, errors messages and output format for the Verticals Selector.
* Fix the missing file error for the Patterns Dictionary.
* Introduce the new get_patterns_dictionary method and update the create_patterns_content method to better handle errors.
* Update the returned response for the endpoint.
* Add the get_item_response method to the PatternsSchema class.
* Update response for when allow_ai_connection option is not set.
* Enable authentication for the endpoint.
* Modify and temporarily remove some failing tests for the AI API: a separate PR will be opened to clear those out later.
* Add validation to the verticals_id.
* Remove reference to the src/Patterns/functions.php file.
* Update `alt` to be more generic, since the displayed images will vary
* Store Customization > Schedule an action to update the patterns content whenever the business description is changed (https://github.com/woocommerce/woocommerce-blocks/pull/10956)
* Introduce the new OptionUpdate class.
* Update the path to action schduler and add a file_exists check before attempting to schedule the action.
* Update the content in patterns from the BlockPatterns class instead.
* Remove return comment
---------
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
---------
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
* Add the Jetpack Connection Package as a dependency for WooCommerce Blocks.
* Introduce the new Configuration Class for registering and enabling the Jetpack connection for sites and users.
* Introduce the Connection class for making requests to the GPT AI API.
* Update the get_jwt_token method.
* Update the error messages for the get_jwt_token method.
* Update the register_site method.
* Update the Configuration class structure and add Dependency Injection.
* Update structure for the Connection Class.
* Update the return type for the get_jwt_token method.
* Update method visibility for get_site_id
* Update the name and params for methods within the Connection Class
* Add tests for the Connecction class.
* Update the Constructor for the Configuration class.
* Add the Patterns class.
* Update the VerticalsSelector class.
* Update the constructor for PatternImages.
* Update the Store API Route for Patterns.
* Update the create_patterns_content method to ensure it returns the results of update_option.
* Add the new Patterns route to the RoutesController class.
* Update the route path and remove the business description validation as that is done via create_patterns_content
* Introduce the PatternsSchema
* Update the prompt, errors messages and output format for the Verticals Selector.
* Fix the missing file error for the Patterns Dictionary.
* Introduce the new get_patterns_dictionary method and update the create_patterns_content method to better handle errors.
* Update the returned response for the endpoint.
* Add the get_item_response method to the PatternsSchema class.
* Update response for when allow_ai_connection option is not set.
* Enable authentication for the endpoint.
* Modify and temporarily remove some failing tests for the AI API: a separate PR will be opened to clear those out later.
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.
* 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
Woo Core supports WP L1, and we support L0. We added this comment
because it can be confusing since the info can only be found on the
release instructions
* Add the Jetpack Connection Package as a dependency for WooCommerce Blocks.
* Introduce the new Configuration Class for registering and enabling the Jetpack connection for sites and users.
* Introduce the Connection class for making requests to the GPT AI API.
* Update the get_jwt_token method.
* Update the error messages for the get_jwt_token method.
* Update the register_site method.
* Update the Configuration class structure and add Dependency Injection.
* Update structure for the Connection Class.
* Update the return type for the get_jwt_token method.
* Update method visibility for get_site_id
* Update the name and params for methods within the Connection Class
* Add tests for the Connecction class.
* Update the Constructor for the Configuration class.
* 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>
* Add the Verticals API client
* Add tests
* Refactor error handling
* Create first version of the prompt class
* Improve Vertical selector and add tests
* Remove testing code
* Update class comment
* Add PatternImages class
* Pass the dictionary as param
* Add tests
---------
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
* Add the Verticals API client
* Add tests
* Refactor error handling
* Create first version of the prompt class
* Improve Vertical selector and add tests
* Remove testing code
* Update class comment
---------
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
Woo Core supports WP L1, and we support L0. We added this comment
because it can be confusing since the info can only be found on the
release instructions
* 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
* Change default number of columns in Related Products
* Add default attributes to Product Template in Single Product template
* Revert adding attributes
* 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
* 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
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.
* Adjust column width and icon alignment.
Set new col width to `75%` / `25%` and set the icon flex-alignment
to `space-between`.
While this is not ideal, without any fine-grained control over
breakpoints, this seems to be marginally better than having the icons
remain right-aligned on mobile.
* Correct grammar for pattern title and heading.
Should be "on" not "in".
* 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
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.
* Add Product Gallery Next Previous block
* update description
* update registration
* improve style
* use context instead of attributes
* add eslint and ts lint exception
* improve CSS
* E2E Next Previous block (https://github.com/woocommerce/woocommerce-blocks/pull/10329)
* Add E2E tests
* fix e2e tests path after rebase
* add screenshots
* improve E2E test
* improve E2E test
* improve E2E test
---------
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
* fix webpack conf
* Next Previous Button block - Add layout support (https://github.com/woocommerce/woocommerce-blocks/pull/10668)
* Add layout support
* Product Gallery Next Previous: Fix block crashing in the editor when vertical alignment has not been customized yet
* Product Gallery Next Previous: Position fixes for the Next/Previous button both in the editor and frontend
* add E2E test
* fix import
---------
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
* Next Previous Buttons: hide buttons when the product has only one image (https://github.com/woocommerce/woocommerce-blocks/pull/10743)
* Next Previous Buttons: hide buttons when the product has only one image
* update URL
* fix import
* set default value
* fix E2E test
---------
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
* Add support to Interactivity API
* Fix php cs errors
* Rename numberOfThumbnailImages to numberOfThumbnails
* Use frontend.tsx with InteractivityAPI
* Replace viewScript in block.json
* Fix UI misalignment of Filter by Price in TT1 theme
* Fix frontend Firefox styles
* Simplify the styles and fix them in Editor (Firefox/Safari)
* Align the background color and sizing in Firefox
* Enable Product Collection as a core feature
* Fix: disable product query title and summary variations from inserter in favour of Product Collection ones (https://github.com/woocommerce/woocommerce-blocks/pull/10548)
* Limit the scope of Product Query's Product Title and Product Summary
* Add missing piece after refactoring
* Enable manual migration of Products to Product Collection (https://github.com/woocommerce/woocommerce-blocks/pull/10655)
* Refactor block variation registration in product-collection (https://github.com/woocommerce/woocommerce-blocks/pull/10701)
This commit refactors the product-collection block's variation registration.
Changes:
- The `product-summary` and `product-title` variations have been encapsulated within their own respective functions: `registerProductSummaryVariation` and `registerProductTitleVariation`.
- Imported and invoked these new functions in the main `index.tsx` of the product-collection block, ensuring the variations are registered.
---------
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
* Add block foundation
* Add block styles
* Add Dots Pager
* Move icons to the block folder
* Add block settings
* Add Pager to Product Gallery template
* Add setting to change Pager display mode
* Change the block description
* Fix the block icon color when selected
* Fix php cs errors
* Fix php cs errors
* Fix css lint errors
* Fix eslint error
* Move enum to its own file
* Remove unnused call to request context
* Add block template
* Fix php cs errors
* fix php cs errors
* improve docs
* Remove duplicate HTML element and added classnames for single product block (https://github.com/woocommerce/woocommerce-blocks/pull/10374)
* Show only products with rating (https://github.com/woocommerce/woocommerce-blocks/pull/10434)
* Add Product Gallery Thumbnails block (https://github.com/woocommerce/woocommerce-blocks/pull/10442)
* WIP Product Gallery: Add the Thumbnails block
* Product Gallery Thumbnails: Add block settings
* Add template for the Product Gallery block
* Add template for the Product Gallery block. Add the rest of the files.
* Product Gallery Thumbnails: Add context settings sharing between the Product Gallery and Thumbnails block.
* Product Gallery Thumbnails: Add UI functionality and frontend functionality. Add settings for the Thumbnails in both places - Product Gallery and the Thumbnails block.
* Product Gallery Thumbnails: Move the static template ouside of the component
* Make sure the context is set before accesing the array values
* Product Gallery Thumbnails: Move the setGroupAttributes() function outside of the component
* Product Gallery Thumbnails: Fix TS errors
* Product Gallery Thumbnails: Update the Features Flags and Experimental Interfaces doc
* Product Gallery Thumbnails: Fix TS error
* Product Gallery Thumbnails: Remove unused stylesheet
* Product Gallery Thumbnails: Fix TS errors
* Product Gallery Thumbnails: Remove unused context and fix the thumbnails bottom position styling on the frontend.
* Product Gallery Thumbnails: Allow the user to move the horizontal thumbnails above the large image and don't overwrite that automatically
* Product Gallery Thumbnails: Add code comments and remove the incorrect conditional check when moving thumbnails up and down
* Product Gallery Thumbnails: Fix the eslint dependency error
* Product Gallery Thumbnails: Refactor Product Gallery edit code and move the logic to a utils file
* Product Gallery Thumbnails: Update the utils file
* Product Gallery Thumbnails: Update the utils file. Fix comment indentation
* Product Gallery Thumbnails: Fix undefined variable html when only 1 product image is set
* Product Gallery: Rename clientId to productGalleryClientId
* Product Gallery Thumbnails: Combine the useEffect code having the same dependencies
* Product Gallery Thumbnails: Combine all useEffect code together
* Product Gallery Thumbnails: Add a ThumbnailsPosition enum
* Product Gallery Thumbnails: Update the thumbnailsPosition to an enum
* Product Gallery Thumbnails: Fix TS errors
* Product Gallery Thumbnails: Fix TS errors
* Product Gallery Thumbnails: Add missing dependency
* Product Gallery Thumbnails: Uppercase the enum and fix the thumbnails position bug when initially adding the Product Gallery block
* Product Gallery: Add crop, zoom and full-screen settings
* Product Gallery Thumbnails: Replace ts-ignore with ts-expect-error
* Product Gallery Thumbnails: Replace ts-ignore with ts-expect-error
* Product Gallery Thumbnails: Revert back to ts-ignore
* Revert "Product Gallery: Add crop, zoom and full-screen settings"
This reverts commit 840654197619e2611029b81990493387ae0b543d.
* Remove propTypes (https://github.com/woocommerce/woocommerce-blocks/pull/10432)
* Fix badge wrong spacing on the newest arrivals pattern (https://github.com/woocommerce/woocommerce-blocks/pull/10446)
* Product Gallery: Add Crop, Zoom and Full-screen settings (https://github.com/woocommerce/woocommerce-blocks/pull/10445)
* WIP Product Gallery: Add the Thumbnails block
* Product Gallery Thumbnails: Add block settings
* Add template for the Product Gallery block
* Add template for the Product Gallery block. Add the rest of the files.
* Product Gallery Thumbnails: Add context settings sharing between the Product Gallery and Thumbnails block.
* Product Gallery Thumbnails: Add UI functionality and frontend functionality. Add settings for the Thumbnails in both places - Product Gallery and the Thumbnails block.
* Product Gallery Thumbnails: Move the static template ouside of the component
* Make sure the context is set before accesing the array values
* Product Gallery Thumbnails: Move the setGroupAttributes() function outside of the component
* Product Gallery Thumbnails: Fix TS errors
* Product Gallery Thumbnails: Update the Features Flags and Experimental Interfaces doc
* Product Gallery Thumbnails: Fix TS error
* Product Gallery Thumbnails: Remove unused stylesheet
* Product Gallery Thumbnails: Fix TS errors
* Product Gallery Thumbnails: Remove unused context and fix the thumbnails bottom position styling on the frontend.
* Product Gallery Thumbnails: Allow the user to move the horizontal thumbnails above the large image and don't overwrite that automatically
* Product Gallery Thumbnails: Add code comments and remove the incorrect conditional check when moving thumbnails up and down
* Product Gallery Thumbnails: Fix the eslint dependency error
* Product Gallery Thumbnails: Refactor Product Gallery edit code and move the logic to a utils file
* Product Gallery Thumbnails: Update the utils file
* Product Gallery Thumbnails: Update the utils file. Fix comment indentation
* Product Gallery Thumbnails: Fix undefined variable html when only 1 product image is set
* Product Gallery: Rename clientId to productGalleryClientId
* Product Gallery Thumbnails: Combine the useEffect code having the same dependencies
* Product Gallery Thumbnails: Combine all useEffect code together
* Product Gallery Thumbnails: Add a ThumbnailsPosition enum
* Product Gallery Thumbnails: Update the thumbnailsPosition to an enum
* Product Gallery Thumbnails: Fix TS errors
* Product Gallery Thumbnails: Fix TS errors
* Product Gallery Thumbnails: Add missing dependency
* Product Gallery Thumbnails: Uppercase the enum and fix the thumbnails position bug when initially adding the Product Gallery block
* Product Gallery: Add crop, zoom and full-screen settings
* Product Gallery Thumbnails: Replace ts-ignore with ts-expect-error
* Product Gallery Thumbnails: Replace ts-ignore with ts-expect-error
* Product Gallery Thumbnails: Revert back to ts-ignore
* Revert "Product Gallery: Add crop, zoom and full-screen settings"
This reverts commit 840654197619e2611029b81990493387ae0b543d.
* Product Gallery: Add crop, zoom and full-screen settings
* Product Gallery: Remove the redundant React Fragment
* Remove nested filled and empty cart blocks in cart template (https://github.com/woocommerce/woocommerce-blocks/pull/10447)
* improve migration to blockified templates (https://github.com/woocommerce/woocommerce-blocks/pull/10415)
* fix compatibility with WP 6.2 (https://github.com/woocommerce/woocommerce-blocks/pull/10449)
* Add Product Gallery Pager to template
* Add Pager settings to Product Gallery block
* Remove save function and rename icon
* Use nullish coalescing operator for the block context
---------
Co-authored-by: Roy Ho <roykho77@gmail.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
* Skipped requests regarding WP/WC setup, to avoid issues with the pages not existing yet when migrating page content to templates.
* Skipped requests regarding WP-CLI to avoid issues with the pages not existing yet when migrating page content to templates.
* Added check for woocommerce_db_version option
* Add check for occurred migration to skip template injection
* corrected if clause
* Update src/BlockTemplatesController.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Added maintenance mode to migration exception. Added trace value to has_migrated options
* Merge with new migration logic.
* Set correct post terms for wp_template content
* updated comment
---------
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Fix: Made migration migrate block templates in the current theme
* Update src/BlockTemplatesController.php
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
* Move migration and status codes to BlockTemplateMigrationUtils
---------
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
* load Interactivity API in Bootstrap.php file
* fix comment
* update visibility function
* remove blank line
* remove comment
* remove logic to not load Interactivity API
* WIP of Upgrade Notice state
* Extend the state options with seeing option
* Move the logic to the dedicated folder
* Subscribe only if not reverted
* Refactor the way UpgradeNotice is rendered
* Simplify the logic of keeping the Upgrade Notice state in local storage
* Improve types organisation
* Lift the functions interacting with local storage to the Inspector Controls of Product Colelction
* Simplify logic of showing Upgrade Notice
* Disable auto migration
* Refactoring
* Use useLocalStorageState hook
* Fix incorrect merge
* Final improvements
* Allow to display Upgrade Notice after revert and manual upgrade
* Fix incorrect merge
* Improve the unsubscribe process
* Trigger auto-update from Product Collection only
* Remove weird console.log
* Abstract manual update from Product Query
* Fix the taxQuery migration from Product Collection to Products
* Product Collection - logic to hide upgrade notice (https://github.com/woocommerce/woocommerce-blocks/pull/10494)
* Add timestamp to each upgrade notice status change
* Revert back only Product Collections converted from Products block
* Make the time threshold configurable
* Add logic that hides the Upgrade Notice after some amount of displays
* Fix the taxQuery migration from Product Collection to Products
* Change the way to count Product Collection entries
* Fix the problem of multiple display counter increments with Product Collection
* Update Upgrade Notice visibility conditions
* Add contiions to unmark Product Collection as converted from Products
* Change variable name
* Change variable t to time name for better readibility. Improve types
* Replace useState with useRef
* Remove unecessary props passed to UpgradeNotice
* Testimonials Single Pattern: Update the styles for the image and add and alt text.
* Update the layout type of the comlumn iwth the content to constrained and update padding to 32px for the columns wrapper.
* Vertical align image to the center.
* Remove client side navigation from Products beta block
Changes:
- Removed the `add_navigation_id_directive` method and its associated filter. This method previously added a `data-wc-navigation-id` attribute to the query block for client-side navigation, which is no longer required.
- Removed the `add_navigation_link_directives` method and its associated filter. This method previously added interactive directives to pagination links inside the Query Pagination block. This specific functionality has been removed as it is no longer needed.
- Introduced a new method `mark_block_as_interactive`, which is designed to mark the Product Query as an interactive region so that interactive elements can work inside it. This is achieved using the 'data-wc-interactive' attribute.
* add data-wc-interactive to product button block
* Remove unnecessary code
As we have added `data-wc-interactive` on Product button therefore we don't need to add it in Product Query block.
* Boolean attribute doesn't need explicit value equal to true
* Skip failing i18n-related E2E tests
* Skip failing i18n-related E2E test
---------
Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Niels Lange <info@nielslange.de>