@wordpress/block-library 9.21.0 → 9.22.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/cover/index.js +1 -1
- package/build/cover/index.js.map +1 -1
- package/build/details/edit.js +1 -5
- package/build/details/edit.js.map +1 -1
- package/build/details/index.js +1 -1
- package/build/details/index.js.map +1 -1
- package/build/navigation/view.js +2 -1
- package/build/navigation/view.js.map +1 -1
- package/build/navigation-link/edit.js +0 -21
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/index.js +0 -3
- package/build/navigation-link/index.js.map +1 -1
- package/build/navigation-link/transforms.js +0 -2
- package/build/navigation-link/transforms.js.map +1 -1
- package/build/navigation-link/update-attributes.js +0 -1
- package/build/navigation-link/update-attributes.js.map +1 -1
- package/build/navigation-submenu/edit.js +1 -24
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/navigation-submenu/index.js +0 -3
- package/build/navigation-submenu/index.js.map +1 -1
- package/build/post-comments-count/index.js +0 -1
- package/build/post-comments-count/index.js.map +1 -1
- package/build/post-comments-link/index.js +0 -1
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-featured-image/edit.js +15 -5
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +47 -59
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/inspector-controls/parent-control.js +2 -2
- package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build/query/edit/inspector-controls/taxonomy-controls.js +2 -2
- package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build/query/edit/query-content.js +4 -17
- package/build/query/edit/query-content.js.map +1 -1
- package/build/quote/index.js +1 -1
- package/build/quote/index.js.map +1 -1
- package/build/social-links/edit.js +29 -31
- package/build/social-links/edit.js.map +1 -1
- package/build/table/index.js +3 -3
- package/build/table/index.js.map +1 -1
- package/build/table/transforms.js +11 -3
- package/build/table/transforms.js.map +1 -1
- package/build/table-of-contents/edit.js +1 -1
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/table-of-contents/hooks.js +6 -3
- package/build/table-of-contents/hooks.js.map +1 -1
- package/build-module/cover/index.js +1 -1
- package/build-module/cover/index.js.map +1 -1
- package/build-module/details/edit.js +1 -5
- package/build-module/details/edit.js.map +1 -1
- package/build-module/details/index.js +1 -1
- package/build-module/details/index.js.map +1 -1
- package/build-module/navigation/view.js +2 -1
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/navigation-link/edit.js +0 -21
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/index.js +0 -3
- package/build-module/navigation-link/index.js.map +1 -1
- package/build-module/navigation-link/transforms.js +0 -2
- package/build-module/navigation-link/transforms.js.map +1 -1
- package/build-module/navigation-link/update-attributes.js +0 -1
- package/build-module/navigation-link/update-attributes.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +1 -24
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/navigation-submenu/index.js +0 -3
- package/build-module/navigation-submenu/index.js.map +1 -1
- package/build-module/post-comments-count/index.js +0 -1
- package/build-module/post-comments-count/index.js.map +1 -1
- package/build-module/post-comments-link/index.js +0 -1
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-featured-image/edit.js +15 -5
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +49 -61
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/parent-control.js +2 -2
- package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js +2 -2
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build-module/query/edit/query-content.js +4 -17
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/quote/index.js +1 -1
- package/build-module/quote/index.js.map +1 -1
- package/build-module/social-links/edit.js +30 -32
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/table/index.js +3 -3
- package/build-module/table/index.js.map +1 -1
- package/build-module/table/transforms.js +11 -3
- package/build-module/table/transforms.js.map +1 -1
- package/build-module/table-of-contents/edit.js +1 -1
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/table-of-contents/hooks.js +6 -3
- package/build-module/table-of-contents/hooks.js.map +1 -1
- package/build-style/editor-rtl.css +1 -50
- package/build-style/editor.css +1 -50
- package/build-style/media-text/style-rtl.css +0 -2
- package/build-style/media-text/style.css +0 -2
- package/build-style/search/style-rtl.css +1 -0
- package/build-style/search/style.css +1 -0
- package/build-style/social-links/editor-rtl.css +1 -50
- package/build-style/social-links/editor.css +1 -50
- package/build-style/style-rtl.css +1 -6
- package/build-style/style.css +1 -6
- package/build-style/tag-cloud/style-rtl.css +0 -4
- package/build-style/tag-cloud/style.css +0 -4
- package/package.json +35 -35
- package/src/button/index.php +2 -3
- package/src/cover/index.js +1 -1
- package/src/details/edit.js +6 -8
- package/src/details/index.js +1 -1
- package/src/file/index.php +2 -3
- package/src/latest-comments/index.php +1 -1
- package/src/latest-posts/index.php +3 -0
- package/src/media-text/style.scss +0 -2
- package/src/navigation/index.php +1 -1
- package/src/navigation/view.js +2 -1
- package/src/navigation-link/block.json +0 -3
- package/src/navigation-link/edit.js +1 -22
- package/src/navigation-link/index.php +1 -5
- package/src/navigation-link/transforms.js +1 -2
- package/src/navigation-link/update-attributes.js +0 -1
- package/src/navigation-submenu/block.json +0 -3
- package/src/navigation-submenu/edit.js +1 -24
- package/src/navigation-submenu/index.php +0 -4
- package/src/post-comments-count/block.json +0 -1
- package/src/post-comments-count/index.php +4 -0
- package/src/post-comments-link/block.json +0 -1
- package/src/post-comments-link/index.php +4 -0
- package/src/post-featured-image/edit.js +94 -77
- package/src/query/edit/inspector-controls/index.js +66 -91
- package/src/query/edit/inspector-controls/parent-control.js +2 -2
- package/src/query/edit/inspector-controls/taxonomy-controls.js +2 -2
- package/src/query/edit/query-content.js +7 -16
- package/src/quote/index.js +1 -1
- package/src/search/index.php +12 -9
- package/src/search/style.scss +1 -0
- package/src/social-links/edit.js +29 -30
- package/src/social-links/editor.scss +1 -59
- package/src/table/index.js +3 -3
- package/src/table/transforms.js +14 -2
- package/src/table-of-contents/edit.js +1 -1
- package/src/table-of-contents/hooks.js +5 -2
- package/src/tag-cloud/style.scss +0 -5
package/src/search/index.php
CHANGED
|
@@ -10,9 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* @since 6.3.0 Using block.json `viewScript` to register script, and update `view_script_handles()` only when needed.
|
|
12
12
|
*
|
|
13
|
-
* @param array
|
|
14
|
-
* @param string $content The saved content.
|
|
15
|
-
* @param WP_Block $block The parsed block.
|
|
13
|
+
* @param array $attributes The block attributes.
|
|
16
14
|
*
|
|
17
15
|
* @return string The search block markup.
|
|
18
16
|
*/
|
|
@@ -152,17 +150,22 @@ function render_block_core_search( $attributes ) {
|
|
|
152
150
|
}
|
|
153
151
|
}
|
|
154
152
|
|
|
155
|
-
$field_markup_classes =
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
153
|
+
$field_markup_classes = array(
|
|
154
|
+
'wp-block-search__inside-wrapper',
|
|
155
|
+
);
|
|
156
|
+
if ( $is_button_inside && ! empty( $border_color_classes ) ) {
|
|
157
|
+
$field_markup_classes[] = $border_color_classes;
|
|
158
|
+
}
|
|
159
|
+
$field_markup = sprintf(
|
|
160
|
+
'<div class="%s" %s>%s</div>',
|
|
161
|
+
esc_attr( implode( ' ', $field_markup_classes ) ),
|
|
159
162
|
$inline_styles['wrapper'],
|
|
160
163
|
$input . $query_params_markup . $button
|
|
161
164
|
);
|
|
162
|
-
$wrapper_attributes
|
|
165
|
+
$wrapper_attributes = get_block_wrapper_attributes(
|
|
163
166
|
array( 'class' => $classnames )
|
|
164
167
|
);
|
|
165
|
-
$form_directives
|
|
168
|
+
$form_directives = '';
|
|
166
169
|
|
|
167
170
|
// If it's interactive, add the directives.
|
|
168
171
|
if ( $is_expandable_searchfield ) {
|
package/src/search/style.scss
CHANGED
|
@@ -110,6 +110,7 @@ $button-spacing-y: math.div($grid-unit-15, 2); // 6px
|
|
|
110
110
|
:where(.wp-block-search__button-inside .wp-block-search__inside-wrapper) {
|
|
111
111
|
padding: $grid-unit-05;
|
|
112
112
|
border: 1px solid $gray-600;
|
|
113
|
+
background-color: $white;
|
|
113
114
|
box-sizing: border-box;
|
|
114
115
|
|
|
115
116
|
.wp-block-search__input {
|
package/src/social-links/edit.js
CHANGED
|
@@ -6,7 +6,7 @@ import clsx from 'clsx';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { useEffect
|
|
9
|
+
import { useEffect } from '@wordpress/element';
|
|
10
10
|
import {
|
|
11
11
|
BlockControls,
|
|
12
12
|
useInnerBlocksProps,
|
|
@@ -57,16 +57,21 @@ export function SocialLinksEdit( props ) {
|
|
|
57
57
|
|
|
58
58
|
const {
|
|
59
59
|
iconBackgroundColorValue,
|
|
60
|
-
customIconBackgroundColor,
|
|
61
60
|
iconColorValue,
|
|
62
61
|
openInNewTab,
|
|
63
62
|
showLabels,
|
|
64
63
|
size,
|
|
65
64
|
} = attributes;
|
|
66
65
|
|
|
67
|
-
const hasSelectedChild = useSelect(
|
|
68
|
-
( select ) =>
|
|
69
|
-
|
|
66
|
+
const { hasSocialIcons, hasSelectedChild } = useSelect(
|
|
67
|
+
( select ) => {
|
|
68
|
+
const { getBlockCount, hasSelectedInnerBlock } =
|
|
69
|
+
select( blockEditorStore );
|
|
70
|
+
return {
|
|
71
|
+
hasSocialIcons: getBlockCount( clientId ) > 0,
|
|
72
|
+
hasSelectedChild: hasSelectedInnerBlock( clientId ),
|
|
73
|
+
};
|
|
74
|
+
},
|
|
70
75
|
[ clientId ]
|
|
71
76
|
);
|
|
72
77
|
|
|
@@ -78,33 +83,25 @@ export function SocialLinksEdit( props ) {
|
|
|
78
83
|
|
|
79
84
|
// Remove icon background color when logos only style is selected or
|
|
80
85
|
// restore it when any other style is selected.
|
|
81
|
-
const backgroundBackupRef = useRef( {} );
|
|
82
86
|
useEffect( () => {
|
|
83
87
|
if ( logosOnly ) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
let restore;
|
|
89
|
+
setAttributes( ( prev ) => {
|
|
90
|
+
restore = {
|
|
91
|
+
iconBackgroundColor: prev.iconBackgroundColor,
|
|
92
|
+
iconBackgroundColorValue: prev.iconBackgroundColorValue,
|
|
93
|
+
customIconBackgroundColor: prev.customIconBackgroundColor,
|
|
94
|
+
};
|
|
95
|
+
return {
|
|
96
|
+
iconBackgroundColor: undefined,
|
|
97
|
+
iconBackgroundColorValue: undefined,
|
|
98
|
+
customIconBackgroundColor: undefined,
|
|
99
|
+
};
|
|
93
100
|
} );
|
|
94
|
-
} else {
|
|
95
|
-
setAttributes( { ...backgroundBackupRef.current } );
|
|
96
|
-
}
|
|
97
|
-
}, [ logosOnly ] );
|
|
98
101
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
<div className="wp-social-link wp-social-link-twitter"></div>
|
|
103
|
-
<div className="wp-social-link wp-social-link-facebook"></div>
|
|
104
|
-
<div className="wp-social-link wp-social-link-instagram"></div>
|
|
105
|
-
</div>
|
|
106
|
-
</li>
|
|
107
|
-
);
|
|
102
|
+
return () => setAttributes( { ...restore } );
|
|
103
|
+
}
|
|
104
|
+
}, [ logosOnly, setAttributes ] );
|
|
108
105
|
|
|
109
106
|
// Fallback color values are used maintain selections in case switching
|
|
110
107
|
// themes and named colors in palette do not match.
|
|
@@ -117,11 +114,13 @@ export function SocialLinksEdit( props ) {
|
|
|
117
114
|
|
|
118
115
|
const blockProps = useBlockProps( { className } );
|
|
119
116
|
const innerBlocksProps = useInnerBlocksProps( blockProps, {
|
|
120
|
-
placeholder: ! isSelected && SocialPlaceholder,
|
|
121
117
|
templateLock: false,
|
|
122
118
|
orientation: attributes.layout?.orientation ?? 'horizontal',
|
|
123
119
|
__experimentalAppenderTagName: 'li',
|
|
124
|
-
renderAppender:
|
|
120
|
+
renderAppender:
|
|
121
|
+
! hasSocialIcons || hasAnySelected
|
|
122
|
+
? InnerBlocks.ButtonBlockAppender
|
|
123
|
+
: undefined,
|
|
125
124
|
} );
|
|
126
125
|
|
|
127
126
|
const POPOVER_PROPS = {
|
|
@@ -12,67 +12,9 @@
|
|
|
12
12
|
|
|
13
13
|
// Specificity for the following styles are fixed at 0-1-0 to match and be
|
|
14
14
|
// overridable by global styles.
|
|
15
|
-
:root :where(.wp-block-social-links)
|
|
16
|
-
:root :where(.wp-block-social-links.is-style-logos-only .wp-block-social-links__social-placeholder .wp-social-link) {
|
|
15
|
+
:root :where(.wp-block-social-links) {
|
|
17
16
|
padding: 0;
|
|
18
17
|
}
|
|
19
|
-
:root :where(.wp-block-social-links__social-placeholder .wp-social-link) {
|
|
20
|
-
padding: 0.25em;
|
|
21
|
-
}
|
|
22
|
-
:root :where(.wp-block-social-links.is-style-pill-shape .wp-block-social-links__social-placeholder .wp-social-link) {
|
|
23
|
-
padding-left: calc((2/3) * 1em);
|
|
24
|
-
padding-right: calc((2/3) * 1em);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Placeholder/setup state.
|
|
28
|
-
.wp-block-social-links__social-placeholder {
|
|
29
|
-
display: flex;
|
|
30
|
-
opacity: 0.8;
|
|
31
|
-
list-style: none;
|
|
32
|
-
|
|
33
|
-
// Use the first link to set the height.
|
|
34
|
-
> .wp-social-link {
|
|
35
|
-
// Use !important to keep the selector simple.
|
|
36
|
-
padding-left: 0 !important;
|
|
37
|
-
margin-left: 0 !important;
|
|
38
|
-
padding-right: 0 !important;
|
|
39
|
-
margin-right: 0 !important;
|
|
40
|
-
width: 0 !important;
|
|
41
|
-
visibility: hidden;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Wrap the remaining placeholders in a container so the plus can overlap.
|
|
45
|
-
> .wp-block-social-links__social-placeholder-icons {
|
|
46
|
-
display: flex;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.wp-social-link::before {
|
|
50
|
-
content: "";
|
|
51
|
-
display: block;
|
|
52
|
-
width: 1em;
|
|
53
|
-
height: 1em;
|
|
54
|
-
border-radius: $radius-round;
|
|
55
|
-
|
|
56
|
-
.is-style-logos-only & {
|
|
57
|
-
background: currentColor;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Selected placeholder state.
|
|
63
|
-
.wp-block-social-links .wp-block-social-links__social-prompt {
|
|
64
|
-
min-height: $button-size-small;
|
|
65
|
-
list-style: none;
|
|
66
|
-
|
|
67
|
-
// Show as block UI.
|
|
68
|
-
font-family: $default-font;
|
|
69
|
-
font-size: $default-font-size;
|
|
70
|
-
line-height: $button-size-small;
|
|
71
|
-
margin-top: auto;
|
|
72
|
-
margin-bottom: auto;
|
|
73
|
-
cursor: default;
|
|
74
|
-
padding-right: $grid-unit-10;
|
|
75
|
-
}
|
|
76
18
|
|
|
77
19
|
// Center flex items. This has an equivalent in style.scss.
|
|
78
20
|
.wp-block[data-align="center"] > .wp-block-social-links,
|
package/src/table/index.js
CHANGED
|
@@ -48,7 +48,7 @@ export const settings = {
|
|
|
48
48
|
tag: 'td',
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
|
-
content: 'Jaco Pastorius',
|
|
51
|
+
content: __( 'Jaco Pastorius' ),
|
|
52
52
|
tag: 'td',
|
|
53
53
|
},
|
|
54
54
|
{
|
|
@@ -64,7 +64,7 @@ export const settings = {
|
|
|
64
64
|
tag: 'td',
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
|
-
content: 'Betty Carter',
|
|
67
|
+
content: __( 'Betty Carter' ),
|
|
68
68
|
tag: 'td',
|
|
69
69
|
},
|
|
70
70
|
{
|
|
@@ -80,7 +80,7 @@ export const settings = {
|
|
|
80
80
|
tag: 'td',
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
|
-
content: 'Bebo Valdés',
|
|
83
|
+
content: __( 'Bebo Valdés' ),
|
|
84
84
|
tag: 'td',
|
|
85
85
|
},
|
|
86
86
|
{
|
package/src/table/transforms.js
CHANGED
|
@@ -15,12 +15,12 @@ const tableContentPasteSchema = ( { phrasingContentSchema } ) => ( {
|
|
|
15
15
|
th: {
|
|
16
16
|
allowEmpty: true,
|
|
17
17
|
children: phrasingContentSchema,
|
|
18
|
-
attributes: [ 'scope', 'colspan', 'rowspan' ],
|
|
18
|
+
attributes: [ 'scope', 'colspan', 'rowspan', 'style' ],
|
|
19
19
|
},
|
|
20
20
|
td: {
|
|
21
21
|
allowEmpty: true,
|
|
22
22
|
children: phrasingContentSchema,
|
|
23
|
-
attributes: [ 'colspan', 'rowspan' ],
|
|
23
|
+
attributes: [ 'colspan', 'rowspan', 'style' ],
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
26
|
},
|
|
@@ -79,11 +79,23 @@ const transforms = {
|
|
|
79
79
|
col.getAttribute( 'colspan' )
|
|
80
80
|
);
|
|
81
81
|
|
|
82
|
+
const { textAlign } = col.style || {};
|
|
83
|
+
|
|
84
|
+
let align;
|
|
85
|
+
if (
|
|
86
|
+
textAlign === 'left' ||
|
|
87
|
+
textAlign === 'center' ||
|
|
88
|
+
textAlign === 'right'
|
|
89
|
+
) {
|
|
90
|
+
align = textAlign;
|
|
91
|
+
}
|
|
92
|
+
|
|
82
93
|
colAcc.push( {
|
|
83
94
|
tag: col.nodeName.toLowerCase(),
|
|
84
95
|
content: col.innerHTML,
|
|
85
96
|
rowspan,
|
|
86
97
|
colspan,
|
|
98
|
+
align,
|
|
87
99
|
} );
|
|
88
100
|
|
|
89
101
|
return colAcc;
|
|
@@ -148,8 +148,11 @@ function observeCallback( select, dispatch, clientId ) {
|
|
|
148
148
|
|
|
149
149
|
const headings = getLatestHeadings( select, clientId );
|
|
150
150
|
if ( ! fastDeepEqual( headings, attributes.headings ) ) {
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
// Executing the update in a microtask ensures that the non-persistent marker doesn't affect an attribute triggering the change.
|
|
152
|
+
window.queueMicrotask( () => {
|
|
153
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
154
|
+
updateBlockAttributes( clientId, { headings } );
|
|
155
|
+
} );
|
|
153
156
|
}
|
|
154
157
|
}
|
|
155
158
|
|