Commit inicial - WordPress Análisis de Precios Unitarios

- WordPress core y plugins
- Tema Twenty Twenty-Four configurado
- Plugin allow-unfiltered-html.php simplificado
- .gitignore configurado para excluir wp-config.php y uploads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-11-03 21:04:30 -06:00
commit a22573bf0b
24068 changed files with 4993111 additions and 0 deletions

View File

@@ -0,0 +1,91 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Article_Element
*/
class TCB_Article_Element extends TCB_Post_List_Sub_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Article', 'thrive-cb' );
}
/**
* WordPress element identifier
*
* @return string
*/
public function identifier() {
return '.' . TCB_POST_WRAPPER_CLASS;
}
/**
* Hide this.
*
* @return bool
*/
public function hide() {
return true;
}
/**
* This element has a selector
*
* @return bool
*/
public function has_selector() {
return true;
}
/**
* Check if this element behaves like a shortcode.
*
* @return bool
*/
public function is_shortcode() {
return false;
}
/**
* Whether or not this element can be edited while under :hover state
*
* @return bool
*/
public function has_hover_state() {
return true;
}
/**
* @return array
*/
public function own_components() {
$components = parent::own_components();
$components['responsive']['hidden'] = true;
$components['typography']['hidden'] = true;
$components['animation']['disabled_controls'] = [ '.anim-popup', '.anim-link' ];
$components['layout']['disabled_controls'] =
[
'margin-right',
'margin-bottom',
'margin-left',
'.tve-advanced-controls',
'MaxWidth',
'Alignment',
'hr',
'Display',
];
return $components;
}
}

View File

@@ -0,0 +1,116 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Audio_Element
*/
class TCB_Audio_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Audio', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'audio';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'audio';
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.thrv_audio,.tve_audio_container';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return [
'audio' => [
'config' => [
'ExternalFields' => [
'config' => [
'key' => 'audio',
'shortcode_element' => 'audio.tcb-audio',
],
'extends' => 'CustomFields',
],
],
],
'typography' => [ 'hidden' => true ],
'background' => [ 'hidden' => true ],
'shadow' => [
'config' => [
'disabled_controls' => [ 'inner', 'text' ],
],
],
'animation' => [ 'hidden' => true ],
'layout' => [
'config' => [
'Width' => [
'important' => true,
],
'Height' => [
'css_suffix' => [ ' iframe', ' > :first-child' ],
],
],
'disabled_controls' => [ 'Overflow', 'ScrollStyle' ],
],
];
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'audio_element',
'link' => 'https://help.thrivethemes.com/en/articles/4425842-how-to-use-the-audio-element',
],
];
}
}

View File

@@ -0,0 +1,195 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Avatar_Picker_Element
*/
class TCB_Avatar_Picker_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Avatar Picker', 'thrive-cb' );
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'text';
}
public function hide() {
return true;
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.tve-avatar-picker-element';
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_integrations_label();
}
public function has_hover_state() {
return true;
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$avatar_image_selector = ' .tve-avatar-picker-image';
$has_google_connection = ! empty( tvd_get_google_api_key() );
$has_facebook_connection = ! empty( tvd_get_facebook_app_id() );
return [
'avatar_picker' => [
'config' => [
'GoogleApi' => [
'config' => [
'name' => '',
'label' => __( 'Enable Google', 'thrive-cb' ),
'default' => false,
'info' => ! $has_google_connection,
'info_hover' => ! $has_google_connection,
],
'extends' => 'Switch',
],
'FacebookApi' => [
'config' => [
'name' => '',
'label' => __( 'Enable Facebook', 'thrive-cb' ),
'default' => false,
'info' => ! $has_facebook_connection,
'info_hover' => ! $has_facebook_connection,
],
'extends' => 'Switch',
],
'Gravatar' => [
'config' => [
'name' => '',
'label' => __( 'Enable Gravatar', 'thrive-cb' ),
'default' => true,
],
'extends' => 'Switch',
],
'CustomUrl' => [
'config' => [
'name' => '',
'label' => __( 'Custom url', 'thrive-cb' ),
'default' => false,
],
'extends' => 'Switch',
],
'ImagePicker' => [
'config' => [
'label' => __( 'Default avatar', 'thrive-cb' ),
],
],
'ImageSize' => [
'config' => [
'default' => '240',
'min' => '50',
'max' => '1024',
'label' => __( 'Image size', 'thrive-cb' ),
'um' => [ 'px' ],
],
],
'ButtonType' => [
'config' => [
'name' => __( 'Edit button type', 'thrive-cb' ),
'options' => [
// 'button' => __( 'Button', 'thrive-cb' ),
'icon' => __( 'Icon', 'thrive-cb' ),
'overlay' => __( 'Overlay', 'thrive-cb' ),
],
],
'extends' => 'Select',
],
'ButtonPosition' => [
'config' => [
'name' => __( 'Button position', 'thrive-cb' ),
'options' => [
'top' => __( 'Top', 'thrive-cb' ),
'bottom' => __( 'Bottom', 'thrive-cb' ),
],
],
'extends' => 'Select',
],
'IconPosition' => [
'config' => [
'name' => __( 'Icon position', 'thrive-cb' ),
'options' => [
'top-left' => __( 'Left', 'thrive-cb' ),
'top-right' => __( 'Right', 'thrive-cb' ),
],
],
'extends' => 'Select',
],
],
],
'typography' => [
'hidden' => true,
],
'shadow' => [
'config' => [
'disabled_controls' => [ 'text' ],
'default_shadow' => 'none',
'css_suffix' => $avatar_image_selector,
],
],
'background' => [
'hidden' => true,
],
'styles-templates' => [
'hidden' => true,
],
'responsive' => [
'hidden' => true,
],
'animation' => [
'hidden' => true,
],
'layout' => [
'disabled_controls' => [ '[data-label="Width"]', '[data-label="Height"]', '[data-view="Display"]', '.tve-advanced-controls' ],
],
'borders' => [
'config' => [
'Borders' => [
'css_suffix' => $avatar_image_selector,
],
'Corners' => [
'css_suffix' => $avatar_image_selector,
],
],
],
];
}
}

View File

@@ -0,0 +1,91 @@
<?php
require_once plugin_dir_path( __FILE__ ) . 'class-tcb-section-element.php';
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Section_Element
*/
class TCB_Block_Element extends TCB_Section_Element {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Block', 'thrive-cb' );
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.thrv-lp-block.thrv-page-section';
}
/**
* @return bool
*/
public function promoted() {
return true;
}
/**
* @return bool
*/
public function is_placeholder() {
return false;
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* HTML layout of the element for when it's dragged in the canvas
*
* @return string
*/
protected function html() {
return tcb_template( 'elements/' . $this->tag() . '.php', $this, true );
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$components = parent::own_components();
$components = array_merge( [ 'block' => $components['section'] ], $components );
unset( $components['section'] );
unset( $components['shared-styles'] );
return array_merge( $components, $this->group_component() );
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'block',
'link' => 'https://help.thrivethemes.com/en/articles/4425843-how-to-use-the-block-element',
],
];
}
}

View File

@@ -0,0 +1,347 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Button_Element
*/
class TCB_Button_Element extends TCB_Cloud_Template_Element_Abstract {
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'button';
}
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Button', 'thrive-cb' );
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'button';
}
/**
* Button element identifier
*
* @return string
*/
public function identifier() {
return '.thrv-button, .thrv_button_shortcode';
}
/**
* This element is not a placeholder
*
* @return bool|true
*/
public function is_placeholder() {
return false;
}
/**
* Allow this element to be also styled for active state
*
* The active state class is .tcb-active-state
*
* @return string
*/
public function active_state_config() {
return apply_filters( 'tcb_button_active_state', false );
}
/**
* HTML layout of the element for when it's dragged in the canvas
*
* @return string
*/
protected function html() {
return tcb_template( 'elements/' . $this->tag() . '.php', $this, true );
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$button = array(
'button' => array(
'config' => array(
'ButtonPalettes' => [
'config' => [],
'extends' => 'Palettes',
],
'icon_side' => array(
'config' => array(
'name' => __( 'Icon side', 'thrive-cb' ),
'buttons' => array(
array( 'value' => 'left', 'text' => __( 'Left', 'thrive-cb' ), 'default' => true ),
array( 'value' => 'right', 'text' => __( 'Right', 'thrive-cb' ) ),
),
),
),
'ButtonIcon' => array(
'config' => array(
'name' => '',
'label' => __( 'Add icon', 'thrive-cb' ),
'default' => false,
),
'extends' => 'Switch',
),
'MasterColor' => array(
'config' => array(
'default' => '000',
'label' => __( 'Master Color', 'thrive-cb' ),
'important' => true,
'affected_components' => [ 'shadow', 'background', 'borders' ],
'options' => [
'showGlobals' => false,
],
),
),
'SecondaryText' => array(
'config' => array(
'name' => '',
'label' => __( 'Secondary button text', 'thrive-cb' ),
'default' => false,
),
'to' => '.tcb-button-texts',
'extends' => 'Switch',
),
'ButtonSize' => array(
'css_prefix' => tcb_selection_root() . ' ',
'config' => array(
'name' => __( 'Size and alignment', 'thrive-cb' ),
'full-width' => true,
'buttons' => array(
array(
'value' => 's',
'properties' => [
'padding' => '12px 15px',
'font-size' => '18px',
'line-height' => '1.2em',
],
'text' => 'S',
'default' => true,
),
array(
'value' => 'm',
'properties' => [
'padding' => '14px 22px',
'font-size' => '24px',
'line-height' => '1.2em',
],
'text' => 'M',
),
array(
'value' => 'l',
'properties' => [
'padding' => '18px 30px',
'font-size' => '32px',
'line-height' => '1.2em',
],
'text' => 'L',
),
array(
'value' => 'xl',
'properties' => [
'padding' => '22px 40px',
'font-size' => '38px',
'line-height' => '1.1em',
],
'text' => 'XL',
),
array(
'value' => 'xxl',
'properties' => [
'padding' => '32px 50px',
'font-size' => '52px',
'line-height' => '1.1em',
],
'text' => 'XXL',
),
),
),
),
'Align' => array(
'config' => array(
'buttons' => array(
array(
'icon' => 'a_left',
'value' => 'left',
'tooltip' => __( 'Align Left', 'thrive-cb' ),
),
array(
'icon' => 'a_center',
'value' => 'center',
'default' => true,
'tooltip' => __( 'Align Center', 'thrive-cb' ),
),
array(
'icon' => 'a_right',
'value' => 'right',
'tooltip' => __( 'Align Right', 'thrive-cb' ),
),
array(
'text' => 'FULL',
'value' => 'full',
'tooltip' => __( 'Full Width', 'thrive-cb' ),
),
),
),
),
'ButtonWidth' => array(
'config' => array(
'default' => '0',
'min' => '10',
'max' => '1080',
'label' => __( 'Button width', 'thrive-cb' ),
'um' => [ '%', 'px' ],
'css' => 'max-width',
),
'extends' => 'Slider',
),
'style' => array(
'css_suffix' => ' .tcb-button-link',
'config' => array(
'label' => __( 'Button Styles', 'thrive-cb' ),
'items' => [],
'default_label' => __( 'Template Button', 'thrive-cb' ),
'default' => 'default',
),
),
),
),
'animation' => [
'config' => [
'to' => '.tcb-button-link',
],
],
'background' => [
'config' => [
'css_suffix' => ' .tcb-button-link',
],
],
'borders' => [
'config' => [
'css_suffix' => ' .tcb-button-link',
],
],
'typography' => [
'config' => [
'css_suffix' => ' .tcb-button-link',
'FontColor' => [
'css_suffix' => ' .tcb-button-link span',
],
'FontSize' => [
'css_suffix' => ' .tcb-button-link',
'important' => true,
],
'TextStyle' => [
'css_suffix' => ' .tcb-button-link span',
],
'LineHeight' => [
'css_suffix' => ' .tcb-button-link',
],
'FontFace' => [
'css_suffix' => ' .tcb-button-link',
],
'TextTransform' => [
'css_suffix' => ' .tcb-button-link span',
],
'LetterSpacing' => [
'css_suffix' => ' .tcb-button-link',
],
],
],
'shadow' => [
'config' => [
'css_suffix' => ' .tcb-button-link',
'default_shadow' => 'none',
],
],
'layout' => [
'config' => [
'MarginAndPadding' => [
'padding_suffix' => ' .tcb-button-link',
],
'Height' => [
'css_suffix' => ' .tcb-button-link',
],
],
'disabled_controls' => [
'Display',
'Alignment',
'Overflow',
'ScrollStyle',
],
],
'scroll' => [
'hidden' => false,
],
);
return array_merge( $button, $this->shared_styles_component() );
}
/**
* @return bool
*/
public function has_hover_state() {
return true;
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_basic_label();
}
/**
* Get default button templates from the cloud
*
* @return array|mixed|WP_Error
*/
public function get_default_templates() {
return tve_get_cloud_content_templates( $this->get_template_tag() );
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'button',
'link' => 'https://help.thrivethemes.com/en/articles/4425768-how-to-use-the-button-element',
],
];
}
}

View File

@@ -0,0 +1,65 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 6/29/2018
* Time: 10:01 AM
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class TCB_Button_Group_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Button Group', 'thrive-cb' );
}
/**
* Hide Element From Sidebar Menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* When element is selected in editor this identifier
* establishes element _type
*
* @return string
* @see TVE.main.element_selected() TVE._type()
*
*/
public function identifier() {
return '.thrv-button-group';
}
/**
* Components that apply only to this
*
* @return array
*/
public function own_components() {
return [
'button_group' => [
'config' => [],
],
'typography' => [ 'hidden' => true ],
'animation' => [ 'hidden' => true ],
'shadow' => [
'config' => [
'disabled_controls' => [ 'text' ],
],
],
];
}
}

View File

@@ -0,0 +1,83 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 7/5/2018
* Time: 4:44 PM
*/
require_once 'class-tcb-button-group-item-element.php';
/**
* Class TCB_Button_Group_Item_Element
*/
class TCB_Button_Group_Item_Element extends TCB_Button_Element {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Button Group Item', 'thrive-cb' );
}
/**
* Hide Element From Sidebar Menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* Allow this element to be also styled for active state
*
* The active state class is .tcb-active-state
*
* @return string
*/
public function active_state_config() {
return true;
}
/**
* Button element identifier
*
* @return string
*/
public function identifier() {
return '.thrv-button-group-item';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$components = parent::own_components();
$components['button']['disabled_controls'] = [
'.tve-control[data-key="style"]',
'.tcb-button-link-container',
];
$components['animation'] = [
'hidden' => true,
];
$components['shared-styles'] = [
'hidden' => true,
];
$components['layout']['disabled_controls'] = [
'Alignment',
'.tve-advanced-controls',
'hr',
];
$components['borders']['config']['Borders']['important'] = true;
$components['borders']['config']['Corners']['important'] = true;
$components['scroll'] = [ 'hidden' => true ];
return $components;
}
}

View File

@@ -0,0 +1,77 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Callaction_Element
*/
class TCB_Callaction_Element extends TCB_Cloud_Template_Element_Abstract {
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'box, template, button, content';
}
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Call to Action', 'thrive-cb' );
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'call_2_action';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return [];
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'call_to_action',
'link' => 'https://help.thrivethemes.com/en/articles/4425745-adding-a-call-to-action-element-with-thrive-architect',
],
];
}
}

View File

@@ -0,0 +1,75 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
if ( ! class_exists( '\TCB_Icon_Element', false ) ) {
require_once TVE_TCB_ROOT_PATH . 'inc/classes/elements/class-tcb-icon-element.php';
}
/**
* Class TCB_Carousel_Arrows_Element
*/
class TCB_Carousel_Arrows_Element extends TCB_Icon_Element {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Arrows', 'thrive-cb' );
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.thrv_icon.tcb-carousel-arrow';
}
/**
* Hide Element From Sidebar Menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* @return array
*/
public function own_components() {
$components = parent::own_components();
$components['icon']['disabled_controls'] = [ 'ToggleURL', 'link', 'RotateIcon' ];
$components['layout']['disabled_controls'] = [
'margin-bottom',
'Width',
'Height',
'Display',
'Overflow',
'ScrollStyle',
'Alignment',
'Position',
'Float',
];
$components['icon']['config']['Slider']['css_prefix'] = tcb_selection_root() . ' .tcb-carousel-arrow';
$components['scroll'] = [ 'hidden' => true ];
$components['animation'] = [ 'hidden' => false ];
$components['carousel_arrows'] = $components['icon'];
unset( $components['icon'] );
return $components;
}
}

View File

@@ -0,0 +1,85 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
if ( ! class_exists( '\TCB_Icon_Element', false ) ) {
require_once TVE_TCB_ROOT_PATH . 'inc/classes/elements/class-tcb-icon-element.php';
}
/**
* Class TCB_Carousel_Dots_Element
*/
class TCB_Carousel_Dots_Element extends TCB_Icon_Element {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Dots', 'thrive-cb' );
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.tcb-carousel-dots,.slick-dots';
}
/**
* Hide Element From Sidebar Menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* @return array
*/
public function own_components() {
$components = parent::own_components();
$components['icon']['disabled_controls'] = [ 'ToggleURL', 'link', 'RotateIcon' ];
$components['layout']['disabled_controls'] = [
'Width',
'Height',
'Display',
'Overflow',
'ScrollStyle',
'Alignment',
'Position',
'Float',
];
$components['scroll'] = [ 'hidden' => true ];
$components['animation'] = [ 'hidden' => true ];
$components['styles-templates'] = [ 'hidden' => true ];
$components['carousel_dots'] = $components['icon'];
$components['carousel_dots']['config']['ColorPicker']['important'] = true;
$components['carousel_dots']['config']['HorizontalSpace'] = array(
'config' => array(
'min' => '0',
'max' => '100',
'label' => __( 'Horizontal space', 'thrive-cb' ),
'um' => [ 'px', '%' ],
),
'extends' => 'Slider',
);
$components['layout']['config']['MarginAndPadding']['important'] = true;
unset( $components['icon'] );
return $components;
}
}

View File

@@ -0,0 +1,134 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Cell_Element
*
* Table cell editing
*/
class TCB_Cell_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Table Cell', 'thrive-cb' );
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'none';
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.tve_table th, .tve_table td';
}
/**
* Table cells are not visible in the side menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return array(
'cell' => array(
'config' => array(
'width' => array(
'config' => array(
'min' => 50,
'max' => 500,
'label' => __( 'Column Width', 'thrive-cb' ),
'um' => [ 'px' ],
),
'extends' => 'Slider',
),
'height' => array(
'config' => array(
'min' => 10,
'max' => 200,
'label' => __( 'Row Height', 'thrive-cb' ),
'um' => [ 'px' ],
),
'extends' => 'Slider',
),
'valign' => array(
'config' => array(
'name' => __( 'Vertical Align', 'thrive-cb' ),
'buttons' => [
[
'icon' => 'none',
'default' => true,
'value' => '',
],
[
'icon' => 'top',
'value' => 'top',
],
[
'icon' => 'vertical',
'value' => 'middle',
],
[
'icon' => 'bot',
'value' => 'bottom',
],
],
),
'extends' => 'ButtonGroup',
),
),
),
'borders' => [
'hidden' => true,
],
'animation' => [
'hidden' => true,
],
'layout' => [
'hidden' => true,
],
'typography' => [
'hidden' => true,
],
'shadow' => [
'config' => [
'disabled_controls' => [ 'text' ],
],
],
'responsive' => [
'hidden' => true,
],
'styles-templates' => [
'hidden' => true,
],
);
}
}

View File

@@ -0,0 +1,152 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Column_Element
*/
class TCB_Column_Element extends TCB_Element_Abstract {
/**
* Not directly available from the menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Column', 'thrive-cb' );
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'column';
}
/**
* Text element identifier
*
* @return string
*/
public function identifier() {
return 'div.tcb-col';
}
/**
* @return string
*/
protected function html() {
return '';
}
/**
* @return array
*/
public function own_components() {
return array(
'column' => array(
'config' => array(
'VerticalPosition' => array(
'config' => array(
'name' => __( 'Vertical position', 'thrive-cb' ),
'important' => true,
'buttons' => [
[
'icon' => 'none',
'default' => true,
'value' => '',
],
[
'icon' => 'top',
'value' => 'flex-start',
],
[
'icon' => 'vertical',
'value' => 'center',
],
[
'icon' => 'bot',
'value' => 'flex-end',
],
],
),
'extends' => 'ButtonGroup',
),
'FixedWidth' => array(
'config' => array(
'name' => '',
'label' => __( 'Enable fixed width', 'thrive-cb' ),
'default' => true,
'info' => true,
),
'extends' => 'Switch',
),
'FullHeight' => array(
'config' => array(
'name' => '',
'label' => __( 'Enable full height', 'thrive-cb' ),
'default' => true,
'info' => true,
),
'extends' => 'Switch',
),
'ColumnWidth' => array(
'config' => array(
'default' => '100',
'min' => '30',
'max' => '1500',
'label' => __( 'Width', 'thrive-cb' ),
'um' => [ 'px', '%', ],
'um_disabled' => true,
),
'extends' => 'Slider',
),
),
),
'responsive' => [ 'hidden' => true ],
'styles-templates' => [ 'hidden' => true ],
'layout' => [
'disabled_controls' => [
'.tve-advanced-controls',
'Width',
'Height',
'Alignment',
'Display',
],
],
'borders' => [
'config' => [
'Borders' => [
'important' => true,
],
],
],
'conditional-display' => [ 'hidden' => false ],
);
}
/**
* @return bool
*/
public function has_hover_state() {
return true;
}
}

View File

@@ -0,0 +1,205 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Columns_Element
*/
class TCB_Columns_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Columns', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'container,box,content';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'column';
}
/**
* Text element identifier
*
* @return string
*/
public function identifier() {
return '.thrv-columns:not(.thrv-testimonial), .thrv_columns';
}
protected function html() {
return '';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return array(
'columns' => array(
'config' => array(
'GutterWidth' => array(
'config' => array(
'default' => '15',
'min' => '0',
'max' => '200',
'label' => __( 'Gutter width', 'thrive-cb' ),
'um' => [ 'px' ],
),
'to' => '> .tcb-flex-row',
'css_suffix' => ' > .tcb-flex-col',
'extends' => 'Slider',
),
'ColumnsOrder' => array(
'config' => array(
'name' => '',
'label' => __( 'Reverse column order', 'thrive-cb' ),
'default' => false,
),
'to' => ' > .tcb-flex-row',
'extends' => 'Switch',
),
'VerticalPosition' => array(
'config' => array(
'name' => __( 'Vertical position', 'thrive-cb' ),
'buttons' => [
[
'icon' => 'top',
'default' => true,
'value' => 'flex-start',
],
[
'icon' => 'vertical',
'value' => 'center',
],
[
'icon' => 'bot',
'value' => 'flex-end',
],
],
'info' => true,
),
'to' => ' > .tcb-flex-row',
'extends' => 'ButtonGroup',
),
'Wrap' => array(
'config' => array(
'name' => '',
'label' => __( 'Wrap columns', 'thrive-cb' ),
'default' => true,
),
'to' => ' > .tcb-flex-row',
'extends' => 'Switch',
),
'ColumnWidth' => array(
'config' => array(
'default' => '250',
'min' => '40',
'max' => '700',
'label' => __( 'Column breakpoint', 'thrive-cb' ),
'info' => true,
'info_hover' => true,
'um' => [ 'PX' ],
),
'to' => ' > .tcb-flex-row',
'extends' => 'Slider',
),
'FullWidth' => array(
'config' => array(
'name' => '',
'label' => __( 'Stretch to fit screen width', 'thrive-cb' ),
'default' => true,
),
'extends' => 'Switch',
),
'MinHeight' => array(
'config' => array(
'default' => '1024',
'min' => '1',
'max' => '1000',
'label' => __( 'Minimum height', 'thrive-cb' ),
'um' => [ 'px', 'vh' ],
'css' => 'min-height',
),
'to' => ' > .tcb-flex-row',
'css_suffix' => ' > .tcb-flex-col > .tcb-col',
'extends' => 'Slider',
),
),
),
'layout' => [
'config' => [
'MarginAndPadding' => [
'margin_to' => '',
'padding_to' => ' > .tcb-flex-row',
],
'Height' => [
'to' => ' > .tcb-flex-row',
'css_suffix' => ' > .tcb-flex-col > .tcb-col',
],
],
'disabled_controls' => [],
],
'typography' => [
'disabled_controls' => [],
'config' => [
'ParagraphStyle' => [ 'hidden' => false ],
],
],
'animation' => [ 'hidden' => true ],
'scroll' => [
'hidden' => false,
],
);
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_basic_label();
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'columns',
'link' => 'https://help.thrivethemes.com/en/articles/4425769-how-to-use-the-columns-element',
],
];
}
}

View File

@@ -0,0 +1,118 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 5/3/2017
* Time: 1:42 PM
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Commentsdisqus_Element
*/
class TCB_Commentsdisqus_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Disqus Comments', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'social';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'disqus_comments';
}
/**
* Disqus Comments element identifier
*
* @return string
*/
public function identifier() {
return '.thrv_disqus_comments'; // Compatibility with TCB 1.5
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return array(
'commentsdisqus' => array(
'config' => array(
'ForumName' => array(
'config' => array(
'full-width' => true,
'label' => __( 'Forum Name', 'thrive-cb' ),
),
'extends' => 'LabelInput',
),
'URL' => array(
'config' => array(
'full-width' => true,
'label' => __( 'URL', 'thrive-cb' ),
'placeholder' => __( 'http://', 'thrive-cb' ),
),
'extends' => 'LabelInput',
),
),
),
'typography' => [ 'hidden' => true ],
'animation' => [ 'hidden' => true ],
'background' => [ 'hidden' => true ],
'shadow' => [ 'hidden' => true ],
'layout' => [
'disabled_controls' => [
'.tve-advanced-controls',
'Width',
'Height',
'Alignment',
],
],
);
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'disqus_comments',
'link' => 'https://help.thrivethemes.com/en/articles/4425808-how-to-add-facebook-disqus-comments-in-thrive-architect',
],
];
}
}

View File

@@ -0,0 +1,160 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 5/4/2017
* Time: 11:56 AM
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Commentsfacebook_Element
*/
class TCB_Commentsfacebook_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Facebook Comments', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'social';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'facebook_comments';
}
/**
* Facebook Comments element identifier
*
* @return string
*/
public function identifier() {
return '.thrv_facebook_comments'; // Compatibility with TCB 1.5
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return array(
'commentsfacebook' => array(
'config' => array(
'moderators' => array(
'config' => array(
'top_text' => __( 'Add Facebook user ID for the people that you will like to moderate the comments.', 'thrive-cb' ),
'add_button_text' => __( 'Add New Moderator', 'thrive-cb' ),
'list_label' => 'ID',
'remove_title' => __( 'Remove Moderator', 'thrive-cb' ),
'list_items' => [],
),
'extends' => 'InputMultiple',
),
'URL' => array(
'config' => array(
'full-width' => true,
'label' => __( 'URL', 'thrive-cb' ),
'placeholder' => 'http://',
),
'extends' => 'LabelInput',
),
'nr_of_comments' => array(
'config' => array(
'default' => '20',
'min' => '1',
'max' => '200',
'label' => __( 'Number of comments', 'thrive-cb' ),
'um' => [],
),
'extends' => 'Slider',
),
'color_scheme' => array(
'config' => array(
'name' => __( 'Color Scheme', 'thrive-cb' ),
'options' => [
[
'value' => 'light',
'name' => 'Light',
],
[
'value' => 'dark',
'name' => 'Dark',
],
],
),
'extends' => 'Select',
),
'order_by' => array(
'config' => array(
'name' => __( 'Order By', 'thrive-cb' ),
'options' => [
[
'value' => 'social',
'name' => 'Social Popularity',
],
[
'value' => 'time',
'name' => 'Oldest First',
],
[
'value' => 'reverse_time',
'name' => 'Newest first',
],
],
),
'extends' => 'Select',
),
),
),
'typography' => [ 'hidden' => true ],
'animation' => [ 'hidden' => true ],
'background' => [ 'hidden' => true ],
'shadow' => [ 'hidden' => true ],
'layout' => [ 'disabled_controls' => [ 'Height', 'Width', 'Alignment', 'Overflow', 'ScrollStyle' ] ],
);
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'facebook_comments',
'link' => 'https://help.thrivethemes.com/en/articles/4425808-how-to-add-facebook-disqus-comments-in-thrive-architect',
],
];
}
}

View File

@@ -0,0 +1,211 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Contact_Form_Element
*
* Element class
*/
class TCB_Contact_Form_Element extends TCB_Cloud_Template_Element_Abstract {
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
public function hide() {
return true;
}
/**
* Name of the Element in sidebar
*
* @return string
*/
public function name() {
return __( 'Contact Form (Old)', 'thrive-cb' );
}
/**
* Which svg symbol id to use
*
* @return string
*/
public function icon() {
return 'contact_form';
}
/**
* When element is selected in editor this identifier
* establishes element _type
*
* @return string
* @see TVE.main.element_selected() TVE._type()
*
*/
public function identifier() {
return '.thrv-contact-form';
}
protected function html() {
return tcb_template( 'elements/' . $this->tag() . '.php', $this, true );
}
/**
* Filters the Contact Form Input Types
*
* @return array
*/
public function get_types() {
require_once dirname( dirname( __FILE__ ) ) . '/class-tcb-contact-form.php';
$types = TCB_Contact_Form::get_types();
foreach ( $types as $key => $value ) {
if ( ! empty( $value['validation_error'] ) ) {
unset( $types[ $key ]['validation_error'] );
}
}
return $types;
}
public function own_components() {
$contact_form = array(
'contact_form' => array(
'config' => array(
'FieldsControl' => array(
'config' => array(
'sortable' => true,
'settings_icon' => 'edit',
'types' => $this->get_types(),
),
),
'AddRemoveLabels' => array(
'config' => array(
'name' => '',
'label' => __( 'Labels', 'thrive-cb' ),
'default' => true,
),
'css_suffix' => ' label',
'css_prefix' => '',
'extends' => 'Switch',
),
'AddRemoveRequiredMarks' => array(
'config' => array(
'name' => '',
'label' => __( 'Required Marks', 'thrive-cb' ),
'default' => true,
),
'extends' => 'Switch',
),
'ZapierConnection' => array(
'config' => array(
'name' => '',
'label' => __( 'Connect to Zapier', 'thrive-cb' ),
'icon' => 'zapier-logo',
'default' => false,
),
'extends' => 'Switch',
),
'ZapierTags' => array(
'config' => array(
'label' => __( 'Tags', 'thrive-cb' ),
),
),
'ZapierIp' => array(
'config' => array(
'label' => __( 'Send IP Address', 'thrive-cb' ),
),
),
),
),
'typography' => [
'hidden' => true,
],
'animation' => [
'hidden' => true,
],
'layout' => [
'config' => [
'Width' => [
'important' => true,
],
],
'disabled_controls' => [
'Overflow',
'ScrollStyle',
],
],
);
return array_merge( $contact_form, $this->group_component() );
}
/**
* Group Edit Properties
*
* @return array|bool
*/
public function has_group_editing() {
return array(
'select_values' => array(
array(
'value' => 'all_cf_items',
'selector' => '.tve-cf-item',
'name' => __( 'Grouped Form Items', 'thrive-cb' ),
'singular' => __( '-- Form Item %s', 'thrive-cb' ),
),
array(
'value' => 'all_inputs',
'selector' => '.tve-cf-input',
'name' => __( 'Grouped Inputs', 'thrive-cb' ),
'singular' => __( '-- Input %s', 'thrive-cb' ),
),
array(
'value' => 'all_labels',
'selector' => '.tve-cf-item label',
'name' => __( 'Grouped Labels', 'thrive-cb' ),
'singular' => __( '-- Label %s', 'thrive-cb' ),
),
),
);
}
public function is_placeholder() {
return false;
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'contact_form',
'link' => 'https://help.thrivethemes.com/en/articles/4430139-how-to-use-the-contact-form-element',
],
];
}
}

View File

@@ -0,0 +1,137 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 5/22/2018
* Time: 8:45 AM
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TCB_Contact_Form_Input_Element extends TCB_Element_Abstract {
/**
* Name of the Element
*
* @return string
*/
public function name() {
return __( 'Contact Form Input', 'thrive-cb' );
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.tve-cf-input';
}
/**
* Enables Hover States on Form Input
*
* @return bool
*/
public function has_hover_state() {
return true;
}
/**
* There is no need for HTML for this element since we need it only for control filter
*
* @return string
*/
protected function html() {
return '';
}
/**
* Hide Element From Sidebar Menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* Component and control configda
*
* @return array
*/
public function own_components() {
$prefix_config = tcb_selection_root();
$controls_default_config = [
'css_suffix' => [
' input',
' input::placeholder',
' textarea',
' textarea::placeholder',
],
];
$tag_default_config = [
'css_suffix' => [
' input',
' textarea',
],
];
return array(
'typography' => [
'config' => [
'FontSize' => $controls_default_config,
'FontColor' => $controls_default_config,
'TextAlign' => $controls_default_config,
'TextStyle' => $controls_default_config,
'TextTransform' => $controls_default_config,
'FontFace' => $controls_default_config,
'LineHeight' => $controls_default_config,
'LetterSpacing' => $controls_default_config,
],
],
'layout' => [
'disabled_controls' => [
'Width',
'Height',
'Alignment',
'Display',
'.tve-advanced-controls',
],
'config' => [
'MarginAndPadding' => $tag_default_config,
],
],
'borders' => array(
'config' => array(
'Borders' => array_merge( [ 'css_prefix' => $prefix_config . ' ' ], $tag_default_config ),
'Corners' => array_merge( [ 'css_prefix' => $prefix_config . ' ' ], $tag_default_config ),
),
),
'animation' => [
'hidden' => true,
],
'background' => [
'config' => [
'ColorPicker' => $tag_default_config,
'PreviewList' => $tag_default_config,
],
],
'shadow' => [
'config' => $tag_default_config,
],
'responsive' => [
'hidden' => true,
],
'styles-templates' => [
'hidden' => true,
],
);
}
}

View File

@@ -0,0 +1,58 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package TCB2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TCB_Contact_Form_Item_Element extends TCB_Element_Abstract {
public function name() {
return __( 'Contact Form Item', 'thrive-cb' );
}
public function identifier() {
return '.tve-cf-item';
}
/**
* Hide Element From Sidebar Menu
*
* @return bool
*/
public function hide() {
return true;
}
public function own_components() {
return [
'typography' => [
'hidden' => true,
],
'layout' => [
'disabled_controls' => [
'Width',
'Height',
'Alignment',
'Display',
'.tve-advanced-controls',
],
],
'animation' => [
'hidden' => true,
],
'responsive' => [
'hidden' => true,
],
'styles-templates' => [
'hidden' => true,
],
];
}
}

View File

