@wordpress/block-library 7.11.0 → 7.12.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/archives/edit.js +7 -0
- package/build/archives/edit.js.map +1 -1
- package/build/archives/index.js +4 -0
- package/build/archives/index.js.map +1 -1
- package/build/block/edit.js +4 -2
- package/build/block/edit.js.map +1 -1
- package/build/block/edit.native.js +4 -2
- package/build/block/edit.native.js.map +1 -1
- package/build/calendar/edit.js +12 -5
- package/build/calendar/edit.js.map +1 -1
- package/build/columns/edit.native.js +2 -1
- package/build/columns/edit.native.js.map +1 -1
- package/build/cover/edit/resizable-cover.js +6 -0
- package/build/cover/edit/resizable-cover.js.map +1 -1
- package/build/group/transforms.js +5 -0
- package/build/group/transforms.js.map +1 -1
- package/build/index.native.js +17 -4
- package/build/index.native.js.map +1 -1
- package/build/list/index.js +6 -0
- package/build/list/index.js.map +1 -1
- package/build/list/v2/edit.js +16 -5
- package/build/list/v2/edit.js.map +1 -1
- package/build/list/v2/tag-name.js +31 -0
- package/build/list/v2/tag-name.js.map +1 -0
- package/build/list/v2/tag-name.native.js +32 -0
- package/build/list/v2/tag-name.native.js.map +1 -0
- package/build/list/v2/transforms.js +1 -11
- package/build/list/v2/transforms.js.map +1 -1
- package/build/list-item/edit.js +1 -0
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/edit.native.js +158 -0
- package/build/list-item/edit.native.js.map +1 -0
- package/build/list-item/icons.native.js +53 -0
- package/build/list-item/icons.native.js.map +1 -0
- package/build/list-item/list-style-type.native.js +136 -0
- package/build/list-item/list-style-type.native.js.map +1 -0
- package/build/media-text/deprecated.js +188 -66
- package/build/media-text/deprecated.js.map +1 -1
- package/build/media-text/edit.js +2 -1
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/media-container.js +1 -1
- package/build/media-text/media-container.js.map +1 -1
- package/build/navigation/edit/index.js +68 -123
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +11 -14
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/placeholder/index.js +4 -2
- package/build/navigation/edit/placeholder/index.js.map +1 -1
- package/build/navigation/edit/responsive-wrapper.js +13 -3
- package/build/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build/navigation/edit/use-create-navigation-menu.js +5 -1
- package/build/navigation/edit/use-create-navigation-menu.js.map +1 -1
- package/build/navigation/edit/use-inner-blocks.js +43 -0
- package/build/navigation/edit/use-inner-blocks.js.map +1 -0
- package/build/navigation/edit/utils.js +28 -0
- package/build/navigation/edit/utils.js.map +1 -0
- package/build/navigation/use-navigation-menu.js +7 -3
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/post-author/edit.js +5 -2
- package/build/post-author/edit.js.map +1 -1
- package/build/post-author-biography/edit.js +7 -1
- package/build/post-author-biography/edit.js.map +1 -1
- package/build/post-content/edit.js +4 -2
- package/build/post-content/edit.js.map +1 -1
- package/build/post-featured-image/edit.js +16 -2
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/index.js +9 -0
- package/build/post-featured-image/index.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +42 -9
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/inspector-controls/taxonomy-controls.js +21 -14
- package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build/query-title/edit.js +20 -7
- package/build/query-title/edit.js.map +1 -1
- package/build/query-title/index.js +4 -0
- package/build/query-title/index.js.map +1 -1
- package/build/query-title/variations.js +10 -0
- package/build/query-title/variations.js.map +1 -1
- package/build/quote/transforms.js +2 -2
- package/build/quote/transforms.js.map +1 -1
- package/build/separator/edit.js +1 -1
- package/build/separator/edit.js.map +1 -1
- package/build/social-links/edit.js +1 -0
- package/build/social-links/edit.js.map +1 -1
- package/build/template-part/edit/index.js +4 -2
- package/build/template-part/edit/index.js.map +1 -1
- package/build-module/archives/edit.js +7 -0
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/archives/index.js +4 -0
- package/build-module/archives/index.js.map +1 -1
- package/build-module/block/edit.js +5 -3
- package/build-module/block/edit.js.map +1 -1
- package/build-module/block/edit.native.js +5 -3
- package/build-module/block/edit.native.js.map +1 -1
- package/build-module/calendar/edit.js +12 -4
- package/build-module/calendar/edit.js.map +1 -1
- package/build-module/columns/edit.native.js +3 -2
- package/build-module/columns/edit.native.js.map +1 -1
- package/build-module/cover/edit/resizable-cover.js +6 -0
- package/build-module/cover/edit/resizable-cover.js.map +1 -1
- package/build-module/group/transforms.js +5 -0
- package/build-module/group/transforms.js.map +1 -1
- package/build-module/index.native.js +16 -4
- package/build-module/index.native.js.map +1 -1
- package/build-module/list/index.js +1 -1
- package/build-module/list/index.js.map +1 -1
- package/build-module/list/v2/edit.js +15 -5
- package/build-module/list/v2/edit.js.map +1 -1
- package/build-module/list/v2/tag-name.js +21 -0
- package/build-module/list/v2/tag-name.js.map +1 -0
- package/build-module/list/v2/tag-name.native.js +21 -0
- package/build-module/list/v2/tag-name.native.js.map +1 -0
- package/build-module/list/v2/transforms.js +1 -10
- package/build-module/list/v2/transforms.js.map +1 -1
- package/build-module/list-item/edit.js +1 -3
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/edit.native.js +141 -0
- package/build-module/list-item/edit.native.js.map +1 -0
- package/build-module/list-item/icons.native.js +37 -0
- package/build-module/list-item/icons.native.js.map +1 -0
- package/build-module/list-item/list-style-type.native.js +124 -0
- package/build-module/list-item/list-style-type.native.js.map +1 -0
- package/build-module/media-text/deprecated.js +189 -65
- package/build-module/media-text/deprecated.js.map +1 -1
- package/build-module/media-text/edit.js +2 -1
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/media-container.js +1 -1
- package/build-module/media-text/media-container.js.map +1 -1
- package/build-module/navigation/edit/index.js +66 -122
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +12 -15
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/placeholder/index.js +4 -2
- package/build-module/navigation/edit/placeholder/index.js.map +1 -1
- package/build-module/navigation/edit/responsive-wrapper.js +12 -3
- package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build-module/navigation/edit/use-create-navigation-menu.js +5 -1
- package/build-module/navigation/edit/use-create-navigation-menu.js.map +1 -1
- package/build-module/navigation/edit/use-inner-blocks.js +33 -0
- package/build-module/navigation/edit/use-inner-blocks.js.map +1 -0
- package/build-module/navigation/edit/utils.js +21 -0
- package/build-module/navigation/edit/utils.js.map +1 -0
- package/build-module/navigation/use-navigation-menu.js +7 -3
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/post-author/edit.js +5 -2
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-author-biography/edit.js +6 -1
- package/build-module/post-author-biography/edit.js.map +1 -1
- package/build-module/post-content/edit.js +5 -3
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/post-featured-image/edit.js +17 -3
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/index.js +9 -0
- package/build-module/post-featured-image/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +42 -9
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js +16 -12
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build-module/query-title/edit.js +20 -8
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/query-title/index.js +4 -0
- package/build-module/query-title/index.js.map +1 -1
- package/build-module/query-title/variations.js +10 -0
- package/build-module/query-title/variations.js.map +1 -1
- package/build-module/quote/transforms.js +3 -3
- package/build-module/quote/transforms.js.map +1 -1
- package/build-module/separator/edit.js +1 -1
- package/build-module/separator/edit.js.map +1 -1
- package/build-module/social-links/edit.js +1 -0
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/template-part/edit/index.js +5 -3
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-style/editor-rtl.css +10 -0
- package/build-style/editor.css +10 -0
- package/build-style/latest-posts/editor-rtl.css +3 -0
- package/build-style/latest-posts/editor.css +3 -0
- package/build-style/navigation/style-rtl.css +17 -19
- package/build-style/navigation/style.css +17 -19
- package/build-style/query/editor-rtl.css +7 -0
- package/build-style/query/editor.css +7 -0
- package/build-style/query-pagination/style-rtl.css +6 -0
- package/build-style/query-pagination/style.css +6 -0
- package/build-style/search/style-rtl.css +2 -0
- package/build-style/search/style.css +2 -0
- package/build-style/style-rtl.css +26 -19
- package/build-style/style.css +26 -19
- package/build-style/tag-cloud/style-rtl.css +1 -0
- package/build-style/tag-cloud/style.css +1 -0
- package/package.json +28 -29
- package/src/archives/block.json +4 -0
- package/src/archives/edit.js +12 -1
- package/src/archives/index.php +5 -3
- package/src/audio/test/__snapshots__/edit.native.js.snap +16 -2
- package/src/block/edit.js +4 -4
- package/src/block/edit.native.js +4 -4
- package/src/calendar/edit.js +11 -4
- package/src/columns/edit.native.js +4 -2
- package/src/cover/edit/resizable-cover.js +6 -0
- package/src/cover/index.php +2 -2
- package/src/file/test/__snapshots__/edit.native.js.snap +32 -4
- package/src/group/transforms.js +7 -0
- package/src/home-link/index.php +8 -17
- package/src/image/test/edit.native.js +6 -10
- package/src/index.native.js +15 -2
- package/src/latest-posts/editor.scss +5 -0
- package/src/list/index.js +1 -1
- package/src/list/test/__snapshots__/edit.native.js.snap +133 -0
- package/src/list/test/edit.native.js +511 -7
- package/src/list/v2/edit.js +12 -4
- package/src/list/v2/tag-name.js +13 -0
- package/src/list/v2/tag-name.native.js +12 -0
- package/src/list/v2/transforms.js +1 -9
- package/src/list-item/edit.js +1 -1
- package/src/list-item/edit.native.js +148 -0
- package/src/list-item/icons.native.js +34 -0
- package/src/list-item/list-style-type.native.js +139 -0
- package/src/list-item/style.native.scss +45 -0
- package/src/media-text/deprecated.js +561 -415
- package/src/media-text/edit.js +1 -0
- package/src/media-text/media-container.js +3 -1
- package/src/media-text/test/media-container.js +24 -0
- package/src/navigation/edit/index.js +83 -164
- package/src/navigation/edit/navigation-menu-selector.js +12 -26
- package/src/navigation/edit/placeholder/index.js +4 -2
- package/src/navigation/edit/responsive-wrapper.js +24 -3
- package/src/navigation/edit/use-create-navigation-menu.js +4 -0
- package/src/navigation/edit/use-inner-blocks.js +39 -0
- package/src/navigation/edit/utils.js +30 -0
- package/src/navigation/index.php +6 -0
- package/src/navigation/style.scss +12 -22
- package/src/navigation/use-navigation-menu.js +9 -5
- package/src/navigation-link/index.php +1 -1
- package/src/navigation-submenu/index.php +1 -1
- package/src/page-list/index.php +4 -4
- package/src/post-author/edit.js +6 -3
- package/src/post-author-biography/edit.js +4 -1
- package/src/post-content/edit.js +4 -4
- package/src/post-featured-image/block.json +9 -0
- package/src/post-featured-image/edit.js +23 -1
- package/src/post-featured-image/index.php +3 -1
- package/src/post-title/index.php +2 -1
- package/src/preformatted/test/__snapshots__/edit.native.js.snap +16 -2
- package/src/query/edit/inspector-controls/index.js +129 -65
- package/src/query/edit/inspector-controls/taxonomy-controls.js +17 -10
- package/src/query/editor.scss +9 -0
- package/src/query-pagination/style.scss +14 -0
- package/src/query-title/block.json +4 -0
- package/src/query-title/edit.js +33 -6
- package/src/query-title/index.php +17 -1
- package/src/query-title/variations.js +13 -0
- package/src/quote/transforms.js +3 -7
- package/src/search/style.scss +2 -0
- package/src/search/test/__snapshots__/edit.native.js.snap +56 -7
- package/src/separator/edit.js +1 -1
- package/src/separator/test/edit.js +5 -3
- package/src/site-title/index.php +8 -9
- package/src/social-link/index.php +1 -1
- package/src/social-links/edit.js +1 -0
- package/src/tag-cloud/style.scss +1 -0
- package/src/template-part/edit/index.js +4 -4
|
@@ -13,6 +13,20 @@ $pagination-margin: 0.5em;
|
|
|
13
13
|
margin-right: 0;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
+
|
|
17
|
+
// This moves the next link to the right side of the container,
|
|
18
|
+
// which is important when it's the only block displayed
|
|
19
|
+
// and the block has a "space-between" justification.
|
|
20
|
+
&.is-content-justification-space-between {
|
|
21
|
+
> .wp-block-query-pagination-next:last-child {
|
|
22
|
+
margin-inline-start: auto;
|
|
23
|
+
}
|
|
24
|
+
> .wp-block-query-pagination-previous:first-child {
|
|
25
|
+
margin-inline-end: auto;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
16
30
|
.wp-block-query-pagination-previous-arrow {
|
|
17
31
|
margin-right: 1ch;
|
|
18
32
|
display: inline-block; // Needed so that the transform works.
|
package/src/query-title/edit.js
CHANGED
|
@@ -9,9 +9,11 @@ import classnames from 'classnames';
|
|
|
9
9
|
import {
|
|
10
10
|
AlignmentControl,
|
|
11
11
|
BlockControls,
|
|
12
|
+
InspectorControls,
|
|
12
13
|
useBlockProps,
|
|
13
14
|
Warning,
|
|
14
15
|
} from '@wordpress/block-editor';
|
|
16
|
+
import { ToggleControl, PanelBody } from '@wordpress/components';
|
|
15
17
|
import { __ } from '@wordpress/i18n';
|
|
16
18
|
|
|
17
19
|
/**
|
|
@@ -19,21 +21,19 @@ import { __ } from '@wordpress/i18n';
|
|
|
19
21
|
*/
|
|
20
22
|
import HeadingLevelDropdown from '../heading/heading-level-dropdown';
|
|
21
23
|
|
|
22
|
-
const SUPPORTED_TYPES = [ 'archive' ];
|
|
24
|
+
const SUPPORTED_TYPES = [ 'archive', 'search' ];
|
|
23
25
|
|
|
24
26
|
export default function QueryTitleEdit( {
|
|
25
|
-
attributes: { type, level, textAlign },
|
|
27
|
+
attributes: { type, level, textAlign, showSearchTerm },
|
|
26
28
|
setAttributes,
|
|
27
29
|
} ) {
|
|
28
30
|
const TagName = `h${ level }`;
|
|
29
31
|
const blockProps = useBlockProps( {
|
|
30
|
-
className: classnames( {
|
|
32
|
+
className: classnames( 'wp-block-query-title__placeholder', {
|
|
31
33
|
[ `has-text-align-${ textAlign }` ]: textAlign,
|
|
32
|
-
'wp-block-query-title__placeholder': type === 'archive',
|
|
33
34
|
} ),
|
|
34
35
|
} );
|
|
35
|
-
|
|
36
|
-
// block variations like `Search Title`.
|
|
36
|
+
|
|
37
37
|
if ( ! SUPPORTED_TYPES.includes( type ) ) {
|
|
38
38
|
return (
|
|
39
39
|
<div { ...blockProps }>
|
|
@@ -48,6 +48,33 @@ export default function QueryTitleEdit( {
|
|
|
48
48
|
<TagName { ...blockProps }>{ __( 'Archive title' ) }</TagName>
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
|
+
|
|
52
|
+
if ( type === 'search' ) {
|
|
53
|
+
titleElement = (
|
|
54
|
+
<>
|
|
55
|
+
<InspectorControls>
|
|
56
|
+
<PanelBody title={ __( 'Settings' ) }>
|
|
57
|
+
<ToggleControl
|
|
58
|
+
label={ __( 'Show search term in title' ) }
|
|
59
|
+
onChange={ () =>
|
|
60
|
+
setAttributes( {
|
|
61
|
+
showSearchTerm: ! showSearchTerm,
|
|
62
|
+
} )
|
|
63
|
+
}
|
|
64
|
+
checked={ showSearchTerm }
|
|
65
|
+
/>
|
|
66
|
+
</PanelBody>
|
|
67
|
+
</InspectorControls>
|
|
68
|
+
|
|
69
|
+
<TagName { ...blockProps }>
|
|
70
|
+
{ showSearchTerm
|
|
71
|
+
? __( 'Search results for: "search term"' )
|
|
72
|
+
: __( 'Search results' ) }
|
|
73
|
+
</TagName>
|
|
74
|
+
</>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
51
78
|
return (
|
|
52
79
|
<>
|
|
53
80
|
<BlockControls group="block">
|
|
@@ -17,13 +17,29 @@
|
|
|
17
17
|
function render_block_core_query_title( $attributes ) {
|
|
18
18
|
$type = isset( $attributes['type'] ) ? $attributes['type'] : null;
|
|
19
19
|
$is_archive = is_archive();
|
|
20
|
-
|
|
20
|
+
$is_search = is_search();
|
|
21
|
+
if ( ! $type ||
|
|
22
|
+
( 'archive' === $type && ! $is_archive ) ||
|
|
23
|
+
( 'search' === $type && ! $is_search )
|
|
24
|
+
) {
|
|
21
25
|
return '';
|
|
22
26
|
}
|
|
23
27
|
$title = '';
|
|
24
28
|
if ( $is_archive ) {
|
|
25
29
|
$title = get_the_archive_title();
|
|
26
30
|
}
|
|
31
|
+
if ( $is_search ) {
|
|
32
|
+
$title = __( 'Search results' );
|
|
33
|
+
|
|
34
|
+
if ( isset( $attributes['showSearchTerm'] ) && $attributes['showSearchTerm'] ) {
|
|
35
|
+
$title = sprintf(
|
|
36
|
+
/* translators: %s is the search term. */
|
|
37
|
+
__( 'Search results for: "%s"' ),
|
|
38
|
+
get_search_query()
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
27
43
|
$tag_name = isset( $attributes['level'] ) ? 'h' . (int) $attributes['level'] : 'h1';
|
|
28
44
|
$align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}";
|
|
29
45
|
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) );
|
|
@@ -17,6 +17,19 @@ const variations = [
|
|
|
17
17
|
},
|
|
18
18
|
scope: [ 'inserter' ],
|
|
19
19
|
},
|
|
20
|
+
{
|
|
21
|
+
isDefault: false,
|
|
22
|
+
name: 'search-title',
|
|
23
|
+
title: __( 'Search Results Title' ),
|
|
24
|
+
description: __(
|
|
25
|
+
'Display the search results title based on the queried object.'
|
|
26
|
+
),
|
|
27
|
+
icon: title,
|
|
28
|
+
attributes: {
|
|
29
|
+
type: 'search',
|
|
30
|
+
},
|
|
31
|
+
scope: [ 'inserter' ],
|
|
32
|
+
},
|
|
20
33
|
];
|
|
21
34
|
|
|
22
35
|
/**
|
package/src/quote/transforms.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
createBlock,
|
|
6
|
-
parseWithAttributeSchema,
|
|
7
|
-
rawHandler,
|
|
8
|
-
} from '@wordpress/blocks';
|
|
4
|
+
import { createBlock, parseWithAttributeSchema } from '@wordpress/blocks';
|
|
9
5
|
|
|
10
6
|
const transforms = {
|
|
11
7
|
from: [
|
|
@@ -59,7 +55,7 @@ const transforms = {
|
|
|
59
55
|
},
|
|
60
56
|
} ),
|
|
61
57
|
selector: 'blockquote',
|
|
62
|
-
transform: ( node ) => {
|
|
58
|
+
transform: ( node, handler ) => {
|
|
63
59
|
return createBlock(
|
|
64
60
|
'core/quote',
|
|
65
61
|
// Don't try to parse any `cite` out of this content.
|
|
@@ -68,7 +64,7 @@ const transforms = {
|
|
|
68
64
|
// * If the cite is nested in the quoted text, it's wrong to
|
|
69
65
|
// remove it.
|
|
70
66
|
{},
|
|
71
|
-
|
|
67
|
+
handler( {
|
|
72
68
|
HTML: node.innerHTML,
|
|
73
69
|
mode: 'BLOCKS',
|
|
74
70
|
} )
|
package/src/search/style.scss
CHANGED
|
@@ -11,7 +11,14 @@ exports[`Search Block renders block with button inside option 1`] = `
|
|
|
11
11
|
accessibilityRole="none"
|
|
12
12
|
accessible={true}
|
|
13
13
|
>
|
|
14
|
-
<View
|
|
14
|
+
<View
|
|
15
|
+
style={
|
|
16
|
+
Array [
|
|
17
|
+
undefined,
|
|
18
|
+
undefined,
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
>
|
|
15
22
|
<RCTAztecView
|
|
16
23
|
accessible={true}
|
|
17
24
|
activeFormats={Array []}
|
|
@@ -119,7 +126,14 @@ exports[`Search Block renders block with button inside option 1`] = `
|
|
|
119
126
|
accessible={true}
|
|
120
127
|
onLayout={[Function]}
|
|
121
128
|
>
|
|
122
|
-
<View
|
|
129
|
+
<View
|
|
130
|
+
style={
|
|
131
|
+
Array [
|
|
132
|
+
undefined,
|
|
133
|
+
undefined,
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
>
|
|
123
137
|
<RCTAztecView
|
|
124
138
|
accessible={true}
|
|
125
139
|
activeFormats={Array []}
|
|
@@ -191,7 +205,14 @@ exports[`Search Block renders block with icon button option matches snapshot 1`]
|
|
|
191
205
|
accessibilityRole="none"
|
|
192
206
|
accessible={true}
|
|
193
207
|
>
|
|
194
|
-
<View
|
|
208
|
+
<View
|
|
209
|
+
style={
|
|
210
|
+
Array [
|
|
211
|
+
undefined,
|
|
212
|
+
undefined,
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
>
|
|
195
216
|
<RCTAztecView
|
|
196
217
|
accessible={true}
|
|
197
218
|
activeFormats={Array []}
|
|
@@ -359,7 +380,14 @@ exports[`Search Block renders block with label hidden matches snapshot 1`] = `
|
|
|
359
380
|
accessible={true}
|
|
360
381
|
onLayout={[Function]}
|
|
361
382
|
>
|
|
362
|
-
<View
|
|
383
|
+
<View
|
|
384
|
+
style={
|
|
385
|
+
Array [
|
|
386
|
+
undefined,
|
|
387
|
+
undefined,
|
|
388
|
+
]
|
|
389
|
+
}
|
|
390
|
+
>
|
|
363
391
|
<RCTAztecView
|
|
364
392
|
accessible={true}
|
|
365
393
|
activeFormats={Array []}
|
|
@@ -431,7 +459,14 @@ exports[`Search Block renders with default configuration matches snapshot 1`] =
|
|
|
431
459
|
accessibilityRole="none"
|
|
432
460
|
accessible={true}
|
|
433
461
|
>
|
|
434
|
-
<View
|
|
462
|
+
<View
|
|
463
|
+
style={
|
|
464
|
+
Array [
|
|
465
|
+
undefined,
|
|
466
|
+
undefined,
|
|
467
|
+
]
|
|
468
|
+
}
|
|
469
|
+
>
|
|
435
470
|
<RCTAztecView
|
|
436
471
|
accessible={true}
|
|
437
472
|
activeFormats={Array []}
|
|
@@ -539,7 +574,14 @@ exports[`Search Block renders with default configuration matches snapshot 1`] =
|
|
|
539
574
|
accessible={true}
|
|
540
575
|
onLayout={[Function]}
|
|
541
576
|
>
|
|
542
|
-
<View
|
|
577
|
+
<View
|
|
578
|
+
style={
|
|
579
|
+
Array [
|
|
580
|
+
undefined,
|
|
581
|
+
undefined,
|
|
582
|
+
]
|
|
583
|
+
}
|
|
584
|
+
>
|
|
543
585
|
<RCTAztecView
|
|
544
586
|
accessible={true}
|
|
545
587
|
activeFormats={Array []}
|
|
@@ -611,7 +653,14 @@ exports[`Search Block renders with no-button option matches snapshot 1`] = `
|
|
|
611
653
|
accessibilityRole="none"
|
|
612
654
|
accessible={true}
|
|
613
655
|
>
|
|
614
|
-
<View
|
|
656
|
+
<View
|
|
657
|
+
style={
|
|
658
|
+
Array [
|
|
659
|
+
undefined,
|
|
660
|
+
undefined,
|
|
661
|
+
]
|
|
662
|
+
}
|
|
663
|
+
>
|
|
615
664
|
<RCTAztecView
|
|
616
665
|
accessible={true}
|
|
617
666
|
activeFormats={Array []}
|
package/src/separator/edit.js
CHANGED
|
@@ -66,7 +66,8 @@ describe( 'Separator block edit method', () => {
|
|
|
66
66
|
expect( useBlockProps ).toHaveBeenCalledWith( {
|
|
67
67
|
// For backwards compatibility the has-text-color class is also added even though it is only needed for
|
|
68
68
|
// is-style-dots as this class was always added to v1 blocks, so may be expected by themes and plugins.
|
|
69
|
-
className:
|
|
69
|
+
className:
|
|
70
|
+
'has-text-color has-alpha-channel-opacity has-background',
|
|
70
71
|
style: {
|
|
71
72
|
backgroundColor: '#ff0000',
|
|
72
73
|
color: '#ff0000',
|
|
@@ -85,7 +86,8 @@ describe( 'Separator block edit method', () => {
|
|
|
85
86
|
};
|
|
86
87
|
render( <SeparatorEdit { ...props } /> );
|
|
87
88
|
expect( useBlockProps ).toHaveBeenCalledWith( {
|
|
88
|
-
className:
|
|
89
|
+
className:
|
|
90
|
+
'has-text-color has-alpha-channel-opacity has-background',
|
|
89
91
|
style: {
|
|
90
92
|
backgroundColor: '#ff0000',
|
|
91
93
|
color: '#ff0000',
|
|
@@ -106,7 +108,7 @@ describe( 'Separator block edit method', () => {
|
|
|
106
108
|
// background color classes are added by useBlockProps which has to be mocked.
|
|
107
109
|
expect( useBlockProps ).toHaveBeenCalledWith( {
|
|
108
110
|
className:
|
|
109
|
-
'has-text-color has-banana-color has-alpha-channel-opacity',
|
|
111
|
+
'has-text-color has-banana-color has-alpha-channel-opacity has-banana-background-color has-background',
|
|
110
112
|
style: undefined,
|
|
111
113
|
} );
|
|
112
114
|
} );
|
package/src/site-title/index.php
CHANGED
|
@@ -21,22 +21,21 @@ function render_block_core_site_title( $attributes ) {
|
|
|
21
21
|
$tag_name = 'h1';
|
|
22
22
|
$align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}";
|
|
23
23
|
|
|
24
|
-
$aria_current = is_home() || ( is_front_page() && 'page' === get_option( 'show_on_front' ) ) ? ' aria-current="page"' : '';
|
|
25
|
-
|
|
26
24
|
if ( isset( $attributes['level'] ) ) {
|
|
27
25
|
$tag_name = 0 === $attributes['level'] ? 'p' : 'h' . (int) $attributes['level'];
|
|
28
26
|
}
|
|
29
27
|
|
|
30
28
|
if ( $attributes['isLink'] ) {
|
|
31
|
-
$
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
$aria_current = is_home() || ( is_front_page() && 'page' === get_option( 'show_on_front' ) ) ? ' aria-current="page"' : '';
|
|
30
|
+
$link_target = ! empty( $attributes['linkTarget'] ) ? $attributes['linkTarget'] : '_self';
|
|
31
|
+
|
|
32
|
+
$site_title = sprintf(
|
|
33
|
+
'<a href="%1$s" target="%2$s" rel="home"%3$s>%4$s</a>',
|
|
34
|
+
esc_url( home_url() ),
|
|
35
|
+
esc_attr( $link_target ),
|
|
34
36
|
$aria_current,
|
|
37
|
+
esc_html( $site_title )
|
|
35
38
|
);
|
|
36
|
-
if ( '_blank' === $attributes['linkTarget'] ) {
|
|
37
|
-
$link_attrs[] = 'target="_blank"';
|
|
38
|
-
}
|
|
39
|
-
$site_title = sprintf( '<a %1$s>%2$s</a>', implode( ' ', $link_attrs ), esc_html( $site_title ) );
|
|
40
39
|
}
|
|
41
40
|
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) );
|
|
42
41
|
|
|
@@ -296,7 +296,7 @@ function block_core_social_link_services( $service = '', $field = '' ) {
|
|
|
296
296
|
),
|
|
297
297
|
'share' => array(
|
|
298
298
|
'name' => 'Share Icon',
|
|
299
|
-
'icon' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z"/></svg>',
|
|
299
|
+
'icon' => '<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z"/></svg>',
|
|
300
300
|
),
|
|
301
301
|
);
|
|
302
302
|
|
package/src/social-links/edit.js
CHANGED
|
@@ -108,6 +108,7 @@ export function SocialLinksEdit( props ) {
|
|
|
108
108
|
// Fallback color values are used maintain selections in case switching
|
|
109
109
|
// themes and named colors in palette do not match.
|
|
110
110
|
const className = classNames( size, {
|
|
111
|
+
'has-visible-labels': showLabels,
|
|
111
112
|
'has-icon-color': iconColor.color || iconColorValue,
|
|
112
113
|
'has-icon-background-color':
|
|
113
114
|
iconBackgroundColor.color || iconBackgroundColorValue,
|
package/src/tag-cloud/style.scss
CHANGED
|
@@ -13,7 +13,8 @@ import {
|
|
|
13
13
|
useBlockProps,
|
|
14
14
|
Warning,
|
|
15
15
|
store as blockEditorStore,
|
|
16
|
-
|
|
16
|
+
__experimentalRecursionProvider as RecursionProvider,
|
|
17
|
+
__experimentalUseHasRecursion as useHasRecursion,
|
|
17
18
|
__experimentalUseBlockOverlayActive as useBlockOverlayActive,
|
|
18
19
|
} from '@wordpress/block-editor';
|
|
19
20
|
import { Spinner, Modal, MenuItem } from '@wordpress/components';
|
|
@@ -43,8 +44,7 @@ export default function TemplatePartEdit( {
|
|
|
43
44
|
} ) {
|
|
44
45
|
const { slug, theme, tagName, layout = {} } = attributes;
|
|
45
46
|
const templatePartId = createTemplatePartId( theme, slug );
|
|
46
|
-
const
|
|
47
|
-
useNoRecursiveRenders( templatePartId );
|
|
47
|
+
const hasAlreadyRendered = useHasRecursion( templatePartId );
|
|
48
48
|
const [ isTemplatePartSelectionOpen, setIsTemplatePartSelectionOpen ] =
|
|
49
49
|
useState( false );
|
|
50
50
|
|
|
@@ -142,7 +142,7 @@ export default function TemplatePartEdit( {
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
return (
|
|
145
|
-
<RecursionProvider>
|
|
145
|
+
<RecursionProvider uniqueId={ templatePartId }>
|
|
146
146
|
<TemplatePartAdvancedControls
|
|
147
147
|
tagName={ tagName }
|
|
148
148
|
setAttributes={ setAttributes }
|