@wordpress/block-library 7.14.3 → 7.14.4

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 (50) hide show
  1. package/build/navigation/edit/index.js +12 -12
  2. package/build/navigation/edit/index.js.map +1 -1
  3. package/build/post-content/edit.js +6 -1
  4. package/build/post-content/edit.js.map +1 -1
  5. package/build/post-featured-image/index.js +1 -1
  6. package/build/post-featured-image/overlay.js +2 -2
  7. package/build/post-featured-image/overlay.js.map +1 -1
  8. package/build/query/edit/inspector-controls/index.js +1 -1
  9. package/build/query/edit/inspector-controls/index.js.map +1 -1
  10. package/build/query/utils.js +1 -1
  11. package/build/query/utils.js.map +1 -1
  12. package/build/quote/index.js +0 -1
  13. package/build/quote/index.js.map +1 -1
  14. package/build/template-part/index.js +2 -2
  15. package/build/template-part/index.js.map +1 -1
  16. package/build-module/navigation/edit/index.js +12 -12
  17. package/build-module/navigation/edit/index.js.map +1 -1
  18. package/build-module/post-content/edit.js +6 -1
  19. package/build-module/post-content/edit.js.map +1 -1
  20. package/build-module/post-featured-image/index.js +1 -1
  21. package/build-module/post-featured-image/overlay.js +2 -2
  22. package/build-module/post-featured-image/overlay.js.map +1 -1
  23. package/build-module/query/edit/inspector-controls/index.js +1 -1
  24. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  25. package/build-module/query/utils.js +1 -1
  26. package/build-module/query/utils.js.map +1 -1
  27. package/build-module/quote/index.js +0 -1
  28. package/build-module/quote/index.js.map +1 -1
  29. package/build-module/template-part/index.js +2 -2
  30. package/build-module/template-part/index.js.map +1 -1
  31. package/build-style/code/style-rtl.css +3 -0
  32. package/build-style/code/style.css +3 -0
  33. package/build-style/editor-rtl.css +39 -29
  34. package/build-style/editor.css +39 -29
  35. package/build-style/post-featured-image/editor-rtl.css +39 -29
  36. package/build-style/post-featured-image/editor.css +39 -29
  37. package/build-style/style-rtl.css +3 -0
  38. package/build-style/style.css +3 -0
  39. package/package.json +12 -12
  40. package/src/code/style.scss +12 -7
  41. package/src/navigation/edit/index.js +12 -10
  42. package/src/post-content/edit.js +3 -1
  43. package/src/post-featured-image/block.json +1 -1
  44. package/src/post-featured-image/editor.scss +79 -72
  45. package/src/post-featured-image/index.php +18 -24
  46. package/src/post-featured-image/overlay.js +17 -14
  47. package/src/query/edit/inspector-controls/index.js +1 -4
  48. package/src/query/utils.js +1 -1
  49. package/src/quote/block.json +0 -1
  50. package/src/template-part/index.js +2 -2
@@ -79,19 +79,19 @@
79
79
  -webkit-backdrop-filter: none;
80
80
  backdrop-filter: none;
81
81
  }
