woocommerce/plugins/woocommerce-blocks/bin/webpack-entries.js

246 lines
7.1 KiB
JavaScript
Raw Normal View History

/**
* External dependencies
*/
const { omit } = require( 'lodash' );
const glob = require( 'glob' );
// List of blocks that should be used as webpack entry points. They are expected
// to be in `/assets/js/blocks/[BLOCK_NAME]`. If they are not, their relative
// path should be defined in the `customDir` property. The scripts below will
// take care of looking for `index.js`, `frontend.js` and `*.scss` files in each
// block directory.
// If a block is experimental, it should be marked with the `isExperimental`
// property.
const blocks = {
'active-filters': {},
'add-to-cart-form': {},
'all-products': {
customDir: 'products/all-products',
},
'all-reviews': {
customDir: 'reviews/all-reviews',
},
'attribute-filter': {},
breadcrumbs: {},
cart: {},
'catalog-sorting': {},
checkout: {},
'customer-account': {},
'featured-category': {
customDir: 'featured-items/featured-category',
},
'featured-product': {
customDir: 'featured-items/featured-product',
},
'filter-wrapper': {},
'handpicked-products': {},
// We need to keep the legacy-template id, so we need to add a custom config to point to the renamed classic-template folder
'legacy-template': {
customDir: 'classic-template',
},
Refactor Cart and Checkout Page Templates (https://github.com/woocommerce/woocommerce-blocks/pull/10773) * Rename checkout template slug * Remove redirect and custom title * Classic shortcode block for checkout * Empty title * WIP placeholder * Change blockified template * Prefix cart and checkout templates with "Page: " * Template migration routine * Apply same treatment to cart template * Notices * Update placeholder text * Classic shortcodes block * Page content wrapper for templates * Update default * Do not save attributes * Update templates * Remove cart classic template * Reverted endpoints for Cart & Checkout templates. This reverts PR 9406 * Migrate page content wrapper. * Removed useless method arg. Minor tweaks. * Skip migration if the theme has a template file for this page. * Removed impossible condition. * Migrate page content wrapper. * Remove TemplateNotice in favour of DefaultNotice * Documentation links in shortcode placeholder * Hide cart and checkout page selector when using block themes * Unused var * Add tests for template changes * Revert changes to classic-template * Allow frontend redirect * Unused file * Bump version for updater * Support x template naming as well as page-x * Need to add item to cart to test checkout * Fix header test by fixing utility for adding to cart * Remove permalink tests * Click body * Wait for content to finish loading * Wait for add to cart response when adding to cart without item name * Wait for save before visiting frontend * Set content instead of inserting block * Perform test in site editor rather than page editor * Prevent notice to set the default cart/checkout page from showing on the site editor. --------- Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com> Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2023-09-19 09:58:18 +00:00
'classic-shortcode': {},
'mini-cart': {},
'mini-cart-contents': {
customDir: 'mini-cart/mini-cart-contents',
},
'store-notices': {},
Refactor Cart and Checkout Page Templates (https://github.com/woocommerce/woocommerce-blocks/pull/10773) * Rename checkout template slug * Remove redirect and custom title * Classic shortcode block for checkout * Empty title * WIP placeholder * Change blockified template * Prefix cart and checkout templates with "Page: " * Template migration routine * Apply same treatment to cart template * Notices * Update placeholder text * Classic shortcodes block * Page content wrapper for templates * Update default * Do not save attributes * Update templates * Remove cart classic template * Reverted endpoints for Cart & Checkout templates. This reverts PR 9406 * Migrate page content wrapper. * Removed useless method arg. Minor tweaks. * Skip migration if the theme has a template file for this page. * Removed impossible condition. * Migrate page content wrapper. * Remove TemplateNotice in favour of DefaultNotice * Documentation links in shortcode placeholder * Hide cart and checkout page selector when using block themes * Unused var * Add tests for template changes * Revert changes to classic-template * Allow frontend redirect * Unused file * Bump version for updater * Support x template naming as well as page-x * Need to add item to cart to test checkout * Fix header test by fixing utility for adding to cart * Remove permalink tests * Click body * Wait for content to finish loading * Wait for add to cart response when adding to cart without item name * Wait for save before visiting frontend * Set content instead of inserting block * Perform test in site editor rather than page editor * Prevent notice to set the default cart/checkout page from showing on the site editor. --------- Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com> Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2023-09-19 09:58:18 +00:00
'page-content-wrapper': {},
'price-filter': {},
'product-best-sellers': {},
'product-category': {},
'product-categories': {},
'product-collection': {},
'product-gallery': {
isExperimental: true,
},
'product-gallery-large-image': {
customDir: 'product-gallery/inner-blocks/product-gallery-large-image',
isExperimental: true,
},
'product-gallery-large-image-next-previous': {
customDir:
'product-gallery/inner-blocks/product-gallery-large-image-next-previous',
isExperimental: true,
},
Product Gallery block: Add Pager block (https://github.com/woocommerce/woocommerce-blocks/pull/10320) * 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>
2023-08-22 19:26:46 +00:00
'product-gallery-pager': {
customDir: 'product-gallery/inner-blocks/product-gallery-pager',
isExperimental: true,
},
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.
2023-08-02 07:09:51 +00:00
'product-gallery-thumbnails': {
customDir: 'product-gallery/inner-blocks/product-gallery-thumbnails',
isExperimental: true,
},
'product-new': {},
'product-on-sale': {},
'product-query': {
isExperimental: true,
},
[Blockifying Product Archive Templates] Add Results Count block (https://github.com/woocommerce/woocommerce-blocks/pull/8078) * 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>
2023-01-17 15:19:42 +00:00
'product-results-count': {},
'product-search': {},
'product-tag': {},
'product-template': {},
'product-top-rated': {},
'products-by-attribute': {},
'rating-filter': {},
'product-average-rating': {},
'product-rating-stars': {},
'product-rating-counter': {},
'reviews-by-category': {
customDir: 'reviews/reviews-by-category',
},
'reviews-by-product': {
customDir: 'reviews/reviews-by-product',
},
'collection-price-filter': {
customDir: 'collection-filters/inner-blocks/price-filter',
isExperimental: true,
},
'single-product': {},
'stock-filter': {},
'collection-filters': {
isExperimental: true,
},
Feature Branch: Blockified Order Confirmation (https://github.com/woocommerce/woocommerce-blocks/pull/10056) * Main block types for confirmation * Initial blocks * Styling and placeholders * Make blocks experimental * Update summary icon * Add name/description for status block and missing text descriptions in the block. Closes woocommerce/woocommerce-blocks#10057 * Order confirmation: Convert Order Details Templates to Blocks (https://github.com/woocommerce/woocommerce-blocks/pull/10095) * Move code from templates into the details block * Details -> Totals * Downloads block * Sample content for downloads block * Add block icon * Add conversion template (https://github.com/woocommerce/woocommerce-blocks/pull/10077) * Update inner block name * Add default title constant * Revert "Add default title constant" This reverts commit 1dd3bbfecc1be83c367b1ab064f5032ea58cb678. * Add global styles for order confirmation status block (https://github.com/woocommerce/woocommerce-blocks/pull/10164) * Implement style controls * Prevent link color spilling over onto wrapper * Add styles and remove class names * Remove __experimentalWritingMode * Add global styles for order confirmation summary block (https://github.com/woocommerce/woocommerce-blocks/pull/10179) * Styles for summary * Remove __experimentalWritingMode * Add table styles for order details (https://github.com/woocommerce/woocommerce-blocks/pull/10185) * Add table styles for order details * __experimentalFontWeight * Add link styles * Handle preview link styles * Unauthenticated views for Order Confirmation template (https://github.com/woocommerce/woocommerce-blocks/pull/10414) * Different views by permission * check user id matches when logged out * Add order confirmation wrapper block (https://github.com/woocommerce/woocommerce-blocks/pull/10286) * Add a heading wrapper block * Register the BillingWrapper Block server side * Fix exception 'render_content' error * Add the Billing Wrapper Block to the template * Fix wrong block name error * Fix php error * Conditionally render Billing Address within the Wrapper * Fix parent rendering * Clean up code (remove billing address from the template) * Update titles, descriptions, and icons of the billing Block and inner block * Fix broken block by removing the "parent" keyword * Use a user-friendly title and description for the Billing Wrapper * Update Billing Wrapper Block's title case Co-authored-by: Mike Jolley <mike.jolley@me.com> * Fix PHP failing unit test --------- Co-authored-by: Mike Jolley <mike.jolley@me.com> * Remove "thanks" for authenticated page * Introduce shipping wrapper based on billing wrapper Closes woocommerce/woocommerce-blocks#10053 * Order confirmation block: Verify email address for guest customers (https://github.com/woocommerce/woocommerce-blocks/pull/10567) * Add verify step for guest orders * Render content to pass through block content * Revert package changes * Customer orders cannot use email to verify * Add style controls for order shipping and billing address blocks (https://github.com/woocommerce/woocommerce-blocks/pull/10633) * Order confirmation block styling (https://github.com/woocommerce/woocommerce-blocks/pull/10780) * Add missing heading to order details * Summary block spacing * Update css variables * table styles * Inherit border styles for cells * Alignment and address styles * Add downloads wrapper * Style controls * Fix typo * Update Download Wrapper's Icon * Fix TS error * Disable Download Block's server side rendering in the editor This fixes the loading after each style change from the style controls * Clean up Downloads render functions * Fix client side Downloads Block's table border * Download + Total wrappers and tables styling * small screen * Remove server side render for previews --------- Co-authored-by: Saad Tarhi <saad.trh@gmail.com> * Shorten template description * Update test address data * Avoid leaking order key in permission form * Remove todo * Make email form required. * Remove edit page link * Remove empty columns from address wrapper * Remove IIFE * typo * Update description to mention billing * Adjust link scss * Fix wrapper markup and spacing controls * Add link preview in editor * Add initial E2E setup for the Order Confirmation Block (https://github.com/woocommerce/woocommerce-blocks/pull/10840) * Fix WC_DateTime check * Move form outside of block markup * Add additional information block (https://github.com/woocommerce/woocommerce-blocks/pull/10842) * Add block which contains hooks * Use skeleton for placeholder instead of illustration * Remove duplicate methods * Remove duplicate align tag * Update meta styles * Tests for order confirmation conditional blocks (https://github.com/woocommerce/woocommerce-blocks/pull/10972) * Add tests for conditional blocks * Move setup into test * Add E2E to the the Order Confirmation Block (https://github.com/woocommerce/woocommerce-blocks/pull/10863) * Add editor util functions * Update editor template E2E test * Add the "exact" property for consistency * Skip test Can't get the element in the page. More investigation needed! Skipping for now. * Fix "transformIntoBlocks" logic * Add tests for logged in user * Fix "beforeAll" config * Confirm downloads section is visible when logged in * Create "verifyOrderConfirmationDetails" util function * Add logged in test case * Add Guest user test case * Fix editor e2e testing * Apply a proper teardown * Fix failing tests after logout * Ensure we are logged in before visiting the editor * Ensure to have shipping selected * Wait for changes to be saved on the editor * Ensure shipping options is selected * Remove comment * Ensure we are logged in before going to the admin page * Mark the Order Confirmation as a side effect test * OrderConfirmation blocks are not experimental * resolve merge conflict * Revert package lock changes * Fix enqueue_assets * Fix CSS 404s * Make template tests more robust * Fix page URL for default confirmation page * Try afterEach to log back in * Skip guest/logout use cases Login out causes other tests to fail. We will implement these case when the multiple sign in roles are introduced in the codebase. * Remove tests requiring login out & add comments * Remove unused util functions * Hide confirmation blocks from post editor --------- Co-authored-by: Saad Tarhi <saad.trh@gmail.com> Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-09-20 12:56:00 +00:00
'order-confirmation-summary': {
customDir: 'order-confirmation/summary',
},
'order-confirmation-totals-wrapper': {
customDir: 'order-confirmation/totals-wrapper',
},
'order-confirmation-totals': {
customDir: 'order-confirmation/totals',
},
'order-confirmation-downloads-wrapper': {
customDir: 'order-confirmation/downloads-wrapper',
},
'order-confirmation-downloads': {
customDir: 'order-confirmation/downloads',
},
'order-confirmation-billing-address': {
customDir: 'order-confirmation/billing-address',
},
'order-confirmation-shipping-address': {
customDir: 'order-confirmation/shipping-address',
},
'order-confirmation-billing-wrapper': {
customDir: 'order-confirmation/billing-wrapper',
},
'order-confirmation-shipping-wrapper': {
customDir: 'order-confirmation/shipping-wrapper',
},
'order-confirmation-status': {
customDir: 'order-confirmation/status',
},
'order-confirmation-additional-information': {
customDir: 'order-confirmation/additional-information',
},
};
// Returns the entries for each block given a relative path (ie: `index.js`,
// `**/*.scss`...).
// It also filters out elements with undefined props and experimental blocks.
const getBlockEntries = ( relativePath ) => {
const experimental =
! parseInt( process.env.WOOCOMMERCE_BLOCKS_PHASE, 10 ) < 3;
return Object.fromEntries(
Object.entries( blocks )
.filter(
( [ , config ] ) =>
! config.isExperimental ||
config.isExperimental === experimental
)
.map( ( [ blockCode, config ] ) => {
const filePaths = glob.sync(
`./assets/js/blocks/${ config.customDir || blockCode }/` +
relativePath
);
if ( filePaths.length > 0 ) {
return [ blockCode, filePaths ];
}
return null;
} )
.filter( Boolean )
);
};
const entries = {
styling: {
// Packages styles
'packages-style': glob.sync( './packages/**/index.{t,j}s' ),
// Shared blocks code
'wc-blocks': './assets/js/index.js',
// Blocks
'product-image-gallery':
'./assets/js/atomic/blocks/product-elements/product-image-gallery/index.ts',
'product-reviews':
'./assets/js/atomic/blocks/product-elements/product-reviews/index.tsx',
'product-details':
'./assets/js/atomic/blocks/product-elements/product-details/index.tsx',
'add-to-cart-form':
'./assets/js/atomic/blocks/product-elements/add-to-cart-form/index.tsx',
...getBlockEntries( '{index,block,frontend}.{t,j}s{,x}' ),
// Templates
'wc-blocks-classic-template-revert-button-style':
'./assets/js/templates/revert-button/index.tsx',
},
core: {
wcBlocksRegistry: './assets/js/blocks-registry/index.js',
Move Block Type Settings into Block Type Classes (https://github.com/woocommerce/woocommerce-blocks/pull/4059) * BLOCK SETTINGS: Remove unused constants/settings * AssetDataRegistry: Helpers to check for settings that exist, and registering page ID/permalinks * Move checkout and cart block settings to checkout and cart blocktypes * Move isShippingCalculatorEnabled to cart block * Remove HAS_DARK_EDITOR_STYLE_SUPPORT and IS_SHIPPING_CALCULATOR_ENABLED in favour of getSetting * Move displayCartPricesIncludingTax to blocktypes, and implement getSetting * Move block settings to core settings and blocktypes * Fix namespace usage * Move review settings * move tag settings * Keep productCount in core data * Move min and default height * Improve storePages code * Move attributes to attribute filter block type * Move $word_count_type outside of settings array * Remove unneeded setting in preview data (shippingCostRequiresAddress) * Move min/max settings dependency from GridLayoutControl to Blocks themselves and use getSettings * DEFAULT_COLUMNS and ROWS to settings * Move product columns/rows to block types * Add grid settings to AllProducts block * Correct default rows * correct min rows default * Move hasDarkEditorStyleSupport * Move hideOutOfStockItems to block type settings * Move build settings to inline script dependency * Pass data through asset api and move restApiRoutes * Export all core settings as constants * Remove WORD_COUNT_TYPE from core settings * Move some other core settings to assets * Update constants * Make settings use TypeScript * Update CURRENT_USER_IS_ADMIN usage * WORD_COUNT_TYPE * REST_API_ROUTES * REVIEW_RATINGS_ENABLED and SHOW_AVATARS * Remove REVIEW_RATINGS_ENABLED and SHOW_AVATARS constants * Remove MIN_HEIGHT * Remove DEFAULT_HEIGHT * PLACEHOLDER_IMG_SRC * LIMIT_TAGS * HAS_PRODUCTS * HOME_URL * HAS_TAGS * COUPONS_ENABLED * SHIPPING_ENABLED * TAXES_ENABLED * DISPLAY_ITEMIZED_TAXES * SHIPPING_COST_REQUIRES_ADDRESS * SHIPPING_STATES and SHIPPING_COUNTRIES * STORE_PAGES * ALLOWED_COUNTRIES * ALLOWED_STATES * SHIPPING_METHODS_EXIST * PAYMENT_GATEWAY_SORT_ORDER * CHECKOUT_SHOW_LOGIN_REMINDER * CHECKOUT_ALLOWS_GUEST and CHECKOUT_ALLOWS_SIGNUP * ATTRIBUTES * DISPLAY_CART_PRICES_INCLUDING_TAX * DISPLAY_CART_PRICES_INCLUDING_TAX * update build for TS files * fix build dir * Move blocks build config params * Move placeholderImgSrc to core settings * Move rest api hydration hoc to shared hocs and provide it restApiRoutes directly to avoid asset data registration * Move wordCountType to abstract block * Remove WORD_COUNT_TYPE in favour of getSetting * Move IS_LARGE_CATALOG and PRODUCT_COUNT to abstract block type and use getSetting inline * Add wcBlocksConfig * fix tests * Remove unused $asset_data_registry * remove console.log * Move build settings to abstract block * Trigger build again * Move hydration back to regular hocs for compatibility with trunk (merge conflict) * Removed wcSharedHocsConfig * esc home url * Update search fixture * Update search snap * 40000 timeout * hasProducts -> productCount * Product Count is part of blocks config * update mocks * Use version comparison to determine if batching is enabled * Change isWpVersion * scrollTo button
2021-04-22 11:37:27 +00:00
wcSettings: './assets/js/settings/shared/index.ts',
wcBlocksData: './assets/js/data/index.ts',
wcBlocksMiddleware: './assets/js/middleware/index.js',
wcBlocksSharedContext: './assets/js/shared/context/index.js',
wcBlocksSharedHocs: './assets/js/shared/hocs/index.js',
priceFormat: './packages/prices/index.js',
blocksCheckout: './packages/checkout/index.js',
blocksComponents: './packages/components/index.ts',
},
main: {
// Shared blocks code
'wc-blocks': './assets/js/index.js',
// Blocks
...getBlockEntries( 'index.{t,j}s{,x}' ),
},
frontend: {
reviews: './assets/js/blocks/reviews/frontend.ts',
...getBlockEntries( 'frontend.{t,j}s{,x}' ),
'mini-cart-component':
'./assets/js/blocks/mini-cart/component-frontend.tsx',
Interactivity API and Product Button (https://github.com/woocommerce/woocommerce-blocks/pull/10006) * 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. Fixes woocommerce/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>
2023-08-10 14:02:33 +00:00
'product-button-interactivity':
'./assets/js/atomic/blocks/product-elements/button/frontend.tsx',
},
payments: {
'wc-payment-method-cheque':
'./assets/js/extensions/payment-methods/cheque/index.js',
'wc-payment-method-paypal':
'./assets/js/extensions/payment-methods/paypal/index.js',
'wc-payment-method-bacs':
'./assets/js/extensions/payment-methods/bacs/index.js',
'wc-payment-method-cod':
'./assets/js/extensions/payment-methods/cod/index.js',
},
extensions: {
'wc-blocks-google-analytics':
'./assets/js/extensions/google-analytics/index.ts',
'wc-shipping-method-pickup-location':
'./assets/js/extensions/shipping-methods/pickup-location/index.js',
'wc-blocks-jetpack-woocommerce-analytics':
'./assets/js/extensions/jetpack/woocommerce-analytics/index.ts',
},
editor: {
'wc-blocks-classic-template-revert-button':
'./assets/js/templates/revert-button/index.tsx',
},
};
const getEntryConfig = ( type = 'main', exclude = [] ) => {
return omit( entries[ type ], exclude );
};
module.exports = {
getEntryConfig,
};