@wordpress/block-library 7.15.1-next.4d3b314fd5.0 → 7.16.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/code/utils.js +3 -3
- package/build/code/utils.js.map +1 -1
- package/build/group/edit.js +1 -1
- package/build/group/edit.js.map +1 -1
- package/build/navigation/edit/index.js +12 -12
- package/build/navigation/edit/index.js.map +1 -1
- package/build/paragraph/deprecated.js +49 -10
- package/build/paragraph/deprecated.js.map +1 -1
- package/build/paragraph/edit.js +19 -3
- package/build/paragraph/edit.js.map +1 -1
- package/build/paragraph/save.js +3 -1
- package/build/paragraph/save.js.map +1 -1
- package/build/post-author/edit.js +20 -2
- package/build/post-author/edit.js.map +1 -1
- package/build/post-author/index.js +8 -0
- package/build/post-author/index.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/post-terms/index.js +4 -0
- package/build/post-terms/index.js.map +1 -1
- package/build/query/edit/inspector-controls/author-control.js +2 -1
- package/build/query/edit/inspector-controls/author-control.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/edit/inspector-controls/parent-control.js +2 -1
- package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build/query/edit/inspector-controls/taxonomy-controls.js +2 -1
- package/build/query/edit/inspector-controls/taxonomy-controls.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/site-title/index.js +2 -1
- package/build/site-title/index.js.map +1 -1
- package/build/template-part/index.js +2 -2
- package/build/template-part/index.js.map +1 -1
- package/build/video/edit.js +13 -1
- package/build/video/edit.js.map +1 -1
- package/build-module/code/utils.js +3 -3
- package/build-module/code/utils.js.map +1 -1
- package/build-module/group/edit.js +1 -1
- package/build-module/group/edit.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/paragraph/deprecated.js +49 -11
- package/build-module/paragraph/deprecated.js.map +1 -1
- package/build-module/paragraph/edit.js +19 -3
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/paragraph/save.js +2 -1
- package/build-module/paragraph/save.js.map +1 -1
- package/build-module/post-author/edit.js +21 -2
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-author/index.js +8 -0
- package/build-module/post-author/index.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/post-terms/index.js +4 -0
- package/build-module/post-terms/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/author-control.js +2 -1
- package/build-module/query/edit/inspector-controls/author-control.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/edit/inspector-controls/parent-control.js +2 -1
- package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js +2 -1
- package/build-module/query/edit/inspector-controls/taxonomy-controls.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/site-title/index.js +2 -1
- package/build-module/site-title/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-module/video/edit.js +15 -3
- package/build-module/video/edit.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 +69 -29
- package/build-style/editor.css +69 -29
- package/build-style/navigation/editor-rtl.css +4 -0
- package/build-style/navigation/editor.css +4 -0
- package/build-style/navigation/style-rtl.css +3 -0
- package/build-style/navigation/style.css +3 -0
- package/build-style/paragraph/style-rtl.css +5 -0
- package/build-style/paragraph/style.css +5 -0
- package/build-style/post-featured-image/editor-rtl.css +39 -29
- package/build-style/post-featured-image/editor.css +39 -29
- package/build-style/post-terms/style-rtl.css +4 -1
- package/build-style/post-terms/style.css +4 -1
- package/build-style/site-title/editor-rtl.css +4 -0
- package/build-style/site-title/editor.css +4 -0
- package/build-style/site-title/style-rtl.css +79 -0
- package/build-style/site-title/style.css +79 -0
- package/build-style/style-rtl.css +19 -1
- package/build-style/style.css +19 -1
- package/build-style/video/editor-rtl.css +22 -0
- package/build-style/video/editor.css +22 -0
- package/package.json +28 -28
- package/src/categories/index.php +1 -1
- package/src/code/style.scss +12 -7
- package/src/code/utils.js +3 -3
- package/src/comment-author-name/index.php +1 -1
- package/src/comment-reply-link/index.php +1 -1
- package/src/comment-template/index.php +2 -3
- package/src/cover/index.php +1 -1
- package/src/group/edit.js +1 -1
- package/src/latest-posts/index.php +1 -1
- package/src/navigation/edit/index.js +12 -10
- package/src/navigation/editor.scss +6 -0
- package/src/navigation/style.scss +8 -0
- package/src/page-list/index.php +2 -2
- package/src/paragraph/deprecated.js +36 -0
- package/src/paragraph/edit.js +23 -8
- package/src/paragraph/save.js +5 -1
- package/src/paragraph/style.scss +5 -0
- package/src/post-author/block.json +8 -0
- package/src/post-author/edit.js +29 -3
- package/src/post-author/index.php +7 -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/post-terms/block.json +4 -0
- package/src/post-terms/style.scss +7 -2
- package/src/query/edit/inspector-controls/author-control.js +1 -0
- package/src/query/edit/inspector-controls/index.js +1 -4
- package/src/query/edit/inspector-controls/parent-control.js +1 -0
- package/src/query/edit/inspector-controls/taxonomy-controls.js +1 -0
- package/src/query/utils.js +1 -1
- package/src/quote/block.json +0 -1
- package/src/site-title/block.json +2 -1
- package/src/site-title/editor.scss +6 -0
- package/src/site-title/style.scss +5 -0
- package/src/style.scss +1 -0
- package/src/template-part/index.js +2 -2
- package/src/video/edit.js +19 -0
- package/src/video/editor.scss +37 -0
- package/build/navigation-submenu/view.js +0 -56
- package/build/navigation-submenu/view.js.map +0 -1
- package/build-module/navigation-submenu/view.js +0 -54
- package/build-module/navigation-submenu/view.js.map +0 -1
- package/src/navigation-submenu/view.js +0 -67
|
@@ -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
|
|
|
@@ -76,16 +76,25 @@ function get_block_core_post_featured_image_overlay_element_markup( $attributes
|
|
|
76
76
|
$has_custom_gradient = isset( $attributes['customGradient'] ) && $attributes['customGradient'];
|
|
77
77
|
$has_solid_overlay = isset( $attributes['overlayColor'] ) && $attributes['overlayColor'];
|
|
78
78
|
$has_custom_overlay = isset( $attributes['customOverlayColor'] ) && $attributes['customOverlayColor'];
|
|
79
|
-
$class_names = array(
|
|
80
|
-
|
|
81
|
-
);
|
|
82
|
-
$styles_properties = array();
|
|
79
|
+
$class_names = array( 'wp-block-post-featured-image__overlay' );
|
|
80
|
+
$styles = array();
|
|
83
81
|
|
|
84
82
|
if ( ! $has_dim_background ) {
|
|
85
83
|
return '';
|
|
86
84
|
}
|
|
87
85
|
|
|
88
|
-
//
|
|
86
|
+
// Apply border classes and styles.
|
|
87
|
+
$border_attributes = get_block_core_post_featured_image_border_attributes( $attributes );
|
|
88
|
+
|
|
89
|
+
if ( ! empty( $border_attributes['class'] ) ) {
|
|
90
|
+
$class_names[] = $border_attributes['class'];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if ( ! empty( $border_attributes['style'] ) ) {
|
|
94
|
+
$styles[] = $border_attributes['style'];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Apply overlay and gradient classes.
|
|
89
98
|
if ( $has_dim_background ) {
|
|
90
99
|
$class_names[] = 'has-background-dim';
|
|
91
100
|
$class_names[] = "has-background-dim-{$attributes['dimRatio']}";
|
|
@@ -103,35 +112,20 @@ function get_block_core_post_featured_image_overlay_element_markup( $attributes
|
|
|
103
112
|
$class_names[] = "has-{$attributes['gradient']}-gradient-background";
|
|
104
113
|
}
|
|
105
114
|
|
|
106
|
-
//
|
|
107
|
-
if ( ! empty( $attributes['style']['border']['radius'] ) ) {
|
|
108
|
-
$styles_properties['border-radius'] = $attributes['style']['border']['radius'];
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if ( ! empty( $attributes['style']['border']['width'] ) ) {
|
|
112
|
-
$styles_properties['border-width'] = $attributes['style']['border']['width'];
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
+
// Apply background styles.
|
|
115
116
|
if ( $has_custom_gradient ) {
|
|
116
|
-
$
|
|
117
|
+
$styles[] = sprintf( 'background-image: %s;', $attributes['customGradient'] );
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
if ( $has_custom_overlay ) {
|
|
120
|
-
$
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
$styles = '';
|
|
124
|
-
|
|
125
|
-
foreach ( $styles_properties as $style_attribute => $style_attribute_value ) {
|
|
126
|
-
$styles .= "{$style_attribute}: $style_attribute_value; ";
|
|
121
|
+
$styles[] = sprintf( 'background-color: %s;', $attributes['customOverlayColor'] );
|
|
127
122
|
}
|
|
128
123
|
|
|
129
124
|
return sprintf(
|
|
130
125
|
'<span class="%s" style="%s" aria-hidden="true"></span>',
|
|
131
126
|
esc_attr( implode( ' ', $class_names ) ),
|
|
132
|
-
esc_attr(
|
|
127
|
+
esc_attr( safecss_filter_attr( implode( ' ', $styles ) ) )
|
|
133
128
|
);
|
|
134
|
-
|
|
135
129
|
}
|
|
136
130
|
|
|
137
131
|
/**
|
|
@@ -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
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
.wp-block-post-
|
|
2
|
-
|
|
1
|
+
.wp-block-post-terms {
|
|
2
|
+
// This block has customizable padding, border-box makes that more predictable.
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
|
|
5
|
+
.wp-block-post-terms__separator {
|
|
6
|
+
white-space: pre-wrap;
|
|
7
|
+
}
|
|
3
8
|
}
|
|
@@ -237,10 +237,7 @@ export default function QueryInspectorControls( {
|
|
|
237
237
|
</ToolsPanelItem>
|
|
238
238
|
) }
|
|
239
239
|
{ isPostTypeHierarchical &&
|
|
240
|
-
|
|
241
|
-
allowedControls,
|
|
242
|
-
'parents'
|
|
243
|
-
) && (
|
|
240
|
+
isControlAllowed( allowedControls, 'parents' ) && (
|
|
244
241
|
<ToolsPanelItem
|
|
245
242
|
hasValue={ () => !! parents?.length }
|
|
246
243
|
label={ __( 'Parents' ) }
|
package/src/query/utils.js
CHANGED
package/src/quote/block.json
CHANGED
package/src/style.scss
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 ) {
|
package/src/video/edit.js
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
Disabled,
|
|
14
14
|
PanelBody,
|
|
15
15
|
Spinner,
|
|
16
|
+
Placeholder,
|
|
16
17
|
} from '@wordpress/components';
|
|
17
18
|
import {
|
|
18
19
|
BlockControls,
|
|
@@ -43,6 +44,23 @@ import VideoCommonSettings from './edit-common-settings';
|
|
|
43
44
|
import TracksEditor from './tracks-editor';
|
|
44
45
|
import Tracks from './tracks';
|
|
45
46
|
|
|
47
|
+
// Much of this description is duplicated from MediaPlaceholder.
|
|
48
|
+
const placeholder = ( content ) => {
|
|
49
|
+
return (
|
|
50
|
+
<Placeholder
|
|
51
|
+
className="block-editor-media-placeholder"
|
|
52
|
+
withIllustration={ true }
|
|
53
|
+
icon={ icon }
|
|
54
|
+
label={ __( 'Video' ) }
|
|
55
|
+
instructions={ __(
|
|
56
|
+
'Upload a video file, pick one from your media library, or add one with a URL.'
|
|
57
|
+
) }
|
|
58
|
+
>
|
|
59
|
+
{ content }
|
|
60
|
+
</Placeholder>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
46
64
|
const ALLOWED_MEDIA_TYPES = [ 'video' ];
|
|
47
65
|
const VIDEO_POSTER_ALLOWED_MEDIA_TYPES = [ 'image' ];
|
|
48
66
|
|
|
@@ -146,6 +164,7 @@ function VideoEdit( {
|
|
|
146
164
|
allowedTypes={ ALLOWED_MEDIA_TYPES }
|
|
147
165
|
value={ attributes }
|
|
148
166
|
onError={ onUploadError }
|
|
167
|
+
placeholder={ placeholder }
|
|
149
168
|
/>
|
|
150
169
|
</div>
|
|
151
170
|
);
|
package/src/video/editor.scss
CHANGED
|
@@ -1,3 +1,40 @@
|
|
|
1
|
+
// Provide special styling for the placeholder.
|
|
2
|
+
// @todo: this particular minimal style of placeholder could be componentized further.
|
|
3
|
+
.wp-block-video.wp-block-video {
|
|
4
|
+
// Show Placeholder style on-select.
|
|
5
|
+
&.is-selected .components-placeholder {
|
|
6
|
+
// Block UI appearance.
|
|
7
|
+
color: $gray-900;
|
|
8
|
+
background-color: $white;
|
|
9
|
+
box-shadow: inset 0 0 0 $border-width $gray-900;
|
|
10
|
+
border: none;
|
|
11
|
+
|
|
12
|
+
// @todo: this should eventually be overridden by a custom border-radius set in the inspector.
|
|
13
|
+
border-radius: $radius-block-ui;
|
|
14
|
+
|
|
15
|
+
> svg {
|
|
16
|
+
opacity: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.components-placeholder__illustration {
|
|
20
|
+
display: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&::before {
|
|
24
|
+
opacity: 0;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Remove the transition while we still have a legacy placeholder style.
|
|
29
|
+
// Otherwise the content jumps between the 1px placeholder border, and any inherited custom
|
|
30
|
+
// parent border that may get applied when you deselect.
|
|
31
|
+
.components-placeholder__label,
|
|
32
|
+
.components-placeholder__instructions,
|
|
33
|
+
.components-button {
|
|
34
|
+
transition: none;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
1
38
|
.wp-block[data-align="center"] > .wp-block-video {
|
|
2
39
|
text-align: center;
|
|
3
40
|
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const closeSubmenus = element => {
|
|
4
|
-
element.querySelectorAll('[aria-expanded="true"]').forEach(toggle => {
|
|
5
|
-
toggle.setAttribute('aria-expanded', 'false');
|
|
6
|
-
});
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const toggleSubmenuOnClick = event => {
|
|
10
|
-
const buttonToggle = event.target.closest('[aria-expanded]');
|
|
11
|
-
const isSubmenuOpen = buttonToggle.getAttribute('aria-expanded');
|
|
12
|
-
|
|
13
|
-
if (isSubmenuOpen === 'true') {
|
|
14
|
-
closeSubmenus(buttonToggle.closest('.wp-block-navigation-submenu'));
|
|
15
|
-
} else {
|
|
16
|
-
// Close all sibling submenus.
|
|
17
|
-
const parentElement = buttonToggle.closest('.wp-block-navigation-submenu');
|
|
18
|
-
const parentList = buttonToggle.closest('.wp-block-navigation__submenu-container') || buttonToggle.closest('.wp-block-navigation__container');
|
|
19
|
-
Array.from(parentList.children).forEach(child => {
|
|
20
|
-
if (child !== parentElement) {
|
|
21
|
-
closeSubmenus(child);
|
|
22
|
-
}
|
|
23
|
-
}); // Open submenu.
|
|
24
|
-
|
|
25
|
-
buttonToggle.setAttribute('aria-expanded', 'true');
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const submenuButtons = document.querySelectorAll('.wp-block-navigation-submenu__toggle');
|
|
30
|
-
submenuButtons.forEach(button => {
|
|
31
|
-
button.addEventListener('click', toggleSubmenuOnClick);
|
|
32
|
-
}); // Close on click outside.
|
|
33
|
-
|
|
34
|
-
document.addEventListener('click', function (event) {
|
|
35
|
-
const navigationBlocks = document.querySelectorAll('.wp-block-navigation');
|
|
36
|
-
navigationBlocks.forEach(block => {
|
|
37
|
-
if (!block.contains(event.target)) {
|
|
38
|
-
closeSubmenus(block);
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
}); // Close on focus outside or escape key.
|
|
42
|
-
|
|
43
|
-
document.addEventListener('keyup', function (event) {
|
|
44
|
-
const submenuBlocks = document.querySelectorAll('.wp-block-navigation-submenu');
|
|
45
|
-
submenuBlocks.forEach(block => {
|
|
46
|
-
if (!block.contains(event.target)) {
|
|
47
|
-
closeSubmenus(block);
|
|
48
|
-
} else if (event.key === 'Escape') {
|
|
49
|
-
const toggle = block.querySelector('[aria-expanded="true"]');
|
|
50
|
-
closeSubmenus(block); // Focus the submenu trigger so focus does not get trapped in the closed submenu.
|
|
51
|
-
|
|
52
|
-
toggle === null || toggle === void 0 ? void 0 : toggle.focus();
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
//# sourceMappingURL=view.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/navigation-submenu/view.js"],"names":["closeSubmenus","element","querySelectorAll","forEach","toggle","setAttribute","toggleSubmenuOnClick","event","buttonToggle","target","closest","isSubmenuOpen","getAttribute","parentElement","parentList","Array","from","children","child","submenuButtons","document","button","addEventListener","navigationBlocks","block","contains","submenuBlocks","key","querySelector","focus"],"mappings":";;AAAA,MAAMA,aAAa,GAAKC,OAAF,IAAe;AACpCA,EAAAA,OAAO,CACLC,gBADF,CACoB,wBADpB,EAEEC,OAFF,CAEaC,MAAF,IAAc;AACvBA,IAAAA,MAAM,CAACC,YAAP,CAAqB,eAArB,EAAsC,OAAtC;AACA,GAJF;AAKA,CAND;;AAQA,MAAMC,oBAAoB,GAAKC,KAAF,IAAa;AACzC,QAAMC,YAAY,GAAGD,KAAK,CAACE,MAAN,CAAaC,OAAb,CAAsB,iBAAtB,CAArB;AACA,QAAMC,aAAa,GAAGH,YAAY,CAACI,YAAb,CAA2B,eAA3B,CAAtB;;AAEA,MAAKD,aAAa,KAAK,MAAvB,EAAgC;AAC/BX,IAAAA,aAAa,CAAEQ,YAAY,CAACE,OAAb,CAAsB,8BAAtB,CAAF,CAAb;AACA,GAFD,MAEO;AACN;AACA,UAAMG,aAAa,GAAGL,YAAY,CAACE,OAAb,CACrB,8BADqB,CAAtB;AAGA,UAAMI,UAAU,GACfN,YAAY,CAACE,OAAb,CAAsB,yCAAtB,KACAF,YAAY,CAACE,OAAb,CAAsB,iCAAtB,CAFD;AAGAK,IAAAA,KAAK,CAACC,IAAN,CAAYF,UAAU,CAACG,QAAvB,EAAkCd,OAAlC,CAA6Ce,KAAF,IAAa;AACvD,UAAKA,KAAK,KAAKL,aAAf,EAA+B;AAC9Bb,QAAAA,aAAa,CAAEkB,KAAF,CAAb;AACA;AACD,KAJD,EARM,CAaN;;AACAV,IAAAA,YAAY,CAACH,YAAb,CAA2B,eAA3B,EAA4C,MAA5C;AACA;AACD,CAtBD;;AAwBA,MAAMc,cAAc,GAAGC,QAAQ,CAAClB,gBAAT,CACtB,sCADsB,CAAvB;AAIAiB,cAAc,CAAChB,OAAf,CAA0BkB,MAAF,IAAc;AACrCA,EAAAA,MAAM,CAACC,gBAAP,CAAyB,OAAzB,EAAkChB,oBAAlC;AACA,CAFD,E,CAIA;;AACAc,QAAQ,CAACE,gBAAT,CAA2B,OAA3B,EAAoC,UAAWf,KAAX,EAAmB;AACtD,QAAMgB,gBAAgB,GAAGH,QAAQ,CAAClB,gBAAT,CACxB,sBADwB,CAAzB;AAGAqB,EAAAA,gBAAgB,CAACpB,OAAjB,CAA4BqB,KAAF,IAAa;AACtC,QAAK,CAAEA,KAAK,CAACC,QAAN,CAAgBlB,KAAK,CAACE,MAAtB,CAAP,EAAwC;AACvCT,MAAAA,aAAa,CAAEwB,KAAF,CAAb;AACA;AACD,GAJD;AAKA,CATD,E,CAUA;;AACAJ,QAAQ,CAACE,gBAAT,CAA2B,OAA3B,EAAoC,UAAWf,KAAX,EAAmB;AACtD,QAAMmB,aAAa,GAAGN,QAAQ,CAAClB,gBAAT,CACrB,8BADqB,CAAtB;AAGAwB,EAAAA,aAAa,CAACvB,OAAd,CAAyBqB,KAAF,IAAa;AACnC,QAAK,CAAEA,KAAK,CAACC,QAAN,CAAgBlB,KAAK,CAACE,MAAtB,CAAP,EAAwC;AACvCT,MAAAA,aAAa,CAAEwB,KAAF,CAAb;AACA,KAFD,MAEO,IAAKjB,KAAK,CAACoB,GAAN,KAAc,QAAnB,EAA8B;AACpC,YAAMvB,MAAM,GAAGoB,KAAK,CAACI,aAAN,CAAqB,wBAArB,CAAf;AACA5B,MAAAA,aAAa,CAAEwB,KAAF,CAAb,CAFoC,CAGpC;;AACApB,MAAAA,MAAM,SAAN,IAAAA,MAAM,WAAN,YAAAA,MAAM,CAAEyB,KAAR;AACA;AACD,GATD;AAUA,CAdD","sourcesContent":["const closeSubmenus = ( element ) => {\n\telement\n\t\t.querySelectorAll( '[aria-expanded=\"true\"]' )\n\t\t.forEach( ( toggle ) => {\n\t\t\ttoggle.setAttribute( 'aria-expanded', 'false' );\n\t\t} );\n};\n\nconst toggleSubmenuOnClick = ( event ) => {\n\tconst buttonToggle = event.target.closest( '[aria-expanded]' );\n\tconst isSubmenuOpen = buttonToggle.getAttribute( 'aria-expanded' );\n\n\tif ( isSubmenuOpen === 'true' ) {\n\t\tcloseSubmenus( buttonToggle.closest( '.wp-block-navigation-submenu' ) );\n\t} else {\n\t\t// Close all sibling submenus.\n\t\tconst parentElement = buttonToggle.closest(\n\t\t\t'.wp-block-navigation-submenu'\n\t\t);\n\t\tconst parentList =\n\t\t\tbuttonToggle.closest( '.wp-block-navigation__submenu-container' ) ||\n\t\t\tbuttonToggle.closest( '.wp-block-navigation__container' );\n\t\tArray.from( parentList.children ).forEach( ( child ) => {\n\t\t\tif ( child !== parentElement ) {\n\t\t\t\tcloseSubmenus( child );\n\t\t\t}\n\t\t} );\n\t\t// Open submenu.\n\t\tbuttonToggle.setAttribute( 'aria-expanded', 'true' );\n\t}\n};\n\nconst submenuButtons = document.querySelectorAll(\n\t'.wp-block-navigation-submenu__toggle'\n);\n\nsubmenuButtons.forEach( ( button ) => {\n\tbutton.addEventListener( 'click', toggleSubmenuOnClick );\n} );\n\n// Close on click outside.\ndocument.addEventListener( 'click', function ( event ) {\n\tconst navigationBlocks = document.querySelectorAll(\n\t\t'.wp-block-navigation'\n\t);\n\tnavigationBlocks.forEach( ( block ) => {\n\t\tif ( ! block.contains( event.target ) ) {\n\t\t\tcloseSubmenus( block );\n\t\t}\n\t} );\n} );\n// Close on focus outside or escape key.\ndocument.addEventListener( 'keyup', function ( event ) {\n\tconst submenuBlocks = document.querySelectorAll(\n\t\t'.wp-block-navigation-submenu'\n\t);\n\tsubmenuBlocks.forEach( ( block ) => {\n\t\tif ( ! block.contains( event.target ) ) {\n\t\t\tcloseSubmenus( block );\n\t\t} else if ( event.key === 'Escape' ) {\n\t\t\tconst toggle = block.querySelector( '[aria-expanded=\"true\"]' );\n\t\t\tcloseSubmenus( block );\n\t\t\t// Focus the submenu trigger so focus does not get trapped in the closed submenu.\n\t\t\ttoggle?.focus();\n\t\t}\n\t} );\n} );\n"]}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
const closeSubmenus = element => {
|
|
2
|
-
element.querySelectorAll('[aria-expanded="true"]').forEach(toggle => {
|
|
3
|
-
toggle.setAttribute('aria-expanded', 'false');
|
|
4
|
-
});
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
const toggleSubmenuOnClick = event => {
|
|
8
|
-
const buttonToggle = event.target.closest('[aria-expanded]');
|
|
9
|
-
const isSubmenuOpen = buttonToggle.getAttribute('aria-expanded');
|
|
10
|
-
|
|
11
|
-
if (isSubmenuOpen === 'true') {
|
|
12
|
-
closeSubmenus(buttonToggle.closest('.wp-block-navigation-submenu'));
|
|
13
|
-
} else {
|
|
14
|
-
// Close all sibling submenus.
|
|
15
|
-
const parentElement = buttonToggle.closest('.wp-block-navigation-submenu');
|
|
16
|
-
const parentList = buttonToggle.closest('.wp-block-navigation__submenu-container') || buttonToggle.closest('.wp-block-navigation__container');
|
|
17
|
-
Array.from(parentList.children).forEach(child => {
|
|
18
|
-
if (child !== parentElement) {
|
|
19
|
-
closeSubmenus(child);
|
|
20
|
-
}
|
|
21
|
-
}); // Open submenu.
|
|
22
|
-
|
|
23
|
-
buttonToggle.setAttribute('aria-expanded', 'true');
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const submenuButtons = document.querySelectorAll('.wp-block-navigation-submenu__toggle');
|
|
28
|
-
submenuButtons.forEach(button => {
|
|
29
|
-
button.addEventListener('click', toggleSubmenuOnClick);
|
|
30
|
-
}); // Close on click outside.
|
|
31
|
-
|
|
32
|
-
document.addEventListener('click', function (event) {
|
|
33
|
-
const navigationBlocks = document.querySelectorAll('.wp-block-navigation');
|
|
34
|
-
navigationBlocks.forEach(block => {
|
|
35
|
-
if (!block.contains(event.target)) {
|
|
36
|
-
closeSubmenus(block);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
}); // Close on focus outside or escape key.
|
|
40
|
-
|
|
41
|
-
document.addEventListener('keyup', function (event) {
|
|
42
|
-
const submenuBlocks = document.querySelectorAll('.wp-block-navigation-submenu');
|
|
43
|
-
submenuBlocks.forEach(block => {
|
|
44
|
-
if (!block.contains(event.target)) {
|
|
45
|
-
closeSubmenus(block);
|
|
46
|
-
} else if (event.key === 'Escape') {
|
|
47
|
-
const toggle = block.querySelector('[aria-expanded="true"]');
|
|
48
|
-
closeSubmenus(block); // Focus the submenu trigger so focus does not get trapped in the closed submenu.
|
|
49
|
-
|
|
50
|
-
toggle === null || toggle === void 0 ? void 0 : toggle.focus();
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
//# sourceMappingURL=view.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/navigation-submenu/view.js"],"names":["closeSubmenus","element","querySelectorAll","forEach","toggle","setAttribute","toggleSubmenuOnClick","event","buttonToggle","target","closest","isSubmenuOpen","getAttribute","parentElement","parentList","Array","from","children","child","submenuButtons","document","button","addEventListener","navigationBlocks","block","contains","submenuBlocks","key","querySelector","focus"],"mappings":"AAAA,MAAMA,aAAa,GAAKC,OAAF,IAAe;AACpCA,EAAAA,OAAO,CACLC,gBADF,CACoB,wBADpB,EAEEC,OAFF,CAEaC,MAAF,IAAc;AACvBA,IAAAA,MAAM,CAACC,YAAP,CAAqB,eAArB,EAAsC,OAAtC;AACA,GAJF;AAKA,CAND;;AAQA,MAAMC,oBAAoB,GAAKC,KAAF,IAAa;AACzC,QAAMC,YAAY,GAAGD,KAAK,CAACE,MAAN,CAAaC,OAAb,CAAsB,iBAAtB,CAArB;AACA,QAAMC,aAAa,GAAGH,YAAY,CAACI,YAAb,CAA2B,eAA3B,CAAtB;;AAEA,MAAKD,aAAa,KAAK,MAAvB,EAAgC;AAC/BX,IAAAA,aAAa,CAAEQ,YAAY,CAACE,OAAb,CAAsB,8BAAtB,CAAF,CAAb;AACA,GAFD,MAEO;AACN;AACA,UAAMG,aAAa,GAAGL,YAAY,CAACE,OAAb,CACrB,8BADqB,CAAtB;AAGA,UAAMI,UAAU,GACfN,YAAY,CAACE,OAAb,CAAsB,yCAAtB,KACAF,YAAY,CAACE,OAAb,CAAsB,iCAAtB,CAFD;AAGAK,IAAAA,KAAK,CAACC,IAAN,CAAYF,UAAU,CAACG,QAAvB,EAAkCd,OAAlC,CAA6Ce,KAAF,IAAa;AACvD,UAAKA,KAAK,KAAKL,aAAf,EAA+B;AAC9Bb,QAAAA,aAAa,CAAEkB,KAAF,CAAb;AACA;AACD,KAJD,EARM,CAaN;;AACAV,IAAAA,YAAY,CAACH,YAAb,CAA2B,eAA3B,EAA4C,MAA5C;AACA;AACD,CAtBD;;AAwBA,MAAMc,cAAc,GAAGC,QAAQ,CAAClB,gBAAT,CACtB,sCADsB,CAAvB;AAIAiB,cAAc,CAAChB,OAAf,CAA0BkB,MAAF,IAAc;AACrCA,EAAAA,MAAM,CAACC,gBAAP,CAAyB,OAAzB,EAAkChB,oBAAlC;AACA,CAFD,E,CAIA;;AACAc,QAAQ,CAACE,gBAAT,CAA2B,OAA3B,EAAoC,UAAWf,KAAX,EAAmB;AACtD,QAAMgB,gBAAgB,GAAGH,QAAQ,CAAClB,gBAAT,CACxB,sBADwB,CAAzB;AAGAqB,EAAAA,gBAAgB,CAACpB,OAAjB,CAA4BqB,KAAF,IAAa;AACtC,QAAK,CAAEA,KAAK,CAACC,QAAN,CAAgBlB,KAAK,CAACE,MAAtB,CAAP,EAAwC;AACvCT,MAAAA,aAAa,CAAEwB,KAAF,CAAb;AACA;AACD,GAJD;AAKA,CATD,E,CAUA;;AACAJ,QAAQ,CAACE,gBAAT,CAA2B,OAA3B,EAAoC,UAAWf,KAAX,EAAmB;AACtD,QAAMmB,aAAa,GAAGN,QAAQ,CAAClB,gBAAT,CACrB,8BADqB,CAAtB;AAGAwB,EAAAA,aAAa,CAACvB,OAAd,CAAyBqB,KAAF,IAAa;AACnC,QAAK,CAAEA,KAAK,CAACC,QAAN,CAAgBlB,KAAK,CAACE,MAAtB,CAAP,EAAwC;AACvCT,MAAAA,aAAa,CAAEwB,KAAF,CAAb;AACA,KAFD,MAEO,IAAKjB,KAAK,CAACoB,GAAN,KAAc,QAAnB,EAA8B;AACpC,YAAMvB,MAAM,GAAGoB,KAAK,CAACI,aAAN,CAAqB,wBAArB,CAAf;AACA5B,MAAAA,aAAa,CAAEwB,KAAF,CAAb,CAFoC,CAGpC;;AACApB,MAAAA,MAAM,SAAN,IAAAA,MAAM,WAAN,YAAAA,MAAM,CAAEyB,KAAR;AACA;AACD,GATD;AAUA,CAdD","sourcesContent":["const closeSubmenus = ( element ) => {\n\telement\n\t\t.querySelectorAll( '[aria-expanded=\"true\"]' )\n\t\t.forEach( ( toggle ) => {\n\t\t\ttoggle.setAttribute( 'aria-expanded', 'false' );\n\t\t} );\n};\n\nconst toggleSubmenuOnClick = ( event ) => {\n\tconst buttonToggle = event.target.closest( '[aria-expanded]' );\n\tconst isSubmenuOpen = buttonToggle.getAttribute( 'aria-expanded' );\n\n\tif ( isSubmenuOpen === 'true' ) {\n\t\tcloseSubmenus( buttonToggle.closest( '.wp-block-navigation-submenu' ) );\n\t} else {\n\t\t// Close all sibling submenus.\n\t\tconst parentElement = buttonToggle.closest(\n\t\t\t'.wp-block-navigation-submenu'\n\t\t);\n\t\tconst parentList =\n\t\t\tbuttonToggle.closest( '.wp-block-navigation__submenu-container' ) ||\n\t\t\tbuttonToggle.closest( '.wp-block-navigation__container' );\n\t\tArray.from( parentList.children ).forEach( ( child ) => {\n\t\t\tif ( child !== parentElement ) {\n\t\t\t\tcloseSubmenus( child );\n\t\t\t}\n\t\t} );\n\t\t// Open submenu.\n\t\tbuttonToggle.setAttribute( 'aria-expanded', 'true' );\n\t}\n};\n\nconst submenuButtons = document.querySelectorAll(\n\t'.wp-block-navigation-submenu__toggle'\n);\n\nsubmenuButtons.forEach( ( button ) => {\n\tbutton.addEventListener( 'click', toggleSubmenuOnClick );\n} );\n\n// Close on click outside.\ndocument.addEventListener( 'click', function ( event ) {\n\tconst navigationBlocks = document.querySelectorAll(\n\t\t'.wp-block-navigation'\n\t);\n\tnavigationBlocks.forEach( ( block ) => {\n\t\tif ( ! block.contains( event.target ) ) {\n\t\t\tcloseSubmenus( block );\n\t\t}\n\t} );\n} );\n// Close on focus outside or escape key.\ndocument.addEventListener( 'keyup', function ( event ) {\n\tconst submenuBlocks = document.querySelectorAll(\n\t\t'.wp-block-navigation-submenu'\n\t);\n\tsubmenuBlocks.forEach( ( block ) => {\n\t\tif ( ! block.contains( event.target ) ) {\n\t\t\tcloseSubmenus( block );\n\t\t} else if ( event.key === 'Escape' ) {\n\t\t\tconst toggle = block.querySelector( '[aria-expanded=\"true\"]' );\n\t\t\tcloseSubmenus( block );\n\t\t\t// Focus the submenu trigger so focus does not get trapped in the closed submenu.\n\t\t\ttoggle?.focus();\n\t\t}\n\t} );\n} );\n"]}
|