82
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder,
83
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder {
82
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder,
83
+ .wp-block-post-featured-image .components-placeholder {
84
84
  justify-content: center;
85
85
  align-items: center;
86
86
  padding: 0;
87
87
  min-height: 200px;
88
88
  }
89
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-form-file-upload,
90
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder .components-form-file-upload {
89
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-form-file-upload,
90
+ .wp-block-post-featured-image .components-placeholder .components-form-file-upload {
91
91
  display: none;
92
92
  }
93
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-button.components-button,
94
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder .components-button.components-button {
93
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-button,
94
+ .wp-block-post-featured-image .components-placeholder .components-button {
95
95
  padding: 0;
96
96
  display: flex;
97
97
  justify-content: center;
@@ -105,51 +105,61 @@
105
105
  border-style: solid;
106
106
  color: #fff;
107
107
  }
108
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-button.components-button > svg,
109
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder .components-button.components-button > svg {
108
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-button > svg,
109
+ .wp-block-post-featured-image .components-placeholder .components-button > svg {
110
110
  color: inherit;
111
111
  }
112
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where(.has-border-color),
113
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where(.has-border-color) {
112
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where(.has-border-color),
113
+ .wp-block-post-featured-image .components-placeholder:where(.has-border-color),
114
+ .wp-block-post-featured-image img:where(.has-border-color) {
114
115
  border-style: solid;
115
116
  }
116
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-top-color"]),
117
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-top-color"]) {
117
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-top-color"]),
118
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-top-color"]),
119
+ .wp-block-post-featured-image img:where([style*="border-top-color"]) {
118
120
  border-top-style: solid;
119
121
  }
120
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-right-color"]),
121
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-right-color"]) {
122
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-right-color"]),
123
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-right-color"]),
124
+ .wp-block-post-featured-image img:where([style*="border-right-color"]) {
122
125
  border-right-style: solid;
123
126
  }
124
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-bottom-color"]),
125
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-bottom-color"]) {
127
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-bottom-color"]),
128
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-bottom-color"]),
129
+ .wp-block-post-featured-image img:where([style*="border-bottom-color"]) {
126
130
  border-bottom-style: solid;
127
131
  }
128
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-left-color"]),
129
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-left-color"]) {
132
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-left-color"]),
133
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-left-color"]),
134
+ .wp-block-post-featured-image img:where([style*="border-left-color"]) {
130
135
  border-left-style: solid;
131
136
  }
132
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-width"]),
133
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-width"]) {
137
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-width"]),
138
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-width"]),
139
+ .wp-block-post-featured-image img:where([style*="border-width"]) {
134
140
  border-style: solid;
135
141
  }
136
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-top-width"]),
137
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-top-width"]) {
142
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-top-width"]),
143
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-top-width"]),
144
+ .wp-block-post-featured-image img:where([style*="border-top-width"]) {
138
145
  border-top-style: solid;
139
146
  }
140
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-right-width"]),
141
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-right-width"]) {
147
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-right-width"]),
148
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-right-width"]),
149
+ .wp-block-post-featured-image img:where([style*="border-right-width"]) {
142
150
  border-right-style: solid;
143
151
  }
144
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-bottom-width"]),
145
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-bottom-width"]) {
152
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-bottom-width"]),
153
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-bottom-width"]),
154
+ .wp-block-post-featured-image img:where([style*="border-bottom-width"]) {
146
155
  border-bottom-style: solid;
147
156
  }
148
- .wp-block-post-featured-image.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-left-width"]),
149
- .wp-block-post-featured-image.wp-block-post-featured-image .components-placeholder:where([style*="border-left-width"]) {
157
+ .wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-left-width"]),
158
+ .wp-block-post-featured-image .components-placeholder:where([style*="border-left-width"]),
159
+ .wp-block-post-featured-image img:where([style*="border-left-width"]) {
150
160
  border-left-style: solid;
151
161
  }
152
- .wp-block-post-featured-image.wp-block-post-featured-image[style*=height] .components-placeholder {
162
+ .wp-block-post-featured-image[style*=height] .components-placeholder {
153
163
  min-height: 48px;
154
164
  min-width: 48px;
155
165
  height: 100%;
@@ -277,6 +277,9 @@
277
277
  margin-left: 2em;
278
278
  }
279
279
 
280
+ .wp-block-code {
281
+ box-sizing: border-box;
282
+ }
280
283
  .wp-block-code code {
281
284
  display: block;
282
285
  font-family: inherit;
@@ -280,6 +280,9 @@
280
280
  margin-left: 2em;
281
281
  }
282
282
 
283
+ .wp-block-code {
284
+ box-sizing: border-box;
285
+ }
283
286
  .wp-block-code code {
284
287
  display: block;
285
288
  font-family: inherit;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "7.14.3",
3
+ "version": "7.14.4",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -35,12 +35,12 @@
35
35
  "@wordpress/api-fetch": "^6.14.1",
36
36
  "@wordpress/autop": "^3.17.1",
37
37
  "@wordpress/blob": "^3.17.1",
38
- "@wordpress/block-editor": "^10.0.3",
39
- "@wordpress/blocks": "^11.16.3",
40
- "@wordpress/components": "^21.0.3",
38
+ "@wordpress/block-editor": "^10.0.4",
39
+ "@wordpress/blocks": "^11.16.4",
40
+ "@wordpress/components": "^21.0.4",
41
41
  "@wordpress/compose": "^5.15.2",
42
- "@wordpress/core-data": "^5.0.3",
43
- "@wordpress/data": "^7.1.2",
42
+ "@wordpress/core-data": "^5.0.4",
43
+ "@wordpress/data": "^7.1.3",
44
44
  "@wordpress/date": "^4.17.1",
45
45
  "@wordpress/deprecated": "^3.17.1",
46
46
  "@wordpress/dom": "^3.17.2",
@@ -50,13 +50,13 @@
50
50
  "@wordpress/i18n": "^4.17.1",
51
51
  "@wordpress/icons": "^9.8.1",
52
52
  "@wordpress/keycodes": "^3.17.1",
53
- "@wordpress/notices": "^3.17.2",
53
+ "@wordpress/notices": "^3.17.3",
54
54
  "@wordpress/primitives": "^3.15.1",
55
- "@wordpress/reusable-blocks": "^3.15.3",
56
- "@wordpress/rich-text": "^5.15.2",
57
- "@wordpress/server-side-render": "^3.15.3",
55
+ "@wordpress/reusable-blocks": "^3.15.4",
56
+ "@wordpress/rich-text": "^5.15.3",
57
+ "@wordpress/server-side-render": "^3.15.4",
58
58
  "@wordpress/url": "^3.18.1",
59
- "@wordpress/viewport": "^4.15.2",
59
+ "@wordpress/viewport": "^4.15.3",
60
60
  "change-case": "^4.1.2",
61
61
  "classnames": "^2.3.1",
62
62
  "colord": "^2.7.0",
@@ -73,5 +73,5 @@
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "54a676dba557a76062d3bf91bfe8a3e3ea12d254"
76
+ "gitHead": "491b4b522dffb4d25aca066ec55500f456ac4aa3"
77
77
  }
@@ -1,8 +1,13 @@
1
- // Provide a minimum of overflow handling and ensure the code markup inherits
2
- // the font-family set on pre.
3
- .wp-block-code code {
4
- display: block;
5
- font-family: inherit;
6
- overflow-wrap: break-word;
7
- white-space: pre-wrap;
1
+ .wp-block-code {
2
+ // This block has customizable padding, border-box makes that more predictable.
3
+ box-sizing: border-box;
4
+
5
+ // Provide a minimum of overflow handling and ensure the code markup inherits
6
+ // the font-family set on pre.
7
+ code {
8
+ display: block;
9
+ font-family: inherit;
10
+ overflow-wrap: break-word;
11
+ white-space: pre-wrap;
12
+ }
8
13
  }
@@ -282,16 +282,18 @@ function Navigation( {
282
282
  hasResolvedNavigationMenus &&
283
283
  ! hasUncontrolledInnerBlocks;
284
284
 
285
- if ( isPlaceholder && ! ref ) {
286
- /**
287
- * this fallback only displays (both in editor and on front)
288
- * the list of pages block if no menu is available as a fallback.
289
- * We don't want the fallback to request a save,
290
- * nor to be undoable, hence we mark it non persistent.
291
- */
292
- __unstableMarkNextChangeAsNotPersistent();
293
- replaceInnerBlocks( clientId, [ createBlock( 'core/page-list' ) ] );
294
- }
285
+ useEffect( () => {
286
+ if ( isPlaceholder && ! ref ) {
287
+ /**
288
+ * this fallback only displays (both in editor and on front)
289
+ * the list of pages block if no menu is available as a fallback.
290
+ * We don't want the fallback to request a save,
291
+ * nor to be undoable, hence we mark it non persistent.
292
+ */
293
+ __unstableMarkNextChangeAsNotPersistent();
294
+ replaceInnerBlocks( clientId, [ createBlock( 'core/page-list' ) ] );
295
+ }
296
+ }, [ clientId, isPlaceholder, ref ] );
295
297
 
296
298
  const isEntityAvailable =
297
299
  ! isNavigationMenuMissing && isNavigationMenuResolved;
@@ -46,7 +46,9 @@ function EditableContent( { layout, context = {} } ) {
46
46
  return getSettings()?.supportsLayout;
47
47
  }, [] );
48
48
  const defaultLayout = useSetting( 'layout' ) || {};
49
- const usedLayout = !! layout && layout.inherit ? defaultLayout : layout;
49
+ const usedLayout = ! layout?.type
50
+ ? { ...defaultLayout, ...layout, type: 'default' }
51
+ : { ...defaultLayout, ...layout };
50
52
  const [ blocks, onInput, onChange ] = useEntityBlockEditor(
51
53
  'postType',
52
54
  postType,
@@ -62,7 +62,7 @@
62
62
  "color": true,
63
63
  "radius": true,
64
64
  "width": true,
65
- "__experimentalSelector": "img, .block-editor-media-placeholder",
65
+ "__experimentalSelector": "img, .block-editor-media-placeholder, .wp-block-post-featured-image__overlay",
66
66
  "__experimentalSkipSerialization": true,
67
67
  "__experimentalDefaultControls": {
68
68
  "color": true,
@@ -6,87 +6,94 @@
6
6
  backdrop-filter: none; // Removes background blur so the overlay's actual color is visible.
7
7
  }
8
8
 
9
- &.wp-block-post-featured-image {
10
- // Style the placeholder.
11
- .wp-block-post-featured-image__placeholder,
12
- .components-placeholder {
13
- justify-content: center;
14
- align-items: center;
15
- padding: 0;
9
+ // Style the placeholder.
10
+ .wp-block-post-featured-image__placeholder,
11
+ .components-placeholder {
12
+ justify-content: center;
13
+ align-items: center;
14
+ padding: 0;
16
15
 
17
- // Hide the upload button, as it's also available in the media library.
18
- .components-form-file-upload {
19
- display: none;
20
- }
16
+ // Hide the upload button, as it's also available in the media library.
17
+ .components-form-file-upload {
18
+ display: none;
19
+ }
21
20
 
22
- // Style the upload button.
23
- .components-button.components-button {
24
- padding: 0;
25
- display: flex;
26
- justify-content: center;
27
- align-items: center;
28
- width: $grid-unit-60;
29
- height: $grid-unit-60;
30
- border-radius: 50%;
31
- position: relative;
32
- background: var(--wp-admin-theme-color);
33
- border-color: var(--wp-admin-theme-color);
34
- border-style: solid;
35
- color: $white;
21
+ // Style the upload button.
22
+ .components-button {
23
+ padding: 0;
24
+ display: flex;
25
+ justify-content: center;
26
+ align-items: center;
27
+ width: $grid-unit-60;
28
+ height: $grid-unit-60;
29
+ border-radius: 50%;
30
+ position: relative;
31
+ background: var(--wp-admin-theme-color);
32
+ border-color: var(--wp-admin-theme-color);
33
+ border-style: solid;
34
+ color: $white;
36
35
 
37
- > svg {
38
- color: inherit;
39
- }
36
+ > svg {
37
+ color: inherit;
40
38
  }
39
+ }
41
40
 
42
- // Show default placeholder height when not resized.
43
- min-height: 200px;
44
-
45
- // The following override the default placeholder styles that remove
46
- // its border so that a user selection for border color or width displays
47
- // a visual border.
48
- &:where(.has-border-color) {
49
- border-style: solid;
50
- }
51
- &:where([style*="border-top-color"]) {
52
- border-top-style: solid;
53
- }
54
- &:where([style*="border-right-color"]) {
55
- border-right-style: solid;
56
- }
57
- &:where([style*="border-bottom-color"]) {
58
- border-bottom-style: solid;
59
- }
60
- &:where([style*="border-left-color"]) {
61
- border-left-style: solid;
62
- }
41
+ // Show default placeholder height when not resized.
42
+ min-height: 200px;
43
+ }
63
44
 
64
- &:where([style*="border-width"]) {
65
- border-style: solid;
66
- }
67
- &:where([style*="border-top-width"]) {
68
- border-top-style: solid;
69
- }
70
- &:where([style*="border-right-width"]) {
71
- border-right-style: solid;
72
- }
73
- &:where([style*="border-bottom-width"]) {
74
- border-bottom-style: solid;
75
- }
76
- &:where([style*="border-left-width"]) {
77
- border-left-style: solid;
78
- }
45
+ // The following override the default placeholder styles that remove
46
+ // its border so that a user selection for border color or width displays
47
+ // a visual border. They also override the `img { border: none; }` applied
48
+ // by core.
49
+ .wp-block-post-featured-image__placeholder,
50
+ .components-placeholder,
51
+ img {
52
+ // The following is required to overcome WP Core applying styles that clear
53
+ // img borders with a higher specificity than those added by the border
54
+ // block support to provide a default border-style of solid when a border
55
+ // color or width has been set.
56
+ &:where(.has-border-color) {
57
+ border-style: solid;
58
+ }
59
+ &:where([style*="border-top-color"]) {
60
+ border-top-style: solid;
61
+ }
62
+ &:where([style*="border-right-color"]) {
63
+ border-right-style: solid;
64
+ }
65
+ &:where([style*="border-bottom-color"]) {
66
+ border-bottom-style: solid;
67
+ }
68
+ &:where([style*="border-left-color"]) {
69
+ border-left-style: solid;
79
70
  }
80
71
 
81
- // Provide a minimum size for the placeholder when resized.
82
- // Note, this should be as small as we can afford it, and exists only
83
- // to ensure there's room for the upload button.
84
- &[style*="height"] .components-placeholder {
85
- min-height: $grid-unit-60;
86
- min-width: $grid-unit-60;
87
- height: 100%;
88
- width: 100%;
72
+ &:where([style*="border-width"]) {
73
+ border-style: solid;
74
+ }
75
+ &:where([style*="border-top-width"]) {
76
+ border-top-style: solid;
77
+ }
78
+ &:where([style*="border-right-width"]) {
79
+ border-right-style: solid;
89
80
  }
81
+ &:where([style*="border-bottom-width"]) {
82
+ border-bottom-style: solid;
83
+ }
84
+ &:where([style*="border-left-width"]) {
85
+ border-left-style: solid;
86
+ }
87
+ }
88
+
89
+ // Provide a minimum size for the placeholder when resized.
90
+ // Note, this should be as small as we can afford it, and exists only
91
+ // to ensure there's room for the upload button.
92
+ &[style*="height"] .components-placeholder {
93
+ min-height: $grid-unit-60;
94
+ min-width: $grid-unit-60;
95
+ height: 100%;
96
+ width: 100%;
90
97
  }
91
98
  }
92
99
 
@@ -83,16 +83,25 @@ function get_block_core_post_featured_image_overlay_element_markup( $attributes
83
83
  $has_custom_gradient = isset( $attributes['customGradient'] ) && $attributes['customGradient'];
84
84
  $has_solid_overlay = isset( $attributes['overlayColor'] ) && $attributes['overlayColor'];
85
85
  $has_custom_overlay = isset( $attributes['customOverlayColor'] ) && $attributes['customOverlayColor'];
86
- $class_names = array(
87
- 'wp-block-post-featured-image__overlay',
88
- );
89
- $styles_properties = array();
86
+ $class_names = array( 'wp-block-post-featured-image__overlay' );
87
+ $styles = array();
90
88
 
91
89
  if ( ! $has_dim_background ) {
92
90
  return '';
93
91
  }
94
92
 
95
- // Generate required classes for the element.
93
+ // Apply border classes and styles.
94
+ $border_attributes = get_block_core_post_featured_image_border_attributes( $attributes );
95
+
96
+ if ( ! empty( $border_attributes['class'] ) ) {
97
+ $class_names[] = $border_attributes['class'];
98
+ }
99
+
100
+ if ( ! empty( $border_attributes['style'] ) ) {
101
+ $styles[] = $border_attributes['style'];
102
+ }
103
+
104
+ // Apply overlay and gradient classes.
96
105
  if ( $has_dim_background ) {
97
106
  $class_names[] = 'has-background-dim';
98
107
  $class_names[] = "has-background-dim-{$attributes['dimRatio']}";
@@ -110,35 +119,20 @@ function get_block_core_post_featured_image_overlay_element_markup( $attributes
110
119
  $class_names[] = "has-{$attributes['gradient']}-gradient-background";
111
120
  }
112
121
 
113
- // Generate required CSS properties and their values.
114
- if ( ! empty( $attributes['style']['border']['radius'] ) ) {
115
- $styles_properties['border-radius'] = $attributes['style']['border']['radius'];
116
- }
117
-
118
- if ( ! empty( $attributes['style']['border']['width'] ) ) {
119
- $styles_properties['border-width'] = $attributes['style']['border']['width'];
120
- }
121
-
122
+ // Apply background styles.
122
123
  if ( $has_custom_gradient ) {
123
- $styles_properties['background-image'] = $attributes['customGradient'];
124
+ $styles[] = sprintf( 'background-image: %s;', $attributes['customGradient'] );
124
125
  }
125
126
 
126
127
  if ( $has_custom_overlay ) {
127
- $styles_properties['background-color'] = $attributes['customOverlayColor'];
128
- }
129
-
130
- $styles = '';
131
-
132
- foreach ( $styles_properties as $style_attribute => $style_attribute_value ) {
133
- $styles .= "{$style_attribute}: $style_attribute_value; ";
128
+ $styles[] = sprintf( 'background-color: %s;', $attributes['customOverlayColor'] );
134
129
  }
135
130
 
136
131
  return sprintf(
137
132
  '<span class="%s" style="%s" aria-hidden="true"></span>',
138
133
  esc_attr( implode( ' ', $class_names ) ),
139
- esc_attr( trim( $styles ) )
134
+ esc_attr( safecss_filter_attr( implode( ' ', $styles ) ) )
140
135
  );
141
-
142
136
  }
143
137
 
144
138
  /**
@@ -47,20 +47,23 @@ const Overlay = ( {
47
47
 
48
48
  return (
49
49
  <>
50
- <span
51
- aria-hidden="true"
52
- className={ classnames(
53
- 'wp-block-post-featured-image__overlay',
54
- dimRatioToClass( dimRatio ),
55
- {
56
- [ overlayColor.class ]: overlayColor.class,
57
- 'has-background-dim': dimRatio !== undefined,
58
- 'has-background-gradient': gradientValue,
59
- [ gradientClass ]: gradientClass,
60
- }
61
- ) }
62
- style={ overlayStyles }
63
- />
50
+ { !! dimRatio && (
51
+ <span
52
+ aria-hidden="true"
53
+ className={ classnames(
54
+ 'wp-block-post-featured-image__overlay',
55
+ dimRatioToClass( dimRatio ),
56
+ {
57
+ [ overlayColor.class ]: overlayColor.class,
58
+ 'has-background-dim': dimRatio !== undefined,
59
+ 'has-background-gradient': gradientValue,
60
+ [ gradientClass ]: gradientClass,
61
+ },
62
+ borderProps.className
63
+ ) }
64
+ style={ overlayStyles }
65
+ />
66
+ ) }
64
67
  <InspectorControls __experimentalGroup="color">
65
68
  <ColorGradientSettingsDropdown
66
69
  __experimentalHasMultipleOrigins
@@ -241,10 +241,7 @@ export default function QueryInspectorControls( {
241
241
  </ToolsPanelItem>
242
242
  ) }
243
243
  { isPostTypeHierarchical &&
244
- ! isControlAllowed(
245
- allowedControls,
246
- 'parents'
247
- ) && (
244
+ isControlAllowed( allowedControls, 'parents' ) && (
248
245
  <ToolsPanelItem
249
246
  hasValue={ () => !! parents?.length }
250
247
  label={ __( 'Parents' ) }
@@ -162,7 +162,7 @@ export function useAllowedControls( attributes ) {
162
162
  select( blocksStore ).getActiveBlockVariation(
163
163
  queryLoopName,
164
164
  attributes
165
- )?.allowControls,
165
+ )?.allowedControls,
166
166
 
167
167
  [ attributes ]
168
168
  );
@@ -29,7 +29,6 @@
29
29
  },
30
30
  "supports": {
31
31
  "anchor": true,
32
- "__experimentalSlashInserter": true,
33
32
  "__experimentalOnEnter": true,
34
33
  "typography": {
35
34
  "fontSize": true,
@@ -62,13 +62,13 @@ export const init = () => {
62
62
  'blockEditor.__unstableCanInsertBlockType',
63
63
  'removeTemplatePartsFromPostTemplates',
64
64
  (
65
- can,
65
+ canInsert,
66
66
  blockType,
67
67
  rootClientId,
68
68
  { getBlock, getBlockParentsByBlockName }
69
69
  ) => {
70
70
  if ( blockType.name !== 'core/template-part' ) {
71
- return can;
71
+ return canInsert;
72
72
  }
73
73
 
74
74
  for ( const disallowedParentType of DISALLOWED_PARENTS ) {