Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Expose withFilteredAttributes to extensions #5058

Merged
merged 1 commit into from
Nov 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;