@wordpress/block-editor 15.6.1 → 15.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/background-image-control/index.js +2 -2
  3. package/build/components/background-image-control/index.js.map +2 -2
  4. package/build/components/block-quick-navigation/index.js +1 -0
  5. package/build/components/block-quick-navigation/index.js.map +2 -2
  6. package/build/components/block-toolbar/switch-section-style.js +2 -5
  7. package/build/components/block-toolbar/switch-section-style.js.map +2 -2
  8. package/build/components/global-styles/border-panel.js +2 -1
  9. package/build/components/global-styles/border-panel.js.map +2 -2
  10. package/build/components/global-styles/color-panel.js +2 -1
  11. package/build/components/global-styles/color-panel.js.map +2 -2
  12. package/build/components/global-styles/dimensions-panel.js +3 -2
  13. package/build/components/global-styles/dimensions-panel.js.map +2 -2
  14. package/build/components/global-styles/filters-panel.js +2 -1
  15. package/build/components/global-styles/filters-panel.js.map +2 -2
  16. package/build/components/global-styles/hooks.js +0 -179
  17. package/build/components/global-styles/hooks.js.map +3 -3
  18. package/build/components/global-styles/index.js +0 -29
  19. package/build/components/global-styles/index.js.map +2 -2
  20. package/build/components/global-styles/typography-panel.js +2 -1
  21. package/build/components/global-styles/typography-panel.js.map +2 -2
  22. package/build/components/global-styles/typography-utils.js +2 -49
  23. package/build/components/global-styles/typography-utils.js.map +2 -2
  24. package/build/components/global-styles/utils.js +0 -396
  25. package/build/components/global-styles/utils.js.map +3 -3
  26. package/build/components/inserter/media-tab/media-tab.js +33 -1
  27. package/build/components/inserter/media-tab/media-tab.js.map +3 -3
  28. package/build/components/inserter/tips.js +0 -2
  29. package/build/components/inserter/tips.js.map +2 -2
  30. package/build/components/media-placeholder/index.js +31 -1
  31. package/build/components/media-placeholder/index.js.map +3 -3
  32. package/build/components/media-replace-flow/index.js +29 -1
  33. package/build/components/media-replace-flow/index.js.map +3 -3
  34. package/build/components/{global-styles/context.js → media-upload-modal/index.js} +8 -23
  35. package/build/components/media-upload-modal/index.js.map +7 -0
  36. package/build/hooks/allowed-blocks.js +3 -8
  37. package/build/hooks/allowed-blocks.js.map +3 -3
  38. package/build/hooks/block-style-variation.js +10 -23
  39. package/build/hooks/block-style-variation.js.map +2 -2
  40. package/build/hooks/duotone.js +3 -3
  41. package/build/hooks/duotone.js.map +2 -2
  42. package/build/hooks/fit-text.js +2 -2
  43. package/build/hooks/fit-text.js.map +2 -2
  44. package/build/hooks/font-size.js +2 -2
  45. package/build/hooks/font-size.js.map +2 -2
  46. package/build/hooks/use-typography-props.js +2 -2
  47. package/build/hooks/use-typography-props.js.map +2 -2
  48. package/build/private-apis.js +3 -1
  49. package/build/private-apis.js.map +3 -3
  50. package/build-module/components/background-image-control/index.js +1 -1
  51. package/build-module/components/background-image-control/index.js.map +2 -2
  52. package/build-module/components/block-quick-navigation/index.js +1 -0
  53. package/build-module/components/block-quick-navigation/index.js.map +2 -2
  54. package/build-module/components/block-toolbar/switch-section-style.js +2 -5
  55. package/build-module/components/block-toolbar/switch-section-style.js.map +2 -2
  56. package/build-module/components/global-styles/border-panel.js +2 -1
  57. package/build-module/components/global-styles/border-panel.js.map +2 -2
  58. package/build-module/components/global-styles/color-panel.js +2 -1
  59. package/build-module/components/global-styles/color-panel.js.map +2 -2
  60. package/build-module/components/global-styles/dimensions-panel.js +2 -1
  61. package/build-module/components/global-styles/dimensions-panel.js.map +2 -2
  62. package/build-module/components/global-styles/filters-panel.js +2 -1
  63. package/build-module/components/global-styles/filters-panel.js.map +2 -2
  64. package/build-module/components/global-styles/hooks.js +1 -167
  65. package/build-module/components/global-styles/hooks.js.map +2 -2
  66. package/build-module/components/global-styles/index.js +1 -29
  67. package/build-module/components/global-styles/index.js.map +2 -2
  68. package/build-module/components/global-styles/typography-panel.js +2 -1
  69. package/build-module/components/global-styles/typography-panel.js.map +2 -2
  70. package/build-module/components/global-styles/typography-utils.js +1 -49
  71. package/build-module/components/global-styles/typography-utils.js.map +2 -2
  72. package/build-module/components/global-styles/utils.js +0 -372
  73. package/build-module/components/global-styles/utils.js.map +2 -2
  74. package/build-module/components/inserter/media-tab/media-tab.js +34 -2
  75. package/build-module/components/inserter/media-tab/media-tab.js.map +2 -2
  76. package/build-module/components/inserter/tips.js +0 -2
  77. package/build-module/components/inserter/tips.js.map +2 -2
  78. package/build-module/components/media-placeholder/index.js +31 -1
  79. package/build-module/components/media-placeholder/index.js.map +2 -2
  80. package/build-module/components/media-replace-flow/index.js +29 -1
  81. package/build-module/components/media-replace-flow/index.js.map +2 -2
  82. package/build-module/components/media-upload-modal/index.js +7 -0
  83. package/build-module/components/media-upload-modal/index.js.map +7 -0
  84. package/build-module/hooks/allowed-blocks.js +3 -8
  85. package/build-module/hooks/allowed-blocks.js.map +2 -2
  86. package/build-module/hooks/block-style-variation.js +8 -25
  87. package/build-module/hooks/block-style-variation.js.map +2 -2
  88. package/build-module/hooks/duotone.js +3 -3
  89. package/build-module/hooks/duotone.js.map +2 -2
  90. package/build-module/hooks/fit-text.js +2 -2
  91. package/build-module/hooks/fit-text.js.map +2 -2
  92. package/build-module/hooks/font-size.js +1 -1
  93. package/build-module/hooks/font-size.js.map +2 -2
  94. package/build-module/hooks/use-typography-props.js +1 -1
  95. package/build-module/hooks/use-typography-props.js.map +2 -2
  96. package/build-module/private-apis.js +3 -1
  97. package/build-module/private-apis.js.map +2 -2
  98. package/build-style/style-rtl.css +10 -6
  99. package/build-style/style.css +10 -6
  100. package/package.json +36 -35
  101. package/src/components/background-image-control/index.js +1 -1
  102. package/src/components/block-card/style.scss +1 -1
  103. package/src/components/block-navigation/style.scss +1 -1
  104. package/src/components/block-quick-navigation/index.js +1 -0
  105. package/src/components/block-quick-navigation/style.scss +5 -0
  106. package/src/components/block-switcher/style.scss +1 -1
  107. package/src/components/block-toolbar/switch-section-style.js +2 -5
  108. package/src/components/color-palette/test/__snapshots__/control.js.snap +1 -1
  109. package/src/components/global-styles/border-panel.js +2 -1
  110. package/src/components/global-styles/color-panel.js +2 -1
  111. package/src/components/global-styles/color-panel.native.js +1 -1
  112. package/src/components/global-styles/dimensions-panel.js +2 -1
  113. package/src/components/global-styles/filters-panel.js +2 -1
  114. package/src/components/global-styles/hooks.js +1 -200
  115. package/src/components/global-styles/index.js +1 -17
  116. package/src/components/global-styles/test/typography-utils.js +0 -806
  117. package/src/components/global-styles/typography-panel.js +2 -1
  118. package/src/components/global-styles/typography-utils.js +0 -133
  119. package/src/components/global-styles/utils.js +0 -568
  120. package/src/components/inserter/media-tab/media-tab.js +44 -2
  121. package/src/components/inserter/style.scss +2 -2
  122. package/src/components/inserter/tips.js +0 -2
  123. package/src/components/media-placeholder/index.js +41 -1
  124. package/src/components/media-replace-flow/index.js +39 -1
  125. package/src/components/media-upload-modal/index.js +18 -0
  126. package/src/components/multi-selection-inspector/style.scss +1 -1
  127. package/src/hooks/allowed-blocks.js +3 -11
  128. package/src/hooks/block-style-variation.js +8 -28
  129. package/src/hooks/duotone.js +3 -3
  130. package/src/hooks/fit-text.js +2 -2
  131. package/src/hooks/font-size.js +1 -1
  132. package/src/hooks/use-typography-props.js +1 -1
  133. package/src/private-apis.js +2 -0
  134. package/src/style.scss +1 -0
  135. package/tsconfig.json +2 -0
  136. package/build/components/global-styles/context.js.map +0 -7
  137. package/build/components/global-styles/get-block-css-selector.js +0 -78
  138. package/build/components/global-styles/get-block-css-selector.js.map +0 -7
  139. package/build/components/global-styles/get-global-styles-changes.js +0 -216
  140. package/build/components/global-styles/get-global-styles-changes.js.map +0 -7
  141. package/build/components/global-styles/use-global-styles-output.js +0 -998
  142. package/build/components/global-styles/use-global-styles-output.js.map +0 -7
  143. package/build-module/components/global-styles/context.js +0 -17
  144. package/build-module/components/global-styles/context.js.map +0 -7
  145. package/build-module/components/global-styles/get-block-css-selector.js +0 -54
  146. package/build-module/components/global-styles/get-block-css-selector.js.map +0 -7
  147. package/build-module/components/global-styles/get-global-styles-changes.js +0 -182
  148. package/build-module/components/global-styles/get-global-styles-changes.js.map +0 -7
  149. package/build-module/components/global-styles/use-global-styles-output.js +0 -979
  150. package/build-module/components/global-styles/use-global-styles-output.js.map +0 -7
  151. package/src/components/global-styles/README.md +0 -190
  152. package/src/components/global-styles/context.js +0 -16
  153. package/src/components/global-styles/get-block-css-selector.js +0 -114
  154. package/src/components/global-styles/get-global-styles-changes.js +0 -252
  155. package/src/components/global-styles/test/get-global-styles-changes.js +0 -290
  156. package/src/components/global-styles/test/use-global-styles-output.js +0 -1131
  157. package/src/components/global-styles/test/utils.js +0 -499
  158. package/src/components/global-styles/use-global-styles-output.js +0 -1487
