* WIP: experimenting with strategy pattern for block registration
* Add TemplateChangeDetector to BlocksRegistrationManager
* Handle blocks registration
* Fix issue causing blocks to be registered multiple times
* Allow register/unregister blocks when on pages or posts
* Add BlockRegistrationStrategy logic
* Fix import error
* Add doc comments for BlockRegistrationManager class
* Add doc comments to TemplateChangeDetector class
* Fix eslint errors
* Import domReady from @wordpress/dom-ready
* Prevent error when using blockName for registerBlockType function
* Add e2e tests to check for block availability in different contexts
* Add e2e tests to cover block availability on different contexts
* Product Gallery Thumbnails: Add View All link to the last thumbnail (non-interactive)
* Product Gallery Thumbnails: Add interactivity to the View All overlay
* Product Gallery Thumbnails: Refactor View all html to make it more readable
* Product Gallery Thumbnails: Fixwoocommerce/woocommerce-blocks#11100 - Load all thumbnails and hide the View all overlay when in Dialog
* Product Gallery Thumbnails: Fixwoocommerce/woocommerce-blocks#11099 - Enable the dialog for the View all thumbnails overlay even when the 'Full-screen when clicked' setting is disabled
* Product Gallery Thumbnails: Remove unnecessary concatenation from the View all html
* Product Gallery Thumbnails: Abstract the View All conditions into separate functions for readability
* Product Gallery Thumbnails: Add escaping to the View all plain text string
* E2E: Fix the Sale Badge and Single Product Template tests by selecting the first Sale Badge
* Fix: Remove incorrect discount label
We don't want to mark a product as having a discount when price includes
additional costs
* Add "goToCart" E2E helper function
* Add the CartPage class
* Add the Cart product price E2E tests
* Remove unnecessary comments
* Mark the Cart shopper E2E testing file as a having side effects
* Fix the "Strict mode violation" error
* Try another fix for the "Strict mode violation"
* Remove authors filter from Product Collection block
* Remove author filed in query
* Add back the author query argument in the final query builder
---------
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
* Add slide animation
* 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
* improve animation
* improve naming
* fix regression
* fix css
* improve code style
* remove check on tag image
* align image
* fix crash when zoom is disabled
* fix E2E tests
* improve CSS
---------
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
* 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>
* 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>
* 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>
* 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.
* 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>
* 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
* 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