@@ -0,0 +1,105 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 5/21/2018
* Time: 4:55 PM
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TCB_Contact_Form_Label_Element extends TCB_Element_Abstract {
/**
* Name of the Element
*
* @return string
*/
public function name() {
return __( 'Contact Form Label', 'thrive-cb' );
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.tve-cf-item label';
}
/**
* There is no need for HTML for this element since we need it only for control filter
*
* @return string
*/
protected function html() {
return '';
}
/**
* Hide Element From Sidebar Menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return [
'typography' => [
'disabled_controls' => [ 'TextAlign', '.tve-advanced-controls' ],
'config' => [
'css_suffix' => '',
'FontSize' => [
'css_suffix' => '',
'important' => true,
],
'FontColor' => [
'css_suffix' => '',
'important' => true,
],
'LineHeight' => [
'css_suffix' => '',
'important' => true,
],
'LetterSpacing' => [
'css_suffix' => '',
'important' => true,
],
'FontFace' => [
'css_suffix' => '',
'important' => true,
],
'TextStyle' => [
'css_suffix' => '',
'important' => true,
],
'TextTransform' => [
'css_suffix' => '',
'important' => true,
],
],
],
'animation' => [
'hidden' => true,
],
'responsive' => [
'hidden' => true,
],
'styles-templates' => [
'hidden' => true,
],
];
}
}

View File

@@ -0,0 +1,156 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package TCB2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TCB_Contact_Form_Submit_Element extends TCB_Element_Abstract {
public function name() {
return __( 'Contact Form Submit', 'thrive-cb' );
}
public function identifier() {
return '.tve-cf-submit';
}
public function has_hover_state() {
return true;
}
public function hide() {
return true;
}
public function own_components() {
$prefix = tcb_selection_root( false ) . ' ';
$controls_default_config = [
'css_suffix' => ' button',
'css_prefix' => $prefix,
];
$submit = array(
'contact_form_submit' => array(
'config' => array(
'icon_side' => array(
'css_suffix' => ' .thrv_icon',
'css_prefix' => $prefix,
'config' => array(
'name' => __( 'Icon Side', 'thrive-cb' ),
'buttons' => array(
array(
'value' => 'left',
'text' => __( 'Left', 'thrive-cb' ),
),
array(
'value' => 'right',
'text' => __( 'Right', 'thrive-cb' ),
),
),
),
),
'ButtonWidth' => array(
'css_prefix' => $prefix,
'config' => array(
'default' => '100',
'min' => '10',
'max' => '100',
'label' => __( 'Button width', 'thrive-cb' ),
'um' => [ '%' ],
'css' => 'width',
),
'extends' => 'Slider',
),
'ButtonAlign' => array(
'config' => array(
'name' => __( 'Button Align', 'thrive-cb' ),
'buttons' => [
[
'icon' => 'a_left',
'text' => '',
'value' => 'left',
'default' => true,
],
[
'icon' => 'a_center',
'text' => '',
'value' => 'center',
],
[
'icon' => 'a_right',
'text' => '',
'value' => 'right',
],
[
'icon' => 'a_full-width',
'text' => '',
'value' => 'justify',
],
],
),
'extends' => 'ButtonGroup',
),
),
),
'typography' => [
'config' => [
'FontSize' => $controls_default_config,
'FontColor' => $controls_default_config,
'TextAlign' => $controls_default_config,
'TextStyle' => $controls_default_config,
'TextTransform' => $controls_default_config,
'FontFace' => $controls_default_config,
'LineHeight' => $controls_default_config,
'LetterSpacing' => $controls_default_config,
],
],
'layout' => [
'disabled_controls' => [
'Width',
'Height',
'Alignment',
'.tve-advanced-controls',
],
'config' => [
'MarginAndPadding' => $controls_default_config,
],
],
'borders' => [
'config' => [
'Borders' => $controls_default_config,
'Corners' => $controls_default_config,
],
],
'animation' => [
'hidden' => true,
],
'responsive' => [
'hidden' => true,
],
'background' => [
'config' => [
'ColorPicker' => $controls_default_config,
'PreviewList' => $controls_default_config,
],
],
'shadow' => [
'config' => $controls_default_config,
],
// 'styles-templates' => [
// 'config' => [
// 'to' => 'button',
// ],
// ],
);
return $submit;
// return array_merge( $submit, $this->shared_styles_component() );
}
}

View File

@@ -0,0 +1,350 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 2/7/2019
* Time: 9:40 AM
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Contentblock_Element
*
* Element Class
*/
class TCB_Contentblock_Element extends TCB_Cloud_Template_Element_Abstract {
/**
* TCB_Contentblock_Element constructor.
*
* @param string $tag
*/
public function __construct( $tag = '' ) {
parent::__construct( $tag );
add_filter( 'tcb_alter_cloud_template_meta', [ $this, 'alter_tpl_meta' ], 10, 2 );
add_filter( 'tcb_filter_cloud_template_data', [ $this, 'filter_tpl_data' ], 10, 2 );
}
/**
* Either to display or not the element in the sidebar menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* Modifies the template meta for the content block element
*
* Works both in storing the meta values inside DB or outputing the values to the user
*
* Used in inc/classes/content-templates/class-tcb-content-templates-api.php
*
* @param array $return
* @param array $template_data
*
* @return array
*/
public function alter_tpl_meta( $return = [], $template_data = [] ) {
if ( $template_data['type'] === $this->_tag ) {
$return['pack'] = $template_data['pack'];
}
return $return;
}
/**
* Filters the data that comes from the user database for content block element
*
* Returns only the templates and ignores the packs and categories
*
* @param array $return
* @param string $tag
*
* @return array
*/
public function filter_tpl_data( $return = [], $tag = '' ) {
if ( $tag === $this->_tag ) {
$return = $return['tpls'];
}
return $return;
}
/**
* Returns the landing page cloud content blocks
*
* @param array $args
*
* @return array|WP_Error
*/
public function get_lp_cloud_templates( $args = [] ) {
$args = wp_parse_args( $args, [
'nocache' => false,
] );
$return = [];
if ( empty( $args['lp_set'] ) ) {
return $return;
}
$pack = sanitize_title( 'lp-set-' . (string) $args['lp_set'] );
$do_not_use_cache = ( defined( 'TCB_TEMPLATE_DEBUG' ) && TCB_TEMPLATE_DEBUG ) || $args['nocache'];
$transient_tpls = 'tcb_cloud_templates_' . $this->tag() . '_tpls_from_lp_set_' . $pack;
$transient_packs = 'tcb_cloud_templates_' . $this->tag() . '_packs_from_lp_set_' . $pack;
$transient_categories = 'tcb_cloud_templates_' . $this->tag() . '_categories_from_lp_set_' . $pack;
$return['tpls'] = get_transient( $transient_tpls );
$return['packs'] = get_transient( $transient_packs );
$return['categories'] = get_transient( $transient_categories );
if ( $do_not_use_cache || empty( $return['tpls'] ) || empty( $return['packs'] ) || empty( $return['categories'] ) ) {
require_once plugin_dir_path( __DIR__ ) . 'content-templates/class-tcb-content-templates-api.php';
try {
$return = tcb_content_templates_api()->get_all( $this->tag(), [ 'pack' => $pack ] );
if ( is_wp_error( $return ) ) {
return new WP_Error( 'tcb_error', $return->getMessage(), 501 );
}
if ( is_array( $return ) && ! empty( $return['tpls'] ) && ! empty( $return['packs'] ) && ! empty( $return['categories'] ) ) {
set_transient( $transient_tpls, $return['tpls'], 8 * HOUR_IN_SECONDS );
set_transient( $transient_packs, $return['packs'], 8 * HOUR_IN_SECONDS );
set_transient( $transient_categories, $return['categories'], 8 * HOUR_IN_SECONDS );
}
} catch ( Exception $e ) {
return new WP_Error( 'tcb_error', $e->getMessage(), 501 );
}
}
return $return;
}
/**
* Return all combined blocks
*
* @param bool $nocache
*
* @return array
*/
public function get_blocks( $nocache = false ) {
$blocks = [
'packs' => [],
'tpls' => [],
];
$special_block_set = apply_filters( 'tcb_get_special_blocks_set', '' );
if ( ! empty( $special_block_set ) ) {
$special_blocks = $this->get_lp_cloud_templates( [
'nocache' => $nocache,
'lp_set' => $special_block_set,
] );
if ( ! empty( $special_blocks ) && is_array( $special_blocks ) && ! empty( $special_blocks['packs'] ) && ! empty( $special_blocks['tpls'] ) ) {
$blocks['packs'] = array_merge( $blocks['packs'], $special_blocks['packs'] );
$blocks['tpls'] = array_merge( $blocks['tpls'], $special_blocks['tpls'] );
}
}
$content_blocks = $this->get_all_contentblocks_templates( [
'nocache' => $nocache,
] );
if ( is_wp_error( $content_blocks ) ) {
return new WP_Error( 'tcb_api_error', $content_blocks->get_error_message() );
}
$blocks['tpls'] = array_merge( $blocks['tpls'], $content_blocks );
if ( empty( $blocks['packs'] ) ) {
$blocks['packs'][] = [ 'name' => 'Content Blocks' ];
}
return $blocks;
}
/**
* Returns all contentblocks templates
* Used for improved LP BLocks + Content Templates Lightbox
*
* @param array $args
*
* @return array|WP_Error
*/
public function get_all_contentblocks_templates( $args = [] ) {
$args = wp_parse_args( $args, [
'nocache' => false,
] );
$do_not_use_cache = ( defined( 'TCB_TEMPLATE_DEBUG' ) && TCB_TEMPLATE_DEBUG ) || $args['nocache'];
$templates_transient = 'tcb_cloud_templates_' . $this->tag() . '_all_templates';
$templates = get_transient( $templates_transient );
if ( $do_not_use_cache || empty( $templates ) ) {
require_once plugin_dir_path( __DIR__ ) . 'content-templates/class-tcb-content-templates-api.php';
try {
$templates = tcb_content_templates_api()->get_all( $this->tag(), [ 'pack' => 'tcb.get.all.c.blocks.templates' ] );
set_transient( $templates_transient, $templates, 8 * HOUR_IN_SECONDS );
} catch ( Exception $exception ) {
return new WP_Error( 'tcb_error', $exception->getMessage(), 501 );
}
}
return $templates;
}
/**
* Fetches a list of cloud templates for an element
*
* @param array $args allows controlling aspects of the method:
* $nocache - do not use caching (transients)
*
* @return array|WP_Error
* @deprecated available only for backwards compatible: people who have content blocks saved in the content
*/
public function get_cloud_templates( $args = [] ) {
$args = wp_parse_args( $args, [
'nocache' => false,
] );
$pack_id = isset( $_GET['pack'] ) ? sanitize_text_field( $_GET['pack'] ) : '';
$return = [];
$do_not_use_cache = ( defined( 'TCB_TEMPLATE_DEBUG' ) && TCB_TEMPLATE_DEBUG ) || $args['nocache'];
$transient_tpls = 'tcb_cloud_templates_' . $this->tag() . '_tpls_from_pack_' . ( ! empty( $pack_id ) ? $pack_id : '' );
$transient_packs = 'tcb_cloud_templates_' . $this->tag() . '_packs';
$transient_categories = 'tcb_cloud_templates_' . $this->tag() . '_categories';
$return['tpls'] = get_transient( $transient_tpls );
$return['packs'] = get_transient( $transient_packs );
$return['categories'] = get_transient( $transient_categories );
if ( $do_not_use_cache || empty( $return['tpls'] ) || empty( $return['packs'] ) || empty( $return['categories'] ) || empty( $pack_id ) ) {
require_once plugin_dir_path( __DIR__ ) . 'content-templates/class-tcb-content-templates-api.php';
try {
$return = tcb_content_templates_api()->get_all( $this->tag(), [ 'pack' => $pack_id ] );
if ( empty( $pack_id ) ) {
$transient_tpls .= $return['from_pack'];
$pack_id = $return['from_pack'];
}
set_transient( $transient_tpls, $return['tpls'], 8 * HOUR_IN_SECONDS );
set_transient( $transient_packs, $return['packs'], 8 * HOUR_IN_SECONDS );
set_transient( $transient_categories, $return['categories'], 8 * HOUR_IN_SECONDS );
} catch ( Exception $e ) {
return new WP_Error( 'tcb_error', $e->getMessage(), 501 );
}
}
/**
* Favorites Blocks
*/
$favorites = get_option( 'thrv_fav_content_blocks', [] );
foreach ( $return['tpls'] as $index => $tpl ) {
$return['tpls'][ $index ]['fav'] = (int) ( ! empty( $favorites[ $pack_id ] ) && is_array( $favorites[ $pack_id ] ) && in_array( $tpl['id'], $favorites[ $pack_id ] ) );
}
return $return;
}
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Content Block', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'content block';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'content_block';
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.thrv-content-block';
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return self::get_thrive_advanced_label();
}
/**
* HTML layout of the element for when it's dragged in the canvas
*
* @return string
*/
protected function html() {
return tcb_template( 'elements/' . $this->tag() . '.php', $this, true );
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$contentblock = array(
'contentblock' => array(
'config' => array(
'ModalPicker' => array(
'config' => array(
'label' => __( 'Template', 'thrive-cb' ),
),
),
),
),
);
return array_merge( $contentblock, $this->group_component() );
}
public function is_placeholder() {
return false;
}
}

View File

@@ -0,0 +1,243 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_ContentBox_Element
*/
class TCB_ContentBox_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Content Box', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'container,box,content';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'content_box';
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.thrv_contentbox_shortcode, .thrv-content-box:not(.tve_lg_file)';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$prefix_config = array( 'css_prefix' => tcb_selection_root( false ) . ' .thrv-content-box ' );
$content_box = array(
'contentbox' => array(
'config' => array(
'ContentPalettes' => [
'config' => [],
'extends' => 'Palettes',
],
'BoxHeight' => array(
'config' => array(
'default' => '80',
'min' => '1',
'max' => '1000',
'label' => __( 'Minimum Height', 'thrive-cb' ),
'um' => [ 'px', 'vh' ],
'css' => 'min-height',
),
'to' => ' > .tve-cb',
'extends' => 'Slider',
),
'BoxWidth' => array(
'config' => array(
'default' => '1024',
'min' => '100',
'max' => '2000',
'label' => __( 'Maximum Width', 'thrive-cb' ),
'um' => [ 'px', '%' ],
'css' => 'max-width',
),
'extends' => 'Slider',
),
'MasterColor' => array(
'config' => array(
'default' => '000',
'label' => __( 'Master Color', 'thrive-cb' ),
'important' => true,
'affected_components' => [ 'shadow', 'background', 'borders' ],
'options' => [
'showGlobals' => false,
],
),
),
'VerticalPosition' => array(
'config' => array(
'name' => __( 'Vertical Position', 'thrive-cb' ),
'buttons' => [
[
'icon' => 'top',
'default' => true,
'value' => '',
],
[
'icon' => 'vertical',
'value' => 'center',
],
[
'icon' => 'bot',
'value' => 'flex-end',
],
],
'info' => true,
),
'extends' => 'ButtonGroup',
),
'style' => array(
'config' => array(
'to' => '> .tve-content-box-background',
'label' => __( 'Content Box Styles', 'thrive-cb' ),
'items' => array(
'cb_style_1' => __( 'Content box 1', 'thrive-cb' ),
'cb_style_2' => __( 'Content box 2', 'thrive-cb' ),
'cb_style_3' => __( 'Content box 3', 'thrive-cb' ),
'cb_style_4' => __( 'Content box 4', 'thrive-cb' ),
'cb_style_5' => __( 'Content box 5', 'thrive-cb' ),
'cb_style_6' => __( 'Content box 6', 'thrive-cb' ),
'cb_style_7' => __( 'Content box 7', 'thrive-cb' ),
'cb_style_8' => __( 'Content box 8', 'thrive-cb' ),
'cb_style_9' => __( 'Content box 9', 'thrive-cb' ),
'cb_style_10' => __( 'Content box 10', 'thrive-cb' ),
'cb_style_11' => __( 'Content box 11', 'thrive-cb' ),
'cb_style_12' => __( 'Content box 12', 'thrive-cb' ),
'cb_style_13' => __( 'Content box 13', 'thrive-cb' ),
'cb_style_14' => __( 'Content box 14', 'thrive-cb' ),
'cb_style_15' => __( 'Content box 15', 'thrive-cb' ),
),
'default_label' => __( 'Content box', 'thrive-cb' ),
'default' => 'default',
),
),
),
),
'borders' => [
'config' => [
'Borders' => [
'to' => '>.tve-content-box-background',
'important' => true,
],
'Corners' => [
'to' => '>.tve-content-box-background',
],
],
],
'layout' => [
'config' => [
'Position' => [
'important' => true,
'disabled_positions' => [ 'auto' ],
],
'Height' => [
'to' => '> .tve-cb',
'important' => true,
],
],
'disabled_controls' => [],
],
'background' => [
'config' => [
'to' => '>.tve-content-box-background',
],
],
'shadow' => [
'config' => [
'to' => '>.tve-content-box-background',
],
],
'decoration' => [
'config' => [
'to' => '>.tve-content-box-background',
],
],
'typography' => [
'disabled_controls' => [],
'config' => [
'to' => '> .tve-cb',
'FontSize' => $prefix_config,
'FontColor' => $prefix_config,
'LineHeight' => $prefix_config,
'FontFace' => $prefix_config,
'ParagraphStyle' => [ 'hidden' => false ],
],
],
'scroll' => [
'hidden' => false,
],
'conditional-display' => [
'hidden' => false,
],
);
return array_merge( $content_box, $this->shared_styles_component(), $this->group_component() );
}
/**
* @return bool
*/
public function has_hover_state() {
return true;
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_basic_label();
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'contentbox',
'link' => 'https://help.thrivethemes.com/en/articles/4425774-how-to-use-the-content-box-element',
],
];
}
}

View File

@@ -0,0 +1,281 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 5/12/2017
* Time: 8:28 AM //countdown
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Countdown_Element
*/
class TCB_Countdown_Element extends TCB_Cloud_Template_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Countdown', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'scarcity ';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'countdown';
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.tve-countdown';
}
public function is_placeholder() {
return false;
}
/**
* HTML layout of the element for when it's dragged in the canvas
*
* @return string
*/
public function html_placeholder( $title = null ) {
if ( empty( $title ) ) {
$title = $this->name();
}
return tcb_template( 'elements/element-placeholder', array(
'icon' => $this->icon(),
'class' => 'tcb-ct-placeholder',
'title' => $title,
'extra_attr' => 'data-ct="countdown-0" data-tcb-elem-type="countdown" data-specific-modal="countdown"',
), true );
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$components = array(
'countdown' => array(
'config' => array(
'CountdownPalette' => [
'config' => [],
'extends' => 'PalettesV2',
],
'EndDate' => array(
'config' => array(
'label' => __( 'End date', 'thrive-cb' ),
),
'extends' => 'DatePicker',
),
'ExternalFields' => [
'config' => [
'key' => 'countdown',
'shortcode_element' => '.thrv_countdown_timer',
],
'extends' => 'CustomFields',
],
'Day' => array(
'config' => array(
'inline' => true,
'name' => __( 'Days', 'thrive-cb' ),
'default' => 10,
'maxlength' => 3,
),
'extends' => 'Input',
),
'Hour' => array(
'config' => array(
'inline' => true,
'name' => __( 'H', 'thrive-cb' ),
'default' => 10,
'min' => 0,
'max' => 23,
'maxlength' => 2,
),
'extends' => 'Input',
),
'Minute' => array(
'config' => array(
'inline' => true,
'name' => __( 'M', 'thrive-cb' ),
'default' => 10,
'min' => 0,
'max' => 59,
'maxlength' => 2,
),
'extends' => 'Input',
),
'ShowSep' => array(
'config' => array(
'name' => '',
'label' => __( 'Enable tile separators', 'thrive-cb' ),
'default' => false,
),
'extends' => 'Switch',
),
'ShowElement' => array(
'config' => array(
'name' => '',
'label' => __( 'Display expired countdown', 'thrive-cb' ),
'default' => false,
),
'extends' => 'Switch',
),
'Second' => array(
'config' => array(
'inline' => true,
'name' => __( 'Seconds', 'thrive-cb' ),
'default' => 10,
'maxlength' => 2,
),
'extends' => 'Input',
),
'ExpDay' => array(
'config' => array(
'inline' => true,
'name' => __( 'Days', 'thrive-cb' ),
'default' => 10,
'maxlength' => 3,
),
'extends' => 'Input',
),
'ExpHour' => array(
'config' => array(
'inline' => true,
'name' => __( 'Hours', 'thrive-cb' ),
'default' => 10,
'maxlength' => 2,
),
'extends' => 'Input',
),
'StartAgain' => array(
'config' => array(
'name' => '',
'label' => __( 'Starts again after', 'thrive-cb' ),
'default' => false,
),
'extends' => 'Switch',
),
'Size' => array(
'config' => array(
'default' => '100',
'min' => '20',
'max' => '350',
'label' => __( 'Tile Size', 'thrive-cb' ),
'um' => [ 'px' ],
'css' => 'max-width',
),
'extends' => 'Slider',
),
),
),
'typography' => [
'hidden' => true,
],
'shadow' => [
'config' => [
'disabled_controls' => [ 'text' ],
],
],
'layout' => [
'disabled_controls' => [
'Overflow',
'ScrollStyle',
'Display',
'Width',
'Height',
'Float',
],
],
);
return array_merge(
apply_filters( 'tcb_countdown_controls', $components ),
$this->group_component()
);
}
public function has_group_editing() {
return array(
'select_values' => array(
array(
'value' => 'all_labels',
'selector' => ' .tve-countdown-label',
'name' => __( 'Grouped countdown labels', 'thrive-cb' ),
'singular' => __( '-- Countdown label item %s', 'thrive-cb' ),
),
array(
'value' => 'all_tiles',
'selector' => ' .tve-countdown-tile',
'name' => __( 'Grouped countdown tiles', 'thrive-cb' ),
'singular' => __( '-- Countdown tile item %s', 'thrive-cb' ),
),
array(
'value' => 'all_digits',
'selector' => ' .tve-countdown-digit',
'name' => __( 'Grouped countdown digits', 'thrive-cb' ),
'singular' => __( '-- Countdown digit item %s', 'thrive-cb' ),
),
array(
'value' => 'all_separators',
'selector' => ' .tve-countdown-separator',
'name' => __( 'Grouped countdown separators', 'thrive-cb' ),
'singular' => __( '-- Countdown separator item %s', 'thrive-cb' ),
'no_unlock' => true,
),
),
);
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'countdown',
'link' => 'https://help.thrivethemes.com/en/articles/4425793-how-to-use-the-countdown-elements',
],
];
}
}

View File

@@ -0,0 +1,76 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package TCB2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
/**
* Class TCB_Countdownevergreen_Template_Element
*/
class TCB_Countdownevergreen_Template_Element extends TCB_Countdown_Element {
/**
* @return string
*/
public function name() {
return __( 'Countdown Evergreen', 'thrive-cb' );
}
/**
* HTML layout of the element for when it's dragged in the canvas
*
* @return string
*/
public function html_placeholder( $title = null ) {
if ( empty( $title ) ) {
$title = $this->name();
}
return tcb_template( 'elements/element-placeholder', array(
'icon' => $this->icon(),
'class' => 'tcb-ct-placeholder tve-countdown-evergreen',
'title' => $title,
'extra_attr' => 'data-ct="' . $this->tag() . '-0" data-tcb-elem-type="' . $this->tag() . '" data-specific-modal="countdown"',
), true );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'scarcity ';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'countdown_evergreen';
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'countdown_evergreen',
'link' => 'https://help.thrivethemes.com/en/articles/4425793-how-to-use-the-countdown-elements',
],
];
}
}

View File

@@ -0,0 +1,154 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 3/28/2017
* Time: 10:09 AM
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Credit_Card_Element
*/
class TCB_Credit_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Credit Card', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'icon ';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'credit';
}
/**
* Text element identifier
*
* @return string
*/
public function identifier() {
return '.thrv-credit';
}
/**
* The HTML is generated from js
*
* @return string
*/
protected function html() {
return '';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return array(
'credit' => array(
'config' => array(
'size' => array(
'config' => array(
'default' => '25',
'min' => '10',
'max' => '150',
'label' => __( 'Size', 'thrive-cb' ),
'um' => [ 'px' ],
),
),
'monochrome_background' => array(
'css_suffix' => [
' .visa-style-4-st0',
' .masterCard-style-4-st0',
' .americanExpress-style-4-st0',
' .payPal-style-4-st0',
' .discover-style-4-st0',
' .bitcoin-style-4-st0',
' .googlePay-style-4-st0',
' .applePay-style-4-st0',
],
'config' => array(
'default' => '#595E60',
'label' => __( 'Color', 'thrive-cb' ),
),
),
'style' => array(
'config' => array(
'label' => __( 'Style', 'thrive-cb' ),
),
),
'stylePicker' => array(
'config' => array(
'label' => __( 'Change style', 'thrive-cb' ),
),
),
'cards' => array(
'config' => array(
'label' => __( 'Change cards', 'thrive-cb' ),
),
),
'preview' => [
'config' => [
'sortable' => true,
],
],
),
'order' => 1,
),
'typography' => [ 'hidden' => true ],
'shadow' => [ 'hidden' => true ],
'layout' => [
'disabled_controls' => [
'Overflow',
'ScrollStyle',
],
],
);
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'credit_card',
'link' => 'https://help.thrivethemes.com/en/articles/4425794-how-to-use-the-credit-card-element',
],
];
}
}

View File

@@ -0,0 +1,72 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Ct_Element
*
* Content templates - allows inserting saved content templates into the page
*/
class TCB_Ct_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Content Template', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'template,content';
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.thrv-ct';
}
/**
* This is only a placeholder element
*
* @return bool
*/
public function is_placeholder() {
return true;
}
/**
* Either to display or not the element in the sidebar menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_basic_label();
}
}

View File

@@ -0,0 +1,98 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Ct_Element
*
* Content templates - allows inserting saved content templates into the page
*/
class TCB_Ct_Symbol_Element extends TCB_Symbol_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Templates & Symbols', 'thrive-cb' );
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'templatesnsymbols';
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.thrv_ct_symbol';
}
/**
* HTML layout of the element for when it's dragged in the canvas
*
* @return string
*/
public function html() {
return tcb_template( 'elements/' . $this->tag() . '.php', $this, true );
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return [
'ct_symbol' => [
'config' => [],
],
];
}
/**
* General components that apply to all elements
*
* @return array
*/
public function general_components() {
return [
'layout' => [
'order' => 100,
],
'responsive' => [
'order' => 140,
],
];
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'templates_symbols',
'link' => 'https://help.thrivethemes.com/en/articles/4425777-how-to-use-the-templates-and-symbols-element-formerly-content-template',
],
];
}
}

View File

@@ -0,0 +1,172 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 4/20/2017
* Time: 3:49 PM
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Divider_Element
*/
class TCB_Divider_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Divider', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'line';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'divider';
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.thrv_wrapper:has(>.tve_sep), .thrv-divider';//'.thrv-divider';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return array(
'divider' => array(
'config' => array(
'divider_color' => array(
'config' => array(
'label' => __( 'Color', 'thrive-cb' ),
'options' => [
'showGlobals' => false,
],
),
'extends' => 'ColorPicker',
),
'ToggleColorControls' => [
'config' => [
'name' => __( 'Fill type', 'thrive-cb' ),
'buttons' => [
[ 'value' => 'tcb-divider-solid-color', 'text' => __( 'Solid', 'thrive-cb' ) ],
[ 'value' => 'tcb-divider-gradient-color', 'text' => __( 'Gradient', 'thrive-cb' ) ],
],
],
'extends' => 'ButtonGroup',
],
'DividerGradient' => [
'config' => [
'default' => '000',
'label' => __( 'Gradient', 'thrive-cb' ),
'options' => [
'output' => 'object',
'hasInput' => true,
],
],
'extends' => 'GradientPicker',
],
'thickness' => array(
'css_prefix' => apply_filters( 'tcb_divider_prefix', '' ),
'config' => array(
'default' => '5',
'min' => '1',
'max' => '100',
'label' => __( 'Thickness', 'thrive-cb' ),
'um' => [ 'px' ],
),
'extends' => 'Slider',
),
'style' => array(
'config' => array(
'label' => __( 'Choose Divider Style', 'thrive-cb' ),
'items' => array(
'tve_sep-1' => array(
'label' => __( 'Solid', 'thrive-cb' ),
'background_image' => '',
),
'tve_sep-2' => array(
'label' => __( 'Dotted', 'thrive-cb' ),
'background_image' => "data:image/svg+xml;charset=utf8,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 9 3' style='enable-background:new 0 0 9 3;' xml:space='preserve'%3E%3Ccircle fill='%thrive%' cx='4.5' cy='1.5' r='1.5'/%3E%3C/svg%3E",
),
'tve_sep-3' => array(
'label' => __( 'Dashed Slim', 'thrive-cb' ),
'background_image' => "data:image/svg+xml;charset=utf8,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 9 3' style='enable-background:new 0 0 9 3;' xml:space='preserve'%3E%3Crect x='2' y='1' fill='%thrive%' width='5' height='1'/%3E%3C/svg%3E",
),
'tve_sep-4' => array(
'label' => __( 'Dashed Thick', 'thrive-cb' ),
'background_image' => "data:image/svg+xml;charset=utf8,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 9 3' style='enable-background:new 0 0 9 3;' xml:space='preserve'%3E%3Crect x='1' y='0.4' fill='%thrive%' width='7' height='2.3'/%3E%3C/svg%3E",
),
'tve_sep-5' => array(
'label' => __( 'Starred', 'thrive-cb' ),
'background_image' => "data:image/svg+xml;charset=utf8,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 50 50' enable-background='new 0 0 50 50' xml:space='preserve' preserveAspectRatio='none slice'%3E%3Cpath fill='%thrive%' d='M44.4 39.2l-15-3.4-11.3 10.4-1.4-15.3-13.3-7.5 14.1-6 3-15.1 10.1 11.6 15.2-1.8-7.8 13.2z'/%3E%3C/svg%3E",
),
),
'default' => 'tve_sep1',
),
),
),
),
'typography' => [ 'hidden' => true ],
'borders' => [ 'hidden' => true ],
'animation' => [ 'hidden' => true ],
'background' => [ 'hidden' => true ],
'shadow' => [ 'hidden' => true ],
'layout' => [
'disabled_controls' => [
'.tve-advanced-controls',
'hr',
],
],
);
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'divider',
'link' => 'https://help.thrivethemes.com/en/articles/4425791-how-to-use-the-divider-and-star-rating-elements',
],
];
}
}

View File

@@ -0,0 +1,247 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package TCB2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TCB_Dynamic_Dropdown_Element extends TCB_Element_Abstract {
public function name() {
return __( 'Dropdown Field', 'thrive-cb' );
}
/**
* @inheritDoc
*/
public function expanded_state_apply_inline() {
return true;
}
public function identifier() {
return '.tve-dynamic-dropdown:not(.tcb-filter-dropdown)';
}
public function hide() {
return true;
}
/**
* @return bool
*/
public function has_hover_state() {
return true;
}
/**
* @inheritDoc
*/
public function expanded_state_config() {
return true;
}
public function own_components() {
$dropdown_svg = $this->get_icon_styles();
$dropdown_icons = [];
foreach ( $dropdown_svg as $key => & $dropdown_icon ) {
$dropdown_icons[ $key ] = $dropdown_icon['label'];
unset( $dropdown_icon['label'] );
}
unset( $dropdown_icon );
$controls_default_config = array(
'css_suffix' => ' span',
'css_prefix' => tcb_selection_root() . ' ',
);
$components = array(
'dynamic_dropdown' => array(
'config' => array(
'PlaceholderInput' => [
'config' => [
'label' => 'Placeholder',
],
'extends' => 'LabelInput',
],
'StyleChange' => array(
'config' => array(
'label' => __( 'Dropdown style', 'thrive-cb' ),
'preview' => [
'key' => '',
'label' => 'default',
],
),
),
'Width' => array(
'config' => array(
'default' => '0',
'min' => '10',
'max' => '500',
'label' => __( 'Width', 'thrive-cb' ),
'um' => [ '%', 'px' ],
'css' => 'max-width',
),
'extends' => 'Slider',
),
'SelectStylePicker' => array(
'config' => array(
'label' => __( 'Choose dropdown style', 'thrive-cb' ),
'items' => array(
'default' => array(
'label' => __( 'Default', 'thrive-cb' ),
),
'style-1' => array(
'label' => __( 'Style 1', 'thrive-cb' ),
),
'style-2' => array(
'label' => __( 'Style 2', 'thrive-cb' ),
),
'style-3' => array(
'label' => __( 'Style 3', 'thrive-cb' ),
),
'style-4' => array(
'label' => __( 'Style 4', 'thrive-cb' ),
),
'style-5' => array(
'label' => __( 'Style 5', 'thrive-cb' ),
),
'style-6' => array(
'label' => __( 'Style 6', 'thrive-cb' ),
),
'style-7' => array(
'label' => __( 'Style 7', 'thrive-cb' ),
),
'style-8' => array(
'label' => __( 'Style 8', 'thrive-cb' ),
),
'style-9' => array(
'label' => __( 'Style 9', 'thrive-cb' ),
),
'style-10' => array(
'label' => __( 'Style 10', 'thrive-cb' ),
),
'style-11' => array(
'label' => __( 'Style 11', 'thrive-cb' ),
),
'style-12' => array(
'label' => __( 'Style 12', 'thrive-cb' ),
),
'style-13' => array(
'label' => __( 'Style 13', 'thrive-cb' ),
),
'style-14' => array(
'label' => __( 'Style 14', 'thrive-cb' ),
),
'style-15' => array(
'label' => __( 'Style 15', 'thrive-cb' ),
),
),
'default' => 'default',
),
),
'DropdownIcon' => array(
'config' => array(
'name' => __( 'Dropdown icon', 'thrive-cb' ),
'options' => $dropdown_icons,
),
'paths' => $dropdown_svg,
),
'DropdownAnimation' => array(
'config' => array(
'name' => __( 'Dropdown animation', 'thrive-cb' ),
'options' => array(
'' => __( 'None (instant)', 'thrive-cb' ),
'da-fade' => __( 'Fade In and Out ', 'thrive-cb' ),
'da-slide' => __( 'Slide Down', 'thrive-cb' ),
'da-fold' => __( 'Fold Out', 'thrive-cb' ),
),
),
'extends' => 'Select',
),
),
),
'typography' => [
'disabled_controls' => [ 'TextAlign' ],
'config' => [
'FontSize' => $controls_default_config,
'FontColor' => $controls_default_config,
'FontFace' => $controls_default_config,
'LetterSpacing' => $controls_default_config,
'LineHeight' => $controls_default_config,
'TextAlign' => $controls_default_config,
'TextStyle' => $controls_default_config,
'TextTransform' => $controls_default_config,
],
],
'layout' => [
'disabled_controls' => [
'Width',
'Height',
'Alignment',
'.tve-advanced-controls',
],
],
'animation' => [
'hidden' => true,
],
'styles-templates' => [
'config' => [
'to' => 'select',
],
],
'responsive' => [
'hidden' => true,
],
'borders' => array(
'config' => array(
'Borders' => array(
'css_prefix' => tcb_selection_root() . ' ',
'important' => true,
),
'Corners' => array(
'css_prefix' => tcb_selection_root() . ' ',
'important' => true,
),
),
),
'shadow' => array(
'config' => array(
'css_prefix' => tcb_selection_root() . ' ',
'important' => true,
),
),
);
return array_merge( $components, $this->group_component() );
}
public function get_icon_styles() {
return [
'style_1' => [
'label' => 'Angle',
'up' => '<path d="M151.5 347.8L3.5 201c-4.7-4.7-4.7-12.3 0-17l19.8-19.8c4.7-4.7 12.3-4.7 17 0L160 282.7l119.7-118.5c4.7-4.7 12.3-4.7 17 0l19.8 19.8c4.7 4.7 4.7 12.3 0 17l-148 146.8c-4.7 4.7-12.3 4.7-17 0z"/>',
'box' => '0 0 320 512',
],
'style_2' => [
'label' => 'Chevron',
'up' => '<path d="M443.5 162.6l-7.1-7.1c-4.7-4.7-12.3-4.7-17 0L224 351 28.5 155.5c-4.7-4.7-12.3-4.7-17 0l-7.1 7.1c-4.7 4.7-4.7 12.3 0 17l211 211.1c4.7 4.7 12.3 4.7 17 0l211-211.1c4.8-4.7 4.8-12.3.1-17z"/>',
'box' => '0 0 448 512',
],
'style_3' => [
'label' => 'Caret',
'up' => '<path d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"/>',
'box' => '0 0 320 512',
],
'style_4' => [
'label' => 'Triangle',
'up' => '<path d="M272 160H48.1c-42.6 0-64.2 51.7-33.9 81.9l111.9 112c18.7 18.7 49.1 18.7 67.9 0l112-112c30-30.1 8.7-81.9-34-81.9zM160 320L48 208h224L160 320z"/>',
'box' => '0 0 320 512',
],
];
}
}

View File

