diff --git a/assets/js/base/components/cart-checkout/totals/discount/index.tsx b/assets/js/base/components/cart-checkout/totals/discount/index.tsx index 4909c5ecd59..1f6cedc75d6 100644 --- a/assets/js/base/components/cart-checkout/totals/discount/index.tsx +++ b/assets/js/base/components/cart-checkout/totals/discount/index.tsx @@ -3,7 +3,7 @@ */ import { __, sprintf } from '@wordpress/i18n'; import LoadingMask from '@woocommerce/base-components/loading-mask'; -import { RemovableChip } from '@woocommerce/base-components/chip'; +import { RemovableChip } from '@woocommerce/blocks-components'; import { applyCheckoutFilter, TotalsItem } from '@woocommerce/blocks-checkout'; import { getSetting } from '@woocommerce/settings'; import { diff --git a/assets/js/base/components/index.ts b/assets/js/base/components/index.ts index 203121ebbbb..8326cd1bccd 100644 --- a/assets/js/base/components/index.ts +++ b/assets/js/base/components/index.ts @@ -1,7 +1,6 @@ export * from './block-error-boundary'; export * from './button'; export * from './cart-checkout'; -export * from './chip'; export * from './combobox'; export * from './country-input'; export * from './drawer'; diff --git a/assets/js/blocks/active-filters/utils.tsx b/assets/js/blocks/active-filters/utils.tsx index c35be234a14..fc11d5f441e 100644 --- a/assets/js/blocks/active-filters/utils.tsx +++ b/assets/js/blocks/active-filters/utils.tsx @@ -3,7 +3,7 @@ */ import { __, sprintf } from '@wordpress/i18n'; import { formatPrice } from '@woocommerce/price-format'; -import { RemovableChip } from '@woocommerce/base-components/chip'; +import { RemovableChip } from '@woocommerce/blocks-components'; import Label from '@woocommerce/base-components/label'; import { getQueryArgs, addQueryArgs, removeQueryArgs } from '@wordpress/url'; import { changeUrl } from '@woocommerce/utils'; diff --git a/assets/js/blocks/migration-products-to-product-collection/migration-from-product-collection-to-products.ts b/assets/js/blocks/migration-products-to-product-collection/migration-from-product-collection-to-products.ts index 722969f2d59..6c55cf0d981 100644 --- a/assets/js/blocks/migration-products-to-product-collection/migration-from-product-collection-to-products.ts +++ b/assets/js/blocks/migration-products-to-product-collection/migration-from-product-collection-to-products.ts @@ -35,7 +35,6 @@ const mapAttributes = ( attributes ) => { woocommerceOnSale, woocommerceHandPickedProducts, taxQuery, - parents, isProductCollectionBlock, ...restQuery } = query; diff --git a/assets/js/blocks/migration-products-to-product-collection/migration-from-products-to-product-collection.ts b/assets/js/blocks/migration-products-to-product-collection/migration-from-products-to-product-collection.ts index dca5dd9d6d2..c617a6f4a01 100644 --- a/assets/js/blocks/migration-products-to-product-collection/migration-from-products-to-product-collection.ts +++ b/assets/js/blocks/migration-products-to-product-collection/migration-from-products-to-product-collection.ts @@ -49,7 +49,6 @@ const mapAttributes = ( attributes: Record< string, unknown > ) => { woocommerceOnSale: __woocommerceOnSale, woocommerceHandPickedProducts: include, taxQuery: {}, - parents: [], isProductCollectionBlock: true, ...restQuery, }, diff --git a/assets/js/blocks/product-collection/constants.ts b/assets/js/blocks/product-collection/constants.ts index daf227d046e..5647db7c99d 100644 --- a/assets/js/blocks/product-collection/constants.ts +++ b/assets/js/blocks/product-collection/constants.ts @@ -43,10 +43,8 @@ export const DEFAULT_QUERY: ProductCollectionQuery = { author: '', search: '', exclude: [], - sticky: '', inherit: null, taxQuery: {}, - parents: [], isProductCollectionBlock: true, woocommerceOnSale: false, woocommerceStockStatus: getDefaultStockStatuses(), diff --git a/assets/js/blocks/product-collection/types.ts b/assets/js/blocks/product-collection/types.ts index e42b77fffc6..1b27dee172f 100644 --- a/assets/js/blocks/product-collection/types.ts +++ b/assets/js/blocks/product-collection/types.ts @@ -35,11 +35,9 @@ export interface ProductCollectionQuery { order: TProductCollectionOrder; orderBy: TProductCollectionOrderBy; pages: number; - parents: number[]; perPage: number; postType: string; search: string; - sticky: string; taxQuery: Record< string, number[] >; woocommerceOnSale: boolean; /** diff --git a/assets/js/blocks/product-template/edit.tsx b/assets/js/blocks/product-template/edit.tsx index c60354a9035..2009d769ebc 100644 --- a/assets/js/blocks/product-template/edit.tsx +++ b/assets/js/blocks/product-template/edit.tsx @@ -80,10 +80,8 @@ const ProductTemplateEdit = ( { author, search, exclude, - sticky, inherit, taxQuery, - parents, pages, ...restQueryArgs }, @@ -165,15 +163,6 @@ const ProductTemplateEdit = ( { if ( exclude?.length ) { query.exclude = exclude; } - if ( parents?.length ) { - query.parent = parents; - } - // If sticky is not set, it will return all products in the results. - // If sticky is set to `only`, it will limit the results to sticky products only. - // If it is anything else, it will exclude sticky products from results. For the record the value stored is `exclude`. - if ( sticky ) { - query.sticky = sticky === 'only'; - } // If `inherit` is truthy, adjust conditionally the query to create a better preview. if ( inherit ) { if ( templateCategory ) { @@ -200,11 +189,9 @@ const ProductTemplateEdit = ( { search, postType, exclude, - sticky, inherit, templateSlug, taxQuery, - parents, restQueryArgs, ] ); diff --git a/assets/js/base/components/chip/chip.tsx b/packages/components/chip/chip.tsx similarity index 100% rename from assets/js/base/components/chip/chip.tsx rename to packages/components/chip/chip.tsx diff --git a/assets/js/base/components/chip/index.ts b/packages/components/chip/index.ts similarity index 100% rename from assets/js/base/components/chip/index.ts rename to packages/components/chip/index.ts diff --git a/assets/js/base/components/chip/removable-chip.tsx b/packages/components/chip/removable-chip.tsx similarity index 100% rename from assets/js/base/components/chip/removable-chip.tsx rename to packages/components/chip/removable-chip.tsx diff --git a/assets/js/base/components/chip/stories/chip.stories.tsx b/packages/components/chip/stories/chip.stories.tsx similarity index 100% rename from assets/js/base/components/chip/stories/chip.stories.tsx rename to packages/components/chip/stories/chip.stories.tsx diff --git a/assets/js/base/components/chip/stories/removable-chip.stories.tsx b/packages/components/chip/stories/removable-chip.stories.tsx similarity index 100% rename from assets/js/base/components/chip/stories/removable-chip.stories.tsx rename to packages/components/chip/stories/removable-chip.stories.tsx diff --git a/assets/js/base/components/chip/style.scss b/packages/components/chip/style.scss similarity index 100% rename from assets/js/base/components/chip/style.scss rename to packages/components/chip/style.scss diff --git a/assets/js/base/components/chip/test/__snapshots__/index.js.snap b/packages/components/chip/test/__snapshots__/index.js.snap similarity index 100% rename from assets/js/base/components/chip/test/__snapshots__/index.js.snap rename to packages/components/chip/test/__snapshots__/index.js.snap diff --git a/assets/js/base/components/chip/test/index.js b/packages/components/chip/test/index.js similarity index 100% rename from assets/js/base/components/chip/test/index.js rename to packages/components/chip/test/index.js diff --git a/packages/components/index.js b/packages/components/index.js index 4293e92612b..599ab85acc2 100644 --- a/packages/components/index.js +++ b/packages/components/index.js @@ -1 +1,2 @@ export { default as CheckboxList } from './checkbox-list'; +export { Chip, RemovableChip } from './chip'; diff --git a/src/BlockTypes/CollectionFilters.php b/src/BlockTypes/CollectionFilters.php index 5db863e88b3..e00d4ef4fa2 100644 --- a/src/BlockTypes/CollectionFilters.php +++ b/src/BlockTypes/CollectionFilters.php @@ -234,7 +234,6 @@ function( $key ) use ( $query, &$params ) { $mapped_params = array( 'orderBy' => 'orderby', 'pages' => 'page', - 'parents' => 'parent', 'perPage' => 'per_page', 'woocommerceStockStatus' => 'stock_status', 'woocommerceOnSale' => 'on_sale',