| @@ -16,29 +16,38 @@ | ||
| 16 | 16 | protected function init_fields() { |
| 17 | 17 | $fields = []; |
| 18 | 18 | |
| 19 | 19 | $fields['basis_type'] = [ |
| 20 | - 'label' => esc_html__( 'Flex Basis', 'elementor' ), | |
| 20 | + 'label' => esc_html_x( 'Flex Basis', 'Flex Item Control', 'elementor' ), | |
| 21 | 21 | 'type' => Controls_Manager::SELECT, |
| 22 | 22 | 'options' => [ |
| 23 | - '' => esc_html__( 'Default', 'elementor' ), | |
| 24 | - 'custom' => esc_html__( 'Custom', 'elementor' ), | |
| 23 | + '' => esc_html_x( 'Default', 'Flex Item Control', 'elementor' ), | |
| 24 | + 'custom' => esc_html_x( 'Custom', 'Flex Item Control', 'elementor' ), | |
| 25 | 25 | ], |
| 26 | 26 | 'responsive' => true, |
| 27 | 27 | ]; |
| 28 | 28 | |
| 29 | 29 | $fields['basis'] = [ |
| 30 | - 'label' => esc_html__( 'Custom Width', 'elementor' ), | |
| 30 | + 'label' => esc_html_x( 'Custom Width', 'Flex Item Control', 'elementor' ), | |
| 31 | 31 | 'type' => Controls_Manager::SLIDER, |
| 32 | 32 | 'range' => [ |
| 33 | 33 | 'px' => [ |
| 34 | + 'min' => 0, | |
| 34 | 35 | 'max' => 1000, |
| 35 | 36 | ], |
| 37 | + '%' => [ | |
| 38 | + 'min' => 0, | |
| 39 | + 'max' => 100, | |
| 40 | + ], | |
| 41 | + 'vw' => [ | |
| 42 | + 'min' => 0, | |
| 43 | + 'max' => 100, | |
| 44 | + ], | |
| 36 | 45 | ], |
| 37 | 46 | 'default' => [ |
| 38 | 47 | 'unit' => '%', |
| 39 | 48 | ], |
| 40 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], | |
| 49 | + 'size_units' => [ 'px', '%', 'vw' ], | |
| 41 | 50 | 'selectors' => [ |
| 42 | 51 | '{{SELECTOR}}' => '--flex-basis: {{SIZE}}{{UNIT}};', |
| 43 | 52 | ], |
| 44 | 53 | 'condition' => [ |
| @@ -47,25 +56,25 @@ | ||
| 47 | 56 | 'responsive' => true, |
| 48 | 57 | ]; |
| 49 | 58 | |
| 50 | 59 | $fields['align_self'] = [ |
| 51 | - 'label' => esc_html__( 'Align Self', 'elementor' ), | |
| 60 | + 'label' => esc_html_x( 'Align Self', 'Flex Item Control', 'elementor' ), | |
| 52 | 61 | 'type' => Controls_Manager::CHOOSE, |
| 53 | 62 | 'options' => [ |
| 54 | 63 | 'flex-start' => [ |
| 55 | - 'title' => esc_html__( 'Start', 'elementor' ), | |
| 64 | + 'title' => esc_html_x( 'Start', 'Flex Item Control', 'elementor' ), | |
| 56 | 65 | 'icon' => 'eicon-flex eicon-align-start-v', |
| 57 | 66 | ], |
| 58 | 67 | 'center' => [ |
| 59 | - 'title' => esc_html__( 'Center', 'elementor' ), | |
| 68 | + 'title' => esc_html_x( 'Center', 'Flex Item Control', 'elementor' ), | |
| 60 | 69 | 'icon' => 'eicon-flex eicon-align-center-v', |
| 61 | 70 | ], |
| 62 | 71 | 'flex-end' => [ |
| 63 | - 'title' => esc_html__( 'End', 'elementor' ), | |
| 72 | + 'title' => esc_html_x( 'End', 'Flex Item Control', 'elementor' ), | |
| 64 | 73 | 'icon' => 'eicon-flex eicon-align-end-v', |
| 65 | 74 | ], |
| 66 | 75 | 'stretch' => [ |
| 67 | - 'title' => esc_html__( 'Stretch', 'elementor' ), | |
| 76 | + 'title' => esc_html_x( 'Stretch', 'Flex Item Control', 'elementor' ), | |
| 68 | 77 | 'icon' => 'eicon-flex eicon-align-stretch-v', |
| 69 | 78 | ], |
| 70 | 79 | ], |
| 71 | 80 | 'default' => '', |
| @@ -72,26 +81,26 @@ | ||
| 72 | 81 | 'selectors' => [ |
| 73 | 82 | '{{SELECTOR}}' => '--align-self: {{VALUE}};', |
| 74 | 83 | ], |
| 75 | 84 | 'responsive' => true, |
| 76 | - 'description' => esc_html__( 'This control will affect contained elements only.', 'elementor' ), | |
| 85 | + 'description' => esc_html_x( 'This control will affect contained elements only.', 'Flex Item Control', 'elementor' ), | |
| 77 | 86 | ]; |
| 78 | 87 | |
| 79 | 88 | $fields['order'] = [ |
| 80 | - 'label' => esc_html__( 'Order', 'elementor' ), | |
| 89 | + 'label' => esc_html_x( 'Order', 'Flex Item Control', 'elementor' ), | |
| 81 | 90 | 'type' => Controls_Manager::CHOOSE, |
| 82 | 91 | 'default' => '', |
| 83 | 92 | 'options' => [ |
| 84 | 93 | 'start' => [ |
| 85 | - 'title' => esc_html__( 'Start', 'elementor' ), | |
| 94 | + 'title' => esc_html_x( 'Start', 'Flex Item Control', 'elementor' ), | |
| 86 | 95 | 'icon' => 'eicon-flex eicon-order-start', |
| 87 | 96 | ], |
| 88 | 97 | 'end' => [ |
| 89 | - 'title' => esc_html__( 'End', 'elementor' ), | |
| 98 | + 'title' => esc_html_x( 'End', 'Flex Item Control', 'elementor' ), | |
| 90 | 99 | 'icon' => 'eicon-flex eicon-order-end', |
| 91 | 100 | ], |
| 92 | 101 | 'custom' => [ |
| 93 | - 'title' => esc_html__( 'Custom', 'elementor' ), | |
| 102 | + 'title' => esc_html_x( 'Custom', 'Flex Item Control', 'elementor' ), | |
| 94 | 103 | 'icon' => 'eicon-ellipsis-v', |
| 95 | 104 | ], |
| 96 | 105 | ], |
| 97 | 106 | 'selectors_dictionary' => [ |
| @@ -105,13 +114,13 @@ | ||
| 105 | 114 | 'selectors' => [ |
| 106 | 115 | '{{SELECTOR}}' => '--order: {{VALUE}};', |
| 107 | 116 | ], |
| 108 | 117 | 'responsive' => true, |
| 109 | - 'description' => esc_html__( 'This control will affect contained elements only.', 'elementor' ), | |
| 118 | + 'description' => esc_html_x( 'This control will affect contained elements only.', 'Flex Item Control', 'elementor' ), | |
| 110 | 119 | ]; |
| 111 | 120 | |
| 112 | 121 | $fields['order_custom'] = [ |
| 113 | - 'label' => esc_html__( 'Custom Order', 'elementor' ), | |
| 122 | + 'label' => esc_html_x( 'Custom Order', 'Flex Item Control', 'elementor' ), | |
| 114 | 123 | 'type' => Controls_Manager::NUMBER, |
| 115 | 124 | 'selectors' => [ |
| 116 | 125 | '{{SELECTOR}}' => '--order: {{VALUE}};', |
| 117 | 126 | ], |
| @@ -121,26 +130,26 @@ | ||
| 121 | 130 | ], |
| 122 | 131 | ]; |
| 123 | 132 | |
| 124 | 133 | $fields['size'] = [ |
| 125 | - 'label' => esc_html__( 'Size', 'elementor' ), | |
| 134 | + 'label' => esc_html_x( 'Size', 'Flex Item Control', 'elementor' ), | |
| 126 | 135 | 'type' => Controls_Manager::CHOOSE, |
| 127 | 136 | 'default' => '', |
| 128 | 137 | 'options' => [ |
| 129 | 138 | 'none' => [ |
| 130 | - 'title' => esc_html__( 'None', 'elementor' ), | |
| 139 | + 'title' => esc_html_x( 'None', 'Flex Item Control', 'elementor' ), | |
| 131 | 140 | 'icon' => 'eicon-ban', |
| 132 | 141 | ], |
| 133 | 142 | 'grow' => [ |
| 134 | - 'title' => esc_html__( 'Grow', 'elementor' ), | |
| 143 | + 'title' => esc_html_x( 'Grow', 'Flex Item Control', 'elementor' ), | |
| 135 | 144 | 'icon' => 'eicon-grow', |
| 136 | 145 | ], |
| 137 | 146 | 'shrink' => [ |
| 138 | - 'title' => esc_html__( 'Shrink', 'elementor' ), | |
| 147 | + 'title' => esc_html_x( 'Shrink', 'Flex Item Control', 'elementor' ), | |
| 139 | 148 | 'icon' => 'eicon-shrink', |
| 140 | 149 | ], |
| 141 | 150 | 'custom' => [ |
| 142 | - 'title' => esc_html__( 'Custom', 'elementor' ), | |
| 151 | + 'title' => esc_html_x( 'Custom', 'Flex Item Control', 'elementor' ), | |
| 143 | 152 | 'icon' => 'eicon-ellipsis-v', |
| 144 | 153 | ], |
| 145 | 154 | ], |
| 146 | 155 | 'selectors_dictionary' => [ |
| @@ -155,9 +164,9 @@ | ||
| 155 | 164 | 'responsive' => true, |
| 156 | 165 | ]; |
| 157 | 166 | |
| 158 | 167 | $fields['grow'] = [ |
| 159 | - 'label' => esc_html__( 'Flex Grow', 'elementor' ), | |
| 168 | + 'label' => esc_html_x( 'Flex Grow', 'Flex Item Control', 'elementor' ), | |
| 160 | 169 | 'type' => Controls_Manager::NUMBER, |
| 161 | 170 | 'selectors' => [ |
| 162 | 171 | '{{SELECTOR}}' => '--flex-grow: {{VALUE}};', |
| 163 | 172 | ], |
| @@ -169,9 +178,9 @@ | ||
| 169 | 178 | ], |
| 170 | 179 | ]; |
| 171 | 180 | |
| 172 | 181 | $fields['shrink'] = [ |
| 173 | - 'label' => esc_html__( 'Flex Shrink', 'elementor' ), | |
| 182 | + 'label' => esc_html_x( 'Flex Shrink', 'Flex Item Control', 'elementor' ), | |
| 174 | 183 | 'type' => Controls_Manager::NUMBER, |
| 175 | 184 | 'selectors' => [ |
| 176 | 185 | '{{SELECTOR}}' => '--flex-shrink: {{VALUE}};', |
| 177 | 186 | ], |