@@ -1,499 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import {
5
- areGlobalStyleConfigsEqual,
6
- getBlockStyleVariationSelector,
7
- getPresetVariableFromValue,
8
- getValueFromVariable,
9
- scopeFeatureSelectors,
10
- getResolvedThemeFilePath,
11
- getResolvedRefValue,
12
- getResolvedValue,
13
- } from '../utils';
14
-
15
- describe( 'editor utils', () => {
16
- const themeJson = {
17
- version: 1,
18
- settings: {
19
- color: {
20
- palette: {
21
- theme: [
22
- {
23
- slug: 'primary',
24
- color: '#007cba',
25
- name: 'Primary',
26
- },
27
- {
28
- slug: 'secondary',
29
- color: '#006ba1',
30
- name: 'Secondary',
31
- },
32
- ],
33
- custom: [
34
- {
35
- slug: 'primary',
36
- color: '#007cba',
37
- name: 'Primary',
38
- },
39
- {
40
- slug: 'secondary',
41
- color: '#a65555',
42
- name: 'Secondary',
43
- },
44
- ],
45
- },
46
- custom: true,
47
- customDuotone: true,
48
- customGradient: true,
49
- link: true,
50
- },
51
- custom: {
52
- color: {
53
- primary: 'var(--wp--preset--color--primary)',
54
- secondary: 'var(--wp--preset--color--secondary)',
55
- },
56
- },
57
- },
58
- styles: {
59
- background: {
60
- backgroundImage: {
61
- url: 'file:./assets/image.jpg',
62
- },
63
- backgroundAttachment: 'fixed',
64
- backgroundPosition: 'top left',
65
- },
66
- blocks: {
67
- 'core/group': {
68
- background: {
69
- backgroundImage: {
70
- ref: 'styles.background.backgroundImage',
71
- },
72
- },
73
- dimensions: {
74
- minHeight: '100px',
75
- },
76
- spacing: {
77
- padding: {
78
- top: 0,
79
- },
80
- },
81
- },
82
- },
83
- },
84
- _links: {
85
- 'wp:theme-file': [
86
- {
87
- name: 'file:./assets/image.jpg',
88
- href: 'https://wordpress.org/assets/image.jpg',
89
- target: 'styles.background.backgroundImage.url',
90
- },
91
- {
92
- name: 'file:./assets/other/image.jpg',
93
- href: 'https://wordpress.org/assets/other/image.jpg',
94
- target: "styles.blocks.['core/group'].background.backgroundImage.url",
95
- },
96
- ],
97
- },
98
- isGlobalStylesUserThemeJSON: true,
99
- };
100
-
101
- describe( 'getPresetVariableFromValue', () => {
102
- const context = 'root';
103
- const propertyName = 'color.text';
104
- const value = '#007cba';
105
-
106
- describe( 'when a provided global style (e.g. fontFamily, color,etc.) does not exist', () => {
107
- it( 'returns the originally provided value', () => {
108
- const actual = getPresetVariableFromValue(
109
- themeJson.settings,
110
- context,
111
- 'fakePropertyName',
112
- value
113
- );
114
- expect( actual ).toBe( value );
115
- } );
116
- } );
117
-
118
- describe( 'when a global style is cleared by the user', () => {
119
- it( 'returns an undefined preset variable', () => {
120
- const actual = getPresetVariableFromValue(
121
- themeJson.settings,
122
- context,
123
- propertyName,
124
- undefined
125
- );
126
- expect( actual ).toBe( undefined );
127
- } );
128
- } );
129
-
130
- describe( 'when a global style is selected by the user', () => {
131
- describe( 'and it is not a preset value (e.g. custom color)', () => {
132
- it( 'returns the originally provided value', () => {
133
- const customValue = '#6e4545';
134
- const actual = getPresetVariableFromValue(
135
- themeJson.settings,
136
- context,
137
- propertyName,
138
- customValue
139
- );
140
- expect( actual ).toBe( customValue );
141
- } );
142
- } );
143
-
144
- describe( 'and it is a preset value', () => {
145
- it( 'returns the preset variable', () => {
146
- const actual = getPresetVariableFromValue(
147
- themeJson.settings,
148
- context,
149
- propertyName,
150
- value
151
- );
152
- expect( actual ).toBe( 'var:preset|color|primary' );
153
- } );
154
- } );
155
- } );
156
- } );
157
-
158
- describe( 'getValueFromVariable', () => {
159
- describe( 'when provided an invalid variable', () => {
160
- it( 'returns the originally provided value', () => {
161
- const actual = getValueFromVariable(
162
- themeJson,
163
- 'root',
164
- undefined
165
- );
166
-
167
- expect( actual ).toBe( undefined );
168
- } );
169
- } );
170
-
171
- describe( 'when provided a preset variable', () => {
172
- it( 'retrieves the correct preset value', () => {
173
- const actual = getValueFromVariable(
174
- themeJson,
175
- 'root',
176
- 'var:preset|color|primary'
177
- );
178
-
179
- expect( actual ).toBe( '#007cba' );
180
- } );
181
- } );
182
-
183
- describe( 'when provided a custom variable', () => {
184
- it( 'retrieves the correct custom value', () => {
185
- const actual = getValueFromVariable(
186
- themeJson,
187
- 'root',
188
- 'var(--wp--custom--color--secondary)'
189
- );
190
-
191
- expect( actual ).toBe( '#a65555' );
192
- } );
193
- } );
194
-
195
- describe( 'when provided a dynamic reference', () => {
196
- it( 'retrieves the referenced value', () => {
197
- const stylesWithRefs = {
198
- ...themeJson,
199
- styles: {
200
- color: {
201
- background: {
202
- ref: 'styles.color.text',
203
- },
204
- text: 'purple-rain',
205
- },
206
- },
207
- };
208
- const actual = getValueFromVariable( stylesWithRefs, 'root', {
209
- ref: 'styles.color.text',
210
- } );
211
-
212
- expect( actual ).toBe( stylesWithRefs.styles.color.text );
213
- } );
214
-
215
- it( 'returns the originally provided value where value is dynamic reference and reference does not exist', () => {
216
- const stylesWithRefs = {
217
- ...themeJson,
218
- styles: {
219
- color: {
220
- text: {
221
- ref: 'styles.background.text',
222
- },
223
- },
224
- },
225
- };
226
- const actual = getValueFromVariable( stylesWithRefs, 'root', {
227
- ref: 'styles.color.text',
228
- } );
229
-
230
- expect( actual ).toBe( stylesWithRefs.styles.color.text );
231
- } );
232
-
233
- it( 'returns the originally provided value where value is dynamic reference', () => {
234
- const stylesWithRefs = {
235
- ...themeJson,
236
- styles: {
237
- color: {
238
- background: {
239
- ref: 'styles.color.text',
240
- },
241
- text: {
242
- ref: 'styles.background.text',
243
- },
244
- },
245
- },
246
- };
247
- const actual = getValueFromVariable( stylesWithRefs, 'root', {
248
- ref: 'styles.color.text',
249
- } );
250
-
251
- expect( actual ).toBe( stylesWithRefs.styles.color.text );
252
- } );
253
- } );
254
- } );
255
-
256
- describe( 'areGlobalStyleConfigsEqual', () => {
257
- test.each( [
258
- { original: null, variation: null, expected: true },
259
- { original: {}, variation: {}, expected: true },
260
- { original: {}, variation: undefined, expected: false },
261
- {
262
- original: {
263
- styles: {
264
- color: { text: 'var(--wp--preset--color--red)' },
265
- },
266
- },
267
- variation: {
268
- styles: {
269
- color: { text: 'var(--wp--preset--color--blue)' },
270
- },
271
- },
272
- expected: false,
273
- },
274
- { original: {}, variation: undefined, expected: false },
275
- {
276
- original: {
277
- styles: {
278
- color: { text: 'var(--wp--preset--color--red)' },
279
- },
280
- settings: {
281
- typography: {
282
- fontSize: true,
283
- },
284
- },
285
- },
286
- variation: {
287
- styles: {
288
- color: { text: 'var(--wp--preset--color--red)' },
289
- },
290
- settings: {
291
- typography: {
292
- fontSize: true,
293
- },
294
- },
295
- },
296
- expected: true,
297
- },
298
- ] )(
299
- '.areGlobalStyleConfigsEqual( $original, $variation )',
300
- ( { original, variation, expected } ) => {
301
- expect(
302
- areGlobalStyleConfigsEqual( original, variation )
303
- ).toBe( expected );
304
- }
305
- );
306
- } );
307
-
308
- describe( 'getBlockStyleVariationSelector', () => {
309
- test.each( [
310
- { type: 'empty', selector: '', expected: '.is-style-custom' },
311
- {
312
- type: 'class',
313
- selector: '.wp-block',
314
- expected: '.wp-block.is-style-custom',
315
- },
316
- {
317
- type: 'id',
318
- selector: '#wp-block',
319
- expected: '#wp-block.is-style-custom',
320
- },
321
- {
322
- type: 'element tag',
323
- selector: 'p',
324
- expected: 'p.is-style-custom',
325
- },
326
- {
327
- type: 'attribute',
328
- selector: '[style*="color"]',
329
- expected: '[style*="color"].is-style-custom',
330
- },
331
- {
332
- type: 'descendant',
333
- selector: '.wp-block .inner',
334
- expected: '.wp-block.is-style-custom .inner',
335
- },
336
- {
337
- type: 'comma-separated',
338
- selector: '.wp-block .inner, .wp-block .alternative',
339
- expected:
340
- '.wp-block.is-style-custom .inner, .wp-block.is-style-custom .alternative',
341
- },
342
- {
343
- type: 'pseudo',
344
- selector: 'div:first-child',
345
- expected: 'div.is-style-custom:first-child',
346
- },
347
- {
348
- type: ':is',
349
- selector: '.wp-block:is(.outer .inner:first-child)',
350
- expected:
351
- '.wp-block.is-style-custom:is(.outer .inner:first-child)',
352
- },
353
- {
354
- type: ':not',
355
- selector: '.wp-block:not(.outer .inner:first-child)',
356
- expected:
357
- '.wp-block.is-style-custom:not(.outer .inner:first-child)',
358
- },
359
- {
360
- type: ':has',
361
- selector: '.wp-block:has(.outer .inner:first-child)',
362
- expected:
363
- '.wp-block.is-style-custom:has(.outer .inner:first-child)',
364
- },
365
- {
366
- type: ':where',
367
- selector: '.wp-block:where(.outer .inner:first-child)',
368
- expected:
369
- '.wp-block.is-style-custom:where(.outer .inner:first-child)',
370
- },
371
- {
372
- type: 'wrapping :where',
373
- selector: ':where(.outer .inner:first-child)',
374
- expected: ':where(.outer.is-style-custom .inner:first-child)',
375
- },
376
- {
377
- type: 'complex',
378
- selector:
379
- '.wp:where(.something):is(.test:not(.nothing p)):has(div[style]) .content, .wp:where(.nothing):not(.test:is(.something div)):has(span[style]) .inner',
380
- expected:
381
- '.wp.is-style-custom:where(.something):is(.test:not(.nothing p)):has(div[style]) .content, .wp.is-style-custom:where(.nothing):not(.test:is(.something div)):has(span[style]) .inner',
382
- },
383
- ] )(
384
- 'should add variation class to ancestor in $type selector',
385
- ( { selector, expected } ) => {
386
- expect(
387
- getBlockStyleVariationSelector( 'custom', selector )
388
- ).toBe( expected );
389
- }
390
- );
391
- } );
392
-
393
- describe( 'scopeFeatureSelectors', () => {
394
- it( 'correctly scopes selectors while maintaining selectors object structure', () => {
395
- const actual = scopeFeatureSelectors( '.custom, .secondary', {
396
- color: '.my-block h1',
397
- typography: {
398
- root: '.my-block',
399
- lineHeight: '.my-block h1',
400
- },
401
- } );
402
-
403
- expect( actual ).toEqual( {
404
- color: '.custom .my-block h1, .secondary .my-block h1',
405
- typography: {
406
- root: '.custom .my-block, .secondary .my-block',
407
- lineHeight: '.custom .my-block h1, .secondary .my-block h1',
408
- },
409
- } );
410
- } );
411
- } );
412
-
413
- describe( 'getResolvedThemeFilePath()', () => {
414
- it.each( [
415
- [
416
- 'file:./assets/image.jpg',
417
- 'https://wordpress.org/assets/image.jpg',
418
- 'Should return absolute URL if found in themeFileURIs',
419
- ],
420
- [
421
- 'file:./misc/image.jpg',
422
- 'file:./misc/image.jpg',
423
- 'Should return value if not found in themeFileURIs',
424
- ],
425
- [
426
- 'https://wordpress.org/assets/image.jpg',
427
- 'https://wordpress.org/assets/image.jpg',
428
- 'Should not match absolute URLs',
429
- ],
430
- ] )(
431
- 'Given file %s and return value %s: %s',
432
- ( file, returnedValue ) => {
433
- expect(
434
- getResolvedThemeFilePath(
435
- file,
436
- themeJson._links[ 'wp:theme-file' ]
437
- ) === returnedValue
438
- ).toBe( true );
439
- }
440
- );
441
- } );
442
-
443
- describe( 'getResolvedRefValue()', () => {
444
- it.each( [
445
- [ 'blue', 'blue', null ],
446
- [ 0, 0, themeJson ],
447
- [
448
- { ref: 'styles.background.backgroundImage' },
449
- { url: 'file:./assets/image.jpg' },
450
- themeJson,
451
- ],
452
- [
453
- { ref: 'styles.blocks.core/group.spacing.padding.top' },
454
- 0,
455
- themeJson,
456
- ],
457
- [
458
- {
459
- ref: 'styles.blocks.core/group.background.backgroundImage',
460
- },
461
- undefined,
462
- themeJson,
463
- ],
464
- ] )(
465
- 'Given ruleValue %s return expected value of %s',
466
- ( ruleValue, returnedValue, tree ) => {
467
- expect( getResolvedRefValue( ruleValue, tree ) ).toEqual(
468
- returnedValue
469
- );
470
- }
471
- );
472
- } );
473
-
474
- describe( 'getResolvedValue()', () => {
475
- it.each( [
476
- [ 'blue', 'blue', null ],
477
- [ 0, 0, themeJson ],
478
- [
479
- { ref: 'styles.background.backgroundImage' },
480
- { url: 'https://wordpress.org/assets/image.jpg' },
481
- themeJson,
482
- ],
483
- [
484
- {
485
- ref: 'styles.blocks.core/group.background.backgroundImage',
486
- },
487
- undefined,
488
- themeJson,
489
- ],
490
- ] )(
491
- 'Given ruleValue %s return expected value of %s',
492
- ( ruleValue, returnedValue, tree ) => {
493
- expect( getResolvedValue( ruleValue, tree ) ).toEqual(
494
- returnedValue
495
- );
496
- }
497
- );
498
- } );
499
- } );