| 1 |
<?php |
| 2 |
namespace YayMail\Elements; |
| 3 |
|
| 4 |
use YayMail\Abstracts\BaseElement; |
| 5 |
use YayMail\Utils\SingletonTrait; |
| 6 |
|
| 7 |
/** |
| 8 |
* Container Elements |
| 9 |
*/ |
| 10 |
class Container extends BaseElement { |
| 11 |
|
| 12 |
use SingletonTrait; |
| 13 |
|
| 14 |
protected static $type = 'container'; |
| 15 |
|
| 16 |
public $available_email_ids = []; |
| 17 |
|
| 18 |
public static function get_data( $attributes = [] ) { |
| 19 |
self::$icon = '<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| 20 |
<path d="M15 0.699951H3C1.5 0.699951 0.199997 1.99995 0.199997 3.49995V15.5C0.199997 17 1.4 18.2999 3 18.2999H15C16.5 18.2999 17.8 17.1 17.8 15.5V3.49995C17.8 1.99995 16.5 0.699951 15 0.699951ZM1.8 3.49995C1.8 2.79995 2.4 2.29995 3 2.29995H8.2V6.09995H1.8V3.49995ZM3 16.7C2.3 16.7 1.8 16.1 1.8 15.5V7.59995H8.3V16.7H3ZM16.2 15.5C16.2 16.2 15.6 16.7 15 16.7H9.8V2.29995H15C15.7 2.29995 16.2 2.89995 16.2 3.49995V15.5Z"/> |
| 21 |
</svg> |
| 22 |
'; |
| 23 |
|
| 24 |
return [ |
| 25 |
'id' => uniqid(), |
| 26 |
'type' => self::$type, |
| 27 |
'name' => __( 'Container', 'yaymail' ), |
| 28 |
'icon' => self::$icon, |
| 29 |
'group' => 'general', |
| 30 |
'available' => false, |
| 31 |
'disabled_reason' => [ |
| 32 |
'html' => __( 'This element is available in YayMail Pro', 'yaymail' ), |
| 33 |
], |
| 34 |
'position' => 145, |
| 35 |
'children' => isset( $attributes['children'] ) ? $attributes['children'] : [], |
| 36 |
'status_info' => [ |
| 37 |
'text' => __( 'New', 'yaymail' ), |
| 38 |
], |
| 39 |
'data' => [ |
| 40 |
'padding' => [ |
| 41 |
'value_path' => 'padding', |
| 42 |
'component' => 'Spacing', |
| 43 |
'title' => __( 'Padding', 'yaymail' ), |
| 44 |
'default_value' => isset( $attributes['padding'] ) ? $attributes['padding'] : [ |
| 45 |
'top' => '15', |
| 46 |
'right' => '50', |
| 47 |
'bottom' => '15', |
| 48 |
'left' => '50', |
| 49 |
], |
| 50 |
'type' => 'style', |
| 51 |
], |
| 52 |
'background_color' => [ |
| 53 |
'value_path' => 'background_color', |
| 54 |
'component' => 'Color', |
| 55 |
'title' => __( 'Background color', 'yaymail' ), |
| 56 |
'default_value' => isset( $attributes['background_color'] ) ? $attributes['background_color'] : '#fff', |
| 57 |
'type' => 'style', |
| 58 |
], |
| 59 |
'background_image' => [ |
| 60 |
'value_path' => 'background_image', |
| 61 |
'component' => 'BackgroundImage', |
| 62 |
'title' => __( 'Background image', 'yaymail' ), |
| 63 |
'default_value' => isset( $attributes['background_image'] ) ? $attributes['background_image'] : [ |
| 64 |
'url' => '', |
| 65 |
'position' => 'default', |
| 66 |
'x_position' => 0, |
| 67 |
'y_position' => 0, |
| 68 |
'repeat' => 'default', |
| 69 |
'size' => 'default', |
| 70 |
], |
| 71 |
'type' => 'style', |
| 72 |
], |
| 73 |
'direction' => [ |
| 74 |
'value_path' => 'direction', |
| 75 |
'component' => 'Selector', |
| 76 |
'title' => __( 'Direction', 'yaymail' ), |
| 77 |
'default_value' => isset( $attributes['direction'] ) ? $attributes['direction'] : 'horizontal', |
| 78 |
'options' => [ |
| 79 |
[ |
| 80 |
'label' => __( 'Horizontal', 'yaymail' ), |
| 81 |
'value' => 'horizontal', |
| 82 |
], |
| 83 |
[ |
| 84 |
'label' => __( 'Vertical', 'yaymail' ), |
| 85 |
'value' => 'vertical', |
| 86 |
], |
| 87 |
], |
| 88 |
'type' => 'style', |
| 89 |
], |
| 90 |
], |
| 91 |
]; |
| 92 |
} |
| 93 |
} |
| 94 |
|