@wordpress/block-editor 13.0.5 → 13.0.7

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 (48) hide show
  1. package/build/autocompleters/block.js +1 -1
  2. package/build/autocompleters/block.js.map +1 -1
  3. package/build/components/block-list/use-block-props/use-block-refs.js +9 -2
  4. package/build/components/block-list/use-block-props/use-block-refs.js.map +1 -1
  5. package/build/components/block-toolbar/shuffle.js +1 -1
  6. package/build/components/block-toolbar/shuffle.js.map +1 -1
  7. package/build/components/global-styles/hooks.js +5 -1
  8. package/build/components/global-styles/hooks.js.map +1 -1
  9. package/build/components/global-styles/use-global-styles-output.js +52 -8
  10. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  11. package/build/layouts/constrained.js +6 -2
  12. package/build/layouts/constrained.js.map +1 -1
  13. package/build/store/private-selectors.js +6 -7
  14. package/build/store/private-selectors.js.map +1 -1
  15. package/build/store/selectors.js +5 -28
  16. package/build/store/selectors.js.map +1 -1
  17. package/build/store/utils.js +36 -0
  18. package/build/store/utils.js.map +1 -1
  19. package/build-module/autocompleters/block.js +1 -1
  20. package/build-module/autocompleters/block.js.map +1 -1
  21. package/build-module/components/block-list/use-block-props/use-block-refs.js +11 -4
  22. package/build-module/components/block-list/use-block-props/use-block-refs.js.map +1 -1
  23. package/build-module/components/block-toolbar/shuffle.js +1 -1
  24. package/build-module/components/block-toolbar/shuffle.js.map +1 -1
  25. package/build-module/components/global-styles/hooks.js +5 -1
  26. package/build-module/components/global-styles/hooks.js.map +1 -1
  27. package/build-module/components/global-styles/use-global-styles-output.js +52 -8
  28. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  29. package/build-module/layouts/constrained.js +6 -2
  30. package/build-module/layouts/constrained.js.map +1 -1
  31. package/build-module/store/private-selectors.js +7 -8
  32. package/build-module/store/private-selectors.js.map +1 -1
  33. package/build-module/store/selectors.js +7 -30
  34. package/build-module/store/selectors.js.map +1 -1
  35. package/build-module/store/utils.js +35 -0
  36. package/build-module/store/utils.js.map +1 -1
  37. package/package.json +3 -3
  38. package/src/autocompleters/block.js +2 -1
  39. package/src/components/block-list/use-block-props/use-block-refs.js +19 -3
  40. package/src/components/block-toolbar/shuffle.js +2 -1
  41. package/src/components/global-styles/hooks.js +5 -1
  42. package/src/components/global-styles/test/use-global-styles-output.js +18 -8
  43. package/src/components/global-styles/use-global-styles-output.js +57 -8
  44. package/src/layouts/constrained.js +10 -2
  45. package/src/store/private-selectors.js +5 -5
  46. package/src/store/selectors.js +9 -40
  47. package/src/store/utils.js +38 -0
  48. package/src/utils/test/transform-styles.js +49 -0
@@ -125,6 +125,21 @@ describe( 'transformStyles', () => {
125
125
  expect( output ).toMatchSnapshot();
126
126
  } );
127
127
 
128
+ it( `should not try to replace 'body' in the middle of a classname`, () => {
129
+ const prefix = '.my-namespace';
130
+ const input = `.has-body-text { color: red; }`;
131
+ const output = transformStyles(
132
+ [
133
+ {
134
+ css: input,
135
+ },
136
+ ],
137
+ prefix
138
+ );
139
+
140
+ expect( output ).toEqual( [ `${ prefix } ${ input }` ] );
141
+ } );
142
+
128
143
  it( 'should ignore keyframes', () => {
129
144
  const input = `
130
145
  @keyframes edit-post__fade-in-animation {
@@ -210,6 +225,40 @@ describe( 'transformStyles', () => {
210
225
 
211
226
  expect( output ).toMatchSnapshot();
212
227
  } );
228
+
229
+ it( 'should not try to wrap items within `:where` selectors', () => {
230
+ const input = `:where(.wp-element-button:active, .wp-block-button__link:active) { color: blue; }`;
231
+ const prefix = '.my-namespace';
232
+ const expected = [ `${ prefix } ${ input }` ];
233
+
234
+ const output = transformStyles(
235
+ [
236
+ {
237
+ css: input,
238
+ },
239
+ ],
240
+ prefix
241
+ );
242
+
243
+ expect( output ).toEqual( expected );
244
+ } );
245
+
246
+ it( 'should not try to prefix pseudo elements on `:where` selectors', () => {
247
+ const input = `:where(.wp-element-button, .wp-block-button__link)::before { color: blue; }`;
248
+ const prefix = '.my-namespace';
249
+ const expected = [ `${ prefix } ${ input }` ];
250
+
251
+ const output = transformStyles(
252
+ [
253
+ {
254
+ css: input,
255
+ },
256
+ ],
257
+ prefix
258
+ );
259
+
260
+ expect( output ).toEqual( expected );
261
+ } );
213
262
  } );
214
263
 
215
264
  it( 'should not break with data urls', () => {