@@ -8,7 +8,7 @@ import { every, isEmpty } from 'lodash';
8
8
* WordPress dependencies
9
9
*/
10
10
import { PanelBody , ColorIndicator } from '@wordpress/components' ;
11
- import { sprintf , __ } from '@wordpress/i18n' ;
11
+ import { sprintf , __ , _x } from '@wordpress/i18n' ;
12
12
import { useMemo } from '@wordpress/element' ;
13
13
14
14
/**
@@ -172,64 +172,88 @@ const PanelColorGradientSettingsSingleSelect = ( props ) => {
172
172
173
173
const PanelColorGradientSettingsMultipleSelect = ( props ) => {
174
174
const colorGradientSettings = useCommonSingleMultipleSelects ( ) ;
175
- const userColors = useSetting ( 'color.palette.user' ) ;
175
+ const customColors = useSetting ( 'color.palette.user' ) ;
176
176
const themeColors = useSetting ( 'color.palette.theme' ) ;
177
- const coreColors = useSetting ( 'color.palette.core' ) ;
178
- const shouldDisplayCoreColors = useSetting ( 'color.corePalette ' ) ;
177
+ const defaultColors = useSetting ( 'color.palette.core' ) ;
178
+ const shouldDisplayDefaultColors = useSetting ( 'color.defaultPalette ' ) ;
179
179
180
180
colorGradientSettings . colors = useMemo ( ( ) => {
181
181
const result = [ ] ;
182
- if ( shouldDisplayCoreColors && coreColors && coreColors . length ) {
182
+ if ( themeColors && themeColors . length ) {
183
183
result . push ( {
184
- name : __ ( 'Core' ) ,
185
- colors : coreColors ,
184
+ name : _x (
185
+ 'Theme' ,
186
+ 'Indicates this palette comes from the theme.'
187
+ ) ,
188
+ colors : themeColors ,
186
189
} ) ;
187
190
}
188
- if ( themeColors && themeColors . length ) {
191
+ if (
192
+ shouldDisplayDefaultColors &&
193
+ defaultColors &&
194
+ defaultColors . length
195
+ ) {
189
196
result . push ( {
190
- name : __ ( 'Theme' ) ,
191
- colors : themeColors ,
197
+ name : _x (
198
+ 'Default' ,
199
+ 'Indicates this palette comes from WordPress.'
200
+ ) ,
201
+ colors : defaultColors ,
192
202
} ) ;
193
203
}
194
- if ( userColors && userColors . length ) {
204
+ if ( customColors && customColors . length ) {
195
205
result . push ( {
196
- name : __ ( 'User' ) ,
197
- colors : userColors ,
206
+ name : _x (
207
+ 'Custom' ,
208
+ 'Indicates this palette comes from the theme.'
209
+ ) ,
210
+ colors : customColors ,
198
211
} ) ;
199
212
}
200
213
return result ;
201
- } , [ coreColors , themeColors , userColors ] ) ;
214
+ } , [ defaultColors , themeColors , customColors ] ) ;
202
215
203
- const userGradients = useSetting ( 'color.gradients.user' ) ;
216
+ const customGradients = useSetting ( 'color.gradients.user' ) ;
204
217
const themeGradients = useSetting ( 'color.gradients.theme' ) ;
205
- const coreGradients = useSetting ( 'color.gradients.core' ) ;
206
- const shouldDisplayCoreGradients = useSetting ( 'color.coreGradients' ) ;
218
+ const defaultGradients = useSetting ( 'color.gradients.core' ) ;
219
+ const shouldDisplayDefaultGradients = useSetting (
220
+ 'color.defaultGradients'
221
+ ) ;
207
222
colorGradientSettings . gradients = useMemo ( ( ) => {
208
223
const result = [ ] ;
209
- if (
210
- shouldDisplayCoreGradients &&
211
- coreGradients &&
212
- coreGradients . length
213
- ) {
224
+ if ( themeGradients && themeGradients . length ) {
214
225
result . push ( {
215
- name : __ ( 'Core' ) ,
216
- gradients : coreGradients ,
226
+ name : _x (
227
+ 'Theme' ,
228
+ 'Indicates this palette comes from the theme.'
229
+ ) ,
230
+ gradients : themeGradients ,
217
231
} ) ;
218
232
}
219
- if ( themeGradients && themeGradients . length ) {
233
+ if (
234
+ shouldDisplayDefaultGradients &&
235
+ defaultGradients &&
236
+ defaultGradients . length
237
+ ) {
220
238
result . push ( {
221
- name : __ ( 'Theme' ) ,
222
- gradients : themeGradients ,
239
+ name : _x (
240
+ 'Default' ,
241
+ 'Indicates this palette comes from WordPress.'
242
+ ) ,
243
+ gradients : defaultGradients ,
223
244
} ) ;
224
245
}
225
- if ( userGradients && userGradients . length ) {
246
+ if ( customGradients && customGradients . length ) {
226
247
result . push ( {
227
- name : __ ( 'User' ) ,
228
- gradients : userGradients ,
248
+ name : _x (
249
+ 'Custom' ,
250
+ 'Indicates this palette is created by the user.'
251
+ ) ,
252
+ gradients : customGradients ,
229
253
} ) ;
230
254
}
231
255
return result ;
232
- } , [ userGradients , themeGradients , coreGradients ] ) ;
256
+ } , [ customGradients , themeGradients , defaultGradients ] ) ;
233
257
return (
234
258
< PanelColorGradientSettingsInner
235
259
{ ...{ ...colorGradientSettings , ...props } }
0 commit comments