<?php

function signify_blocks_masonry_block_assets()
{
	$script_asset = require get_theme_file_path() . '/inc/blocks/dist/masonry.asset.php';

	wp_enqueue_script(
		'signify-blocks-pro-masonry-script-front',
		get_theme_file_uri() . '/inc/blocks/dist/masonry-front.js',
		array('wp-element'),
		'0.0.1',
		true
	);

	wp_enqueue_script(
		'signify-blocks-pro-masonry-script',
		get_theme_file_uri() . '/inc/blocks/dist/masonry.js',
		isset($script_asset['dependencies']) ? $script_asset['dependencies'] : array(),
		'0.0.1',
		false
	);

	wp_register_style(
		'signify-blocks-pro-masonry-style',
		get_theme_file_uri() . '/inc/blocks/dist/style-masonry.css',
		array(),
		'0.0.1',
		'all'
	);

	wp_register_style(
		'signify-blocks-pro-masonry-editor-style',
		get_theme_file_uri() . '/inc/blocks/dist/masonry.css',
		array(),
		'0.0.1',
		'all'
	);

	register_block_type_from_metadata(__DIR__, array());
}

add_action('init', 'signify_blocks_masonry_block_assets');
