| @@ -120,35 +120,8 @@ | ||
| 120 | 120 | * |
| 121 | 121 | * @return array Control fields. |
| 122 | 122 | */ |
| 123 | 123 | public function init_fields() { |
| 124 | - $active_breakpoints = Plugin::$instance->breakpoints->get_active_breakpoints(); | |
| 125 | - | |
| 126 | - $location_device_args = []; | |
| 127 | - $location_device_defaults = [ | |
| 128 | - 'default' => [ | |
| 129 | - 'unit' => '%', | |
| 130 | - ], | |
| 131 | - ]; | |
| 132 | - | |
| 133 | - $angel_device_args = []; | |
| 134 | - $angel_device_defaults = [ | |
| 135 | - 'default' => [ | |
| 136 | - 'unit' => 'deg', | |
| 137 | - ], | |
| 138 | - ]; | |
| 139 | - | |
| 140 | - $position_device_args = []; | |
| 141 | - $position_device_defaults = [ | |
| 142 | - 'default' => 'center center', | |
| 143 | - ]; | |
| 144 | - | |
| 145 | - foreach ( $active_breakpoints as $breakpoint_name => $breakpoint ) { | |
| 146 | - $location_device_args[ $breakpoint_name ] = $location_device_defaults; | |
| 147 | - $angel_device_args[ $breakpoint_name ] = $angel_device_defaults; | |
| 148 | - $position_device_args[ $breakpoint_name ] = $position_device_defaults; | |
| 149 | - } | |
| 150 | - | |
| 151 | 124 | $fields = []; |
| 152 | 125 | |
| 153 | 126 | $fields['background'] = [ |
| 154 | 127 | 'label' => esc_html__( 'Background Type', 'elementor' ), |
| @@ -155,23 +128,12 @@ | ||
| 155 | 128 | 'type' => Controls_Manager::CHOOSE, |
| 156 | 129 | 'render_type' => 'ui', |
| 157 | 130 | ]; |
| 158 | 131 | |
| 159 | - $fields['gradient_notice'] = [ | |
| 160 | - 'type' => Controls_Manager::ALERT, | |
| 161 | - 'alert_type' => 'warning', | |
| 162 | - 'content' => esc_html__( 'Set locations and angle for each breakpoint to ensure the gradient adapts to different screen sizes.', 'elementor' ), | |
| 163 | - 'render_type' => 'ui', | |
| 164 | - 'condition' => [ | |
| 165 | - 'background' => [ 'gradient' ], | |
| 166 | - ], | |
| 167 | - ]; | |
| 168 | - | |
| 169 | 132 | $fields['color'] = [ |
| 170 | 133 | 'label' => esc_html__( 'Color', 'elementor' ), |
| 171 | 134 | 'type' => Controls_Manager::COLOR, |
| 172 | 135 | 'default' => '', |
| 173 | - 'control_type' => 'content', | |
| 174 | 136 | 'title' => esc_html__( 'Background Color', 'elementor' ), |
| 175 | 137 | 'selectors' => [ |
| 176 | 138 | '{{SELECTOR}}' => 'background-color: {{VALUE}};', |
| 177 | 139 | ], |
| @@ -187,10 +149,8 @@ | ||
| 187 | 149 | 'default' => [ |
| 188 | 150 | 'unit' => '%', |
| 189 | 151 | 'size' => 0, |
| 190 | 152 | ], |
| 191 | - 'device_args' => $location_device_args, | |
| 192 | - 'responsive' => true, | |
| 193 | 153 | 'render_type' => 'ui', |
| 194 | 154 | 'condition' => [ |
| 195 | 155 | 'background' => [ 'gradient' ], |
| 196 | 156 | ], |
| @@ -201,9 +161,8 @@ | ||
| 201 | 161 | 'label' => esc_html__( 'Second Color', 'elementor' ), |
| 202 | 162 | 'type' => Controls_Manager::COLOR, |
| 203 | 163 | 'default' => '#f2295b', |
| 204 | 164 | 'render_type' => 'ui', |
| 205 | - 'control_type' => 'content', | |
| 206 | 165 | 'condition' => [ |
| 207 | 166 | 'background' => [ 'gradient' ], |
| 208 | 167 | ], |
| 209 | 168 | 'of_type' => 'gradient', |
| @@ -216,10 +175,8 @@ | ||
| 216 | 175 | 'default' => [ |
| 217 | 176 | 'unit' => '%', |
| 218 | 177 | 'size' => 100, |
| 219 | 178 | ], |
| 220 | - 'device_args' => $location_device_args, | |
| 221 | - 'responsive' => true, | |
| 222 | 179 | 'render_type' => 'ui', |
| 223 | 180 | 'condition' => [ |
| 224 | 181 | 'background' => [ 'gradient' ], |
| 225 | 182 | ], |
| @@ -248,10 +205,8 @@ | ||
| 248 | 205 | 'default' => [ |
| 249 | 206 | 'unit' => 'deg', |
| 250 | 207 | 'size' => 180, |
| 251 | 208 | ], |
| 252 | - 'device_args' => $angel_device_args, | |
| 253 | - 'responsive' => true, | |
| 254 | 209 | 'selectors' => [ |
| 255 | 210 | '{{SELECTOR}}' => 'background-color: transparent; background-image: linear-gradient({{SIZE}}{{UNIT}}, {{color.VALUE}} {{color_stop.SIZE}}{{color_stop.UNIT}}, {{color_b.VALUE}} {{color_b_stop.SIZE}}{{color_b_stop.UNIT}})', |
| 256 | 211 | ], |
| 257 | 212 | 'condition' => [ |
| @@ -275,10 +230,8 @@ | ||
| 275 | 230 | 'bottom left' => esc_html__( 'Bottom Left', 'elementor' ), |
| 276 | 231 | 'bottom right' => esc_html__( 'Bottom Right', 'elementor' ), |
| 277 | 232 | ], |
| 278 | 233 | 'default' => 'center center', |
| 279 | - 'device_args' => $position_device_args, | |
| 280 | - 'responsive' => true, | |
| 281 | 234 | 'selectors' => [ |
| 282 | 235 | '{{SELECTOR}}' => 'background-color: transparent; background-image: radial-gradient(at {{VALUE}}, {{color.VALUE}} {{color_stop.SIZE}}{{color_stop.UNIT}}, {{color_b.VALUE}} {{color_b_stop.SIZE}}{{color_b_stop.UNIT}})', |
| 283 | 236 | ], |
| 284 | 237 | 'condition' => [ |
| @@ -445,8 +398,9 @@ | ||
| 445 | 398 | $fields['attachment_alert'] = [ |
| 446 | 399 | 'type' => Controls_Manager::RAW_HTML, |
| 447 | 400 | 'content_classes' => 'elementor-control-field-description', |
| 448 | 401 | 'raw' => esc_html__( 'Note: Attachment Fixed works only on desktop.', 'elementor' ), |
| 402 | + 'separator' => 'none', | |
| 449 | 403 | 'condition' => [ |
| 450 | 404 | 'background' => [ 'classic' ], |
| 451 | 405 | 'image[url]!' => '', |
| 452 | 406 | 'attachment' => 'fixed', |
| @@ -501,10 +455,19 @@ | ||
| 501 | 455 | 'responsive' => true, |
| 502 | 456 | 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], |
| 503 | 457 | 'range' => [ |
| 504 | 458 | 'px' => [ |
| 459 | + 'min' => 0, | |
| 505 | 460 | 'max' => 1000, |
| 506 | 461 | ], |
| 462 | + '%' => [ | |
| 463 | + 'min' => 0, | |
| 464 | + 'max' => 100, | |
| 465 | + ], | |
| 466 | + 'vw' => [ | |
| 467 | + 'min' => 0, | |
| 468 | + 'max' => 100, | |
| 469 | + ], | |
| 507 | 470 | ], |
| 508 | 471 | 'default' => [ |
| 509 | 472 | 'size' => 100, |
| 510 | 473 | 'unit' => '%', |
| @@ -533,11 +496,8 @@ | ||
| 533 | 496 | 'categories' => [ |
| 534 | 497 | TagsModule::POST_META_CATEGORY, |
| 535 | 498 | TagsModule::URL_CATEGORY, |
| 536 | 499 | ], |
| 537 | - ], | |
| 538 | - 'ai' => [ | |
| 539 | - 'active' => false, | |
| 540 | 500 | ], |
| 541 | 501 | 'condition' => [ |
| 542 | 502 | 'background' => [ 'video' ], |
| 543 | 503 | ], |