[Experimental] Update folder structure for new product filter blocks (#51029)

This commit is contained in:
Tung Du 2024-08-29 22:23:40 +07:00 committed by GitHub
parent 84e689d8a4
commit cd638721f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
82 changed files with 26 additions and 18 deletions

View File

@ -6,7 +6,7 @@ import { store, getContext } from '@woocommerce/interactivity';
/**
* Internal dependencies
*/
import { navigate } from '../../frontend';
import { navigate } from '../product-filter/frontend';
type ActiveFiltersContext = {
queryId: number;

View File

@ -8,7 +8,7 @@ import { HTMLElementEvent } from '@woocommerce/types';
/**
* Internal dependencies
*/
import { navigate } from '../../frontend';
import { navigate } from '../product-filter/frontend';
type AttributeFilterContext = {
attributeSlug: string;

View File

@ -6,7 +6,7 @@ import { store, getContext } from '@woocommerce/interactivity';
/**
* Internal dependencies
*/
import { navigate } from '../../frontend';
import { navigate } from '../product-filter/frontend';
const getQueryParams = ( e: Event ) => {
const filterNavContainer = ( e.target as HTMLElement )?.closest(

View File

@ -16,8 +16,8 @@ import type {
BlockContext,
BlockVariationTriggerType,
} from './types';
import { default as productFiltersIcon } from '../product-filters/icon';
import { BlockOverlayAttribute as ProductFiltersBlockOverlayAttribute } from '../product-filters/constants';
import { default as productFiltersIcon } from '../../icon';
import { BlockOverlayAttribute as ProductFiltersBlockOverlayAttribute } from '../../constants';
import './editor.scss';
import { Inspector } from './inspector-controls';

View File

@ -1,7 +1,7 @@
/**
* Internal dependencies
*/
import { BlockOverlayAttributeOptions as ProductFiltersBlockOverlayAttributeOptions } from '../product-filters/types';
import { BlockOverlayAttributeOptions as ProductFiltersBlockOverlayAttributeOptions } from '../../types';
type BorderRadius = {
bottomLeft: string;

View File

@ -9,7 +9,7 @@ import { debounce } from '@woocommerce/base-utils';
/**
* Internal dependencies
*/
import { navigate } from '../../frontend';
import { navigate } from '../product-filter/frontend';
import type { PriceFilterContext, PriceFilterStore } from './types';
const getUrl = ( context: PriceFilterContext ) => {

View File

@ -8,7 +8,7 @@ import { DropdownContext } from '@woocommerce/interactivity-components/dropdown'
/**
* Internal dependencies
*/
import { navigate } from '../../frontend';
import { navigate } from '../product-filter/frontend';
function getUrl( filters: Array< string | null > ) {
filters = filters.filter( Boolean );

View File

@ -9,7 +9,7 @@ import { CheckboxListContext } from '@woocommerce/interactivity-components/check
/**
* Internal dependencies
*/
import { navigate } from '../../frontend';
import { navigate } from '../product-filter/frontend';
const getUrl = ( activeFilters: string ) => {
const url = new URL( window.location.href );

View File

@ -85,40 +85,43 @@ const blocks = {
},
'single-product': {},
'stock-filter': {},
'product-filter': {
isExperimental: true,
},
'product-filters': {
isExperimental: true,
},
'product-filter': {
isExperimental: true,
customDir: 'product-filters/inner-blocks/product-filter',
},
'product-filters-overlay': {
isExperimental: true,
customDir: 'product-filters/inner-blocks/overlay',
},
'product-filters-overlay-navigation': {
isExperimental: true,
customDir: 'product-filters/inner-blocks/overlay-navigation',
},
'product-filter-stock-status': {
isExperimental: true,
customDir: 'product-filter/inner-blocks/stock-filter',
customDir: 'product-filters/inner-blocks/stock-filter',
},
'product-filter-price': {
customDir: 'product-filter/inner-blocks/price-filter',
customDir: 'product-filters/inner-blocks/price-filter',
isExperimental: true,
},
'product-filter-attribute': {
customDir: 'product-filter/inner-blocks/attribute-filter',
customDir: 'product-filters/inner-blocks/attribute-filter',
isExperimental: true,
},
'product-filter-rating': {
customDir: 'product-filter/inner-blocks/rating-filter',
customDir: 'product-filters/inner-blocks/rating-filter',
isExperimental: true,
},
'product-filter-active': {
customDir: 'product-filter/inner-blocks/active-filters',
customDir: 'product-filters/inner-blocks/active-filters',
isExperimental: true,
},
'product-filter-clear-button': {
customDir: 'product-filter/inner-blocks/clear-button',
customDir: 'product-filters/inner-blocks/clear-button',
isExperimental: true,
},
'order-confirmation-summary': {

View File

@ -0,0 +1,5 @@
Significance: patch
Type: update
Comment: Update the folder structure of new filter blocks.