@@ -0,0 +1,101 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package TCB2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TCB_Dynamic_Dropdown_Option_Element extends TCB_Element_Abstract {
public function name() {
return __( 'Dropdown Field Option', 'thrive-cb' );
}
public function identifier() {
return '.tve-dynamic-dropdown-option';
}
public function hide() {
return true;
}
/**
* @return bool
*/
public function has_hover_state() {
return true;
}
/**
* @inheritDoc
*/
public function active_state_config() {
return true;
}
public function own_components() {
$prefix_config = tcb_selection_root() . ' ';
$suffix = ' .tve-input-option-text';
return [
'typography' => [
'config' => [
'FontColor' => [
'css_suffix' => $suffix,
'important' => true,
],
'TextAlign' => [
'css_suffix' => $suffix,
'css_prefix' => $prefix_config,
'important' => true,
],
'FontSize' => [
'css_suffix' => $suffix,
'important' => true,
],
'TextStyle' => [
'css_suffix' => $suffix,
'css_prefix' => $prefix_config,
'important' => true,
],
'LineHeight' => [
'css_suffix' => $suffix,
'important' => true,
],
'FontFace' => [
'css_suffix' => $suffix,
'important' => true,
],
'LetterSpacing' => [
'css_suffix' => $suffix,
'css_prefix' => $prefix_config,
'important' => true,
],
'TextTransform' => [
'css_suffix' => $suffix,
'css_prefix' => $prefix_config,
'important' => true,
],
],
],
'layout' => [
'disabled_controls' => [
'margin',
'.tve-advanced-controls',
'Alignment',
'Display',
],
],
'animation' => [
'hidden' => true,
],
'styles-templates' => [ 'hidden' => true ],
'responsive' => [ 'hidden' => true ],
];
}
}

View File

@@ -0,0 +1,177 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Fillcounter_Element
*/
class TCB_Fillcounter_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Fill Counter', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'progress,fill';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'fill_counter';
}
/**
* Fillcounter element identifier
*
* @return string
*/
public function identifier() {
return '.thrv_fill_counter, .thrv-fill-counter';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return array(
'fillcounter' => array(
'config' => array(
'CounterSize' => array(
'config' => array(
'default' => '202',
'min' => '0',
'max' => '2000',
'label' => __( 'Counter Size', 'thrive-cb' ),
'um' => [ 'px' ],
),
'extends' => 'Slider',
),
'FillPercent' => array(
'to' => '.tve_fill_counter_n',
'config' => array(
'default' => '75',
'min' => '0',
'max' => '100',
'label' => __( 'Fill Percentage', 'thrive-cb' ),
'um' => [ '%' ],
),
'extends' => 'Slider',
),
'ExternalFields' => [
'config' => [
'key' => 'number',
'shortcode_element' => '.tve_fill_counter_n',
],
'extends' => 'CustomFields',
],
'FillColor' => array(
'to' => '.tve_fill_counter_n',
'config' => array(
'default' => '000',
'label' => __( 'Fill', 'thrive-cb' ),
'options' => [
'output' => 'object',
],
),
'extends' => 'ColorPicker',
),
'CircleColor' => array(
'to' => '.tve_fill_counter_n',
'config' => array(
'default' => '000',
'label' => __( 'Circle', 'thrive-cb' ),
'options' => [
'output' => 'object',
],
),
'extends' => 'ColorPicker',
),
'InnerColor' => array(
'to' => '.tve_fill_counter_n',
'config' => array(
'default' => '000',
'label' => __( 'Inner Color', 'thrive-cb' ),
'options' => [
'output' => 'object',
],
),
'extends' => 'ColorPicker',
),
'DynamicPercent' => array(
'config' => array(
'name' => '',
'label' => __( 'Match fill value with dial value', 'thrive-cb' ),
'default' => true,
),
'to' => '.tve_fill_counter_n',
'extends' => 'Switch',
),
),
),
'layout' => [
'disabled_controls' => [
'Width',
'Height',
'Overflow',
'ScrollStyle',
],
],
'typography' => [ 'hidden' => true ],
'background' => [ 'hidden' => true ],
'shadow' => [
'config' => [
'disabled_controls' => [ 'inner', 'text' ],
],
],
'animation' => [ 'hidden' => true ],
);
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'fill_counter',
'link' => 'https://help.thrivethemes.com/en/articles/4425789-how-to-use-the-fill-counter-element',
],
];
}
}

View File

@@ -0,0 +1,199 @@
<?php
/**
* FileName class-tcb-footer-element.php.
*
* @project : thrive-visual-editor
*/
/**
* Class TCB_Footer_Element
*/
class TCB_Footer_Element extends TCB_Symbol_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Footer', 'thrive-cb' );
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'post_grid';
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.thrv_symbol.thrv_footer';
}
/**
* Whether or not this element is only a placeholder ( it has no menu, it's not selectable etc )
* e.g. Content Templates
*
* @return bool
*/
public function is_placeholder() {
return false;
}
/**
* Either to display or not the element in the sidebar menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$background_selector = '.symbol-section-out';
$content_selector = '.symbol-section-in';
$components = array(
'footer' => array(
'config' => array(
'Visibility' => array(
'config' => array(
'name' => '',
'label' => __( 'Visibility', 'thrive-cb' ),
'default' => true,
),
'extends' => 'Switch',
),
'InheritContentSize' => array(
'config' => array(
'name' => '',
'label' => __( 'Inherit content size from layout', 'thrive-cb' ),
'default' => true,
),
'extends' => 'Switch',
),
'StretchBackground' => array(
'config' => array(
'name' => '',
'label' => __( 'Stretch background to full width', 'thrive-cb' ),
'default' => true,
),
'extends' => 'Switch',
),
'ContentWidth' => array(
'config' => array(
'default' => '1080',
'min' => '1',
'max' => '1980',
'label' => __( 'Content Width', 'thrive-cb' ),
'um' => [ 'px' ],
'css' => 'max-width',
),
'extends' => 'Slider',
),
'StretchContent' => array(
'config' => array(
'name' => '',
'label' => __( 'Stretch content to full width', 'thrive-cb' ),
'default' => true,
),
'extends' => 'Switch',
),
'Height' => array(
'config' => array(
'default' => '1024',
'min' => '1',
'max' => '1000',
'label' => __( 'Footer Minimum Height', 'thrive-cb' ),
'um' => [ 'px', 'vh' ],
'css' => 'min-height',
),
'to' => $content_selector,
'extends' => 'Slider',
),
'FullHeight' => array(
'config' => array(
'name' => '',
'label' => __( 'Match height to screen', 'thrive-cb' ),
'default' => true,
),
'to' => $content_selector,
'extends' => 'Switch',
),
'VerticalPosition' => array(
'config' => array(
'name' => __( 'Vertical Position', 'thrive-cb' ),
'buttons' => [
[
'icon' => 'top',
'default' => true,
'value' => '',
],
[
'icon' => 'vertical',
'value' => 'center',
],
[
'icon' => 'bot',
'value' => 'flex-end',
],
],
),
'to' => $content_selector,
'extends' => 'ButtonGroup',
),
),
),
'background' => [
'config' => [
'css_suffix' => ' .symbol-section-out',
],
'disabled_controls' => [],
],
'shadow' => [
'config' => [
'to' => $background_selector,
],
],
'layout' => [
'disabled_controls' => [ '.tve-advanced-controls', 'Float', 'hr', 'Position', 'PositionFrom', 'zIndex', 'Width', 'Height', 'Alignment', 'Display' ],
],
'borders' => [
'config' => [
'Borders' => [],
'Corners' => [],
'css_suffix' => ' .thrive-symbol-shortcode',
],
],
'typography' => [
'disabled_controls' => [],
'config' => [
'to' => $content_selector,
],
],
'decoration' => [
'config' => [
'to' => $background_selector,
],
],
'animation' => [ 'hidden' => true ],
'styles-templates' => [ 'hidden' => true ],
);
$components['layout']['config']['MarginAndPadding']['padding_to'] = $content_selector;
return $components;
}
}

View File

@@ -0,0 +1,107 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package TCB2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
require_once __DIR__ . '/class-tcb-icon-element.php';
class TCB_Form_Icon_Element extends TCB_Icon_Element {
protected $_tag = 'form-icon';
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'icon,media';
}
/**
* @return string
*/
public function identifier() {
return '.tve_lg_input_container:not(.tve_lg_file) .thrv_icon, .tve-login-form-input .thrv_icon';
}
/**
* @return bool
*/
public function hide() {
return true;
}
/**
* @return array
*/
public function own_components() {
$prefix_config = tcb_selection_root();
return array(
'icon' => array(
'config' => array(
'ColorPicker' => array(
'css_prefix' => $prefix_config . ' ',
'css_suffix' => ' > :first-child',
'config' => array(
'label' => __( 'Icon color', 'thrive-cb' ),
),
),
'Slider' => array(
'css_prefix' => $prefix_config . ' ',
'config' => array(
'default' => '30',
'min' => '10',
'max' => '200',
'label' => __( 'Icon size', 'thrive-cb' ),
'um' => [ 'px' ],
'css' => 'fontSize',
),
),
),
),
'typography' => [
'hidden' => true,
],
'layout' => [
'config' => [
'MarginAndPadding' => [
'css_prefix' => $prefix_config . ' ',
],
],
'disabled_controls' => [
'Width',
'Height',
'Alignment',
'.tve-advanced-controls',
],
],
'borders' => [
'config' => [
'Borders' => [
'css_prefix' => $prefix_config . ' ',
],
'Corners' => [
'css_prefix' => $prefix_config . ' ',
],
],
],
'shadow' => [
'config' => [
'disabled_controls' => [ 'text' ],
],
],
'animation' => [
'hidden' => true,
],
);
}
}

View File

@@ -0,0 +1,138 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 10/15/2018
* Time: 3:27 PM
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TCB_Form_Input_Element extends TCB_Element_Abstract {
/**
* Name of the Element
*
* @return string
*/
public function name() {
return __( 'Form Input', 'thrive-cb' );
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.tve-form-input';
}
/**
* Enables Hover States on Form Input
*
* @return bool
*/
public function has_hover_state() {
return true;
}
/**
* There is no need for HTML for this element since we need it only for control filter
*
* @return string
*/
protected function html() {
return '';
}
/**
* Hide Element From Sidebar Menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* Component and control configda
*
* @return array
*/
public function own_components() {
$prefix_config = tcb_selection_root();
$controls_default_config = [
'css_suffix' => [
' input',
' input::placeholder',
' textarea',
' textarea::placeholder',
],
];
$tag_default_config = [
'css_suffix' => [
' input',
' textarea',
],
];
return array(
'typography' => [
'config' => [
'FontSize' => $controls_default_config,
'FontColor' => $controls_default_config,
'TextAlign' => $controls_default_config,
'TextStyle' => $controls_default_config,
'TextTransform' => $controls_default_config,
'FontFace' => $controls_default_config,
'LineHeight' => $controls_default_config,
'LetterSpacing' => $controls_default_config,
],
],
'layout' => [
'disabled_controls' => [
'Width',
'Height',
'Alignment',
'Display',
'.tve-advanced-controls',
],
'config' => [
'MarginAndPadding' => $tag_default_config,
],
],
'borders' => array(
'config' => array(
'Borders' => array_merge( [ 'css_prefix' => $prefix_config . ' ' ], $tag_default_config ),
'Corners' => array_merge( [ 'css_prefix' => $prefix_config . ' ' ], $tag_default_config ),
),
),
'animation' => [
'hidden' => true,
],
'background' => [
'config' => [
'ColorPicker' => $tag_default_config,
'PreviewList' => $tag_default_config,
],
],
'shadow' => [
'config' => $tag_default_config,
],
'responsive' => [
'hidden' => true,
],
'styles-templates' => [
'hidden' => true,
],
);
}
}

View File

@@ -0,0 +1,59 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 10/15/2018
* Time: 3:38 PM
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TCB_Form_Item_Element extends TCB_Element_Abstract {
public function name() {
return __( 'Form Item', 'thrive-cb' );
}
public function identifier() {
return '.tve-form-item';
}
/**
* Hide Element From Sidebar Menu
*
* @return bool
*/
public function hide() {
return true;
}
public function own_components() {
return [
'typography' => [
'hidden' => true,
],
'layout' => [
'disabled_controls' => [
'Width',
'Height',
'Alignment',
'Display',
'.tve-advanced-controls',
],
],
'animation' => [
'hidden' => true,
],
'responsive' => [
'hidden' => true,
],
'styles-templates' => [
'hidden' => true,
],
];
}
}

View File

@@ -0,0 +1,102 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 10/15/2018
* Time: 3:51 PM
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TCB_Form_Label_Element extends TCB_Element_Abstract {
/**
* Name of the Element
*
* @return string
*/
public function name() {
return __( 'Form Label', 'thrive-cb' );
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.tve-form-item label';
}
/**
* There is no need for HTML for this element since we need it only for control filter
*
* @return string
*/
protected function html() {
return '';
}
/**
* Hide Element From Sidebar Menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return [
'typography' => [
'disabled_controls' => [ 'TextAlign', '.tve-advanced-controls' ],
'config' => [
'css_suffix' => '',
'FontSize' => [
'css_suffix' => '',
'important' => true,
],
'FontColor' => [
'css_suffix' => '',
'important' => true,
],
'LineHeight' => [
'css_suffix' => '',
'important' => true,
],
'LetterSpacing' => [
'css_suffix' => '',
'important' => true,
],
'FontFace' => [
'css_suffix' => '',
'important' => true,
],
'TextStyle' => [
'css_suffix' => '',
'important' => true,
],
],
],
'animation' => [
'hidden' => true,
],
'responsive' => [
'hidden' => true,
],
'styles-templates' => [
'hidden' => true,
],
];
}
}

View File

@@ -0,0 +1,45 @@
<?php
class TCB_Form_State_Element extends TCB_Element_Abstract {
public function name() {
return __( 'Form State', 'thrive-cb' );
}
public function identifier() {
return '.tve-form-state';
}
/**
* Hide Element From Sidebar Menu
*
* @return bool
*/
public function hide() {
return true;
}
public function own_components() {
return [
'typography' => [ 'hidden' => true, ],
'animation' => [ 'hidden' => true, ],
'responsive' => [ 'hidden' => true, ],
'background' => [
'config' => [],
],
'shadow' => [
'config' => [],
],
'layout' => [
'disabled_controls' => [ 'Width', 'Height', 'Display', 'Alignment', 'Float', 'Position', 'PositionFrom' ],
],
'borders' => [
'config' => [
'Borders' => [],
'Corners' => [],
],
],
];
}
}

View File

@@ -0,0 +1,157 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 10/15/2018
* Time: 4:05 PM
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TCB_Form_Submit_Element extends TCB_Element_Abstract {
public function name() {
return __( 'Form Submit', 'thrive-cb' );
}
public function identifier() {
return '.tve-form-submit';
}
public function has_hover_state() {
return true;
}
public function hide() {
return true;
}
public function own_components() {
$prefix_config = tcb_selection_root();
$controls_default_config = [
'css_suffix' => ' button',
'css_prefix' => $prefix_config . ' ',
];
return array(
'form_submit' => array(
'config' => array(
'ModalPicker' => array(
'config' => array(
'label' => __( 'Add Icon', 'thrive-cb' ),
),
),
'icon_side' => array(
'css_suffix' => ' .thrv_icon',
'css_prefix' => $prefix_config . ' ',
'config' => array(
'name' => __( 'Icon Side', 'thrive-cb' ),
'buttons' => array(
array(
'value' => 'left',
'text' => __( 'Left', 'thrive-cb' ),
),
array(
'value' => 'right',
'text' => __( 'Right', 'thrive-cb' ),
),
),
),
),
'ButtonWidth' => array(
'css_prefix' => $prefix_config . ' ',
'config' => array(
'default' => '100',
'min' => '10',
'max' => '100',
'label' => __( 'Button width', 'thrive-cb' ),
'um' => [ '%' ],
'css' => 'width',
),
'extends' => 'Slider',
),
'ButtonAlign' => array(
'config' => array(
'name' => __( 'Button Align', 'thrive-cb' ),
'buttons' => [
[
'icon' => 'a_left',
'text' => '',
'value' => 'left',
'default' => true,
],
[
'icon' => 'a_center',
'text' => '',
'value' => 'center',
],
[
'icon' => 'a_right',
'text' => '',
'value' => 'right',
],
[
'icon' => 'a_full-width',
'text' => '',
'value' => 'justify',
],
],
),
'extends' => 'ButtonGroup',
),
),
),
'typography' => [
'config' => [
'FontSize' => $controls_default_config,
'FontColor' => $controls_default_config,
'TextAlign' => $controls_default_config,
'TextStyle' => $controls_default_config,
'TextTransform' => $controls_default_config,
'FontFace' => $controls_default_config,
'LineHeight' => $controls_default_config,
'LetterSpacing' => $controls_default_config,
],
],
'layout' => [
'disabled_controls' => [
'Width',
'Height',
'Alignment',
'.tve-advanced-controls',
],
'config' => [
'MarginAndPadding' => $controls_default_config,
],
],
'borders' => [
'config' => [
'Borders' => $controls_default_config,
'Corners' => $controls_default_config,
],
],
'animation' => [
'hidden' => true,
],
'responsive' => [
'hidden' => true,
],
'background' => [
'config' => [
'ColorPicker' => $controls_default_config,
'PreviewList' => $controls_default_config,
],
],
'shadow' => [
'config' => $controls_default_config,
],
'styles-templates' => [
'config' => [
'to' => 'button',
],
],
);
}
}

View File

@@ -0,0 +1,163 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 4/28/2017
* Time: 4:08 PM
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Gmaps_Element
*/
class TCB_Gmap_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Google Map', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'address';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'gmaps';
}
/**
* WordPress element identifier
*
* @return string
*/
public function identifier() {
return '.thrv-google-map-embedded-code, .tve-flexible-container';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return array(
'gmap' => array(
'config' => array(
'ExternalFields' => [
'config' => [
'key' => 'map',
'shortcode_element' => 'iframe',
],
'extends' => 'CustomFields',
],
'address' => array(
'config' => array(
'label' => __( 'Address', 'thrive-cb' ),
'placeholder' => __( 'Insert Address', 'thrive-cb' ),
),
'extends' => 'LabelInput',
),
'zoom' => array(
'config' => array(
'default' => '10',
'min' => '1',
'max' => '20',
'label' => __( 'Zoom', 'thrive-cb' ),
'um' => '',
),
'extends' => 'Slider',
),
'fullWidth' => array(
'config' => array(
'name' => '',
'label' => __( 'Stretch to fit screen width', 'thrive-cb' ),
),
'extends' => 'Switch',
),
'width' => array(
'config' => array(
'default' => '0',
'min' => '0',
'max' => '2000',
'label' => __( 'Width', 'thrive-cb' ),
'um' => [ 'px', '%', 'vh', 'vw' ],
'css' => 'width',
),
'extends' => 'Slider',
),
'height' => array(
'config' => array(
'default' => '0',
'min' => '0',
'max' => '2000',
'label' => __( 'Height', 'thrive-cb' ),
'um' => [ 'px', 'vh' ],
'css' => 'height',
),
'extends' => 'Slider',
),
),
),
'background' => [
'hidden' => true,
],
'typography' => [
'hidden' => true,
],
'animation' => [
'hidden' => true,
],
'shadow' => [
'config' => [
'disabled_controls' => [ 'text' ],
],
],
'layout' => [
'disabled_controls' => [
'.tve-advanced-controls',
],
],
);
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'google_map',
'link' => 'https://help.thrivethemes.com/en/articles/4425799-how-to-use-the-custom-html-and-google-map-elements',
],
];
}
}

View File

@@ -0,0 +1,76 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Guaranteebox_Element
*/
class TCB_Guaranteebox_Element extends TCB_Cloud_Template_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Guarantee Box', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'box, template, content';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'guarantee_box';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return [];
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'guarantee_box',
'link' => 'https://help.thrivethemes.com/en/articles/4425744-adding-guarantee-boxes-to-your-thrive-architect-pages',
],
];
}
}

View File

@@ -0,0 +1,58 @@
<?php
if ( ! class_exists( 'TCB_Menu_Element', false ) ) {
require_once __DIR__ . '/class-tcb-menu-element.php';
}
/**
* Class TCB_Hamburger_Menu_Element
*/
class TCB_Hamburger_Menu_Element extends TCB_Menu_Element {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Menu Element', 'thrive-cb' );
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.thrv_wrapper:not(.tve-regular) .tve-ham-wrap > .tve_w_menu';
}
/**
* There is no need for HTML for this element since we need it only for control filter
*
* @return string
*/
protected function html() {
return '';
}
public function hide() {
return true;
}
public function own_components() {
$components = parent::own_components();
unset( $components['background'] );
unset( $components['borders'] );
unset( $components['shadow'] );
$components['conditional-display'] = [ 'hidden' => true ];
$components['responsive'] = [ 'hidden' => true ];
$components['layout'] = [ 'hidden' => true ];
unset( $components['menu']['config']['MenuWidth']['css_suffix'] );
return $components;
}
}

View File

@@ -0,0 +1,260 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Footer_Element
*/
class TCB_Header_Element extends TCB_Symbol_Element_Abstract {
/**
* TCB_Header_Element constructor.
*
* @param string $tag element tag.
*/
public function __construct( $tag = '' ) {
parent::__construct( $tag );
}
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Header', 'thrive-cb' );
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'post_grid';
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.thrv_symbol.thrv_header';
}
/**
* Whether or not this element is only a placeholder ( it has no menu, it's not selectable etc )
* e.g. Content Templates
*
* @return bool
*/
public function is_placeholder() {
return false;
}
/**
* Either to display or not the element in the sidebar menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$background_selector = '.symbol-section-out';
$content_selector = '.symbol-section-in';
$components = array(
'header' => array(
'config' => array(
'Visibility' => array(
'config' => array(
'name' => '',
'label' => __( 'Visibility', 'thrive-cb' ),
'default' => true,
),
'extends' => 'Switch',
),
'InheritContentSize' => array(
'config' => array(
'name' => '',
'label' => __( 'Inherit content size from layout', 'thrive-cb' ),
'default' => true,
),
'extends' => 'Switch',
),
'StretchBackground' => array(
'config' => array(
'name' => '',
'label' => __( 'Stretch background to full width', 'thrive-cb' ),
'default' => true,
),
'extends' => 'Switch',
),
'ContentWidth' => array(
'config' => array(
'default' => '1080',
'min' => '1',
'max' => '1980',
'label' => __( 'Content width', 'thrive-cb' ),
'um' => [ 'px' ],
'css' => 'max-width',
),
'extends' => 'Slider',
'css_suffix' => $content_selector,
),
'StretchContent' => array(
'config' => array(
'name' => '',
'label' => __( 'Stretch content to full width', 'thrive-cb' ),
'default' => true,
),
'extends' => 'Switch',
'css_suffix' => ' .symbol-section-in',
),
'HeaderPosition' => array(
'config' => array(
'name' => 'Header position',
'full-width' => true,
'buttons' => array(
array( 'value' => 'push', 'text' => __( 'Push content' ), 'default' => true ),
array( 'value' => 'over', 'text' => __( 'Over content' ) ),
),
),
'extends' => 'ButtonGroup',
),
'Height' => array(
'config' => array(
'default' => '80',
'min' => '1',
'max' => '1000',
'label' => __( 'Content minimum height', 'thrive-cb' ),
'um' => [ 'px', 'vh' ],
'css' => 'min-height',
),
'to' => $content_selector,
'extends' => 'Slider',
),
'FullHeight' => array(
'config' => array(
'name' => '',
'label' => __( 'Match height to screen', 'thrive-cb' ),
'default' => true,
),
'to' => $content_selector,
'extends' => 'Switch',
),
'VerticalPosition' => array(
'config' => array(
'name' => __( 'Vertical position', 'thrive-cb' ),
'buttons' => [
[
'icon' => 'top',
'default' => true,
'value' => '',
],
[
'icon' => 'vertical',
'value' => 'center',
],
[
'icon' => 'bot',
'value' => 'flex-end',
],
],
),
'to' => $content_selector,
'extends' => 'ButtonGroup',
),
'StateSelect' => array(
'config' => array(
'name' => __( 'Header state', 'thrive-cb' ),
'options' => array(
'tve-default-state' => __( 'On load', 'thrive-cb' ),
'tve-scroll-state' => __( 'On scroll', 'thrive-cb' ),
),
),
'extends' => 'Select',
),
),
),
'background' => [
'config' => [
'to' => $background_selector,
],
'disabled_controls' => [],
],
'shadow' => [
'config' => [
'to' => $background_selector,
],
],
'layout' => [
'disabled_controls' => [ '.tve-advanced-controls', 'Float', 'hr', 'Position', 'PositionFrom', 'zIndex', 'Width', 'Height', 'Alignment', 'Display' ],
],
'borders' => [
'config' => [
'Borders' => [],
'Corners' => [],
'css_suffix' => ' .thrive-symbol-shortcode',
],
],
'typography' => [
'disabled_controls' => [],
'config' => [
'to' => $content_selector,
],
],
'decoration' => [
'config' => [
'to' => $background_selector,
],
],
'animation' => [ 'hidden' => true ],
'scroll' => [
'order' => 2,
'config' => [
'to' => '.thrive-symbol-shortcode',
],
'disabled_controls' => [ '[data-value="parallax"]' ],
'hidden' => false,
],
'styles-templates' => [ 'hidden' => true ],
);
$components['layout']['config']['MarginAndPadding']['padding_to'] = $content_selector;
return $components;
}
/**
* Update meta for scroll on behaviour
*
* @param $meta
*
* @return bool
*/
public function update_meta( $meta ) {
$header_id = $meta['header_id'];
update_post_meta( $header_id, $meta['meta_key'], $meta['meta_value'] );
return true;
}
}

View File

@@ -0,0 +1,98 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 4/18/2017
* Time: 11:52 AM
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Html_Element
*/
class TCB_Html_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Custom HTML', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'code';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'custom_html';
}
/**
* WordPress element identifier
*
* @return string
*/
public function identifier() {
return '.thrv_custom_html_shortcode'; // For backwards compatibility
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return [
'html' => [
'config' => [],
],
'typography' => [ 'hidden' => true ],
'borders' => [ 'hidden' => true ],
'animation' => [ 'hidden' => true ],
'background' => [ 'hidden' => true ],
'shadow' => [ 'hidden' => true ],
'layout' => [
'disabled_controls' => [],
],
];
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'custom_html',
'link' => 'https://help.thrivethemes.com/en/articles/4425799-how-to-use-the-custom-html-and-google-map-elements',
],
];
}
}

View File

@@ -0,0 +1,220 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package TCB2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
/**
* Class TCB_Icon_Element
*/
class TCB_Icon_Element extends TCB_Element_Abstract {
/**
* @return string
*/
public function icon() {
return 'icon';
}
/**
* @return string
*/
public function name() {
return __( 'Icon', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'media,icon,icons';
}
/**
* @return string
*/
public function identifier() {
/**
* These elements all inherit the icon element class (this one)
* Since they all have the '.thrv_icon' class, we must ensure that they are matched by their own identifiers, not by this, so we add them inside :not()
*/
$not_icon_elements = implode( ', ', [
'.tve_lg_input_container .thrv_icon',
'.tve-login-form-input .thrv_icon',
'.tcb-carousel-arrow',
'.tcb-icon-open',
'.tcb-icon-close',
'.tcb-icon-close-offscreen',
] );
return ".tve_lg_file .thrv_icon, .thrv_icon:not($not_icon_elements)";
}
/**
* @return array
*/
public function own_components() {
return array(
'icon' => array(
'config' => array(
'ToggleColorControls' => [
'config' => [
'name' => __( 'Color type', 'thrive-cb' ),
'buttons' => [
[ 'value' => 'tcb-icon-solid-color', 'text' => __( 'Solid', 'thrive-cb' ) ],
[ 'value' => 'tcb-icon-gradient-color', 'text' => __( 'Gradient', 'thrive-cb' ) ],
],
],
'extends' => 'ButtonGroup',
],
'ColorPicker' => array(
'css_prefix' => tcb_selection_root() . ' ',
'css_suffix' => ' > :first-child',
'config' => array(
'label' => __( 'Color', 'thrive-cb' ),
'options' => [ 'noBeforeInit' => false ],
),
),
'GradientPicker' => [
'config' => [
'default' => '000',
'label' => __( 'Gradient', 'thrive-cb' ),
'options' => [
'output' => 'object',
'hasInput' => true,
],
],
'extends' => 'GradientPicker',
],
'StyleColor' => [
'css_prefix' => tcb_selection_root() . ' ',
'css_suffix' => ' > :first-child',
'config' => [
'default' => '000',
'label' => __( 'Style color', 'thrive-cb' ),
'info' => true,
'options' => [
'output' => 'object',
],
],
'extends' => 'ColorPicker',
],
'Slider' => array(
'config' => array(
'default' => '30',
'min' => '12',
'max' => '200',
'label' => __( 'Size', 'thrive-cb' ),
'um' => [ 'px' ],
'css' => 'fontSize',
),
),
'RotateIcon' => array(
'config' => array(
'step' => '1',
'label' => __( 'Rotate Icon', 'thrive-cb' ),
'default' => '0',
'min' => '-180',
'max' => '180',
'um' => [ ' Deg' ],
),
'extends' => 'Slider',
),
'link' => array(
'config' => array(
'label' => __( 'Icon link', 'thrive-cb' ),
'class' => 'thrv_icon',
),
),
'StylePicker' => array(
'config' => array(
'label' => __( 'Choose icon style', 'thrive-cb' ),
'items' => [
'circle_outlined' => 'Circle Outlined',
'circle_shaded' => 'Circle Shaded',
'circle_inverted' => 'Circle Inverted',
'rounded_outlined' => 'Rounded Outlined',
'rounded_shaded' => 'Rounded Shaded',
'rounded_inverted' => 'Rounded Inverted',
'square_outlined' => 'Square Outlined',
'square_shaded' => 'Square Shaded',
'square_inverted' => 'Square Inverted',
],
),
),
'IconPicker' => array(
'config' => array(
'label_style' => __( 'Change style', 'thrive-cb' ),
'label_modal' => __( 'Change icon', 'thrive-cb' ),
'label' => __( 'Icon and style', 'thrive-cb' ),
),
'extends' => 'ModalStylePicker',
),
),
),
'typography' => [ 'hidden' => true ],
'shadow' => [
'config' => [
'disabled_controls' => [ 'text' ],
],
],
'layout' => [
'config' => [
'Position' => [
'important' => true,
],
],
'disabled_controls' => [
'Width',
'Height',
'Display',
'Overflow',
'ScrollStyle',
],
],
'scroll' => [
'hidden' => false,
'disabled_controls' => [ '[data-value="sticky"]' ],
],
);
}
/**
* @return bool
*/
public function has_hover_state() {
return true;
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'icon',
'link' => 'https://help.thrivethemes.com/en/articles/4425785-how-to-use-the-icon-element',
],
];
}
}

View File

@@ -0,0 +1,145 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
require_once 'class-tcb-text-element.php';
/**
* Class TCB_Image_Caption_Element
*/
class TCB_Image_Caption_Element extends TCB_Text_Element {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Image Caption', 'thrive-cb' );
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.wp-caption-text.thrv-inline-text';
}
/**
* Hide Element From Sidebar Menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* There is no need for HTML for this element since we need it only for control filter
*
* @return string
*/
protected function html() {
return '';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$components = parent::own_components();
$components['text']['config']['ImageCaptionPosition'] = array(
'config' => array(
'default' => 'none',
'name' => __( 'Position', 'thrive-cb' ),
'options' => array(
array(
'name' => __( 'Below image', 'thrive-cb' ),
'value' => 'below',
),
array(
'name' => __( 'Above image', 'thrive-cb' ),
'value' => 'above',
),
array(
'name' => __( 'Inside image', 'thrive-cb' ),
'value' => 'inside',
),
),
),
'extends' => 'Select',
);
$components['text']['config']['CaptionVerticalPosition'] = array(
'config' => array(
'name' => __( 'Vertical position', 'thrive-cb' ),
'buttons' => [
[
'icon' => 'top',
'default' => true,
'value' => 'top',
],
[
'icon' => 'vertical',
'value' => 'center',
],
[
'icon' => 'bot',
'value' => 'bottom',
],
],
),
'extends' => 'ButtonGroup',
);
$components['text']['config']['TextAlign'] = array(
'config' => array(
'name' => __( 'Alignment', 'thrive-cb' ),
'buttons' => [
[
'icon' => 'format-align-left',
'text' => '',
'value' => 'left',
'default' => true,
],
[
'icon' => 'format-align-center',
'text' => '',
'value' => 'center',
],
[
'icon' => 'format-align-right',
'text' => '',
'value' => 'right',
],
[
'icon' => 'format-align-justify',
'text' => '',
'value' => 'justify',
],
],
),
'extends' => 'ButtonGroup',
);
$components['image_caption'] = $components['text'];
unset( $components['text'], $components['layout'], $components['borders'], $components['animation'], $components['background'], $components['responsive'], $components['styles-templates'] );
$components['scroll'] = [ 'hidden' => true ];
return $components;
}
}

View File

@@ -0,0 +1,344 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Image_Element
*/
class TCB_Image_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Image', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'media';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'image';
}
/**
* Text element identifier
*
* @return string
*/
public function identifier() {
return 'div.tve_image_caption';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return array(
'image' => array(
'config' => array(
'StyleChange' => array(
'config' => array(
'label' => __( 'Image style', 'thrive-cb' ),
),
),
'ImagePicker' => array(
'config' => array(
'label' => __( 'Replace image', 'thrive-cb' ),
),
),
'ExternalFields' => array(
'config' => array(
'main_dropdown' => array(
'' => __( 'Select a source', 'thrive-cb' ),
'featured' => __( 'Featured image', 'thrive-cb' ),
'author' => __( 'Author image', 'thrive-cb' ),
'user' => __( 'User image', 'thrive-cb' ),
'custom' => __( 'Custom fields', 'thrive-cb' ),
),
'key' => 'image',
'shortcode_element' => 'img.tve_image',
),
'extends' => 'CustomFields',
),
'ImageSize' => array(
'config' => array(
'default' => 'auto',
'min' => '30',
'forceMin' => '5',
'max' => '1024',
'label' => __( 'Size', 'thrive-cb' ),
'um' => [ 'px', '%' ],
'css' => 'width',
),
'extends' => 'Slider',
),
'ImageHeight' => array(
'config' => array(
'default' => 'auto',
'min' => '5',
'max' => '300',
'label' => __( 'Height', 'thrive-cb' ),
'um' => [ '' ],
'css' => 'height',
),
'extends' => 'Slider',
),
'StylePicker' => array(
'config' => array(
'label' => __( 'Choose image style', 'thrive-cb' ),
'items' => array(
'no_style' => __( 'No style', 'thrive-cb' ),
'img_style_dark_frame' => __( 'Dark frame', 'thrive-cb' ),
'img_style_framed' => __( 'Framed', 'thrive-cb' ),
'img_style_lifted_style1' => __( 'Lifted style 1', 'thrive-cb' ),
'img_style_lifted_style2' => __( 'Lifted style 2', 'thrive-cb' ),
'img_style_polaroid' => __( 'Polaroid', 'thrive-cb' ),
'img_style_rounded_corners' => __( 'Rounded corners', 'thrive-cb' ),
'img_style_circle' => __( 'Circle', 'thrive-cb' ),
'img_style_caption_overlay' => __( 'Caption overlay', 'thrive-cb' ),
),
'default' => 'no_style',
),
),
'ImageTitle' => array(
'config' => array(
'label' => __( 'Title', 'thrive-cb' ),
),
'extends' => 'LabelInput',
),
'ImageAltText' => array(
'config' => array(
'label' => __( 'Alt text', 'thrive-cb' ),
),
'extends' => 'LabelInput',
),
'ImageCaption' => array(
'config' => array(
'name' => '',
'label' => __( 'Add caption text', 'thrive-cb' ),
'default' => false,
),
'extends' => 'Switch',
),
'ImageLoading' => array(
'config' => array(
'name' => '',
'label' => __( 'Lazy-load image', 'thrive-cb' ),
'default' => true,
),
'extends' => 'Switch',
),
'ImageFullSize' => array(
'config' => array(
'name' => '',
'label' => __( 'Open full size image on click', 'thrive-cb' ),
'default' => false,
),
'extends' => 'Checkbox',
),
),
),
'background' => [ 'hidden' => true ],
'image-effects' => array(
'config' => array(
'css_suffix' => ' img',
'ImageGreyscale' => array(
'config' => array(
'default' => '0',
'min' => '0',
'max' => '100',
'label' => __( 'Greyscale', 'thrive-cb' ),
'um' => [ '' ],
'css' => 'filter',
),
'extends' => 'Slider',
),
'ImageOpacity' => array(
'config' => array(
'default' => '100',
'min' => '1',
'max' => '100',
'label' => __( 'Opacity', 'thrive-cb' ),
'um' => [ '' ],
'css' => 'opacity',
),
'extends' => 'Slider',
),
'ImageBlur' => array(
'config' => array(
'default' => '0',
'min' => '0',
'max' => '20',
'label' => __( 'Blur', 'thrive-cb' ),
'um' => [ 'px' ],
'css' => 'filter',
),
'extends' => 'Slider',
),
'ImageBrightness' => array(
'config' => array(
'default' => '100',
'min' => '0',
'max' => '300',
'label' => __( 'Brightness', 'thrive-cb' ),
'um' => [ '' ],
'css' => 'filter',
),
'extends' => 'Slider',
),
'ImageContrast' => array(
'config' => array(
'default' => '100',
'min' => '0',
'max' => '300',
'label' => __( 'Contrast', 'thrive-cb' ),
'um' => [ '' ],
'css' => 'filter',
),
'extends' => 'Slider',
),
'ImageSepia' => array(
'config' => array(
'default' => '0',
'min' => '0',
'max' => '100',
'label' => __( 'Sepia', 'thrive-cb' ),
'um' => [ '' ],
'css' => 'filter',
),
'extends' => 'Slider',
),
'ImageInvert' => array(
'config' => array(
'default' => '0',
'min' => '0',
'max' => '100',
'label' => __( 'Invert', 'thrive-cb' ),
'um' => [ '' ],
'css' => 'filter',
),
'extends' => 'Slider',
),
'ImageSaturate' => array(
'config' => array(
'default' => '100',
'min' => '0',
'max' => '300',
'label' => __( 'Saturate', 'thrive-cb' ),
'um' => [ '' ],
'css' => 'filter',
),
'extends' => 'Slider',
),
'ImageHueRotate' => array(
'config' => array(
'default' => '0',
'min' => '0',
'max' => '359',
'label' => __( 'Hue rotate', 'thrive-cb' ),
'um' => [ 'deg' ],
'css' => 'filter',
),
'extends' => 'Knob',
),
'ImageOverlaySwitch' => array(
'strategy' => 'element',
'config' => array(
'name' => '',
'label' => __( 'Image overlay', 'thrive-cb' ),
'default' => true,
),
'extends' => 'Switch',
),
'ImageOverlay' => array(
'config' => array(
'default' => '000',
'label' => __( 'Overlay color', 'thrive-cb' ),
),
'css_suffix' => ' .tve-image-overlay',
'extends' => 'ColorPicker',
),
),
),
'typography' => [
'hidden' => true,
],
'animation' => [
'config' => [
'to' => 'img',
],
],
'layout' => [
'disabled_controls' => [
'Width',
'Height',
'Overflow',
'ScrollStyle',
],
],
'shadow' => [
'config' => [
'disabled_controls' => [ 'inner', 'text' ],
],
],
'scroll' => [
'hidden' => false,
],
);
}
/**
* @return bool
*/
public function has_hover_state() {
return true;
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_basic_label();
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'image_element',
'link' => 'https://help.thrivethemes.com/en/articles/4425765-how-to-use-the-image-element',
],
];
}
}

