@wordpress/block-library 8.3.8 → 8.3.9
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.9",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@wordpress/api-fetch": "^6.23.1",
|
|
36
36
|
"@wordpress/autop": "^3.26.1",
|
|
37
37
|
"@wordpress/blob": "^3.26.1",
|
|
38
|
-
"@wordpress/block-editor": "^11.3.
|
|
38
|
+
"@wordpress/block-editor": "^11.3.9",
|
|
39
39
|
"@wordpress/blocks": "^12.3.3",
|
|
40
40
|
"@wordpress/components": "^23.3.6",
|
|
41
41
|
"@wordpress/compose": "^6.3.3",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@wordpress/notices": "^3.26.3",
|
|
55
55
|
"@wordpress/primitives": "^3.24.2",
|
|
56
56
|
"@wordpress/private-apis": "^0.8.1",
|
|
57
|
-
"@wordpress/reusable-blocks": "^4.3.
|
|
57
|
+
"@wordpress/reusable-blocks": "^4.3.9",
|
|
58
58
|
"@wordpress/rich-text": "^6.3.3",
|
|
59
59
|
"@wordpress/server-side-render": "^4.3.6",
|
|
60
60
|
"@wordpress/url": "^3.27.1",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"publishConfig": {
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "f22a3cbf0cd8f48c7ef800a09b69212a893b99b8"
|
|
81
81
|
}
|
|
@@ -58,11 +58,10 @@ function block_core_comment_template_render_comments( $comments, $block ) {
|
|
|
58
58
|
$block_content .= sprintf( '<ol>%1$s</ol>', $inner_content );
|
|
59
59
|
--$comment_depth;
|
|
60
60
|
} else {
|
|
61
|
-
$
|
|
61
|
+
$block_content .= block_core_comment_template_render_comments(
|
|
62
62
|
$children,
|
|
63
63
|
$block
|
|
64
64
|
);
|
|
65
|
-
$block_content .= sprintf( $inner_content );
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
67
|
|
|
@@ -5,76 +5,6 @@
|
|
|
5
5
|
* @package WordPress
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
* Build an array with CSS classes and inline styles defining the colors
|
|
10
|
-
* which will be applied to the navigation markup in the front-end.
|
|
11
|
-
*
|
|
12
|
-
* @param array $context Navigation block context.
|
|
13
|
-
* @param array $attributes Block attributes.
|
|
14
|
-
* @param bool $is_sub_menu Whether the link is part of a sub-menu.
|
|
15
|
-
* @return array Colors CSS classes and inline styles.
|
|
16
|
-
*/
|
|
17
|
-
function block_core_navigation_link_build_css_colors( $context, $attributes, $is_sub_menu = false ) {
|
|
18
|
-
$colors = array(
|
|
19
|
-
'css_classes' => array(),
|
|
20
|
-
'inline_styles' => '',
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
// Text color.
|
|
24
|
-
$named_text_color = null;
|
|
25
|
-
$custom_text_color = null;
|
|
26
|
-
|
|
27
|
-
if ( $is_sub_menu && array_key_exists( 'customOverlayTextColor', $context ) ) {
|
|
28
|
-
$custom_text_color = $context['customOverlayTextColor'];
|
|
29
|
-
} elseif ( $is_sub_menu && array_key_exists( 'overlayTextColor', $context ) ) {
|
|
30
|
-
$named_text_color = $context['overlayTextColor'];
|
|
31
|
-
} elseif ( array_key_exists( 'customTextColor', $context ) ) {
|
|
32
|
-
$custom_text_color = $context['customTextColor'];
|
|
33
|
-
} elseif ( array_key_exists( 'textColor', $context ) ) {
|
|
34
|
-
$named_text_color = $context['textColor'];
|
|
35
|
-
} elseif ( isset( $context['style']['color']['text'] ) ) {
|
|
36
|
-
$custom_text_color = $context['style']['color']['text'];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// If has text color.
|
|
40
|
-
if ( ! is_null( $named_text_color ) ) {
|
|
41
|
-
// Add the color class.
|
|
42
|
-
array_push( $colors['css_classes'], 'has-text-color', sprintf( 'has-%s-color', $named_text_color ) );
|
|
43
|
-
} elseif ( ! is_null( $custom_text_color ) ) {
|
|
44
|
-
// Add the custom color inline style.
|
|
45
|
-
$colors['css_classes'][] = 'has-text-color';
|
|
46
|
-
$colors['inline_styles'] .= sprintf( 'color: %s;', $custom_text_color );
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Background color.
|
|
50
|
-
$named_background_color = null;
|
|
51
|
-
$custom_background_color = null;
|
|
52
|
-
|
|
53
|
-
if ( $is_sub_menu && array_key_exists( 'customOverlayBackgroundColor', $context ) ) {
|
|
54
|
-
$custom_background_color = $context['customOverlayBackgroundColor'];
|
|
55
|
-
} elseif ( $is_sub_menu && array_key_exists( 'overlayBackgroundColor', $context ) ) {
|
|
56
|
-
$named_background_color = $context['overlayBackgroundColor'];
|
|
57
|
-
} elseif ( array_key_exists( 'customBackgroundColor', $context ) ) {
|
|
58
|
-
$custom_background_color = $context['customBackgroundColor'];
|
|
59
|
-
} elseif ( array_key_exists( 'backgroundColor', $context ) ) {
|
|
60
|
-
$named_background_color = $context['backgroundColor'];
|
|
61
|
-
} elseif ( isset( $context['style']['color']['background'] ) ) {
|
|
62
|
-
$custom_background_color = $context['style']['color']['background'];
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// If has background color.
|
|
66
|
-
if ( ! is_null( $named_background_color ) ) {
|
|
67
|
-
// Add the background-color class.
|
|
68
|
-
array_push( $colors['css_classes'], 'has-background', sprintf( 'has-%s-background-color', $named_background_color ) );
|
|
69
|
-
} elseif ( ! is_null( $custom_background_color ) ) {
|
|
70
|
-
// Add the custom background-color inline style.
|
|
71
|
-
$colors['css_classes'][] = 'has-background';
|
|
72
|
-
$colors['inline_styles'] .= sprintf( 'background-color: %s;', $custom_background_color );
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return $colors;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
8
|
/**
|
|
79
9
|
* Build an array with CSS classes and inline styles defining the font sizes
|
|
80
10
|
* which will be applied to the navigation markup in the front-end.
|
|
@@ -173,13 +103,11 @@ function render_block_core_navigation_link( $attributes, $content, $block ) {
|
|
|
173
103
|
return '';
|
|
174
104
|
}
|
|
175
105
|
|
|
176
|
-
$colors = block_core_navigation_link_build_css_colors( $block->context, $attributes );
|
|
177
106
|
$font_sizes = block_core_navigation_link_build_css_font_sizes( $block->context );
|
|
178
107
|
$classes = array_merge(
|
|
179
|
-
$colors['css_classes'],
|
|
180
108
|
$font_sizes['css_classes']
|
|
181
109
|
);
|
|
182
|
-
$style_attribute = ( $
|
|
110
|
+
$style_attribute = ( $font_sizes['inline_styles'] );
|
|
183
111
|
|
|
184
112
|
$css_classes = trim( implode( ' ', $classes ) );
|
|
185
113
|
$has_submenu = count( $block->inner_blocks ) > 0;
|