@wordpress/block-library 7.14.3 → 7.14.5
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/comment-template/edit.js +40 -32
- package/build/comment-template/edit.js.map +1 -1
- package/build/comments-title/edit.js +18 -1
- package/build/comments-title/edit.js.map +1 -1
- package/build/group/edit.js +1 -1
- package/build/group/edit.js.map +1 -1
- package/build/list/transforms.js +9 -1
- package/build/list/transforms.js.map +1 -1
- package/build/list-item/edit.js +3 -2
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/hooks/use-merge.js +5 -21
- package/build/list-item/hooks/use-merge.js.map +1 -1
- package/build/navigation/edit/index.js +12 -12
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/index.js +0 -1
- package/build/navigation/index.js.map +1 -1
- package/build/page-list/index.js +1 -5
- package/build/page-list/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/comment-template/edit.js +38 -30
- package/build-module/comment-template/edit.js.map +1 -1
- package/build-module/comments-title/edit.js +18 -2
- package/build-module/comments-title/edit.js.map +1 -1
- package/build-module/group/edit.js +1 -1
- package/build-module/group/edit.js.map +1 -1
- package/build-module/list/transforms.js +9 -1
- package/build-module/list/transforms.js.map +1 -1
- package/build-module/list-item/edit.js +3 -2
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/hooks/use-merge.js +5 -20
- package/build-module/list-item/hooks/use-merge.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/navigation/index.js +0 -1
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/page-list/index.js +1 -5
- package/build-module/page-list/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/comment-author-name/index.php +1 -1
- package/src/comment-template/edit.js +47 -34
- package/src/comments-title/edit.js +24 -1
- package/src/group/edit.js +1 -1
- package/src/list/transforms.js +11 -0
- package/src/list-item/edit.js +2 -1
- package/src/list-item/hooks/use-merge.js +4 -23
- package/src/navigation/block.json +0 -1
- package/src/navigation/edit/index.js +12 -10
- package/src/navigation/index.php +0 -3
- package/src/page-list/block.json +1 -5
- package/src/page-list/index.php +0 -5
- 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
- package/src/template-part/index.php +4 -0
|
@@ -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/navigation/index.php
CHANGED
package/src/page-list/block.json
CHANGED
|
@@ -7,11 +7,7 @@
|
|
|
7
7
|
"description": "Display a list of all pages.",
|
|
8
8
|
"keywords": [ "menu", "navigation" ],
|
|
9
9
|
"textdomain": "default",
|
|
10
|
-
"attributes": {
|
|
11
|
-
"__unstableMaxPages": {
|
|
12
|
-
"type": "number"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
10
|
+
"attributes": {},
|
|
15
11
|
"usesContext": [
|
|
16
12
|
"textColor",
|
|
17
13
|
"customTextColor",
|
package/src/page-list/index.php
CHANGED
|
@@ -299,11 +299,6 @@ function render_block_core_page_list( $attributes, $content, $block ) {
|
|
|
299
299
|
|
|
300
300
|
$nested_pages = block_core_page_list_nest_pages( $top_level_pages, $pages_with_children );
|
|
301
301
|
|
|
302
|
-
// Limit the number of items to be visually displayed.
|
|
303
|
-
if ( ! empty( $attributes['__unstableMaxPages'] ) ) {
|
|
304
|
-
$nested_pages = array_slice( $nested_pages, 0, $attributes['__unstableMaxPages'] );
|
|
305
|
-
}
|
|
306
|
-
|
|
307
302
|
$is_navigation_child = array_key_exists( 'showSubmenuIcon', $block->context );
|
|
308
303
|
|
|
309
304
|
$open_submenus_on_click = array_key_exists( 'openSubmenusOnClick', $block->context ) ? $block->context['openSubmenusOnClick'] : false;
|
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 ) {
|
|
@@ -189,6 +189,10 @@ function build_template_part_block_area_variations() {
|
|
|
189
189
|
* @return array Array containing the block variation objects.
|
|
190
190
|
*/
|
|
191
191
|
function build_template_part_block_instance_variations() {
|
|
192
|
+
// Block themes are unavailable during installation.
|
|
193
|
+
if ( wp_installing() ) {
|
|
194
|
+
return array();
|
|
195
|
+
}
|
|
192
196
|
$variations = array();
|
|
193
197
|
$template_parts = get_block_templates(
|
|
194
198
|
array(
|