View File

@@ -0,0 +1,325 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Image_Gallery_Element
*/
class TCB_Image_Gallery_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Image Gallery', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'media';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'image-gallery';
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.tcb-image-gallery';
}
/**
* This element is not a placeholder
*
* @return bool|true
*/
public function is_placeholder() {
return false;
}
/**
* HTML layout of the element for when it's dragged in the canvas
*
* @return string
*/
protected function html() {
return $this->html_placeholder();
}
/**
* @param null $title
*
* @return bool|string|null
*/
public function html_placeholder( $title = null ) {
return tcb_template( 'elements/image-gallery', null, true );
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$components = array(
'carousel' => [ 'hidden' => false ],
'image_gallery' => array(
'config' => array(
'GalleryType' => array(
'config' => array(
'name' => __( 'Gallery type', 'thrive-cb' ),
'large_buttons' => true,
'buttons' => array(
array(
'value' => 'grid',
'data' => array(
'tooltip' => __( 'Grid', 'thrive-cb' ),
'position' => 'top',
),
'icon' => 'gallery-grid',
'default' => true,
),
array(
'value' => 'verticalMasonry',
'data' => array(
'tooltip' => __( 'Vertical Masonry', 'thrive-cb' ),
'position' => 'top',
'width' => '100%',
),
'icon' => 'gallery-vertical-masonry',
),
array(
'value' => 'horizontalMasonry',
'data' => array(
'tooltip' => __( 'Horizontal Masonry', 'thrive-cb' ),
'position' => 'top',
'width' => '100%',
),
'icon' => 'gallery-horizontal-masonry',
),
array(
'value' => 'carousel',
'data' => array(
'tooltip' => __( 'Carousel', 'thrive-cb' ),
'position' => 'top',
'width' => '100%',
),
'icon' => 'gallery-carousel',
),
),
),
'extends' => 'ButtonGroup',
),
'ShowCaptions' => array(
'config' => array(
'name' => '',
'label' => __( 'Show captions', 'thrive-cb' ),
'default' => false,
),
'extends' => 'Switch',
),
'ShowCaptionsInLightbox' => array(
'config' => array(
'name' => '',
'label' => __( 'Show captions on lightbox', 'thrive-cb' ),
'default' => false,
),
'extends' => 'Switch',
),
'Columns' => array(
'config' => array(
'default' => '3',
'min' => '1',
'max' => '10',
'label' => __( 'Images per row', 'thrive-cb' ),
'um' => [ '' ],
),
'extends' => 'Slider',
),
'VerticalSpace' => array(
'config' => array(
'min' => '0',
'max' => '240',
'label' => __( 'Vertical space', 'thrive-cb' ),
'um' => [ 'px' ],
),
'extends' => 'Slider',
),
'HorizontalSpace' => array(
'config' => array(
'min' => '0',
'max' => '240',
'label' => __( 'Horizontal space', 'thrive-cb' ),
'um' => [ 'px' ],
),
'extends' => 'Slider',
),
'ColumnHeight' => array(
'config' => array(
'min' => '1',
'max' => '800',
'label' => __( 'Column Height', 'thrive-cb' ),
'um' => [ 'px' ],
),
'extends' => 'Slider',
),
'Gutter' => array(
'config' => array(
'min' => '0',
'max' => '240',
'label' => __( 'Gutter', 'thrive-cb' ),
'um' => [ 'px' ],
),
'extends' => 'Slider',
),
'ClickBehavior' => array(
'config' => array(
'name' => __( 'Click behavior', 'thrive-cb' ),
'options' => array(
[
'value' => 'fullscreen',
'name' => 'Open fullscreen lightbox',
],
array(
'value' => 'none',
'name' => 'None (links can be added in edit mode)',
),
),
),
'extends' => 'Select',
),
'ThumbnailSize' => array(
'config' => array(
'name' => __( 'Thumbnail size', 'thrive-cb' ),
'options' => [
[
'value' => 'auto',
'name' => 'Automatic',
],
[
'value' => 'medium',
'name' => 'Medium',
],
[
'value' => 'large',
'name' => 'Large',
],
],
'info' => true,
),
'extends' => 'Select',
),
'CropImages' => array(
'config' => array(
'name' => '',
'label' => __( 'Crop images to fit', 'thrive-cb' ),
'default' => true,
),
'extends' => 'Switch',
),
'GalleryImageHeight' => array(
'config' => array(
'min' => '1',
'max' => '800',
'label' => __( 'Image height', 'thrive-cb' ),
'um' => [ 'px' ],
),
'extends' => 'Slider',
),
'FullscreenSize' => array(
'config' => array(
'name' => __( 'Full screen image size', 'thrive-cb' ),
'options' => [
[
'value' => 'medium',
'name' => 'Medium',
],
[
'value' => 'large',
'name' => 'Large',
],
[
'value' => 'full',
'name' => 'Original',
],
],
),
'extends' => 'Select',
),
),
),
'layout' => [
'disabled_controls' => [ 'Display' ],
],
);
$components = array_merge( $components, $this->group_component() );
return array_merge( $components, parent::own_components() );
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Group Edit Properties
*
* @return array|bool
*/
public function has_group_editing() {
return array(
'select_values' => array(
array(
'value' => 'arrows',
'selector' => '.tcb-carousel-arrow',
'name' => __( 'Next/Previous buttons Icons', 'thrive-cb' ),
'singular' => __( '-- Next/Previous buttons Icon', 'thrive-cb' ),
),
),
);
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'image_gallery_element',
'link' => 'https://thrivethemes.com/docs/using-the-image-gallery-element-in-thrive-architect/',
],
];
}
}

View File

@@ -0,0 +1,71 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 11/6/2017
* Time: 5:27 PM
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
require_once 'class-tcb-label-element.php';
/**
* Class TCB_Label_Advanced_Element
*
* Basically is the label element with more features unlocked such as: layout, borders, background
*/
class TCB_Label_Advanced_Element extends TCB_Label_Element {
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.thrv-advanced-inline-text';
}
/**
* Removes the unnecessary components from the element json string
*
* @return array
*/
protected function general_components() {
$general_components = parent::general_components();
unset( $general_components['typography'], $general_components['animation'], $general_components['responsive'], $general_components['styles-templates'] );
return $general_components;
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$components = parent::own_components();
$components['layout'] = [
'disabled_controls' => [
'Width',
'Height',
'Alignment',
'.tve-advanced-controls',
],
'config' => [],
];
/**
* We remove all this indexes from the components array.
* The functionality from here will be handled in general_components function
* Reason: not to be added in the element json string
*/
unset( $components['typography'], $components['borders'], $components['animation'], $components['background'], $components['responsive'], $components['styles-templates'] );
return $components;
}
}

View File

@@ -0,0 +1,99 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 11/7/2017
* Time: 9:26 AM
*/
require_once 'class-tcb-label-element.php';
/**
* Class TCB_Label_Disabled_Element
*
* Non edited label element. For inline text we use typography control
*/
class TCB_Label_Disabled_Element extends TCB_Label_Element {
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.thrv-disabled-label';
}
/**
* There is no need for HTML for this element since we need it only for control filter
*
* @return string
*/
protected function html() {
return '';
}
/**
* Removes the unnecessary components from the element json string
*
* @return array
*/
protected function general_components() {
$general_components = parent::general_components();
if ( isset( $general_components['animation'] ) ) {
unset( $general_components['animation'] );
}
if ( isset( $general_components['responsive'] ) ) {
unset( $general_components['responsive'] );
}
if ( isset( $general_components['styles-templates'] ) ) {
unset( $general_components['styles-templates'] );
}
return $general_components;
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return [
'typography' => [
'disabled_controls' => [
'TextTransform',
'typography-text-transform-hr',
'.tve-advanced-controls',
],
'config' => [
'FontColor' => [
'css_suffix' => ' .tcb-numbered-list-index',
],
'FontSize' => [
'css_suffix' => ' .tcb-numbered-list-index',
],
'FontFace' => [
'css_suffix' => ' .tcb-numbered-list-index',
],
'TextStyle' => [
'css_suffix' => ' .tcb-numbered-list-index',
],
'LineHeight' => [
'css_suffix' => ' .tcb-numbered-list-index',
],
],
],
'layout' => [
'disabled_controls' => [
'.tve-advanced-controls',
'Width',
'Height',
'Alignment',
],
],
];
}
}

View File

@@ -0,0 +1,146 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Label_Element
*/
class TCB_Label_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Inline text', 'thrive-cb' );
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return '';
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.thrv-inline-text, .thrv_toggle_shortcode .tve_faqB h4';
}
/**
* Hidden element
*
* @return string
*/
public function hide() {
return true;
}
/**
* @return bool
*/
public function has_hover_state() {
return true;
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return array(
'text' => array(
'config' => array(
'FontSize' => array(
'config' => array(
'default' => '16',
'min' => '1',
'max' => '100',
'label' => __( 'Font Size', 'thrive-cb' ),
'um' => [ 'px', 'em' ],
'css' => 'fontSize',
),
'extends' => 'Slider',
),
'LineHeight' => array(
'config' => array(
'default' => '1',
'min' => '1',
'max' => '100',
'label' => __( 'Line Height', 'thrive-cb' ),
'um' => [ 'em', 'px' ],
'css' => 'lineHeight',
),
'extends' => 'Slider',
),
'LetterSpacing' => array(
'config' => array(
'default' => 'auto',
'min' => '1',
'max' => '100',
'label' => __( 'Letter Spacing', 'thrive-cb' ),
'um' => [ 'px' ],
'css' => 'letterSpacing',
),
'extends' => 'Slider',
),
'FontColor' => array(
'config' => array(
'default' => '000',
'label' => __( 'Font Color', 'thrive-cb' ),
'options' => [
'output' => 'object',
],
),
'extends' => 'ColorPicker',
),
'FontBackground' => array(
'config' => array(
'default' => '000',
'label' => __( 'Font Highlight', 'thrive-cb' ),
'options' => [
'output' => 'object',
],
),
'extends' => 'ColorPicker',
),
'FontFace' => [
'config' => [
'template' => 'controls/font-manager',
'inline' => true,
],
'extends' => 'FontManager',
],
),
),
'typography' => [ 'hidden' => true ],
'layout' => [ 'hidden' => true ],
'borders' => [ 'hidden' => true ],
'animation' => [ 'hidden' => true ],
'background' => [ 'hidden' => true ],
'responsive' => [ 'hidden' => true ],
'styles-templates' => [ 'hidden' => true ],
'shadow' => [
'config' => [
'disabled_controls' => [ 'inner', 'drop' ],
'with_froala' => true,
],
],
);
}
}

View File

@@ -0,0 +1,96 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Handles backwards-compatibility functionality for landing pages - main content area
*/
class TCB_Landing_Page_Content_Element extends TCB_Element_Abstract {
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.tve_lp_content';
}
/**
* This is only available on landing pages
*
* @return false|string
*/
public function is_available() {
return tcb_post()->is_landing_page();
}
public function name() {
return __( 'Landing Page Content', 'thrive-cb' );
}
/**
* Either to display or not the element in the sidebar menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* The HTML is generated from js
*
* @return string
*/
protected function html() {
return '';
}
/**
* Hide all general components.
*
* @return array
*/
public function own_components() {
return [
'typography' => [ 'hidden' => true ],
'animation' => [ 'hidden' => true ],
'responsive' => [ 'hidden' => true ],
'styles-templates' => [ 'hidden' => true ],
'layout' => [
'disabled_controls' => [
'.tve-advanced-controls',
],
'config' => [
'Width' => [
'important' => true,
],
],
],
'borders' => [
'config' => [
'Borders' => [
'important' => true,
],
'Corners' => [
'important' => true,
],
],
],
'shadow' => [
'config' => [
'important' => true,
'default_shadow' => 'none',
],
],
];
}
}

View File

@@ -0,0 +1,160 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
require_once 'class-tcb-post-element.php';
/**
* Class TCB_Landing_Page_Element
*/
class TCB_Landing_page_Element extends TCB_Post_Element {
/**
* Post Component Main Option
*
* @var array
*/
private $post_components = [];
/**
* TCB_Landing_page_Element constructor.
*
* @param string $tag
*/
public function __construct( $tag = '' ) {
parent::__construct( $tag );
$this->post_components = parent::post_main_option();
}
/**
* This is only available when editing landing pages
*
* @return bool
*/
public function is_available() {
return tcb_post()->is_landing_page();
}
public function name() {
return __( 'Landing Page', 'thrive-cb' );
}
/**
* Element identifier
*
* These settings apply directly on <body>, on landing pages
*
* @return string
*/
public function identifier() {
return 'body.tve_lp';
}
/**
* Either to display or not the element in the sidebar menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* The HTML is generated from js
*
* @return string
*/
protected function html() {
return '';
}
/**
* Override this from the parent
*
* @return array
*/
public function own_components() {
return [];
}
protected function general_components() {
$lp = array(
'landing_page' => array(
'config' => array(
'ContentMaxWidth' => array(
'to' => '#tve_editor',
'config' => array(
'default' => '1080',
'min' => '100',
'max' => '2400',
'label' => __( 'Content Maximum Width', 'thrive-cb' ),
'um' => [ 'px', '%' ],
'css' => 'max-width',
),
'extends' => 'Slider',
),
'ContentWidth' => array(
'to' => '#tve_editor',
'config' => array(
'default' => '1080',
'min' => '100',
'max' => '2400',
'label' => __( 'Layout Maximum Width', 'thrive-cb' ),
'um' => [ 'px', '%' ],
'css' => 'max-width',
),
'extends' => 'Slider',
),
'ContentFullWidth' => array(
'config' => array(
'name' => '',
'label' => __( 'Layout covers entire screen width', 'thrive-cb' ),
'default' => true,
),
'extends' => 'Switch',
),
),
),
'lpfonts' => [ 'order' => 90 ],
'background' => [
'order' => 110,
'config' => [
'ColorPicker' => [
'config' => [
'icon' => true,
'important' => true,
],
],
'PreviewFilterList' => [
'config' => [
'sortable' => false,
'extra_class' => 'tcb-preview-list-white',
],
],
'PreviewList' => [
'config' => [
'sortable' => true,
],
],
],
'disabled_controls' => [
'video',
],
],
'lp-advanced' => [],
'scripts_settings' => [ 'order' => 752 ],
);
$lp_config = array_merge( $this->post_components + $lp, $this->group_component() );
return apply_filters( 'tcb_lp_element_extend_config', $lp_config ); /* filter the config in order to extend this in TTB */
}
}

View File

@@ -0,0 +1,326 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package TCB2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
/**
* Class TCB_Lead_Generation_Element
*/
class TCB_Lead_Generation_Element extends TCB_Cloud_Template_Element_Abstract {
/**
* @return string
*/
public function name() {
return __( 'Lead Generation', 'thrive-cb' );
}
public function is_placeholder() {
return false;
}
/**
* HTML layout of the element for when it's dragged in the canvas
*
* @return string
*/
public function html_placeholder( $title = null ) {
if ( empty( $title ) ) {
$title = $this->name();
}
return tcb_template( 'elements/element-placeholder', array(
'icon' => $this->icon(),
'class' => 'tcb-ct-placeholder',
'title' => $title,
'extra_attr' => 'data-ct="' . $this->tag() . '-0" data-tcb-elem-type="' . $this->tag() . '" data-tcb-lg-type="' . $this->tag() . '" data-specific-modal="lead-generation"',
), true );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'form';
}
/**
* @return string
*/
public function icon() {
return 'lead_gen';
}
/**
* @return string
*/
public function identifier() {
return '.thrv_lead_generation';
}
/**
* @return array
*/
public function get_spam_prevention_tools() {
$spam_prevention_tools = apply_filters( 'tcb_spam_prevention_tools', [] );
$formatted_tools = [];
foreach ( $spam_prevention_tools as $tool ) {
$credentials = Thrive_Dash_List_Manager::credentials( $tool );
$disabled = 1;
if ( ! empty( $credentials['site_key'] ) && ! empty( $credentials['secret_key'] ) ) {
unset( $credentials['secret_key'] );
$disabled = 0;
}
$config = [
'value' => $tool,
'name' => ucfirst( $tool ),
'disabled' => $disabled,
'class' => $disabled ? 'tve-disabled' : '',
'tool_settings' => $credentials,
'logo' => $this->get_logo_url( $tool ),
];
$formatted_tools[ $tool ] = $config;
}
$formatted_tools['thrive-sp'] = [
'name' => 'Thrive spam protection',
'value' => 'thrive-sp',
'enabled' => 0,
'tool_settings' => [
'site_key' => '0i1Lk8skHd2no5dNK',
'secret_key' => 'xVCSHKWlohcZbw0hutIC93Lr2NK',
],
'logo' => $this->get_logo_url( 'thrive-spam-protect' ),
];
$formatted_tools['disabled'] = [
'name' => 'Disabled',
'value' => 'disabled',
'enabled' => 0,
'tool_settings' => [
'site_key' => '0i1Lk8skHd2no5d',
'secret_key' => 'xVCSHKWlohcZbw0hutIC93Lr2',
],
'logo' => $this->get_logo_url( 'disabled' ),
];
return $formatted_tools;
}
public function get_logo_url( $name ) {
return TVE_DASH_URL . '/inc/auto-responder/views/images/' . $name . '.png';
}
/**
* @return array
*/
public function own_components() {
$spam_prevention_tools = $this->get_spam_prevention_tools();
$lead_generation = array(
'lead_generation' => array(
'config' => array(
'ModalPicker' => array(
'config' => array(
'label' => __( 'Template', 'thrive-cb' ),
),
),
'FormPalettes' => [
'config' => [],
'extends' => 'Palettes',
],
'connectionType' => array(
'config' => array(
'name' => __( 'Connection', 'thrive-cb' ),
'buttons' => [
[
'text' => 'API',
'value' => 'api',
'default' => true,
],
[
'text' => 'HTML code',
'value' => 'custom-html',
],
],
),
),
'FieldsControl' => [
'config' => [
'sortable' => true,
'settings_icon' => 'pen-light',
],
],
'HiddenFieldsControl' => [
'config' => [
'sortable' => false,
'settings_icon' => 'pen-light',
],
'extends' => 'PreviewList',
],
'ApiConnections' => [
'config' => [],
],
'SPTools' => array(
'config' => array(
'name' => '',
'options' => $spam_prevention_tools
),
'extends' => 'Select',
),
'consent' => array(
'config' => array(
'labels' => array(
'wordpress' => __( 'Create WordPress account', 'thrive-cb' ),
'default' => __( '{service}', 'thrive-cb' ),
),
),
),
'FormIdentifier' => array(
'config' => array(
'label' => __( 'Form identifier', 'thrive-cb' ),
'full-width' => true,
'tooltip' => __( 'Used in other Thrive plugins to identify this form. It should be unique.', 'thrive-cb' ),
'tooltip_side' => 'top',
'width' => '100%',
),
'extends' => 'LabelInput',
),
),
),
'typography' => [
'hidden' => true,
],
'layout' => [
'disabled_controls' => [
'.tve-advanced-controls',
],
'config' => [
'Width' => [
'important' => true,
],
],
],
'borders' => [
'disabled_controls' => [],
'config' => [
'Corners' => [
'overflow' => false,
],
],
],
'animation' => [
'hidden' => true,
],
'shadow' => [
'config' => [
'disabled_controls' => [ 'text' ],
],
],
'styles-templates' => [
'config' => [
'ID' => [
'hidden' => true,
],
],
],
);
return array_merge( $lead_generation, $this->group_component() );
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'lead_generation',
'link' => 'https://help.thrivethemes.com/en/articles/4425779-how-to-use-the-lead-generation-element',
],
];
}
/**
* Group Edit Properties
*
* @return array|bool
*/
public function has_group_editing() {
return array(
'select_values' => array(
array(
'value' => 'all_labels',
'selector' => '.thrv_text_element[data-label-for]',
'name' => __( 'Grouped Lead Generation Labels', 'thrive-cb' ),
'singular' => __( '-- Label %s', 'thrive-cb' ),
),
array(
'value' => 'all_lead_gen_items',
'selector' => '.tve_lg_input,.tve_lg_textarea',
'name' => __( 'Grouped Lead Generation Inputs', 'thrive-cb' ),
'singular' => __( '-- Input %s', 'thrive-cb' ),
),
array(
'value' => 'all_radio_elements',
'selector' => '.tve_lg_radio',
'name' => __( 'Grouped Lead Generation Radio', 'thrive-cb' ),
'singular' => __( '-- Radio %s', 'thrive-cb' ),
),
array(
'value' => 'all_checkbox_elements',
'selector' => '.tve_lg_checkbox:not(.tcb-lg-consent)',
'name' => __( 'Grouped Form Checkbox', 'thrive-cb' ),
'singular' => __( '-- Checkbox %s', 'thrive-cb' ),
),
array(
'value' => 'all_dropdown_elements',
'selector' => '.tve_lg_dropdown, .tve_lg_country, .tve_lg_state',
'name' => __( 'Grouped Dropdown', 'thrive-cb' ),
'singular' => __( '-- Dropdown %s', 'thrive-cb' ),
),
array(
'value' => 'radio_options',
'selector' => '.tve_lg_radio_wrapper',
'name' => __( 'Grouped Radio Options', 'thrive-cb' ),
'singular' => __( '-- Option %s', 'thrive-cb' ),
),
array(
'value' => 'dropdown_options',
'selector' => '.tve-lg-dropdown-option',
'name' => __( 'Grouped Dropdown Options', 'thrive-cb' ),
'singular' => __( '-- Option %s', 'thrive-cb' ),
),
array(
'value' => 'checkbox_options',
'selector' => '.tve_lg_checkbox_wrapper:not(.tcb-lg-consent .tve_lg_checkbox_wrapper)',
'name' => __( 'Grouped Checkbox Options', 'thrive-cb' ),
'singular' => __( '-- Option %s', 'thrive-cb' ),
),
),
);
}
}

View File

@@ -0,0 +1,148 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Lightbox_Element
*
* Thrive Lightbox general settings
*/
class TCB_Lightbox_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Thrive Lightbox', 'thrive-cb' );
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'none';
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.tve_p_lb_content';
}
/**
* Not visible in the side menu ( elements )
*
* @return bool
*/
public function hide() {
return true;
}
/**
* @return bool
*/
public function is_available() {
return tcb_post()->is_lightbox();
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return array(
'lightbox' => array(
'config' => array(
'Switch' => array(
'to' => '> .tve_p_lb_close',
'config' => array(
'label' => __( 'Show "close" icon', 'thrive-cb' ),
),
),
'CloseColor' => array(
'to' => '> .tve_p_lb_close',
'config' => array(
'label' => __( 'Icon color', 'thrive-cb' ),
),
'extends' => 'ColorPicker',
),
'BorderColor' => array(
'to' => '> .tve_p_lb_close',
'config' => array(
'label' => __( 'Icon border', 'thrive-cb' ),
),
'extends' => 'ColorPicker',
),
'IconBg' => array(
'to' => '> .tve_p_lb_close',
'config' => array(
'label' => __( 'Icon background', 'thrive-cb' ),
),
'extends' => 'ColorPicker',
),
'OverlayColor' => array(
'to' => 'main::.tve_p_lb_overlay',
'config' => array(
'label' => __( 'Overlay color', 'thrive-cb' ),
),
'extends' => 'ColorPicker',
),
),
),
'borders' => [
'config' => [
'Borders' => [
'important' => true,
],
'Corners' => [
'important' => true,
],
],
],
'shadow' => [
'config' => [
'important' => true,
],
],
'animation' => [
'hidden' => true,
],
'typography' => [
'hidden' => true,
],
'responsive' => [
'hidden' => true,
],
'styles-templates' => [
'hidden' => true,
],
'layout' => [
'config' => [
'Width' => [
'important' => true,
],
],
'disabled_controls' => [
'Alignment',
'.tve-advanced-controls',
],
],
);
}
}

View File

@@ -0,0 +1,219 @@
<?php
require_once plugin_dir_path( __FILE__ ) . 'class-tcb-label-element.php';
/**
* Class TCB_Label_Disabled_Element
*
* Non edited label element. For inline text we use typography control
*/
class TCB_Link_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Link Text', 'thrive-cb' );
}
public function hide() {
return true;
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.thrv_text_element a, .tcb-styled-list a, .tcb-numbered-list a, .tve-input-option-text a, .thrv-typography-link';
}
/**
* There is no need for HTML for this element since we need it only for control filter
*
* @return string
*/
protected function html() {
return '';
}
/**
* Links have hover states
*
* @return bool
*/
public function has_hover_state() {
return true;
}
/**
* @return array|void
*/
public function general_components() {
return array(
'link' => array(
'config' => array(
'ToggleColor' => array(
'config' => array(
'name' => __( 'Color', 'thrive-cb' ),
'buttons' => array(
array( 'value' => 'inherit', 'text' => __( 'Inherit', 'thrive-cb' ), 'default' => true ),
array( 'value' => 'specific', 'text' => __( 'Specific', 'thrive-cb' ) ),
),
),
'extends' => 'Tabs',
),
'FontColor' => [
'config' => [
'default' => '000',
'label' => ' ',
'options' => [
'output' => 'object',
],
],
'extends' => 'ColorPicker',
],
'ToggleColorControls' => array(
'config' => array(
'name' => __( 'Color type', 'thrive-cb' ),
'buttons' => array(
array( 'value' => 'tcb-text-solid-color', 'text' => __( 'Solid', 'thrive-cb' ) ),
array( 'value' => 'tcb-text-gradient-color', 'text' => __( 'Gradient', 'thrive-cb' ) ),
),
),
'extends' => 'ButtonGroup',
),
'FontGradient' => [
'config' => [
'default' => '000',
'label' => __( 'Gradient', 'thrive-cb' ),
'options' => [
'output' => 'object',
'hasInput' => true,
],
],
'extends' => 'GradientPicker',
],
'FontBaseColor' => [
'css_prefix' => '.thrv_text_element ',
'config' => [
'default' => '000',
'label' => __( 'Base color', 'thrive-cb' ),
'info' => true,
'options' => [
'output' => 'object',
],
],
'extends' => 'ColorPicker',
],
'BgColor' => array(
'config' => array(
'default' => '000',
'label' => __( 'Highlight', 'thrive-cb' ),
'options' => [
'output' => 'object',
],
),
'extends' => 'ColorPicker',
),
'ToggleFont' => array(
'config' => array(
'name' => __( 'Font', 'thrive-cb' ),
'buttons' => array(
array( 'value' => 'inherit', 'text' => __( 'Inherit', 'thrive-cb' ), 'default' => true ),
array( 'value' => 'specific', 'text' => __( 'Specific', 'thrive-cb' ) ),
),
),
'extends' => 'Tabs',
),
'FontFace' => [
'config' => [
'label' => ' ',
'template' => 'controls/font-manager',
'inline' => true,
],
],
'ToggleSize' => array(
'config' => array(
'name' => __( 'Size', 'thrive-cb' ),
'buttons' => array(
array( 'value' => 'inherit', 'text' => __( 'Inherit', 'thrive-cb' ), 'default' => true ),
array( 'value' => 'specific', 'text' => __( 'Specific', 'thrive-cb' ) ),
),
),
'extends' => 'Tabs',
),
'FontSize' => [
'config' => [
'default' => '16',
'min' => '1',
'max' => '100',
'label' => '',
'um' => [ 'px', 'em' ],
'css' => 'fontSize',
],
'extends' => 'FontSize',
],
'TextStyle' => [
'config' => [
'important' => true,
'buttons' => [
'underline' => [
'data' => [ 'style' => 'text-decoration-line' ],
],
'line-through' => [
'data' => [ 'style' => 'text-decoration-line' ],
],
],
],
],
'Effect' => array(
'config' => array(
'label' => __( 'Effect', 'thrive-cb' ),
),
'extends' => 'StyleChange',
),
'EffectPicker' => array(
'config' => array(
'label' => __( 'Choose link effect', 'thrive-cb' ),
'default' => 'none',
),
),
'EffectColor' => array(
'config' => array(
'label' => __( 'Effect Color', 'thrive-cb' ),
'options' => [
'output' => 'object',
'showGlobals' => false,
],
),
'extends' => 'ColorPicker',
),
'EffectSpeed' => array(
'label' => __( 'Effect Speed', 'thrive-cb' ),
'config' => array(
'default' => '0.2',
'min' => '0.05',
'step' => '0.05',
'max' => '1',
'label' => __( 'Speed', 'thrive-cb' ),
'um' => [ 's' ],
),
'extends' => 'Slider',
),
),
),
'shadow' => [
'order' => 140,
'config' => [
'disabled_controls' => [ 'drop', 'inner' ],
'with_froala' => true,
],
],
);
}
}

View File

@@ -0,0 +1,222 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class TCB_Login_Element extends TCB_Cloud_Template_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return esc_html__( 'Login & Registration Form', 'thrive-cb' );
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'login_elem';
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'login,registration,forgot,password,register';
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.thrv-login-element';
}
/**
* Whether or not this element is a placeholder
*
* @return bool
*/
public function is_placeholder() {
return false;
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return $this->get_thrive_integrations_label();
}
/**
* Element HTML
*
* @return string
*/
public function html() {
return
'<div class="element">' . $this->html_placeholder( 'Insert Login & Registration Form' ) . '</div>' .
'<div class="template">' . tcb_template( 'elements/login.php', [], true ) . '</div>';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$login = array(
'login' => array(
'config' => array(
'Palettes' => [
'config' => [],
'extends' => 'PalettesV2',
],
'formType' => array(
'config' => array(
'name' => __( 'Type', 'thrive-cb' ),
'full-width' => true,
'buttons' => [
[
'text' => 'Login',
'default' => true,
'value' => 'login',
],
[
'text' => 'Register',
'value' => 'register',
],
[
'text' => 'Both',
'value' => 'both',
],
],
),
),
'defaultState' => array(
'config' => array(
'name' => __( 'Default state', 'thrive-cb' ),
'options' => array(
'login' => __( 'Login', 'thrive-cb' ),
'register' => __( 'Register', 'thrive-cb' ),
),
),
),
'hideWhenLoggedIn' => array(
'config' => array(
'label' => __( 'Hide form when user is logged in', 'thrive-cb' ),
),
),
'PassResetUrl' => array(
'config' => array(
'name' => '',
'label' => __( 'Password Reset Link', 'thrive-cb' ),
'default' => true,
),
'css_suffix' => ' .tcb-lost-password-link',
'css_prefix' => '',
'extends' => 'Switch',
),
'Align' => array(
'config' => array(
'name' => __( 'Size and Alignment', 'thrive-cb' ),
'full-width' => true,
'buttons' => array(
array(
'icon' => 'a_left',
'value' => 'left',
'tooltip' => __( 'Align Left', 'thrive-cb' ),
),
array(
'icon' => 'a_center',
'value' => 'center',
'default' => true,
'tooltip' => __( 'Align Center', 'thrive-cb' ),
),
array(
'icon' => 'a_right',
'value' => 'right',
'tooltip' => __( 'Align Right', 'thrive-cb' ),
),
array(
'text' => 'FULL',
'value' => 'full',
'tooltip' => __( 'Full Width', 'thrive-cb' ),
),
),
),
'extends' => 'ButtonGroup',
),
'FormWidth' => array(
'config' => array(
'default' => '400',
'min' => '10',
'max' => '1080',
'label' => __( 'Form width', 'thrive-cb' ),
'um' => [ '%', 'px' ],
'css' => 'max-width',
),
'extends' => 'Slider',
),
),
),
'typography' => [
'hidden' => true,
],
'animation' => [
'hidden' => true,
],
'styles-templates' => [
'config' => [
'ID' => [
'hidden' => true,
],
],
],
'scroll' => [
'hidden' => false,
],
'layout' => [
'disabled_controls' => [],
],
);
return array_merge( $login, $this->group_component() );
}
/**
* Group Edit Properties
*
* @return array|bool
*/
public function has_group_editing() {
return TCB_Login_Element_Handler::get_group_editing_options();
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'login_registration',
'link' => 'https://help.thrivethemes.com/en/articles/4425883-how-to-use-the-login-registration-form-element',
],
];
}
}

View File

@@ -0,0 +1,92 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 10/16/2018
* Time: 9:06 AM
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Login_Form_Element
*/
class TCB_Login_Form_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return esc_html__( 'Login Form', 'thrive-cb' );
}
/**
* Hide the element in the sidebar menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.tcb-login-form';
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Components that apply only to this
*
* @return array
*/
public function own_components() {
return array(
'login_form' => array(
'config' => array(
'FieldsControl' => [
'config' => [
'sortable' => false,
'settings_icon' => 'edit',
],
],
'AddRemoveLabels' => array(
'config' => array(
'name' => '',
'label' => __( 'Show labels', 'thrive-cb' ),
'default' => true,
),
'extends' => 'Switch',
),
'RememberMe' => array(
'config' => array(
'name' => '',
'label' => __( 'Remember me', 'thrive-cb' ),
'default' => true,
),
'css_suffix' => ' .tcb-remember-me-item',
'css_prefix' => '',
'extends' => 'Switch',
),
),
),
);
}
}

View File

