| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Modules\FloatingButtons\Base; |
| 4 |
|
| 5 |
use Elementor\Controls_Manager; |
| 6 |
use Elementor\Core\Base\Providers\Social_Network_Provider; |
| 7 |
use Elementor\Core\Base\Traits\Shared_Widget_Controls_Trait; |
| 8 |
use Elementor\Group_Control_Box_Shadow; |
| 9 |
use Elementor\Group_Control_Typography; |
| 10 |
use Elementor\Modules\FloatingButtons\Classes\Render\Contact_Buttons_Core_Render; |
| 11 |
use Elementor\Modules\FloatingButtons\Documents\Floating_Buttons; |
| 12 |
use Elementor\Plugin; |
| 13 |
use Elementor\Repeater; |
| 14 |
use Elementor\Utils; |
| 15 |
use Elementor\Widget_Base; |
| 16 |
|
| 17 |
abstract class Widget_Contact_Button_Base extends Widget_Base { |
| 18 |
|
| 19 |
use Shared_Widget_Controls_Trait; |
| 20 |
|
| 21 |
const TAB_ADVANCED = 'advanced-tab-floating-buttons'; |
| 22 |
|
| 23 |
public function show_in_panel(): bool { |
| 24 |
return false; |
| 25 |
} |
| 26 |
|
| 27 |
public function get_group_name(): string { |
| 28 |
return 'floating-buttons'; |
| 29 |
} |
| 30 |
|
| 31 |
public function get_style_depends(): array { |
| 32 |
$widget_name = $this->get_name(); |
| 33 |
|
| 34 |
$style_depends = Plugin::$instance->experiments->is_feature_active( 'e_font_icon_svg' ) |
| 35 |
? parent::get_style_depends() |
| 36 |
: [ 'elementor-icons-fa-solid', 'elementor-icons-fa-brands', 'elementor-icons-fa-regular' ]; |
| 37 |
|
| 38 |
$style_depends[] = 'widget-contact-buttons-base'; |
| 39 |
|
| 40 |
if ( 'contact-buttons' !== $widget_name ) { |
| 41 |
$style_depends[] = "widget-{$widget_name}"; |
| 42 |
} |
| 43 |
|
| 44 |
return $style_depends; |
| 45 |
} |
| 46 |
|
| 47 |
public function hide_on_search(): bool { |
| 48 |
return true; |
| 49 |
} |
| 50 |
|
| 51 |
protected function get_initial_config(): array { |
| 52 |
return array_merge( parent::get_initial_config(), [ |
| 53 |
'commonMerged' => true, |
| 54 |
] ); |
| 55 |
} |
| 56 |
|
| 57 |
public static function get_configuration() { |
| 58 |
return [ |
| 59 |
'content' => [ |
| 60 |
'chat_button_section' => [ |
| 61 |
'section_name' => esc_html__( 'Chat Button', 'elementor' ), |
| 62 |
'has_platform' => true, |
| 63 |
'has_icon' => false, |
| 64 |
'icon_default' => [ |
| 65 |
'value' => 'far fa-comment-dots', |
| 66 |
'library' => 'fa-regular', |
| 67 |
], |
| 68 |
'icons_recommended' => [ |
| 69 |
'fa-regular' => [ |
| 70 |
'comment', |
| 71 |
'comment-dots', |
| 72 |
'comment-alt', |
| 73 |
], |
| 74 |
'fa-solid' => [ |
| 75 |
'ellipsis-v', |
| 76 |
], |
| 77 |
], |
| 78 |
'has_notification_dot' => true, |
| 79 |
'has_notification_dot_default_enabled' => true, |
| 80 |
'has_active_tab' => false, |
| 81 |
'has_display_text' => false, |
| 82 |
'display_text_label' => esc_html__( 'Call now', 'elementor' ), |
| 83 |
'has_display_text_select' => true, |
| 84 |
'platform' => [ |
| 85 |
'group' => [ |
| 86 |
Social_Network_Provider::EMAIL, |
| 87 |
Social_Network_Provider::SMS, |
| 88 |
Social_Network_Provider::WHATSAPP, |
| 89 |
Social_Network_Provider::SKYPE, |
| 90 |
Social_Network_Provider::MESSENGER, |
| 91 |
Social_Network_Provider::VIBER, |
| 92 |
], |
| 93 |
'default' => Social_Network_Provider::WHATSAPP, |
| 94 |
], |
| 95 |
'chat_aria_label' => Floating_Buttons::get_title(), |
| 96 |
'defaults' => [ |
| 97 |
'mail' => null, |
| 98 |
'mail_subject' => null, |
| 99 |
'mail_body' => null, |
| 100 |
'number' => null, |
| 101 |
'username' => null, |
| 102 |
'location' => [ |
| 103 |
'is_external' => true, |
| 104 |
], |
| 105 |
'url' => [ |
| 106 |
'is_external' => true, |
| 107 |
], |
| 108 |
], |
| 109 |
'has_accessible_name' => true, |
| 110 |
], |
| 111 |
'top_bar_section' => [ |
| 112 |
'section_name' => esc_html__( 'Top Bar', 'elementor' ), |
| 113 |
'has_image' => true, |
| 114 |
'has_active_dot' => true, |
| 115 |
'has_subtitle' => true, |
| 116 |
'title' => [ |
| 117 |
'label' => esc_html__( 'Name', 'elementor' ), |
| 118 |
'default' => esc_html__( 'Rob Jones', 'elementor' ), |
| 119 |
'placeholder' => esc_html__( 'Type your name here', 'elementor' ), |
| 120 |
'dynamic' => false, |
| 121 |
'ai' => false, |
| 122 |
'label_block' => false, |
| 123 |
], |
| 124 |
'subtitle' => [ |
| 125 |
'label' => esc_html__( 'Title', 'elementor' ), |
| 126 |
'default' => esc_html__( 'Store Manager', 'elementor' ), |
| 127 |
'placeholder' => esc_html__( 'Type your title here', 'elementor' ), |
| 128 |
'dynamic' => false, |
| 129 |
'ai' => false, |
| 130 |
'label_block' => false, |
| 131 |
], |
| 132 |
], |
| 133 |
'message_bubble_section' => [ |
| 134 |
'has_typing_animation' => true, |
| 135 |
], |
| 136 |
'contact_section' => [ |
| 137 |
'section_name' => esc_html__( 'Contact Buttons', 'elementor' ), |
| 138 |
'has_cta_text' => true, |
| 139 |
'repeater' => [ |
| 140 |
'has_tooltip' => false, |
| 141 |
'tooltip_label' => esc_html__( 'Text', 'elementor' ), |
| 142 |
'tooltip_default' => esc_html__( 'Tooltip', 'elementor' ), |
| 143 |
'tooltip_placeholder' => esc_html__( 'Enter icon text', 'elementor' ), |
| 144 |
'has_title' => false, |
| 145 |
'has_description' => false, |
| 146 |
], |
| 147 |
'platform' => [ |
| 148 |
'group-1' => [ |
| 149 |
Social_Network_Provider::EMAIL, |
| 150 |
Social_Network_Provider::SMS, |
| 151 |
Social_Network_Provider::WHATSAPP, |
| 152 |
Social_Network_Provider::SKYPE, |
| 153 |
Social_Network_Provider::MESSENGER, |
| 154 |
Social_Network_Provider::VIBER, |
| 155 |
], |
| 156 |
'limit' => 5, |
| 157 |
'min_items' => 0, |
| 158 |
], |
| 159 |
'default' => [ |
| 160 |
[ |
| 161 |
'contact_icon_platform' => Social_Network_Provider::WHATSAPP, |
| 162 |
], |
| 163 |
[ |
| 164 |
'contact_icon_platform' => Social_Network_Provider::EMAIL, |
| 165 |
], |
| 166 |
[ |
| 167 |
'contact_icon_platform' => Social_Network_Provider::SMS, |
| 168 |
], |
| 169 |
[ |
| 170 |
'contact_icon_platform' => Social_Network_Provider::VIBER, |
| 171 |
], |
| 172 |
[ |
| 173 |
'contact_icon_platform' => Social_Network_Provider::MESSENGER, |
| 174 |
], |
| 175 |
], |
| 176 |
'has_accessible_name' => true, |
| 177 |
], |
| 178 |
'send_button_section' => [ |
| 179 |
'section_name' => esc_html__( 'Send Button', 'elementor' ), |
| 180 |
'has_link' => false, |
| 181 |
'text' => [ |
| 182 |
'default' => esc_html__( 'Click to start chat', 'elementor' ), |
| 183 |
], |
| 184 |
], |
| 185 |
], |
| 186 |
'style' => [ |
| 187 |
'has_platform_colors' => true, |
| 188 |
'chat_button_section' => [ |
| 189 |
'has_entrance_animation' => true, |
| 190 |
'has_box_shadow' => true, |
| 191 |
'has_drop_shadow' => false, |
| 192 |
'has_padding' => false, |
| 193 |
'has_button_size' => true, |
| 194 |
'button_size_default' => 'small', |
| 195 |
'has_typography' => false, |
| 196 |
'has_icon_position' => false, |
| 197 |
'has_icon_spacing' => false, |
| 198 |
'has_tabs' => true, |
| 199 |
'has_platform_color_controls' => false, |
| 200 |
'hover_animation_type' => 'default', |
| 201 |
'icon_color_label' => esc_html__( 'Icon Color', 'elementor' ), |
| 202 |
], |
| 203 |
'top_bar_section' => [ |
| 204 |
'has_title_heading' => true, |
| 205 |
'title_heading_label' => esc_html__( 'Name', 'elementor' ), |
| 206 |
'subtitle_heading_label' => esc_html__( 'Title', 'elementor' ), |
| 207 |
'has_style_close_button' => true, |
| 208 |
'has_close_button_heading' => false, |
| 209 |
'has_background' => true, |
| 210 |
'has_background_heading' => false, |
| 211 |
], |
| 212 |
'message_bubble_section' => [ |
| 213 |
'has_chat_background' => true, |
| 214 |
], |
| 215 |
'contact_section' => [ |
| 216 |
'has_buttons_heading' => true, |
| 217 |
'buttons_heading_label' => esc_html__( 'Buttons', 'elementor' ), |
| 218 |
'has_buttons_size' => true, |
| 219 |
'has_box_shadow' => false, |
| 220 |
'has_buttons_spacing' => false, |
| 221 |
'has_hover_animation' => true, |
| 222 |
'has_chat_box_animation' => false, |
| 223 |
'has_icon_bg_color' => true, |
| 224 |
'has_button_bar' => false, |
| 225 |
'has_tabs' => true, |
| 226 |
'has_text_color' => false, |
| 227 |
'has_bg_color' => false, |
| 228 |
'has_padding' => false, |
| 229 |
'has_button_corners' => false, |
| 230 |
'has_typography' => false, |
| 231 |
'icon_color_label' => esc_html__( 'Icon Color', 'elementor' ), |
| 232 |
'has_hover_transition_duration' => false, |
| 233 |
], |
| 234 |
'send_button_section' => [ |
| 235 |
'has_platform_colors' => true, |
| 236 |
'has_icon_color' => true, |
| 237 |
'has_background_color' => true, |
| 238 |
'has_text_color' => false, |
| 239 |
'has_typography' => true, |
| 240 |
'typography_selector' => '{{WRAPPER}} .e-contact-buttons__send-cta', |
| 241 |
], |
| 242 |
'chat_box_section' => [ |
| 243 |
'section_name' => esc_html__( 'Chat Box', 'elementor' ), |
| 244 |
'has_width' => true, |
| 245 |
'has_padding' => false, |
| 246 |
], |
| 247 |
], |
| 248 |
'advanced' => [ |
| 249 |
'has_layout_position' => true, |
| 250 |
'horizontal_position_default' => 'end', |
| 251 |
'has_mobile_full_width' => false, |
| 252 |
'has_vertical_offset' => true, |
| 253 |
'has_horizontal_offset' => true, |
| 254 |
], |
| 255 |
]; |
| 256 |
} |
| 257 |
|
| 258 |
public function get_icon(): string { |
| 259 |
return 'eicon-commenting-o'; |
| 260 |
} |
| 261 |
|
| 262 |
public function get_categories(): array { |
| 263 |
return [ 'general' ]; |
| 264 |
} |
| 265 |
|
| 266 |
protected function register_controls(): void { |
| 267 |
|
| 268 |
$this->add_content_tab(); |
| 269 |
|
| 270 |
$this->add_style_tab(); |
| 271 |
|
| 272 |
$this->add_advanced_tab(); |
| 273 |
} |
| 274 |
|
| 275 |
private function social_media_controls(): void { |
| 276 |
$config = static::get_configuration(); |
| 277 |
|
| 278 |
$this->add_control( |
| 279 |
'chat_button_mail', |
| 280 |
[ |
| 281 |
'label' => esc_html__( 'Email', 'elementor' ), |
| 282 |
'type' => Controls_Manager::TEXT, |
| 283 |
'dynamic' => [ |
| 284 |
'active' => true, |
| 285 |
], |
| 286 |
'ai' => [ |
| 287 |
'active' => false, |
| 288 |
], |
| 289 |
'label_block' => true, |
| 290 |
'placeholder' => esc_html__( '@', 'elementor' ), |
| 291 |
'default' => $config['content']['chat_button_section']['defaults']['mail'], |
| 292 |
'condition' => [ |
| 293 |
'chat_button_platform' => Social_Network_Provider::EMAIL, |
| 294 |
], |
| 295 |
], |
| 296 |
); |
| 297 |
|
| 298 |
$this->add_control( |
| 299 |
'chat_button_mail_subject', |
| 300 |
[ |
| 301 |
'label' => esc_html__( 'Subject', 'elementor' ), |
| 302 |
'type' => Controls_Manager::TEXT, |
| 303 |
'dynamic' => [ |
| 304 |
'active' => true, |
| 305 |
], |
| 306 |
'label_block' => true, |
| 307 |
'default' => $config['content']['chat_button_section']['defaults']['mail_subject'], |
| 308 |
'condition' => [ |
| 309 |
'chat_button_platform' => Social_Network_Provider::EMAIL, |
| 310 |
], |
| 311 |
], |
| 312 |
); |
| 313 |
|
| 314 |
$this->add_control( |
| 315 |
'chat_button_mail_body', |
| 316 |
[ |
| 317 |
'label' => esc_html__( 'Message', 'elementor' ), |
| 318 |
'type' => Controls_Manager::TEXTAREA, |
| 319 |
'default' => $config['content']['chat_button_section']['defaults']['mail_body'], |
| 320 |
'condition' => [ |
| 321 |
'chat_button_platform' => Social_Network_Provider::EMAIL, |
| 322 |
], |
| 323 |
] |
| 324 |
); |
| 325 |
|
| 326 |
$this->add_control( |
| 327 |
'chat_button_number', |
| 328 |
[ |
| 329 |
'label' => esc_html__( 'Number', 'elementor' ), |
| 330 |
'type' => Controls_Manager::TEXT, |
| 331 |
'dynamic' => [ |
| 332 |
'active' => true, |
| 333 |
], |
| 334 |
'ai' => [ |
| 335 |
'active' => false, |
| 336 |
], |
| 337 |
'label_block' => true, |
| 338 |
'placeholder' => esc_html__( '+', 'elementor' ), |
| 339 |
'default' => $config['content']['chat_button_section']['defaults']['number'], |
| 340 |
'condition' => [ |
| 341 |
'chat_button_platform' => [ |
| 342 |
Social_Network_Provider::SMS, |
| 343 |
Social_Network_Provider::WHATSAPP, |
| 344 |
Social_Network_Provider::VIBER, |
| 345 |
Social_Network_Provider::TELEPHONE, |
| 346 |
], |
| 347 |
], |
| 348 |
], |
| 349 |
); |
| 350 |
|
| 351 |
$this->add_control( |
| 352 |
'chat_button_username', |
| 353 |
[ |
| 354 |
'label' => esc_html__( 'Username', 'elementor' ), |
| 355 |
'type' => Controls_Manager::TEXT, |
| 356 |
'dynamic' => [ |
| 357 |
'active' => true, |
| 358 |
], |
| 359 |
'ai' => [ |
| 360 |
'active' => false, |
| 361 |
], |
| 362 |
'label_block' => true, |
| 363 |
'default' => $config['content']['chat_button_section']['defaults']['username'], |
| 364 |
'condition' => [ |
| 365 |
'chat_button_platform' => [ |
| 366 |
Social_Network_Provider::SKYPE, |
| 367 |
Social_Network_Provider::MESSENGER, |
| 368 |
], |
| 369 |
], |
| 370 |
], |
| 371 |
); |
| 372 |
|
| 373 |
$this->add_control( |
| 374 |
'chat_button_viber_action', |
| 375 |
[ |
| 376 |
'label' => esc_html__( 'Action', 'elementor' ), |
| 377 |
'type' => Controls_Manager::SELECT, |
| 378 |
'default' => 'chat', |
| 379 |
'options' => [ |
| 380 |
'chat' => 'Chat', |
| 381 |
'contact' => 'Contact', |
| 382 |
], |
| 383 |
'condition' => [ |
| 384 |
'chat_button_platform' => Social_Network_Provider::VIBER, |
| 385 |
], |
| 386 |
] |
| 387 |
); |
| 388 |
|
| 389 |
$this->add_control( |
| 390 |
'chat_button_waze', |
| 391 |
[ |
| 392 |
'label' => esc_html__( 'Location', 'elementor' ), |
| 393 |
'type' => Controls_Manager::URL, |
| 394 |
'dynamic' => [ |
| 395 |
'active' => true, |
| 396 |
], |
| 397 |
'ai' => [ |
| 398 |
'active' => false, |
| 399 |
], |
| 400 |
'label_block' => true, |
| 401 |
'placeholder' => esc_html__( 'Paste Waze link', 'elementor' ), |
| 402 |
'default' => $config['content']['chat_button_section']['defaults']['location'], |
| 403 |
'condition' => [ |
| 404 |
'chat_button_platform' => [ |
| 405 |
Social_Network_Provider::WAZE, |
| 406 |
], |
| 407 |
], |
| 408 |
], |
| 409 |
); |
| 410 |
|
| 411 |
$this->add_control( |
| 412 |
'chat_button_url', |
| 413 |
[ |
| 414 |
'label' => esc_html__( 'Link', 'elementor' ), |
| 415 |
'type' => Controls_Manager::URL, |
| 416 |
'default' => [ |
| 417 |
'is_external' => true, |
| 418 |
], |
| 419 |
'dynamic' => [ |
| 420 |
'active' => true, |
| 421 |
], |
| 422 |
'ai' => [ |
| 423 |
'active' => false, |
| 424 |
], |
| 425 |
'autocomplete' => true, |
| 426 |
'label_block' => true, |
| 427 |
'default' => $config['content']['chat_button_section']['defaults']['url'], |
| 428 |
'condition' => [ |
| 429 |
'chat_button_platform' => [ |
| 430 |
Social_Network_Provider::URL, |
| 431 |
], |
| 432 |
], |
| 433 |
], |
| 434 |
); |
| 435 |
} |
| 436 |
|
| 437 |
private function get_display_text_condition( $condition ) { |
| 438 |
$config = static::get_configuration(); |
| 439 |
|
| 440 |
if ( true == $config['content']['chat_button_section']['has_display_text_select'] ) { |
| 441 |
return $condition; |
| 442 |
} |
| 443 |
|
| 444 |
return null; |
| 445 |
} |
| 446 |
|
| 447 |
protected function add_chat_button_section(): void { |
| 448 |
$config = static::get_configuration(); |
| 449 |
|
| 450 |
$this->start_controls_section( |
| 451 |
'chat_button_section', |
| 452 |
[ |
| 453 |
'label' => $config['content']['chat_button_section']['section_name'], |
| 454 |
'tab' => Controls_Manager::TAB_CONTENT, |
| 455 |
] |
| 456 |
); |
| 457 |
|
| 458 |
if ( $config['content']['chat_button_section']['has_accessible_name'] ) { |
| 459 |
$this->add_control( |
| 460 |
'chat_aria_label', |
| 461 |
[ |
| 462 |
'label' => esc_html__( 'Accessible name', 'elementor' ), |
| 463 |
'type' => Controls_Manager::TEXT, |
| 464 |
'default' => $config['content']['chat_button_section']['chat_aria_label'], |
| 465 |
'placeholder' => esc_html__( 'Add accessible name', 'elementor' ), |
| 466 |
'dynamic' => [ |
| 467 |
'active' => true, |
| 468 |
], |
| 469 |
], |
| 470 |
); |
| 471 |
} |
| 472 |
|
| 473 |
if ( $config['content']['chat_button_section']['has_platform'] ) { |
| 474 |
|
| 475 |
$this->add_control( |
| 476 |
'chat_button_platform', |
| 477 |
[ |
| 478 |
'label' => esc_html__( 'Platform', 'elementor' ), |
| 479 |
'type' => Controls_Manager::SELECT, |
| 480 |
'default' => $config['content']['chat_button_section']['platform']['default'], |
| 481 |
'options' => Social_Network_Provider::get_social_networks_text( |
| 482 |
$config['content']['chat_button_section']['platform']['group'] |
| 483 |
), |
| 484 |
] |
| 485 |
); |
| 486 |
|
| 487 |
$this->social_media_controls(); |
| 488 |
} |
| 489 |
|
| 490 |
if ( $config['content']['chat_button_section']['has_icon'] ) { |
| 491 |
$this->add_control( |
| 492 |
'chat_button_icon', |
| 493 |
[ |
| 494 |
'label' => esc_html__( 'Icon', 'elementor' ), |
| 495 |
'type' => Controls_Manager::ICONS, |
| 496 |
'default' => $config['content']['chat_button_section']['icon_default'], |
| 497 |
'recommended' => $config['content']['chat_button_section']['icons_recommended'], |
| 498 |
] |
| 499 |
); |
| 500 |
} |
| 501 |
|
| 502 |
if ( $config['content']['chat_button_section']['has_notification_dot'] ) { |
| 503 |
|
| 504 |
$notification_dot_return_value = 'yes'; |
| 505 |
$notification_dot_default = $notification_dot_return_value; |
| 506 |
|
| 507 |
// Only clear if explicitly passed |
| 508 |
if ( false === $config['content']['chat_button_section']['has_notification_dot_default_enabled'] ) { |
| 509 |
$notification_dot_default = ''; |
| 510 |
} |
| 511 |
|
| 512 |
$this->add_control( |
| 513 |
'chat_button_show_dot', |
| 514 |
[ |
| 515 |
'label' => esc_html__( 'Notification Dot', 'elementor' ), |
| 516 |
'type' => Controls_Manager::SWITCHER, |
| 517 |
'label_on' => esc_html__( 'Show', 'elementor' ), |
| 518 |
'label_off' => esc_html__( 'Hide', 'elementor' ), |
| 519 |
'return_value' => $notification_dot_return_value, |
| 520 |
'default' => $notification_dot_default, |
| 521 |
] |
| 522 |
); |
| 523 |
} |
| 524 |
|
| 525 |
if ( $config['content']['chat_button_section']['has_display_text'] ) { |
| 526 |
|
| 527 |
if ( $config['content']['chat_button_section']['has_display_text_select'] ) { |
| 528 |
$this->add_control( |
| 529 |
'chat_button_display_text_select', |
| 530 |
[ |
| 531 |
'label' => esc_html__( 'Display Text', 'elementor' ), |
| 532 |
'type' => Controls_Manager::SELECT, |
| 533 |
'default' => 'details', |
| 534 |
'options' => [ |
| 535 |
'details' => esc_html__( 'Contact Details', 'elementor' ), |
| 536 |
'cta' => esc_html__( 'Call to Action', 'elementor' ), |
| 537 |
], |
| 538 |
] |
| 539 |
); |
| 540 |
} |
| 541 |
|
| 542 |
$this->add_control( |
| 543 |
'chat_button_display_text', |
| 544 |
[ |
| 545 |
'label' => esc_html__( 'Call to Action Text', 'elementor' ), |
| 546 |
'type' => Controls_Manager::TEXT, |
| 547 |
'dynamic' => [ |
| 548 |
'active' => true, |
| 549 |
], |
| 550 |
'label_block' => true, |
| 551 |
'placeholder' => esc_html__( 'Enter the text', 'elementor' ), |
| 552 |
'default' => $config['content']['chat_button_section']['display_text_label'], |
| 553 |
'condition' => $this->get_display_text_condition([ |
| 554 |
'chat_button_display_text_select' => 'cta', |
| 555 |
] ), |
| 556 |
], |
| 557 |
); |
| 558 |
} |
| 559 |
|
| 560 |
$this->end_controls_section(); |
| 561 |
} |
| 562 |
|
| 563 |
protected function add_top_bar_section(): void { |
| 564 |
$config = static::get_configuration(); |
| 565 |
|
| 566 |
$this->start_controls_section( |
| 567 |
'top_bar_section', |
| 568 |
[ |
| 569 |
'label' => $config['content']['top_bar_section']['section_name'], |
| 570 |
'tab' => Controls_Manager::TAB_CONTENT, |
| 571 |
] |
| 572 |
); |
| 573 |
|
| 574 |
$this->add_control( |
| 575 |
'top_bar_title', |
| 576 |
[ |
| 577 |
'label' => $config['content']['top_bar_section']['title']['label'], |
| 578 |
'type' => Controls_Manager::TEXT, |
| 579 |
'default' => $config['content']['top_bar_section']['title']['default'], |
| 580 |
'placeholder' => $config['content']['top_bar_section']['title']['placeholder'], |
| 581 |
'dynamic' => [ |
| 582 |
'active' => $config['content']['top_bar_section']['title']['dynamic'], |
| 583 |
], |
| 584 |
'ai' => [ |
| 585 |
'active' => $config['content']['top_bar_section']['title']['ai'], |
| 586 |
], |
| 587 |
'label_block' => $config['content']['top_bar_section']['title']['label_block'], |
| 588 |
] |
| 589 |
); |
| 590 |
|
| 591 |
if ( $config['content']['top_bar_section']['has_subtitle'] ) { |
| 592 |
$this->add_control( |
| 593 |
'top_bar_subtitle', |
| 594 |
[ |
| 595 |
'label' => $config['content']['top_bar_section']['subtitle']['label'], |
| 596 |
'type' => Controls_Manager::TEXT, |
| 597 |
'default' => $config['content']['top_bar_section']['subtitle']['default'], |
| 598 |
'placeholder' => $config['content']['top_bar_section']['subtitle']['placeholder'], |
| 599 |
$config['content']['top_bar_section']['subtitle']['dynamic'], |
| 600 |
'ai' => [ |
| 601 |
'active' => $config['content']['top_bar_section']['subtitle']['ai'], |
| 602 |
], |
| 603 |
'label_block' => $config['content']['top_bar_section']['title']['label_block'], |
| 604 |
] |
| 605 |
); |
| 606 |
} |
| 607 |
|
| 608 |
if ( $config['content']['top_bar_section']['has_image'] ) { |
| 609 |
$this->add_control( |
| 610 |
'top_bar_image', |
| 611 |
[ |
| 612 |
'label' => esc_html__( 'Profile Image', 'elementor' ), |
| 613 |
'type' => Controls_Manager::MEDIA, |
| 614 |
'default' => [ |
| 615 |
'url' => Utils::get_placeholder_image_src(), |
| 616 |
], |
| 617 |
] |
| 618 |
); |
| 619 |
} |
| 620 |
|
| 621 |
if ( $config['content']['top_bar_section']['has_active_dot'] ) { |
| 622 |
$this->add_control( |
| 623 |
'top_bar_show_dot', |
| 624 |
[ |
| 625 |
'label' => esc_html__( 'Active Dot', 'elementor' ), |
| 626 |
'type' => Controls_Manager::SWITCHER, |
| 627 |
'label_on' => esc_html__( 'Show', 'elementor' ), |
| 628 |
'label_off' => esc_html__( 'Hide', 'elementor' ), |
| 629 |
'return_value' => 'yes', |
| 630 |
'default' => 'yes', |
| 631 |
] |
| 632 |
); |
| 633 |
} |
| 634 |
|
| 635 |
$this->end_controls_section(); |
| 636 |
} |
| 637 |
|
| 638 |
protected function add_message_bubble_section(): void { |
| 639 |
$config = static::get_configuration(); |
| 640 |
|
| 641 |
$this->start_controls_section( |
| 642 |
'message_bubble_section', |
| 643 |
[ |
| 644 |
'label' => esc_html__( 'Message Bubble', 'elementor' ), |
| 645 |
'tab' => Controls_Manager::TAB_CONTENT, |
| 646 |
] |
| 647 |
); |
| 648 |
|
| 649 |
$this->add_control( |
| 650 |
'message_bubble_name', |
| 651 |
[ |
| 652 |
'label' => esc_html__( 'Name', 'elementor' ), |
| 653 |
'type' => Controls_Manager::TEXT, |
| 654 |
'default' => esc_html__( 'Rob', 'elementor' ), |
| 655 |
'placeholder' => esc_html__( 'Type your name here', 'elementor' ), |
| 656 |
] |
| 657 |
); |
| 658 |
|
| 659 |
$this->add_control( |
| 660 |
'message_bubble_body', |
| 661 |
[ |
| 662 |
'label' => esc_html__( 'Message', 'elementor' ), |
| 663 |
'type' => Controls_Manager::TEXTAREA, |
| 664 |
'dynamic' => [ |
| 665 |
'active' => true, |
| 666 |
], |
| 667 |
'label_block' => true, |
| 668 |
'default' => esc_html__( 'Hey, how can I help you today?', 'elementor' ), |
| 669 |
'placeholder' => esc_html__( 'Message', 'elementor' ), |
| 670 |
], |
| 671 |
); |
| 672 |
|
| 673 |
$this->add_control( |
| 674 |
'chat_button_time_format', |
| 675 |
[ |
| 676 |
'label' => esc_html__( 'Time format', 'elementor' ), |
| 677 |
'type' => Controls_Manager::SELECT, |
| 678 |
'default' => '12h', |
| 679 |
'options' => [ |
| 680 |
'12h' => esc_html__( '2:20 PM', 'elementor' ), |
| 681 |
'24h' => esc_html__( '14:20', 'elementor' ), |
| 682 |
], |
| 683 |
] |
| 684 |
); |
| 685 |
|
| 686 |
if ( $config['content']['message_bubble_section']['has_typing_animation'] ) { |
| 687 |
$this->add_control( |
| 688 |
'chat_button_show_animation', |
| 689 |
[ |
| 690 |
'label' => esc_html__( 'Typing Animation', 'elementor' ), |
| 691 |
'type' => Controls_Manager::SWITCHER, |
| 692 |
'label_on' => esc_html__( 'Show', 'elementor' ), |
| 693 |
'label_off' => esc_html__( 'Hide', 'elementor' ), |
| 694 |
'return_value' => 'yes', |
| 695 |
'default' => 'yes', |
| 696 |
] |
| 697 |
); |
| 698 |
} |
| 699 |
|
| 700 |
$this->end_controls_section(); |
| 701 |
} |
| 702 |
|
| 703 |
protected function add_contact_section(): void { |
| 704 |
$config = static::get_configuration(); |
| 705 |
|
| 706 |
$this->start_controls_section( |
| 707 |
'contact_section', |
| 708 |
[ |
| 709 |
'label' => $config['content']['contact_section']['section_name'], |
| 710 |
'tab' => Controls_Manager::TAB_CONTENT, |
| 711 |
] |
| 712 |
); |
| 713 |
|
| 714 |
if ( $config['content']['contact_section']['has_accessible_name'] ) { |
| 715 |
$this->add_control( |
| 716 |
'contact_aria_label', |
| 717 |
[ |
| 718 |
'label' => esc_html__( 'Accessible name', 'elementor' ), |
| 719 |
'type' => Controls_Manager::TEXT, |
| 720 |
'default' => $config['content']['chat_button_section']['chat_aria_label'], |
| 721 |
'placeholder' => esc_html__( 'Add accessible name', 'elementor' ), |
| 722 |
'dynamic' => [ |
| 723 |
'active' => true, |
| 724 |
], |
| 725 |
], |
| 726 |
); |
| 727 |
} |
| 728 |
|
| 729 |
if ( $config['content']['contact_section']['has_cta_text'] ) { |
| 730 |
$this->add_control( |
| 731 |
'contact_cta_text', |
| 732 |
[ |
| 733 |
'label' => esc_html__( 'Call to Action Text', 'elementor' ), |
| 734 |
'type' => Controls_Manager::TEXT, |
| 735 |
'default' => esc_html__( 'Start conversation:', 'elementor' ), |
| 736 |
'placeholder' => esc_html__( 'Type your text here', 'elementor' ), |
| 737 |
'label_block' => true, |
| 738 |
] |
| 739 |
); |
| 740 |
} |
| 741 |
|
| 742 |
if ( $config['content']['contact_section']['platform']['limit'] ) { |
| 743 |
if ( $config['content']['contact_section']['platform']['min_items'] ) { |
| 744 |
$this->add_control( |
| 745 |
'contact_custom_panel_alert', |
| 746 |
[ |
| 747 |
'type' => Controls_Manager::ALERT, |
| 748 |
'alert_type' => 'info', |
| 749 |
'content' => sprintf( |
| 750 |
__( 'Add between <b>%1$d</b> to <b>%2$d</b> contact buttons', 'elementor' ), |
| 751 |
$config['content']['contact_section']['platform']['min_items'], |
| 752 |
$config['content']['contact_section']['platform']['limit'] |
| 753 |
), |
| 754 |
] |
| 755 |
); |
| 756 |
} else { |
| 757 |
$this->add_control( |
| 758 |
'contact_custom_panel_alert', |
| 759 |
[ |
| 760 |
'type' => Controls_Manager::ALERT, |
| 761 |
'alert_type' => 'info', |
| 762 |
'content' => sprintf( |
| 763 |
__( 'Add up to <b>%d</b> contact buttons', 'elementor' ), |
| 764 |
$config['content']['contact_section']['platform']['limit'] |
| 765 |
), |
| 766 |
] |
| 767 |
); |
| 768 |
} |
| 769 |
} |
| 770 |
|
| 771 |
$repeater = new Repeater(); |
| 772 |
|
| 773 |
$repeater->add_control( |
| 774 |
'contact_icon_platform', |
| 775 |
[ |
| 776 |
'label' => esc_html__( 'Platform', 'elementor' ), |
| 777 |
'type' => Controls_Manager::SELECT, |
| 778 |
'options' => Social_Network_Provider::get_social_networks_text( |
| 779 |
$config['content']['contact_section']['platform']['group-1'] |
| 780 |
), |
| 781 |
'default' => Social_Network_Provider::WHATSAPP, |
| 782 |
], |
| 783 |
); |
| 784 |
|
| 785 |
if ( $config['content']['contact_section']['repeater']['has_tooltip'] ) { |
| 786 |
$repeater->add_control( |
| 787 |
'contact_tooltip', |
| 788 |
[ |
| 789 |
'label' => $config['content']['contact_section']['repeater']['tooltip_label'], |
| 790 |
'type' => Controls_Manager::TEXT, |
| 791 |
'dynamic' => [ |
| 792 |
'active' => true, |
| 793 |
], |
| 794 |
'default' => $config['content']['contact_section']['repeater']['tooltip_default'], |
| 795 |
'placeholder' => $config['content']['contact_section']['repeater']['tooltip_placeholder'], |
| 796 |
], |
| 797 |
); |
| 798 |
} |
| 799 |
|
| 800 |
if ( $config['content']['contact_section']['repeater']['has_title'] ) { |
| 801 |
$repeater->add_control( |
| 802 |
'contact_title', |
| 803 |
[ |
| 804 |
'label' => 'Title', |
| 805 |
'type' => Controls_Manager::TEXT, |
| 806 |
'dynamic' => [ |
| 807 |
'active' => true, |
| 808 |
], |
| 809 |
'default' => 'Title', |
| 810 |
'placeholder' => esc_html__( 'Enter title', 'elementor' ), |
| 811 |
], |
| 812 |
); |
| 813 |
} |
| 814 |
|
| 815 |
if ( $config['content']['contact_section']['repeater']['has_description'] ) { |
| 816 |
$repeater->add_control( |
| 817 |
'contact_description', |
| 818 |
[ |
| 819 |
'label' => 'Description', |
| 820 |
'type' => Controls_Manager::TEXT, |
| 821 |
'dynamic' => [ |
| 822 |
'active' => true, |
| 823 |
], |
| 824 |
'default' => 'Description', |
| 825 |
'placeholder' => esc_html__( 'Enter description', 'elementor' ), |
| 826 |
], |
| 827 |
); |
| 828 |
} |
| 829 |
|
| 830 |
$repeater->add_control( |
| 831 |
'contact_icon_mail', |
| 832 |
[ |
| 833 |
'label' => esc_html__( 'Email', 'elementor' ), |
| 834 |
'type' => Controls_Manager::TEXT, |
| 835 |
'placeholder' => esc_html__( 'Enter your email', 'elementor' ), |
| 836 |
'dynamic' => [ |
| 837 |
'active' => true, |
| 838 |
], |
| 839 |
'ai' => [ |
| 840 |
'active' => false, |
| 841 |
], |
| 842 |
'label_block' => true, |
| 843 |
'condition' => [ |
| 844 |
'contact_icon_platform' => [ |
| 845 |
Social_Network_Provider::EMAIL, |
| 846 |
], |
| 847 |
], |
| 848 |
], |
| 849 |
); |
| 850 |
|
| 851 |
$repeater->add_control( |
| 852 |
'contact_icon_mail_subject', |
| 853 |
[ |
| 854 |
'label' => esc_html__( 'Subject', 'elementor' ), |
| 855 |
'type' => Controls_Manager::TEXT, |
| 856 |
'placeholder' => esc_html__( 'Subject', 'elementor' ), |
| 857 |
'label_block' => true, |
| 858 |
'condition' => [ |
| 859 |
'contact_icon_platform' => [ |
| 860 |
Social_Network_Provider::EMAIL, |
| 861 |
], |
| 862 |
], |
| 863 |
] |
| 864 |
); |
| 865 |
|
| 866 |
$repeater->add_control( |
| 867 |
'contact_icon_mail_body', |
| 868 |
[ |
| 869 |
'label' => esc_html__( 'Message', 'elementor' ), |
| 870 |
'type' => Controls_Manager::TEXTAREA, |
| 871 |
'placeholder' => esc_html__( 'Message', 'elementor' ), |
| 872 |
'label_block' => true, |
| 873 |
'condition' => [ |
| 874 |
'contact_icon_platform' => [ |
| 875 |
Social_Network_Provider::EMAIL, |
| 876 |
], |
| 877 |
], |
| 878 |
] |
| 879 |
); |
| 880 |
|
| 881 |
$repeater->add_control( |
| 882 |
'contact_icon_number', |
| 883 |
[ |
| 884 |
'label' => esc_html__( 'Number', 'elementor' ), |
| 885 |
'type' => Controls_Manager::TEXT, |
| 886 |
'dynamic' => [ |
| 887 |
'active' => true, |
| 888 |
], |
| 889 |
'ai' => [ |
| 890 |
'active' => false, |
| 891 |
], |
| 892 |
'label_block' => true, |
| 893 |
'placeholder' => esc_html__( '+', 'elementor' ), |
| 894 |
'condition' => [ |
| 895 |
'contact_icon_platform' => [ |
| 896 |
Social_Network_Provider::SMS, |
| 897 |
Social_Network_Provider::WHATSAPP, |
| 898 |
Social_Network_Provider::VIBER, |
| 899 |
Social_Network_Provider::TELEPHONE, |
| 900 |
], |
| 901 |
], |
| 902 |
], |
| 903 |
); |
| 904 |
|
| 905 |
$repeater->add_control( |
| 906 |
'contact_icon_username', |
| 907 |
[ |
| 908 |
'label' => esc_html__( 'Username', 'elementor' ), |
| 909 |
'type' => Controls_Manager::TEXT, |
| 910 |
'dynamic' => [ |
| 911 |
'active' => true, |
| 912 |
], |
| 913 |
'ai' => [ |
| 914 |
'active' => false, |
| 915 |
], |
| 916 |
'label_block' => true, |
| 917 |
'placeholder' => esc_html__( 'Enter your username', 'elementor' ), |
| 918 |
'condition' => [ |
| 919 |
'contact_icon_platform' => [ |
| 920 |
Social_Network_Provider::MESSENGER, |
| 921 |
Social_Network_Provider::SKYPE, |
| 922 |
], |
| 923 |
], |
| 924 |
], |
| 925 |
); |
| 926 |
|
| 927 |
$repeater->add_control( |
| 928 |
'contact_icon_url', |
| 929 |
[ |
| 930 |
'label' => esc_html__( 'Link', 'elementor' ), |
| 931 |
'type' => Controls_Manager::URL, |
| 932 |
'dynamic' => [ |
| 933 |
'active' => true, |
| 934 |
], |
| 935 |
'ai' => [ |
| 936 |
'active' => false, |
| 937 |
], |
| 938 |
'autocomplete' => true, |
| 939 |
'label_block' => true, |
| 940 |
'condition' => [ |
| 941 |
'contact_icon_platform' => [ |
| 942 |
Social_Network_Provider::URL, |
| 943 |
], |
| 944 |
], |
| 945 |
'default' => [ |
| 946 |
'is_external' => true, |
| 947 |
], |
| 948 |
'placeholder' => esc_html__( 'Paste URL or type', 'elementor' ), |
| 949 |
], |
| 950 |
); |
| 951 |
|
| 952 |
$repeater->add_control( |
| 953 |
'contact_icon_waze', |
| 954 |
[ |
| 955 |
'label' => esc_html__( 'Location', 'elementor' ), |
| 956 |
'type' => Controls_Manager::URL, |
| 957 |
'default' => [ |
| 958 |
'is_external' => true, |
| 959 |
], |
| 960 |
'dynamic' => [ |
| 961 |
'active' => true, |
| 962 |
], |
| 963 |
'label_block' => true, |
| 964 |
'placeholder' => esc_html__( 'Paste Waze link', 'elementor' ), |
| 965 |
'condition' => [ |
| 966 |
'contact_icon_platform' => [ |
| 967 |
Social_Network_Provider::WAZE, |
| 968 |
], |
| 969 |
], |
| 970 |
'ai' => [ |
| 971 |
'active' => false, |
| 972 |
], |
| 973 |
], |
| 974 |
); |
| 975 |
|
| 976 |
$repeater->add_control( |
| 977 |
'contact_icon_viber_action', |
| 978 |
[ |
| 979 |
'label' => esc_html__( 'Action', 'elementor' ), |
| 980 |
'type' => Controls_Manager::SELECT, |
| 981 |
'default' => 'chat', |
| 982 |
'dynamic' => [ |
| 983 |
'active' => true, |
| 984 |
], |
| 985 |
'options' => [ |
| 986 |
'chat' => 'Chat', |
| 987 |
'contact' => 'Contact', |
| 988 |
], |
| 989 |
'condition' => [ |
| 990 |
'contact_icon_platform' => Social_Network_Provider::VIBER, |
| 991 |
], |
| 992 |
] |
| 993 |
); |
| 994 |
|
| 995 |
$this->add_control( |
| 996 |
'contact_repeater', |
| 997 |
[ |
| 998 |
'max_items' => $config['content']['contact_section']['platform']['limit'], |
| 999 |
'min_items' => $config['content']['contact_section']['platform']['min_items'], |
| 1000 |
'type' => Controls_Manager::REPEATER, |
| 1001 |
'fields' => $repeater->get_controls(), |
| 1002 |
'title_field' => $this->get_icon_title_field(), |
| 1003 |
'prevent_empty' => true, |
| 1004 |
'button_text' => esc_html__( 'Add Item', 'elementor' ), |
| 1005 |
'default' => $config['content']['contact_section']['default'], |
| 1006 |
] |
| 1007 |
); |
| 1008 |
|
| 1009 |
$this->end_controls_section(); |
| 1010 |
} |
| 1011 |
|
| 1012 |
protected function get_icon_title_field(): string { |
| 1013 |
$platform_icons_js = json_encode( Social_Network_Provider::get_social_networks_icons() ); |
| 1014 |
$platform_text_js = json_encode( Social_Network_Provider::get_social_networks_text() ); |
| 1015 |
|
| 1016 |
return <<<JS |
| 1017 |
<# |
| 1018 |
elementor.helpers.enqueueIconFonts( 'fa-solid' ); |
| 1019 |
elementor.helpers.enqueueIconFonts( 'fa-brands' ); |
| 1020 |
const mapping = {$platform_icons_js}; |
| 1021 |
const text_mapping = {$platform_text_js}; |
| 1022 |
#> |
| 1023 |
<i class='{{{ mapping[contact_icon_platform] }}}' ></i> {{{ text_mapping[contact_icon_platform] }}} |
| 1024 |
JS; |
| 1025 |
} |
| 1026 |
|
| 1027 |
protected function add_send_button_section(): void { |
| 1028 |
$config = static::get_configuration(); |
| 1029 |
|
| 1030 |
$this->start_controls_section( |
| 1031 |
'send_button_section', |
| 1032 |
[ |
| 1033 |
'label' => $config['content']['send_button_section']['section_name'], |
| 1034 |
'tab' => Controls_Manager::TAB_CONTENT, |
| 1035 |
] |
| 1036 |
); |
| 1037 |
|
| 1038 |
$this->add_control( |
| 1039 |
'send_button_text', |
| 1040 |
[ |
| 1041 |
'label' => esc_html__( 'Text', 'elementor' ), |
| 1042 |
'type' => Controls_Manager::TEXT, |
| 1043 |
'default' => $config['content']['send_button_section']['text']['default'], |
| 1044 |
'placeholder' => esc_html__( 'Type your text here', 'elementor' ), |
| 1045 |
'dynamic' => [ |
| 1046 |
'active' => true, |
| 1047 |
], |
| 1048 |
'ai' => [ |
| 1049 |
'active' => false, |
| 1050 |
], |
| 1051 |
] |
| 1052 |
); |
| 1053 |
|
| 1054 |
if ( $config['content']['send_button_section']['has_link'] ) { |
| 1055 |
$this->add_control( |
| 1056 |
'send_button_url', |
| 1057 |
[ |
| 1058 |
'label' => esc_html__( 'Link', 'elementor' ), |
| 1059 |
'type' => Controls_Manager::URL, |
| 1060 |
'default' => [ |
| 1061 |
'is_external' => true, |
| 1062 |
], |
| 1063 |
'dynamic' => [ |
| 1064 |
'active' => true, |
| 1065 |
], |
| 1066 |
'ai' => [ |
| 1067 |
'active' => false, |
| 1068 |
], |
| 1069 |
'autocomplete' => true, |
| 1070 |
'label_block' => true, |
| 1071 |
], |
| 1072 |
); |
| 1073 |
} |
| 1074 |
|
| 1075 |
$this->end_controls_section(); |
| 1076 |
} |
| 1077 |
|
| 1078 |
protected function add_content_tab(): void { |
| 1079 |
$this->add_chat_button_section(); |
| 1080 |
|
| 1081 |
$this->add_top_bar_section(); |
| 1082 |
|
| 1083 |
$this->add_message_bubble_section(); |
| 1084 |
|
| 1085 |
$this->add_send_button_section(); |
| 1086 |
} |
| 1087 |
|
| 1088 |
private function get_platform_color_condition( $condition ) { |
| 1089 |
$config = static::get_configuration(); |
| 1090 |
|
| 1091 |
if ( true == $config['style']['has_platform_colors'] ) { |
| 1092 |
return $condition; |
| 1093 |
} |
| 1094 |
|
| 1095 |
return null; |
| 1096 |
} |
| 1097 |
|
| 1098 |
protected function add_style_chat_button_section(): void { |
| 1099 |
$config = static::get_configuration(); |
| 1100 |
|
| 1101 |
$this->start_controls_section( |
| 1102 |
'style_chat_button', |
| 1103 |
[ |
| 1104 |
'label' => $config['content']['chat_button_section']['section_name'], |
| 1105 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1106 |
] |
| 1107 |
); |
| 1108 |
|
| 1109 |
if ( $config['style']['chat_button_section']['has_button_size'] ) { |
| 1110 |
$this->add_control( |
| 1111 |
'style_chat_button_size', |
| 1112 |
[ |
| 1113 |
'label' => esc_html__( 'Size', 'elementor' ), |
| 1114 |
'type' => Controls_Manager::SELECT, |
| 1115 |
'default' => $config['style']['chat_button_section']['button_size_default'], |
| 1116 |
'options' => [ |
| 1117 |
'small' => esc_html__( 'Small', 'elementor' ), |
| 1118 |
'medium' => esc_html__( 'Medium', 'elementor' ), |
| 1119 |
'large' => esc_html__( 'Large', 'elementor' ), |
| 1120 |
], |
| 1121 |
] |
| 1122 |
); |
| 1123 |
} |
| 1124 |
|
| 1125 |
if ( $config['style']['chat_button_section']['has_icon_position'] ) { |
| 1126 |
$this->add_responsive_control( |
| 1127 |
'style_chat_button_horizontal_position', |
| 1128 |
[ |
| 1129 |
'label' => esc_html__( 'Icon Position', 'elementor' ), |
| 1130 |
'type' => Controls_Manager::CHOOSE, |
| 1131 |
'options' => [ |
| 1132 |
'start' => [ |
| 1133 |
'title' => esc_html__( 'Left', 'elementor' ), |
| 1134 |
'icon' => 'eicon-h-align-left', |
| 1135 |
], |
| 1136 |
'end' => [ |
| 1137 |
'title' => esc_html__( 'Right', 'elementor' ), |
| 1138 |
'icon' => 'eicon-h-align-right', |
| 1139 |
], |
| 1140 |
], |
| 1141 |
'selectors' => [ |
| 1142 |
'{{WRAPPER}} .e-contact-buttons__chat-button svg' => 'order: {{VALUE}};', |
| 1143 |
], |
| 1144 |
'selectors_dictionary' => [ |
| 1145 |
'start' => '-1', |
| 1146 |
'end' => '2', |
| 1147 |
], |
| 1148 |
'default' => 'start', |
| 1149 |
'mobile_default' => 'start', |
| 1150 |
'toggle' => true, |
| 1151 |
] |
| 1152 |
); |
| 1153 |
} |
| 1154 |
|
| 1155 |
if ( $config['style']['chat_button_section']['has_icon_spacing'] ) { |
| 1156 |
$this->add_responsive_control( |
| 1157 |
'style_chat_button_spacing', |
| 1158 |
[ |
| 1159 |
'label' => esc_html__( 'Icon Spacing', 'elementor' ), |
| 1160 |
'type' => Controls_Manager::SLIDER, |
| 1161 |
'range' => [ |
| 1162 |
'%' => [ |
| 1163 |
'min' => 10, |
| 1164 |
'max' => 100, |
| 1165 |
], |
| 1166 |
'px' => [ |
| 1167 |
'min' => 0, |
| 1168 |
'max' => 100, |
| 1169 |
], |
| 1170 |
], |
| 1171 |
'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], |
| 1172 |
'selectors' => [ |
| 1173 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-chat-button-gap: {{SIZE}}{{UNIT}}', |
| 1174 |
], |
| 1175 |
'separator' => 'before', |
| 1176 |
] |
| 1177 |
); |
| 1178 |
} |
| 1179 |
|
| 1180 |
if ( $config['style']['chat_button_section']['has_typography'] ) { |
| 1181 |
$this->add_group_control( |
| 1182 |
Group_Control_Typography::get_type(), |
| 1183 |
[ |
| 1184 |
'name' => 'style_top_bar_title_typography', |
| 1185 |
'selector' => '{{WRAPPER}} .e-contact-buttons__chat-button', |
| 1186 |
] |
| 1187 |
); |
| 1188 |
} |
| 1189 |
|
| 1190 |
if ( $config['style']['chat_button_section']['has_tabs'] ) { |
| 1191 |
$this->start_controls_tabs( |
| 1192 |
'style_button_color_tabs' |
| 1193 |
); |
| 1194 |
|
| 1195 |
$this->start_controls_tab( |
| 1196 |
'style_button_color_tabs_normal', |
| 1197 |
[ |
| 1198 |
'label' => esc_html__( 'Normal', 'elementor' ), |
| 1199 |
] |
| 1200 |
); |
| 1201 |
|
| 1202 |
if ( $config['style']['has_platform_colors'] ) { |
| 1203 |
$this->add_control( |
| 1204 |
'style_button_color_select', |
| 1205 |
[ |
| 1206 |
'label' => esc_html__( 'Colors', 'elementor' ), |
| 1207 |
'type' => Controls_Manager::SELECT, |
| 1208 |
'default' => 'default', |
| 1209 |
'options' => [ |
| 1210 |
'default' => esc_html__( 'Default', 'elementor' ), |
| 1211 |
'custom' => esc_html__( 'Custom', 'elementor' ), |
| 1212 |
], |
| 1213 |
] |
| 1214 |
); |
| 1215 |
} |
| 1216 |
|
| 1217 |
$this->add_control( |
| 1218 |
'style_button_color_icon', |
| 1219 |
[ |
| 1220 |
'label' => $config['style']['chat_button_section']['icon_color_label'], |
| 1221 |
'type' => Controls_Manager::COLOR, |
| 1222 |
'selectors' => [ |
| 1223 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-icon: {{VALUE}}', |
| 1224 |
], |
| 1225 |
'condition' => $this->get_platform_color_condition( [ |
| 1226 |
'style_button_color_select' => 'custom', |
| 1227 |
] ), |
| 1228 |
] |
| 1229 |
); |
| 1230 |
|
| 1231 |
$this->add_control( |
| 1232 |
'style_button_color_background', |
| 1233 |
[ |
| 1234 |
'label' => esc_html__( 'Background Color', 'elementor' ), |
| 1235 |
'type' => Controls_Manager::COLOR, |
| 1236 |
'selectors' => [ |
| 1237 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-bg: {{VALUE}}', |
| 1238 |
], |
| 1239 |
'condition' => $this->get_platform_color_condition( [ |
| 1240 |
'style_button_color_select' => 'custom', |
| 1241 |
] ), |
| 1242 |
] |
| 1243 |
); |
| 1244 |
|
| 1245 |
$this->end_controls_tab(); |
| 1246 |
|
| 1247 |
$this->start_controls_tab( |
| 1248 |
'style_button_color_tabs_hover', |
| 1249 |
[ |
| 1250 |
'label' => esc_html__( 'Hover', 'elementor' ), |
| 1251 |
] |
| 1252 |
); |
| 1253 |
|
| 1254 |
if ( $config['style']['has_platform_colors'] ) { |
| 1255 |
$this->add_control( |
| 1256 |
'style_button_color_select_hover', |
| 1257 |
[ |
| 1258 |
'label' => esc_html__( 'Colors', 'elementor' ), |
| 1259 |
'type' => Controls_Manager::SELECT, |
| 1260 |
'default' => 'default', |
| 1261 |
'options' => [ |
| 1262 |
'default' => esc_html__( 'Default', 'elementor' ), |
| 1263 |
'custom' => esc_html__( 'Custom', 'elementor' ), |
| 1264 |
], |
| 1265 |
] |
| 1266 |
); |
| 1267 |
} |
| 1268 |
|
| 1269 |
$this->add_control( |
| 1270 |
'style_button_color_icon_hover', |
| 1271 |
[ |
| 1272 |
'label' => $config['style']['chat_button_section']['icon_color_label'], |
| 1273 |
'type' => Controls_Manager::COLOR, |
| 1274 |
'selectors' => [ |
| 1275 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-icon-hover: {{VALUE}}', |
| 1276 |
], |
| 1277 |
'condition' => $this->get_platform_color_condition( [ |
| 1278 |
'style_button_color_select_hover' => 'custom', |
| 1279 |
] ), |
| 1280 |
] |
| 1281 |
); |
| 1282 |
|
| 1283 |
$this->add_control( |
| 1284 |
'style_button_color_background_hover', |
| 1285 |
[ |
| 1286 |
'label' => esc_html__( 'Background Color', 'elementor' ), |
| 1287 |
'type' => Controls_Manager::COLOR, |
| 1288 |
'selectors' => [ |
| 1289 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-bg-hover: {{VALUE}}', |
| 1290 |
], |
| 1291 |
'condition' => $this->get_platform_color_condition( [ |
| 1292 |
'style_button_color_select_hover' => 'custom', |
| 1293 |
] ), |
| 1294 |
] |
| 1295 |
); |
| 1296 |
|
| 1297 |
if ( 'default' == $config['style']['chat_button_section']['hover_animation_type'] ) { |
| 1298 |
$this->add_hover_animation_control( |
| 1299 |
'style_button_color_hover_animation', |
| 1300 |
); |
| 1301 |
} |
| 1302 |
|
| 1303 |
$this->end_controls_tab(); |
| 1304 |
|
| 1305 |
if ( $config['content']['chat_button_section']['has_active_tab'] ) { |
| 1306 |
$this->start_controls_tab( |
| 1307 |
'style_button_color_tabs_active', |
| 1308 |
[ |
| 1309 |
'label' => esc_html__( 'Active', 'elementor' ), |
| 1310 |
] |
| 1311 |
); |
| 1312 |
|
| 1313 |
$this->add_control( |
| 1314 |
'style_button_color_icon_active', |
| 1315 |
[ |
| 1316 |
'label' => esc_html__( 'Icon Color', 'elementor' ), |
| 1317 |
'type' => Controls_Manager::COLOR, |
| 1318 |
'selectors' => [ |
| 1319 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-active-button-color: {{VALUE}}', |
| 1320 |
], |
| 1321 |
] |
| 1322 |
); |
| 1323 |
|
| 1324 |
$this->add_control( |
| 1325 |
'style_button_color_background_active', |
| 1326 |
[ |
| 1327 |
'label' => esc_html__( 'Background Color', 'elementor' ), |
| 1328 |
'type' => Controls_Manager::COLOR, |
| 1329 |
'selectors' => [ |
| 1330 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-active-button-bg: {{VALUE}}', |
| 1331 |
], |
| 1332 |
] |
| 1333 |
); |
| 1334 |
|
| 1335 |
$this->end_controls_tab(); |
| 1336 |
} |
| 1337 |
|
| 1338 |
$this->end_controls_tabs(); |
| 1339 |
} |
| 1340 |
|
| 1341 |
if ( $config['style']['chat_button_section']['has_platform_color_controls'] ) { |
| 1342 |
$this->add_control( |
| 1343 |
'style_platform_control_select', |
| 1344 |
[ |
| 1345 |
'label' => esc_html__( 'Colors', 'elementor' ), |
| 1346 |
'type' => Controls_Manager::SELECT, |
| 1347 |
'default' => 'default', |
| 1348 |
'options' => [ |
| 1349 |
'default' => esc_html__( 'Default', 'elementor' ), |
| 1350 |
'custom' => esc_html__( 'Custom', 'elementor' ), |
| 1351 |
], |
| 1352 |
'separator' => 'before', |
| 1353 |
] |
| 1354 |
); |
| 1355 |
|
| 1356 |
$this->add_control( |
| 1357 |
'style_button_color_icon', |
| 1358 |
[ |
| 1359 |
'label' => $config['style']['chat_button_section']['icon_color_label'], |
| 1360 |
'type' => Controls_Manager::COLOR, |
| 1361 |
'selectors' => [ |
| 1362 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-icon: {{VALUE}}', |
| 1363 |
], |
| 1364 |
'condition' => [ |
| 1365 |
'style_platform_control_select' => 'custom', |
| 1366 |
], |
| 1367 |
] |
| 1368 |
); |
| 1369 |
|
| 1370 |
$this->add_control( |
| 1371 |
'style_button_color_background', |
| 1372 |
[ |
| 1373 |
'label' => esc_html__( 'Background Color', 'elementor' ), |
| 1374 |
'type' => Controls_Manager::COLOR, |
| 1375 |
'selectors' => [ |
| 1376 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-bg: {{VALUE}}', |
| 1377 |
], |
| 1378 |
'condition' => [ |
| 1379 |
'style_platform_control_select' => 'custom', |
| 1380 |
], |
| 1381 |
] |
| 1382 |
); |
| 1383 |
} |
| 1384 |
|
| 1385 |
if ( $config['style']['chat_button_section']['has_entrance_animation'] ) { |
| 1386 |
$this->add_responsive_control( |
| 1387 |
'style_chat_button_animation', |
| 1388 |
[ |
| 1389 |
'label' => esc_html__( 'Entrance Animation', 'elementor' ), |
| 1390 |
'type' => Controls_Manager::ANIMATION, |
| 1391 |
'frontend_available' => true, |
| 1392 |
'separator' => 'before', |
| 1393 |
] |
| 1394 |
); |
| 1395 |
|
| 1396 |
$this->add_control( |
| 1397 |
'style_chat_button_animation_duration', |
| 1398 |
[ |
| 1399 |
'label' => esc_html__( 'Animation Duration', 'elementor' ), |
| 1400 |
'type' => Controls_Manager::SELECT, |
| 1401 |
'default' => 'normal', |
| 1402 |
'options' => [ |
| 1403 |
'slow' => esc_html__( 'Slow', 'elementor' ), |
| 1404 |
'normal' => esc_html__( 'Normal', 'elementor' ), |
| 1405 |
'fast' => esc_html__( 'Fast', 'elementor' ), |
| 1406 |
], |
| 1407 |
'prefix_class' => 'animated-', |
| 1408 |
] |
| 1409 |
); |
| 1410 |
|
| 1411 |
$this->add_control( |
| 1412 |
'style_chat_button_animation_delay', |
| 1413 |
[ |
| 1414 |
'label' => esc_html__( 'Animation Delay', 'elementor' ) . ' (ms)', |
| 1415 |
'type' => Controls_Manager::NUMBER, |
| 1416 |
'min' => 0, |
| 1417 |
'step' => 100, |
| 1418 |
'selectors' => [ |
| 1419 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-button-chat-button-animation-delay: {{SIZE}}ms;', |
| 1420 |
], |
| 1421 |
'render_type' => 'none', |
| 1422 |
'frontend_available' => true, |
| 1423 |
'separator' => 'after', |
| 1424 |
] |
| 1425 |
); |
| 1426 |
} |
| 1427 |
|
| 1428 |
if ( $config['style']['chat_button_section']['has_box_shadow'] ) { |
| 1429 |
$this->add_group_control( |
| 1430 |
Group_Control_Box_Shadow::get_type(), |
| 1431 |
[ |
| 1432 |
'name' => 'style_chat_button_box_shadow', |
| 1433 |
'selector' => '{{WRAPPER}} .e-contact-buttons__chat-button-shadow', |
| 1434 |
] |
| 1435 |
); |
| 1436 |
} |
| 1437 |
|
| 1438 |
if ( $config['style']['chat_button_section']['has_drop_shadow'] ) { |
| 1439 |
$this->add_group_control( |
| 1440 |
Group_Control_Box_Shadow::get_type(), |
| 1441 |
[ |
| 1442 |
'name' => 'style_chat_button_drop_shadow', |
| 1443 |
'fields_options' => [ |
| 1444 |
'box_shadow' => [ |
| 1445 |
'selectors' => [ |
| 1446 |
'{{WRAPPER}} .e-contact-buttons__chat-button-drop-shadow' => 'filter: drop-shadow({{HORIZONTAL}}px {{VERTICAL}}px {{BLUR}}px {{COLOR}});', |
| 1447 |
], |
| 1448 |
], |
| 1449 |
], |
| 1450 |
] |
| 1451 |
); |
| 1452 |
} |
| 1453 |
|
| 1454 |
if ( $config['style']['chat_button_section']['has_padding'] ) { |
| 1455 |
$this->add_responsive_control( |
| 1456 |
'style_chat_button_padding', |
| 1457 |
[ |
| 1458 |
'label' => esc_html__( 'Padding', 'elementor' ), |
| 1459 |
'type' => Controls_Manager::DIMENSIONS, |
| 1460 |
'size_units' => [ 'px', '%', 'em', 'rem' ], |
| 1461 |
'selectors' => [ |
| 1462 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-chat-button-padding-block-end: {{BOTTOM}}{{UNIT}}; --e-contact-buttons-chat-button-padding-block-start: {{TOP}}{{UNIT}}; --e-contact-buttons-chat-button-padding-inline-end: {{RIGHT}}{{UNIT}}; --e-contact-buttons-chat-button-padding-inline-start: {{LEFT}}{{UNIT}};', |
| 1463 |
], |
| 1464 |
'separator' => 'before', |
| 1465 |
] |
| 1466 |
); |
| 1467 |
} |
| 1468 |
|
| 1469 |
if ( 'custom' == $config['style']['chat_button_section']['hover_animation_type'] ) { |
| 1470 |
$this->add_control( |
| 1471 |
'style_chat_button_custom_animation_heading', |
| 1472 |
[ |
| 1473 |
'label' => esc_html__( 'Hover Animation', 'elementor' ), |
| 1474 |
'type' => Controls_Manager::HEADING, |
| 1475 |
'separator' => 'before', |
| 1476 |
] |
| 1477 |
); |
| 1478 |
|
| 1479 |
$this->add_control( |
| 1480 |
'style_chat_button_custom_animation_alert', |
| 1481 |
[ |
| 1482 |
'type' => Controls_Manager::ALERT, |
| 1483 |
'alert_type' => 'info', |
| 1484 |
'content' => __( 'Hover animation is <b>desktop only</b>', 'elementor' ), |
| 1485 |
] |
| 1486 |
); |
| 1487 |
|
| 1488 |
$this->add_control( |
| 1489 |
'style_chat_button_custom_animation_transition', |
| 1490 |
[ |
| 1491 |
'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)', |
| 1492 |
'type' => Controls_Manager::SLIDER, |
| 1493 |
'range' => [ |
| 1494 |
's' => [ |
| 1495 |
'min' => 0, |
| 1496 |
'max' => 3, |
| 1497 |
'step' => 0.1, |
| 1498 |
], |
| 1499 |
], |
| 1500 |
'default' => [ |
| 1501 |
'unit' => 's', |
| 1502 |
'size' => 0.3, |
| 1503 |
], |
| 1504 |
'selectors' => [ |
| 1505 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-transition-duration: {{SIZE}}{{UNIT}}', |
| 1506 |
], |
| 1507 |
] |
| 1508 |
); |
| 1509 |
} |
| 1510 |
|
| 1511 |
$this->end_controls_section(); |
| 1512 |
} |
| 1513 |
|
| 1514 |
protected function add_style_top_bar_section(): void { |
| 1515 |
$config = static::get_configuration(); |
| 1516 |
|
| 1517 |
$this->start_controls_section( |
| 1518 |
'style_top_bar_section', |
| 1519 |
[ |
| 1520 |
'label' => $config['content']['top_bar_section']['section_name'], |
| 1521 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1522 |
] |
| 1523 |
); |
| 1524 |
|
| 1525 |
if ( $config['content']['top_bar_section']['has_image'] ) { |
| 1526 |
$this->add_control( |
| 1527 |
'style_top_bar_profile_heading', |
| 1528 |
[ |
| 1529 |
'label' => esc_html__( 'Profile Image', 'elementor' ), |
| 1530 |
'type' => Controls_Manager::HEADING, |
| 1531 |
'separator' => 'before', |
| 1532 |
] |
| 1533 |
); |
| 1534 |
|
| 1535 |
$this->add_control( |
| 1536 |
'style_top_bar_image_size', |
| 1537 |
[ |
| 1538 |
'label' => esc_html__( 'Size', 'elementor' ), |
| 1539 |
'type' => Controls_Manager::SELECT, |
| 1540 |
'default' => 'medium', |
| 1541 |
'options' => [ |
| 1542 |
'small' => esc_html__( 'Small', 'elementor' ), |
| 1543 |
'medium' => esc_html__( 'Medium', 'elementor' ), |
| 1544 |
'large' => esc_html__( 'Large', 'elementor' ), |
| 1545 |
], |
| 1546 |
] |
| 1547 |
); |
| 1548 |
} |
| 1549 |
|
| 1550 |
if ( $config['style']['has_platform_colors'] ) { |
| 1551 |
$this->add_control( |
| 1552 |
'style_top_bar_colors', |
| 1553 |
[ |
| 1554 |
'label' => esc_html__( 'Colors', 'elementor' ), |
| 1555 |
'type' => Controls_Manager::SELECT, |
| 1556 |
'default' => 'default', |
| 1557 |
'options' => [ |
| 1558 |
'default' => esc_html__( 'Default', 'elementor' ), |
| 1559 |
'custom' => esc_html__( 'Custom', 'elementor' ), |
| 1560 |
], |
| 1561 |
'separator' => 'before', |
| 1562 |
] |
| 1563 |
); |
| 1564 |
} |
| 1565 |
|
| 1566 |
if ( $config['style']['top_bar_section']['has_title_heading'] ) { |
| 1567 |
$this->add_control( |
| 1568 |
'style_top_bar_title_heading', |
| 1569 |
[ |
| 1570 |
'label' => $config['style']['top_bar_section']['title_heading_label'], |
| 1571 |
'type' => Controls_Manager::HEADING, |
| 1572 |
'separator' => ! $config['style']['has_platform_colors'] ? 'before' : false, |
| 1573 |
] |
| 1574 |
); |
| 1575 |
} |
| 1576 |
|
| 1577 |
$this->add_control( |
| 1578 |
'style_top_bar_title_color', |
| 1579 |
[ |
| 1580 |
'label' => esc_html__( 'Text Color', 'elementor' ), |
| 1581 |
'type' => Controls_Manager::COLOR, |
| 1582 |
'selectors' => [ |
| 1583 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-top-bar-title: {{VALUE}}', |
| 1584 |
], |
| 1585 |
'condition' => $this->get_platform_color_condition( [ |
| 1586 |
'style_top_bar_colors' => 'custom', |
| 1587 |
] ), |
| 1588 |
] |
| 1589 |
); |
| 1590 |
|
| 1591 |
$this->add_group_control( |
| 1592 |
Group_Control_Typography::get_type(), |
| 1593 |
[ |
| 1594 |
'name' => 'style_top_bar_title_typography', |
| 1595 |
'selector' => '{{WRAPPER}} .e-contact-buttons__top-bar-title', |
| 1596 |
] |
| 1597 |
); |
| 1598 |
|
| 1599 |
if ( $config['content']['top_bar_section']['has_subtitle'] ) { |
| 1600 |
$this->add_control( |
| 1601 |
'style_top_bar_subtitle_heading', |
| 1602 |
[ |
| 1603 |
'label' => $config['style']['top_bar_section']['subtitle_heading_label'], |
| 1604 |
'type' => Controls_Manager::HEADING, |
| 1605 |
'separator' => false, |
| 1606 |
] |
| 1607 |
); |
| 1608 |
|
| 1609 |
$this->add_control( |
| 1610 |
'style_top_bar_subtitle_color', |
| 1611 |
[ |
| 1612 |
'label' => esc_html__( 'Text Color', 'elementor' ), |
| 1613 |
'type' => Controls_Manager::COLOR, |
| 1614 |
'selectors' => [ |
| 1615 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-top-bar-subtitle: {{VALUE}}', |
| 1616 |
], |
| 1617 |
'condition' => $this->get_platform_color_condition( [ |
| 1618 |
'style_top_bar_colors' => 'custom', |
| 1619 |
] ), |
| 1620 |
] |
| 1621 |
); |
| 1622 |
|
| 1623 |
$this->add_group_control( |
| 1624 |
Group_Control_Typography::get_type(), |
| 1625 |
[ |
| 1626 |
'name' => 'style_top_bar_subtitle_typography', |
| 1627 |
'selector' => '{{WRAPPER}} .e-contact-buttons__top-bar-subtitle', |
| 1628 |
] |
| 1629 |
); |
| 1630 |
} |
| 1631 |
|
| 1632 |
$close_and_background_partial_divider = 'before'; |
| 1633 |
|
| 1634 |
if ( $config['style']['top_bar_section']['has_style_close_button'] ) { |
| 1635 |
|
| 1636 |
if ( $config['style']['top_bar_section']['has_close_button_heading'] ) { |
| 1637 |
$this->add_control( |
| 1638 |
'style_top_bar_close_button_heading', |
| 1639 |
[ |
| 1640 |
'label' => esc_html__( 'Close Button', 'elementor' ), |
| 1641 |
'type' => Controls_Manager::HEADING, |
| 1642 |
'separator' => $close_and_background_partial_divider, |
| 1643 |
'condition' => $this->get_platform_color_condition( [ |
| 1644 |
'style_top_bar_colors' => 'custom', |
| 1645 |
] ), |
| 1646 |
] |
| 1647 |
); |
| 1648 |
$close_and_background_partial_divider = false; |
| 1649 |
} |
| 1650 |
|
| 1651 |
$this->add_control( |
| 1652 |
'style_top_bar_close_button_color', |
| 1653 |
[ |
| 1654 |
'label' => esc_html__( 'Close Button Color', 'elementor' ), |
| 1655 |
'type' => Controls_Manager::COLOR, |
| 1656 |
'selectors' => [ |
| 1657 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-close-button-color: {{VALUE}}', |
| 1658 |
], |
| 1659 |
'condition' => $this->get_platform_color_condition( [ |
| 1660 |
'style_top_bar_colors' => 'custom', |
| 1661 |
] ), |
| 1662 |
'separator' => $close_and_background_partial_divider, |
| 1663 |
] |
| 1664 |
); |
| 1665 |
|
| 1666 |
$close_and_background_partial_divider = false; |
| 1667 |
} |
| 1668 |
|
| 1669 |
if ( $config['style']['top_bar_section']['has_background'] ) { |
| 1670 |
|
| 1671 |
if ( $config['style']['top_bar_section']['has_background_heading'] ) { |
| 1672 |
$this->add_control( |
| 1673 |
'style_top_bar_background_heading', |
| 1674 |
[ |
| 1675 |
'label' => esc_html__( 'Background', 'elementor' ), |
| 1676 |
'type' => Controls_Manager::HEADING, |
| 1677 |
'separator' => $close_and_background_partial_divider, |
| 1678 |
'condition' => $this->get_platform_color_condition( [ |
| 1679 |
'style_top_bar_colors' => 'custom', |
| 1680 |
] ), |
| 1681 |
] |
| 1682 |
); |
| 1683 |
$close_and_background_partial_divider = false; |
| 1684 |
} |
| 1685 |
|
| 1686 |
$this->add_control( |
| 1687 |
'style_top_bar_background_color', |
| 1688 |
[ |
| 1689 |
'label' => esc_html__( 'Background Color', 'elementor' ), |
| 1690 |
'type' => Controls_Manager::COLOR, |
| 1691 |
'selectors' => [ |
| 1692 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-top-bar-bg: {{VALUE}}', |
| 1693 |
], |
| 1694 |
'condition' => $this->get_platform_color_condition( [ |
| 1695 |
'style_top_bar_colors' => 'custom', |
| 1696 |
] ), |
| 1697 |
'separator' => $close_and_background_partial_divider, |
| 1698 |
] |
| 1699 |
); |
| 1700 |
} |
| 1701 |
|
| 1702 |
$this->end_controls_section(); |
| 1703 |
} |
| 1704 |
|
| 1705 |
protected function add_style_message_bubble_section(): void { |
| 1706 |
$config = static::get_configuration(); |
| 1707 |
|
| 1708 |
$this->start_controls_section( |
| 1709 |
'style_bubble_section', |
| 1710 |
[ |
| 1711 |
'label' => esc_html__( 'Message Bubble', 'elementor' ), |
| 1712 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1713 |
] |
| 1714 |
); |
| 1715 |
|
| 1716 |
if ( $config['style']['has_platform_colors'] ) { |
| 1717 |
$this->add_control( |
| 1718 |
'style_bubble_colors', |
| 1719 |
[ |
| 1720 |
'label' => esc_html__( 'Colors', 'elementor' ), |
| 1721 |
'type' => Controls_Manager::SELECT, |
| 1722 |
'default' => 'default', |
| 1723 |
'options' => [ |
| 1724 |
'default' => esc_html__( 'Default', 'elementor' ), |
| 1725 |
'custom' => esc_html__( 'Custom', 'elementor' ), |
| 1726 |
], |
| 1727 |
] |
| 1728 |
); |
| 1729 |
} |
| 1730 |
|
| 1731 |
$this->add_control( |
| 1732 |
'style_bubble_name_heading', |
| 1733 |
[ |
| 1734 |
'label' => esc_html__( 'Name', 'elementor' ), |
| 1735 |
'type' => Controls_Manager::HEADING, |
| 1736 |
'separator' => false, |
| 1737 |
] |
| 1738 |
); |
| 1739 |
|
| 1740 |
$this->add_control( |
| 1741 |
'style_bubble_name_color', |
| 1742 |
[ |
| 1743 |
'label' => esc_html__( 'Text Color', 'elementor' ), |
| 1744 |
'type' => Controls_Manager::COLOR, |
| 1745 |
'selectors' => [ |
| 1746 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-message-bubble-name: {{VALUE}}', |
| 1747 |
], |
| 1748 |
'condition' => $this->get_platform_color_condition( [ |
| 1749 |
'style_bubble_colors' => 'custom', |
| 1750 |
] ), |
| 1751 |
] |
| 1752 |
); |
| 1753 |
|
| 1754 |
$this->add_group_control( |
| 1755 |
Group_Control_Typography::get_type(), |
| 1756 |
[ |
| 1757 |
'name' => 'style_bubble_name_typography', |
| 1758 |
'selector' => '{{WRAPPER}} .e-contact-buttons__message-bubble-name', |
| 1759 |
] |
| 1760 |
); |
| 1761 |
|
| 1762 |
$this->add_control( |
| 1763 |
'style_bubble_message_heading', |
| 1764 |
[ |
| 1765 |
'label' => esc_html__( 'Message', 'elementor' ), |
| 1766 |
'type' => Controls_Manager::HEADING, |
| 1767 |
'separator' => false, |
| 1768 |
] |
| 1769 |
); |
| 1770 |
|
| 1771 |
$this->add_control( |
| 1772 |
'style_bubble_message_color', |
| 1773 |
[ |
| 1774 |
'label' => esc_html__( 'Text Color', 'elementor' ), |
| 1775 |
'type' => Controls_Manager::COLOR, |
| 1776 |
'selectors' => [ |
| 1777 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-message-bubble-body: {{VALUE}}', |
| 1778 |
], |
| 1779 |
'condition' => $this->get_platform_color_condition( [ |
| 1780 |
'style_bubble_colors' => 'custom', |
| 1781 |
] ), |
| 1782 |
] |
| 1783 |
); |
| 1784 |
|
| 1785 |
$this->add_group_control( |
| 1786 |
Group_Control_Typography::get_type(), |
| 1787 |
[ |
| 1788 |
'name' => 'style_bubble_message_typography', |
| 1789 |
'selector' => '{{WRAPPER}} .e-contact-buttons__message-bubble-body', |
| 1790 |
] |
| 1791 |
); |
| 1792 |
|
| 1793 |
$this->add_control( |
| 1794 |
'style_bubble_time_heading', |
| 1795 |
[ |
| 1796 |
'label' => esc_html__( 'Time', 'elementor' ), |
| 1797 |
'type' => Controls_Manager::HEADING, |
| 1798 |
'separator' => false, |
| 1799 |
] |
| 1800 |
); |
| 1801 |
|
| 1802 |
$this->add_control( |
| 1803 |
'style_bubble_time_color', |
| 1804 |
[ |
| 1805 |
'label' => esc_html__( 'Text Color', 'elementor' ), |
| 1806 |
'type' => Controls_Manager::COLOR, |
| 1807 |
'selectors' => [ |
| 1808 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-message-bubble-time: {{VALUE}}', |
| 1809 |
], |
| 1810 |
'condition' => $this->get_platform_color_condition( [ |
| 1811 |
'style_bubble_colors' => 'custom', |
| 1812 |
] ), |
| 1813 |
] |
| 1814 |
); |
| 1815 |
|
| 1816 |
$this->add_group_control( |
| 1817 |
Group_Control_Typography::get_type(), |
| 1818 |
[ |
| 1819 |
'name' => 'style_bubble_time_typography', |
| 1820 |
'selector' => '{{WRAPPER}} .e-contact-buttons__message-bubble-time', |
| 1821 |
] |
| 1822 |
); |
| 1823 |
|
| 1824 |
$this->add_control( |
| 1825 |
'style_bubble_background_color', |
| 1826 |
[ |
| 1827 |
'label' => esc_html__( 'Bubble Background Color', 'elementor' ), |
| 1828 |
'type' => Controls_Manager::COLOR, |
| 1829 |
'selectors' => [ |
| 1830 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-message-bubble-bubble-bg: {{VALUE}}', |
| 1831 |
], |
| 1832 |
'condition' => $this->get_platform_color_condition( [ |
| 1833 |
'style_bubble_colors' => 'custom', |
| 1834 |
] ), |
| 1835 |
'separator' => 'before', |
| 1836 |
] |
| 1837 |
); |
| 1838 |
|
| 1839 |
if ( $config['style']['message_bubble_section']['has_chat_background'] ) { |
| 1840 |
$this->add_control( |
| 1841 |
'style_bubble_chat_color', |
| 1842 |
[ |
| 1843 |
'label' => esc_html__( 'Chat Background Color', 'elementor' ), |
| 1844 |
'type' => Controls_Manager::COLOR, |
| 1845 |
'selectors' => [ |
| 1846 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-message-bubble-chat-bg: {{VALUE}}', |
| 1847 |
], |
| 1848 |
'condition' => $this->get_platform_color_condition( [ |
| 1849 |
'style_bubble_colors' => 'custom', |
| 1850 |
] ), |
| 1851 |
] |
| 1852 |
); |
| 1853 |
} |
| 1854 |
|
| 1855 |
$this->end_controls_section(); |
| 1856 |
} |
| 1857 |
|
| 1858 |
protected function add_style_contact_section(): void { |
| 1859 |
$config = static::get_configuration(); |
| 1860 |
|
| 1861 |
$this->start_controls_section( |
| 1862 |
'style_contact_section', |
| 1863 |
[ |
| 1864 |
'label' => $config['content']['contact_section']['section_name'], |
| 1865 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1866 |
] |
| 1867 |
); |
| 1868 |
|
| 1869 |
if ( $config['content']['contact_section']['has_cta_text'] ) { |
| 1870 |
$this->add_control( |
| 1871 |
'style_contact_text_heading', |
| 1872 |
[ |
| 1873 |
'label' => esc_html__( 'Call to Action Text', 'elementor' ), |
| 1874 |
'type' => Controls_Manager::HEADING, |
| 1875 |
'separator' => false, |
| 1876 |
'condition' => $this->get_platform_color_condition( [ |
| 1877 |
'style_bubble_colors' => 'custom', |
| 1878 |
] ), |
| 1879 |
] |
| 1880 |
); |
| 1881 |
|
| 1882 |
$this->add_control( |
| 1883 |
'style_contact_text_color', |
| 1884 |
[ |
| 1885 |
'label' => esc_html__( 'Color', 'elementor' ), |
| 1886 |
'type' => Controls_Manager::COLOR, |
| 1887 |
'selectors' => [ |
| 1888 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-text: {{VALUE}}', |
| 1889 |
], |
| 1890 |
] |
| 1891 |
); |
| 1892 |
|
| 1893 |
$this->add_group_control( |
| 1894 |
Group_Control_Typography::get_type(), |
| 1895 |
[ |
| 1896 |
'name' => 'style_contact_text_typography', |
| 1897 |
'selector' => '{{WRAPPER}} .e-contact-buttons__contact-text', |
| 1898 |
] |
| 1899 |
); |
| 1900 |
} |
| 1901 |
|
| 1902 |
if ( $config['style']['contact_section']['has_buttons_heading'] ) { |
| 1903 |
$this->add_control( |
| 1904 |
'style_contact_buttons_heading', |
| 1905 |
[ |
| 1906 |
'label' => $config['style']['contact_section']['buttons_heading_label'], |
| 1907 |
'type' => Controls_Manager::HEADING, |
| 1908 |
'separator' => false, |
| 1909 |
'condition' => $this->get_platform_color_condition( [ |
| 1910 |
'style_bubble_colors' => 'custom', |
| 1911 |
] ), |
| 1912 |
] |
| 1913 |
); |
| 1914 |
} |
| 1915 |
|
| 1916 |
if ( $config['style']['contact_section']['has_buttons_size'] ) { |
| 1917 |
$this->add_control( |
| 1918 |
'style_contact_button_size', |
| 1919 |
[ |
| 1920 |
'label' => esc_html__( 'Size', 'elementor' ), |
| 1921 |
'type' => Controls_Manager::SELECT, |
| 1922 |
'default' => 'small', |
| 1923 |
'options' => [ |
| 1924 |
'small' => esc_html__( 'Small', 'elementor' ), |
| 1925 |
'medium' => esc_html__( 'Medium', 'elementor' ), |
| 1926 |
'large' => esc_html__( 'Large', 'elementor' ), |
| 1927 |
], |
| 1928 |
] |
| 1929 |
); |
| 1930 |
} |
| 1931 |
|
| 1932 |
if ( $config['style']['contact_section']['has_text_color'] ) { |
| 1933 |
$this->add_control( |
| 1934 |
'style_contact_button_text_color', |
| 1935 |
[ |
| 1936 |
'label' => $config['style']['contact_section']['icon_color_label'], |
| 1937 |
'type' => Controls_Manager::COLOR, |
| 1938 |
'selectors' => [ |
| 1939 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-icon: {{VALUE}}', |
| 1940 |
], |
| 1941 |
] |
| 1942 |
); |
| 1943 |
} |
| 1944 |
|
| 1945 |
if ( $config['style']['contact_section']['has_typography'] ) { |
| 1946 |
$this->add_group_control( |
| 1947 |
Group_Control_Typography::get_type(), |
| 1948 |
[ |
| 1949 |
'name' => 'style_contact_typography', |
| 1950 |
'selector' => '{{WRAPPER}} .e-contact-buttons__contact-icon-link', |
| 1951 |
] |
| 1952 |
); |
| 1953 |
} |
| 1954 |
|
| 1955 |
if ( $config['style']['contact_section']['has_bg_color'] ) { |
| 1956 |
$this->add_control( |
| 1957 |
'style_contact_button_bg_color', |
| 1958 |
[ |
| 1959 |
'label' => esc_html__( 'Background Color', 'elementor' ), |
| 1960 |
'type' => Controls_Manager::COLOR, |
| 1961 |
'selectors' => [ |
| 1962 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-bg: {{VALUE}}', |
| 1963 |
], |
| 1964 |
] |
| 1965 |
); |
| 1966 |
} |
| 1967 |
|
| 1968 |
if ( $config['style']['contact_section']['has_tabs'] ) { |
| 1969 |
$this->start_controls_tabs( |
| 1970 |
'style_contact_button_color_tabs' |
| 1971 |
); |
| 1972 |
|
| 1973 |
$this->start_controls_tab( |
| 1974 |
'style_contact_button_color_tabs_normal', |
| 1975 |
[ |
| 1976 |
'label' => esc_html__( 'Normal', 'elementor' ), |
| 1977 |
] |
| 1978 |
); |
| 1979 |
|
| 1980 |
$this->add_control( |
| 1981 |
'style_contact_button_color_icon', |
| 1982 |
[ |
| 1983 |
'label' => $config['style']['contact_section']['icon_color_label'], |
| 1984 |
'type' => Controls_Manager::COLOR, |
| 1985 |
'selectors' => [ |
| 1986 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-icon: {{VALUE}}', |
| 1987 |
], |
| 1988 |
] |
| 1989 |
); |
| 1990 |
|
| 1991 |
if ( $config['style']['contact_section']['has_icon_bg_color'] ) { |
| 1992 |
$this->add_control( |
| 1993 |
'style_contact_button_color_background', |
| 1994 |
[ |
| 1995 |
'label' => esc_html__( 'Background Color', 'elementor' ), |
| 1996 |
'type' => Controls_Manager::COLOR, |
| 1997 |
'selectors' => [ |
| 1998 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-bg: {{VALUE}}', |
| 1999 |
], |
| 2000 |
] |
| 2001 |
); |
| 2002 |
} |
| 2003 |
|
| 2004 |
$this->end_controls_tab(); |
| 2005 |
|
| 2006 |
$this->start_controls_tab( |
| 2007 |
'style_contact_button_color_tabs_hover', |
| 2008 |
[ |
| 2009 |
'label' => esc_html__( 'Hover', 'elementor' ), |
| 2010 |
] |
| 2011 |
); |
| 2012 |
|
| 2013 |
$this->add_control( |
| 2014 |
'style_contact_button_color_icon_hover', |
| 2015 |
[ |
| 2016 |
'label' => esc_html__( 'Icon Color', 'elementor' ), |
| 2017 |
'type' => Controls_Manager::COLOR, |
| 2018 |
'selectors' => [ |
| 2019 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-icon-hover: {{VALUE}}', |
| 2020 |
], |
| 2021 |
] |
| 2022 |
); |
| 2023 |
|
| 2024 |
if ( $config['style']['contact_section']['has_icon_bg_color'] ) { |
| 2025 |
$this->add_control( |
| 2026 |
'style_contact_button_color_background_hover', |
| 2027 |
[ |
| 2028 |
'label' => esc_html__( 'Background Color', 'elementor' ), |
| 2029 |
'type' => Controls_Manager::COLOR, |
| 2030 |
'selectors' => [ |
| 2031 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-bg-hover: {{VALUE}}', |
| 2032 |
], |
| 2033 |
] |
| 2034 |
); |
| 2035 |
} |
| 2036 |
|
| 2037 |
if ( $config['style']['contact_section']['has_hover_animation'] ) { |
| 2038 |
$this->add_hover_animation_control( |
| 2039 |
'style_contact_button_hover_animation', |
| 2040 |
); |
| 2041 |
} |
| 2042 |
|
| 2043 |
$this->end_controls_tab(); |
| 2044 |
|
| 2045 |
$this->end_controls_tabs(); |
| 2046 |
} |
| 2047 |
|
| 2048 |
if ( $config['style']['contact_section']['has_buttons_spacing'] ) { |
| 2049 |
|
| 2050 |
$this->add_responsive_control( |
| 2051 |
'style_contact_buttons_spacing', |
| 2052 |
[ |
| 2053 |
'label' => esc_html__( 'Buttons Spacing', 'elementor' ), |
| 2054 |
'type' => Controls_Manager::SLIDER, |
| 2055 |
'range' => [ |
| 2056 |
'%' => [ |
| 2057 |
'min' => 10, |
| 2058 |
'max' => 100, |
| 2059 |
], |
| 2060 |
'px' => [ |
| 2061 |
'min' => 0, |
| 2062 |
'max' => 100, |
| 2063 |
], |
| 2064 |
], |
| 2065 |
'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], |
| 2066 |
'selectors' => [ |
| 2067 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-gap: {{SIZE}}{{UNIT}}', |
| 2068 |
], |
| 2069 |
'separator' => 'before', |
| 2070 |
] |
| 2071 |
); |
| 2072 |
} |
| 2073 |
|
| 2074 |
if ( $config['style']['contact_section']['has_button_corners'] ) { |
| 2075 |
$this->add_control( |
| 2076 |
'style_contact_corners', |
| 2077 |
[ |
| 2078 |
'label' => esc_html__( 'Corners', 'elementor' ), |
| 2079 |
'type' => Controls_Manager::SELECT, |
| 2080 |
'default' => 'round', |
| 2081 |
'options' => [ |
| 2082 |
'round' => esc_html__( 'Round', 'elementor' ), |
| 2083 |
'rounded' => esc_html__( 'Rounded', 'elementor' ), |
| 2084 |
'sharp' => esc_html__( 'Sharp', 'elementor' ), |
| 2085 |
], |
| 2086 |
] |
| 2087 |
); |
| 2088 |
} |
| 2089 |
|
| 2090 |
if ( $config['style']['contact_section']['has_box_shadow'] ) { |
| 2091 |
$this->add_group_control( |
| 2092 |
Group_Control_Box_Shadow::get_type(), |
| 2093 |
[ |
| 2094 |
'name' => 'style_contact_icons_box_shadow', |
| 2095 |
'selector' => '{{WRAPPER}} .e-contact-buttons__contact-box-shadow', |
| 2096 |
] |
| 2097 |
); |
| 2098 |
} |
| 2099 |
|
| 2100 |
if ( $config['content']['contact_section']['repeater']['has_tooltip'] ) { |
| 2101 |
$this->add_control( |
| 2102 |
'style_contact_tooltip_heading', |
| 2103 |
[ |
| 2104 |
'label' => esc_html__( 'Tooltips', 'elementor' ), |
| 2105 |
'type' => Controls_Manager::HEADING, |
| 2106 |
'separator' => 'before', |
| 2107 |
] |
| 2108 |
); |
| 2109 |
|
| 2110 |
$this->add_control( |
| 2111 |
'style_contact_tooltip_text_color', |
| 2112 |
[ |
| 2113 |
'label' => esc_html__( 'Text Color', 'elementor' ), |
| 2114 |
'type' => Controls_Manager::COLOR, |
| 2115 |
'selectors' => [ |
| 2116 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-tooltip-text: {{VALUE}}', |
| 2117 |
], |
| 2118 |
] |
| 2119 |
); |
| 2120 |
|
| 2121 |
$this->add_group_control( |
| 2122 |
Group_Control_Typography::get_type(), |
| 2123 |
[ |
| 2124 |
'name' => 'style_contact_tooltip_typography', |
| 2125 |
'selector' => '{{WRAPPER}} .e-contact-buttons__contact-tooltip', |
| 2126 |
] |
| 2127 |
); |
| 2128 |
|
| 2129 |
$this->add_control( |
| 2130 |
'style_contact_tooltip_bg_color', |
| 2131 |
[ |
| 2132 |
'label' => esc_html__( 'Background Color', 'elementor' ), |
| 2133 |
'type' => Controls_Manager::COLOR, |
| 2134 |
'selectors' => [ |
| 2135 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-tooltip-bg: {{VALUE}}', |
| 2136 |
], |
| 2137 |
] |
| 2138 |
); |
| 2139 |
} |
| 2140 |
|
| 2141 |
if ( $config['style']['contact_section']['has_chat_box_animation'] ) { |
| 2142 |
$this->chat_box_animation_controls(); |
| 2143 |
} |
| 2144 |
|
| 2145 |
if ( $config['style']['contact_section']['has_button_bar'] ) { |
| 2146 |
$this->add_control( |
| 2147 |
'style_contact_button_bar_heading', |
| 2148 |
[ |
| 2149 |
'label' => esc_html__( 'Button Bar', 'elementor' ), |
| 2150 |
'type' => Controls_Manager::HEADING, |
| 2151 |
'separator' => 'before', |
| 2152 |
] |
| 2153 |
); |
| 2154 |
|
| 2155 |
$this->add_control( |
| 2156 |
'style_contact_button_bar_bg_color', |
| 2157 |
[ |
| 2158 |
'label' => esc_html__( 'Background Color', 'elementor' ), |
| 2159 |
'type' => Controls_Manager::COLOR, |
| 2160 |
'selectors' => [ |
| 2161 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-bar-bg: {{VALUE}}', |
| 2162 |
], |
| 2163 |
] |
| 2164 |
); |
| 2165 |
|
| 2166 |
$this->add_control( |
| 2167 |
'style_contact_button_bar_corners', |
| 2168 |
[ |
| 2169 |
'label' => esc_html__( 'Corners', 'elementor' ), |
| 2170 |
'type' => Controls_Manager::SELECT, |
| 2171 |
'default' => 'round', |
| 2172 |
'options' => [ |
| 2173 |
'round' => esc_html__( 'Round', 'elementor' ), |
| 2174 |
'rounded' => esc_html__( 'Rounded', 'elementor' ), |
| 2175 |
'sharp' => esc_html__( 'Sharp', 'elementor' ), |
| 2176 |
], |
| 2177 |
] |
| 2178 |
); |
| 2179 |
|
| 2180 |
$this->add_responsive_control( |
| 2181 |
'style_contact_button_bar_padding', |
| 2182 |
[ |
| 2183 |
'label' => esc_html__( 'Padding', 'elementor' ), |
| 2184 |
'type' => Controls_Manager::DIMENSIONS, |
| 2185 |
'size_units' => [ 'px', '%', 'em', 'rem' ], |
| 2186 |
'selectors' => [ |
| 2187 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-bar-padding-block-end: {{BOTTOM}}{{UNIT}}; --e-contact-buttons-button-bar-padding-block-start: {{TOP}}{{UNIT}}; --e-contact-buttons-button-bar-padding-inline-end: {{RIGHT}}{{UNIT}}; --e-contact-buttons-button-bar-padding-inline-start: {{LEFT}}{{UNIT}};', |
| 2188 |
], |
| 2189 |
'separator' => 'before', |
| 2190 |
] |
| 2191 |
); |
| 2192 |
} |
| 2193 |
|
| 2194 |
if ( $config['style']['contact_section']['has_padding'] ) { |
| 2195 |
$this->add_responsive_control( |
| 2196 |
'style_contact_padding', |
| 2197 |
[ |
| 2198 |
'label' => esc_html__( 'Padding', 'elementor' ), |
| 2199 |
'type' => Controls_Manager::DIMENSIONS, |
| 2200 |
'size_units' => [ 'px', '%', 'em', 'rem' ], |
| 2201 |
'selectors' => [ |
| 2202 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-padding-block-end: {{BOTTOM}}{{UNIT}}; --e-contact-buttons-contact-padding-block-start: {{TOP}}{{UNIT}}; --e-contact-buttons-contact-padding-inline-end: {{RIGHT}}{{UNIT}}; --e-contact-buttons-contact-padding-inline-start: {{LEFT}}{{UNIT}};', |
| 2203 |
], |
| 2204 |
'separator' => 'before', |
| 2205 |
] |
| 2206 |
); |
| 2207 |
} |
| 2208 |
|
| 2209 |
if ( $config['style']['contact_section']['has_hover_transition_duration'] ) { |
| 2210 |
$this->add_control( |
| 2211 |
'style_contact_custom_animation_heading', |
| 2212 |
[ |
| 2213 |
'label' => esc_html__( 'Animation', 'elementor' ), |
| 2214 |
'type' => Controls_Manager::HEADING, |
| 2215 |
] |
| 2216 |
); |
| 2217 |
|
| 2218 |
$this->add_control( |
| 2219 |
'style_contact_custom_animation_alert', |
| 2220 |
[ |
| 2221 |
'type' => Controls_Manager::ALERT, |
| 2222 |
'alert_type' => 'info', |
| 2223 |
'content' => __( 'Adjust transition duration to change the speed of the <b>hover animation on desktop</b> and the <b>click animation on touchscreen</b>.', 'elementor' ), |
| 2224 |
] |
| 2225 |
); |
| 2226 |
|
| 2227 |
$this->add_control( |
| 2228 |
'style_contact_custom_animation_transition', |
| 2229 |
[ |
| 2230 |
'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)', |
| 2231 |
'type' => Controls_Manager::SLIDER, |
| 2232 |
'range' => [ |
| 2233 |
's' => [ |
| 2234 |
'min' => 0, |
| 2235 |
'max' => 3, |
| 2236 |
'step' => 0.1, |
| 2237 |
], |
| 2238 |
], |
| 2239 |
'selectors' => [ |
| 2240 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-transition-duration: {{SIZE}}{{UNIT}}', |
| 2241 |
], |
| 2242 |
] |
| 2243 |
); |
| 2244 |
} |
| 2245 |
|
| 2246 |
$this->end_controls_section(); |
| 2247 |
} |
| 2248 |
|
| 2249 |
protected function add_style_resource_links_section(): void { |
| 2250 |
$this->start_controls_section( |
| 2251 |
'style_resource_links_section', |
| 2252 |
[ |
| 2253 |
'label' => esc_html__( 'Resource Links', 'elementor' ), |
| 2254 |
'tab' => Controls_Manager::TAB_STYLE, |
| 2255 |
] |
| 2256 |
); |
| 2257 |
|
| 2258 |
$this->add_control( |
| 2259 |
'style_resource_links_icons_heading', |
| 2260 |
[ |
| 2261 |
'label' => esc_html__( 'Icons', 'elementor' ), |
| 2262 |
'type' => Controls_Manager::HEADING, |
| 2263 |
'separator' => false, |
| 2264 |
] |
| 2265 |
); |
| 2266 |
|
| 2267 |
$this->add_control( |
| 2268 |
'style_resource_links_button_size', |
| 2269 |
[ |
| 2270 |
'label' => esc_html__( 'Size', 'elementor' ), |
| 2271 |
'type' => Controls_Manager::SELECT, |
| 2272 |
'default' => 'small', |
| 2273 |
'options' => [ |
| 2274 |
'small' => esc_html__( 'Small', 'elementor' ), |
| 2275 |
'medium' => esc_html__( 'Medium', 'elementor' ), |
| 2276 |
'large' => esc_html__( 'Large', 'elementor' ), |
| 2277 |
], |
| 2278 |
] |
| 2279 |
); |
| 2280 |
|
| 2281 |
$this->add_control( |
| 2282 |
'style_resource_links_color_select', |
| 2283 |
[ |
| 2284 |
'label' => esc_html__( 'Color', 'elementor' ), |
| 2285 |
'type' => Controls_Manager::SELECT, |
| 2286 |
'default' => 'custom', |
| 2287 |
'options' => [ |
| 2288 |
'default' => esc_html__( 'Default', 'elementor' ), |
| 2289 |
'custom' => esc_html__( 'Custom', 'elementor' ), |
| 2290 |
], |
| 2291 |
] |
| 2292 |
); |
| 2293 |
|
| 2294 |
$this->add_control( |
| 2295 |
'style_contact_icon_color', |
| 2296 |
[ |
| 2297 |
'label' => esc_html__( 'Color', 'elementor' ), |
| 2298 |
'type' => Controls_Manager::COLOR, |
| 2299 |
'selectors' => [ |
| 2300 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-icon: {{VALUE}}', |
| 2301 |
], |
| 2302 |
'condition' => [ |
| 2303 |
'style_resource_links_color_select' => 'custom', |
| 2304 |
], |
| 2305 |
] |
| 2306 |
); |
| 2307 |
|
| 2308 |
$this->add_control( |
| 2309 |
'style_resource_links_title_heading', |
| 2310 |
[ |
| 2311 |
'label' => esc_html__( 'Title', 'elementor' ), |
| 2312 |
'type' => Controls_Manager::HEADING, |
| 2313 |
'separator' => false, |
| 2314 |
] |
| 2315 |
); |
| 2316 |
|
| 2317 |
$this->add_control( |
| 2318 |
'style_resource_links_title_color', |
| 2319 |
[ |
| 2320 |
'label' => esc_html__( 'Text Color', 'elementor' ), |
| 2321 |
'type' => Controls_Manager::COLOR, |
| 2322 |
'selectors' => [ |
| 2323 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-title-text-color: {{VALUE}}', |
| 2324 |
], |
| 2325 |
] |
| 2326 |
); |
| 2327 |
|
| 2328 |
$this->add_group_control( |
| 2329 |
Group_Control_Typography::get_type(), |
| 2330 |
[ |
| 2331 |
'name' => 'style_resource_links_title_typography', |
| 2332 |
'selector' => '{{WRAPPER}} .e-contact-buttons__contact-title', |
| 2333 |
] |
| 2334 |
); |
| 2335 |
|
| 2336 |
$this->add_control( |
| 2337 |
'style_resource_links_description_heading', |
| 2338 |
[ |
| 2339 |
'label' => esc_html__( 'Description', 'elementor' ), |
| 2340 |
'type' => Controls_Manager::HEADING, |
| 2341 |
'separator' => false, |
| 2342 |
] |
| 2343 |
); |
| 2344 |
|
| 2345 |
$this->add_control( |
| 2346 |
'style_resource_links_description_color', |
| 2347 |
[ |
| 2348 |
'label' => esc_html__( 'Text Color', 'elementor' ), |
| 2349 |
'type' => Controls_Manager::COLOR, |
| 2350 |
'selectors' => [ |
| 2351 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-description-text-color: {{VALUE}}', |
| 2352 |
], |
| 2353 |
] |
| 2354 |
); |
| 2355 |
|
| 2356 |
$this->add_group_control( |
| 2357 |
Group_Control_Typography::get_type(), |
| 2358 |
[ |
| 2359 |
'name' => 'style_resource_links_description_typography', |
| 2360 |
'selector' => '{{WRAPPER}} .e-contact-buttons__contact-description', |
| 2361 |
] |
| 2362 |
); |
| 2363 |
|
| 2364 |
$this->add_control( |
| 2365 |
'style_resource_links_bg_color', |
| 2366 |
[ |
| 2367 |
'label' => esc_html__( 'Background Color', 'elementor' ), |
| 2368 |
'type' => Controls_Manager::COLOR, |
| 2369 |
'selectors' => [ |
| 2370 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-bg: {{VALUE}}', |
| 2371 |
], |
| 2372 |
'separator' => 'before', |
| 2373 |
] |
| 2374 |
); |
| 2375 |
|
| 2376 |
$this->add_hover_animation_control( |
| 2377 |
'style_resource_links_hover_animation', |
| 2378 |
); |
| 2379 |
|
| 2380 |
$this->end_controls_section(); |
| 2381 |
} |
| 2382 |
|
| 2383 |
protected function add_style_info_links_section(): void { |
| 2384 |
$this->start_controls_section( |
| 2385 |
'style_info_links_section', |
| 2386 |
[ |
| 2387 |
'label' => esc_html__( 'Info Links', 'elementor' ), |
| 2388 |
'tab' => Controls_Manager::TAB_STYLE, |
| 2389 |
] |
| 2390 |
); |
| 2391 |
|
| 2392 |
$this->add_control( |
| 2393 |
'style_info_links_icon_position', |
| 2394 |
[ |
| 2395 |
'label' => esc_html__( 'Icon Position', 'elementor' ), |
| 2396 |
'type' => Controls_Manager::CHOOSE, |
| 2397 |
'options' => [ |
| 2398 |
'start' => [ |
| 2399 |
'title' => esc_html__( 'Left', 'elementor' ), |
| 2400 |
'icon' => 'eicon-h-align-left', |
| 2401 |
], |
| 2402 |
'end' => [ |
| 2403 |
'title' => esc_html__( 'Right', 'elementor' ), |
| 2404 |
'icon' => 'eicon-h-align-right', |
| 2405 |
], |
| 2406 |
], |
| 2407 |
'default' => 'start', |
| 2408 |
'toggle' => true, |
| 2409 |
] |
| 2410 |
); |
| 2411 |
|
| 2412 |
$this->add_control( |
| 2413 |
'style_info_links_icon_spacing', |
| 2414 |
[ |
| 2415 |
'label' => esc_html__( 'Icon Spacing', 'elementor' ), |
| 2416 |
'type' => Controls_Manager::SLIDER, |
| 2417 |
'range' => [ |
| 2418 |
'%' => [ |
| 2419 |
'min' => 10, |
| 2420 |
'max' => 100, |
| 2421 |
], |
| 2422 |
'px' => [ |
| 2423 |
'min' => 0, |
| 2424 |
'max' => 20, |
| 2425 |
], |
| 2426 |
], |
| 2427 |
'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], |
| 2428 |
'selectors' => [ |
| 2429 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-gap: {{SIZE}}{{UNIT}}', |
| 2430 |
], |
| 2431 |
] |
| 2432 |
); |
| 2433 |
|
| 2434 |
$this->add_responsive_control( |
| 2435 |
'style_info_links_link_spacing', |
| 2436 |
[ |
| 2437 |
'label' => esc_html__( 'Link Spacing', 'elementor' ), |
| 2438 |
'type' => Controls_Manager::SLIDER, |
| 2439 |
'range' => [ |
| 2440 |
'%' => [ |
| 2441 |
'min' => 10, |
| 2442 |
'max' => 100, |
| 2443 |
], |
| 2444 |
'px' => [ |
| 2445 |
'min' => 0, |
| 2446 |
'max' => 10, |
| 2447 |
], |
| 2448 |
], |
| 2449 |
'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], |
| 2450 |
'selectors' => [ |
| 2451 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-spacing: {{SIZE}}{{UNIT}}', |
| 2452 |
], |
| 2453 |
] |
| 2454 |
); |
| 2455 |
|
| 2456 |
$this->add_group_control( |
| 2457 |
Group_Control_Typography::get_type(), |
| 2458 |
[ |
| 2459 |
'name' => 'style_info_links_typography', |
| 2460 |
'selector' => '{{WRAPPER}} .e-contact-buttons__contact-icon-link', |
| 2461 |
] |
| 2462 |
); |
| 2463 |
|
| 2464 |
$this->start_controls_tabs( |
| 2465 |
'style_info_links_tabs' |
| 2466 |
); |
| 2467 |
|
| 2468 |
$this->start_controls_tab( |
| 2469 |
'style_info_links_tabs_normal', |
| 2470 |
[ |
| 2471 |
'label' => esc_html__( 'Normal', 'elementor' ), |
| 2472 |
] |
| 2473 |
); |
| 2474 |
|
| 2475 |
$this->add_control( |
| 2476 |
'style_info_links_normal_text_color', |
| 2477 |
[ |
| 2478 |
'label' => esc_html__( 'Text and Icon Color', 'elementor' ), |
| 2479 |
'type' => Controls_Manager::COLOR, |
| 2480 |
'selectors' => [ |
| 2481 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-text-color: {{VALUE}}', |
| 2482 |
], |
| 2483 |
] |
| 2484 |
); |
| 2485 |
|
| 2486 |
$this->end_controls_tab(); |
| 2487 |
|
| 2488 |
$this->start_controls_tab( |
| 2489 |
'style_info_links_tabs_hover', |
| 2490 |
[ |
| 2491 |
'label' => esc_html__( 'Hover', 'elementor' ), |
| 2492 |
] |
| 2493 |
); |
| 2494 |
|
| 2495 |
$this->add_control( |
| 2496 |
'style_info_links_hover_text_color', |
| 2497 |
[ |
| 2498 |
'label' => esc_html__( 'Text and Icon Color', 'elementor' ), |
| 2499 |
'type' => Controls_Manager::COLOR, |
| 2500 |
'selectors' => [ |
| 2501 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-text-color-hover: {{VALUE}}', |
| 2502 |
], |
| 2503 |
] |
| 2504 |
); |
| 2505 |
|
| 2506 |
$this->add_control( |
| 2507 |
'style_info_links_hover_animation', |
| 2508 |
[ |
| 2509 |
'label' => esc_html__( 'Hover Animation', 'elementor' ), |
| 2510 |
'type' => Controls_Manager::HOVER_ANIMATION, |
| 2511 |
'frontend_available' => true, |
| 2512 |
] |
| 2513 |
); |
| 2514 |
|
| 2515 |
$this->end_controls_tab(); |
| 2516 |
|
| 2517 |
$this->end_controls_tabs(); |
| 2518 |
|
| 2519 |
$this->add_control( |
| 2520 |
'style_info_links_dividers', |
| 2521 |
[ |
| 2522 |
'label' => esc_html__( 'Dividers', 'elementor' ), |
| 2523 |
'type' => Controls_Manager::SWITCHER, |
| 2524 |
'label_on' => esc_html__( 'Show', 'elementor' ), |
| 2525 |
'label_off' => esc_html__( 'Hide', 'elementor' ), |
| 2526 |
'return_value' => 'yes', |
| 2527 |
'default' => 'yes', |
| 2528 |
'separator' => 'before', |
| 2529 |
] |
| 2530 |
); |
| 2531 |
|
| 2532 |
$this->add_control( |
| 2533 |
'style_info_links_divider_color', |
| 2534 |
[ |
| 2535 |
'label' => esc_html__( 'Color', 'elementor' ), |
| 2536 |
'type' => Controls_Manager::COLOR, |
| 2537 |
'selectors' => [ |
| 2538 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-divider-color: {{VALUE}}', |
| 2539 |
], |
| 2540 |
'condition' => [ |
| 2541 |
'style_info_links_dividers' => 'yes', |
| 2542 |
], |
| 2543 |
] |
| 2544 |
); |
| 2545 |
|
| 2546 |
$this->add_responsive_control( |
| 2547 |
'style_info_links_divider_weight', |
| 2548 |
[ |
| 2549 |
'label' => esc_html__( 'Weight', 'elementor' ), |
| 2550 |
'type' => Controls_Manager::SLIDER, |
| 2551 |
'range' => [ |
| 2552 |
'%' => [ |
| 2553 |
'min' => 10, |
| 2554 |
'max' => 100, |
| 2555 |
], |
| 2556 |
'px' => [ |
| 2557 |
'min' => 1, |
| 2558 |
'max' => 10, |
| 2559 |
], |
| 2560 |
], |
| 2561 |
'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], |
| 2562 |
'selectors' => [ |
| 2563 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-divider-weight: {{SIZE}}{{UNIT}}', |
| 2564 |
], |
| 2565 |
'condition' => [ |
| 2566 |
'style_info_links_dividers' => 'yes', |
| 2567 |
], |
| 2568 |
] |
| 2569 |
); |
| 2570 |
|
| 2571 |
$this->end_controls_section(); |
| 2572 |
} |
| 2573 |
|
| 2574 |
protected function add_style_send_button_section(): void { |
| 2575 |
$config = static::get_configuration(); |
| 2576 |
|
| 2577 |
$this->start_controls_section( |
| 2578 |
'style_send_section', |
| 2579 |
[ |
| 2580 |
'label' => $config['content']['send_button_section']['section_name'], |
| 2581 |
'tab' => Controls_Manager::TAB_STYLE, |
| 2582 |
] |
| 2583 |
); |
| 2584 |
|
| 2585 |
if ( $config['style']['send_button_section']['has_typography'] ) { |
| 2586 |
$this->add_group_control( |
| 2587 |
Group_Control_Typography::get_type(), |
| 2588 |
[ |
| 2589 |
'name' => 'style_send_typography', |
| 2590 |
'selector' => $config['style']['send_button_section']['typography_selector'], |
| 2591 |
] |
| 2592 |
); |
| 2593 |
} |
| 2594 |
|
| 2595 |
$this->start_controls_tabs( |
| 2596 |
'style_send_tabs' |
| 2597 |
); |
| 2598 |
|
| 2599 |
$this->start_controls_tab( |
| 2600 |
'style_send_tabs_normal', |
| 2601 |
[ |
| 2602 |
'label' => esc_html__( 'Normal', 'elementor' ), |
| 2603 |
] |
| 2604 |
); |
| 2605 |
|
| 2606 |
if ( $config['style']['send_button_section']['has_platform_colors'] ) { |
| 2607 |
$this->add_control( |
| 2608 |
'style_send_normal_colors', |
| 2609 |
[ |
| 2610 |
'label' => esc_html__( 'Colors', 'elementor' ), |
| 2611 |
'type' => Controls_Manager::SELECT, |
| 2612 |
'default' => 'default', |
| 2613 |
'options' => [ |
| 2614 |
'default' => esc_html__( 'Default', 'elementor' ), |
| 2615 |
'custom' => esc_html__( 'Custom', 'elementor' ), |
| 2616 |
], |
| 2617 |
] |
| 2618 |
); |
| 2619 |
} |
| 2620 |
|
| 2621 |
if ( $config['style']['send_button_section']['has_icon_color'] ) { |
| 2622 |
$this->add_control( |
| 2623 |
'style_send_normal_icon_color', |
| 2624 |
[ |
| 2625 |
'label' => esc_html__( 'Icon Color', 'elementor' ), |
| 2626 |
'type' => Controls_Manager::COLOR, |
| 2627 |
'selectors' => [ |
| 2628 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-icon: {{VALUE}}', |
| 2629 |
], |
| 2630 |
'condition' => [ |
| 2631 |
'style_send_normal_colors' => 'custom', |
| 2632 |
], |
| 2633 |
] |
| 2634 |
); |
| 2635 |
} |
| 2636 |
|
| 2637 |
if ( $config['style']['send_button_section']['has_text_color'] ) { |
| 2638 |
$this->add_control( |
| 2639 |
'style_send_normal_text_color', |
| 2640 |
[ |
| 2641 |
'label' => esc_html__( 'Text Color', 'elementor' ), |
| 2642 |
'type' => Controls_Manager::COLOR, |
| 2643 |
'selectors' => [ |
| 2644 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-text: {{VALUE}}', |
| 2645 |
], |
| 2646 |
] |
| 2647 |
); |
| 2648 |
} |
| 2649 |
|
| 2650 |
if ( $config['style']['send_button_section']['has_background_color'] ) { |
| 2651 |
$this->add_control( |
| 2652 |
'style_send_normal_background_color', |
| 2653 |
[ |
| 2654 |
'label' => esc_html__( 'Background Color', 'elementor' ), |
| 2655 |
'type' => Controls_Manager::COLOR, |
| 2656 |
'selectors' => [ |
| 2657 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-bg: {{VALUE}}', |
| 2658 |
], |
| 2659 |
'condition' => $this->get_platform_color_condition( [ |
| 2660 |
'style_send_normal_colors' => 'custom', |
| 2661 |
] ), |
| 2662 |
] |
| 2663 |
); |
| 2664 |
} |
| 2665 |
|
| 2666 |
$this->end_controls_tab(); |
| 2667 |
|
| 2668 |
$this->start_controls_tab( |
| 2669 |
'style_send_tabs_hover', |
| 2670 |
[ |
| 2671 |
'label' => esc_html__( 'Hover', 'elementor' ), |
| 2672 |
] |
| 2673 |
); |
| 2674 |
|
| 2675 |
if ( $config['style']['send_button_section']['has_platform_colors'] ) { |
| 2676 |
$this->add_control( |
| 2677 |
'style_send_hover_colors', |
| 2678 |
[ |
| 2679 |
'label' => esc_html__( 'Colors', 'elementor' ), |
| 2680 |
'type' => Controls_Manager::SELECT, |
| 2681 |
'default' => 'default', |
| 2682 |
'options' => [ |
| 2683 |
'default' => esc_html__( 'Default', 'elementor' ), |
| 2684 |
'custom' => esc_html__( 'Custom', 'elementor' ), |
| 2685 |
], |
| 2686 |
] |
| 2687 |
); |
| 2688 |
} |
| 2689 |
|
| 2690 |
if ( $config['style']['send_button_section']['has_icon_color'] ) { |
| 2691 |
$this->add_control( |
| 2692 |
'style_send_hover_icon_color', |
| 2693 |
[ |
| 2694 |
'label' => esc_html__( 'Icon Color', 'elementor' ), |
| 2695 |
'type' => Controls_Manager::COLOR, |
| 2696 |
'selectors' => [ |
| 2697 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-icon-hover: {{VALUE}}', |
| 2698 |
], |
| 2699 |
'condition' => [ |
| 2700 |
'style_send_hover_colors' => 'custom', |
| 2701 |
], |
| 2702 |
] |
| 2703 |
); |
| 2704 |
} |
| 2705 |
|
| 2706 |
if ( $config['style']['send_button_section']['has_text_color'] ) { |
| 2707 |
$this->add_control( |
| 2708 |
'style_send_hover_text_color', |
| 2709 |
[ |
| 2710 |
'label' => esc_html__( 'Text Color', 'elementor' ), |
| 2711 |
'type' => Controls_Manager::COLOR, |
| 2712 |
'selectors' => [ |
| 2713 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-text-hover: {{VALUE}}', |
| 2714 |
], |
| 2715 |
] |
| 2716 |
); |
| 2717 |
} |
| 2718 |
|
| 2719 |
if ( $config['style']['send_button_section']['has_background_color'] ) { |
| 2720 |
$this->add_control( |
| 2721 |
'style_send_hover_background_color', |
| 2722 |
[ |
| 2723 |
'label' => esc_html__( 'Background Color', 'elementor' ), |
| 2724 |
'type' => Controls_Manager::COLOR, |
| 2725 |
'selectors' => [ |
| 2726 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-bg-hover: {{VALUE}}', |
| 2727 |
], |
| 2728 |
'condition' => $this->get_platform_color_condition( [ |
| 2729 |
'style_send_hover_colors' => 'custom', |
| 2730 |
] ), |
| 2731 |
] |
| 2732 |
); |
| 2733 |
} |
| 2734 |
|
| 2735 |
$this->add_hover_animation_control( |
| 2736 |
'style_send_hover_animation', |
| 2737 |
); |
| 2738 |
|
| 2739 |
$this->end_controls_tab(); |
| 2740 |
|
| 2741 |
$this->end_controls_tabs(); |
| 2742 |
|
| 2743 |
$this->add_responsive_control( |
| 2744 |
'style_chat_button_padding', |
| 2745 |
[ |
| 2746 |
'label' => esc_html__( 'Padding', 'elementor' ), |
| 2747 |
'type' => Controls_Manager::DIMENSIONS, |
| 2748 |
'size_units' => [ 'px', '%', 'em', 'rem' ], |
| 2749 |
'selectors' => [ |
| 2750 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-padding-block-end: {{BOTTOM}}{{UNIT}}; --e-contact-buttons-send-button-padding-block-start: {{TOP}}{{UNIT}}; --e-contact-buttons-send-button-padding-inline-end: {{RIGHT}}{{UNIT}}; --e-contact-buttons-send-button-padding-inline-start: {{LEFT}}{{UNIT}};', |
| 2751 |
], |
| 2752 |
'separator' => 'before', |
| 2753 |
] |
| 2754 |
); |
| 2755 |
|
| 2756 |
$this->end_controls_section(); |
| 2757 |
} |
| 2758 |
|
| 2759 |
protected function chat_box_animation_controls(): void { |
| 2760 |
$this->add_responsive_control( |
| 2761 |
'style_chat_box_entrance_animation', |
| 2762 |
[ |
| 2763 |
'label' => esc_html__( 'Open Animation', 'elementor' ), |
| 2764 |
'type' => Controls_Manager::ANIMATION, |
| 2765 |
'frontend_available' => true, |
| 2766 |
'separator' => 'before', |
| 2767 |
] |
| 2768 |
); |
| 2769 |
|
| 2770 |
$this->add_responsive_control( |
| 2771 |
'style_chat_box_exit_animation', |
| 2772 |
[ |
| 2773 |
'label' => esc_html__( 'Close Animation', 'elementor' ), |
| 2774 |
'type' => Controls_Manager::EXIT_ANIMATION, |
| 2775 |
'frontend_available' => true, |
| 2776 |
] |
| 2777 |
); |
| 2778 |
|
| 2779 |
$this->add_control( |
| 2780 |
'style_chat_box_animation_duration', |
| 2781 |
[ |
| 2782 |
'label' => esc_html__( 'Animation Duration', 'elementor' ), |
| 2783 |
'type' => Controls_Manager::SELECT, |
| 2784 |
'default' => 'normal', |
| 2785 |
'options' => [ |
| 2786 |
'slow' => esc_html__( 'Slow', 'elementor' ), |
| 2787 |
'normal' => esc_html__( 'Normal', 'elementor' ), |
| 2788 |
'fast' => esc_html__( 'Fast', 'elementor' ), |
| 2789 |
], |
| 2790 |
'prefix_class' => 'animated-', |
| 2791 |
] |
| 2792 |
); |
| 2793 |
} |
| 2794 |
|
| 2795 |
protected function add_style_chat_box_section(): void { |
| 2796 |
$config = static::get_configuration(); |
| 2797 |
|
| 2798 |
$this->start_controls_section( |
| 2799 |
'style_chat_box_section', |
| 2800 |
[ |
| 2801 |
'label' => $config['style']['chat_box_section']['section_name'], |
| 2802 |
'tab' => Controls_Manager::TAB_STYLE, |
| 2803 |
] |
| 2804 |
); |
| 2805 |
|
| 2806 |
if ( $config['style']['has_platform_colors'] ) { |
| 2807 |
$this->add_control( |
| 2808 |
'style_chat_box_bg_select', |
| 2809 |
[ |
| 2810 |
'label' => esc_html__( 'Background Color', 'elementor' ), |
| 2811 |
'type' => Controls_Manager::SELECT, |
| 2812 |
'default' => 'default', |
| 2813 |
'options' => [ |
| 2814 |
'default' => esc_html__( 'Default', 'elementor' ), |
| 2815 |
'custom' => esc_html__( 'Custom', 'elementor' ), |
| 2816 |
], |
| 2817 |
] |
| 2818 |
); |
| 2819 |
} |
| 2820 |
|
| 2821 |
$this->add_control( |
| 2822 |
'style_chat_box_bg_color', |
| 2823 |
[ |
| 2824 |
'label' => esc_html__( 'Background Color', 'elementor' ), |
| 2825 |
'type' => Controls_Manager::COLOR, |
| 2826 |
'selectors' => [ |
| 2827 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-chat-box-bg: {{VALUE}}', |
| 2828 |
], |
| 2829 |
'condition' => $this->get_platform_color_condition( [ |
| 2830 |
'style_chat_box_bg_select' => 'custom', |
| 2831 |
] ), |
| 2832 |
] |
| 2833 |
); |
| 2834 |
|
| 2835 |
if ( $config['style']['chat_box_section']['has_width'] ) { |
| 2836 |
$this->add_responsive_control( |
| 2837 |
'style_chat_box_width', |
| 2838 |
[ |
| 2839 |
'label' => esc_html__( 'Width', 'elementor' ), |
| 2840 |
'type' => Controls_Manager::SLIDER, |
| 2841 |
'range' => [ |
| 2842 |
'%' => [ |
| 2843 |
'min' => 10, |
| 2844 |
'max' => 100, |
| 2845 |
], |
| 2846 |
'px' => [ |
| 2847 |
'min' => 0, |
| 2848 |
'max' => 400, |
| 2849 |
], |
| 2850 |
], |
| 2851 |
'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], |
| 2852 |
'selectors' => [ |
| 2853 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-chat-box-width: {{SIZE}}{{UNIT}}', |
| 2854 |
], |
| 2855 |
] |
| 2856 |
); |
| 2857 |
} |
| 2858 |
|
| 2859 |
$this->add_control( |
| 2860 |
'style_chat_box_corners', |
| 2861 |
[ |
| 2862 |
'label' => esc_html__( 'Corners', 'elementor' ), |
| 2863 |
'type' => Controls_Manager::SELECT, |
| 2864 |
'default' => 'rounded', |
| 2865 |
'options' => [ |
| 2866 |
'round' => esc_html__( 'Round', 'elementor' ), |
| 2867 |
'rounded' => esc_html__( 'Rounded', 'elementor' ), |
| 2868 |
'sharp' => esc_html__( 'Sharp', 'elementor' ), |
| 2869 |
], |
| 2870 |
'separator' => 'before', |
| 2871 |
] |
| 2872 |
); |
| 2873 |
|
| 2874 |
$this->add_group_control( |
| 2875 |
Group_Control_Box_Shadow::get_type(), |
| 2876 |
[ |
| 2877 |
'name' => 'style_chat_box_box_shadow', |
| 2878 |
'selector' => '{{WRAPPER}} .e-contact-buttons__content', |
| 2879 |
] |
| 2880 |
); |
| 2881 |
|
| 2882 |
if ( $config['style']['chat_box_section']['has_padding'] ) { |
| 2883 |
$this->add_responsive_control( |
| 2884 |
'style_chat_box_padding', |
| 2885 |
[ |
| 2886 |
'label' => esc_html__( 'Padding', 'elementor' ), |
| 2887 |
'type' => Controls_Manager::DIMENSIONS, |
| 2888 |
'size_units' => [ 'px', '%', 'em', 'rem' ], |
| 2889 |
'selectors' => [ |
| 2890 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-chat-box-padding-block-end: {{BOTTOM}}{{UNIT}}; --e-contact-buttons-chat-box-padding-block-start: {{TOP}}{{UNIT}}; --e-contact-buttons-chat-box-padding-inline-end: {{RIGHT}}{{UNIT}}; --e-contact-buttons-chat-box-padding-inline-start: {{LEFT}}{{UNIT}};', |
| 2891 |
], |
| 2892 |
] |
| 2893 |
); |
| 2894 |
} |
| 2895 |
|
| 2896 |
$this->chat_box_animation_controls(); |
| 2897 |
|
| 2898 |
$this->end_controls_section(); |
| 2899 |
} |
| 2900 |
|
| 2901 |
protected function add_style_tab(): void { |
| 2902 |
$this->add_style_chat_button_section(); |
| 2903 |
|
| 2904 |
$this->add_style_top_bar_section(); |
| 2905 |
|
| 2906 |
$this->add_style_message_bubble_section(); |
| 2907 |
|
| 2908 |
$this->add_style_send_button_section(); |
| 2909 |
|
| 2910 |
$this->add_style_chat_box_section(); |
| 2911 |
} |
| 2912 |
|
| 2913 |
private function add_advanced_tab(): void { |
| 2914 |
$config = static::get_configuration(); |
| 2915 |
|
| 2916 |
Controls_Manager::add_tab( |
| 2917 |
static::TAB_ADVANCED, |
| 2918 |
esc_html__( 'Advanced', 'elementor' ) |
| 2919 |
); |
| 2920 |
|
| 2921 |
if ( $config['advanced']['has_layout_position'] ) { |
| 2922 |
$this->start_controls_section( |
| 2923 |
'advanced_layout_section', |
| 2924 |
[ |
| 2925 |
'label' => esc_html__( 'Layout', 'elementor' ), |
| 2926 |
'tab' => static::TAB_ADVANCED, |
| 2927 |
] |
| 2928 |
); |
| 2929 |
|
| 2930 |
$this->add_control( |
| 2931 |
'advanced_horizontal_position', |
| 2932 |
[ |
| 2933 |
'label' => esc_html__( 'Horizontal Position', 'elementor' ), |
| 2934 |
'type' => Controls_Manager::CHOOSE, |
| 2935 |
'options' => [ |
| 2936 |
'start' => [ |
| 2937 |
'title' => esc_html__( 'Left', 'elementor' ), |
| 2938 |
'icon' => 'eicon-h-align-left', |
| 2939 |
], |
| 2940 |
'center' => [ |
| 2941 |
'title' => esc_html__( 'Center', 'elementor' ), |
| 2942 |
'icon' => 'eicon-h-align-center', |
| 2943 |
], |
| 2944 |
'end' => [ |
| 2945 |
'title' => esc_html__( 'Right', 'elementor' ), |
| 2946 |
'icon' => 'eicon-h-align-right', |
| 2947 |
], |
| 2948 |
], |
| 2949 |
'default' => $config['advanced']['horizontal_position_default'], |
| 2950 |
'toggle' => false, |
| 2951 |
] |
| 2952 |
); |
| 2953 |
|
| 2954 |
if ( $config['advanced']['has_horizontal_offset'] ) { |
| 2955 |
$this->add_responsive_control( |
| 2956 |
'advanced_horizontal_offset', |
| 2957 |
[ |
| 2958 |
'label' => esc_html__( 'Offset', 'elementor' ), |
| 2959 |
'type' => Controls_Manager::SLIDER, |
| 2960 |
'range' => [ |
| 2961 |
'%' => [ |
| 2962 |
'min' => 10, |
| 2963 |
'max' => 100, |
| 2964 |
], |
| 2965 |
'px' => [ |
| 2966 |
'min' => 0, |
| 2967 |
'max' => 100, |
| 2968 |
], |
| 2969 |
], |
| 2970 |
'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], |
| 2971 |
'selectors' => [ |
| 2972 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-horizontal-offset: {{SIZE}}{{UNIT}}', |
| 2973 |
], |
| 2974 |
'condition' => [ |
| 2975 |
'advanced_horizontal_position' => [ |
| 2976 |
'start', |
| 2977 |
'end', |
| 2978 |
], |
| 2979 |
], |
| 2980 |
] |
| 2981 |
); |
| 2982 |
} |
| 2983 |
|
| 2984 |
$this->add_control( |
| 2985 |
'advanced_vertical_position', |
| 2986 |
[ |
| 2987 |
'label' => esc_html__( 'Vertical Position', 'elementor' ), |
| 2988 |
'type' => Controls_Manager::CHOOSE, |
| 2989 |
'options' => [ |
| 2990 |
'top' => [ |
| 2991 |
'title' => esc_html__( 'Top', 'elementor' ), |
| 2992 |
'icon' => 'eicon-v-align-top', |
| 2993 |
], |
| 2994 |
'middle' => [ |
| 2995 |
'title' => esc_html__( 'Middle', 'elementor' ), |
| 2996 |
'icon' => 'eicon-v-align-middle', |
| 2997 |
], |
| 2998 |
'bottom' => [ |
| 2999 |
'title' => esc_html__( 'Bottom', 'elementor' ), |
| 3000 |
'icon' => 'eicon-v-align-bottom', |
| 3001 |
], |
| 3002 |
], |
| 3003 |
'default' => 'bottom', |
| 3004 |
'toggle' => false, |
| 3005 |
] |
| 3006 |
); |
| 3007 |
|
| 3008 |
if ( $config['advanced']['has_vertical_offset'] ) { |
| 3009 |
$this->add_responsive_control( |
| 3010 |
'advanced_vertical_offset', |
| 3011 |
[ |
| 3012 |
'label' => esc_html__( 'Offset', 'elementor' ), |
| 3013 |
'type' => Controls_Manager::SLIDER, |
| 3014 |
'range' => [ |
| 3015 |
'%' => [ |
| 3016 |
'min' => 10, |
| 3017 |
'max' => 100, |
| 3018 |
], |
| 3019 |
'px' => [ |
| 3020 |
'min' => 0, |
| 3021 |
'max' => 100, |
| 3022 |
], |
| 3023 |
], |
| 3024 |
'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], |
| 3025 |
'selectors' => [ |
| 3026 |
'{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-vertical-offset: {{SIZE}}{{UNIT}}', |
| 3027 |
], |
| 3028 |
'condition' => [ |
| 3029 |
'advanced_vertical_position' => [ |
| 3030 |
'top', |
| 3031 |
'bottom', |
| 3032 |
], |
| 3033 |
], |
| 3034 |
] |
| 3035 |
); |
| 3036 |
} |
| 3037 |
|
| 3038 |
if ( $config['advanced']['has_mobile_full_width'] ) { |
| 3039 |
$this->add_control( |
| 3040 |
'advanced_mobile_full_width', |
| 3041 |
[ |
| 3042 |
'label' => esc_html__( 'Full Width on Mobile', 'elementor' ), |
| 3043 |
'type' => Controls_Manager::SWITCHER, |
| 3044 |
'label_on' => esc_html__( 'Yes', 'elementor' ), |
| 3045 |
'label_off' => esc_html__( 'No', 'elementor' ), |
| 3046 |
'return_value' => 'yes', |
| 3047 |
'default' => 'yes', |
| 3048 |
] |
| 3049 |
); |
| 3050 |
} |
| 3051 |
|
| 3052 |
$this->end_controls_section(); |
| 3053 |
} |
| 3054 |
|
| 3055 |
$this->start_controls_section( |
| 3056 |
'advanced_responsive_section', |
| 3057 |
[ |
| 3058 |
'label' => esc_html__( 'Responsive', 'elementor' ), |
| 3059 |
'tab' => static::TAB_ADVANCED, |
| 3060 |
] |
| 3061 |
); |
| 3062 |
|
| 3063 |
$this->add_control( |
| 3064 |
'responsive_description', |
| 3065 |
[ |
| 3066 |
'raw' => __( 'Responsive visibility will take effect only on preview mode or live page, and not while editing in Elementor.', 'elementor' ), |
| 3067 |
'type' => Controls_Manager::RAW_HTML, |
| 3068 |
'content_classes' => 'elementor-descriptor', |
| 3069 |
] |
| 3070 |
); |
| 3071 |
|
| 3072 |
$this->add_hidden_device_controls(); |
| 3073 |
|
| 3074 |
$this->end_controls_section(); |
| 3075 |
|
| 3076 |
$this->start_controls_section( |
| 3077 |
'advanced_custom_controls_section', |
| 3078 |
[ |
| 3079 |
'label' => esc_html__( 'CSS', 'elementor' ), |
| 3080 |
'tab' => static::TAB_ADVANCED, |
| 3081 |
] |
| 3082 |
); |
| 3083 |
|
| 3084 |
$this->add_control( |
| 3085 |
'advanced_custom_css_id', |
| 3086 |
[ |
| 3087 |
'label' => esc_html__( 'CSS ID', 'elementor' ), |
| 3088 |
'type' => Controls_Manager::TEXT, |
| 3089 |
'default' => '', |
| 3090 |
'ai' => [ |
| 3091 |
'active' => false, |
| 3092 |
], |
| 3093 |
'dynamic' => [ |
| 3094 |
'active' => true, |
| 3095 |
], |
| 3096 |
'title' => esc_html__( 'Add your custom id WITHOUT the Pound key. e.g: my-id', 'elementor' ), |
| 3097 |
'style_transfer' => false, |
| 3098 |
] |
| 3099 |
); |
| 3100 |
|
| 3101 |
$this->add_control( |
| 3102 |
'advanced_custom_css_classes', |
| 3103 |
[ |
| 3104 |
'label' => esc_html__( 'CSS Classes', 'elementor' ), |
| 3105 |
'type' => Controls_Manager::TEXT, |
| 3106 |
'default' => '', |
| 3107 |
'ai' => [ |
| 3108 |
'active' => false, |
| 3109 |
], |
| 3110 |
'dynamic' => [ |
| 3111 |
'active' => true, |
| 3112 |
], |
| 3113 |
'title' => esc_html__( 'Add your custom class WITHOUT the dot. e.g: my-class', 'elementor' ), |
| 3114 |
] |
| 3115 |
); |
| 3116 |
|
| 3117 |
$this->end_controls_section(); |
| 3118 |
|
| 3119 |
Plugin::$instance->controls_manager->add_custom_css_controls( $this, static::TAB_ADVANCED ); |
| 3120 |
|
| 3121 |
Plugin::$instance->controls_manager->add_custom_attributes_controls( $this, static::TAB_ADVANCED ); |
| 3122 |
|
| 3123 |
} |
| 3124 |
|
| 3125 |
protected function render(): void { |
| 3126 |
$render_strategy = new Contact_Buttons_Core_Render( $this ); |
| 3127 |
|
| 3128 |
$render_strategy->render(); |
| 3129 |
} |
| 3130 |
} |
| 3131 |
|