Skip to content

Commit

Permalink
expose with-filtered-attributes (woocommerce#5058)
Browse files Browse the repository at this point in the history
  • Loading branch information
senadir authored and jonny-bull committed Dec 16, 2021
1 parent 2f7658a commit dbc6d86
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import withFilteredAttributes from '@woocommerce/base-hocs/with-filtered-attributes';
import { withFilteredAttributes } from '@woocommerce/shared-hocs';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion assets/js/atomic/blocks/product-elements/image/frontend.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import withFilteredAttributes from '@woocommerce/base-hocs/with-filtered-attributes';
import { withFilteredAttributes } from '@woocommerce/shared-hocs';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion assets/js/atomic/blocks/product-elements/title/frontend.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import withFilteredAttributes from '@woocommerce/base-hocs/with-filtered-attributes';
import { withFilteredAttributes } from '@woocommerce/shared-hocs';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import withFilteredAttributes from '@woocommerce/base-hocs/with-filtered-attributes';
import { withFilteredAttributes } from '@woocommerce/shared-hocs';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import withFilteredAttributes from '@woocommerce/base-hocs/with-filtered-attributes';
import { withFilteredAttributes } from '@woocommerce/shared-hocs';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import withFilteredAttributes from '@woocommerce/base-hocs/with-filtered-attributes';
import { withFilteredAttributes } from '@woocommerce/shared-hocs';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import classnames from 'classnames';
import withFilteredAttributes from '@woocommerce/base-hocs/with-filtered-attributes';
import { withFilteredAttributes } from '@woocommerce/shared-hocs';
import { FormStep } from '@woocommerce/base-components/cart-checkout';
import { useCheckoutContext } from '@woocommerce/base-context';
import { useCheckoutAddress } from '@woocommerce/base-context/hooks';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import classnames from 'classnames';
import withFilteredAttributes from '@woocommerce/base-hocs/with-filtered-attributes';
import { withFilteredAttributes } from '@woocommerce/shared-hocs';
import { FormStep } from '@woocommerce/base-components/cart-checkout';
import { useCheckoutContext } from '@woocommerce/base-context';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import classnames from 'classnames';
import { useStoreCart, useEmitResponse } from '@woocommerce/base-context/hooks';
import withFilteredAttributes from '@woocommerce/base-hocs/with-filtered-attributes';
import { withFilteredAttributes } from '@woocommerce/shared-hocs';
import { FormStep } from '@woocommerce/base-components/cart-checkout';
import {
useCheckoutContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import classnames from 'classnames';
import withFilteredAttributes from '@woocommerce/base-hocs/with-filtered-attributes';
import { withFilteredAttributes } from '@woocommerce/shared-hocs';
import { FormStep } from '@woocommerce/base-components/cart-checkout';
import { useCheckoutContext } from '@woocommerce/base-context';
import { useCheckoutAddress } from '@woocommerce/base-context/hooks';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import classnames from 'classnames';
import withFilteredAttributes from '@woocommerce/base-hocs/with-filtered-attributes';
import { withFilteredAttributes } from '@woocommerce/shared-hocs';
import { FormStep } from '@woocommerce/base-components/cart-checkout';
import { useCheckoutContext } from '@woocommerce/base-context';
import { useCheckoutAddress } from '@woocommerce/base-context/hooks';
Expand Down
1 change: 1 addition & 0 deletions assets/js/shared/hocs/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './with-product-data-context';
export * from './with-filtered-attributes';
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import { getValidBlockAttributes } from '@woocommerce/base-utils';
*
* @param {Object} blockAttributes Component being wrapped.
*/
const withFilteredAttributes = ( blockAttributes ) => ( OriginalComponent ) => {
export const withFilteredAttributes = ( blockAttributes ) => (
OriginalComponent
) => {
return ( ownProps ) => {
const validBlockAttributes = getValidBlockAttributes(
blockAttributes,
Expand All @@ -20,5 +22,3 @@ const withFilteredAttributes = ( blockAttributes ) => ( OriginalComponent ) => {
);
};
};

export default withFilteredAttributes;

0 comments on commit dbc6d86

Please sign in to comment.