@@ -0,0 +1,138 @@
<?php
class TCB_Login_Form_Input_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Form Input', 'thrive-cb' );
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.tve-login-form-input';
}
/**
* Hide the element in the sidebar menu
*
* @return bool
*/
public function hide() {
return true;
}
public function own_components() {
$controls_default_config_text = [
'css_suffix' => [
' input',
' input::placeholder',
' textarea',
' textarea::placeholder',
],
];
$controls_default_config = [
'css_suffix' => [
' input',
' textarea',
],
];
return array(
'login_form_input' => array(
'config' => array(
'ShowLabel' => array(
'config' => array(
'name' => '',
'label' => __( 'Show label', 'thrive-cb' ),
'default' => false,
),
'extends' => 'Switch',
),
'icon_side' => array(
'rem_ic_css_suf' => ' input', //Remove Icon Css Suffix
'css_suffix' => ' .thrv_icon',
'config' => array(
'name' => __( 'Icon Side', 'thrive-cb' ),
'buttons' => array(
array(
'value' => 'left',
'text' => __( 'Left', 'thrive-cb' ),
),
array(
'value' => 'right',
'text' => __( 'Right', 'thrive-cb' ),
),
),
),
),
'placeholder' => array(
'config' => array(
'label' => __( 'Placeholder', 'thrive-cb' ),
),
),
),
),
'typography' => [
'config' => [
'FontSize' => $controls_default_config_text,
'FontColor' => $controls_default_config_text,
'TextAlign' => $controls_default_config_text,
'TextStyle' => $controls_default_config_text,
'TextTransform' => $controls_default_config_text,
'FontFace' => $controls_default_config_text,
'LineHeight' => $controls_default_config_text,
'LetterSpacing' => $controls_default_config_text,
],
],
'layout' => [
'disabled_controls' => [
'Width',
'Height',
'Alignment',
'.tve-advanced-controls',
'hr',
],
'config' => [
'MarginAndPadding' => $controls_default_config,
],
],
'borders' => [
'config' => [
'Borders' => $controls_default_config,
'Corners' => $controls_default_config,
],
],
'animation' => [
'hidden' => true,
],
'background' => [
'config' => [
'ColorPicker' => $controls_default_config,
'PreviewList' => $controls_default_config,
],
],
'shadow' => [
'config' => $controls_default_config,
],
'responsive' => [
'hidden' => true,
],
'styles-templates' => [
'hidden' => true,
],
);
}
public function has_hover_state() {
return true;
}
}

View File

@@ -0,0 +1,53 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TCB_Login_Form_Item_Element extends TCB_Element_Abstract {
public function name() {
return __( 'Form Item', 'thrive-cb' );
}
public function identifier() {
return '.tve-login-form-item';
}
/**
* Hide Element From Sidebar Menu
*
* @return bool
*/
public function hide() {
return true;
}
public function own_components() {
return [
'typography' => [
'hidden' => true,
],
'layout' => [
'disabled_controls' => [
'Width',
'Height',
'Alignment',
'Display',
'.tve-advanced-controls',
],
],
'animation' => [
'hidden' => true,
],
'responsive' => [
'hidden' => true,
],
'styles-templates' => [
'hidden' => true,
],
];
}
}

View File

@@ -0,0 +1,129 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Logo_Element
*/
class TCB_Logo_Element extends TCB_Image_Element {
/**
* @return string
*/
public function name() {
return __( 'Logo', 'thrive-cb' );
}
/**
* @return string
*/
public function icon() {
return 'logo';
}
/**
* @return string
*/
public function identifier() {
return '.' . TCB_Logo::IDENTIFIER;
}
/**
* @return string
*/
public function html() {
/* by default, when added to the page, the logo has id = 0 ( which is the first default placeholder ) */
return TCB_Logo::render_logo( [ 'data-id-d' => 0 ] );
}
/**
* Inherit all the controls from the Image Element, then remove what we don't need and add our own.
*
* @return array
*/
public function own_components() {
$components = parent::own_components();
unset( $components['image'] );
unset( $components['image-effects'] );
/* remove hyperlink */
$components['animation'] = [ 'hidden' => true ];
/* add the logo control */
$components[ TCB_Logo::COMPONENT ] = array(
'config' => array(
'ImageSize' => array(
'config' => array(
'default' => '240',
'min' => '20',
'max' => '1024',
'label' => __( 'Size', 'thrive-cb' ),
'um' => [ 'px', '%' ],
'css' => 'width',
'important' => true,
),
'extends' => 'ImageSize',
),
'MenuSplitLogoPosition' => array(
'config' => array(
'full-width' => true,
'name' => __( 'Position when menu is Hamburger', 'thrive-cb' ),
'buttons' => array(
array(
'text' => __( 'Left', 'thrive-cb' ),
'value' => 'left',
),
array(
'text' => __( 'Right', 'thrive-cb' ),
'value' => 'right',
),
),
),
'extends' => 'ButtonGroup',
),
'ImageLoading' => array(
'config' => array(
'name' => '',
'label' => __( 'Lazy-load image', 'thrive-cb' ),
'default' => true,
),
'extends' => 'Switch',
),
'ImageAltText' => array(
'config' => array(
'label' => __( 'Alt Text', 'thrive-cb' ),
),
'extends' => 'LabelInput',
),
),
'disabled_controls' => [
'Overflow',
'ScrollStyle',
],
);
return $components;
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'logo',
'link' => 'https://help.thrivethemes.com/en/articles/4425848-how-to-use-the-logo-element',
],
];
}
}

View File

@@ -0,0 +1,78 @@
<?php
require_once plugin_dir_path( __FILE__ ) . 'class-tcb-menu-item-element.php';
/**
* Class TCB_Label_Disabled_Element
*
* Non edited label element. For inline text we use typography control
*/
class TCB_Megamenu_Column_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Dropdown Column', 'thrive-cb' );
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.tve-regular.tcb-mega-std li.lvl-1';
}
/**
* Hidden element
*
* @return string
*/
public function hide() {
return true;
}
/**
* There is no need for HTML for this element since we need it only for control filter
*
* @return string
*/
protected function html() {
return '';
}
/**
* Component and control config
*
* @return array
*/
public function general_components() {
$components = parent::general_components();
unset( $components['animation'], $components['typography'], $components['responsive'], $components['styles-templates'], $components['scroll'] );
$components['layout']['disabled_controls'] = [
'margin',
'.tve-advanced-controls',
'Width',
'Height',
'Alignment',
'Display',
];
$components['megamenu_column'] = array(
'config' => array(
'Description' => array(
'config' => array(
'label' => __( 'Show menu description', 'thrive-cb' ),
),
'extends' => 'Switch',
),
),
);
return $components;
}
}

View File

@@ -0,0 +1,133 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
require_once plugin_dir_path( __FILE__ ) . 'class-tcb-menu-dropdown-element.php';
/**
* Class TCB_Menu_Child_Element
*/
class TCB_Megamenu_Dropdown_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Mega Menu Dropdown', 'thrive-cb' );
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.tve-regular .tcb-mega-drop-inner';
}
/**
* Hidden element
*
* @return string
*/
public function hide() {
return true;
}
/**
* Component and control config
*
* @return array
*/
protected function general_components() {
$components = parent::general_components();
unset( $components['typography'], $components['animation'], $components['responsive'], $components['styles-templates'], $components['scroll'] );
$components['layout']['disabled_controls'] = [
'margin',
'.tve-advanced-controls',
'Height',
'Width',
'Alignment',
'Display',
];
$components['megamenu_dropdown'] = array(
'order' => 1,
'config' => array(
'Type' => array(
'config' => array(
'default' => 'grid',
'name' => __( 'Display Type', 'thrive-cb' ),
'buttons' => [
[
'icon' => '',
'text' => 'GRID',
'value' => 'grid',
'default' => true,
],
[
'icon' => '',
'text' => 'MASONRY',
'value' => 'masonry',
],
],
),
'extends' => 'ButtonGroup',
),
'ColumnsNumber' => array(
'config' => array(
'default' => '4',
'min' => '2',
'max' => '10',
'label' => __( 'Number of Columns', 'thrive-cb' ),
'um' => [ '' ],
),
'extends' => 'Slider',
),
'HorizontalSpace' => array(
'config' => array(
/* in order to set the default SpaceBetween, you actually have to set a new margin-bottom for the article */
'min' => '0',
'max' => '150',
'label' => __( 'Horizontal Spacing', 'thrive-cb' ),
'um' => [ 'px' ],
),
'extends' => 'Slider',
),
'VerticalSpace' => array(
'config' => array(
/* in order to set the default SpaceBetween, you actually have to set a new margin-bottom for the article */
'min' => '0',
'max' => '150',
'label' => __( 'Vertical Spacing', 'thrive-cb' ),
'um' => [ 'px' ],
),
'extends' => 'Slider',
),
'MaxWidth' => array(
'config' => array(
'min' => '0',
'max' => '2000',
'label' => __( 'Dropdown max width', 'thrive-cb' ),
'um' => [ '%', 'px' ],
'css' => 'max-width',
),
'extends' => 'Slider',
),
),
);
return $components;
}
}

View File

@@ -0,0 +1,135 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
require_once plugin_dir_path( __FILE__ ) . 'class-tcb-menu-element.php';
/**
* Class TCB_Menu_Element
*/
class TCB_Megamenu_Element extends TCB_Menu_Element {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Simple Mega Menu', 'thrive-cb' );
}
/**
* Hide element from panel
*
* @return bool
*/
public function hide() {
return true;
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.tcb-mega-std';
}
/**
* Group Edit Properties
*
* @return array|bool
*/
public function has_group_editing() {
return array(
'select_values' => array(
array(
'value' => 'top_level',
'selector' => '.thrive-shortcode-html ul.tve_w_menu > li',
'element' => '.thrive-shortcode-html li',
'name' => __( 'Top Level Items', 'thrive-cb' ),
/* Translators: %s represents index of the unlocked item */
'singular' => __( '-- Item %s', 'thrive-cb' ),
),
array(
'value' => 'dropdowns',
'selector' => '.tcb-mega-drop-inner',
'element' => '.tcb-mega-drop-inner',
'name' => __( 'All Dropdowns', 'thrive-cb' ),
/* Translators: %s represents index of the unlocked item */
'singular' => __( '-- Dropdown %s', 'thrive-cb' ),
),
array(
'value' => 'dropdown-columns',
'selector' => '.tcb-mega-drop-inner li.lvl-1',
'element' => '.tcb-mega-drop-inner li.lvl-1',
'name' => __( 'All Dropdown Columns', 'thrive-cb' ),
/* Translators: %s represents index of the unlocked item */
'singular' => __( '-- Column %s', 'thrive-cb' ),
),
array(
'value' => 'menu-descriptions',
'selector' => '.tcb-mega-drop-inner li.lvl-1 > .thrv_text_element',
'element' => '.tcb-mega-drop-inner li.lvl-1 > .thrv_text_element',
'name' => __( 'All Menu Descriptions', 'thrive-cb' ),
/* Translators: %s represents index of the unlocked item */
'singular' => __( '-- Menu Description %s', 'thrive-cb' ),
'no_unlock' => true, // mark the fact that this type of element cannot be unlocked
),
array(
'value' => 'menu-images',
'selector' => '.tcb-mega-drop-inner li.lvl-1 .tcb-mm-image:not(.tcb-elem-placeholder)',
'element' => '.tcb-mega-drop-inner li.lvl-1 .tcb-mm-image',
'name' => __( 'All Menu Images', 'thrive-cb' ),
/* Translators: %s represents index of the unlocked item */
'singular' => __( '-- Menu Image %s', 'thrive-cb' ),
),
array(
'value' => 'menu-images',
'selector' => '.tcb-menu-item-image:not(.tcb-elem-placeholder)',
'element' => '.tcb-menu-item-image',
'name' => __( 'All Menu Images', 'thrive-cb' ),
/* Translators: %s represents index of the unlocked item */
'singular' => __( '-- Menu Image %s', 'thrive-cb' ),
),
array(
'value' => 'second-lvl',
'selector' => '.tcb-mega-drop-inner > ul > li > a',
'element' => '.tcb-mega-drop-inner > ul > li > a',
'name' => __( 'Second Level Items', 'thrive-cb' ),
/* Translators: %s represents index of the unlocked item */
'singular' => __( '-- Item %s', 'thrive-cb' ),
),
array(
'value' => 'third-lvl',
'selector' => '.tcb-mega-drop li li a',
'element' => '.tcb-mega-drop li li a',
'name' => __( 'Third Level Items', 'thrive-cb' ),
/* Translators: %s represents index of the unlocked item */
'singular' => __( '-- Item %s', 'thrive-cb' ),
),
),
);
}
/**
* Use another set of cloud templates - since the revamp
*
* @return string
*/
public function get_template_tag() {
return 'megamenu';
}
public function inherit_components_from() {
return 'menu';
}
}

View File

@@ -0,0 +1,128 @@
<?php
require_once plugin_dir_path( __FILE__ ) . 'class-tcb-image-element.php';
/**
* Class TCB_Label_Disabled_Element
*
* Non edited label element. For inline text we use typography control
*/
class TCB_Megamenu_Image_Element extends TCB_Image_Element {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Mega Menu Image', 'thrive-cb' );
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.tcb-mega-drop .tcb-mm-image,.tcb-mega-drop .tcb-mm-image.tcb-elem-placeholder';
}
/**
* There is no need for HTML for this element since we need it only for control filter
*
* @return string
*/
protected function html() {
return '';
}
/**
* Hidden element
*
* @return string
*/
public function hide() {
return true;
}
/**
* Component and control config
*
* @return array
*/
public function general_components() {
$components = parent::general_components();
$image_components = parent::own_components();
unset(
$components['background'],
$components['typography'],
$components['animation'],
$components['scroll'],
$components['responsive'],
$components['styles-templates']
);
$components['layout']['disabled_controls'] = [
'Width',
'Height',
'.tve-advanced-controls',
'Display',
'Alignment',
'padding',
];
$components['shadow']['config']['disabled_controls'] = [ 'text' ];
$components['megamenu_image']['config'] = array(
'ImagePicker' => array(
'config' => array(
'label' => __( 'Replace Image', 'thrive-cb' ),
),
),
'ExternalFields' => array(
'config' => array(
'main_dropdown' => array(
'' => __( 'Select a source', 'thrive-cb' ),
'featured' => __( 'Featured image', 'thrive-cb' ),
'author' => __( 'Author image', 'thrive-cb' ),
'user' => __( 'User image', 'thrive-cb' ),
'custom' => __( 'Custom fields', 'thrive-cb' ),
),
'key' => 'image',
'shortcode_element' => 'img.tve_image',
),
'extends' => 'CustomFields',
),
'Height' => array(
'config' => array(
'default' => 'auto',
'min' => '20',
'max' => '600',
'label' => __( 'Size (height)', 'thrive-cb' ),
'um' => [ 'px' ],
'css' => 'width',
),
'extends' => 'Slider',
),
);
$components['image-effects'] = $image_components['image-effects'];
$components['image-effects']['config']['css_suffix'] = ':not(.tcb-elem-placeholder)';
$components['image-effects']['config']['ImageOverlaySwitch']['strategy'] = 'pseudo-element';
$components['image-effects']['config']['ImageOverlaySwitch']['css_suffix'] = ':not(.tcb-elem-placeholder)::after';
$components['image-effects']['config']['ImageOverlay']['css_suffix'] = ':not(.tcb-elem-placeholder)::after';
return $components;
}
public function own_components() {
return [];
}
/**
* Get all available menu item templates
*
* @return array
*/
public function get_templates() {
return get_option( 'tve_menu_item_templates', [] );
}
}

View File

@@ -0,0 +1,142 @@
<?php
require_once plugin_dir_path( __FILE__ ) . 'class-tcb-menu-item-element.php';
/**
* Class TCB_Label_Disabled_Element
*
* Non edited label element. For inline text we use typography control
*/
class TCB_Megamenu_Item_Element extends TCB_Menu_Item_Element {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Mega Menu Item', 'thrive-cb' );
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.tcb-mega-drop li a';
}
/**
* There is no need for HTML for this element since we need it only for control filter
*
* @return string
*/
protected function html() {
return '';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$typography_defaults = [
'css_prefix' => '',
'css_suffix' => '',
'important' => true,
];
return array(
'megamenu_item' => array(
'config' => array(
'HasIconImage' => array(
'config' => array(
'name' => __( 'Display', 'thrive-cb' ),
'options' => array(
'text' => __( 'Text only', 'thrive-cb' ),
'icon' => __( 'Icon only', 'thrive-cb' ),
'icon-text' => __( 'Icon and text', 'thrive-cb' ),
'image' => __( 'Image only', 'thrive-cb' ),
'image-text' => __( 'Image and text', 'thrive-cb' ),
),
),
'extends' => 'Select',
),
'ImageSide' => [
'extends' => 'ButtonGroup',
],
'ColorPicker' => array(
'css_suffix' => ' .m-icon',
'config' => array(
'label' => __( 'Icon Color', 'thrive-cb' ),
'important' => true,
),
),
'Slider' => array(
'css_suffix' => ' .m-icon',
'config' => array(
'default' => 30,
'min' => 1,
'max' => 50,
'label' => __( 'Size', 'thrive-cb' ),
'um' => [ 'px' ],
'css' => 'fontSize',
),
),
'Display' => array(
'config' => array(
'name' => __( 'Show when', 'thrive-cb' ),
'options' => array(
'always' => __( 'Always', 'thrive-cb' ),
'logged-in' => __( 'Logged in', 'thrive-cb' ),
'logged-out' => __( 'Logged out', 'thrive-cb' ),
),
),
'extends' => 'Select',
),
),
),
'typography' => [
'disabled_controls' => [
'.tve-advanced-controls',
],
'config' => [
'FontColor' => $typography_defaults,
'FontSize' => $typography_defaults,
'FontFace' => $typography_defaults,
'TextStyle' => $typography_defaults,
'LineHeight' => $typography_defaults,
'LetterSpacing' => $typography_defaults,
'TextTransform' => $typography_defaults,
],
],
'background' => [
'config' => [
'ColorPicker' => [
'config' => [
'important' => false,
],
],
],
],
'layout' => [
'disabled_controls' => [
'.tve-advanced-controls',
'Alignment',
'Display',
],
],
);
}
/**
* Get all available menu item templates
*
* @return array
*/
public function get_templates() {
return get_option( 'tve_menu_item_templates', [] );
}
}

View File

@@ -0,0 +1,88 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Menu_Child_Element
*/
class TCB_Menu_Dropdown_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Menu Dropdown', 'thrive-cb' );
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.tve_w_menu .sub-menu:not(.tcb-mega-drop ul)';
}
/**
* Hidden element
*
* @return string
*/
public function hide() {
return true;
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return array(
'borders' => array(
'blocked_controls' => array(
'Corners' => __( 'This is disabled for the current element because it can have an unpredictable behaviour', 'thrive-cb' ),
),
'config' => [
'Borders' => [
'important' => true,
],
'Corners' => [
'important' => true,
],
],
),
'shadow' => [
'config' => [
'important' => true,
'default_shadow' => 'none',
],
],
'layout' => [
'disabled_controls' => [
'margin',
'.tve-advanced-controls',
'Height',
'Width',
'Alignment',
'Display',
],
],
'typography' => [ 'hidden' => true ],
'animation' => [ 'hidden' => true ],
'responsive' => [ 'hidden' => true ],
'styles-templates' => [ 'hidden' => true ],
);
}
}

View File

@@ -0,0 +1,578 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Menu_Element
*/
class TCB_Menu_Element extends TCB_Cloud_Template_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Custom Menu', 'thrive-cb' );
}
/**
* All these elements act as placeholders
*
* @return boolean
*/
public function is_placeholder() {
return false;
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'navigation menu, nav, nav menu';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'menu';
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.thrv_widget_menu:not(.tcb-mega-std)';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$dropdown_svg = $this->get_icon_styles();
$dropdown_icons = [];
foreach ( $dropdown_svg as $key => & $dropdown_icon ) {
$dropdown_icons[ $key ] = $dropdown_icon['label'];
unset( $dropdown_icon['label'] );
}
unset( $dropdown_icon );
$menus = array(
array(
'value' => 'custom',
'name' => __( 'Custom', 'thrive-cb' ),
),
);
foreach ( tve_get_custom_menus() as $menu ) {
$menu['value'] = $menu['id'];
$menus [] = $menu;
}
$menu = array(
'menu' => array(
'config' => array(
'MenuPalettes' => [
'config' => [],
'extends' => 'Palettes',
],
'MenuSource' => array(
'config' => array(
'label' => __( 'Menu source', 'thrive-cb' ),
'options' => $menus,
),
'extends' => 'Select',
),
'OrderList' => [
'config' => [
'sortable' => true,
'max_levels' => 2,
'tpl' => 'controls/menu/preview-list-item',
],
],
'SelectMenu' => [],
'HoverEffect' => array(
'config' => array(
'name' => __( 'Hover effect', 'thrive-cb' ),
'options' => [
'none' => 'None',
'style_1' => 'Underline',
'style_2' => 'Double line',
'style_3' => 'Brackets',
],
),
'extends' => 'Select',
),
'ContentAlign' => array(
'to' => '.menu-item',
'config' => array(
'name' => __( 'Content alignment', 'thrive-cb' ),
'buttons' => [
[
'icon' => 'format-align-left',
'text' => '',
'value' => 'left',
'default' => true,
],
[
'icon' => 'format-align-center',
'text' => '',
'value' => 'center',
],
[
'icon' => 'format-align-right',
'text' => '',
'value' => 'right',
],
],
),
'extends' => 'ButtonGroup',
),
'Align' => array(
'config' => array(
'buttons' => array(
array(
'icon' => 'a_left',
'value' => 'left',
'tooltip' => __( 'Align Left', 'thrive-cb' ),
),
array(
'icon' => 'a_center',
'value' => 'center',
'default' => true,
'tooltip' => __( 'Align Center', 'thrive-cb' ),
),
array(
'icon' => 'a_right',
'value' => 'right',
'tooltip' => __( 'Align Right', 'thrive-cb' ),
),
array(
'text' => 'FULL',
'value' => 'full',
'tooltip' => __( 'Full Width', 'thrive-cb' ),
),
),
),
'css_suffix' => '.tve-vertical-menu',
),
'HamburgerMenuAlign' => [
'config' => [
'buttons' => [
[
'icon' => 'a_left',
'value' => 'flex-start',
'default' => true,
'tooltip' => __( 'Align Left', 'thrive-cb' ),
],
[
'icon' => 'a_center',
'value' => 'center',
'tooltip' => __( 'Align Center', 'thrive-cb' ),
],
[
'icon' => 'a_right',
'value' => 'flex-end',
'tooltip' => __( 'Align Right', 'thrive-cb' ),
],
],
],
],
'MenuWidth' => array(
'config' => array(
'default' => '0',
'min' => '50',
'max' => '1080',
'label' => __( 'Menu width', 'thrive-cb' ),
'um' => [ 'px', '%' ],
'css' => 'max-width',
),
'css_suffix' => '.tve-vertical-menu',
'extends' => 'Slider',
),
'DropdownDirection' => array(
'config' => array(
'name' => __( 'Expand style', 'thrive-cb' ),
'options' => array(
'vm-toggle' => __( 'Toggle', 'thrive-cb' ),
'vmd-right' => __( 'Drop right', 'thrive-cb' ),
'vmd-left' => __( 'Drop left', 'thrive-cb' ),
),
),
'extends' => 'Select',
),
'DropdownIcon' => array(
'config' => array(
'name' => __( 'Dropdown icon', 'thrive-cb' ),
'options' => $dropdown_icons,
),
'paths' => $dropdown_svg,
),
'DropdownAnimation' => array(
'config' => array(
'name' => __( 'Dropdown animation', 'thrive-cb' ),
'options' => array(
'' => __( 'None (instant)', 'thrive-cb' ),
'da-fade' => __( 'Fade In and Out ', 'thrive-cb' ),
'da-slide1' => __( 'Slide Down #1', 'thrive-cb' ),
'da-slide2' => __( 'Slide Down #2', 'thrive-cb' ),
'da-fold' => __( 'Fold Out', 'thrive-cb' ),
),
),
'extends' => 'Select',
),
'MenuType' => array(
'config' => array(
'options' => [
'horizontal' => __( 'Horizontal', 'thrive-cb' ),
'vertical' => __( 'Vertical', 'thrive-cb' ),
'hamburger' => __( 'Hamburger', 'thrive-cb' ),
],
'name' => __( 'Type', 'thrive-cb' ),
),
'extends' => 'Select',
),
'MenuSpacing' => array(
'config' => array(
'name' => __( 'Spacing', 'thrive-cb' ),
'full-width' => true,
'buttons' => array(
array(
'value' => 'horizontal',
'text' => __( 'Horizontal', 'thrive-cb' ),
),
array(
'value' => 'vertical',
'text' => __( 'Vertical', 'thrive-cb' ),
),
array(
'value' => 'between',
'text' => __( 'Between', 'thrive-cb' ),
),
),
),
'extends' => 'Tabs',
),
'LogoSplit' => array(
'config' => array(
'label' => __( 'Split menu with logo', 'thrive-cb' ),
'default' => false,
),
'extends' => 'Switch',
),
'MenuState' => array(
'config' => array(
'label' => __( 'View expanded menu in editor', 'thrive-cb' ),
'default' => false,
),
'extends' => 'Switch',
),
'MenuOverlay' => array(
'config' => array(
'label' => __( 'Overlay', 'thrive-cb' ),
'default' => false,
),
'extends' => 'Switch',
),
'MenuOverlayColor' => array(
'config' => array(
'default' => 'transparent',
'label' => __( 'Color ', 'thrive-cb' ),
'options' => [
'output' => 'object',
],
),
'extends' => 'ColorPicker',
),
'HorizontalSpacing' => [
'to' => '.tve_w_menu > .menu-item',
'config' => [
'default' => '16',
'min' => '0',
'max' => '100',
'label' => '',
'um' => [ 'px' ],
],
'extends' => 'Slider',
],
'VerticalSpacing' => [
'to' => '.tve_w_menu > .menu-item',
'config' => [
'default' => '1',
'min' => '0',
'max' => '100',
'label' => '',
'um' => [ 'px' ],
],
'extends' => 'Slider',
],
'BetweenSpacing' => [
'to' => '.tve_w_menu > .menu-item',
'config' => [
'default' => 'auto',
'min' => '0',
'max' => '300',
'label' => '',
'um' => [ 'px' ],
],
'extends' => 'Slider',
],
'MobileSide' => array(
'config' => array(
'name' => __( 'Menu display', 'thrive-cb' ),
'options' => [
'tve-mobile-side-right' => 'Off screen, right',
'tve-mobile-side-left' => 'Off screen, left',
'tve-mobile-dropdown' => 'Drop down',
'tve-mobile-side-fullscreen' => 'Full screen overlay',
],
),
'extends' => 'Select',
),
'DisableActiveLinks' => array(
'config' => array(
'label' => __( 'Disable links to current page', 'thrive-cb' ),
),
'extends' => 'Switch',
),
),
'icons' => $this->get_trigger_icons(),
),
'background' => [
'config' => [
'css_suffix' => ' .tve_w_menu',
],
],
'typography' => [
'hidden' => true,
],
'animation' => [ 'hidden' => true ],
'shadow' => [
'config' => [
'css_suffix' => ' .tve_w_menu',
],
],
'borders' => [
'config' => [
'css_suffix' => ' .tve_w_menu',
'Corners' => [
'overflow' => false,
],
],
],
'layout' => array(
'disabled_controls' => [
'Display',
'Width',
'Height',
],
'config' => array(
'MarginAndPadding' => [
'padding_suffix' => ' .tve_w_menu',
],
'Alignment' => array(
'override_buttons' => array(
array( 'icon' => 'a_left', 'value' => 'left', 'data' => [ 'tooltip' => 'Align Left' ] ),
array( 'icon' => 'a_center', 'value' => 'center', 'default' => true, 'data' => [ 'tooltip' => 'Align Center' ] ),
array( 'icon' => 'a_right', 'value' => 'right', 'data' => [ 'tooltip' => 'Align Right' ] ),
array( 'text' => 'FULL', 'value' => 'full', 'tooltip' => __( 'Full Width', 'thrive-cb' ), ),
),
),
),
),
'conditional-display' => [
'hidden' => false,
],
);
return array_merge( $menu, $this->group_component() );
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Group Edit Properties
*
* @return array|bool
*/
public function has_group_editing() {
return array(
'elem_selector' => '.thrv_widget_menu',
'select_values' => array(
array(
'value' => 'top_level',
'selector' => '.thrive-shortcode-html ul.tve_w_menu > li:not(.tcb-menu-logo-wrap)',
'element' => '.thrive-shortcode-html li:not(.tcb-menu-logo-wrap)',
'name' => __( 'Top Level Items', 'thrive-cb' ),
/* Translators: %s represents index of the unlocked item */
'singular' => __( '-- Item %s', 'thrive-cb' ),
),
array(
'value' => 'dropdowns',
'selector' => '.tve_w_menu .sub-menu',
'element' => '.tve_w_menu .sub-menu',
'name' => __( 'All Dropdowns', 'thrive-cb' ),
/* Translators: %s represents index of the unlocked item */
'singular' => __( '-- Dropdown %s', 'thrive-cb' ),
),
array(
'value' => 'items',
'selector' => '.thrive-shortcode-html li li',
'element' => '.thrive-shortcode-html li',
'name' => __( 'All Dropdown Items', 'thrive-cb' ),
/* Translators: %s represents index of the unlocked item */
'singular' => __( '-- Item %s', 'thrive-cb' ),
),
array(
'value' => 'menu-images',
'selector' => '.tcb-menu-item-image:not(.tcb-elem-placeholder)',
'element' => '.tcb-menu-item-image',
'name' => __( 'All Menu Images', 'thrive-cb' ),
/* Translators: %s represents index of the unlocked item */
'singular' => __( '-- Menu Image %s', 'thrive-cb' ),
),
array(
'value' => 'menu-images-hamburger',
'selector' => '.tcb-menu-img-hamburger .tcb-mm-image:not(.tcb-elem-placeholder)',
'element' => '.tcb-menu-img-hamburger .tcb-mm-image',
'name' => __( 'All Menu Images', 'thrive-cb' ),
/* Translators: %s represents index of the unlocked item */
'singular' => __( '-- Menu Image %s', 'thrive-cb' ),
),
),
);
}
public function get_icon_styles() {
return [
'none' => [
'label' => 'None',
'up' => '',
'box' => '',
],
'style_1' => [
'label' => 'Angle',
'up' => '<path d="M151.5 347.8L3.5 201c-4.7-4.7-4.7-12.3 0-17l19.8-19.8c4.7-4.7 12.3-4.7 17 0L160 282.7l119.7-118.5c4.7-4.7 12.3-4.7 17 0l19.8 19.8c4.7 4.7 4.7 12.3 0 17l-148 146.8c-4.7 4.7-12.3 4.7-17 0z"/>',
'box' => '0 0 320 512',
],
'style_2' => [
'label' => 'Chevron',
'up' => '<path d="M443.5 162.6l-7.1-7.1c-4.7-4.7-12.3-4.7-17 0L224 351 28.5 155.5c-4.7-4.7-12.3-4.7-17 0l-7.1 7.1c-4.7 4.7-4.7 12.3 0 17l211 211.1c4.7 4.7 12.3 4.7 17 0l211-211.1c4.8-4.7 4.8-12.3.1-17z"/>',
'box' => '0 0 448 512',
],
'style_3' => [
'label' => 'Caret',
'up' => '<path d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"/>',
'box' => '0 0 320 512',
],
'style_4' => [
'label' => 'Triangle',
'up' => '<path d="M272 160H48.1c-42.6 0-64.2 51.7-33.9 81.9l111.9 112c18.7 18.7 49.1 18.7 67.9 0l112-112c30-30.1 8.7-81.9-34-81.9zM160 320L48 208h224L160 320z"/>',
'box' => '0 0 320 512',
],
];
}
public function get_trigger_icons() {
return [
'style_1' => [
'open' => '<svg class="tcb-icon" viewBox="0 0 24 24" data-name="align-justify"><g><g><path class="st0" d="M23,13H1c-0.6,0-1-0.4-1-1s0.4-1,1-1h22c0.6,0,1,0.4,1,1S23.6,13,23,13z"/></g><g><path class="st0" d="M23,6.7H1c-0.6,0-1-0.4-1-1s0.4-1,1-1h22c0.6,0,1,0.4,1,1S23.6,6.7,23,6.7z"/></g><g><path class="st0" d="M23,19.3H1c-0.6,0-1-0.4-1-1s0.4-1,1-1h22c0.6,0,1,0.4,1,1S23.6,19.3,23,19.3z"/></g></g></svg>',
'close' => '<svg class="tcb-icon" viewBox="0 0 24 24" data-name="close"><path class="st0" d="M13.4,12l7.1-7.1c0.4-0.4,0.4-1,0-1.4s-1-0.4-1.4,0L12,10.6L4.9,3.5c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4l7.1,7.1 l-7.1,7.1c-0.4,0.4-0.4,1,0,1.4c0.4,0.4,1,0.4,1.4,0l7.1-7.1l7.1,7.1c0.4,0.4,1,0.4,1.4,0c0.4-0.4,0.4-1,0-1.4L13.4,12z"/></svg>',
],
'style_2' => [
'open' => '<svg class="tcb-icon" viewBox="0 0 32 32" data-name="align-justify"><path class="st0" d="M0,0v32h32V0H0z M23.5,23.1h-15c-0.7,0-1.3-0.6-1.3-1.3s0.6-1.3,1.3-1.3h15c0.7,0,1.3,0.6,1.3,1.3 S24.2,23.1,23.5,23.1z M23.5,17.3h-15c-0.7,0-1.3-0.6-1.3-1.3s0.6-1.3,1.3-1.3h15c0.7,0,1.3,0.6,1.3,1.3S24.2,17.3,23.5,17.3z M23.5,11.4h-15c-0.7,0-1.3-0.6-1.3-1.3s0.6-1.3,1.3-1.3h15c0.7,0,1.3,0.6,1.3,1.3S24.2,11.4,23.5,11.4z"/></svg>',
'close' => '<svg class="tcb-icon" viewBox="0 0 32 32" data-name="close"><path class="st0" d="M0,0v32h32V0H0z M22.2,20.4c0.5,0.5,0.5,1.3,0,1.8c-0.2,0.2-0.6,0.4-0.9,0.4s-0.6-0.1-0.9-0.4L16,17.8l-4.4,4.4 c-0.2,0.2-0.6,0.4-0.9,0.4s-0.6-0.1-0.9-0.4c-0.5-0.5-0.5-1.3,0-1.8l4.4-4.4l-4.4-4.4c-0.5-0.5-0.5-1.3,0-1.8s1.3-0.5,1.8,0l4.4,4.4 l4.4-4.4c0.5-0.5,1.3-0.5,1.8,0s0.5,1.3,0,1.8L17.8,16L22.2,20.4z"/></svg>',
],
'style_3' => [
'open' => '<svg class="tcb-icon" viewBox="0 0 32 32" data-name="align-justify"><g><rect x="8" y="10.1" class="st0" width="16" height="2"/><rect x="8" y="15" class="st0" width="16" height="2"/><rect x="8" y="19.9" class="st0" width="16" height="2"/><path class="st0" d="M0,0v32h32V0H0z M30,30H2V2h28V30z"/></g></svg>',
'close' => '<svg class="tcb-icon" viewBox="0 0 32 32" data-name="close"><g><path class="st0" d="M0,0v32h32V0H0z M30,30H2V2h28V30z"/><polygon class="st0" points="11.1,22.4 16,17.4 21,22.4 22.4,21 17.4,16 22.4,11.1 21,9.6 16,14.6 11.1,9.6 9.6,11.1 14.6,16 9.6,21 "/></g></svg>',
],
'style_4' => [
'open' => '<svg class="tcb-icon" viewBox="0 0 32 32" data-name="align-justify"><g><path class="st0" d="M23.5,11.4h-15c-0.4,0-0.8,0.3-0.8,0.8s0.3,0.8,0.8,0.8h15c0.4,0,0.8-0.3,0.8-0.8S23.9,11.4,23.5,11.4z"/><path class="st0" d="M23.5,15.3h-15c-0.4,0-0.8,0.3-0.8,0.8s0.3,0.8,0.8,0.8h15c0.4,0,0.8-0.3,0.8-0.8S23.9,15.3,23.5,15.3z"/><path class="st0" d="M23.5,19.1h-15c-0.4,0-0.8,0.3-0.8,0.8s0.3,0.8,0.8,0.8h15c0.4,0,0.8-0.3,0.8-0.8S23.9,19.1,23.5,19.1z"/><path class="st0" d="M16,0C7.2,0,0,7.2,0,16v0c0,8.8,7.2,16,16,16s16-7.2,16-16v0C32,7.2,24.8,0,16,0z M16,30.5 C8,30.5,1.5,24,1.5,16C1.5,8,8,1.5,16,1.5C24,1.5,30.5,8,30.5,16C30.5,24,24,30.5,16,30.5z"/></g></svg>',
'close' => '<svg class="tcb-icon" viewBox="0 0 32 32" data-name="close"><g><path class="st0" d="M16,0C7.2,0,0,7.2,0,16v0c0,8.8,7.2,16,16,16s16-7.2,16-16v0C32,7.2,24.8,0,16,0z M16,30.5 C8,30.5,1.5,24,1.5,16C1.5,8,8,1.5,16,1.5C24,1.5,30.5,8,30.5,16C30.5,24,24,30.5,16,30.5z"/><path class="st0" d="M21.8,10.2c-0.3-0.3-0.8-0.3-1.1,0L16,14.9l-4.8-4.8c-0.3-0.3-0.8-0.3-1.1,0s-0.3,0.8,0,1.1l4.8,4.8l-4.8,4.8 c-0.3,0.3-0.3,0.8,0,1.1c0.1,0.1,0.3,0.2,0.5,0.2s0.4-0.1,0.5-0.2l4.8-4.8l4.8,4.8c0.1,0.1,0.3,0.2,0.5,0.2s0.4-0.1,0.5-0.2 c0.3-0.3,0.3-0.8,0-1.1L17.1,16l4.8-4.8C22.1,10.9,22.1,10.5,21.8,10.2z"/></g></svg>',
],
'style_5' => [
'open' => '<svg class="tcb-icon" viewBox="0 0 64.4 14.7" data-name="align-justify"><g><g><path class="st0" d="M63.4,8.3h-22c-0.6,0-1-0.4-1-1s0.4-1,1-1h22c0.6,0,1,0.4,1,1S63.9,8.3,63.4,8.3z"/></g><g><path class="st0" d="M63.4,2h-22c-0.6,0-1-0.4-1-1s0.4-1,1-1h22c0.6,0,1,0.4,1,1S63.9,2,63.4,2z"/></g><g><path class="st0" d="M63.4,14.7h-22c-0.6,0-1-0.4-1-1s0.4-1,1-1h22c0.6,0,1,0.4,1,1S63.9,14.7,63.4,14.7z"/></g><g><g><path class="st0" d="M5.6,7.3l0.1-1.4H5.5L5,7.2l-1.4,3l-1.4-3L1.7,5.9H1.5l0.1,1.4v4.4H0V3.3h1.8l1.1,2.5l0.6,1.8h0.1l0.6-1.8 l1.1-2.5h1.8v8.4H5.6V7.3z"/></g><g><path class="st0" d="M9,11.6V3.3h5.2v1.5h-3.5v1.9h2.9v1.5h-2.9v2h3.5v1.5H9z"/></g><g><path class="st0" d="M17.9,7.1l-0.5-1.3h-0.2l0.1,1.4v4.4h-1.6V3.3h1.9l2.1,4.5l0.5,1.3h0.2l-0.1-1.4V3.3h1.6v8.4H20L17.9,7.1z" /></g><g><path class="st0" d="M25.3,3.3v5.4c0,0.6,0.1,1,0.3,1.2c0.2,0.2,0.5,0.4,1,0.4c0.5,0,0.8-0.1,1-0.4c0.2-0.2,0.3-0.6,0.3-1.2V3.3 h1.7v5.2c0,0.6-0.1,1.1-0.2,1.5c-0.1,0.4-0.3,0.8-0.5,1s-0.5,0.5-0.9,0.6c-0.4,0.1-0.9,0.2-1.4,0.2c-0.6,0-1-0.1-1.4-0.2 s-0.7-0.3-0.9-0.6c-0.2-0.3-0.4-0.6-0.5-1c-0.1-0.4-0.2-0.9-0.2-1.5V3.3H25.3z"/></g></g></g></svg>',
'close' => '<svg class="tcb-icon" viewBox="0 0 60.9 17.6" data-name="close"><g><path class="st0" d="M3.4,13.1c-0.5,0-1-0.1-1.4-0.2c-0.4-0.2-0.8-0.4-1.1-0.7s-0.5-0.8-0.7-1.3S0,9.6,0,8.8s0.1-1.5,0.2-2 c0.2-0.6,0.4-1,0.7-1.4C1.2,5.1,1.6,4.9,2,4.7c0.4-0.2,0.9-0.2,1.4-0.2c0.8,0,1.3,0.2,1.8,0.5s0.8,0.8,1.1,1.5L4.7,7.2 c0-0.2-0.1-0.3-0.2-0.5C4.5,6.5,4.4,6.4,4.3,6.3C4.2,6.2,4.1,6.1,3.9,6C3.8,6,3.6,5.9,3.4,5.9c-0.5,0-0.9,0.1-1.1,0.4 S1.8,7.1,1.8,7.7v2.2c0,0.6,0.1,1,0.4,1.3s0.6,0.4,1.1,0.4c0.2,0,0.4,0,0.6-0.1c0.2-0.1,0.3-0.2,0.4-0.3c0.1-0.1,0.2-0.3,0.3-0.4 c0.1-0.2,0.1-0.3,0.2-0.5l1.4,0.8c-0.1,0.3-0.3,0.6-0.5,0.8c-0.2,0.2-0.4,0.5-0.6,0.6S4.7,12.9,4.4,13C4.1,13.1,3.7,13.1,3.4,13.1z"/><path class="st0" d="M7.5,13V4.6h1.7v6.9H12V13H7.5z"/><path class="st0" d="M15.9,13.1c-0.5,0-1-0.1-1.4-0.2c-0.4-0.2-0.8-0.4-1-0.8c-0.3-0.3-0.5-0.8-0.7-1.3c-0.2-0.5-0.2-1.2-0.2-2 c0-0.8,0.1-1.4,0.2-2s0.4-1,0.7-1.3c0.3-0.3,0.6-0.6,1-0.8c0.4-0.2,0.9-0.2,1.4-0.2c0.5,0,1,0.1,1.4,0.2s0.8,0.4,1,0.8 c0.3,0.3,0.5,0.8,0.7,1.3s0.2,1.2,0.2,2c0,0.8-0.1,1.5-0.2,2c-0.2,0.5-0.4,1-0.7,1.3c-0.3,0.3-0.6,0.6-1,0.8S16.4,13.1,15.9,13.1z M15.9,11.6c0.5,0,0.9-0.1,1.1-0.4s0.4-0.7,0.4-1.3V7.7c0-0.6-0.1-1-0.4-1.3s-0.6-0.4-1.1-0.4c-0.5,0-0.8,0.1-1.1,0.4 s-0.4,0.7-0.4,1.3v2.2c0,0.6,0.1,1,0.4,1.3S15.4,11.6,15.9,11.6z"/><path class="st0" d="M23.1,13.1c-1.3,0-2.2-0.4-3-1.3l1.1-1.1c0.5,0.6,1.1,0.9,1.9,0.9c0.8,0,1.2-0.4,1.2-1.1 c0-0.3-0.1-0.5-0.2-0.7c-0.1-0.2-0.4-0.3-0.7-0.3l-0.8-0.1C21.9,9.3,21.3,9,21,8.6c-0.4-0.4-0.5-0.9-0.5-1.7c0-0.8,0.2-1.4,0.7-1.9 c0.5-0.4,1.2-0.6,2.1-0.6c1.2,0,2.1,0.4,2.7,1.2l-1.1,1.1c-0.2-0.3-0.4-0.4-0.7-0.6c-0.3-0.1-0.6-0.2-0.9-0.2 c-0.4,0-0.7,0.1-0.8,0.2c-0.2,0.1-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.2,0.6c0.1,0.1,0.3,0.2,0.6,0.3L23.7,8c0.4,0.1,0.8,0.2,1,0.3 s0.5,0.3,0.7,0.5c0.2,0.2,0.3,0.4,0.4,0.7c0.1,0.3,0.1,0.6,0.1,0.9c0,0.9-0.3,1.6-0.8,2C24.8,12.9,24.1,13.1,23.1,13.1z"/><path class="st0" d="M27.4,13V4.6h5.2v1.5h-3.5V8h2.9v1.5h-2.9v2h3.5V13H27.4z"/></g><path class="st0" d="M53.6,8.8l7.1-7.1c0.4-0.4,0.4-1,0-1.4s-1-0.4-1.4,0l-7.1,7.1l-7.1-7.1c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4 l7.1,7.1l-7.1,7.1c-0.4,0.4-0.4,1,0,1.4c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3l7.1-7.1l7.1,7.1c0.2,0.2,0.5,0.3,0.7,0.3 s0.5-0.1,0.7-0.3c0.4-0.4,0.4-1,0-1.4L53.6,8.8z"/></svg>',
],
];
}
/**
* Build html for the hamburger trigger icons
*
* @param array $attributes
*
* @return string
*/
public function get_hamburger_trigger_html( $attributes = [] ) {
$sets = $this->get_trigger_icons();
$trigger_icons = empty( $attributes['mobile_icon'] ) ? $sets['style_1'] : $sets[ $attributes['mobile_icon'] ];
$trigger_classes = [ 'tve-m-trigger' ];
if ( ! empty( $attributes['dir'] ) ) {
$trigger_classes[] = 't_' . $attributes['dir'];
}
if ( ! empty( $attributes['color'] ) ) {
$trigger_classes[] = $attributes['color'];
}
return sprintf(
'<a%s class="%s" href="javascript:void(0)">' .
'<div class="thrv_wrapper thrv_icon tcb-icon-open">%s</div>' .
'<div class="thrv_wrapper thrv_icon tcb-icon-close">%s</div>' .
'</a>',
empty( $attributes['trigger_attr'] ) ? '' : sprintf( " data-tve-custom-colour='%s'", $attributes['trigger_attr'] ),
implode( ' ', $trigger_classes ),
$trigger_icons['open'],
$trigger_icons['close']
);
}
/**
* Use another set of cloud templates - since the revamp
*
* @return string
*/
public function get_template_tag() {
return 'menu_v2';
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'menu',
'link' => 'https://help.thrivethemes.com/en/articles/4425832-how-to-use-the-custom-menu-element',
],
];
}
}

