PluginProbe
Elementor Website Builder – more than just a page builder / 3.23.0-beta5
Elementor Website Builder – more than just a page builder v3.23.0-beta5
4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 All 455 releases
elementor / modules / floating-buttons / base / widget-contact-button-base.php

widget-contact-button-base.php in Elementor Website Builder – more than just a page builder 3.23.0-beta5, at modules/floating-buttons/base/widget-contact-button-base.php

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