version = $data['version'] ?? '0.0';
$this->styles = $data['styles'] ?? [];
$this->editor_settings = $data['editor_settings'] ?? [];
}
abstract protected function define_atomic_controls(): array;
public function get_global_scripts() {
return [];
}
final public function get_initial_config() {
$config = parent::get_initial_config();
$props_schema = static::get_props_schema();
$config['atomic_controls'] = $this->get_atomic_controls();
$config['atomic_props_schema'] = $props_schema;
$config['dependencies_per_target_mapping'] = Dependency_Manager::get_source_to_dependents( $props_schema );
$config['base_styles'] = $this->get_base_styles();
$config['version'] = $this->version;
$config['show_in_panel'] = $this->should_show_in_panel();
$config['categories'] = [ 'v4-elements' ];
$config['hide_on_search'] = false;
$config['controls'] = [];
$config['keywords'] = $this->get_keywords();
$config['default_children'] = $this->define_default_children();
$config['initial_attributes'] = $this->define_initial_attributes();
$config['include_in_widgets_config'] = true;
$config['default_html_tag'] = $this->define_default_html_tag();
return $config;
}
protected function should_show_in_panel() {
return true;
}
protected function define_default_children() {
return [];
}
protected function define_default_html_tag() {
return 'div';
}
protected function define_initial_attributes() {
return [];
}
/**
* Get Element keywords.
*
* Retrieve the element keywords.
*
* @since 3.29
* @access public
*
* @return array Element keywords.
*/
public function get_keywords() {
return [];
}
/**
* @return array