View File

@@ -0,0 +1,156 @@
<?php
/**
* Class TCB_Menu_Hamburger_Wrapper_Element
*/
class TCB_Menu_Hamburger_Wrapper_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Menu Box', 'thrive-cb' );
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.thrv_wrapper:not(.tve-regular) .tve-ham-wrap';
}
/**
* There is no need for HTML for this element since we need it only for control filter
*
* @return string
*/
protected function html() {
return '';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$components = array_merge( $this->general_components(), [
'menu_hamburger_wrapper' => [
'config' => [
'BoxWidth' => [
'config' => [
'default' => '1024',
'min' => '100',
'max' => '2000',
'label' => __( 'Maximum Width', 'thrive-cb' ),
'um' => [ 'px', '%' ],
'css' => 'max-width',
],
'extends' => 'Slider',
],
'HorizontalPosition' => [
'config' => [
'name' => __( 'Horizontal position', 'thrive-cb' ),
'buttons' => [
[
'icon' => 'a_right',
'text' => '',
'value' => 'left',
],
[
'icon' => 'a_center',
'text' => '',
'value' => 'center',
'default' => true,
],
[
'icon' => 'a_left',
'text' => '',
'value' => 'right',
],
],
],
'extends' => 'ButtonGroup',
],
'BoxHeight' => [
'config' => [
'default' => '80',
'min' => '1',
'max' => '1000',
'label' => __( 'Minimum Height', 'thrive-cb' ),
'um' => [ 'px', 'vh' ],
'css' => 'min-height',
],
'extends' => 'Slider',
],
'VerticalPosition' => [
'config' => [
'name' => __( 'Vertical Position', 'thrive-cb' ),
'buttons' => [
[
'icon' => 'top',
'default' => true,
'value' => 'flex-start',
],
[
'icon' => 'vertical',
'value' => 'center',
],
[
'icon' => 'bot',
'value' => 'flex-end',
],
],
],
'extends' => 'ButtonGroup',
],
],
],
'background' => [
'config' => [
'ColorPicker' => [
'config' => [
'important' => false,
],
],
],
],
'layout' => [
'disabled_controls' => [
'Display',
'Width',
'Height',
'Alignment',
'.tve-advanced-controls',
'margin',
],
],
'borders' => [
'config' => [
'Corners' => [
'overflow' => false,
],
],
],
'animation' => [ 'hidden' => true ],
'responsive' => [ 'hidden' => true ],
'styles-templates' => [ 'hidden' => true ],
] );
foreach ( $components['typography']['config'] as $control => $config ) {
if ( is_array( $config ) ) {
$components['typography']['config'][ $control ]['important'] = true;
}
}
return $components;
}
public function hide() {
return true;
}
}

View File

@@ -0,0 +1,33 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
if ( ! class_exists( '\TCB_Menu_Icon_Element_Abstract', false ) ) {
require_once TVE_TCB_ROOT_PATH . 'inc/classes/class-tcb-menu-icon-element-abstract.php';
}
/**
* Class TCB_Menu_Icon_Close_Element
*/
class TCB_Menu_Icon_Close_Element extends TCB_Menu_Icon_Element_Abstract {
/**
* @return string
*/
public function name() {
return __( 'Close Menu Icon', 'thrive-cb' );
}
/**
* @return string
*/
public function identifier() {
return '.tcb-icon-close';
}
}

View File

@@ -0,0 +1,33 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
if ( ! class_exists( '\TCB_Menu_Icon_Element_Abstract', false ) ) {
require_once TVE_TCB_ROOT_PATH . 'inc/classes/class-tcb-menu-icon-element-abstract.php';
}
/**
* Class TCB_Menu_Icon_Close_Offscreen_Element
*/
class TCB_Menu_Icon_Close_Offscreen_Element extends TCB_Menu_Icon_Element_Abstract {
/**
* @return string
*/
public function name() {
return __( 'Close Menu Icon', 'thrive-cb' );
}
/**
* @return string
*/
public function identifier() {
return '.tcb-icon-close-offscreen';
}
}

View File

@@ -0,0 +1,33 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
if ( ! class_exists( '\TCB_Menu_Icon_Element_Abstract', false ) ) {
require_once TVE_TCB_ROOT_PATH . 'inc/classes/class-tcb-menu-icon-element-abstract.php';
}
/**
* Class TCB_Menu_Icon_Open_Element
*/
class TCB_Menu_Icon_Open_Element extends TCB_Menu_Icon_Element_Abstract {
/**
* @return string
*/
public function name() {
return __( 'Open Menu Icon', 'thrive-cb' );
}
/**
* @return string
*/
public function identifier() {
return '.tcb-icon-open';
}
}

View File

@@ -0,0 +1,216 @@
<?php
require_once plugin_dir_path( __FILE__ ) . 'class-tcb-label-element.php';
/**
* Class TCB_Label_Disabled_Element
*
* Non edited label element. For inline text we use typography control
*/
class TCB_Menu_Item_Element extends TCB_Label_Element {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Menu Item', 'thrive-cb' );
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.thrv_widget_menu li';
}
/**
* There is no need for HTML for this element since we need it only for control filter
*
* @return string
*/
protected function html() {
return '';
}
/**
* Removes the unnecessary components from the element json string
*
* @return array
*/
protected function general_components() {
$general_components = parent::general_components();
$general_components['animation']['config']['hide_items'] = [ 'animation', 'tooltip', 'link' ];
unset( $general_components['responsive'], $general_components['styles-templates'] );
return $general_components;
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return array(
'menu_item' => array(
'config' => array(
'HoverEffect' => array(
'config' => array(
'name' => __( 'Hover Effect', 'thrive-cb' ),
'options' => [
'' => 'None',
'c-underline' => 'Underline',
'c-double' => 'Double line',
'c-brackets' => 'Brackets',
'c-thick' => 'Thick Underline',
],
),
'extends' => 'Select',
),
'StyleChange' => array(
'config' => array(
'label' => __( 'Item style', 'thrive-cb' ),
'label_none' => __( 'Choose...', 'thrive-cb' ),
),
),
'StylePicker' => array(
'config' => array(
'label' => __( 'Choose item style', 'thrive-cb' ),
'items' => $this->get_templates(),
),
),
'HasIconImage' => array(
'config' => array(
'name' => __( 'Display', 'thrive-cb' ),
'options' => array(
'text' => __( 'Text only', 'thrive-cb' ),
'icon' => __( 'Icon only', 'thrive-cb' ),
'icon-text' => __( 'Icon and text', 'thrive-cb' ),
'image' => __( 'Image only', 'thrive-cb' ),
'image-text' => __( 'Image and text', 'thrive-cb' ),
),
),
'extends' => 'Select',
),
'Display' => array(
'config' => array(
'name' => __( 'Show when', 'thrive-cb' ),
'options' => array(
'always' => __( 'Always', 'thrive-cb' ),
'logged-in' => __( 'Logged in', 'thrive-cb' ),
'logged-out' => __( 'Logged out', 'thrive-cb' ),
),
),
'extends' => 'Select',
),
'ImageSide' => [
'extends' => 'ButtonGroup',
],
'ColorPicker' => array(
'css_suffix' => ' > a .m-icon',
'config' => array(
'label' => __( 'Icon Color', 'thrive-cb' ),
'options' => [ 'noBeforeInit' => false ],
),
),
'Slider' => array(
'css_suffix' => ' > a .m-icon',
'config' => array(
'default' => 30,
'min' => 1,
'max' => 50,
'label' => __( 'Size', 'thrive-cb' ),
'um' => [ 'px' ],
'css' => 'fontSize',
),
),
),
),
'typography' => [
'disabled_controls' => [
'.tve-advanced-controls',
],
'config' => [
'FontColor' => [
'css_prefix' => '',
'css_suffix' => ' > a',
'important' => true,
],
'FontSize' => [
'css_prefix' => '',
'css_suffix' => ' > a',
'important' => true,
],
'FontFace' => [
'css_prefix' => '',
'css_suffix' => ' > a',
'important' => true,
],
'TextStyle' => [
'css_suffix' => ' > a',
'important' => true,
],
'LineHeight' => [
'css_suffix' => ' > a',
'css_prefix' => '',
'important' => true,
],
'LetterSpacing' => [
'css_suffix' => ' > a',
'important' => true,
],
'TextTransform' => [
'css_suffix' => ' > a',
'important' => true,
],
],
],
'background' => [
'config' => [
'ColorPicker' => [
'config' => [
'important' => false,
],
],
],
],
'layout' => [
'disabled_controls' => [
'margin-top',
'margin-bottom',
'.tve-advanced-controls',
'Alignment',
'Display',
],
],
'borders' => [
'config' => [
'Corners' => [
'overflow' => false,
],
],
],
);
}
/**
* Get all available menu item templates
*
* @return array
*/
public function get_templates() {
return get_option( 'tve_menu_item_templates', [] );
}
/**
* @inheritDoc
*/
public function active_state_config() {
return true;
}
}

View File

@@ -0,0 +1,136 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
/**
* Class TCB_Menu_Item_Image_Element
*
* Non edited label element. For inline text we use typography control
*/
class TCB_Menu_Item_Image_Element extends TCB_Image_Element {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Menu Item Image', 'thrive-cb' );
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.tcb-menu-item-image,.tcb-mm-image,.tcb-menu-img-hamburger .tcb-mm-image,.tcb-menu-item-image.tcb-elem-placeholder,.tcb-mm-image.tcb-elem-placeholder,.tcb-menu-img-hamburger .tcb-mm-image.tcb-elem-placeholder';
}
/**
* There is no need for HTML for this element since we need it only for control filter
*
* @return string
*/
protected function html() {
return '';
}
/**
* Hidden element
*
* @return string
*/
public function hide() {
return true;
}
/**
* Component and control config
*
* @return array
*/
public function general_components() {
$components = parent::general_components();
$image_components = parent::own_components();
unset(
$components['background'],
$components['typography'],
$components['animation'],
$components['scroll'],
$components['styles-templates'],
$components['responsive']
);
$components['layout']['disabled_controls'] = [
'Width',
'Height',
'.tve-advanced-controls',
'Display',
'Alignment',
'padding',
];
$components['shadow']['config']['disabled_controls'] = [ 'text' ];
$components['menu_item_image']['config'] = array(
'ImagePicker' => array(
'config' => array(
'label' => __( 'Replace Image', 'thrive-cb' ),
),
),
'ExternalFields' => array(
'config' => array(
'main_dropdown' => array(
'' => __( 'Select a source', 'thrive-cb' ),
'featured' => __( 'Featured image', 'thrive-cb' ),
'author' => __( 'Author image', 'thrive-cb' ),
'user' => __( 'User image', 'thrive-cb' ),
'custom' => __( 'Custom fields', 'thrive-cb' ),
),
'key' => 'image',
'shortcode_element' => 'img.tve_image',
),
'extends' => 'CustomFields',
),
'ImageSize' => array(
'config' => array(
'default' => 'auto',
'min' => '20',
'forceMin' => '5',
'max' => '200',
'label' => __( 'Size', 'thrive-cb' ),
'um' => [ 'px' ],
),
'extends' => 'Slider',
),
'Height' => array(
'config' => array(
'default' => 'auto',
'min' => '20',
'max' => '200',
'label' => __( 'Height', 'thrive-cb' ),
'um' => [ 'px' ],
'css' => 'width',
),
'extends' => 'Slider',
),
);
$components['image-effects'] = $image_components['image-effects'];
$components['image-effects']['config']['css_suffix'] = ':not(.tcb-elem-placeholder)';
$components['image-effects']['config']['ImageOverlaySwitch']['strategy'] = 'pseudo-element';
$components['image-effects']['config']['ImageOverlaySwitch']['css_suffix'] = ':not(.tcb-elem-placeholder)::after';
$components['image-effects']['config']['ImageOverlay']['css_suffix'] = ':not(.tcb-elem-placeholder)::after';
return $components;
}
public function own_components() {
return [];
}
}

View File

@@ -0,0 +1,81 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Moretag_Element
*
* Content templates - allows inserting saved content templates into the page
*/
class TCB_Moretag_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'More Tag', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'more, read more';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'more_tag';
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.tve_more_tag';
}
/**
* This is only a placeholder element
*
* @return bool
*/
public function is_placeholder() {
return true;
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Display this only when editing posts
*
* @return bool
*/
public function hide() {
return get_post_type() !== 'post';
}
}

View File

@@ -0,0 +1,243 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_NumberCounter_Element
*/
class TCB_Number_Counter_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Number Counter', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'number, counter, fill';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'number_counter_icon';
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.tve-number-counter';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$components['number_counter'] = [
'config' => [
'StartingValue' => [
'config' => [
'name' => __( 'Starting value', 'thrive-cb' ),
'default' => 0,
],
'extends' => 'Input',
],
'EndValue' => [
'config' => [
'name' => __( 'End value', 'thrive-cb' ),
'default' => 1,
],
'extends' => 'Input',
],
'DecimalPrecision' => [
'config' => [
'label' => __( 'Decimal precision', 'thrive-cb' ),
'default' => '0',
'min' => '0',
'max' => '3',
'um' => [ '' ],
],
'extends' => 'Slider',
],
'DecimalCharacter' => [
'config' => [
'name' => __( 'Decimal character', 'thrive-cb' ),
'options' => [
'.' => 'Point',
',' => 'Comma',
],
],
'extends' => 'Select',
],
'ThousandsDivider' => [
'config' => [
'name' => __( 'Thousands divider', 'thrive-cb' ),
'options' => [
'' => 'None',
',' => 'Comma',
'.' => 'Point',
' ' => 'Space',
],
],
'extends' => 'Select',
],
'Prefix' => [
'extends' => 'LabelInput',
],
'Suffix' => [
'extends' => 'LabelInput',
],
'ShowLabel' => [
'config' => [
'name' => '',
'label' => __( 'Show label', 'thrive-cb' ),
'default' => false,
],
'extends' => 'Switch',
],
'LabelPosition' => [
'config' => [
'name' => __( 'Position', 'thrive-cb' ),
'options' => [
[
'value' => 'tcb-label-top',
'name' => __( 'Top', 'thrive-cb' ),
],
[
'value' => 'tcb-label-bottom',
'name' => __( 'Bottom', 'thrive-cb' ),
],
[
'value' => 'tcb-label-both',
'name' => __( 'Both', 'thrive-cb' ),
],
],
],
'extends' => 'Select',
],
'Size' => [
'config' => [
'default' => '25',
'min' => '10',
'max' => '100',
'um' => [ 'px' ],
'label' => __( 'Size', 'thrive-cb' ),
],
'extends' => 'Slider',
],
'Speed' => [
'config' => [
'name' => __( 'Speed', 'thrive-cb' ),
'options' => [
[
'value' => '4007',
'name' => __( 'Slow', 'thrive-cb' ),
],
[
'value' => '2507',
'name' => __( 'Default', 'thrive-cb' ),
],
[
'value' => '1007',
'name' => __( 'Fast', 'thrive-cb' ),
],
[
'value' => '2000',
'name' => __( 'Custom', 'thrive-cb' ),
],
],
],
'extends' => 'Select',
],
'CustomSpeed' => [
'config' => [
'name' => __( 'Custom speed(ms)', 'thrive-cb' ),
'value' => '2000',
],
'extends' => 'Input',
],
],
];
$general_components = $this->general_components();
$components['typography'] = $general_components['typography'];
/* disable this, since we already have a Size control in the Main Options */
$components['typography']['disabled_controls'] = [ 'FontSize', '[data-value="tcb-typography-font-size"]' ];
foreach ( $components['typography']['config'] as $control => $config ) {
if ( in_array( $control, [ 'css_suffix', 'css_prefix' ] ) ) {
continue;
}
$components['typography']['config'][ $control ]['css_suffix'] = [ ' .thrv-inline-text' ];
}
$components['typography']['config']['FontSize']['config'] ['min'] = '10';
/* the text align should be flex-based */
$components['typography']['config']['TextAlign'] = array_merge(
$components['typography']['config']['TextAlign'],
[
'property' => 'text-align',
'property_val' => [
'left' => 'left',
'center' => 'center',
'right' => 'right',
'justify' => 'justify',
],
] );
$components['typography']['config']['TextAlign']['css_suffix'] = [ ' .thrv-inline-text', ' .tve-number-wrapper' ];
return $components;
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'number_counter',
'link' => 'https://help.thrivethemes.com/en/articles/5579404-how-to-use-the-number-counter-element',
],
];
}
}

View File

@@ -0,0 +1,232 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 11/3/2017
* Time: 9:20 AM
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Nunberlist_Element
*/
class TCB_Numberedlist_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Numbered List', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'list';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'numbered-list';
}
/**
* Number List element identifier
*
* @return string
*/
public function identifier() {
return ' .thrv-numbered_list';
}
/**
* The HTML is generated from js
*
* @return string
*/
protected function html() {
return '';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$prefix_config = tcb_selection_root();
$default_config = [
'css_suffix' => ' li',
'css_prefix' => $prefix_config . ' ',
'important' => true,
];
$numberedlist = array(
'numberedlist' => array(
'config' => array(
'FontFace' => array(
'css_suffix' => ' .tcb-numbered-list-number',
'config' => array(
'template' => 'controls/font-manager',
'label' => __( 'Number Font', 'thrive-cb' ),
'inline' => false,
),
),
'numbers_color' => array(
'css_suffix' => ' .tcb-numbered-list-number',
'config' => array(
'label' => __( 'Numbers color', 'thrive-cb' ),
),
'extends' => 'ColorPicker',
),
'item_spacing' => array(
'css_suffix' => ' li',
'css_prefix' => $prefix_config . ' ',
'config' => array(
'default' => '20',
'min' => '1',
'max' => '100',
'label' => __( 'List Item Spacing', 'thrive-cb' ),
'um' => [ 'px', 'em' ],
'css' => 'margin-bottom',
),
'extends' => 'Slider',
),
'starting_number' => array(
'config' => array(
'name' => __( 'Starting Number', 'thrive-cb' ),
'default' => 10,
'min' => 0,
'max' => 366,
'maxlength' => 3,
),
'extends' => 'Input',
),
'increment_number' => array(
'config' => array(
'name' => __( 'Increment', 'thrive-cb' ),
'default' => 10,
'min' => 1,
'max' => 366,
'maxlength' => 3,
),
'extends' => 'Input',
),
'numbers_size' => array(
'css_suffix' => ' .tcb-numbered-list-number',
'config' => array(
'default' => '18',
'min' => '8',
'max' => '200',
'label' => __( 'Numbers size', 'thrive-cb' ),
'um' => [ 'px' ],
'css' => 'fontSize',
),
'extends' => 'Slider',
),
'preview' => [
'config' => [
'sortable' => true,
],
],
),
),
'typography' => [
'disabled_controls' => [
'.tve-advanced-controls',
'[data-value="tcb-typography-line-height"] ',
'p_spacing',
'h1_spacing',
'h2_spacing',
'h3_spacing',
],
'config' => [
'TextAlign' => [
'css_suffix' => ' .thrv-styled-list-item',
'property' => 'justify-content',
'property_val' => [
'left' => 'flex-start',
'center' => 'center',
'right' => 'flex-end',
'justify' => 'space-evenly',
],
],
'FontColor' => $default_config,
'FontSize' => $default_config,
'TextTransform' => $default_config,
],
],
'layout' => [
'disabled_controls' => [],
],
);
return array_merge( $numberedlist, $this->group_component() );
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Group Edit Properties
*
* @return array|bool
*/
public function has_group_editing() {
return array(
'select_values' => array(
array(
'value' => 'all_list_items',
'selector' => '.thrv-styled-list-item',
'name' => __( 'Grouped List Items', 'thrive-cb' ),
'singular' => __( '-- List Item %s', 'thrive-cb' ),
),
array(
'value' => 'all_numbers',
'selector' => '.thrv-disabled-label',
'name' => __( 'Grouped Figures', 'thrive-cb' ),
'singular' => __( '-- Figure %s', 'thrive-cb' ),
),
array(
'value' => 'all_texts',
'selector' => '.thrv-advanced-inline-text',
'name' => __( 'Grouped Texts', 'thrive-cb' ),
'singular' => __( '-- Text %s', 'thrive-cb' ),
),
),
);
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'numbered_list',
'link' => 'https://help.thrivethemes.com/en/articles/4425821-how-to-use-the-numbered-list-element',
],
];
}
}

View File

@@ -0,0 +1,206 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Pagination_Element
*/
class TCB_Pagination_Element extends TCB_Cloud_Template_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Pagination', 'thrive-cb' );
}
/**
* WordPress element identifier
*
* @return string
*/
public function identifier() {
return '.' . TCB_Pagination::IDENTIFIER;
}
/**
* @return bool
*/
public function is_placeholder() {
return false;
}
/**
* Hide this in the sidebar.
*/
public function hide() {
return true;
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$components = array(
'pagination' => array(
'config' => array(
'Type' => array(
'config' => array(
'default' => TCB_Pagination::NONE,
/* if this is the control from the post list, change the name a bit */
'name' => __( 'Type', 'thrive-cb' ),
/* the option list is populated in JS */
'options' => [],
),
'extends' => 'Select',
),
'PageNumbersToggle' => array(
'config' => array(
'label' => __( 'Page Numbers', 'thrive-cb' ),
),
'extends' => 'Switch',
),
'PagesNearCurrent' => array(
'config' => array(
'default' => '2',
'min' => '0',
'max' => '10',
'label' => __( 'Pages Displayed Near Current Page', 'thrive-cb' ),
'um' => [ '' ],
),
'extends' => 'Slider',
),
'NextPreviousToggle' => array(
'config' => array(
'label' => __( 'Next/Previous', 'thrive-cb' ),
),
'extends' => 'Switch',
),
'FirstLastToggle' => array(
'config' => array(
'label' => __( 'First/Last', 'thrive-cb' ),
),
'extends' => 'Switch',
),
'LabelToggle' => array(
'config' => array(
'label' => __( 'Pagination Label', 'thrive-cb' ),
),
'extends' => 'Switch',
),
'PageSpacing' => array(
'config' => array(
'default' => '10',
'min' => '1',
'max' => '100',
'label' => __( 'Page Number Spacing', 'thrive-cb' ),
'um' => [ 'px', 'em' ],
'css' => 'margin-left',
),
'extends' => 'Slider',
),
'Alignment' => array(
'config' => array(
'default' => 'space-between',
'name' => __( 'Alignment', 'thrive-cb' ),
'options' => [
[
'name' => 'Centered',
'value' => 'center',
],
[
'name' => 'Left',
'value' => 'flex-start',
],
[
'name' => 'Right',
'value' => 'flex-end',
],
[
'name' => 'Space Between',
'value' => 'space-between',
],
],
),
'extends' => 'Select',
),
),
),
'layout' => [
'disabled_controls' => [ 'Display' ],
],
'animation' => [ 'hidden' => true ],
'styles-templates' => [ 'hidden' => true ],
'scroll' => [ 'hidden' => true ],
'typography' => [ 'hidden' => true ],
);
return array_merge( $components, $this->group_component() );
}
/**
* Group Edit Properties
*
* @return array|bool
*/
public function has_group_editing() {
return array(
'select_values' => array(
array(
'value' => 'prev_next_pagination_buttons',
'selector' => '.' . TCB_Pagination_Numeric::PREV_NEXT_BUTTON_CLASS,
'name' => __( 'Next/Previous Buttons', 'thrive-cb' ),
'singular' => __( 'Next/Previous Button', 'thrive-cb' ),
),
array(
'value' => 'prev_next_pagination_button_icons',
'selector' => '.' . TCB_Pagination_Numeric::PREV_NEXT_BUTTON_CLASS . ' .thrv_icon',
'name' => __( 'Next/Previous Button Icons', 'thrive-cb' ),
'singular' => __( 'Next/Previous Button Icon', 'thrive-cb' ),
),
array(
'value' => 'prev_next_pagination_button_texts',
'selector' => '.' . TCB_Pagination_Numeric::PREV_NEXT_BUTTON_CLASS . ' .tcb-button-text',
'name' => __( 'Next/Previous Button Texts', 'thrive-cb' ),
'singular' => __( 'Next/Previous Button Text', 'thrive-cb' ),
),
array(
'value' => 'first_last_pagination_buttons',
'selector' => '.' . TCB_Pagination_Numeric::FIRST_LAST_BUTTON_CLASS,
'name' => __( 'First/Last Buttons', 'thrive-cb' ),
'singular' => __( 'First/Last Button', 'thrive-cb' ),
),
array(
'value' => 'first_last_pagination_buttons_icons',
'selector' => '.' . TCB_Pagination_Numeric::FIRST_LAST_BUTTON_CLASS . ' .thrv_icon',
'name' => __( 'First/Last Button Icons', 'thrive-cb' ),
'singular' => __( 'First/Last Button Icon', 'thrive-cb' ),
),
array(
'value' => 'first_last_pagination_buttons_texts',
'selector' => '.' . TCB_Pagination_Numeric::FIRST_LAST_BUTTON_CLASS . ' .tcb-button-text',
'name' => __( 'First/Last Button Texts', 'thrive-cb' ),
'singular' => __( 'First/Last Button Text', 'thrive-cb' ),
),
array(
'value' => 'all_pagination_numbers',
'selector' => '.tcb-pagination-link',
'name' => __( 'Grouped Pagination Numbers', 'thrive-cb' ),
'singular' => __( '-- Pagination Number %s', 'thrive-cb' ),
'no_unlock' => true,
),
),
);
}
}

View File

