<?php
/**
 * Block styles.
 *
 * @package nas-construction-lite
 * @since 1.0.0
 */

/**
 * Register block styles
 *
 * @since 1.0.0
 *
 * @return void
 */
function nas_construction_lite_register_block_styles() {

	register_block_style( // phpcs:ignore WPThemeReview.PluginTerritory.ForbiddenFunctions.editor_blocks_register_block_style
		'core/button',
		array(
			'name'  => 'nas-construction-lite-flat-button',
			'label' => __( 'Flat button', 'nas-construction-lite' ),
		)
	);

	register_block_style( // phpcs:ignore WPThemeReview.PluginTerritory.ForbiddenFunctions.editor_blocks_register_block_style
		'core/list',
		array(
			'name'  => 'nas-construction-lite-list-underline',
			'label' => __( 'Underlined list items', 'nas-construction-lite' ),
		)
	);

	register_block_style( // phpcs:ignore WPThemeReview.PluginTerritory.ForbiddenFunctions.editor_blocks_register_block_style
		'core/group',
		array(
			'name'  => 'nas-construction-lite-box-shadow',
			'label' => __( 'Box shadow', 'nas-construction-lite' ),
		)
	);

	register_block_style( // phpcs:ignore WPThemeReview.PluginTerritory.ForbiddenFunctions.editor_blocks_register_block_style
		'core/column',
		array(
			'name'  => 'nas-construction-lite-box-shadow',
			'label' => __( 'Box shadow', 'nas-construction-lite' ),
		)
	);

	register_block_style( // phpcs:ignore WPThemeReview.PluginTerritory.ForbiddenFunctions.editor_blocks_register_block_style
		'core/columns',
		array(
			'name'  => 'nas-construction-lite-box-shadow',
			'label' => __( 'Box shadow', 'nas-construction-lite' ),
		)
	);

	register_block_style( // phpcs:ignore WPThemeReview.PluginTerritory.ForbiddenFunctions.editor_blocks_register_block_style
		'core/details',
		array(
			'name'  => 'nas-construction-lite-plus',
			'label' => __( 'Plus & minus', 'nas-construction-lite' ),
		)
	);
}
add_action( 'init', 'nas_construction_lite_register_block_styles' );

/**
 * This is an example of how to unregister a core block style.
 *
 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-styles/
 * @see https://github.com/WordPress/gutenberg/pull/37580
 *
 * @since 1.0.0
 *
 * @return void
 */
function nas_construction_lite_unregister_block_style() {
	wp_enqueue_script(
		'nas-construction-lite-unregister',
		get_stylesheet_directory_uri() . '/assets/js/unregister.js',
		array( 'wp-blocks', 'wp-dom-ready', 'wp-edit-post' ),
		NAS_CONSTRUCTION_LITE_VERSION,
		true
	);
}
add_action( 'enqueue_block_editor_assets', 'nas_construction_lite_unregister_block_style' );
