@wordpress/block-library 8.3.9 → 8.3.10
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.10",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"publishConfig": {
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "356298f91f5e43d68dda6a770e3e6f8e1aa69f14"
|
|
81
81
|
}
|
|
@@ -58,10 +58,11 @@ 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
|
+
$inner_content = block_core_comment_template_render_comments(
|
|
62
62
|
$children,
|
|
63
63
|
$block
|
|
64
64
|
);
|
|
65
|
+
$block_content .= sprintf( $inner_content );
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
|
|
@@ -5,6 +5,76 @@
|
|
|
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
|
+
|
|
8
78
|
/**
|
|
9
79
|
* Build an array with CSS classes and inline styles defining the font sizes
|
|
10
80
|
* which will be applied to the navigation markup in the front-end.
|
|
@@ -107,7 +177,7 @@ function render_block_core_navigation_link( $attributes, $content, $block ) {
|
|
|
107
177
|
$classes = array_merge(
|
|
108
178
|
$font_sizes['css_classes']
|
|
109
179
|
);
|
|
110
|
-
$style_attribute =
|
|
180
|
+
$style_attribute = $font_sizes['inline_styles'];
|
|
111
181
|
|
|
112
182
|
$css_classes = trim( implode( ' ', $classes ) );
|
|
113
183
|
$has_submenu = count( $block->inner_blocks ) > 0;
|