Skip to content

Commit

Permalink
fix compiling blockers
Browse files Browse the repository at this point in the history
  • Loading branch information
retrofox committed Feb 28, 2024
1 parent fc13b91 commit 73fce83
Showing 1 changed file with 22 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { parse, synchronizeBlocksWithTemplate } from '@wordpress/blocks';
import { parse } from '@wordpress/blocks';
import {
createElement,
useMemo,
Expand All @@ -12,12 +12,9 @@ import { useDispatch, useSelect, select as WPSelect } from '@wordpress/data';
import { uploadMedia } from '@wordpress/media-utils';
import { PluginArea } from '@wordpress/plugins';
import { __ } from '@wordpress/i18n';
// @ts-expect-error -- No types for this exist yet.
import { useLayoutTemplate } from '@woocommerce/block-templates';
import { Product } from '@woocommerce/data';
// @ts-expect-error -- No types for this exist yet.
// eslint-disable-next-line @woocommerce/dependency-group
import { store as coreStore } from '@wordpress/core-data';
import {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore No types for this exist yet.
Expand All @@ -33,6 +30,9 @@ import {
// It doesn't seem to notice the External dependency block whn @ts-ignore is added.
// eslint-disable-next-line @woocommerce/dependency-group
import {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore No types for this exist yet.
store as coreStore,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore store should be included.
useEntityBlockEditor,
Expand Down Expand Up @@ -80,15 +80,17 @@ export function BlockEditor( {
}, [] );

const productFormTemplates = useSelect( ( select ) => {
// @ts-expect-error No types for this exist yet.
return select( coreStore ).getEntityRecords(
'postType',
'wp_template_part',
{
area: 'product-form',
post_type: 'wp_template_part',
}
) || [];
return (
// @ts-expect-error No types for this exist yet.
select( coreStore ).getEntityRecords(
'postType',
'wp_template_part',
{
area: 'product-form',
post_type: 'wp_template_part',
}
) || []
);
}, [] );

/**
Expand Down Expand Up @@ -179,7 +181,13 @@ export function BlockEditor( {
// the blocks by calling onChange.
//
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [ layoutTemplate, settings, productTemplate, productId, productFormTemplates ] );
}, [
layoutTemplate,
settings,
productTemplate,
productId,
productFormTemplates,
] );

// Check if the Modal editor is open from the store.
const isModalEditorOpen = useSelect( ( select ) => {
Expand Down

0 comments on commit 73fce83

Please sign in to comment.