@wordpress/block-library 8.3.3 → 8.4.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.
- package/CHANGELOG.md +2 -0
- package/build/button/edit.js +3 -1
- package/build/button/edit.js.map +1 -1
- package/build/button/index.js +17 -6
- package/build/button/index.js.map +1 -1
- package/build/file/index.js +10 -1
- package/build/file/index.js.map +1 -1
- package/build/image/image.js +12 -11
- package/build/image/image.js.map +1 -1
- package/build/latest-comments/edit.js +6 -2
- package/build/latest-comments/edit.js.map +1 -1
- package/build/latest-comments/index.js +13 -0
- package/build/latest-comments/index.js.map +1 -1
- package/build/navigation/edit/menu-inspector-controls.js +3 -4
- package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +14 -11
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +1 -1
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation-link/edit.js +4 -0
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/link-ui.js +1 -0
- package/build/navigation-link/link-ui.js.map +1 -1
- package/build/navigation-submenu/edit.js +4 -0
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/edit.js +5 -4
- package/build/page-list/edit.js.map +1 -1
- package/build/page-list/use-convert-to-navigation-links.js +61 -5
- package/build/page-list/use-convert-to-navigation-links.js.map +1 -1
- package/build/post-excerpt/edit.js +49 -3
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-excerpt/index.js +4 -0
- package/build/post-excerpt/index.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js +52 -1
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/post-featured-image/edit.js +9 -4
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/index.js +3 -0
- package/build/post-featured-image/index.js.map +1 -1
- package/build/site-logo/edit.js +7 -11
- package/build/site-logo/edit.js.map +1 -1
- package/build/table/edit.js +3 -3
- package/build/table/edit.js.map +1 -1
- package/build/table-of-contents/utils.js +1 -1
- package/build/table-of-contents/utils.js.map +1 -1
- package/build/verse/index.js +6 -0
- package/build/verse/index.js.map +1 -1
- package/build-module/button/edit.js +2 -1
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/index.js +17 -6
- package/build-module/button/index.js.map +1 -1
- package/build-module/file/index.js +10 -1
- package/build-module/file/index.js.map +1 -1
- package/build-module/image/image.js +12 -11
- package/build-module/image/image.js.map +1 -1
- package/build-module/latest-comments/edit.js +6 -2
- package/build-module/latest-comments/edit.js.map +1 -1
- package/build-module/latest-comments/index.js +13 -0
- package/build-module/latest-comments/index.js.map +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js +2 -2
- package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +14 -10
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +1 -1
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation-link/edit.js +4 -0
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/link-ui.js +1 -0
- package/build-module/navigation-link/link-ui.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +4 -0
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/edit.js +5 -4
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/page-list/use-convert-to-navigation-links.js +61 -5
- package/build-module/page-list/use-convert-to-navigation-links.js.map +1 -1
- package/build-module/post-excerpt/edit.js +52 -5
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-excerpt/index.js +4 -0
- package/build-module/post-excerpt/index.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js +52 -1
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/post-featured-image/edit.js +9 -4
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/index.js +3 -0
- package/build-module/post-featured-image/index.js.map +1 -1
- package/build-module/site-logo/edit.js +7 -11
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/table/edit.js +3 -3
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table-of-contents/utils.js +1 -1
- package/build-module/table-of-contents/utils.js.map +1 -1
- package/build-module/verse/index.js +6 -0
- package/build-module/verse/index.js.map +1 -1
- package/build-style/avatar/style-rtl.css +3 -0
- package/build-style/avatar/style.css +3 -0
- package/build-style/button/editor-rtl.css +31 -0
- package/build-style/button/editor.css +31 -0
- package/build-style/button/style-rtl.css +31 -0
- package/build-style/button/style.css +31 -0
- package/build-style/editor-rtl.css +32 -0
- package/build-style/editor.css +32 -0
- package/build-style/file/style-rtl.css +1 -0
- package/build-style/file/style.css +1 -0
- package/build-style/image/editor-rtl.css +1 -0
- package/build-style/image/editor.css +1 -0
- package/build-style/image/style-rtl.css +6 -2
- package/build-style/image/style.css +6 -0
- package/build-style/latest-comments/style-rtl.css +18 -5
- package/build-style/latest-comments/style.css +18 -5
- package/build-style/quote/style-rtl.css +5 -5
- package/build-style/quote/style.css +5 -5
- package/build-style/style-rtl.css +64 -12
- package/build-style/style.css +64 -10
- package/build-types/table-of-contents/utils.d.ts +1 -1
- package/package.json +30 -30
- package/src/avatar/index.php +67 -63
- package/src/avatar/style.scss +3 -0
- package/src/button/block.json +17 -6
- package/src/button/edit.js +2 -1
- package/src/button/editor.scss +36 -0
- package/src/button/style.scss +37 -1
- package/src/file/block.json +10 -1
- package/src/file/style.scss +1 -0
- package/src/image/editor.scss +1 -0
- package/src/image/image.js +5 -11
- package/src/image/style.scss +13 -0
- package/src/latest-comments/block.json +13 -0
- package/src/latest-comments/edit.js +9 -2
- package/src/latest-comments/style.scss +25 -7
- package/src/navigation/edit/menu-inspector-controls.js +1 -3
- package/src/navigation/edit/navigation-menu-selector.js +12 -26
- package/src/navigation/edit/test/navigation-menu-selector.js +638 -0
- package/src/navigation/index.php +8 -6
- package/src/navigation/use-navigation-menu.js +1 -1
- package/src/navigation-link/edit.js +3 -0
- package/src/navigation-link/link-ui.js +1 -0
- package/src/navigation-submenu/edit.js +3 -0
- package/src/page-list/edit.js +6 -5
- package/src/page-list/index.php +4 -4
- package/src/page-list/test/convert-to-links-modal.js +134 -0
- package/src/page-list/use-convert-to-navigation-links.js +64 -4
- package/src/post-excerpt/block.json +4 -0
- package/src/post-excerpt/edit.js +72 -7
- package/src/post-excerpt/index.php +29 -5
- package/src/post-featured-image/block.json +3 -0
- package/src/post-featured-image/dimension-controls.js +64 -2
- package/src/post-featured-image/edit.js +18 -6
- package/src/post-featured-image/index.php +25 -9
- package/src/post-title/index.php +3 -3
- package/src/quote/style.scss +2 -2
- package/src/site-logo/edit.js +3 -6
- package/src/table/edit.js +3 -3
- package/src/table-of-contents/utils.ts +1 -1
- package/src/template-part/index.php +1 -1
- package/src/verse/block.json +6 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/navigation/leaf-more-menu.js +0 -95
- package/build/navigation/leaf-more-menu.js.map +0 -1
- package/build-module/navigation/leaf-more-menu.js +0 -76
- package/build-module/navigation/leaf-more-menu.js.map +0 -1
- package/src/navigation/leaf-more-menu.js +0 -93
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.4.0",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -31,34 +31,34 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.16.0",
|
|
34
|
-
"@wordpress/a11y": "^3.
|
|
35
|
-
"@wordpress/api-fetch": "^6.
|
|
36
|
-
"@wordpress/autop": "^3.
|
|
37
|
-
"@wordpress/blob": "^3.
|
|
38
|
-
"@wordpress/block-editor": "^11.
|
|
39
|
-
"@wordpress/blocks": "^12.
|
|
40
|
-
"@wordpress/components": "^23.
|
|
41
|
-
"@wordpress/compose": "^6.
|
|
42
|
-
"@wordpress/core-data": "^6.
|
|
43
|
-
"@wordpress/data": "^8.
|
|
44
|
-
"@wordpress/date": "^4.
|
|
45
|
-
"@wordpress/deprecated": "^3.
|
|
46
|
-
"@wordpress/dom": "^3.
|
|
47
|
-
"@wordpress/element": "^5.
|
|
48
|
-
"@wordpress/escape-html": "^2.
|
|
49
|
-
"@wordpress/hooks": "^3.
|
|
50
|
-
"@wordpress/html-entities": "^3.
|
|
51
|
-
"@wordpress/i18n": "^4.
|
|
52
|
-
"@wordpress/icons": "^9.
|
|
53
|
-
"@wordpress/keycodes": "^3.
|
|
54
|
-
"@wordpress/notices": "^3.
|
|
55
|
-
"@wordpress/primitives": "^3.
|
|
56
|
-
"@wordpress/private-apis": "^0.
|
|
57
|
-
"@wordpress/reusable-blocks": "^4.
|
|
58
|
-
"@wordpress/rich-text": "^6.
|
|
59
|
-
"@wordpress/server-side-render": "^4.
|
|
60
|
-
"@wordpress/url": "^3.
|
|
61
|
-
"@wordpress/viewport": "^5.
|
|
34
|
+
"@wordpress/a11y": "^3.27.0",
|
|
35
|
+
"@wordpress/api-fetch": "^6.24.0",
|
|
36
|
+
"@wordpress/autop": "^3.27.0",
|
|
37
|
+
"@wordpress/blob": "^3.27.0",
|
|
38
|
+
"@wordpress/block-editor": "^11.4.0",
|
|
39
|
+
"@wordpress/blocks": "^12.4.0",
|
|
40
|
+
"@wordpress/components": "^23.4.0",
|
|
41
|
+
"@wordpress/compose": "^6.4.0",
|
|
42
|
+
"@wordpress/core-data": "^6.4.0",
|
|
43
|
+
"@wordpress/data": "^8.4.0",
|
|
44
|
+
"@wordpress/date": "^4.27.0",
|
|
45
|
+
"@wordpress/deprecated": "^3.27.0",
|
|
46
|
+
"@wordpress/dom": "^3.27.0",
|
|
47
|
+
"@wordpress/element": "^5.4.0",
|
|
48
|
+
"@wordpress/escape-html": "^2.27.0",
|
|
49
|
+
"@wordpress/hooks": "^3.27.0",
|
|
50
|
+
"@wordpress/html-entities": "^3.27.0",
|
|
51
|
+
"@wordpress/i18n": "^4.27.0",
|
|
52
|
+
"@wordpress/icons": "^9.18.0",
|
|
53
|
+
"@wordpress/keycodes": "^3.27.0",
|
|
54
|
+
"@wordpress/notices": "^3.27.0",
|
|
55
|
+
"@wordpress/primitives": "^3.25.0",
|
|
56
|
+
"@wordpress/private-apis": "^0.9.0",
|
|
57
|
+
"@wordpress/reusable-blocks": "^4.4.0",
|
|
58
|
+
"@wordpress/rich-text": "^6.4.0",
|
|
59
|
+
"@wordpress/server-side-render": "^4.4.0",
|
|
60
|
+
"@wordpress/url": "^3.28.0",
|
|
61
|
+
"@wordpress/viewport": "^5.4.0",
|
|
62
62
|
"change-case": "^4.1.2",
|
|
63
63
|
"classnames": "^2.3.1",
|
|
64
64
|
"colord": "^2.7.0",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"publishConfig": {
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "c25ff895413bad4354c55c0c2d732552618b0d56"
|
|
81
81
|
}
|
package/src/avatar/index.php
CHANGED
|
@@ -16,67 +16,19 @@
|
|
|
16
16
|
function render_block_core_avatar( $attributes, $content, $block ) {
|
|
17
17
|
$size = isset( $attributes['size'] ) ? $attributes['size'] : 96;
|
|
18
18
|
$wrapper_attributes = get_block_wrapper_attributes();
|
|
19
|
+
$border_attributes = get_block_core_avatar_border_attributes( $attributes );
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
// Class gets passed through `esc_attr` via `get_avatar`.
|
|
22
|
+
$image_classes = ! empty( $border_attributes['class'] )
|
|
23
|
+
? "wp-block-avatar__image {$border_attributes['class']}"
|
|
24
|
+
: 'wp-block-avatar__image';
|
|
21
25
|
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Add border radius styles.
|
|
31
|
-
$has_border_radius = ! empty( $attributes['style']['border']['radius'] );
|
|
32
|
-
|
|
33
|
-
if ( $has_border_radius ) {
|
|
34
|
-
$border_radius = $attributes['style']['border']['radius'];
|
|
35
|
-
|
|
36
|
-
if ( is_array( $border_radius ) ) {
|
|
37
|
-
// Apply styles for individual corner border radii.
|
|
38
|
-
foreach ( $border_radius as $key => $value ) {
|
|
39
|
-
if ( null !== $value ) {
|
|
40
|
-
$name = _wp_to_kebab_case( $key );
|
|
41
|
-
// Add shared styles for individual border radii.
|
|
42
|
-
$border_style = sprintf(
|
|
43
|
-
'border-%s-radius: %s;',
|
|
44
|
-
esc_attr( $name ),
|
|
45
|
-
esc_attr( $value )
|
|
46
|
-
);
|
|
47
|
-
$image_styles[] = $border_style;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
} else {
|
|
51
|
-
$border_style = sprintf( 'border-radius: %s;', esc_attr( $border_radius ) );
|
|
52
|
-
$image_styles[] = $border_style;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Add border color styles.
|
|
57
|
-
$has_border_color = ! empty( $attributes['style']['border']['color'] );
|
|
58
|
-
|
|
59
|
-
if ( $has_border_color ) {
|
|
60
|
-
$border_color = $attributes['style']['border']['color'];
|
|
61
|
-
$image_styles[] = sprintf( 'border-color: %s;', esc_attr( $border_color ) );
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// Add border style (solid, dashed, dotted ).
|
|
65
|
-
$has_border_style = ! empty( $attributes['style']['border']['style'] );
|
|
66
|
-
|
|
67
|
-
if ( $has_border_style ) {
|
|
68
|
-
$border_style = $attributes['style']['border']['style'];
|
|
69
|
-
$image_styles[] = sprintf( 'border-style: %s;', esc_attr( $border_style ) );
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// Add border classes to the avatar image for both custom colors and palette colors.
|
|
73
|
-
$image_classes = '';
|
|
74
|
-
if ( $has_border_color || isset( $attributes['borderColor'] ) ) {
|
|
75
|
-
$image_classes .= 'has-border-color';
|
|
76
|
-
}
|
|
77
|
-
if ( isset( $attributes['borderColor'] ) ) {
|
|
78
|
-
$image_classes .= ' has-' . $attributes['borderColor'] . '-border-color';
|
|
79
|
-
}
|
|
26
|
+
// Unlike class, `get_avatar` doesn't filter the styles via `esc_attr`.
|
|
27
|
+
// The style engine does pass the border styles through
|
|
28
|
+
// `safecss_filter_attr` however.
|
|
29
|
+
$image_styles = ! empty( $border_attributes['style'] )
|
|
30
|
+
? sprintf( ' style="%s"', esc_attr( $border_attributes['style'] ) )
|
|
31
|
+
: '';
|
|
80
32
|
|
|
81
33
|
if ( ! isset( $block->context['commentId'] ) ) {
|
|
82
34
|
$author_id = isset( $attributes['userId'] ) ? $attributes['userId'] : get_post_field( 'post_author', $block->context['postId'] );
|
|
@@ -89,8 +41,8 @@ function render_block_core_avatar( $attributes, $content, $block ) {
|
|
|
89
41
|
'',
|
|
90
42
|
$alt,
|
|
91
43
|
array(
|
|
92
|
-
'extra_attr' =>
|
|
93
|
-
'class' =>
|
|
44
|
+
'extra_attr' => $image_styles,
|
|
45
|
+
'class' => $image_classes,
|
|
94
46
|
)
|
|
95
47
|
);
|
|
96
48
|
if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) {
|
|
@@ -116,8 +68,8 @@ function render_block_core_avatar( $attributes, $content, $block ) {
|
|
|
116
68
|
'',
|
|
117
69
|
$alt,
|
|
118
70
|
array(
|
|
119
|
-
'extra_attr' =>
|
|
120
|
-
'class' =>
|
|
71
|
+
'extra_attr' => $image_styles,
|
|
72
|
+
'class' => $image_classes,
|
|
121
73
|
)
|
|
122
74
|
);
|
|
123
75
|
if ( isset( $attributes['isLink'] ) && $attributes['isLink'] && isset( $comment->comment_author_url ) && '' !== $comment->comment_author_url ) {
|
|
@@ -132,6 +84,58 @@ function render_block_core_avatar( $attributes, $content, $block ) {
|
|
|
132
84
|
return sprintf( '<div %1s>%2s</div>', $wrapper_attributes, $avatar_block );
|
|
133
85
|
}
|
|
134
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Generates class names and styles to apply the border support styles for
|
|
89
|
+
* the Avatar block.
|
|
90
|
+
*
|
|
91
|
+
* @param array $attributes The block attributes.
|
|
92
|
+
* @return array The border-related classnames and styles for the block.
|
|
93
|
+
*/
|
|
94
|
+
function get_block_core_avatar_border_attributes( $attributes ) {
|
|
95
|
+
$border_styles = array();
|
|
96
|
+
$sides = array( 'top', 'right', 'bottom', 'left' );
|
|
97
|
+
|
|
98
|
+
// Border radius.
|
|
99
|
+
if ( isset( $attributes['style']['border']['radius'] ) ) {
|
|
100
|
+
$border_styles['radius'] = $attributes['style']['border']['radius'];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Border style.
|
|
104
|
+
if ( isset( $attributes['style']['border']['style'] ) ) {
|
|
105
|
+
$border_styles['style'] = $attributes['style']['border']['style'];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Border width.
|
|
109
|
+
if ( isset( $attributes['style']['border']['width'] ) ) {
|
|
110
|
+
$border_styles['width'] = $attributes['style']['border']['width'];
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Border color.
|
|
114
|
+
$preset_color = array_key_exists( 'borderColor', $attributes ) ? "var:preset|color|{$attributes['borderColor']}" : null;
|
|
115
|
+
$custom_color = _wp_array_get( $attributes, array( 'style', 'border', 'color' ), null );
|
|
116
|
+
$border_styles['color'] = $preset_color ? $preset_color : $custom_color;
|
|
117
|
+
|
|
118
|
+
// Individual border styles e.g. top, left etc.
|
|
119
|
+
foreach ( $sides as $side ) {
|
|
120
|
+
$border = _wp_array_get( $attributes, array( 'style', 'border', $side ), null );
|
|
121
|
+
$border_styles[ $side ] = array(
|
|
122
|
+
'color' => isset( $border['color'] ) ? $border['color'] : null,
|
|
123
|
+
'style' => isset( $border['style'] ) ? $border['style'] : null,
|
|
124
|
+
'width' => isset( $border['width'] ) ? $border['width'] : null,
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
$styles = wp_style_engine_get_styles( array( 'border' => $border_styles ) );
|
|
129
|
+
$attributes = array();
|
|
130
|
+
if ( ! empty( $styles['classnames'] ) ) {
|
|
131
|
+
$attributes['class'] = $styles['classnames'];
|
|
132
|
+
}
|
|
133
|
+
if ( ! empty( $styles['css'] ) ) {
|
|
134
|
+
$attributes['style'] = $styles['css'];
|
|
135
|
+
}
|
|
136
|
+
return $attributes;
|
|
137
|
+
}
|
|
138
|
+
|
|
135
139
|
/**
|
|
136
140
|
* Registers the `core/avatar` block on the server.
|
|
137
141
|
*/
|
package/src/avatar/style.scss
CHANGED
package/src/button/block.json
CHANGED
|
@@ -16,30 +16,35 @@
|
|
|
16
16
|
"type": "string",
|
|
17
17
|
"source": "attribute",
|
|
18
18
|
"selector": "a",
|
|
19
|
-
"attribute": "href"
|
|
19
|
+
"attribute": "href",
|
|
20
|
+
"__experimentalRole": "content"
|
|
20
21
|
},
|
|
21
22
|
"title": {
|
|
22
23
|
"type": "string",
|
|
23
24
|
"source": "attribute",
|
|
24
25
|
"selector": "a",
|
|
25
|
-
"attribute": "title"
|
|
26
|
+
"attribute": "title",
|
|
27
|
+
"__experimentalRole": "content"
|
|
26
28
|
},
|
|
27
29
|
"text": {
|
|
28
30
|
"type": "string",
|
|
29
31
|
"source": "html",
|
|
30
|
-
"selector": "a"
|
|
32
|
+
"selector": "a",
|
|
33
|
+
"__experimentalRole": "content"
|
|
31
34
|
},
|
|
32
35
|
"linkTarget": {
|
|
33
36
|
"type": "string",
|
|
34
37
|
"source": "attribute",
|
|
35
38
|
"selector": "a",
|
|
36
|
-
"attribute": "target"
|
|
39
|
+
"attribute": "target",
|
|
40
|
+
"__experimentalRole": "content"
|
|
37
41
|
},
|
|
38
42
|
"rel": {
|
|
39
43
|
"type": "string",
|
|
40
44
|
"source": "attribute",
|
|
41
45
|
"selector": "a",
|
|
42
|
-
"attribute": "rel"
|
|
46
|
+
"attribute": "rel",
|
|
47
|
+
"__experimentalRole": "content"
|
|
43
48
|
},
|
|
44
49
|
"placeholder": {
|
|
45
50
|
"type": "string"
|
|
@@ -92,10 +97,16 @@
|
|
|
92
97
|
}
|
|
93
98
|
},
|
|
94
99
|
"__experimentalBorder": {
|
|
100
|
+
"color": true,
|
|
95
101
|
"radius": true,
|
|
102
|
+
"style": true,
|
|
103
|
+
"width": true,
|
|
96
104
|
"__experimentalSkipSerialization": true,
|
|
97
105
|
"__experimentalDefaultControls": {
|
|
98
|
-
"
|
|
106
|
+
"color": true,
|
|
107
|
+
"radius": true,
|
|
108
|
+
"style": true,
|
|
109
|
+
"width": true
|
|
99
110
|
}
|
|
100
111
|
},
|
|
101
112
|
"__experimentalSelector": ".wp-block-button .wp-block-button__link"
|
package/src/button/edit.js
CHANGED
|
@@ -32,6 +32,7 @@ import { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';
|
|
|
32
32
|
import { link, linkOff } from '@wordpress/icons';
|
|
33
33
|
import { createBlock } from '@wordpress/blocks';
|
|
34
34
|
import { useMergeRefs } from '@wordpress/compose';
|
|
35
|
+
import { prependHTTP } from '@wordpress/url';
|
|
35
36
|
|
|
36
37
|
const NEW_TAB_REL = 'noreferrer noopener';
|
|
37
38
|
|
|
@@ -240,7 +241,7 @@ function ButtonEdit( props ) {
|
|
|
240
241
|
url: newURL = '',
|
|
241
242
|
opensInNewTab: newOpensInNewTab,
|
|
242
243
|
} ) => {
|
|
243
|
-
setAttributes( { url: newURL } );
|
|
244
|
+
setAttributes( { url: prependHTTP( newURL ) } );
|
|
244
245
|
|
|
245
246
|
if ( opensInNewTab !== newOpensInNewTab ) {
|
|
246
247
|
onToggleOpenInNewTab( newOpensInNewTab );
|
package/src/button/editor.scss
CHANGED
|
@@ -79,3 +79,39 @@ div[data-type="core/button"] {
|
|
|
79
79
|
.editor-styles-wrapper .wp-block-button[style*="text-decoration"] .wp-block-button__link {
|
|
80
80
|
text-decoration: inherit;
|
|
81
81
|
}
|
|
82
|
+
|
|
83
|
+
.editor-styles-wrapper .wp-block-button .wp-block-button__link {
|
|
84
|
+
// The following styles ensure a default border is applied when the user selects only a border color or style in the editor,
|
|
85
|
+
// but no width. They override the `border-width: 0;` applied by core's theme.json via the Elements API button.
|
|
86
|
+
&:where(.has-border-color) {
|
|
87
|
+
border-width: initial;
|
|
88
|
+
}
|
|
89
|
+
&:where([style*="border-top-color"]) {
|
|
90
|
+
border-top-width: initial;
|
|
91
|
+
}
|
|
92
|
+
&:where([style*="border-right-color"]) {
|
|
93
|
+
border-right-width: initial;
|
|
94
|
+
}
|
|
95
|
+
&:where([style*="border-bottom-color"]) {
|
|
96
|
+
border-bottom-width: initial;
|
|
97
|
+
}
|
|
98
|
+
&:where([style*="border-left-color"]) {
|
|
99
|
+
border-left-width: initial;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&:where([style*="border-style"]) {
|
|
103
|
+
border-width: initial;
|
|
104
|
+
}
|
|
105
|
+
&:where([style*="border-top-style"]) {
|
|
106
|
+
border-top-width: initial;
|
|
107
|
+
}
|
|
108
|
+
&:where([style*="border-right-style"]) {
|
|
109
|
+
border-right-width: initial;
|
|
110
|
+
}
|
|
111
|
+
&:where([style*="border-bottom-style"]) {
|
|
112
|
+
border-bottom-width: initial;
|
|
113
|
+
}
|
|
114
|
+
&:where([style*="border-left-style"]) {
|
|
115
|
+
border-left-width: initial;
|
|
116
|
+
}
|
|
117
|
+
}
|
package/src/button/style.scss
CHANGED
|
@@ -92,7 +92,6 @@ $blocks-block__margin: 0.5em;
|
|
|
92
92
|
border-radius: 0;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
|
|
96
95
|
// the first selector is required for old buttons markup
|
|
97
96
|
.wp-block-button.no-border-radius,
|
|
98
97
|
.wp-block-button__link.no-border-radius {
|
|
@@ -116,3 +115,40 @@ $blocks-block__margin: 0.5em;
|
|
|
116
115
|
// background-image is required to overwrite a gradient background
|
|
117
116
|
background-image: none;
|
|
118
117
|
}
|
|
118
|
+
|
|
119
|
+
.wp-block-button .wp-block-button__link {
|
|
120
|
+
// The following styles ensure a default border is applied when the user
|
|
121
|
+
// selects only a border color or style. This overcomes the zero border
|
|
122
|
+
// width applied by core's theme.json via the elements API.
|
|
123
|
+
&:where(.has-border-color) {
|
|
124
|
+
border-width: initial;
|
|
125
|
+
}
|
|
126
|
+
&:where([style*="border-top-color"]) {
|
|
127
|
+
border-top-width: initial;
|
|
128
|
+
}
|
|
129
|
+
&:where([style*="border-right-color"]) {
|
|
130
|
+
border-right-width: initial;
|
|
131
|
+
}
|
|
132
|
+
&:where([style*="border-bottom-color"]) {
|
|
133
|
+
border-bottom-width: initial;
|
|
134
|
+
}
|
|
135
|
+
&:where([style*="border-left-color"]) {
|
|
136
|
+
border-left-width: initial;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&:where([style*="border-style"]) {
|
|
140
|
+
border-width: initial;
|
|
141
|
+
}
|
|
142
|
+
&:where([style*="border-top-style"]) {
|
|
143
|
+
border-top-width: initial;
|
|
144
|
+
}
|
|
145
|
+
&:where([style*="border-right-style"]) {
|
|
146
|
+
border-right-width: initial;
|
|
147
|
+
}
|
|
148
|
+
&:where([style*="border-bottom-style"]) {
|
|
149
|
+
border-bottom-width: initial;
|
|
150
|
+
}
|
|
151
|
+
&:where([style*="border-left-style"]) {
|
|
152
|
+
border-left-width: initial;
|
|
153
|
+
}
|
|
154
|
+
}
|
package/src/file/block.json
CHANGED
|
@@ -56,7 +56,16 @@
|
|
|
56
56
|
},
|
|
57
57
|
"supports": {
|
|
58
58
|
"anchor": true,
|
|
59
|
-
"align": true
|
|
59
|
+
"align": true,
|
|
60
|
+
"color": {
|
|
61
|
+
"gradients": true,
|
|
62
|
+
"link": true,
|
|
63
|
+
"text": false,
|
|
64
|
+
"__experimentalDefaultControls": {
|
|
65
|
+
"background": true,
|
|
66
|
+
"link": true
|
|
67
|
+
}
|
|
68
|
+
}
|
|
60
69
|
},
|
|
61
70
|
"viewScript": "file:./view.min.js",
|
|
62
71
|
"editorStyle": "wp-block-file-editor",
|
package/src/file/style.scss
CHANGED
package/src/image/editor.scss
CHANGED
package/src/image/image.js
CHANGED
|
@@ -134,19 +134,13 @@ export default function Image( {
|
|
|
134
134
|
} = select( blockEditorStore );
|
|
135
135
|
|
|
136
136
|
const rootClientId = getBlockRootClientId( clientId );
|
|
137
|
-
const settings =
|
|
138
|
-
Object.entries( getSettings() ).filter( ( [ key ] ) =>
|
|
139
|
-
[
|
|
140
|
-
'imageEditing',
|
|
141
|
-
'imageSizes',
|
|
142
|
-
'maxWidth',
|
|
143
|
-
'mediaUpload',
|
|
144
|
-
].includes( key )
|
|
145
|
-
)
|
|
146
|
-
);
|
|
137
|
+
const settings = getSettings();
|
|
147
138
|
|
|
148
139
|
return {
|
|
149
|
-
|
|
140
|
+
imageEditing: settings.imageEditing,
|
|
141
|
+
imageSizes: settings.imageSizes,
|
|
142
|
+
maxWidth: settings.maxWidth,
|
|
143
|
+
mediaUpload: settings.mediaUpload,
|
|
150
144
|
canInsertCover: canInsertBlockType(
|
|
151
145
|
'core/cover',
|
|
152
146
|
rootClientId
|
package/src/image/style.scss
CHANGED
|
@@ -6,6 +6,17 @@
|
|
|
6
6
|
box-sizing: border-box;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
// The following style maintains border radius application for deprecated
|
|
10
|
+
// image blocks that applied border radius to the outer `figure` element.
|
|
11
|
+
//
|
|
12
|
+
// See: https://github.com/WordPress/gutenberg/issues/47422
|
|
13
|
+
&[style*="border-radius"] {
|
|
14
|
+
> a,
|
|
15
|
+
img {
|
|
16
|
+
border-radius: inherit;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
9
20
|
&.has-custom-border {
|
|
10
21
|
img {
|
|
11
22
|
box-sizing: border-box;
|
|
@@ -41,6 +52,7 @@
|
|
|
41
52
|
float: left;
|
|
42
53
|
/*rtl:ignore*/
|
|
43
54
|
margin-left: 0;
|
|
55
|
+
/*rtl:ignore*/
|
|
44
56
|
margin-right: 1em;
|
|
45
57
|
margin-top: 0.5em;
|
|
46
58
|
margin-bottom: 0.5em;
|
|
@@ -51,6 +63,7 @@
|
|
|
51
63
|
float: right;
|
|
52
64
|
/*rtl:ignore*/
|
|
53
65
|
margin-right: 0;
|
|
66
|
+
/*rtl:ignore*/
|
|
54
67
|
margin-left: 1em;
|
|
55
68
|
margin-top: 0.5em;
|
|
56
69
|
margin-bottom: 0.5em;
|
|
@@ -34,6 +34,19 @@
|
|
|
34
34
|
"spacing": {
|
|
35
35
|
"margin": true,
|
|
36
36
|
"padding": true
|
|
37
|
+
},
|
|
38
|
+
"typography": {
|
|
39
|
+
"fontSize": true,
|
|
40
|
+
"lineHeight": true,
|
|
41
|
+
"__experimentalFontFamily": true,
|
|
42
|
+
"__experimentalFontWeight": true,
|
|
43
|
+
"__experimentalFontStyle": true,
|
|
44
|
+
"__experimentalTextTransform": true,
|
|
45
|
+
"__experimentalTextDecoration": true,
|
|
46
|
+
"__experimentalLetterSpacing": true,
|
|
47
|
+
"__experimentalDefaultControls": {
|
|
48
|
+
"fontSize": true
|
|
49
|
+
}
|
|
37
50
|
}
|
|
38
51
|
},
|
|
39
52
|
"editorStyle": "wp-block-latest-comments-editor",
|
|
@@ -28,6 +28,14 @@ export default function LatestComments( { attributes, setAttributes } ) {
|
|
|
28
28
|
const { commentsToShow, displayAvatar, displayDate, displayExcerpt } =
|
|
29
29
|
attributes;
|
|
30
30
|
|
|
31
|
+
const serverSideAttributes = {
|
|
32
|
+
...attributes,
|
|
33
|
+
style: {
|
|
34
|
+
...attributes?.style,
|
|
35
|
+
spacing: undefined,
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
31
39
|
return (
|
|
32
40
|
<div { ...useBlockProps() }>
|
|
33
41
|
<InspectorControls>
|
|
@@ -71,8 +79,7 @@ export default function LatestComments( { attributes, setAttributes } ) {
|
|
|
71
79
|
<Disabled>
|
|
72
80
|
<ServerSideRender
|
|
73
81
|
block="core/latest-comments"
|
|
74
|
-
attributes={
|
|
75
|
-
skipBlockSupportAttributes
|
|
82
|
+
attributes={ serverSideAttributes }
|
|
76
83
|
// The preview uses the site's locale to make it more true to how
|
|
77
84
|
// the block appears on the frontend. Setting the locale
|
|
78
85
|
// explicitly prevents any middleware from setting it to 'user'.
|
|
@@ -9,6 +9,23 @@ ol.wp-block-latest-comments {
|
|
|
9
9
|
box-sizing: border-box;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
// Following styles leverage :where so that typography block support styles and
|
|
13
|
+
// global styles apply when necessary.
|
|
14
|
+
:where(.wp-block-latest-comments:not([style*="line-height"] .wp-block-latest-comments__comment)) {
|
|
15
|
+
line-height: 1.1;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:where(.wp-block-latest-comments:not([style*="line-height"] .wp-block-latest-comments__comment-excerpt p)) {
|
|
19
|
+
line-height: 1.8;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.has-dates,
|
|
23
|
+
.has-excerpts {
|
|
24
|
+
:where(.wp-block-latest-comments:not([style*="line-height"])) {
|
|
25
|
+
line-height: 1.5;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
12
29
|
// Higher specificity - target list via wrapper.
|
|
13
30
|
.wp-block-latest-comments .wp-block-latest-comments {
|
|
14
31
|
// Remove left spacing. Higher specificity required to
|
|
@@ -17,7 +34,6 @@ ol.wp-block-latest-comments {
|
|
|
17
34
|
}
|
|
18
35
|
|
|
19
36
|
.wp-block-latest-comments__comment {
|
|
20
|
-
line-height: 1.1;
|
|
21
37
|
list-style: none;
|
|
22
38
|
margin-bottom: 1em;
|
|
23
39
|
|
|
@@ -30,16 +46,10 @@ ol.wp-block-latest-comments {
|
|
|
30
46
|
margin-left: 3.25em;
|
|
31
47
|
}
|
|
32
48
|
}
|
|
33
|
-
|
|
34
|
-
.has-dates &,
|
|
35
|
-
.has-excerpts & {
|
|
36
|
-
line-height: 1.5;
|
|
37
|
-
}
|
|
38
49
|
}
|
|
39
50
|
|
|
40
51
|
.wp-block-latest-comments__comment-excerpt p {
|
|
41
52
|
font-size: 0.875em;
|
|
42
|
-
line-height: 1.8;
|
|
43
53
|
margin: 0.36em 0 1.4em;
|
|
44
54
|
}
|
|
45
55
|
|
|
@@ -57,3 +67,11 @@ ol.wp-block-latest-comments {
|
|
|
57
67
|
margin-right: 0.75em;
|
|
58
68
|
width: 2.5em;
|
|
59
69
|
}
|
|
70
|
+
|
|
71
|
+
// Enforce font size when user has made selection at the individual block level.
|
|
72
|
+
.wp-block-latest-comments[style*="font-size"],
|
|
73
|
+
.wp-block-latest-comments[class*="-font-size"] {
|
|
74
|
+
a {
|
|
75
|
+
font-size: inherit;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -19,7 +19,6 @@ import { __, sprintf } from '@wordpress/i18n';
|
|
|
19
19
|
* Internal dependencies
|
|
20
20
|
*/
|
|
21
21
|
import NavigationMenuSelector from './navigation-menu-selector';
|
|
22
|
-
import { LeafMoreMenu } from '../leaf-more-menu';
|
|
23
22
|
import { unlock } from '../../private-apis';
|
|
24
23
|
import DeletedNavigationWarning from './deleted-navigation-warning';
|
|
25
24
|
import useNavigationMenu from '../use-navigation-menu';
|
|
@@ -34,8 +33,7 @@ const MainContent = ( {
|
|
|
34
33
|
isNavigationMenuMissing,
|
|
35
34
|
onCreateNew,
|
|
36
35
|
} ) => {
|
|
37
|
-
const { OffCanvasEditor } = unlock( blockEditorPrivateApis );
|
|
38
|
-
|
|
36
|
+
const { OffCanvasEditor, LeafMoreMenu } = unlock( blockEditorPrivateApis );
|
|
39
37
|
// Provide a hierarchy of clientIds for the given Navigation block (clientId).
|
|
40
38
|
// This is required else the list view will display the entire block tree.
|
|
41
39
|
const clientIdsTree = useSelect(
|