'; $border_conditions = [ [ 'comparison' => 'contain', 'value' => [ 'border' ], 'attribute' => 'showing_items', ], ]; $button_conditions = [ [ 'comparison' => 'contain', 'value' => [ 'button' ], 'attribute' => 'showing_items', ], ]; return [ 'id' => uniqid(), 'type' => self::$type, 'name' => __( 'Simple Offer', 'yaymail' ), 'icon' => self::$icon, 'group' => 'block', 'available' => false, 'disabled_reason' => [ 'html' => '' . '' . __( 'This element is available in YayMail Pro', 'yaymail' ) . '', ], 'position' => 230, 'data' => [ 'padding' => [ 'value_path' => 'padding', 'component' => 'Spacing', 'title' => __( 'Padding', 'yaymail' ), 'default_value' => isset( $attributes['padding'] ) ? $attributes['padding'] : [ 'top' => '15', 'right' => '50', 'bottom' => '15', 'left' => '50', ], 'type' => 'style', ], 'background_color' => [ 'value_path' => 'background_color', 'component' => 'Color', 'title' => __( 'Background color', 'yaymail' ), 'default_value' => isset( $attributes['background_color'] ) ? $attributes['background_color'] : '#fff', 'type' => 'style', ], 'text_color' => [ 'value_path' => 'text_color', 'component' => 'Color', 'title' => __( 'Text color', 'yaymail' ), 'default_value' => isset( $attributes['text_color'] ) ? $attributes['text_color'] : YAYMAIL_COLOR_TEXT_DEFAULT, 'type' => 'style', ], 'font_family' => [ 'value_path' => 'font_family', 'component' => 'FontFamilySelector', 'title' => __( 'Font family', 'yaymail' ), 'default_value' => isset( $attributes['font_family'] ) ? $attributes['font_family'] : YAYMAIL_DEFAULT_FAMILY, 'type' => 'style', ], 'content_breaker' => [ 'component' => 'LineBreaker', ], 'content_group_definition' => [ 'component' => 'GroupDefinition', 'title' => __( 'Content', 'yaymail' ), 'description' => __( 'Handle content settings', 'yaymail' ), ], 'rich_text' => [ 'value_path' => 'rich_text', 'component' => 'RichTextEditor', 'title' => __( 'Content', 'yaymail' ), 'default_value' => isset( $attributes['rich_text'] ) ? $attributes['rich_text'] : '

Extra 30% off

ON ORDERS ABOVE $100 ON NEW ARRIVALS

', 'type' => 'content', ], 'showing_items' => [ 'value_path' => 'showing_items', 'component' => 'CheckboxGroup', 'title' => __( 'Showing items', 'yaymail' ), 'default_value' => isset( $attributes['showing_items'] ) ? $attributes['showing_items'] : [ 'button', 'border' ], 'type' => 'content', 'options' => [ [ 'label' => __( 'Border', 'yaymail' ), 'value' => 'border', ], [ 'label' => __( 'Button', 'yaymail' ), 'value' => 'button', ], ], ], 'border_breaker' => [ 'component' => 'LineBreaker', 'conditions' => $border_conditions, ], 'border_group_definition' => [ 'component' => 'GroupDefinition', 'title' => __( 'Border', 'yaymail' ), 'description' => __( 'Handle content border settings', 'yaymail' ), 'conditions' => $border_conditions, ], 'border_width' => [ 'value_path' => 'border_width', 'component' => 'NumberInput', 'title' => __( 'Border width', 'yaymail' ), 'default_value' => isset( $attributes['border_width'] ) ? $attributes['border_width'] : '3', 'min' => 0, 'max' => 100, 'type' => 'style', 'conditions' => $border_conditions, ], 'border_style' => [ 'value_path' => 'border_style', 'component' => 'Selector', 'title' => __( 'Border style', 'yaymail' ), 'default_value' => isset( $attributes['border_style'] ) ? $attributes['border_style'] : 'solid', 'options' => [ [ 'label' => __( 'Solid', 'yaymail' ), 'value' => 'solid', ], [ 'label' => __( 'Double', 'yaymail' ), 'value' => 'double', ], [ 'label' => __( 'Dotted', 'yaymail' ), 'value' => 'dotted', ], [ 'label' => __( 'Dashed', 'yaymail' ), 'value' => 'dashed', ], ], 'type' => 'style', 'conditions' => $border_conditions, ], 'border_color' => [ 'value_path' => 'border_color', 'component' => 'Color', 'title' => __( 'Border color', 'yaymail' ), 'default_value' => isset( $attributes['border_color'] ) ? $attributes['border_color'] : '#000000', 'type' => 'style', 'conditions' => $border_conditions, ], 'button_breaker' => [ 'component' => 'LineBreaker', 'conditions' => $button_conditions, ], 'button_group_definition' => [ 'component' => 'GroupDefinition', 'title' => __( 'Button', 'yaymail' ), 'description' => __( 'Handle button settings', 'yaymail' ), 'conditions' => $button_conditions, ], 'button_text' => [ 'value_path' => 'button_text', 'component' => 'TextInput', 'title' => __( 'Button text', 'yaymail' ), 'default_value' => isset( $attributes['button_text'] ) ? $attributes['button_text'] : __( 'ORDER NOW', 'yaymail' ), 'type' => 'content', 'conditions' => $button_conditions, ], 'button_url' => [ 'value_path' => 'button_url', 'component' => 'TextInput', 'title' => __( 'Button URL', 'yaymail' ), 'default_value' => isset( $attributes['button_url'] ) ? $attributes['button_url'] : home_url(), 'type' => 'content', 'conditions' => $button_conditions, ], 'button_background_color' => [ 'value_path' => 'button_background_color', 'component' => 'Color', 'title' => __( 'Button background color', 'yaymail' ), 'default_value' => isset( $attributes['button_background_color'] ) ? $attributes['button_background_color'] : '#ec4770', 'type' => 'style', 'conditions' => $button_conditions, ], 'button_text_color' => [ 'value_path' => 'button_text_color', 'component' => 'Color', 'title' => __( 'Button text color', 'yaymail' ), 'default_value' => isset( $attributes['button_text_color'] ) ? $attributes['button_text_color'] : '#fff', 'type' => 'style', 'conditions' => $button_conditions, ], ], ]; } }