PluginProbe
Elementor Website Builder – more than just a page builder / 3.31.2
Elementor Website Builder – more than just a page builder v3.31.2
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / modules / atomic-widgets / elements / atomic-widget-base.php

atomic-widget-base.php in Elementor Website Builder – more than just a page builder 3.31.2, at modules/atomic-widgets/elements/atomic-widget-base.php

62 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor\Modules\AtomicWidgets\Elements;
3
4 use Elementor\Modules\AtomicWidgets\PropDependencies\Manager as Dependency_Manager;
5 use Elementor\Modules\AtomicWidgets\PropTypes\Contracts\Prop_Type;
6 use Elementor\Widget_Base;
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit; // Exit if accessed directly.
10 }
11
12 abstract class Atomic_Widget_Base extends Widget_Base {
13 use Has_Atomic_Base;
14
15 protected $version = '0.0';
16 protected $styles = [];
17 protected $editor_settings = [];
18
19 public function __construct( $data = [], $args = null ) {
20 parent::__construct( $data, $args );
21
22 $this->version = $data['version'] ?? '0.0';
23 $this->styles = $data['styles'] ?? [];
24 $this->editor_settings = $data['editor_settings'] ?? [];
25 }
26
27 abstract protected function define_atomic_controls(): array;
28
29 public function get_global_scripts() {
30 return [];
31 }
32
33 public function get_initial_config() {
34 $config = parent::get_initial_config();
35 $props_schema = static::get_props_schema();
36
37 $config['atomic'] = true;
38 $config['atomic_controls'] = $this->get_atomic_controls();
39 $config['base_styles'] = $this->get_base_styles();
40 $config['base_styles_dictionary'] = $this->get_base_styles_dictionary();
41 $config['atomic_props_schema'] = $props_schema;
42 $config['dependencies_per_target_mapping'] = Dependency_Manager::get_source_to_dependents( $props_schema );
43 $config['version'] = $this->version;
44
45 return $config;
46 }
47
48 public function get_categories(): array {
49 return [ 'v4-elements' ];
50 }
51 /**
52 * TODO: Removes the wrapper div from the widget.
53 */
54 public function before_render() {}
55 public function after_render() {}
56
57 /**
58 * @return array<string, Prop_Type>
59 */
60 abstract protected static function define_props_schema(): array;
61 }
62