| @@ -72,31 +72,9 @@ | ||
| 72 | 72 | public function get_keywords() { |
| 73 | 73 | return [ 'icon list', 'icon', 'list' ]; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - protected function is_dynamic_content(): bool { | |
| 77 | - return false; | |
| 78 | - } | |
| 79 | - | |
| 80 | - public function has_widget_inner_wrapper(): bool { | |
| 81 | - return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); | |
| 82 | - } | |
| 83 | - | |
| 84 | 76 | /** |
| 85 | - * Get style dependencies. | |
| 86 | - * | |
| 87 | - * Retrieve the list of style dependencies the widget requires. | |
| 88 | - * | |
| 89 | - * @since 3.24.0 | |
| 90 | - * @access public | |
| 91 | - * | |
| 92 | - * @return array Widget style dependencies. | |
| 93 | - */ | |
| 94 | - public function get_style_depends(): array { | |
| 95 | - return [ 'widget-icon-list' ]; | |
| 96 | - } | |
| 97 | - | |
| 98 | - /** | |
| 99 | 77 | * Register icon list widget controls. |
| 100 | 78 | * |
| 101 | 79 | * Adds different input fields to allow the user to change and customize the widget settings. |
| 102 | 80 | * |
| @@ -243,13 +221,14 @@ | ||
| 243 | 221 | 'max' => 50, |
| 244 | 222 | ], |
| 245 | 223 | ], |
| 246 | 224 | 'selectors' => [ |
| 247 | - '{{WRAPPER}} .elementor-icon-list-items:not(.elementor-inline-items) .elementor-icon-list-item:not(:last-child)' => 'padding-block-end: calc({{SIZE}}{{UNIT}}/2)', | |
| 248 | - '{{WRAPPER}} .elementor-icon-list-items:not(.elementor-inline-items) .elementor-icon-list-item:not(:first-child)' => 'margin-block-start: calc({{SIZE}}{{UNIT}}/2)', | |
| 249 | - '{{WRAPPER}} .elementor-icon-list-items.elementor-inline-items .elementor-icon-list-item' => 'margin-inline: calc({{SIZE}}{{UNIT}}/2)', | |
| 250 | - '{{WRAPPER}} .elementor-icon-list-items.elementor-inline-items' => 'margin-inline: calc(-{{SIZE}}{{UNIT}}/2)', | |
| 251 | - '{{WRAPPER}} .elementor-icon-list-items.elementor-inline-items .elementor-icon-list-item:after' => 'inset-inline-end: calc(-{{SIZE}}{{UNIT}}/2)', | |
| 225 | + '{{WRAPPER}} .elementor-icon-list-items:not(.elementor-inline-items) .elementor-icon-list-item:not(:last-child)' => 'padding-bottom: calc({{SIZE}}{{UNIT}}/2)', | |
| 226 | + '{{WRAPPER}} .elementor-icon-list-items:not(.elementor-inline-items) .elementor-icon-list-item:not(:first-child)' => 'margin-top: calc({{SIZE}}{{UNIT}}/2)', | |
| 227 | + '{{WRAPPER}} .elementor-icon-list-items.elementor-inline-items .elementor-icon-list-item' => 'margin-right: calc({{SIZE}}{{UNIT}}/2); margin-left: calc({{SIZE}}{{UNIT}}/2)', | |
| 228 | + '{{WRAPPER}} .elementor-icon-list-items.elementor-inline-items' => 'margin-right: calc(-{{SIZE}}{{UNIT}}/2); margin-left: calc(-{{SIZE}}{{UNIT}}/2)', | |
| 229 | + 'body.rtl {{WRAPPER}} .elementor-icon-list-items.elementor-inline-items .elementor-icon-list-item:after' => 'left: calc(-{{SIZE}}{{UNIT}}/2)', | |
| 230 | + 'body:not(.rtl) {{WRAPPER}} .elementor-icon-list-items.elementor-inline-items .elementor-icon-list-item:after' => 'right: calc(-{{SIZE}}{{UNIT}}/2)', | |
| 252 | 231 | ], |
| 253 | 232 | ] |
| 254 | 233 | ); |
| 255 | 234 | |
| @@ -258,10 +237,10 @@ | ||
| 258 | 237 | [ |
| 259 | 238 | 'label' => esc_html__( 'Alignment', 'elementor' ), |
| 260 | 239 | 'type' => Controls_Manager::CHOOSE, |
| 261 | 240 | 'options' => [ |
| 262 | - 'start' => [ | |
| 263 | - 'title' => esc_html__( 'Start', 'elementor' ), | |
| 241 | + 'left' => [ | |
| 242 | + 'title' => esc_html__( 'Left', 'elementor' ), | |
| 264 | 243 | 'icon' => 'eicon-h-align-left', |
| 265 | 244 | ], |
| 266 | 245 | 'center' => [ |
| 267 | 246 | 'title' => esc_html__( 'Center', 'elementor' ), |
| @@ -266,19 +245,14 @@ | ||
| 266 | 245 | 'center' => [ |
| 267 | 246 | 'title' => esc_html__( 'Center', 'elementor' ), |
| 268 | 247 | 'icon' => 'eicon-h-align-center', |
| 269 | 248 | ], |
| 270 | - 'end' => [ | |
| 271 | - 'title' => esc_html__( 'End', 'elementor' ), | |
| 249 | + 'right' => [ | |
| 250 | + 'title' => esc_html__( 'Right', 'elementor' ), | |
| 272 | 251 | 'icon' => 'eicon-h-align-right', |
| 273 | 252 | ], |
| 274 | 253 | ], |
| 275 | - 'classes_dictionary' => [ | |
| 276 | - 'left' => is_rtl() ? 'end' : 'start', | |
| 277 | - 'right' => is_rtl() ? 'start' : 'end', | |
| 278 | - ], | |
| 279 | 254 | 'prefix_class' => 'elementor%s-align-', |
| 280 | - 'classes' => 'elementor-control-start-end', | |
| 281 | 255 | ] |
| 282 | 256 | ); |
| 283 | 257 | |
| 284 | 258 | $this->add_control( |
| @@ -310,10 +284,10 @@ | ||
| 310 | 284 | 'condition' => [ |
| 311 | 285 | 'divider' => 'yes', |
| 312 | 286 | ], |
| 313 | 287 | 'selectors' => [ |
| 314 | - '{{WRAPPER}} .elementor-icon-list-items:not(.elementor-inline-items) .elementor-icon-list-item:not(:last-child):after' => 'border-block-start-style: {{VALUE}}', | |
| 315 | - '{{WRAPPER}} .elementor-icon-list-items.elementor-inline-items .elementor-icon-list-item:not(:last-child):after' => 'border-inline-start-style: {{VALUE}}', | |
| 288 | + '{{WRAPPER}} .elementor-icon-list-items:not(.elementor-inline-items) .elementor-icon-list-item:not(:last-child):after' => 'border-top-style: {{VALUE}}', | |
| 289 | + '{{WRAPPER}} .elementor-icon-list-items.elementor-inline-items .elementor-icon-list-item:not(:last-child):after' => 'border-left-style: {{VALUE}}', | |
| 316 | 290 | ], |
| 317 | 291 | ] |
| 318 | 292 | ); |
| 319 | 293 | |
| @@ -335,10 +309,10 @@ | ||
| 335 | 309 | 'condition' => [ |
| 336 | 310 | 'divider' => 'yes', |
| 337 | 311 | ], |
| 338 | 312 | 'selectors' => [ |
| 339 | - '{{WRAPPER}} .elementor-icon-list-items:not(.elementor-inline-items) .elementor-icon-list-item:not(:last-child):after' => 'border-block-start-width: {{SIZE}}{{UNIT}}', | |
| 340 | - '{{WRAPPER}} .elementor-inline-items .elementor-icon-list-item:not(:last-child):after' => 'border-inline-start-width: {{SIZE}}{{UNIT}}', | |
| 313 | + '{{WRAPPER}} .elementor-icon-list-items:not(.elementor-inline-items) .elementor-icon-list-item:not(:last-child):after' => 'border-top-width: {{SIZE}}{{UNIT}}', | |
| 314 | + '{{WRAPPER}} .elementor-inline-items .elementor-icon-list-item:not(:last-child):after' => 'border-left-width: {{SIZE}}{{UNIT}}', | |
| 341 | 315 | ], |
| 342 | 316 | ] |
| 343 | 317 | ); |
| 344 | 318 | |
| @@ -529,9 +503,9 @@ | ||
| 529 | 503 | ], |
| 530 | 504 | ], |
| 531 | 505 | 'separator' => 'after', |
| 532 | 506 | 'selectors' => [ |
| 533 | - '{{WRAPPER}} .elementor-icon-list-icon' => 'padding-inline-end: {{SIZE}}{{UNIT}};', | |
| 507 | + '{{WRAPPER}} .elementor-icon-list-icon' => is_rtl() ? 'padding-left: {{SIZE}}{{UNIT}};' : 'padding-right: {{SIZE}}{{UNIT}};', | |
| 534 | 508 | ], |
| 535 | 509 | ] |
| 536 | 510 | ); |
| 537 | 511 | |
| @@ -782,9 +756,9 @@ | ||
| 782 | 756 | <i class="<?php echo esc_attr( $item['icon'] ); ?>" aria-hidden="true"></i> |
| 783 | 757 | <?php } ?> |
| 784 | 758 | </span> |
| 785 | 759 | <?php endif; ?> |
| 786 | - <span <?php $this->print_render_attribute_string( $repeater_setting_key ); ?>><?php echo wp_kses_post( $item['text'] ); ?></span> | |
| 760 | + <span <?php $this->print_render_attribute_string( $repeater_setting_key ); ?>><?php $this->print_unescaped_setting( 'text', 'icon_list', $index ); ?></span> | |
| 787 | 761 | <?php if ( ! empty( $item['link']['url'] ) ) : ?> |
| 788 | 762 | </a> |
| 789 | 763 | <?php endif; ?> |
| 790 | 764 | </li> |
| @@ -802,34 +776,8 @@ | ||
| 802 | 776 | * |
| 803 | 777 | * @since 2.9.0 |
| 804 | 778 | * @access protected |
| 805 | 779 | */ |
| 806 | - public function render_markdown(): string { | |
| 807 | - $settings = $this->get_settings_for_display(); | |
| 808 | - | |
| 809 | - if ( empty( $settings['icon_list'] ) ) { | |
| 810 | - return ''; | |
| 811 | - } | |
| 812 | - | |
| 813 | - $lines = []; | |
| 814 | - | |
| 815 | - foreach ( $settings['icon_list'] as $item ) { | |
| 816 | - $text = Utils::html_to_plain_text( $item['text'] ?? '' ); | |
| 817 | - | |
| 818 | - if ( empty( $text ) ) { | |
| 819 | - continue; | |
| 820 | - } | |
| 821 | - | |
| 822 | - if ( ! empty( $item['link']['url'] ) ) { | |
| 823 | - $text = '[' . $text . '](' . esc_url( $item['link']['url'] ) . ')'; | |
| 824 | - } | |
| 825 | - | |
| 826 | - $lines[] = '- ' . $text; | |
| 827 | - } | |
| 828 | - | |
| 829 | - return implode( "\n", $lines ); | |
| 830 | - } | |
| 831 | - | |
| 832 | 780 | protected function content_template() { |
| 833 | 781 | ?> |
| 834 | 782 | <# |
| 835 | 783 | view.addRenderAttribute( 'icon_list', 'class', 'elementor-icon-list-items' ); |
| @@ -852,10 +800,10 @@ | ||
| 852 | 800 | |
| 853 | 801 | view.addInlineEditingAttributes( iconTextKey ); #> |
| 854 | 802 | |
| 855 | 803 | <li {{{ view.getRenderAttributeString( 'list_item' ) }}}> |
| 856 | - <# if ( item.link && item.link?.url ) { #> | |
| 857 | - <a href="{{ elementor.helpers.sanitizeUrl( item.link?.url ) }}"> | |
| 804 | + <# if ( item.link && item.link.url ) { #> | |
| 805 | + <a href="{{ item.link.url }}"> | |
| 858 | 806 | <# } #> |
| 859 | 807 | <# if ( item.icon || item.selected_icon.value ) { #> |
| 860 | 808 | <span class="elementor-icon-list-icon"> |
| 861 | 809 | <# |
| @@ -869,9 +817,9 @@ | ||
| 869 | 817 | #> |
| 870 | 818 | </span> |
| 871 | 819 | <# } #> |
| 872 | 820 | <span {{{ view.getRenderAttributeString( iconTextKey ) }}}>{{{ item.text }}}</span> |
| 873 | - <# if ( item.link && item.link?.url ) { #> | |
| 821 | + <# if ( item.link && item.link.url ) { #> | |
| 874 | 822 | </a> |
| 875 | 823 | <# } #> |
| 876 | 824 | </li> |
| 877 | 825 | <# |