2023-07-03 14:21:31 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { registerBlockSingleProductTemplate } from '@woocommerce/atomic-utils';
|
|
|
|
import { isExperimentalBuild } from '@woocommerce/block-settings';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2023-08-02 07:09:51 +00:00
|
|
|
import { Edit } from './edit';
|
|
|
|
import { Save } from './save';
|
2023-07-03 14:21:31 +00:00
|
|
|
import metadata from './block.json';
|
|
|
|
import icon from './icon';
|
2023-09-15 08:54:49 +00:00
|
|
|
import './style.scss';
|
2023-09-21 11:31:16 +00:00
|
|
|
import './inner-blocks/product-gallery-large-image';
|
2023-08-28 16:32:45 +00:00
|
|
|
import './inner-blocks/product-gallery-large-image-next-previous';
|
2023-08-22 19:26:46 +00:00
|
|
|
import './inner-blocks/product-gallery-pager';
|
2023-08-02 07:09:51 +00:00
|
|
|
import './inner-blocks/product-gallery-thumbnails';
|
2023-07-03 14:21:31 +00:00
|
|
|
|
|
|
|
if ( isExperimentalBuild() ) {
|
|
|
|
registerBlockSingleProductTemplate( {
|
|
|
|
blockName: metadata.name,
|
2023-08-02 07:09:51 +00:00
|
|
|
// @ts-expect-error: `metadata` currently does not have a type definition in WordPress core
|
2023-07-03 14:21:31 +00:00
|
|
|
blockMetadata: metadata,
|
|
|
|
blockSettings: {
|
|
|
|
icon,
|
2023-08-02 07:09:51 +00:00
|
|
|
// @ts-expect-error `edit` can be extended to include other attributes
|
2023-07-03 14:21:31 +00:00
|
|
|
edit: Edit,
|
|
|
|
save: Save,
|
|
|
|
},
|
2023-07-06 15:08:39 +00:00
|
|
|
isAvailableOnPostEditor: true,
|
2023-07-03 14:21:31 +00:00
|
|
|
} );
|
|
|
|
}
|