* Sync Interactivity API code with Gutenberg
* New store() API
* Store raw actions
* Update wc-interactivity-store implementation
* Replace `wc_store` with `wc_initial_state`
* Parse and populate initial state
* Allow store parts in `store()`
* Accept namespaces in directive paths
* Add $$namespace to directives' object values
* Make namespace parsing more robust
* Use DeepPartial type for store parts
* Do not pass `rawStore` to `afterLoad` callbacks
* Simplify `store()` a bit
* Implement `privateStore()`
* Sync context directive with Gutenberg
* Refactor scope and extract getters per scope
* Add namespace to getters and actions
* Remove current privateStore implementation
* Remove `afterLoad` option from `store`
* Use same proxy handlers for ns, getters and actions
* Set scope inside `evaluate`
* Refactor proxy handlers
* Improve types a bit
* Catch errors in async actions
* Implement stacks for scopes and namespaces
* Implement `getElement`
* Change directives object structure
* Remove unnecessary import
* Implement private stores
* Return value from sync actions
* Minor optimizations and improved comments
* Don't use async inside `data-wp-watch`
* Use a single Provider in context directive
* Remove DeepPartial type
* Do not check if element exists
* Add the `current` prop of state inside the scope
* Move getters outside scope
* Fix wc-key assignment
* Fix missing `navigate` in directives
* Fix namespace not being picked in the same element
* Deep merge raw stores instead of proxied ones
* Fix namespace assignment
* Allow forward slashes in namespaces
* Migration of Product Collection and Product Button blocks to the new `store()` API (https://github.com/woocommerce/woocommerce-blocks/pull/11558)
* Refactor Product Button with new store() API
* Use `wc_initial_state` in Product Button
* Fix namespace
* Remove unnecessary state
* Test namespaces in directive paths
* Add test context with namespace
* Simplify woo-test context
* Move addToCart and animations to a file
* Do not pass `rawStore` to `afterLoad` callbacks
* Move callbacks and actions back to the main file
Because the animation was broken.
* Remove selectors in favor of state
* Use default ns in `getContext` for state and actions
* Remove `afterLoad` callback
* Remove unnecessary ns
* Fix getContext in add-to-cart
* Replace namespace and delete unnecessary store
* Pass context types only once
* Use an alternative for requestIdleCallback
* Add previous react code for notices
* Add namespace to Product Collection block
* Replace getTextButton with getButtonText
* Add block name to the ProductCollection namespace
* fix style HTML code
* Remove circular deps error on the Interactivity API
* Product Gallery block: Migrate to new Interactivity API store (https://github.com/woocommerce/woocommerce-blocks/pull/11721)
* Migrate Product Gallery block to new Interactivity API store
* Fix some references
* Add missing data-wc-interactive
* Fix an additional namespace
* Remove unnecessary click handler
* Dialog working
* Refactor action names
* Reindex PHP array
There was some missing indexes, which turned the array into an object in JS.
* Remove unused event handlers
* Move next/previous logic to external function
* Move StorePart util to the types folder
* Rename namespace to `woocommerce/product-gallery`
* Undo product collection namespace renaming
* Remove unnecessary namespace
* Don't hide the large image on page load
* Minor refactorings
* Fix eslint error
* Fix php cs errors with spacing and double arrows alignment
* Disable no-use-before-define rule for eslint
* Disable @typescript-eslint/ban-types rule for eslint
* Fix parsed context error in e2e tests
* Fix context parser for Thumbnail image
* Move store to the top of the frontend file
* Add interactivity api utils to the @woocommerce/utils alias
* Replace deprecated event attribute
---------
Co-authored-by: Luis Herranz <luisherranz@gmail.com>
Co-authored-by: David Arenas <david.arenas@automattic.com>
Co-authored-by: roykho <roykho77@gmail.com>
---------
Co-authored-by: David Arenas <david.arenas@automattic.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: roykho <roykho77@gmail.com>
* Fix error when closing product gallery dialog with keyboard escape key
* use wc_initial_state instead of wc_store
---------
Co-authored-by: Luis Herranz <luisherranz@gmail.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: roykho <roykho77@gmail.com>
* Update Interactivity API JS files
* Disable TS checks in the Interactivity API for now
* Add new SSR files
* Replace wp_ prefixes with wc_ ones
* Replace wp- prefix with wc-
* Replace guternberg_ prefix with woocommerce_
* Remove file comments from Gutenberg
* Rename files with `wp` prefix
* Fix code to load Interactivity API php files
* Remove TODO comments
* Replace @wordpress with @woocommerce
* Update Webpack configuration
* Fix directive prefix
* Remove interactivity folder from tsconfig exclude
* Add client-side navigation meta tag code
* Remove unneeded blocks.php file
* Fix store tag id
* Register Interactivity API runtime script
* Fix Interactivity API runtime registering
* Add Simple Price Filter block
* Remove all files related to directive processing in PHP
* Use values directly for SimplePriceFilter SSR
* Reset pages to 0 when changing filter
Note: we also need to do this with `/page/x`
* wip
* phpcs
* register price filter as inner block
* try: render block using save
* add types
* use min range var instead of 0
* inject dynamic data
* query price data in editor
* better injecting interactivity data
* remove rounding
* Product Collection Data endpoint doesn't care about current query so we remove the context for now
* extract data injecting as a method, possbily a trait in the future
* add sidebar setting
* duplicating the markup in php render callback for safety
* remove directive from edit component
* show prices without decimal
* use final class
* use sample collection data response
* prepare for multiple styles support
* use collection data from context
* cleanup props and props passing
* pass only necessary states
* retire heredoc in favor of late escaping
* reorganize style
* inherit style from current price filter react component, pre extract the component for multiple display style support
* keep minPrice smaller than max
* remove unnecessary active handler logic
* update folder structure
* avoid whitespace change
* clean up
* title
* move inspector to component folder, ready to be extracted to inner block
* block icon
* block name
* name
* use inner block for view
* inner block view switcher
* try: process data in Collection Filtes block only
* wip: query collection data from collection filters block only
* provide all context from collection filters block
* simplify context passing
* feat: use default attribute to define filter type of view block
* rename
* remove price block
* rename price slider to price, default price filter should be a slider
* type cleanup
* fix ancestor block name
* only passing the collection data down
* wip
* recusive
* editor preview
* refactor: data fetching, context passing, and code organization
* initial attribute filter block
* feat: attribute selector
* inspector control
* wip
* break the edit into smaller components
* wip: editor component
* extract checkbox list
* wip editor preview
* show count checkbox list
* fix param aggregation for attribute filter blocks
* post merge fix
* fix param aggregation for attribute filters
* fix: set correct selected attribute
* WIP checkbox list
* WIP checkbox list
* avoid action name conflicts
* Checkbox list front end
* phpcs
* update context on input, navigate on change
* fix: attribute selection
* dropdown
* remove isDeepEqual
* add: warning when attribute has no products or no attribute is selected
* update type
* update type
---------
Co-authored-by: David Arenas <david.arenas@automattic.com>
Co-authored-by: Luis Herranz <luisherranz@gmail.com>
* Add custom 'No Results' block for Product Collection
This commit introduces a new 'No Results' block, replacing the default core 'query-no-results' block within product collection block. The 'No Results' block provides a tailored experience for WooCommerce stores, displaying a custom message when no products are found in a query.
Key changes include:
- A new block type 'woocommerce/no-results' is registered with a complete configuration and content structure.
- Edit and save functions are implemented for the block, allowing for custom content and styles within the block editor and on the front end.
- Webpack entries are updated to include the new block in the build process.
- A PHP class NoResults is added for server-side rendering, which only displays the block when the product query returns no results, enhancing performance.
- The ProductCollectionUtils utility class is extended to support the new block's query needs.
The new block enriches the user experience by providing clearer communication when no products match the collection criteria and allows store owners to customize the message and presentation.
* Update description
* Rename 'no-results' block to 'product-collection-no-results'
Changes include:
- Updating the block name in `edit.tsx` within the `product-collection` directory.
- Modifying the block.json file in the `no-results` inner block to reflect the new name.
- Adjusting the className in `edit.tsx` for the `no-results` inner block.
- Altering the webpack entries in `webpack-entries.js` to recognize the new block name.
- Renaming the block in `NoResults.php` to align with this update.
This renaming aims to make the block's purpose more clear and to maintain a consistent naming scheme within our product collection blocks.
* Rename NoResults to ProductCollectionNoResults for clarity
This commit renames the `NoResults` class to `ProductCollectionNoResults`. The change aims to enhance clarity and specificity about the class's purpose, indicating that it specifically handles no-result scenarios within product collections.
Changes made:
- Renamed `NoResults.php` to `ProductCollectionNoResults.php`.
- Updated the class name from `NoResults` to `ProductCollectionNoResults` in the file.
- Modified the reference in `BlockTypesController.php` to use the new class name.
This renaming ensures better readability and understanding of the class's role in the context of product collections. The primary change is the renaming, with no significant alterations in the class functionality.
* Update No-Results Message Formatting in Product Collection Block
This commit simplifies the layout and message content for the 'No results found' message in the product collection block's no-results edit component. The changes include:
1. Removal of the full stop in the 'No results found' string for consistency.
2. Replacing the 'core/group' block with a 'core/paragraph' block.
3. Streamlining the message content to be more concise and integrated into fewer text blocks.
4. Direct links for 'clearing any filters' and navigating to the 'store's home' are now included in the same paragraph.
---------
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.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>
* 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>
* 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>
* 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>
Co-authored-by: Luigi <gigitux@gmail.com>
- Updates the `@wordpress/e2e-test-utils-playwright` package to use the npm release.
- Removes hard-coded WP version in `.wp-env.json` to use the latest Core release.
- Fixes failing Playwright tests when using WP 6.3.
- Pins the core version (6.2.2) for Jest E2E tests so they can keep passing. We decided not to fix those tests because we're moving to Playwright.
* Update Interactivity API JS files
* Disable TS checks in the Interactivity API for now
* Add new SSR files
* Replace wp_ prefixes with wc_ ones
* Replace wp- prefix with wc-
* Replace guternberg_ prefix with woocommerce_
* Remove file comments from Gutenberg
* Rename files with `wp` prefix
* Fix code to load Interactivity API php files
* Remove TODO comments
* Replace @wordpress with @woocommerce
* Update Webpack configuration
* Fix directive prefix
* Remove interactivity folder from tsconfig exclude
* Add client-side navigation meta tag code
* Remove unneeded blocks.php file
* Fix store tag id
* Register Interactivity API runtime script
* Fix Interactivity API runtime registering
* Remove all files related to directive processing in PHP
* Move json_encode to Store's render method
* WIP
* WIP
* WIP
* WIP
* Preserve previous context
* Ignore Minicart block on client-side navigation
* Refresh page on store updatRefresh page on store updatee
* Refactor logic
* Add console error when a path is missing
* fix PHP lint error
* WIP store
* use store approach
* update jest configuration
* restore Mini Cart changes
* move cart store subscription to interactivity package
* move interactivity flag
* format HTML
* move addToCartText to the context
* Load product-query stylesheet when rendering the Products block
* update sideEffects array
* fix catch
* rename moreThanOneItem to isThereMoreThanOneItem
* improve how scripts are enqueued
* update default value for the filter woocommerce_blocks_enable_interactivity_api
* Update assets/js/atomic/blocks/product-elements/button/block.json
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update assets/js/interactivity/cart/cart-store.ts
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* fix block.json
* remove updateStore function
* restore interactivity api changes
* import cart store
* show notice when there is an error
* add logic to dequeue script on classic themes and block themes
* imrpove logic about notice
* Interactivity API: add `afterLoad` callbacks to `store()` function (https://github.com/woocommerce/woocommerce-blocks/pull/10338)
* show notice when there is an error
* Add initial implementation for store callbacks
* Run `afterLoad` callbacks after `init`
* Move cart state subscription to Product button
* Remove cart-store from Interactivity API internals
* Change callbacks with options and save only afterLoad callbacks
* ProductButton: Add animation (https://github.com/woocommerce/woocommerce-blocks/pull/10351)
* implement animation
* improve logic
* refactor logic
* refactor code
* address feedback about code style
* add support for woocommerce_add_to_cart_quantity
* Fix animation flickering
* Introduce wp-effect, reduce the amount of numberOfItem variables to 2 and consolidate animation status
* add support for added class
* Remove unnecessary selector
* Don't fetch cart if it was already fetched
* remove added class
---------
Co-authored-by: Luis Herranz <luisherranz@gmail.com>
---------
Co-authored-by: Luigi <gigitux@gmail.com>
Co-authored-by: Luis Herranz <luisherranz@gmail.com>
* update deepsignal
* remove added class
* update deepsignal
* Interactivity API and Product Button: Add E2E tests (https://github.com/woocommerce/woocommerce-blocks/pull/10036)
* Add FrontendUtils class
* fix conflicts
* use locator
* restore click usage
* Product Button: Add E2E test
* fix util
* fix E2E tests
* remove comment
* Add E2E test to ensure that woocommerce_product_add_to_cart_text works
* update sideEffects array
* add zip and unzip as package
* fix wp-env configuration
* fix E2E test
* add report
* try now
* try now
* try now
* fix E2E test
* E2E: Add documentation for testing actions and filters. Fixeswoocommerce/woocommerce-blocks#10135 (https://github.com/woocommerce/woocommerce-blocks/pull/10206)
* update description
* fix label
* rename files
* make requestUtils private
* remove page.goto
* use toHaveCount
* use productsToDisplay variable
* fix E2E tests
* rename class utils
---------
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
---------
Co-authored-by: David Arenas <david.arenas@automattic.com>
Co-authored-by: Luis Herranz <luisherranz@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
* Move e2e to e2e-jest
* Move e2e-pw to e2e
* Update e2e usage + scripts
* Missed some directory renames
* Update gitignore
* Remove test results as its in gitignore
* 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.
* 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
* Make sure the revert button is registered and enqueued for usage exclusively in the site editor.
* Register and enqueue the styles for the revert button.
* Rename the files.
* Revert "Rename the file renames."
This reverts commit c0330ce70fec20bea1f957eddcf458881e16242c.
* Add plugin-proposal-optional-chaining to the WebPack plugins config.
* Rename the files.
* Remove unnecessary dependencies as those are already provided via : more specifically, get_script_data.
* Address CR.
* Show alignment toolbar also when the block is in the single product block
* Start using `Single Product` for the `Product Details Product Listing` pattern
* Use counter and stars blocks in the pattern
* Undo button change
* Make the new rating blocks not experimental
* Add Beta to the average rating block
* Add blocks to block types controller
* Add new Product Average Rating block
* Add new blocks to the feature flag docs
* Translate 'No ratings'
* Fix condition
* Small improvements after review
* Avoid duplication of styles
* Update supports in php class
* Product Gallery: Add an new block base code
* Product Gallery: Add experimental flag
* Product Gallery: Add Large Image block code
* Product Gallery Large Image: Remove unsed types
* Product Gallery: Move the block from registerBlockType to registerBlockSingleProductTemplate
* Product Gallery: Update icon
* Product Gallery: Add missing icon import
* Product Gallery Large Image: Add experimental mode check
* Product Gallery Large Image: Deregister unnecessary block settings
* Product Gallery Large Image: Add experimental flag to the Product Gallery Large Image and remove the icon override
* Product Gallery Large Image: Add zoom and correct styling
* Product Gallery Large Image: Remove commented out unnecessary code
* Product Gallery Large Image: Re-add the removed action after capturing the large image html
* Product Gallery Large Image: Update Large Image icon and description. Move metadata to the block.json file.
* Product Gallery: Add an new block base code
* Product Gallery: Add experimental flag
* Product Gallery: Move the block from registerBlockType to registerBlockSingleProductTemplate
* Product Gallery: Update icon
* Update Interactivity API JS files
* Disable TS checks in the Interactivity API for now
* Add new SSR files
* Replace wp_ prefixes with wc_ ones
* Replace wp- prefix with wc-
* Replace guternberg_ prefix with woocommerce_
* Remove file comments from Gutenberg
* Rename files with `wp` prefix
* Fix code to load Interactivity API php files
* Remove TODO comments
* Replace @wordpress with @woocommerce
* Update Webpack configuration
* Fix directive prefix
* Remove interactivity folder from tsconfig exclude
* Add client-side navigation meta tag code
* Remove unneeded blocks.php file
* Fix store tag id
* Register Interactivity API runtime script
* Fix Interactivity API runtime registering
* Remove all files related to directive processing in PHP
* Move json_encode to Store's render method
* Add Products Collection block scaffolding
This commit adds the initial scaffolding for the new Products Collection block. It includes the creation of new files (block.json, edit.tsx, index.tsx and ProductsCollection.php) and additions to existing files (webpack-entries.js and BlockTypesController.php). The block is marked as experimental and currently displays a static "Product collection" text in both the editor and the frontend.
* Add Product Template block and integrate with Products Collection block
This commit introduces the new Product Template block and integrates it with the existing Products Collection block. The changes include:
- Creation of the Product Template block, including its block.json, edit.tsx, icon.tsx, index.tsx, and save.tsx files.
- Modification of the Products Collection block, adding an icon.tsx file and updating its edit.tsx and index.tsx files.
- Updates to the webpack-entries.js file to include the new Product Template block.
- Addition of the ProductTemplate class in the src/BlockTypes directory.
- Inclusion of the ProductTemplate class in the src/BlockTypesController.php file.
* Enhance product-template block with context and styling
This commit adds various enhancements to the product-template block. It includes:
- Introduce `usesContext` and `supports` properties to the block.json file
- Update the edit.tsx file to use BlockContextProvider and add query logic
- Add an editor.scss file for styling the product-template block in the editor
- Extend the products-collection block.json file with new properties
- Modify the products-collection edit.tsx file to include instanceId and useEffect
These changes improve the product-template block by providing better context handling and styling options.
* Add 'woocommerce/product-template' to supported inner blocks and improve product-template editing
This commit adds 'woocommerce/product-template' as a supported inner block for various product elements, including button, image, rating, sale-badge, SKU, and stock-indicator. It also improves the editing experience for the product-template block by memoizing the block previews and rendering them more efficiently. This should lead to a smoother editing experience and better performance in the block editor.
* Add product title and summary variations for Products Collection block
- Add default spacing between product elements in `style.scss`
- Register product title and summary element variations in `products-collection` block
- Create utility for registering element variations
- Extend core elements with WooCommerce namespace
* Set inherit to false by default and other improvements
This commit introduces several changes to the ProductsCollection block:
1. Set the "inherit" property to false in block.json, disabling inheritance by default.
2. Remove the default styles for inner blocks in the edit.tsx file.
3. Add a save function in the index.tsx file, and create a save.tsx file to handle saving the block.
4. Update the ProductTemplate.php file to properly render the block content based on the changes.
5. Remove the render function from the ProductsCollection.php file, as it is no longer necessary.
These changes improve the functionality and flexibility of the ProductsCollection block, allowing for better customization and control over the block's appearance and behavior.
* Fix pagination issue
* Minor code quality improvments
* Register product blocks only in experimental builds
- Wrap registerBlockType calls in product-template and products-collection with isExperimentalBuild check to enable block registration only in experimental builds.
- Update the default value for the perPage property in products-collection/block.json from null to 9, setting a default display of 9 items per page.
* Add experimental flag to PHP file
* Update documentation for feature flags
- Add Products Collection and Product Template blocks to the list of experimental flags in the feature-flags-and-experimental-interfaces.md file.
- Include references to PHP and webpack flags for both blocks.
* Change default order and orderBy values in block.json
- Update the default 'order' value from 'desc' to 'asc'.
- Update the default 'orderBy' value from 'date' to 'title'.
* Refactor experimental block registration and remove unused file
- Replace `isExperimentalBuild()` with `registerExperimentalBlockType()` in product-template/index.tsx.
- Remove unused file types.ts in product-template directory.
- Add `get_block_type_script()` function to ProductTemplate.php and ProductsCollection.php to return null.
* Update variation names in product summary and product title elements
Updated variation names for product summary and product title elements to match the new products-collection namespace. The previous variation names used the product-query namespace which will be deprecated. This change ensures that the correct variation names are used for these elements in the products-collection block.
* Rename 'Products Collection' to 'Product Collection'
- Renamed all instances of "products-collection" to "product-collection" across multiple files.
- Adjusted related types and method calls to match the new naming convention.
- Updated documentation and feature flags to reflect the name change.
- Made necessary changes in `BlockTypesController.php` and `bin/webpack-entries.js`.
* Hide product-template block from inserter
- Added "woocommerce/product-collection" to the list of parent blocks in `product-template/block.json`.
- Added `"inserter": false` to the "supports" section to disable the option of inserting this block through the editor inserter component.
* Fix Eslint error
* Add block minimal structure
* Add Single Product block icon
* Add usesContext to block.json
* Add Save function to Single Product Block registration settings
* Add InnerBlocks template to Editor for Single Product Block
* Add Product selector to Single Product block
* Add withProduct HOC to the block editor
* Add save function to the Single Product block
* Add renderOnServerSide attribute to Product image
This attribute is used to determine if the product image should be rendered on the server side or not. This is needed because the product image is not rendered on the server side by default, but we want to render it on the server side when it is inside the Single Product block.
* Add renderOnServerSide attribute to Product Category List block
* Add renderOnServerSide attribute to Product Price block
* Add renderOnServerSide attribute to Product Rating block
* Add renderOnServerSide attribute to Product Stock Indicator block
* Add renderOnServerSide attribute to Product Summary block
* Add renderOnServerSide attribute to Product Tag List block
* Add renderOnServerSide attribute to Product Title block
* Add renderOnServerSide attribute to Product Add to Cart, Sales Badge and Sku block
* Reuse editor code for Single Product block
* Add Props interface to Single Product Server Side Editor
* Add render_block_context hook to SingleProductServerSide block
* Fix Single Product Server Side block that was not appearing in the block inserter
* Fix bug where the correct product was not being displayed on the frontend
* Remove Single Product Block
* Add Product title and product summary variations
* Add Add To Cart Form and Product Meta blocks to the Single Product Block
* remove more files that belong the Single Product block
* fix php linter error
* wrap up Single Product Block
* Fix issue preventing the block from working on the Single Product Template
* Fix update context function for Single Product block
* Replace Single Product block title
* Replace global $post only for Single Product inner blocks
* Remove unnecessary var_dump statement
* Improve documentation for the Single Product block
* fix registration: add-to-cart-form and product-meta blocks
* Improve documentation for Single Product block
* Fix lint error related to imports
* Remove query monitor debug code
* Remove unnecessary `renderOnServerSide` attribute from product elements
* Fix return type for the Save function of the Product Elements blocks
* Fix return type for the Save function of the Product Title block
* Add scss file for Single Product block
* Fix PHP coding standards
* Fix php coding standards
* Remove internal dependencies section duplication
* Replace .wc-block with .wc-block-editor- styles
According to the naming convention for this project (https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/contributors/contributing/coding-guidelines.md#naming) we should be using the `.wc-block-editor-` prefix for styles that are only used in the editor.
* Solve style for the Edit card component in the Single Product block
* Fix error preventing Block Control from being displayed
* Make the Product title to be a link by default
* Fix PHP Coding Standards
* Fix PHP Code Standards
* Fix php cs issues
* Fix issue with php cs
* Remove unnecessary comment
* Remove unused Icon import
* Remove unnecessary dot from the className attributes in the Single Product Block
* Replace metadata.name with metadata.title in the Editor file
* Ignore phpcs rule
* Add new attributes to the Attributes interface of the Price block
* Fix typescript errors on the Product Meta block
* Fix ts errors on Single Product editor
* Fix ts errors on layout-editor.tsx
* Fix ts errors in Single Product index file
* Fix ts errors on add to cart form index file
* Fix unsupported block error when using inner blocks outside the Single Product template
* Fix unsupported block error for the Single Product block when editing Posts/Pages
* Remove unnecessary JSDoc types
* Remove unnecessary APIError component
* Replace global $post only when rendering a `core/post-excerpt` block
* Fix php cs errors
* Put the Single Product block behind an experimental flag
* Fix error occurring when trying to access ancestor of an undefined block settings
* Remove JS Doc from shared-product-control.tsx
* Fix single-product-frontend.js 404 error
* Fix error 'Block names must be string' when adding Single Product block
* Add todo comment to state the temporary solution used in the Single Product block
* Move the wp_reset_postdata outside the block name check condition
* Add comments about why we need to unregister the block on Single Product template
---------
Co-authored-by: Luigi <gigitux@gmail.com>
* Remove Single Product Block
* remove more files that belong the Single Product block
* fix php linter error
* remove Product Tag List and Product Category List blocks
* Add minimum structure for Single Product Details block
* Add Product Image Gallery woocommerce/woocommerce-blocks#8233
Add Product Image Gallery
* Add tests for Single Product Details block
* Add the initial basis for the Add to Cart button
* Trigger the single product add to cart action for each product type.
* wip: create block structure and add initial styles
* Add block details to the SingleProductDetails.php file
* Rename the block from add-to-cart-button to add-to-cart-form
* Update to use the cart icon.
* Implement the skeleton for the editor preview.
* Render tabs title with empty content
* Use woocommerce_output_product_data_tabs function to retrieve tabs data
* Update styles and add Notice for the display in the Editor.
* Update CSS.
* Add base tests for the new Add to Cart Form component.
* Add Product Image Gallery block
* remove support global styles
* remove support global styles
* Update the button CSS.
* Remove customizations for the Single Product Details block
* Update styles for the cart form.
* update td style.
* Update divs and CSS.
* Use conventional input instead of the experimental InputControl
* address CSS feedback
* add support for the custom classname
* remove save function
* Remove unnecessary console.log from the Edit.tsx file
* Remove block classname from block wrapper
* Remove unnecessary WooCommerce tabs filter from the BlockTemplatesController
* Remove attributes property from the block registration
* Remove isExperimental flag for the Single Product Details block
* Remove get_classes_and_styles_by_attributes method from SingleProductDetails block
* Prevent Single Product Details block from apppearing in Pages or Posts
* add second parameter to the subscribe function
* Implement the new design and copy provided for the editor.
* Make the notice compatible with dark themes.
* Some additional CSS tweaks
* adjust the padding for the input
* wrap the Single Product Template in a div with the product class
* Fix PHP Coding Standards warnings
* improve logic and increase coverage of unit test
* improve logic and increase coverage of unit test
* fix test
* format HTML
* fix edge case
* update @types/wordpress__data package
* update placeholder, icon and description
* update tsconfig
* update block name
* fix SCSS linter error
* address feedback
* create SingleProductTemplateCompatibility class
* Add Hooks compatibility
* remove not used file
* remove not used files
* Add compatibility layer for the Single Product template
* fix check
* address feedback
* remove unused import
* double empty line
* remove logic in the constructor
* remove hook
* generate the docs
* add missing hooks
* fix docs
* address feedback
* fix linter
* fix import
* Disable compatibility layer when the WooCommerce Product Grid Block block and WooCommerce Single Product Block are used (https://github.com/woocommerce/woocommerce-blocks/pull/8538)
* disable compatibility layer via hook
* update docs
* generate the docs
* fix version
* fix import
* fix code after merge
---------
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
* Add the initial basis for the Add to Cart button
* Trigger the single product add to cart action for each product type.
* Rename the block from add-to-cart-button to add-to-cart-form
* Update to use the cart icon.
* Implement the skeleton for the editor preview.
* Update styles and add Notice for the display in the Editor.
* Update CSS.
* Add base tests for the new Add to Cart Form component.
* Update the button CSS.
* Update styles for the cart form.
* update td style.
* Update divs and CSS.
* Use conventional input instead of the experimental InputControl
* Implement the new design and copy provided for the editor.
* Make the notice compatible with dark themes.
* Some additional CSS tweaks
* adjust the padding for the input
* Update the icon for the block to match the core icon button
* Initial structure for the breadcrumbs block
* ditch inline comment
* Fine-tune the store breadcrumbs
* Disable the breadcrumbs block for regular posts & pages
* Update the breadcrumbs block details.
* Add tests
* rely on sprintf to render the breadcrumb
* Ditch usesContext.
* Add a link to the breadcrumb editor preview
* Disable all pointer-events for the breadcrumb link in the editor preview
* Add the align attribute
* Use the Disabled component to prevent interactions and update the copy for the block description.
* Add Interactivity API scripts
* Enqueue scripts if Products exists for testing
* Test client-side transitions
* Remove script enqueue
* Remove hpq dependency
* Update Interactivity scripts to latest version
* Remove interactivity scripts from core entries
* Create webpack config for interactivity api
A plugin for optional chaining is required as the repo uses Webpack 4 for now.
* Enqueue the directives runtime
* Updated wp directives code
* Use a filter to enque the directives runtime
* Remove base-interactivity alias for now
* Add path for modules inside base-interactivity
* Revert "Remove base-interactivity alias for now"
This reverts commit 7c6cbee372c65e430590d98c1819b6b4b0a97d93.
* Remove unnecessary filter and enqueue
* Update router code
* Update Interactivity location and alias
* Use hook `init` for script registering
Co-authored-by: Mario Santos <santosguillamot@gmail.com>
Co-authored-by: Luis Herranz <luisherranz@gmail.com>
* Block scaffolding
* Rename to store notices
* Register only in the site editor
* Update description
* Add woocommerce class
* Add tests
* Delete old test file
* Update notices message in the editor
* Remove customization
* Disable the block server side
* Fix TS error
* Add custom classes
* Reprashed test description
* Escape notices
* Remove unnecessary disabled component
* Only allow to insert the block once
* Improve class name
* Merge edit and block files
* Fix copy
* Simplify test case
* Remove align support
* Remove attributes
* Change editor markup
* Use the Notice component to display the notice placeholder on the editor
* Use sprintf to improve readability
* Inline component
* Remove styles and unregister scripts
* Use ordered placeholders
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Use info as the notices status
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Fix php lint error
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* WIP
* Render in editor and add styles
* Simplify select
* Undo change
* Update titles and description
* Wrapped text for translation
* Remove from products inner blocks
* Allow the block in the inserter
* Rename test file and add new tests for catalog-sorting block
* Register on the site editor only
* Fix tests
* Disable block server side
* Override the `enqueue_assets`
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Fix TS error
* Simplify edit
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Disable background color
* Add custom classes
* Remove alignment
* Inherit color and font properties
* Merge edit and block files
* Use sprintf to improve code readability
* Make fontsize small by default
* Add order placeholders and woocommerce class
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Fix floating issue
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Add woocommerce class
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Init setup to add a new block Results Count
* Render template part as a content of ResultsCount block
* Switch to template part rendering
* Rename the block to ProductResultsCount
* Fix typo in BlockTypesController
* Change the ProductResultsCount class name
* Remove Product Results Count block from Product Query template
* Improve the way Product Results Count is rendered in the editor
* Add prefix to places that missed renaming from ResultsCount to ProductResultsCount
* Remove unnecessary frontend.tsx file for ProductResultsCount
* Make sure global styles are applied and respected by Product Results Count block
* Make sure the Product Results Count is available inly in Product Catalog template
* Add basic tests to Product Results Count
* Remove empty line in style file
* Fix TS issue in Product Results Count
* Fix typo
* Override the enqueue_assets method to prevent unnecessary enqueue and 404 error on the frontend
* Add necessary property to block's metadata
* Address code review feedback
* Update description
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Remove disabled component
* Improve test description
* Merge edit and block files
* Remove align support
* Remove background support
* Simplify edit component
* Improve readability with sprintf and add custom class
* Simplify test case
* Add styles and order placeholders
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Fix markup to match with the frontend
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Move payment methods
* Setup entrypoints
* Sortable implementation
* Sortable
* Basic UI in place for settings
* Hydrate real settings
* Form updates values
* Styling and save button placement
* useSettings hook
* Prepare for save
* delete
* Add location button
* Remove className
* Conditional display of taxes
* Save via API
* Update general settings to designs
* Modal styles
* Style table
* Border colors and radius
* Added e2e tests
* use node 16
* Enqueue states in admin
* Use render from wordpress/element
* Missing handle style
* Enable translations
* Remove curried function
* Todo for inline settings
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
* Add empty 'Customer Account' block
* Add edit to render the block on the editor
* Add Customer Account icon to @woocommerce/icons library
This icon is used in the Customer Account block.
* Use customerAccount icon in the Customer Account block
* Add Block Settings to Customer Account block
Add Typography and Color settings to the Customer Account block that can be used during Edit mode.
* Add Customer Account style icons
This adds the customer account style icons to be used by the customer account block.
* Render the block in the frontend
* Add Display setting to the Customer Account block
This setting allow users to choose if they want to include an icon with the customer account link.
* Add icon style selector to Display settings
This adds an icon style selector in which users can choose the customer account link icon.
* Display on the frontend depending on the icon style
* Rename attributes
* Refactor block rendering
* Improve styling
* Make the account link dynamic
* Add alignment menu
* Get dashboardUrl with getSettings and add fallback
* Add link to account settings
* Add tests
* Fix test
* Change display title
* Split css file
* Switch to SSR
* Add styles to the front end
* Address latest feedback
* Remove experimental flag
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
* Add woocommerce_blocks_loaded hook information to actions doc
* add docs to woocommerce_blocks_loaded hook inline
* fix docs
* Switch to updated wp-hooks/generator package
* Prevent syntax error in doc script from storeapi.php
* Remove footer from internal docs and examples
* Doc footer script should ignore examples and internal developer docs
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* fixed method sig
* Updated to @wordpress/env@5.5.0 and set default PHP 7.4 for wp-env.
* updated Coding Standards flow to use PHP 8.0
* Added comment to E2E flows explaining what PHP version is used
* Revert "Updated to @wordpress/env@5.5.0 and set default PHP 7.4 for wp-env."
This reverts commit 696cd7f42edc9d9726b777cf4f83a501a6d63936.
* Added comment to Unit test flows explaining what PHP version is used.
Specified PHP version on .wp-env.json
* Fixed composer-lock.json version.
* Updated tests to run on PHP Unit 9.2.6
* Updated tests to run on PHP 8
* Reverted test, mismatched results between local and pipeline
* Removed Todo
* Updated platform overrides
* Update Migrationb tests with Mockery for PHP8 compat
* try at PHP unit flow matrix
* Fix blocks.ini invalid config
* Temp disable E2E
* Downgraded woocommerce/woocommerce-sniffs as it introduced new sniffs we should be handling on a different PR
* re-enable E2E tests
* blocks.ini fix
* revert blocks.ini fix
* Update @wordpress/env
* remove .htaccess mapping
* Fix permissions for tests
* Debug permissions
* Attempt at perm fix
* Attempt at perm fix
* Downgraded @wordpress/env
* Another attempt at upgrade @wordpress/env
* Attempt at cleaning wp-env before run
* Attempt at destroying wp-env before run. Disabled E2E.
* Attempt at destroying wp-env before run.
* debug wp-env data
* attempt at deleting wp-env data (destroy won't work due to prompt)
* re-enable E2E
* Fix deprecation warnings
* Cleaned wp-env data for E2E
* Fix perms for E2E
* Updated RateLimitsTests
* debug
* Force 7.4 for wp-env
* Run sh outside of npm
* Reverted E2E flow
* reverted wp-env-config.sh debug test
* reverted .wp-env.json phpVersion force
* Update tests/php/StoreApi/Utilities/ProductQueryFilters.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Update tests/php/StoreApi/Routes/CartExtensions.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Update tests/php/StoreApi/Routes/CartItems.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Update tests/php/StoreApi/Routes/Products.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Update tests/php/StoreApi/Routes/ProductCollectionData.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Update tests/php/StoreApi/Routes/Batch.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Update tests/php/StoreApi/Routes/Checkout.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Update tests/php/StoreApi/Routes/CartCoupons.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Update tests/php/StoreApi/Routes/ProductAttributes.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Update tests/php/StoreApi/Routes/Cart.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* downgraded @wordpress/env to v4
* Reverted back to reflection class for pivate attribs manipulation on tests
* reverted JS unit testing job name
* Update tests/php/StoreApi/Formatters/TestMoneyFormatter.php
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Typo fix
Co-authored-by: Mike Jolley <mike.jolley@me.com>
* Use backslashes to fix webpack build on windows
* Update regex to use square brackets, and update copywebpack path for Windows
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* Add PQ support for client-side.
Set up the block for PQ support and add necessary adjustments for the
editor. Will address dynamic save functionality in a following commit.
* Add dynamic render function for PQ support.
* Add dynamic render callback for SSR.
* Remove client-side Save function.
* Add PQ Context interface to shared type defs.
* Convert all block JS files to TS.
* Remove commented import from block file.
* Add typecasting to block function params.
As a workaround, added a general Record type but left a TODO to revisit
the proper object, as there is a mismatch in the shape of the default
object property types and the actual types.
* Update inserter behavior.
Allows for the ability to add the rating block from in the inserter
(as long as it's an inner block of the listed parents in the config).
Also disables the placeholder product selector from being rendered
unnecessarily (i.e., when the context ID is present).
* Update parent inner blocks config.
Reassign parent array to ancestor array which allows for blocks to be
included with more flexibility - i.e., added within groups that are
children of the ancestor block.
* Add productID to rating Attributes interface.
* TS type casting and import adustments.
Some adjustments to utilize types that we already have available, along
with some syntax adjustments and more sensible import tweaks.
* Update type-casting to use ProductResponseItem
Instead of using the generic Record, we can utilize the
ProductResponseItem interface and set an omission for the average_rating
property until that is corrected to properly reflect the API response.
* Add alias to blocks dir for imports.
Allows us to use exports from the blocks dir as "external" imports. This
way we do not need to write long, relative import paths (which can be
fragile in the long run).
* register filter wrapper block
* register block variation
* rename the active filters wrapper
* prevent 404 error
* Revert "prevent 404 error"
This reverts commit 8b6cb7c6658b2a5a99b890b67f1dce8c1c51cdbf.
* render parent wrapper block
* support price filter block
* hide the active filter block from inserter
* swap the title of wrapper and inner filter block for active filters
* hide the legacy heading for the price filter
* update block title and description for active filters and price filter
* remove heading control for price filter
* remove heading control for active filters
* update pattern
* try: upgrade button
* limit the number of inner block to 2
* prevent removing the inner filter block
* Revert "prevent removing the inner filter block"
This reverts commit 83b7feed78a7a7f50fd5799d1706faa9f2fc9050.
* convert stock filter to inner block
* refactor block upgrade button to share between filter blocks
* update default heading
* update pattern
* update icon and title
* Fix stock filter error by importing translations package
* Upgrade Active Filters name to Active Filter Controls
* Add upgrade support to price filter
* Convert attribute filter to inner block (https://github.com/woocommerce/woocommerce-blocks/pull/7101)
* wip: convert attribute filter to inner block
* fix: render inner attribute filter block on the front end
* refactor: inner block wrapper, extract the attribute parsing logic into a utility
Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>
* Set correct attribute on the new filter blocks when they are upgraded
* Use the Warning component to display the upgrade message so it is consistent with Gutenberg
* address code review
* better detect legacy block to show the upgrade notice
* rename UpgradeToolbarButton to UpgradeNotice
* add upgrade notice to the stock filter block
* rename InnerBlockWrapper to BlockWrapper
* attribute-filter: control wrapper visibility
* passing block attributes down to inner active filters control block
* fix styling of inner attribute filter control block
* passing attribute to inner price filter control block
* passing down the attribute to inner stock filter control block
* remove unneccessary parsing
* use default scope for variations
* fix default attribute values
* use default block appender
* fix: lock control blocks
* remove dynamic title code from attribute filter block
* register active filters as variation and set it to the default that overrides the base block
* fix isActive for default variation
* fix: isActive logic for the active filters block
* register side effect
* fix ts error
* e2e: fix active filters block backend test
* e2e: fix frontend active filters test
* e2e: fix attribute filter test
* e2e: fix price filter test
* e2e: fix stock filter test
* e2e: update fixture
* e2e: fix attribute filter test
* remove invalid test
* e2e: update heading selector for price filter in backend test
* e2e: fixe backend price filter heading test
* fix: patterns i18n
* fix: heading level when upgrading the block
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
* Add interactivity to the Product by Rating filter block
* Fix block with the latest repo changes
* Product by Rating: Code tidying up
* Add an experimental build gate and update block title and description
* Remove redundant title and description
* Add support for the CheckboxList component in the Products by Rating block
* Products by Rating: Minor code clean-up
* Active Filters: Fix the Clear All button for Ratings. Closes #woocommerce/woocommerce-blocks#7172
* Products by Rating: Add misc TS fixes
* Generate Inner Blocks' JSON files in a common folder
* Get the correct metadata path for the Inner Blocks
The Inner Blocks' metadata lives now in the `/build/inner-blocks`. But,
the function `get_block_metadata_path` was only looking for metadata
inside the top-level of the `build/` folder
* Move `EditorBlock` to general `type-defs`
`EditorBlock` was scoped under the `featured-items` directory at the time of its creation. It is, however, a useful type that should be shared repo-wide. For this reason, I am moving it into the `blocks` type-defs and updating all the references.
* Define types for the Product Query block
Also defines a more generic `WooCommerceBlockVariation` type which should be also useful in the future to implement a similar pattern.
* Add Product Query utils
Add two utility functions:
1. `isWooQueryBlockVariation`: is used to check whether a given block is a variation of the core Query Loop block, and also one of the allowed variations within our repo. See: `QueryVariation` enum type.
2. `setCustomQueryAttribute`: is a shorthand to set an attribute within the variation query attribute.
* Refactor and cleanup the JS demo code
Specifically:
1. Creates a `constant.ts` file to store all shared constants. Currently, the default variation attributes.
2. Move the variations to their own directory. One file per variation.
3. Move the inspector controls into own file and create a conditional logic to allow showing only certain settings.
* Update webpack config
* Add ProductQuery class
* Fix `QueryVariation` enum
We had changed the Products on Sale variation slug to something else,
but we had forgotten to update the proper enum.
* Remove unused params from `update_query`
The filter we added to Gutenberg will pass the block and the page,
as we might need them in the future and we want to minimize the
amount of changes we'll have to do upstream.
However, we currently do not use those, so I removed
them from our own inner function.
Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
* Add default page notice
* show notice all inner blocks
* support flow when page isnt saved
* switch from where we get the current post id
* update lock
* fix types
* Remove old compatibility notices from Cart and Checkout
* Move useCompatibilityNotice to sidebar-compatibility-notice directory
* Remove old CartCheckoutCompatibilityNotice
* Create sidebar compatibility notice hoc
* Add isCartOrCheckoutOrInnerBlock function
* Refactor defaultNotice to use new isCartOrCheckoutOrInnerBlock func
* Remove BlockSettings from checkout edit and export from checkout-shared
* Change so component still renders, it is just hidden with display: none
This is required because when it returns null the component gets skipped from being added to the Slot, then when it does return a component, then it gets rendered at the bottom of the Slot. By ensuring it always renders we can have it at the top all the time.
* Set the priorities of the hoc filters so compat notice renders first
* Make isCartOrCheckoutInnerBlock a hook
* Remove old compatibility notice related tests
* Remove BlockSettings from Cart
* Remove withDefaultNotice hoc
* Include DefaultNotice in compatibility notice
* Remove DefaultNotice from Checkout
* Rename withSidebarCompatibilityNotice to withSidebarNotices
This is because it includes the sidebar compatibility notice and the default notices
* Remove useIsCartOrCheckoutOrInnerBlock hook
* Remove compatibility notice code from tests
* Revert DefaultNotice back to the old one
* Remove unused components
* Remove withBlockSettings HOC and fix TS types
This is an abstraction that is no longer required, we can just include BlockSettings in the Cart and Checkout blocks
* Remove CartCheckoutFeedbackPrompt from BlockSettings
It will be included in sidebar-notices instead
* Fix TS Types in DefaultNotice
* Add BlockSettings to cart and checkout edit
* Editor: Add feedback box to the Cart & Checkout Inner Blocks (https://github.com/woocommerce/woocommerce-blocks/pull/6881)
* Show "Feedback prompt" for all inner blocks
* Fix the "feedback" notice position for these blocks
The "checkout fields", "checkout billing address" and
"checkout shipping address" have the addressFields option which
gets rerendered and placed at the bottom of the inspector controls.
* Tidy up the address-fields hoc
* Use correct block name to check for billing or shipping address
* Revert "Editor: Add feedback box to the Cart & Checkout Inner Blocks (https://github.com/woocommerce/woocommerce-blocks/pull/6881)"
This reverts commit 5f3d6cf15ce08d9c303e62ec3e0d0315ead1281f.
* Add hack to get feedback prompt to render last
* Fix TS errors for context and attributes
* Include CartCheckoutFeedbackPrompt in accountcontrols & addresscontrols
* Do not include feedback prompt if on an address block or contact info
* Remove unused hoc for address fields
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
* Try registering the "cart taxes" inner block
Registering server side. This example isn't working, but I'm pushing to
share it and see what's wrong with this implementation.
* Fix registering the cart taxes inner block issue
* Update translation script loading
* Remove unnecessary JS translation
The translation should work fine by getting the title & description from
the `block.json` file
* Put back the initial code in the 'Cart Taxes' inner block
We didn't provide the correct `block.json` file path server side,
that's why the `metadata` wasn't correctly registered
* Generate `block.json`files for inner blocks
This is the first step on fixing the missing translations of `metadata`
in `block.json` files
* Set the folder name exactly the same as the inner block name
We are doing this first test for the `Cart taxes` inner block.
The `Block` & its containing folder need to have the same name for:
- Consistency
- We use the `Block` name to get the file Path
* Update imports after folder renaming
* Get block name directly from the JSON metadata
Getting the block name from the JSON metadata is less error prone than
extracting it from the file path.
And no need to rename all our `inner-blocks` to get the correct
`block.json` path
* Revert folder naming change of `Cart taxes` inner block
Since we are getting the `block` name directly from the `block.json`
metadata instead of extracting it from the file path, there is no need
to keep their names in sync anymore
* Fix missing translations for the `Cart Subtotal` Block
* Register only the client-side settings on the client
When the block is registered on the server, you only need to register
the client-side settings on the client using the same block’s name.
See [docs](https://github.com/WordPress/gutenberg/blob/trunk/docs/reference-guides/block-api/block-metadata.md#javascript-client-side).
* Add schema validation to `block.json`
Development is improved by using a defined schema definition file.
Supported editors can provide help like tooltips, autocomplete, and
schema validation.
* Use the same `editor_script` as the parent block
This prevents WordPress from generating script tags to inexistant
inner blocks JS files
* Add C&C inner blocks in Cart.php & Checkout.php
This is a refactoring to keep the block types controller file less
overloaded
* Fix all Cart inner blocks missing translations
* Create the "AbstractInnerBlock" class
The "Inner Blocks" will use their parent's script, so no need to create
new scripts for each one of them
And, our "Inner Blocks" should always be registered using the metadata file
* Update the "Inner Blocks" PHP classes
* Fix PHP lint erros & update function description
* Fix missing translations bug for all Checkout Inner Blocks
* Update src/BlockTypes/Checkout.php
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* skip lazy loaded scripts
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* Add dry run and simulate release mode woocommerce/woocommerce-blocks#3059
Add dry run and simulate release mode
* execute more svn commands in release mode
* fix boolean
* fix command
* revert changes to webpack file
* fix loading of chunks
* revert changes to assets api as well
* include chunks from other blocks
* bail early if there is no build folder
* Start using the block.json metadata file for `Products by Tag`
* Remove comment
* Add version, schema, and text domain
* Add defaults
* Remove wrong keyword
* Add tag icon when registering the block
This PR creates a new directory called `featured-items` which includes both blocks.
All the shared code lives at the top level of that directory.
Individual blocks still have their own directories, with their `block.json` and all other relevant configuration.
All the functionalities have been refactored out into their own files, accepting configuration when relevant, but mostly de-duplicating all the code.
Styles have also been refactored using mixins and extends and they mostly live in one place.
* Start using the `block.json` metadata file for `Handpicked products`
* Add the `properties` attribute to properly parse booleans
* Remove comment
* Add schema, delete version
* Try to fix account.test.js
* Remove language installations for woo core and wp core and take screenshots
* Upload screenshots to artifacts
* npm install instead of npm ci
* Upload artifacts not matter what
* fsdf
* fsdfsf
* remove screenshoting from account.test.js and only run checkout-terms.test.js
* Print NODE_ENV
* Better handling of overriding wp-env.json
* Run all tests
* Re-enable translations for WP and Woo
* Wait for Cart & Checkout blocks to load before moving on
* Uncomment github actions
* Try to fix shipping test
* fill checkout before placing order, duuuh
* Wait until networkidel0 instead of domcontentloaded for page navigations
* Fix account.test.js
* change visitBlockPage() to use Promise.all()
* Remove screenshot taking
* I think Promise.all() is being funny and not throwing properly, testing
* wait for checkbox to be visible before clicking
* Remove try catch around Promise.all()
* Fix linting issues
* Remove screenshot dir
* Raluca feedback:
* Timeout back to 30000
* Login to merhcant before changing settings
* merchant.logout()
* Start using the `block.json` metadata file for the `Featured Category` block
* Get default attributes from the `block.json` file
* Remove unnecessary `get_block_metadata_defaults` function
* Add alt attribute to the block.json file
* Remove unused imports
* Start using the `block.json` metadata file for the `Feature Product` block
* Get default attributes from the block.json file
* Add removed comment
* Remove unnecessary `get_block_metadata_defaults` function
* Add alt default to block.json
* Enable Attribute Filter block to work with the PHP rendered Classic Template block
* Check for presence of option before rendering it
* improve filter product by attribute
* fix pagination problem
* fix check when two filter block with same attribute are used
* fix filter by stock for PHP templates
* fix naming and comment
* Update filter key in ClassicTemplate
* Update stock filter block for PHP templates when the filter button is enabled
* Remove unused useEffect and fix ESLint error
* Set active stock filter and track using local state
* ESLint fix
* Remove unncessary dependencies from useEffect
Co-authored-by: tjcafferkey <tjcafferkey@gmail.com>
* Cart & Checkout translations test use the already installed language nl_NL
* Extra timeout when checking for shipping and billing addresses
* wait for selector instead of increase timeout
* Change waitForSelector selector:
* Clean up
* Increase idleTime for waitForNetworkRequest
* Fix random timeouts and increase timeout of verifying shipping option
* feedack