@@ -0,0 +1,118 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package TCB2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TCB_Post_Element extends TCB_Element_Abstract {
/**
* @return string
*/
public function name() {
$name = get_post_type() === 'post' ? __( 'Post', 'thrive-cb' ) : __( 'Page', 'thrive-cb' );
/**
* Change post element name
*/
return apply_filters( 'tcb_post_element_name', $name );
}
/**
* @return string
*/
public function identifier() {
return '.tve-post-options-element';
}
/**
* Either to display or not the element in the sidebar menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* Returns the class main option
*
* Used also in:
* inc/classes/elements/class-tcb-post-element.php
* inc/classes/elements/class-tcb-landing-page-element.php
*
* @return array
*/
protected function post_main_option() {
return array(
'post' => array(
'config' => array(
'VisibilityOptions' => array(
'config' => array(
'label' => __( 'Visibility', 'thrive-cb' ),
'options' => array(
array(
'value' => 'public',
'name' => __( 'Public', 'thrive-cb' ),
),
array(
'value' => 'private',
'name' => __( 'Private', 'thrive-cb' ),
),
array(
'value' => 'password',
'name' => __( 'Password protected', 'thrive-cb' ),
),
),
),
),
'PublishOptions' => [],
'UnpublishOptions' => [],
),
),
);
}
/**
* @return array
*/
public function own_components() {
$post_config = [
'typography' => [
'hidden' => true,
],
'layout' => [
'hidden' => true,
],
'borders' => [
'hidden' => true,
],
'animation' => [
'hidden' => true,
],
'background' => [
'hidden' => true,
],
'shadow' => [
'hidden' => true,
],
'responsive' => [
'hidden' => true,
],
'styles-templates' => [
'hidden' => true,
],
];
$post_config = $this->post_main_option() + $post_config;
/* filter in order to add more components to this in the Theme Builder */
return apply_filters( 'tcb_post_element_extend_config', $post_config );
}
}

View File

@@ -0,0 +1,323 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Post_List_Element
*/
class TCB_Post_List_Element extends TCB_Cloud_Template_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Post List', 'thrive-cb' );
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'post-list';
}
/**
* This element is not a placeholder
*
* @return bool|true
*/
public function is_placeholder() {
return false;
}
/**
* WordPress element identifier
*
* @return string
*/
public function identifier() {
return '.' . TCB_POST_LIST_CLASS;
}
/**
* Hide this element in the places where it doesn't make sense, but show it on posts, pages, custom post types, etc.
*
* @return bool
*/
public function hide() {
return apply_filters( 'tcb_hide_post_list_element', TCB_Utils::should_hide_element_on_blacklisted_post_types() );
}
/**
* Override the parent implementation of this method in order to add more classes.
*
* Returns the HTML placeholder for an element (contains a wrapper, and a button with icon + element name)
*
* @param string $title Optional. Defaults to the name of the current element
*
* @return string
*/
public function html_placeholder( $title = null ) {
if ( empty( $title ) ) {
$title = $this->name();
}
$post_list_args = TCB_Post_List::default_args();
$attr = array(
'query' => $post_list_args['query'],
'ct' => $this->tag() . '-0',
'tcb-elem-type' => $this->tag(),
'element-name' => esc_attr( $this->name() ),
'specific-modal' => 'post-list',
);
$extra_attr = '';
foreach ( $attr as $key => $value ) {
$extra_attr .= 'data-' . $key . '="' . $value . '" ';
}
return tcb_template( 'elements/element-placeholder', array(
'icon' => $this->icon(),
'class' => 'tcb-ct-placeholder tcb-compact-element',
'title' => $title,
'extra_attr' => $extra_attr,
), true );
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$pagination_types = [];
/* for each pagination instance, get the label and the type for the select control config */
foreach ( TCB_Pagination::$all_types as $type ) {
$instance = tcb_pagination( $type );
$pagination_types[] = array(
'name' => $instance->get_label(),
'value' => $instance->get_type(),
);
}
$components = array(
'carousel' => [ 'hidden' => false ],
'animation' => [ 'hidden' => true ],
'styles-templates' => [ 'hidden' => true ],
'typography' => [ 'hidden' => true ],
'layout' => [
'disabled_controls' => [ 'MaxWidth', 'Float', 'hr', 'Position', 'PositionFrom', 'Display', 'Overflow', 'ScrollStyle' ],
],
'post_list' => array(
'order' => 1,
'config' => array(
'Type' => array(
'config' => array(
'default' => 'grid',
'large_buttons' => true,
'name' => __( 'Display type', 'thrive-cb' ),
'buttons' => array(
array(
'data' => array(
'tooltip' => __( 'Grid', 'thrive-cb' ),
'position' => 'top',
),
'icon' => 'gallery-grid',
'value' => 'grid',
'default' => true,
),
array(
'data' => array(
'tooltip' => __( 'Masonry', 'thrive-cb' ),
'position' => 'top',
'width' => '100%',
),
'icon' => 'gallery-vertical-masonry',
'value' => 'masonry',
),
array(
'data' => array(
'tooltip' => __( 'List', 'thrive-cb' ),
'position' => 'top',
'width' => '100%',
),
'icon' => 'display-list',
'value' => 'list',
),
array(
'data' => array(
'tooltip' => __( 'Carousel', 'thrive-cb' ),
'position' => 'top',
'width' => '100%',
),
'icon' => 'gallery-carousel',
'value' => 'carousel',
),
),
),
'extends' => 'ButtonGroup',
),
'ColumnsNumber' => array(
'config' => array(
'default' => '3',
'min' => '1',
'max' => '10',
'label' => __( 'Columns', 'thrive-cb' ),
'um' => [ '' ],
),
'extends' => 'Slider',
),
'VerticalSpace' => array(
'config' => array(
'min' => '0',
'max' => '240',
'label' => __( 'Vertical space', 'thrive-cb' ),
'um' => [ 'px' ],
),
'extends' => 'Slider',
),
'HorizontalSpace' => array(
'config' => array(
'min' => '0',
'max' => '240',
'label' => __( 'Horizontal space', 'thrive-cb' ),
'um' => [ 'px' ],
),
'extends' => 'Slider',
),
/* get the select control for the pagination type */
'PaginationType' => array(
'config' => array(
'default' => TCB_Pagination::NONE,
/* if this is the control from the post list, change the name a bit */
'name' => __( 'Pagination type', 'thrive-cb' ),
'options' => $pagination_types,
),
'extends' => 'Select',
),
'ContentSize' => array(
'config' => array(
'name' => __( 'Content', 'thrive-cb' ),
'buttons' => [
[
'icon' => '',
'text' => 'Full',
'value' => 'content',
],
[
'icon' => '',
'text' => 'Excerpt',
'value' => 'excerpt',
],
[
'icon' => '',
'text' => 'Words',
'value' => 'words',
'default' => true,
],
],
),
'extends' => 'ButtonGroup',
),
'WordsTrim' => array(
'config' => array(
'name' => __( 'Word count', 'thrive-cb' ),
'default' => 12,
'maxlength' => 2,
'min' => 1,
),
'extends' => 'Input',
),
'ReadMoreText' => array(
'config' => array(
'label' => __( 'Read more text', 'thrive-cb' ),
'default' => '',
'placeholder' => __( 'e.g. Continue reading', 'thrive-cb' ),
),
'extends' => 'LabelInput',
),
'Linker' => array(
'config' => array(
'name' => '',
'label' => __( 'Link entire item to content', 'thrive-cb' ),
),
'extends' => 'Switch',
),
'Featured' => array(
'config' => array(
'name' => '',
'label' => __( 'Show featured content' ),
'info' => true,
),
'extends' => 'Switch',
),
'NumberOfItems' => array(
'config' => array(
'name' => __( 'Number of items', 'thrive-cb' ),
'default' => get_option( 'posts_per_page' ),
'maxlength' => 4,
'min' => 1,
),
'extends' => 'Input',
),
),
),
);
/* Add group components for the Carousel Arrows */
$components = array_merge( $components, $this->group_component() );
return $components;
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'post_list',
'link' => 'https://help.thrivethemes.com/en/articles/4425844-how-to-use-the-post-list-element-in-thrive-architect',
],
];
}
/**
* Group Edit Properties
*
* @return array|bool
*/
public function has_group_editing() {
return array(
'select_values' => array(
array(
'value' => 'arrows',
'selector' => '.tcb-carousel-arrow',
'name' => __( 'Next/Previous buttons Icons', 'thrive-cb' ),
'singular' => __( '-- Next/Previous buttons Icon', 'thrive-cb' ),
),
),
);
}
}

View File

@@ -0,0 +1,218 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Post_List_Filter_Element
*/
class TCB_Post_List_Filter_Element extends TCB_Element_Abstract {
/**
* @return string
*/
public function name() {
return __( 'Post List Filter', 'thrive-cb' );
}
/**
* @return string
*/
public function icon() {
return 'post-list-filters';
}
/**
* @return string
*/
public function identifier() {
return '.tcb-post-list-filter';
}
/**
* Hide this element in the places where it doesn't make sense, but show it on posts, pages, custom post types, etc.
*
* @return bool
*/
public function hide() {
return TCB_Utils::should_hide_element_on_blacklisted_post_types();
}
public function own_components() {
$default_filter_option = array(
'author' => __( 'Author', 'thrive-cb' ),
'category' => __( 'Category', 'thrive-cb' ),
'tag' => __( 'Tag', 'thrive-cb' ),
);
$filter_options = array_merge( $default_filter_option, static::get_filter_options() );
/* add the post list filter control */
$components['post_list_filter'] = array(
'config' => array(
'FilterOption' => array(
'config' => array(
'name' => __( 'Filter option', 'thrive-cb' ),
'options' => $filter_options,
),
'extends' => 'Select',
),
'MultipleSelections' => array(
'config' => array(
'name' => '',
'label' => __( 'Allow multiple selections', 'thrive-cb' ),
'default' => true,
),
'extends' => 'Switch',
),
'FilterType' => array(
'config' => array(
'name' => __( 'Filter type', 'thrive-cb' ),
'options' => array(
'button' => __( 'Buttons', 'thrive-cb' ),
'checkbox' => __( 'Checkboxes', 'thrive-cb' ),
'radio' => __( 'Radios', 'thrive-cb' ),
'dropdown' => __( 'Dropdown', 'thrive-cb' ),
'list' => __( 'Text links', 'thrive-cb' ),
'search' => __( 'Search', 'thrive-cb' ),
),
),
'extends' => 'Select',
),
'DisplayOption' => array(
'config' => array(
'name' => __( 'Display option', 'thrive-cb' ),
'options' => array(
'horizontally' => __( 'Horizontally', 'thrive-cb' ),
'vertically' => __( 'Vertically', 'thrive-cb' ),
),
),
'extends' => 'Select',
),
'VerticalSpace' => array(
'config' => array(
'min' => 0,
'max' => 200,
'label' => __( 'Vertical space', 'thrive-cb' ),
'um' => [ 'px' ],
),
'extends' => 'Slider',
),
'HorizontalSpace' => array(
'config' => array(
'min' => 0,
'max' => 200,
'label' => __( 'Horizontal space', 'thrive-cb' ),
'um' => [ 'px' ],
),
'extends' => 'Slider',
),
'URLQueryKey' => array(
'config' => array(
'label' => __( 'URL query key', 'thrive-cb' ),
),
'extends' => 'LabelInput',
),
'AllOption' => array(
'config' => array(
'name' => '',
'label' => __( 'Include "All" option', 'thrive-cb' ),
'default' => true,
),
'extends' => 'Switch',
),
'AllLabel' => array(
'config' => array(
'label' => __( 'Label for "All"', 'thrive-cb' ),
),
'extends' => 'LabelInput',
),
'OptionsSelection' => array(
'config' => array(
'label' => __( 'Content', 'thrive-cb' ),
'tags' => false,
'data' => '',
'min_input_length' => 0,
'remote' => false,
'no_results' => __( 'No posts were found satisfying your Query', 'thrive-cb' ),
),
'extends' => 'SelectAutocomplete',
),
'DefaultValue' => array(
'config' => array(
'name' => __( 'Default value', 'thrive-cb' ),
'options' => [],
),
'extends' => 'Select',
),
),
);
return array_merge( $components, $this->group_component() );
}
public static function get_filter_options() {
$args = [
'public' => true,
'_builtin' => false,
];
$excluded_tax = [ 'tva_courses', 'tcb_symbols_tax', 'tvo_tags' ];
$taxonimies = get_taxonomies( $args, 'object' );
$options = [];
foreach ( $taxonimies as $tax ) {
if ( ! in_array( $tax->name, $excluded_tax, true ) ) {
$options[ $tax->name ] = $tax->label;
}
}
return $options;
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Group Edit Properties
*
* @return array|bool
*/
public function has_group_editing() {
return array(
'select_values' => array(
array(
'value' => 'all_filter_optiopns',
'selector' => '.tcb-filter-option',
'name' => __( 'Grouped Filter Options', 'thrive-cb' ),
'singular' => __( '-- Filter Option %s', 'thrive-cb' ),
),
),
);
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'post_list_filter',
'link' => 'https://help.thrivethemes.com/en/articles/6533678-how-to-use-the-post-list-filter-element',
],
];
}
}

View File

@@ -0,0 +1,613 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 5/26/2017
* Time: 4:37 PM
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Postgrid_Element
*/
class TCB_Postgrid_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Post Grid', 'thrive-cb' );
}
/**
* We don't use this anymore
*
* @return bool
*/
public function hide() {
return true;
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'list';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'post_grid';
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.thrv_post_grid ';
}
/**
* Post Grid extra sidebar state - used in MANAGE CELLS mode.
*
* @return null|string
*/
public function get_sidebar_extra_state() {
return tcb_template( 'sidebars/post-grid-edit-grid-options', null, true );
}
/**
* Gets all the post types for post grid
*
* @return array
*/
private function get_all_post_types() {
$types = [];
$banned_types = TCB_Utils::get_banned_post_types();
foreach ( get_post_types( [], 'objects' ) as $type ) {
if ( ! in_array( $type->name, $banned_types ) ) {
$types[] = [
'id' => $type->name,
'text' => $type->label,
];
}
}
return $types;
}
/**
* Construct number of posts data
*
* @return array
*/
private function get_number_of_posts() {
$return = [
[
'value' => 0,
'name' => 'All',
],
];
foreach ( range( 1, 19 ) as $number ) {
$return[] = [
'value' => $number,
'name' => $number,
];
}
return $return;
}
/**
* Constructs the categories list for "Category filter"
*
* @return array
*/
public static function get_categories( $term ) {
$taxonomies = [ 'category' ];
if ( taxonomy_exists( 'apprentice' ) ) {
$taxonomies[] = 'apprentice';
}
$terms = get_terms( $taxonomies, [ 'search' => $term ] );
$categories = [];
foreach ( $terms as $item ) {
$categories[] = [
'id' => $item->name,
'text' => $item->name,
];
}
return $categories;
}
/**
* Constructs the tags list for "Tags filter"
*
* @return array
*/
public static function get_tags( $term ) {
$taxonomies = [
'post_tag',
];
if ( taxonomy_exists( 'apprentice' ) ) {
$taxonomies[] = 'apprentice-tag';
}
$terms = get_terms( $taxonomies, [ 'search' => $term ] );
$tags = [];
foreach ( $terms as $item ) {
$tags[] = [
'id' => $item->name,
'text' => $item->name,
];
}
return $tags;
}
/**
* Constructs the taxonomies list for "Custom Taxonomies filter"
*
* @return array
*/
public static function get_custom_taxonomies( $term ) {
$items = get_taxonomies();
$banned = [ 'category', 'post_tag' ];
$taxonomies = [];
foreach ( $items as $item ) {
if ( in_array( $item, $banned ) ) {
continue;
}
if ( strpos( $item, $term ) !== false ) {
$taxonomies[] = [
'id' => $item,
'text' => $item,
];
}
}
return $taxonomies;
}
/**
* Constructs the author list for "Authors filter"
*
* @return array
*/
public static function get_authors( $term ) {
$users = get_users( [ 'search' => "*$term*" ] );
$authors = [];
foreach ( $users as $item ) {
$authors[] = [
'id' => $item->data->user_nicename,
'text' => $item->data->user_nicename,
];
}
return $authors;
}
/**
* Constructs the post lists for "Individual Post / Pages filter"
*
* @return array
*/
public static function get_posts_list( $term ) {
$args = [
'order_by' => 'post_title',
'post_type' => [ 'page', 'post' ],
'post_status' => [ 'publish' ],
's' => $term,
];
$results = new WP_Query( $args );
$list = [];
foreach ( $results->get_posts() as $post ) {
$list[] = [
'id' => $post->ID,
'text' => $post->post_title,
];
}
return $list;
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return array(
'postgrid' => array(
'config' => array(
'read_more' => array(
'config' => array(
'label' => __( 'Read More', 'thrive-cb' ),
),
'extends' => 'LabelInput',
),
'read_more_color' => array(
'config' => array(
'default' => 'f00',
'label' => __( 'Text Color', 'thrive-cb' ),
'important' => true,
'options' => [ 'allowEmpty' => true ],
),
'extends' => 'ColorPicker',
),
'img_height' => [
'config' => [
'default' => '100',
'min' => '10',
'max' => '999',
'um' => [ 'px' ],
],
'extends' => 'Slider',
],
'title_font_size' => [
'css_suffix' => ' .tve-post-grid-title',
'config' => [
'default' => '16',
'min' => '10',
'max' => '100',
'um' => [ 'px' ],
],
'extends' => 'Slider',
],
'title_line_height' => [
'css_suffix' => ' .tve-post-grid-title',
'config' => [
'default' => '16',
'min' => '10',
'max' => '100',
'um' => [ 'px' ],
],
'extends' => 'Slider',
],
'tabs' => array(
'config' => array(
'buttons' => array(
array(
'value' => 'img-height',
'text' => __( 'Image Height', 'thrive-cb' ),
),
array(
'value' => 'title-font',
'text' => __( 'Title Font', 'thrive-cb' ),
),
array(
'value' => 'line-height',
'text' => __( 'Line Height', 'thrive-cb' ),
),
),
),
),
),
),
'postgrid-layout' => array(
'config' => array(
'number_of_columns' => array(
'config' => array(
'name' => __( 'Columns', 'thrive-cb' ),
'default' => 3,
'options' => range( 1, 6 ),
),
'extends' => 'Select',
),
'display' => array(
'config' => array(
'name' => __( 'Display', 'thrive-cb' ),
'options' => [
[
'value' => 'grid',
'name' => 'Grid',
],
[
'value' => 'masonry',
'name' => 'Masonry',
],
],
),
'extends' => 'Select',
),
'grid_layout' => array(
'config' => array(
'name' => __( 'Grid Layout', 'thrive-cb' ),
'options' => [
[
'value' => 'horizontal',
'name' => 'Horizontal',
],
[
'value' => 'vertical',
'name' => 'Vertical',
],
],
),
'extends' => 'Select',
),
'featured_image' => array(
'config' => array(
'name' => '',
'label' => __( 'Featured image', 'thrive-cb' ),
'default' => false,
),
'extends' => 'Checkbox',
),
'title' => array(
'config' => array(
'name' => '',
'label' => __( 'Title', 'thrive-cb' ),
'default' => false,
),
'extends' => 'Checkbox',
),
'read_more_lnk' => array(
'config' => array(
'name' => '',
'label' => __( 'Read more link', 'thrive-cb' ),
'default' => false,
),
'extends' => 'Checkbox',
),
'text' => array(
'config' => array(
'name' => '',
'label' => __( 'Text', 'thrive-cb' ),
'default' => false,
),
'extends' => 'Checkbox',
),
'text_type' => array(
'config' => array(
'name' => __( 'Text type', 'thrive-cb' ),
'options' => [
[
'value' => 'summary',
'name' => 'Summary',
],
[
'value' => 'excerpt',
'name' => 'Excerpt',
],
[
'value' => 'fulltext',
'name' => 'Full text',
],
],
),
'extends' => 'Select',
),
'preview' => array(
'config' => array(
'sortable' => true,
'labels' => array(
'featured_image' => __( 'Featured Image', 'thrive-cb' ),
'title' => __( 'Title', 'thrive-cb' ),
'text' => __( 'Text', 'thrive-cb' ),
'read_more' => __( 'Read More', 'thrive-cb' ),
),
),
),
),
),
'postgrid-query' => array(
'config' => array(
'content' => array(
'config' => array(
'label' => __( 'Content', 'thrive-cb' ),
'tags' => false,
'data' => $this->get_all_post_types(),
'min_input_length' => 0,
'remote' => false,
'no_results' => __( 'No posts were found satisfying your Query', 'thrive-cb' ),
),
'extends' => 'SelectMultiple',
),
'order_by' => array(
'config' => array(
'name' => __( 'Order By', 'thrive-cb' ),
'options' => [
[
'value' => 'date',
'name' => 'Date',
],
[
'value' => 'title',
'name' => 'Title',
],
[
'value' => 'author',
'name' => 'Author',
],
[
'value' => 'comment_count',
'name' => 'Number of Comments',
],
[
'value' => 'rand',
'name' => 'Random',
],
],
),
'extends' => 'Select',
),
'order_mode' => array(
'config' => array(
'name' => __( 'Order', 'thrive-cb' ),
'options' => [
[
'value' => 'DESC',
'name' => 'Descending',
],
[
'value' => 'ASC',
'name' => 'Ascending',
],
],
),
'extends' => 'Select',
),
'number_of_posts' => array(
'config' => array(
'name' => __( 'Number of posts', 'thrive-cb' ),
'options' => $this->get_number_of_posts(),
),
'extends' => 'Select',
),
'recent_days' => array(
'config' => array(
'inline' => true,
'name' => __( 'Days', 'thrive-cb' ),
'default' => 0,
'min' => 0,
'max' => 999,
'maxlength' => 3,
),
'extends' => 'Input',
),
'start' => array(
'config' => array(
'name' => __( 'Start', 'thrive-cb' ),
'default' => 0,
'min' => 0,
'max' => 19,
'maxlength' => 2,
),
'extends' => 'Input',
),
),
),
'postgrid-filter' => array(
'config' => array(
'categories' => array(
'config' => array(
'label' => __( 'Categories', 'thrive-cb' ),
'tags' => false,
'min_input_length' => 2,
'remote' => true,
'custom_ajax' => 'post_grid_categories',
'no_results' => __( 'No categories were found satisfying your Query', 'thrive-cb' ),
),
'extends' => 'SelectMultiple',
),
'tags' => array(
'config' => array(
'label' => __( 'Tags', 'thrive-cb' ),
'tags' => false,
'custom_ajax' => 'post_grid_tags',
'remote' => true,
'min_input_length' => 2,
'no_results' => __( 'No tags were found satisfying your Query', 'thrive-cb' ),
),
'extends' => 'SelectMultiple',
),
'authors' => array(
'config' => array(
'label' => __( 'Authors', 'thrive-cb' ),
'tags' => false,
'custom_ajax' => 'post_grid_users',
'remote' => true,
'min_input_length' => 2,
'no_results' => __( 'No authors were found satisfying your Query', 'thrive-cb' ),
),
'extends' => 'SelectMultiple',
),
'custom_taxonomies' => array(
'config' => array(
'label' => __( 'Custom Taxonomies', 'thrive-cb' ),
'tags' => false,
'custom_ajax' => 'post_grid_custom_taxonomies',
'remote' => true,
'min_input_length' => 2,
'no_results' => __( 'No taxonomies were found satisfying your Query', 'thrive-cb' ),
),
'extends' => 'SelectMultiple',
),
'individual_post_pages' => array(
'config' => array(
'label' => __( 'Individual Posts / Pages', 'thrive-cb' ),
'tags' => false,
'custom_ajax' => 'post_grid_individual_post_pages',
'remote' => true,
'min_input_length' => 2,
'no_results' => __( 'No post / pages were found satisfying your Query', 'thrive-cb' ),
),
'extends' => 'SelectMultiple',
),
),
),
'background' => [
'config' => [
'css_suffix' => ' .tve_pg_container',
],
],
'borders' => [
'config' => [
'Borders' => [
'important' => true,
],
'css_suffix' => ' .tve_pg_container',
],
],
'typography' => [
'config' => [
'FontColor' => [
'css_suffix' => [ ' .tve-post-grid-text', ' .tve-post-grid-title' ],
],
'FontFace' => [
'css_suffix' => [ ' .tve-post-grid-text', ' .tve-post-grid-title' ],
],
],
'disabled_controls' => [
'TextStyle',
'TextTransform',
'.typography-button-toggle-controls', //Hides FontSize, LineHeight, LetterSpacing
'.typography-button-toggle-hr',
'.typography-text-transform-hr',
'.tve-advanced-controls',
],
],
'layout' => [
'disabled_controls' => [
'Width',
'Height',
'.tve-advanced-controls',
'Alignment',
],
],
);
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
}

View File

@@ -0,0 +1,104 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 7/3/2018
* Time: 2:25 PM
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Pricing_Table_Box_Container_Element
*/
class TCB_Pricing_Table_Box_Container_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Box Container', 'thrive-cb' );
}
/**
* Hide the element in the sidebar menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.tcb-pricing-table-box-container';
}
/**
* This is only a placeholder element
*
* @return bool
*/
public function is_placeholder() {
return true;
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Components that apply only to this
*
* @return array
*/
public function own_components() {
$pricing_table_box_container = [
'pricing_table_box_container' => [
'config' => [],
],
'layout' => [ 'disabled_controls' => [ 'Height', 'Width', 'Alignment', 'Overflow', 'ScrollStyle', 'Display', '.tve-advanced-controls', ] ],
];
return array_merge( $pricing_table_box_container, $this->group_component() );
}
/**
* Group Edit Properties
*
* @return array|bool
*/
public function has_group_editing() {
return array(
'select_values' => array(
array(
'value' => 'all_pricing_boxes',
'selector' => '.tcb-col > .thrv-content-box',
'name' => __( 'Grouped Pricing Boxes', 'thrive-cb' ),
'singular' => __( '-- Box %s', 'thrive-cb' ),
),
array(
'value' => 'all_pricing_boxes_buttons',
'selector' => '.tcb-col > .thrv-button, .tcb-col > .thrv-content-box > .tve-cb > .thrv-button',
'name' => __( 'Grouped Pricing Boxes Buttons', 'thrive-cb' ),
'singular' => __( '-- Button %s', 'thrive-cb' ),
),
),
);
}
}

View File

@@ -0,0 +1,123 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 6/27/2018
* Time: 1:57 PM
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Pricing_Table_Element
*
* Element Class
*/
class TCB_Pricing_Table_Element extends TCB_Cloud_Template_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Pricing Table', 'thrive-cb' );
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Element Icon
*
* @return string
*/
public function icon() {
return 'pricing_box';
}
/**
* When element is selected in editor this identifier
* establishes element _type
*
* @return string
* @see TVE.main.element_selected() TVE._type()
*
*/
public function identifier() {
return '.thrv-pricing-table';
}
/**
* This element is not a placeholder
*
* @return bool|true
*/
public function is_placeholder() {
return false;
}
/**
* Components that apply only to this
*
* @return array
*/
public function own_components() {
return array(
'pricing_table' => [
'config' => [
'PricingPalette' => [
'config' => [],
'extends' => 'PalettesV2',
],
'PriceInstances' => [
'config' => [
'sortable' => true,
],
],
],
],
'typography' => [ 'hidden' => true ],
'animation' => array(
'disabled_controls' => array(
'.btn-inline:not(.anim-animation)',
),
),
'shadow' => [
'config' => [
'disabled_controls' => [ 'text' ],
],
],
'layout' => [
'disabled_controls' => [
'Overflow',
'ScrollStyle',
],
],
);
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'pricing_table',
'link' => 'https://help.thrivethemes.com/en/articles/4425836-how-to-use-the-pricing-table-element',
],
];
}
}

View File

@@ -0,0 +1,352 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Progressbar_Element
*/
class TCB_Progressbar_Element extends TCB_Cloud_Template_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Progress Bar', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'progress, fill';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'progress_bar';
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.tve-progress-bar-wrapper';
}
public function is_placeholder() {
return false;
}
/**
* HTML layout of the element for when it's dragged in the canvas
*
* @return string
*/
public function html_placeholder( $title = null ) {
if ( empty( $title ) ) {
$title = $this->name();
}
return tcb_template( 'elements/element-placeholder', array(
'icon' => $this->icon(),
'class' => 'tcb-ct-placeholder',
'title' => $title,
'extra_attr' => 'data-ct="progressbar-0" data-tcb-elem-type="progressbar" data-specific-modal="progressbar"',
), true );
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$components = array(
'progressbar' => array(
'config' => array(
'ProgressPalette' => [
'config' => [],
'extends' => 'PalettesV2',
],
'Type' => array(
'config' => array(
'name' => __( 'Type', 'thrive-cb' ),
'buttons' => array(
array(
'icon' => '',
'text' => __( 'Simple', 'thrive-cb' ),
'value' => 'simple',
'default' => true,
),
array(
'icon' => '',
'text' => __( 'Nodes', 'thrive-cb' ),
'value' => 'nodes',
),
),
),
'extends' => 'ButtonGroup',
),
'NodesControl' => [
'config' => [
'sortable' => true,
'tpl' => 'controls/preview-list-inline-item',
],
],
'LabelPosition' => array(
'config' => array(
'name' => __( 'Progress label position', 'thrive-cb' ),
'options' => array(
array(
'value' => 'inside',
'class' => 'simple',
'name' => __( 'Inside bar', 'thrive-cb' ),
),
array(
'value' => 'above',
'class' => 'simple nodes',
'name' => __( 'Above bar', 'thrive-cb' ),
),
array(
'value' => 'below',
'class' => 'simple nodes',
'name' => __( 'Below bar', 'thrive-cb' ),
),
),
),
'extends' => 'Select',
),
'DisplayLabels' => array(
'config' => array(
'name' => __( 'Display progress labels', 'thrive-cb' ),
'options' => array(
array(
'value' => 'all',
'class' => 'nodes',
'name' => __( 'All', 'thrive-cb' ),
),
array(
'value' => 'current',
'class' => 'nodes',
'name' => __( 'Current', 'thrive-cb' ),
),
array(
'class' => 'nodes',
'value' => 'sides',
'name' => __( 'First & last', 'thrive-cb' ),
),
),
),
'extends' => 'Select',
),
'BarHeight' => array(
'config' => array(
'default' => '16',
'min' => '1',
'max' => '100',
'label' => __( 'Bar height', 'thrive-cb' ),
'um' => [ 'px' ],
),
'extends' => 'Slider',
),
'HasLabels' => array(
'config' => array(
'name' => '',
'label' => __( 'Show label', 'thrive-cb' ),
'default' => false,
),
'extends' => 'Switch',
),
'WithDualProgress' => array(
'config' => array(
'name' => '',
'label' => __( 'Enable dual progress', 'thrive-cb' ),
'default' => false,
),
'extends' => 'Switch',
),
'WithAnimation' => array(
'config' => array(
'name' => '',
'label' => __( 'Fill animation on view', 'thrive-cb' ),
'default' => false,
),
'extends' => 'Switch',
),
'HideEmpty' => array(
'config' => array(
'name' => '',
'label' => __( 'Current progress is 0%', 'thrive-cb' ),
'default' => false,
),
'extends' => 'Switch',
),
'HideFull' => array(
'config' => array(
'name' => '',
'label' => __( 'Current progress is 100%', 'thrive-cb' ),
'default' => false,
),
'extends' => 'Switch',
),
'AnimSpeed' => array(
'config' => array(
'name' => __( 'Speed', 'thrive-cb' ),
'buttons' => array(
array(
'icon' => '',
'text' => __( 'Slow', 'thrive-cb' ),
'value' => '5s',
),
array(
'icon' => '',
'text' => __( 'Default', 'thrive-cb' ),
'value' => '3s',
'default' => true,
),
array(
'icon' => '',
'text' => __( 'Fast', 'thrive-cb' ),
'value' => '1s',
),
),
),
'extends' => 'ButtonGroup',
),
'AnimStart' => array(
'config' => array(
'default' => '50',
'min' => '0',
'max' => '100',
'label' => __( 'Start at', 'thrive-cb' ),
'um' => [ '%' ],
),
'extends' => 'Slider',
),
),
),
'borders' => [
'config' => [
'Borders' => [],
'Corners' => [],
],
],
'typography' => [ 'hidden' => true ],
'animation' => [ 'hidden' => true ],
'layout' => [
'disabled_controls' => [
'Overflow',
'ScrollStyle',
'Height',
],
],
);
return array_merge(
$components,
$this->group_component()
);
}
public function has_group_editing() {
return array(
'select_values' => array(
array(
'value' => 'all_labels',
'selector' => ' .tve-progress-label-wrapper--nodes .tve-progress-label',
'name' => __( 'Progress labels', 'thrive-cb' ),
'singular' => __( '-- Progress label item %s', 'thrive-cb' ),
),
array(
'value' => 'all_labels_simple',
'selector' => ' .tve-progress-label:not(.tve-progress-label-wrapper--nodes *)',
'name' => __( 'Progress labels', 'thrive-cb' ),
'singular' => __( '-- Progress label item %s', 'thrive-cb' ),
'no_unlock' => true,
),
array(
'value' => 'all_icons',
'selector' => ' .tve-steps-wrapper .tve-progress-icon',
'name' => __( 'Progress icons', 'thrive-cb' ),
'singular' => __( '-- Progress icon item %s', 'thrive-cb' ),
),
array(
'value' => 'all_nodes',
'selector' => ' .tve-steps-wrapper .tve-progress-node',
'name' => __( 'Progress nodes', 'thrive-cb' ),
'singular' => __( '-- Progress node item %s', 'thrive-cb' ),
),
array(
'value' => 'all_line_background',
'selector' => ' .tve-progress-line--background',
'name' => __( 'Grouped lines background', 'thrive-cb' ),
'singular' => __( '-- Line background item %s', 'thrive-cb' ),
'no_unlock' => true,
),
array(
'value' => 'all_lines',
'selector' => ' .tve-progress-line--fill',
'name' => __( 'Grouped completed lines', 'thrive-cb' ),
'singular' => __( '-- Completed line item %s', 'thrive-cb' ),
'no_unlock' => true,
),
array(
'value' => 'all_wrapper_lines',
'selector' => ' .tve-line-wrapper',
'name' => __( 'Grouped wrapper lines', 'thrive-cb' ),
'singular' => __( '-- Wrapper line item %s', 'thrive-cb' ),
'no_unlock' => true,
),
array(
'value' => 'all_dual_lines',
'selector' => ' .tve-progress-line--fill-dual',
'name' => __( 'Grouped secondary completed lines', 'thrive-cb' ),
'singular' => __( '-- Secondary completed line item %s', 'thrive-cb' ),
'no_unlock' => true,
),
),
);
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'progress_bar',
'link' => 'https://help.thrivethemes.com/en/articles/4790886-how-to-use-the-progress-bar-element',
],
];
}
}

View File

@@ -0,0 +1,180 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Rating_Element
*/
class TCB_Rating_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Star Rating', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'review';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'rating';
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.thrv-rating';
}
/**
* The HTML is generated from js
*
* @return string
*/
protected function html() {
return '';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return array(
'rating' => array(
'config' => array(
'ratingValue' => [
'config' => [
'default_value' => 2.5,
'default_max' => 5,
'max_size' => 10,
],
],
'ExternalFields' => [
'config' => [
'key' => 'number',
'shortcode_element' => '.thrv-rating',
],
'extends' => 'CustomFields',
],
'style' => array(
'config' => array(
'label' => __( 'Style', 'thrive-cb' ),
),
),
'stylePicker' => array(
'config' => array(
'label' => __( 'Change style', 'thrive-cb' ),
),
),
'size' => array(
'config' => array(
'default' => '25',
'min' => '10',
'max' => '150',
'label' => __( 'Size', 'thrive-cb' ),
'um' => [ 'px' ],
),
),
'background' => array(
'config' => array(
'label' => __( 'Background', 'thrive-cb' ),
'options' => [ 'noBeforeInit' => false ],
),
),
'fill' => array(
'config' => array(
'label' => __( 'Fill', 'thrive-cb' ),
'options' => [ 'noBeforeInit' => false ],
),
),
'outline' => array(
'config' => array(
'label' => __( 'Outline', 'thrive-cb' ),
'options' => [ 'noBeforeInit' => false ],
),
),
),
'order' => 1,
),
'typography' => [
'hidden' => true,
],
'animation' => [
'hidden' => true,
],
'styles-templates' => [
'hidden' => true,
],
'layout' => [
'disabled_controls' => [
'Width',
'Height',
'Overflow',
'ScrollStyle',
],
],
'shadow' => [
'config' => [
'disabled_controls' => [ 'text' ],
],
],
);
}
/**
* @return bool
*/
public function has_hover_state() {
return true;
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'star_rating',
'link' => 'https://help.thrivethemes.com/en/articles/4425791-how-to-use-the-divider-and-star-rating-elements',
],
];
}
}

