<?php

/**
 * The file that defines the core plugin configurator class
 *
 * @link       https://wpconfiguratorbuilder.com
 * @since      1.0.0
 *
 * @package    wcb-configurator-builder
 * @subpackage wcb-configurator-builder/includes
 */

if ( ! defined('ABSPATH') ) {
	die();
}

use Carbon_Fields\Block;
use Carbon_Fields\Field;

$builder_tab_fields = array(
	Field::make( 'text', 'wpcb_tab_title', __( 'Tab title', 'wcb-configurator-builder' ) )
		->set_help_text( __( 'Start new tab group', 'wcb-configurator-builder' ) )
		->set_width( 50 ),
	Field::make( 'image', 'wpcb_tab_icon', __( 'Tab icon', 'wcb-configurator-builder' ) )
		->set_width( 50 ),
);
$builder_tab_fields = apply_filters( 'wpcb_builder_tab_fields', $builder_tab_fields );

Block::make( __( 'WCB Tab', 'wcb-configurator-builder' ) )
	->add_fields( $builder_tab_fields )
	->set_description( __( 'Displays a tab group in the configuration form', 'wcb-configurator-builder' ) )
	->set_keywords(['wcb', 'tab'])
	->set_icon( 'category' )
	->set_mode( 'edit' )
	->set_category( 'wpcb-layout', __( 'Layout', 'wcb-configurator-builder' ) )
	->set_inner_blocks( true )
	->set_allowed_inner_blocks( array(
		'carbon-fields/wcb-filter',
		'carbon-fields/wcb-group',
		'carbon-fields/wcb-repeater',
		'carbon-fields/wcb-choice',
		'carbon-fields/wcb-input',
		'carbon-fields/wcb-html',
		'carbon-fields/wcb-shortcode',
	) )
	->set_inner_blocks_position( 'below' )
	->set_render_callback( function ( $fields, $attributes, $inner_blocks ) {
		
		// include block partial

	});