@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.
- package/build/navigation/edit/index.js +12 -12
- package/build/navigation/edit/index.js.map +1 -1
- package/build/post-content/edit.js +6 -1
- package/build/post-content/edit.js.map +1 -1
- package/build/post-featured-image/index.js +1 -1
- package/build/post-featured-image/overlay.js +2 -2
- package/build/post-featured-image/overlay.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +1 -1
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/utils.js +1 -1
- package/build/query/utils.js.map +1 -1
- package/build/quote/index.js +0 -1
- package/build/quote/index.js.map +1 -1
- package/build/template-part/index.js +2 -2
- package/build/template-part/index.js.map +1 -1
- package/build-module/navigation/edit/index.js +12 -12
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/post-content/edit.js +6 -1
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/post-featured-image/index.js +1 -1
- package/build-module/post-featured-image/overlay.js +2 -2
- package/build-module/post-featured-image/overlay.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +1 -1
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/utils.js +1 -1
- package/build-module/query/utils.js.map +1 -1
- package/build-module/quote/index.js +0 -1
- package/build-module/quote/index.js.map +1 -1
- package/build-module/template-part/index.js +2 -2
- package/build-module/template-part/index.js.map +1 -1
- package/build-style/code/style-rtl.css +3 -0
- package/build-style/code/style.css +3 -0
- package/build-style/editor-rtl.css +39 -29
- package/build-style/editor.css +39 -29
- package/build-style/post-featured-image/editor-rtl.css +39 -29
- package/build-style/post-featured-image/editor.css +39 -29
- package/build-style/style-rtl.css +3 -0
- package/build-style/style.css +3 -0
- package/package.json +12 -12
- package/src/code/style.scss +12 -7
- package/src/navigation/edit/index.js +12 -10
- package/src/post-content/edit.js +3 -1
- package/src/post-featured-image/block.json +1 -1
- package/src/post-featured-image/editor.scss +79 -72
- package/src/post-featured-image/index.php +18 -24
- package/src/post-featured-image/overlay.js +17 -14
- package/src/query/edit/inspector-controls/index.js +1 -4
- package/src/query/utils.js +1 -1
- package/src/quote/block.json +0 -1
- 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
|
|
83
|
-
.wp-block-post-featured-image
|
|
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
|
|
90
|
-
.wp-block-post-featured-image
|
|
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
|
|
94
|
-
.wp-block-post-featured-image
|
|
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
|
|
109
|
-
.wp-block-post-featured-image
|
|
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
|
|
113
|
-
.wp-block-post-featured-image
|
|
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
|
|
117
|
-
.wp-block-post-featured-image
|
|
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
|
|
121
|
-
.wp-block-post-featured-image
|
|
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
|
|
125
|
-
.wp-block-post-featured-image
|
|
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
|
|
129
|
-
.wp-block-post-featured-image
|
|
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
|
|
133
|
-
.wp-block-post-featured-image
|
|
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
|
|
137
|
-
.wp-block-post-featured-image
|
|
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
|
|
141
|
-
.wp-block-post-featured-image
|
|
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
|
|
145
|
-
.wp-block-post-featured-image
|
|
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
|
|
149
|
-
.wp-block-post-featured-image
|
|
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
|
|
162
|
+
.wp-block-post-featured-image[style*=height] .components-placeholder {
|
|
153
163
|
min-height: 48px;
|
|
154
164
|
min-width: 48px;
|
|
155
165
|
height: 100%;
|
package/build-style/style.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "7.14.
|
|
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.
|
|
39
|
-
"@wordpress/blocks": "^11.16.
|
|
40
|
-
"@wordpress/components": "^21.0.
|
|
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.
|
|
43
|
-
"@wordpress/data": "^7.1.
|
|
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.
|
|
53
|
+
"@wordpress/notices": "^3.17.3",
|
|
54
54
|
"@wordpress/primitives": "^3.15.1",
|
|
55
|
-
"@wordpress/reusable-blocks": "^3.15.
|
|
56
|
-
"@wordpress/rich-text": "^5.15.
|
|
57
|
-
"@wordpress/server-side-render": "^3.15.
|
|
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.
|
|
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": "
|
|
76
|
+
"gitHead": "491b4b522dffb4d25aca066ec55500f456ac4aa3"
|
|
77
77
|
}
|
package/src/code/style.scss
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
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;
|
package/src/post-content/edit.js
CHANGED
|
@@ -46,7 +46,9 @@ function EditableContent( { layout, context = {} } ) {
|
|
|
46
46
|
return getSettings()?.supportsLayout;
|
|
47
47
|
}, [] );
|
|
48
48
|
const defaultLayout = useSetting( 'layout' ) || {};
|
|
49
|
-
const usedLayout =
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
36
|
+
> svg {
|
|
37
|
+
color: inherit;
|
|
40
38
|
}
|
|
39
|
+
}
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
$
|
|
124
|
+
$styles[] = sprintf( 'background-image: %s;', $attributes['customGradient'] );
|
|
124
125
|
}
|
|
125
126
|
|
|
126
127
|
if ( $has_custom_overlay ) {
|
|
127
|
-
$
|
|
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(
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
|
|
245
|
-
allowedControls,
|
|
246
|
-
'parents'
|
|
247
|
-
) && (
|
|
244
|
+
isControlAllowed( allowedControls, 'parents' ) && (
|
|
248
245
|
<ToolsPanelItem
|
|
249
246
|
hasValue={ () => !! parents?.length }
|
|
250
247
|
label={ __( 'Parents' ) }
|
package/src/query/utils.js
CHANGED
package/src/quote/block.json
CHANGED
|
@@ -62,13 +62,13 @@ export const init = () => {
|
|
|
62
62
|
'blockEditor.__unstableCanInsertBlockType',
|
|
63
63
|
'removeTemplatePartsFromPostTemplates',
|
|
64
64
|
(
|
|
65
|
-
|
|
65
|
+
canInsert,
|
|
66
66
|
blockType,
|
|
67
67
|
rootClientId,
|
|
68
68
|
{ getBlock, getBlockParentsByBlockName }
|
|
69
69
|
) => {
|
|
70
70
|
if ( blockType.name !== 'core/template-part' ) {
|
|
71
|
-
return
|
|
71
|
+
return canInsert;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
for ( const disallowedParentType of DISALLOWED_PARENTS ) {
|