View File

@@ -0,0 +1,67 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 10/16/2018
* Time: 9:06 AM
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Login_Form_Element
*/
class TCB_Registration_Form_Element extends TCB_Lead_Generation_Element {
/**
* Name of the element
*
* @return string
*/
public function name() {
return esc_html__( 'Registration Form', 'thrive-cb' );
}
/**
* Hide the element in the sidebar menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.tcb-registration-form';
}
/**
* Components that apply only to this
*
* @return array
*/
public function own_components() {
$components = parent::own_components();
$components['registration_form'] = $components['lead_generation'];
unset( $components['lead_generation'] );
return $components;
}
/**
* Group Edit Properties
*
* @return array|bool
*/
public function has_group_editing() {
return false;
}
}

View File

@@ -0,0 +1,214 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 5/20/2017
* Time: 9:34 AM
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Responsivevideo_Element
*/
class TCB_Responsivevideo_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Video', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'media';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'responsive_video';
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.thrv_responsive_video,.tve_responsive_video_container';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return array(
'responsivevideo' => array(
'config' => array(
'style' => array(
'config' => array(
'label' => __( 'Video Style', 'thrive-cb' ),
'items' => array(
'rv_style_none' => __( 'No Style', 'thrive-cb' ),
'rv_style_grey_monitor' => __( 'Gray Monitor', 'thrive-cb' ),
'rv_style_black_monitor' => __( 'Black Monitor', 'thrive-cb' ),
'rv_style_black_tablet' => __( 'Black Tablet', 'thrive-cb' ),
'rv_style_white_tablet' => __( 'White Tablet', 'thrive-cb' ),
'rv_style_white_frame' => __( 'White Frame', 'thrive-cb' ),
'rv_style_gray_frame' => __( 'Gray Frame', 'thrive-cb' ),
'rv_style_dark_frame' => __( 'Dark Frame', 'thrive-cb' ),
'rv_style_light_frame' => __( 'Light Frame', 'thrive-cb' ),
'rv_style_lifted_style1' => __( 'Lifted Style 1', 'thrive-cb' ),
'rv_style_lifted_style2' => __( 'Lifted Style 2', 'thrive-cb' ),
'rv_style_lifted_style3' => __( 'Lifted Style 3', 'thrive-cb' ),
'rv_style_lifted_style4' => __( 'Lifted Style 4', 'thrive-cb' ),
'rv_style_lifted_style5' => __( 'Lifted Style 5', 'thrive-cb' ),
'rv_style_lifted_style6' => __( 'Lifted Style 6', 'thrive-cb' ),
),
'default' => 'rv_style_none',
),
),
'ExternalFields' => [
'config' => [
'key' => 'video',
'shortcode_element' => '.tcb-responsive-video',
],
'extends' => 'CustomFields',
],
'performance' => array(
'config' => array(
'name' => '',
'label' => __( 'Performance Optimizations', 'thrive-cb' ),
),
'extends' => 'Switch',
),
'adjustable_size' => array(
'config' => array(
'name' => '',
'label' => __( 'Adjustable player size', 'thrive-cb' ),
),
'extends' => 'Switch',
),
'custom_aspect' => array(
'config' => array(
'name' => '',
'label' => __( 'Custom aspect ratio & orientation', 'thrive-cb' ),
),
'extends' => 'Switch',
),
'custom_time' => array(
'config' => array(
'name' => '',
'label' => __( 'Custom start / end times', 'thrive-cb' ),
),
'extends' => 'Switch',
),
'anonymize' => array(
'config' => array(
'name' => '',
'label' => __( 'Anonymize viewing data', 'thrive-cb' ),
),
'extends' => 'Switch',
),
'responsive' => array(
'config' => array(
'name' => '',
'label' => __( 'Responsive', 'thrive-cb' ),
),
'extends' => 'Switch',
),
'autoplay' => array(
'config' => array(
'name' => '',
'label' => __( 'Autoplay', 'thrive-cb' ),
),
'extends' => 'Switch',
),
'preload' => array(
'config' => array(
'name' => '',
'label' => __( 'Preload', 'thrive-cb' ),
),
'extends' => 'Switch',
),
'loop' => array(
'config' => array(
'name' => '',
'label' => __( 'Loop', 'thrive-cb' ),
),
'extends' => 'Switch',
),
'muted' => array(
'config' => array(
'name' => '',
'label' => __( 'Muted', 'thrive-cb' ),
),
'extends' => 'Switch',
),
'lazy_load' => array(
'config' => array(
'name' => '',
'label' => __( 'Lazy load', 'thrive-cb' ),
),
'extends' => 'Switch',
),
),
),
'typography' => [ 'hidden' => true ],
'background' => [ 'hidden' => true ],
'shadow' => [
'config' => [
'disabled_controls' => [ 'inner', 'text' ],
],
],
'animation' => [ 'hidden' => true ],
'layout' => [
'config' => [
'Width' => [
'important' => true,
],
],
'disabled_controls' => [ 'Overflow', 'ScrollStyle' ],
],
);
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'video_element',
'link' => 'https://help.thrivethemes.com/en/articles/4425782-how-to-use-the-video-element',
],
];
}
}

View File

@@ -0,0 +1,116 @@
<?php
/**
* Created by PhpStorm.
* User: Ovidiu
* Date: 4/12/2017
* Time: 2:14 PM
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Reveal_Element
*/
class TCB_Reveal_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Content Reveal', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'container,box';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'reveal';
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.thrv_content_reveal'; //For backwards compatibility
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
return array(
'reveal' => array(
'config' => array(
'RedirectURL' => array(
'config' => array(
'label' => __( 'Redirect to URL', 'thrive-cb' ),
),
'extends' => 'LabelInput',
),
'Time' => array(
'config' => array(
'default' => 'auto',
'min' => '0',
'max' => '21600',
'label' => __( 'Reveal Content After', 'thrive-cb' ),
'css' => 'width',
),
'extends' => 'TimeSlider',
),
'AutoScroll' => array(
'config' => array(
'name' => '',
'label' => __( 'Autoscroll to content when revealed', 'thrive-cb' ),
'default' => false,
),
'extends' => 'Checkbox',
),
),
),
'animation' => [ 'hidden' => true ],
);
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'content_reveal',
'link' => 'https://help.thrivethemes.com/en/articles/4425778-how-to-use-the-content-reveal-element',
],
];
}
}

View File

@@ -0,0 +1,242 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Search_Form_Element
*/
class TCB_Search_Form_Element extends TCB_Cloud_Template_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Search', 'thrive-cb' );
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'search_elem';
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* WordPress element identifier
*
* @return string
*/
public function identifier() {
return '.thrv-search-form';
}
/**
* HTML layout of the element for when it's dragged in the canvas
*
* @return string
*/
public function html_placeholder( $title = null ) {
if ( empty( $title ) ) {
$title = $this->name();
}
return tcb_template( 'elements/element-placeholder', array(
'icon' => $this->icon(),
'class' => 'tcb-ct-placeholder',
'title' => $title,
'extra_attr' => 'data-ct="search_form-0" data-tcb-elem-type="search_form" data-specific-modal="search_form"',
), true );
}
/**
* @return bool
*/
public function is_placeholder() {
return false;
}
/**
* @return array
*/
public function own_components() {
return array(
'search_form' => array(
'config' => array(
'SearchPalette' => [
'config' => [],
'extends' => 'PalettesV2',
],
'PostTypes' => [
'config' => [
'sortable' => false,
'clickable' => false,
],
],
'ButtonLayout' => array(
'config' => array(
'buttons' => array(
array(
'text' => __( 'Text only', 'thrive-cb' ),
'value' => 'text',
),
array(
'text' => __( 'Icon only', 'thrive-cb' ),
'value' => 'icon',
),
array(
'text' => __( 'Icon & text', 'thrive-cb' ),
'value' => 'icon_text',
'default' => true,
),
),
),
'extends' => 'ButtonGroup',
),
'FormType' => array(
'config' => array(
'buttons' => array(
array(
'text' => __( 'With button', 'thrive-cb' ),
'value' => 'with',
'default' => true,
),
array(
'text' => __( 'Without button', 'thrive-cb' ),
'value' => 'without',
),
),
),
'extends' => 'ButtonGroup',
),
'InputPosition' => array(
'config' => array(
'buttons' => array(
array(
'text' => __( 'Left', 'thrive-cb' ),
'value' => 'left',
'default' => true,
),
array(
'text' => __( 'Right', 'thrive-cb' ),
'value' => 'right',
),
),
),
'extends' => 'ButtonGroup',
),
'DisplayOptions' => array(
'config' => array(
'name' => __( 'Display options', 'thrive-cb' ),
'groups' => array(
array(
'label' => 'On click',
'options' => array(
'expand' => __( 'Expand search', 'thrive-cb' ),
'overlay' => __( 'Show overlay', 'thrive-cb' ),
'tooltip-click' => __( 'Show tooltip', 'thrive-cb' ),
),
),
array(
'label' => 'On hover',
'options' => array(
'tooltip-hover' => __( 'Show tooltip', 'thrive-cb' ),
),
),
),
),
'extends' => 'Optgroup',
),
'ContentWidth' => array(
'config' => array(
'default' => '1024',
'min' => '100',
'label' => __( 'Search field width', 'thrive-cb' ),
'um' => [ 'px', '%' ],
'css' => 'max-width',
),
'extends' => 'Slider',
),
'Size' => array(
'config' => array(
'default' => '20',
'min' => '10',
'max' => '150',
'label' => __( 'Size', 'thrive-cb' ),
'um' => [ 'px', 'em' ],
'css' => 'font-size',
),
'css_prefix' => tcb_selection_root() . ' ',
'extends' => 'Slider',
),
'EditorPreview' => array(
'config' => array(
'name' => '',
'label' => __( 'View expanded search in the editor', 'thrive-cb' ),
'default' => false,
),
'extends' => 'Switch',
),
),
),
'shadow' => [
'config' => [
'disabled_controls' => [ 'text' ],
],
],
'typography' => [
'hidden' => true,
],
'animation' => [
'hidden' => true,
],
'styles-templates' => [
'hidden' => true,
],
'layout' => [
'disabled_controls' => [
'padding-left',
'padding-right',
],
],
'borders' => [
'disabled_controls' => [],
'config' => [
'Corners' => [
'overflow' => false,
],
],
],
);
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'search_element',
'link' => 'https://help.thrivethemes.com/en/articles/4425871-how-to-use-the-search-element',
],
];
}
}

View File

@@ -0,0 +1,135 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Search_Form_Input_Element
*/
class TCB_Search_Form_Input_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Search Input', 'thrive-cb' );
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.thrv-sf-input';
}
/**
* There is no need for HTML for this element since we need it only for control filter
*
* @return string
*/
protected function html() {
return '';
}
/**
* Hide Element From Sidebar Menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* Whether or not the this element can be edited while under :hover state
*
* @return bool
*/
public function has_hover_state() {
return true;
}
/**
* Component and control configuration
*
* @return array
*/
public function own_components() {
$prefix_config = tcb_selection_root() . ' ';
$controls_default_config = [
'css_suffix' => ' input',
'css_prefix' => $prefix_config,
];
$tag_default_config = [
'css_suffix' => ' input',
];
return array(
'search_form_input' => array(
'config' => array(
'InputPlaceholder' => array(
'config' => array(
'label' => __( 'Placeholder', 'thrive-cb' ),
),
'extends' => 'LabelInput',
),
),
),
'typography' => [
'config' => [
'FontSize' => $controls_default_config,
'FontColor' => $controls_default_config,
'TextAlign' => $controls_default_config,
'TextStyle' => $controls_default_config,
'TextTransform' => $controls_default_config,
'FontFace' => $controls_default_config,
'LineHeight' => $controls_default_config,
'LetterSpacing' => $controls_default_config,
],
],
'layout' => [
'disabled_controls' => [
'Width',
'Height',
'Alignment',
'Display',
'margin',
'.tve-advanced-controls',
],
'config' => [
'MarginAndPadding' => $tag_default_config,
],
],
'borders' => array(
'config' => array(
'Borders' => array_merge( [ 'css_prefix' => $prefix_config ], $tag_default_config ),
'Corners' => array_merge( [ 'css_prefix' => $prefix_config ], $tag_default_config ),
),
),
'animation' => [
'hidden' => true,
],
'background' => [
'config' => [
'ColorPicker' => $tag_default_config,
'PreviewList' => $tag_default_config,
],
],
'shadow' => [
'config' => $tag_default_config,
],
'responsive' => [
'hidden' => true,
],
'styles-templates' => [
'hidden' => true,
],
);
}
}

View File

@@ -0,0 +1,120 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Search_Form_Submit_Element
*/
class TCB_Search_Form_Submit_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Search Submit', 'thrive-cb' );
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.thrv-sf-submit';
}
/**
* There is no need for HTML for this element since we need it only for control filter
*
* @return string
*/
protected function html() {
return '';
}
/**
* Hide Element From Sidebar Menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* Whether or not the this element can be edited while under :hover state
*
* @return bool
*/
public function has_hover_state() {
return true;
}
/**
* Component and control configuration
*
* @return array
*/
public function own_components() {
$prefix = tcb_selection_root( false ) . ' ';
$controls_default_config = [
'css_suffix' => ' button',
'css_prefix' => $prefix,
];
return [
'typography' => [
'config' => [
'FontSize' => $controls_default_config,
'FontColor' => $controls_default_config,
'TextAlign' => $controls_default_config,
'TextStyle' => $controls_default_config,
'TextTransform' => $controls_default_config,
'FontFace' => $controls_default_config,
'LineHeight' => $controls_default_config,
'LetterSpacing' => $controls_default_config,
],
],
'layout' => [
'disabled_controls' => [
'Width',
'Height',
'Alignment',
'Display',
'margin',
'.tve-advanced-controls',
],
'config' => [
'MarginAndPadding' => $controls_default_config,
],
],
'borders' => [
'config' => [
'Borders' => $controls_default_config,
'Corners' => $controls_default_config,
],
],
'animation' => [
'hidden' => true,
],
'responsive' => [
'hidden' => true,
],
'background' => [
'config' => [
'ColorPicker' => $controls_default_config,
'PreviewList' => $controls_default_config,
],
],
'shadow' => [
'config' => $controls_default_config,
],
'styles-templates' => [
'hidden' => true,
],
];
}
}

View File

@@ -0,0 +1,91 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class TCB_Search_Overlay_Element extends TCB_ContentBox_Element {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Search Overlay', 'thrive-cb' );
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.tve-sf-overlay-container';
}
public function own_components() {
$prefix_config = tcb_selection_root() . ' ';
$bg_selector = '>.tve-content-box-background';
$components = parent::own_components();
unset( $components['contentbox'] );
unset( $components['shared-styles'] );
$components['layout'] = [
'disabled_controls' => [
'Display',
'Float',
'Position',
'Width',
'Alignment',
'.tve-advanced-controls',
],
'config' => [
'Height' => [
'important' => true,
],
],
];
$components['background'] = [
'config' => [
'ColorPicker' => [ 'css_prefix' => $prefix_config ],
'PreviewList' => [ 'css_prefix' => $prefix_config ],
'to' => $bg_selector,
],
];
$components['borders'] = [
'config' => [
'Borders' => [
'important' => true,
'to' => $bg_selector,
],
'Corners' => [
'important' => true,
'to' => $bg_selector,
],
],
];
$components['typography'] = [ 'hidden' => true ];
$components['scroll'] = [ 'hidden' => true ];
$components['responsive'] = [ 'hidden' => true ];
$components['animation'] = [ 'hidden' => true ];
$components['decoration'] = [ 'hidden' => true ];
$components['styles-templates'] = [ 'hidden' => true ];
return $components;
}
public function hide() {
return true;
}
}

View File

@@ -0,0 +1,232 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Section_Element
*/
class TCB_Section_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Background Section', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'container,box,content';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'section';
}
/**
* Section element identifier
*
* @return string
*/
public function identifier() {
return '.thrv_page_section, .thrv-page-section';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$section = array(
'section' => array(
'config' => array(
'SectionHeight' => array(
'config' => array(
'default' => '1024',
'min' => '1',
'max' => '1000',
'label' => __( 'Section Minimum Height', 'thrive-cb' ),
'um' => [ 'px', 'vh' ],
'css' => 'min-height',
),
'to' => '.tve-page-section-in',
'extends' => 'Slider',
),
'ContentWidth' => array(
'config' => array(
'default' => '1024',
'min' => '100',
'max' => '2000',
'label' => __( 'Content Maximum Width', 'thrive-cb' ),
'um' => [ 'px', '%' ],
'css' => 'max-width',
),
'to' => '.tve-page-section-in',
'extends' => 'Slider',
),
'FullHeight' => array(
'config' => array(
'name' => '',
'label' => __( 'Match height to screen', 'thrive-cb' ),
'default' => true, //todo: this is useless
),
'to' => '.tve-page-section-in',
'extends' => 'Switch',
),
'ContentFullWidth' => array(
'config' => array(
'name' => '',
'label' => __( 'Content covers entire screen width', 'thrive-cb' ),
'default' => true, //todo: this is useless
),
'to' => '.tve-page-section-in',
'extends' => 'Switch',
),
'SectionFullWidth' => array(
'config' => array(
'name' => '',
'label' => __( 'Stretch to fit screen width', 'thrive-cb' ),
'default' => true, //todo: this is useless
),
'extends' => 'Switch',
),
'VerticalPosition' => array(
'config' => array(
'name' => __( 'Vertical Position', 'thrive-cb' ),
'buttons' => [
[
'icon' => 'top',
'default' => true,
'value' => '',
],
[
'icon' => 'vertical',
'value' => 'center',
],
[
'icon' => 'bot',
'value' => 'flex-end',
],
],
'info' => true,
),
'extends' => 'ButtonGroup',
),
),
),
'background' => [
'config' => [
'to' => '.tve-page-section-out',
],
'disabled_controls' => [],
],
'shadow' => [
'config' => [
'to' => '.tve-page-section-out',
],
],
'layout' => [
'disabled_controls' => [ 'Width', 'Alignment', 'Float', 'Position', 'PositionFrom' ],
'config' => [
'Height' => [
'to' => '.tve-page-section-in',
'important' => true,
],
],
],
'animation' => [
'hidden' => true,
],
'borders' => [
'config' => [
'Borders' => [],
'Corners' => [],
],
],
'typography' => [
'disabled_controls' => [],
'config' => [
'to' => '.tve-page-section-in',
'ParagraphStyle' => [ 'hidden' => false ],
],
],
'decoration' => [
'config' => [
'to' => '.tve-page-section-out',
],
],
'scroll' => [
'hidden' => false,
],
'conditional-display' => [
'hidden' => false,
],
);
if ( tcb_post()->is_landing_page() ) {
/**
* For Landing Pages we add this additional control
*/
$section['section']['config']['InheritFromLandingPage'] = array(
'config' => array(
'name' => '',
'label' => __( 'Inherit Width from Landing Page', 'thrive-cb' ),
),
'extends' => 'Switch',
);
}
return array_merge( $section, $this->shared_styles_component() );
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_basic_label();
}
/**
* @return bool
*/
public function has_hover_state() {
return true;
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'background_section',
'link' => 'https://help.thrivethemes.com/en/articles/4425770-how-to-use-the-background-section-element',
],
];
}
}

View File

@@ -0,0 +1,284 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Social_Element
*/
class TCB_Social_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Social Share', 'thrive-cb' );
}
/**
* Get element alternate
*
* @return string
*/
public function alternate() {
return 'social';
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'social_share';
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.thrv_social.thrv_social_custom';
}
/**
* The HTML is generated from js
*
* @return string
*/
protected function html() {
return '';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$components = array(
'social' => array(
'config' => array(
'CustomBranding' => array(
'config' => array(
'name' => '',
'label' => __( 'Custom branding', 'thrive-cb' ),
'default' => true,
),
'extends' => 'Switch',
),
'CssVarChanger' => array(
'config' => array(
'label' => __( 'Colors', 'thrive-cb' ),
'variable' => '--tcb-social-share-master-color',
),
'extends' => 'CssVariablesChanger',
),
'SocialSharePalettes' => [
'config' => [],
'extends' => 'Palettes',
'important' => true,
],
'style' => array(
'config' => array(
'label' => __( 'Style', 'thrive-cb' ),
),
),
'stylePicker' => array(
'config' => array(
'label' => __( 'Change style', 'thrive-cb' ),
'items' => [
'tve_style_6' => 'Style 1',
'tve_style_7' => 'Style 2',
'tve_style_8' => 'Style 3',
'tve_style_9' => 'Style 4',
'tve_style_10' => 'Style 5',
'tve_style_11' => 'Style 6',
'tve_style_12' => 'Style 7',
'tve_style_13' => 'Style 8',
'tve_style_14' => 'Style 9',
'tve_style_15' => 'Style 10',
'tve_style_16' => 'Style 11',
'tve_style_17' => 'Style 12',
'tve_style_18' => 'Style 13',
'tve_style_1' => 'Style 14',
'tve_style_2' => 'Style 15',
'tve_style_3' => 'Style 16',
'tve_style_4' => 'Style 17',
'tve_style_5' => 'Style 18',
],
),
),
'type' => array(
'config' => array(
'full-width' => true,
'name' => __( 'Type', 'thrive-cb' ),
'buttons' => array(
array( 'value' => 'tve_social_ib', 'text' => __( 'Icon only', 'thrive-cb' ) ),
array( 'value' => 'tve_social_itb', 'text' => __( 'Icon + text', 'thrive-cb' ), 'default' => true ),
array( 'value' => 'tve_social_cb', 'text' => __( 'Counter', 'thrive-cb' ) ),
),
),
),
'orientation' => array(
'config' => array(
'name' => __( 'Orientation', 'thrive-cb' ),
'buttons' => array(
array( 'value' => 'h', 'text' => __( 'Horizontal', 'thrive-cb' ), 'default' => true ),
array( 'value' => 'v', 'text' => __( 'Vertical', 'thrive-cb' ) ),
),
),
),
'size' => array(
'config' => array(
'default' => '25',
'min' => '1',
'max' => '60',
'label' => __( 'Size and Align', 'thrive-cb' ),
'um' => [ 'px' ],
),
),
'Align' => array(
'config' => array(
'buttons' => array(
array(
'icon' => 'a_left',
'value' => 'left',
'tooltip' => __( 'Align Left', 'thrive-cb' ),
),
array(
'icon' => 'a_center',
'value' => 'center',
'default' => true,
'tooltip' => __( 'Align Center', 'thrive-cb' ),
),
array(
'icon' => 'a_right',
'value' => 'right',
'tooltip' => __( 'Align Right', 'thrive-cb' ),
),
array(
'text' => 'FULL',
'value' => 'full',
'tooltip' => __( 'Full Width', 'thrive-cb' ),
),
),
),
),
'CommonButtonWidth' => array(
'config' => array(
'name' => '',
'label' => __( 'Common Button Width', 'thrive-cb' ),
'default' => true,
),
'extends' => 'Switch',
),
'preview' => [
'config' => [
'sortable' => true,
'settings_icon' => 'pen-regular',
'tpl' => 'controls/preview-check-list-item',
],
],
'has_custom_url' => array(
'config' => array(
'label' => __( 'Custom share URL' ),
),
),
'custom_url' => array(
'config' => array(
'placeholder' => __( 'http://', 'thrive-cb' ),
),
),
'counts' => [
'config' => [
'min' => 0,
'max' => 2000,
'default' => 0,
],
],
'total_share' => array(
'config' => array(
'label' => __( 'Show share count', 'thrive-cb' ),
),
),
),
'order' => 1,
),
'shadow' => [ 'hidden' => true ],
'typography' => [
'hidden' => true,
],
'animation' => [
'hidden' => true,
],
'layout' => [
'disabled_controls' => [
'Width',
'Height',
'Overflow',
'ScrollStyle',
],
],
);
return array_merge( $components, $this->group_component() );
}
/**
* Element category that will be displayed in the sidebar
*
* @return string
*/
public function category() {
return static::get_thrive_advanced_label();
}
/**
* Group Edit Properties
*
* @return array|bool
*/
public function has_group_editing() {
return array(
'select_values' => array(
array(
'value' => 'social_options',
'selector' => '.tve_s_item',
'name' => __( 'Grouped Social Labels', 'thrive-cb' ),
'singular' => __( '-- Option Label %s', 'thrive-cb' ),
),
array(
'value' => 'social_buttons',
'selector' => '.tve_share_item .tve_s_icon',
'name' => __( 'Grouped Social Icons', 'thrive-cb' ),
'singular' => __( '-- Option Icon %s', 'thrive-cb' ),
),
),
);
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'social_share',
'link' => 'https://help.thrivethemes.com/en/articles/4425796-how-to-use-the-social-share-element',
],
];
}
}

View File

@@ -0,0 +1,170 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Social_Follow_Element
*/
class TCB_Social_Follow_Element extends TCB_Social_Element {
/**
* Element name
*
* @return string
*/
public function name() {
return __( 'Social Follow', 'thrive-cb' );
}
/**
* Return icon class needed for display in menu
*
* @return string
*/
public function icon() {
return 'business-social-links';
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.thrive_author_links,.thrv_social_follow';
}
/**
* The HTML is generated from js
*
* @return string
*/
protected function html() {
return '';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$components = parent::own_components();
$components['styles-templates'] = [ 'hidden' => true ];
$components['social_follow'] = $components['social'];
$components['social_follow']['disabled_controls'] = [ 'type', 'has_custom_url', 'custom_url', 'counts', 'total_share', 'CssVarChanger', 'CommonButtonWidth' ];
$styles = [];
foreach ( range( 1, 8 ) as $i ) {
$styles[ 'tve_links_style_' . $i ] = 'Style ' . $i;
}
$components['social_follow']['config']['size']['config']['label'] = __( 'Size and Alignment', 'thrive-cb' );
$components['social_follow']['config']['Align'] = array(
'config' => array(
'buttons' => array(
array(
'icon' => 'a_left',
'value' => 'left',
'default' => true,
'tooltip' => __( 'Align Left', 'thrive-cb' ),
),
array(
'icon' => 'a_center',
'value' => 'center',
'tooltip' => __( 'Align Center', 'thrive-cb' ),
),
array(
'icon' => 'a_right',
'value' => 'right',
'tooltip' => __( 'Align Right', 'thrive-cb' ),
),
array(
'text' => 'FULL',
'value' => 'full',
'tooltip' => __( 'Full Width', 'thrive-cb' ),
),
),
),
);
$components['social_follow']['config']['stylePicker'] = array(
'config' => array(
'label' => __( 'Change style', 'thrive-cb' ),
'match' => 'tve_links_style_',
'items' => $styles,
),
);
$components['social_follow']['config']['preview'] = [
'config' => [
'sortable' => true,
'settings_icon' => 'pen-regular',
'tpl' => 'controls/preview-check-list-item',
],
];
$components['social_follow']['config']['CustomBranding'] = array(
'config' => array(
'name' => '',
'label' => __( 'Custom branding', 'thrive-cb' ),
'default' => true,
),
'extends' => 'Switch',
);
$components['social_follow']['config']['SocialFollowPalettes'] = [
'config' => [],
'extends' => 'Palettes',
'important' => true,
];
$components['scroll'] = [
'hidden' => false,
'disabled_controls' => [ '[data-value="parallax"]' ],
];
$components['layout']['disabled_controls'] = [ 'Width', 'Height', 'Display', 'Overflow', 'ScrollStyle' ];
unset( $components['social'] );
return array_merge( $components, $this->group_component() );
}
/**
* Group Edit Properties
*
* @return array|bool
*/
public function has_group_editing() {
return array(
'select_values' => array(
array(
'value' => 'social_options',
'selector' => '.tve_s_item',
'name' => __( 'Grouped Social Buttons', 'thrive-cb' ),
'singular' => __( '-- Option Label %s', 'thrive-cb' ),
),
),
);
}
/**
* Element info
*
* @return string|string[][]
*/
public function info() {
return [
'instructions' => [
'type' => 'help',
'url' => 'social_follow',
'link' => 'https://help.thrivethemes.com/en/articles/4472330-how-to-use-the-social-follow-element',
],
];
}
}
return new TCB_Social_Follow_Element( 'thrive_social_follow' );

View File

@@ -0,0 +1,109 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Social_Follow_Item_Element
*/
class TCB_Social_Follow_Item_Element extends TCB_Icon_Element {
/**
* Element name
*
* @return string
*/
public function name() {
return __( 'Social Share Button', 'thrive-cb' );
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.tcb-social-follow .tve_s_item:not(.tve_share_item)';
}
/**
* @return bool
*/
public function hide() {
return true;
}
/**
* The HTML is generated from js
*
* @return string
*/
protected function html() {
return '';
}
/**
* @return bool
*/
public function has_hover_state() {
return true;
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$components = parent::own_components();
$components['social_follow_item'] = array(
'config' => array(
'NetworkColor' => array(
'config' => array(
'label' => __( 'Network Color', 'thrive-cb' ),
),
'extends' => 'ColorPicker',
),
'ColorPicker' => array(
'css_prefix' => tcb_selection_root() . ' ',
'css_suffix' => [ ' svg.tcb-icon', ' .tve_s_icon .tve_sc_icon' ],
'config' => array(
'label' => __( 'Color', 'thrive-cb' ),
'options' => [ 'noBeforeInit' => false ],
),
),
'Slider' => array(
'css_suffix' => '.tve_s_item .tve_s_icon ',
'config' => array(
'default' => '18',
'min' => '1',
'max' => '60',
'label' => __( 'Size', 'thrive-cb' ),
'um' => [ 'px' ],
'css' => 'fontSize',
),
),
),
);
$components['scroll'] = [ 'hidden' => true ];
$components['borders'] = [
'config' => [
'Borders' => [ 'css_prefix' => '.tve_social_items .tve_s_item', 'important' => 'true' ],
'Corners' => [ 'css_prefix' => '.tve_social_items .tve_s_item', 'important' => 'true' ],
],
];
$components['background']['config'] = array(
'ColorPicker' => array( 'css_prefix' => tcb_selection_root() . ' .thrv_social_follow .tve_social_items ' ),
'PreviewList' => array( 'css_prefix' => tcb_selection_root() . ' .thrv_social_follow .tve_social_items ' ),
);
$components['layout']['disabled_controls'] = [ 'Width', 'Height', 'Display', 'Overflow', 'ScrollStyle', 'Alignment' ];
unset( $components['icon'] );
return $components;
}
}

View File

@@ -0,0 +1,127 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Social_Follow_Item_Element
*/
class TCB_Social_Share_Button_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Social Share Button', 'thrive-cb' );
}
/**
* Default element identifier
*
* @return string
*/
public function identifier() {
return '.thrv_social .tve_s_item';
}
/**
* Either to display or not the element in the sidebar menu
*
* @return bool
*/
public function hide() {
return true;
}
/**
* @return bool
*/
public function has_hover_state() {
return true;
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$typography_defaults = [
'css_prefix' => '',
'css_suffix' => '',
'important' => true,
];
$color_typography = [
'css_suffix' => ' a.tve_s_link .tve_s_text',
'important' => true,
];
return array(
'social_share_button' => array(
'config' => array(
'NetworkColor' => array(
'config' => array(
'label' => __( 'Network Color', 'thrive-cb' ),
),
'extends' => 'ColorPicker',
),
),
),
'typography' => [
'css_prefix' => '.tve_s_text ',
'config' => [
'FontSize' => $typography_defaults,
'FontColor' => $color_typography,
'LineHeight' => $typography_defaults,
'FontFace' => $typography_defaults,
'TextStyle' => $typography_defaults,
'LetterSpacing' => $typography_defaults,
'TextTransform' => $typography_defaults,
'TextAlign' => $typography_defaults,
],
],
'styles-templates' => [ 'hidden' => true ],
'shadow' => [
'config' => [
'css_suffix' => '',
'important' => true,
],
],
'background' => array(
'config' => array(
'ColorPicker' => array( 'css_prefix' => tcb_selection_root() . ' .tve_social_items ' ),
'PreviewList' => array( 'css_prefix' => tcb_selection_root() . ' .tve_social_items ' ),
),
),
'borders' => [
'config' => [
'Borders' => [
'important' => true,
],
'Corners' => [
'important' => true,
],
],
],
'borders' => [
'config' => [
'Borders' => [
'important' => true,
],
'Corners' => [
'important' => true,
],
],
],
'animation' => [
'disabled_controls' => [ '.btn-inline.anim-link', '.btn-inline.anim-popup' ],
],
'layout' => [
'disabled_controls' => [ 'Alignment', 'Display' ],
],
);
}
}

View File

@@ -0,0 +1,66 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Social_Follow_Item_Element
*/
class TCB_Social_Share_Count_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Social Share Count', 'thrive-cb' );
}
/**
* Default element identifier
*
* @return string
*/
public function identifier() {
return '.tve_s_cnt';
}
/**
* Either to display or not the element in the sidebar menu
*
* @return bool
*/
public function hide() {
return true;
}
public function own_components() {
$components = parent::own_components();
$typography_defaults = [
'css_prefix' => '',
'css_suffix' => '',
'important' => true,
];
$components['typography'] = [
'disabled_controls' => [ 'TextTransform', '.tve-advanced-controls', ],
'config' => [
'FontSize' => $typography_defaults,
'FontColor' => $typography_defaults,
'LineHeight' => $typography_defaults,
'FontFace' => $typography_defaults,
'TextStyle' => $typography_defaults,
'LetterSpacing' => $typography_defaults,
],
];
$components['layout']['disabled_controls'] = [
'Alignment',
'Display',
];
return $components;
}
}

View File

@@ -0,0 +1,66 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Social_Follow_Item_Element
*/
class TCB_Social_Share_Count_Label_Element extends TCB_Element_Abstract {
/**
* Name of the element
*
* @return string
*/
public function name() {
return __( 'Social Share Count Label', 'thrive-cb' );
}
/**
* Default element identifier
*
* @return string
*/
public function identifier() {
return '.tve_s_cnt_label';
}
/**
* Either to display or not the element in the sidebar menu
*
* @return bool
*/
public function hide() {
return true;
}
public function own_components() {
$components = parent::own_components();
$typography_defaults = [
'css_prefix' => '',
'css_suffix' => '',
'important' => true,
];
$components['typography'] = [
'disabled_controls' => [ '.tve-advanced-controls', ],
'config' => [
'FontSize' => $typography_defaults,
'FontColor' => $typography_defaults,
'LineHeight' => $typography_defaults,
'FontFace' => $typography_defaults,
'TextStyle' => $typography_defaults,
'LetterSpacing' => $typography_defaults,
'TextTransform' => $typography_defaults,
],
];
$components['layout']['disabled_controls'] = [
'Alignment',
'Display',
];
return $components;
}
}

View File

@@ -0,0 +1,67 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class TCB_Social_Follow_Item_Element
*/
class TCB_Social_Share_Icon_Element extends TCB_Social_Follow_Item_Element {
/**
* Element name
*
* @return string
*/
public function name() {
return __( 'Social Share Icon', 'thrive-cb' );
}
/**
* Element identifier
*
* @return string
*/
public function identifier() {
return '.tve_share_item .tve_s_icon';
}
/**
* Component and control config
*
* @return array
*/
public function own_components() {
$components = parent::own_components();
$components['animation']['disabled_controls'] = [ '.btn-inline.anim-link', '.btn-inline.anim-popup' ];
$components['social_follow_item']['config']['Slider']['css_suffix'] = '.tve_s_item .tve_s_icon ';
$components['social_follow_item']['disabled_controls'] = [ 'NetworkColor' ];
$components['background']['config'] = array(
'ColorPicker' => array( 'css_prefix' => tcb_selection_root() . ' a ' ),
'PreviewList' => array( 'css_prefix' => tcb_selection_root() . ' a ' ),
);
$components['borders'] = [
'config' => [
'Borders' => [ 'css_prefix' => '', 'important' => 'true' ],
'Corners' => [ 'css_prefix' => '', 'important' => 'true' ],
],
];
$components['shadow'] = [
'config' => [
'css_prefix' => '',
'css_suffix' => '',
'important' => 'true',
'disabled_controls' => [ 'text' ],
],
];
return $components;
}
}

Some files were not shown because too many files have changed in this diff Show More