@wordpress/block-library 9.12.0 → 9.13.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/block-keyboard-shortcuts/index.js +7 -7
- package/build/block-keyboard-shortcuts/index.js.map +1 -1
- package/build/cover/edit/index.js +1 -1
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/index.js +10 -10
- package/build/cover/index.js.map +1 -1
- package/build/cover/shared.js +6 -7
- package/build/cover/shared.js.map +1 -1
- package/build/details/index.js +19 -0
- package/build/details/index.js.map +1 -1
- package/build/file/edit.js +7 -3
- package/build/file/edit.js.map +1 -1
- package/build/freeform/modal.js +1 -1
- package/build/freeform/modal.js.map +1 -1
- package/build/heading/index.js +1 -7
- package/build/heading/index.js.map +1 -1
- package/build/home-link/edit.js +20 -36
- package/build/home-link/edit.js.map +1 -1
- package/build/navigation/use-template-part-area-label.js +6 -8
- package/build/navigation/use-template-part-area-label.js.map +1 -1
- package/build/page-list/index.js +14 -0
- package/build/page-list/index.js.map +1 -1
- package/build/paragraph/edit.js +26 -25
- package/build/paragraph/edit.js.map +1 -1
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js +1 -3
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +1 -11
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/utils.js +6 -8
- package/build/query/utils.js.map +1 -1
- package/build/social-link/edit.js +57 -10
- package/build/social-link/edit.js.map +1 -1
- package/build/social-link/index.js +4 -2
- package/build/social-link/index.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +2 -7
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/template-part/edit/utils/get-template-part-icon.js +23 -0
- package/build/template-part/edit/utils/get-template-part-icon.js.map +1 -0
- package/build/template-part/edit/utils/hooks.js +1 -6
- package/build/template-part/edit/utils/hooks.js.map +1 -1
- package/build/template-part/variations.js +6 -12
- package/build/template-part/variations.js.map +1 -1
- package/build/video/tracks-editor.js +135 -121
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/block-keyboard-shortcuts/index.js +7 -7
- package/build-module/block-keyboard-shortcuts/index.js.map +1 -1
- package/build-module/cover/edit/index.js +1 -1
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/index.js +10 -10
- package/build-module/cover/index.js.map +1 -1
- package/build-module/cover/shared.js +6 -7
- package/build-module/cover/shared.js.map +1 -1
- package/build-module/details/index.js +20 -1
- package/build-module/details/index.js.map +1 -1
- package/build-module/file/edit.js +7 -3
- package/build-module/file/edit.js.map +1 -1
- package/build-module/freeform/modal.js +1 -1
- package/build-module/freeform/modal.js.map +1 -1
- package/build-module/heading/index.js +1 -7
- package/build-module/heading/index.js.map +1 -1
- package/build-module/home-link/edit.js +23 -39
- package/build-module/home-link/edit.js.map +1 -1
- package/build-module/navigation/use-template-part-area-label.js +6 -8
- package/build-module/navigation/use-template-part-area-label.js.map +1 -1
- package/build-module/page-list/index.js +14 -0
- package/build-module/page-list/index.js.map +1 -1
- package/build-module/paragraph/edit.js +26 -25
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +1 -3
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +1 -11
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/utils.js +6 -8
- package/build-module/query/utils.js.map +1 -1
- package/build-module/social-link/edit.js +61 -14
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-link/index.js +4 -2
- package/build-module/social-link/index.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +3 -8
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/template-part/edit/utils/get-template-part-icon.js +15 -0
- package/build-module/template-part/edit/utils/get-template-part-icon.js.map +1 -0
- package/build-module/template-part/edit/utils/hooks.js +1 -6
- package/build-module/template-part/edit/utils/hooks.js.map +1 -1
- package/build-module/template-part/variations.js +5 -11
- package/build-module/template-part/variations.js.map +1 -1
- package/build-module/video/tracks-editor.js +136 -122
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/editor-rtl.css +16 -8
- package/build-style/editor.css +16 -8
- package/build-style/navigation/style-rtl.css +1 -1
- package/build-style/navigation/style.css +1 -1
- package/build-style/page-list/style-rtl.css +4 -0
- package/build-style/page-list/style.css +4 -0
- package/build-style/query/editor-rtl.css +0 -4
- package/build-style/query/editor.css +0 -4
- package/build-style/search/style-rtl.css +3 -3
- package/build-style/search/style.css +3 -3
- package/build-style/social-link/editor-rtl.css +8 -4
- package/build-style/social-link/editor.css +8 -4
- package/build-style/style-rtl.css +8 -4
- package/build-style/style.css +8 -4
- package/build-style/video/editor-rtl.css +8 -0
- package/build-style/video/editor.css +8 -0
- package/package.json +2 -2
- package/src/block-keyboard-shortcuts/index.js +25 -11
- package/src/cover/edit/index.js +1 -1
- package/src/cover/index.js +8 -8
- package/src/cover/shared.js +10 -10
- package/src/cover/test/edit.js +2 -2
- package/src/details/index.js +23 -1
- package/src/file/edit.js +8 -2
- package/src/freeform/modal.js +1 -1
- package/src/heading/block.json +1 -7
- package/src/home-link/edit.js +27 -45
- package/src/home-link/index.php +0 -3
- package/src/navigation/index.php +4 -150
- package/src/navigation/style.scss +1 -1
- package/src/navigation/use-template-part-area-label.js +10 -10
- package/src/page-list/block.json +14 -0
- package/src/page-list/style.scss +4 -0
- package/src/paragraph/edit.js +20 -17
- package/src/pattern/index.php +0 -7
- package/src/query/edit/inspector-controls/enhanced-pagination-control.js +3 -5
- package/src/query/edit/inspector-controls/index.js +0 -10
- package/src/query/editor.scss +0 -4
- package/src/query/index.php +1 -1
- package/src/query/utils.js +14 -15
- package/src/rss/index.php +11 -8
- package/src/search/style.scss +3 -5
- package/src/social-link/block.json +4 -2
- package/src/social-link/edit.js +87 -19
- package/src/social-link/editor.scss +11 -7
- package/src/template-part/edit/advanced-controls.js +13 -13
- package/src/template-part/edit/utils/get-template-part-icon.js +20 -0
- package/src/template-part/edit/utils/hooks.js +2 -7
- package/src/template-part/variations.js +4 -16
- package/src/video/editor.scss +9 -0
- package/src/video/tracks-editor.js +157 -139
- package/build/query/edit/inspector-controls/create-new-post-link.js +0 -40
- package/build/query/edit/inspector-controls/create-new-post-link.js.map +0 -1
- package/build-module/query/edit/inspector-controls/create-new-post-link.js +0 -33
- package/build-module/query/edit/inspector-controls/create-new-post-link.js.map +0 -1
- package/src/query/edit/inspector-controls/create-new-post-link.js +0 -32
package/src/home-link/index.php
CHANGED
|
@@ -137,9 +137,6 @@ function block_core_home_link_build_li_wrapper_attributes( $context ) {
|
|
|
137
137
|
*/
|
|
138
138
|
function render_block_core_home_link( $attributes, $content, $block ) {
|
|
139
139
|
if ( empty( $attributes['label'] ) ) {
|
|
140
|
-
// Using a fallback for the label attribute allows rendering the block even if no attributes have been set,
|
|
141
|
-
// e.g. when using the block as a hooked block.
|
|
142
|
-
// Note that the fallback value needs to be kept in sync with the one set in `edit.js` (upon first loading the block in the editor).
|
|
143
140
|
$attributes['label'] = __( 'Home' );
|
|
144
141
|
}
|
|
145
142
|
$aria_current = '';
|
package/src/navigation/index.php
CHANGED
|
@@ -344,6 +344,10 @@ class WP_Navigation_Block_Renderer {
|
|
|
344
344
|
|
|
345
345
|
$navigation_name = $attributes['ariaLabel'] ?? '';
|
|
346
346
|
|
|
347
|
+
if ( ! empty( $navigation_name ) ) {
|
|
348
|
+
return $navigation_name;
|
|
349
|
+
}
|
|
350
|
+
|
|
347
351
|
// Load the navigation post.
|
|
348
352
|
if ( array_key_exists( 'ref', $attributes ) ) {
|
|
349
353
|
$navigation_post = get_post( $attributes['ref'] );
|
|
@@ -1516,153 +1520,3 @@ function block_core_navigation_insert_hooked_blocks( $inner_blocks, $post ) {
|
|
|
1516
1520
|
|
|
1517
1521
|
return traverse_and_serialize_block( $mock_navigation_block, $before_block_visitor, $after_block_visitor );
|
|
1518
1522
|
}
|
|
1519
|
-
|
|
1520
|
-
/**
|
|
1521
|
-
* Insert ignoredHookedBlocks meta into the Navigation block and its inner blocks.
|
|
1522
|
-
*
|
|
1523
|
-
* Given a Navigation block's inner blocks and its corresponding `wp_navigation` post object,
|
|
1524
|
-
* this function inserts ignoredHookedBlocks meta into it, and returns the serialized inner blocks in a
|
|
1525
|
-
* mock Navigation block wrapper.
|
|
1526
|
-
*
|
|
1527
|
-
* @since 6.5.0
|
|
1528
|
-
*
|
|
1529
|
-
* @param array $inner_blocks Parsed inner blocks of a Navigation block.
|
|
1530
|
-
* @param WP_Post $post `wp_navigation` post object corresponding to the block.
|
|
1531
|
-
* @return string Serialized inner blocks in mock Navigation block wrapper, with hooked blocks inserted, if any.
|
|
1532
|
-
*/
|
|
1533
|
-
function block_core_navigation_set_ignored_hooked_blocks_metadata( $inner_blocks, $post ) {
|
|
1534
|
-
$mock_navigation_block = block_core_navigation_mock_parsed_block( $inner_blocks, $post );
|
|
1535
|
-
$hooked_blocks = get_hooked_blocks();
|
|
1536
|
-
$before_block_visitor = null;
|
|
1537
|
-
$after_block_visitor = null;
|
|
1538
|
-
|
|
1539
|
-
if ( ! empty( $hooked_blocks ) || has_filter( 'hooked_block_types' ) ) {
|
|
1540
|
-
$before_block_visitor = make_before_block_visitor( $hooked_blocks, $post, 'set_ignored_hooked_blocks_metadata' );
|
|
1541
|
-
$after_block_visitor = make_after_block_visitor( $hooked_blocks, $post, 'set_ignored_hooked_blocks_metadata' );
|
|
1542
|
-
}
|
|
1543
|
-
|
|
1544
|
-
return traverse_and_serialize_block( $mock_navigation_block, $before_block_visitor, $after_block_visitor );
|
|
1545
|
-
}
|
|
1546
|
-
|
|
1547
|
-
/**
|
|
1548
|
-
* Updates the post meta with the list of ignored hooked blocks when the navigation is created or updated via the REST API.
|
|
1549
|
-
*
|
|
1550
|
-
* @access private
|
|
1551
|
-
* @since 6.5.0
|
|
1552
|
-
*
|
|
1553
|
-
* @param stdClass $post Post object.
|
|
1554
|
-
* @return stdClass The updated post object.
|
|
1555
|
-
*/
|
|
1556
|
-
function block_core_navigation_update_ignore_hooked_blocks_meta( $post ) {
|
|
1557
|
-
/*
|
|
1558
|
-
* In this scenario the user has likely tried to create a navigation via the REST API.
|
|
1559
|
-
* In which case we won't have a post ID to work with and store meta against.
|
|
1560
|
-
*/
|
|
1561
|
-
if ( empty( $post->ID ) ) {
|
|
1562
|
-
return $post;
|
|
1563
|
-
}
|
|
1564
|
-
|
|
1565
|
-
/**
|
|
1566
|
-
* Skip meta generation when consumers intentionally update specific Navigation fields
|
|
1567
|
-
* and omit the content update.
|
|
1568
|
-
*/
|
|
1569
|
-
if ( ! isset( $post->post_content ) ) {
|
|
1570
|
-
return $post;
|
|
1571
|
-
}
|
|
1572
|
-
|
|
1573
|
-
/*
|
|
1574
|
-
* We run the Block Hooks mechanism to inject the `metadata.ignoredHookedBlocks` attribute into
|
|
1575
|
-
* all anchor blocks. For the root level, we create a mock Navigation and extract them from there.
|
|
1576
|
-
*/
|
|
1577
|
-
$blocks = parse_blocks( $post->post_content );
|
|
1578
|
-
|
|
1579
|
-
/*
|
|
1580
|
-
* Block Hooks logic requires a `WP_Post` object (rather than the `stdClass` with the updates that
|
|
1581
|
-
* we're getting from the `rest_pre_insert_wp_navigation` filter) as its second argument (to be
|
|
1582
|
-
* used as context for hooked blocks insertion).
|
|
1583
|
-
* We thus have to look it up from the DB,based on `$post->ID`.
|
|
1584
|
-
*/
|
|
1585
|
-
$markup = block_core_navigation_set_ignored_hooked_blocks_metadata( $blocks, get_post( $post->ID ) );
|
|
1586
|
-
|
|
1587
|
-
$root_nav_block = parse_blocks( $markup )[0];
|
|
1588
|
-
$ignored_hooked_blocks = isset( $root_nav_block['attrs']['metadata']['ignoredHookedBlocks'] )
|
|
1589
|
-
? $root_nav_block['attrs']['metadata']['ignoredHookedBlocks']
|
|
1590
|
-
: array();
|
|
1591
|
-
|
|
1592
|
-
if ( ! empty( $ignored_hooked_blocks ) ) {
|
|
1593
|
-
$existing_ignored_hooked_blocks = get_post_meta( $post->ID, '_wp_ignored_hooked_blocks', true );
|
|
1594
|
-
if ( ! empty( $existing_ignored_hooked_blocks ) ) {
|
|
1595
|
-
$existing_ignored_hooked_blocks = json_decode( $existing_ignored_hooked_blocks, true );
|
|
1596
|
-
$ignored_hooked_blocks = array_unique( array_merge( $ignored_hooked_blocks, $existing_ignored_hooked_blocks ) );
|
|
1597
|
-
}
|
|
1598
|
-
update_post_meta( $post->ID, '_wp_ignored_hooked_blocks', json_encode( $ignored_hooked_blocks ) );
|
|
1599
|
-
}
|
|
1600
|
-
|
|
1601
|
-
$post->post_content = block_core_navigation_remove_serialized_parent_block( $markup );
|
|
1602
|
-
return $post;
|
|
1603
|
-
}
|
|
1604
|
-
|
|
1605
|
-
/*
|
|
1606
|
-
* Before adding our filter, we verify if it's already added in Core.
|
|
1607
|
-
* However, during the build process, Gutenberg automatically prefixes our functions with "gutenberg_".
|
|
1608
|
-
* Therefore, we concatenate the Core's function name to circumvent this prefix for our check.
|
|
1609
|
-
*/
|
|
1610
|
-
$rest_insert_wp_navigation_core_callback = 'block_core_navigation_' . 'update_ignore_hooked_blocks_meta'; // phpcs:ignore Generic.Strings.UnnecessaryStringConcat.Found
|
|
1611
|
-
|
|
1612
|
-
/*
|
|
1613
|
-
* Do not add the `block_core_navigation_update_ignore_hooked_blocks_meta` filter in the following cases:
|
|
1614
|
-
* - If Core has added the `update_ignored_hooked_blocks_postmeta` filter already (WP >= 6.6);
|
|
1615
|
-
* - or if the `$rest_insert_wp_navigation_core_callback` filter has already been added.
|
|
1616
|
-
*/
|
|
1617
|
-
if (
|
|
1618
|
-
! has_filter( 'rest_pre_insert_wp_navigation', 'update_ignored_hooked_blocks_postmeta' ) &&
|
|
1619
|
-
! has_filter( 'rest_pre_insert_wp_navigation', $rest_insert_wp_navigation_core_callback )
|
|
1620
|
-
) {
|
|
1621
|
-
add_filter( 'rest_pre_insert_wp_navigation', 'block_core_navigation_update_ignore_hooked_blocks_meta' );
|
|
1622
|
-
}
|
|
1623
|
-
|
|
1624
|
-
/**
|
|
1625
|
-
* Hooks into the REST API response for the core/navigation block and adds the first and last inner blocks.
|
|
1626
|
-
*
|
|
1627
|
-
* @since 6.5.0
|
|
1628
|
-
*
|
|
1629
|
-
* @param WP_REST_Response $response The response object.
|
|
1630
|
-
* @param WP_Post $post Post object.
|
|
1631
|
-
* @return WP_REST_Response The response object.
|
|
1632
|
-
*/
|
|
1633
|
-
function block_core_navigation_insert_hooked_blocks_into_rest_response( $response, $post ) {
|
|
1634
|
-
if ( ! isset( $response->data['content']['raw'] ) || ! isset( $response->data['content']['rendered'] ) ) {
|
|
1635
|
-
return $response;
|
|
1636
|
-
}
|
|
1637
|
-
$parsed_blocks = parse_blocks( $response->data['content']['raw'] );
|
|
1638
|
-
$content = block_core_navigation_insert_hooked_blocks( $parsed_blocks, $post );
|
|
1639
|
-
|
|
1640
|
-
// Remove mock Navigation block wrapper.
|
|
1641
|
-
$content = block_core_navigation_remove_serialized_parent_block( $content );
|
|
1642
|
-
|
|
1643
|
-
$response->data['content']['raw'] = $content;
|
|
1644
|
-
|
|
1645
|
-
/** This filter is documented in wp-includes/post-template.php */
|
|
1646
|
-
$response->data['content']['rendered'] = apply_filters( 'the_content', $content );
|
|
1647
|
-
|
|
1648
|
-
return $response;
|
|
1649
|
-
}
|
|
1650
|
-
|
|
1651
|
-
/*
|
|
1652
|
-
* Before adding our filter, we verify if it's already added in Core.
|
|
1653
|
-
* However, during the build process, Gutenberg automatically prefixes our functions with "gutenberg_".
|
|
1654
|
-
* Therefore, we concatenate the Core's function name to circumvent this prefix for our check.
|
|
1655
|
-
*/
|
|
1656
|
-
$rest_prepare_wp_navigation_core_callback = 'block_core_navigation_' . 'insert_hooked_blocks_into_rest_response';
|
|
1657
|
-
|
|
1658
|
-
/*
|
|
1659
|
-
* Do not add the `block_core_navigation_insert_hooked_blocks_into_rest_response` filter in the following cases:
|
|
1660
|
-
* - If Core has added the `insert_hooked_blocks_into_rest_response` filter already (WP >= 6.6);
|
|
1661
|
-
* - or if the `$rest_prepare_wp_navigation_core_callback` filter has already been added.
|
|
1662
|
-
*/
|
|
1663
|
-
if (
|
|
1664
|
-
! has_filter( 'rest_prepare_wp_navigation', 'insert_hooked_blocks_into_rest_response' ) &&
|
|
1665
|
-
! has_filter( 'rest_prepare_wp_navigation', $rest_prepare_wp_navigation_core_callback )
|
|
1666
|
-
) {
|
|
1667
|
-
add_filter( 'rest_prepare_wp_navigation', 'block_core_navigation_insert_hooked_blocks_into_rest_response', 10, 3 );
|
|
1668
|
-
}
|
|
@@ -510,7 +510,7 @@ button.wp-block-navigation-item__content {
|
|
|
510
510
|
padding-top: clamp(1rem, var(--wp--style--root--padding-top), 20rem);
|
|
511
511
|
padding-right: clamp(1rem, var(--wp--style--root--padding-right), 20rem);
|
|
512
512
|
padding-bottom: clamp(1rem, var(--wp--style--root--padding-bottom), 20rem);
|
|
513
|
-
padding-left: clamp(1rem, var(--wp--style--root--padding-left),
|
|
513
|
+
padding-left: clamp(1rem, var(--wp--style--root--padding-left), 20rem);
|
|
514
514
|
|
|
515
515
|
// Allow modal to scroll.
|
|
516
516
|
overflow: auto;
|
|
@@ -11,6 +11,7 @@ import { useSelect } from '@wordpress/data';
|
|
|
11
11
|
|
|
12
12
|
// TODO: this util should perhaps be refactored somewhere like core-data.
|
|
13
13
|
import { createTemplatePartId } from '../template-part/edit/utils/create-template-part-id';
|
|
14
|
+
import { getTemplatePartIcon } from '../template-part/edit/utils/get-template-part-icon';
|
|
14
15
|
|
|
15
16
|
export default function useTemplatePartAreaLabel( clientId ) {
|
|
16
17
|
return useSelect(
|
|
@@ -35,16 +36,15 @@ export default function useTemplatePartAreaLabel( clientId ) {
|
|
|
35
36
|
return;
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
/* eslint-enable @wordpress/data-no-store-string-literals */
|
|
39
|
+
const defaultTemplatePartAreas =
|
|
40
|
+
select( coreStore ).getEntityRecord( 'root', '__unstableBase' )
|
|
41
|
+
?.default_template_part_areas || [];
|
|
42
|
+
|
|
43
|
+
const definedAreas = defaultTemplatePartAreas.map( ( item ) => ( {
|
|
44
|
+
...item,
|
|
45
|
+
icon: getTemplatePartIcon( item.icon ),
|
|
46
|
+
} ) );
|
|
47
|
+
|
|
48
48
|
const { getCurrentTheme, getEditedEntityRecord } =
|
|
49
49
|
select( coreStore );
|
|
50
50
|
|
package/src/page-list/block.json
CHANGED
|
@@ -51,6 +51,20 @@
|
|
|
51
51
|
},
|
|
52
52
|
"interactivity": {
|
|
53
53
|
"clientNavigation": true
|
|
54
|
+
},
|
|
55
|
+
"__experimentalBorder": {
|
|
56
|
+
"radius": true,
|
|
57
|
+
"color": true,
|
|
58
|
+
"width": true,
|
|
59
|
+
"style": true
|
|
60
|
+
},
|
|
61
|
+
"spacing": {
|
|
62
|
+
"padding": true,
|
|
63
|
+
"margin": true,
|
|
64
|
+
"__experimentalDefaultControls": {
|
|
65
|
+
"padding": false,
|
|
66
|
+
"margin": false
|
|
67
|
+
}
|
|
54
68
|
}
|
|
55
69
|
},
|
|
56
70
|
"editorStyle": "wp-block-page-list-editor",
|
package/src/page-list/style.scss
CHANGED
package/src/paragraph/edit.js
CHANGED
|
@@ -70,22 +70,24 @@ function DropCapControl( { clientId, attributes, setAttributes } ) {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
return (
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
onDeselect={ () => setAttributes( { dropCap: undefined } ) }
|
|
77
|
-
resetAllFilter={ () => ( { dropCap: undefined } ) }
|
|
78
|
-
panelId={ clientId }
|
|
79
|
-
>
|
|
80
|
-
<ToggleControl
|
|
81
|
-
__nextHasNoMarginBottom
|
|
73
|
+
<InspectorControls group="typography">
|
|
74
|
+
<ToolsPanelItem
|
|
75
|
+
hasValue={ () => !! dropCap }
|
|
82
76
|
label={ __( 'Drop cap' ) }
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
77
|
+
onDeselect={ () => setAttributes( { dropCap: undefined } ) }
|
|
78
|
+
resetAllFilter={ () => ( { dropCap: undefined } ) }
|
|
79
|
+
panelId={ clientId }
|
|
80
|
+
>
|
|
81
|
+
<ToggleControl
|
|
82
|
+
__nextHasNoMarginBottom
|
|
83
|
+
label={ __( 'Drop cap' ) }
|
|
84
|
+
checked={ !! dropCap }
|
|
85
|
+
onChange={ () => setAttributes( { dropCap: ! dropCap } ) }
|
|
86
|
+
help={ helpText }
|
|
87
|
+
disabled={ hasDropCapDisabled( align ) }
|
|
88
|
+
/>
|
|
89
|
+
</ToolsPanelItem>
|
|
90
|
+
</InspectorControls>
|
|
89
91
|
);
|
|
90
92
|
}
|
|
91
93
|
|
|
@@ -96,6 +98,7 @@ function ParagraphBlock( {
|
|
|
96
98
|
onRemove,
|
|
97
99
|
setAttributes,
|
|
98
100
|
clientId,
|
|
101
|
+
isSelected: isSingleSelected,
|
|
99
102
|
} ) {
|
|
100
103
|
const { align, content, direction, dropCap, placeholder } = attributes;
|
|
101
104
|
const blockProps = useBlockProps( {
|
|
@@ -131,13 +134,13 @@ function ParagraphBlock( {
|
|
|
131
134
|
/>
|
|
132
135
|
</BlockControls>
|
|
133
136
|
) }
|
|
134
|
-
|
|
137
|
+
{ isSingleSelected && (
|
|
135
138
|
<DropCapControl
|
|
136
139
|
clientId={ clientId }
|
|
137
140
|
attributes={ attributes }
|
|
138
141
|
setAttributes={ setAttributes }
|
|
139
142
|
/>
|
|
140
|
-
|
|
143
|
+
) }
|
|
141
144
|
<RichText
|
|
142
145
|
identifier="content"
|
|
143
146
|
tagName="p"
|
package/src/pattern/index.php
CHANGED
|
@@ -58,13 +58,6 @@ function render_block_core_pattern( $attributes ) {
|
|
|
58
58
|
$pattern = $registry->get_registered( $slug );
|
|
59
59
|
$content = $pattern['content'];
|
|
60
60
|
|
|
61
|
-
// Backward compatibility for handling Block Hooks and injecting the theme attribute in the Gutenberg plugin.
|
|
62
|
-
// This can be removed when the minimum supported WordPress is >= 6.4.
|
|
63
|
-
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN && ! function_exists( 'traverse_and_serialize_blocks' ) ) {
|
|
64
|
-
$blocks = parse_blocks( $content );
|
|
65
|
-
$content = gutenberg_serialize_blocks( $blocks );
|
|
66
|
-
}
|
|
67
|
-
|
|
68
61
|
$seen_refs[ $attributes['slug'] ] = true;
|
|
69
62
|
|
|
70
63
|
$content = do_blocks( $content );
|
|
@@ -18,15 +18,13 @@ export default function EnhancedPaginationControl( {
|
|
|
18
18
|
const fullPageClientSideNavigation =
|
|
19
19
|
window.__experimentalFullPageClientSideNavigation;
|
|
20
20
|
|
|
21
|
-
let help = __(
|
|
21
|
+
let help = __(
|
|
22
|
+
'Reload the full page—instead of just the posts list—when visitors navigate between pages.'
|
|
23
|
+
);
|
|
22
24
|
if ( fullPageClientSideNavigation ) {
|
|
23
25
|
help = __(
|
|
24
26
|
'Experimental full-page client-side navigation setting enabled.'
|
|
25
27
|
);
|
|
26
|
-
} else if ( enhancedPagination ) {
|
|
27
|
-
help = __(
|
|
28
|
-
'Reload the full page—instead of just the posts list—when visitors navigate between pages.'
|
|
29
|
-
);
|
|
30
28
|
} else if ( hasUnsupportedBlocks ) {
|
|
31
29
|
help = __(
|
|
32
30
|
'Enhancement disabled because there are non-compatible blocks inside the Query block.'
|
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
import { useSelect } from '@wordpress/data';
|
|
16
16
|
import { store as coreStore } from '@wordpress/core-data';
|
|
17
17
|
import { __ } from '@wordpress/i18n';
|
|
18
|
-
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
19
18
|
import { debounce } from '@wordpress/compose';
|
|
20
19
|
import { useEffect, useState, useCallback } from '@wordpress/element';
|
|
21
20
|
|
|
@@ -28,11 +27,9 @@ import ParentControl from './parent-control';
|
|
|
28
27
|
import { TaxonomyControls } from './taxonomy-controls';
|
|
29
28
|
import FormatControls from './format-controls';
|
|
30
29
|
import StickyControl from './sticky-control';
|
|
31
|
-
import CreateNewPostLink from './create-new-post-link';
|
|
32
30
|
import PerPageControl from './per-page-control';
|
|
33
31
|
import OffsetControl from './offset-controls';
|
|
34
32
|
import PagesControl from './pages-control';
|
|
35
|
-
import { unlock } from '../../../lock-unlock';
|
|
36
33
|
import {
|
|
37
34
|
usePostTypes,
|
|
38
35
|
useIsPostTypeHierarchical,
|
|
@@ -42,8 +39,6 @@ import {
|
|
|
42
39
|
} from '../../utils';
|
|
43
40
|
import { useToolsPanelDropdownMenuProps } from '../../../utils/hooks';
|
|
44
41
|
|
|
45
|
-
const { BlockInfo } = unlock( blockEditorPrivateApis );
|
|
46
|
-
|
|
47
42
|
export default function QueryInspectorControls( props ) {
|
|
48
43
|
const { attributes, setQuery, setDisplayLayout, isSingular } = props;
|
|
49
44
|
const { query, displayLayout } = attributes;
|
|
@@ -191,11 +186,6 @@ export default function QueryInspectorControls( props ) {
|
|
|
191
186
|
|
|
192
187
|
return (
|
|
193
188
|
<>
|
|
194
|
-
{ !! postType && (
|
|
195
|
-
<BlockInfo>
|
|
196
|
-
<CreateNewPostLink postType={ postType } />
|
|
197
|
-
</BlockInfo>
|
|
198
|
-
) }
|
|
199
189
|
{ showSettingsPanel && (
|
|
200
190
|
<PanelBody title={ __( 'Settings' ) }>
|
|
201
191
|
{ showInheritControl && (
|
package/src/query/editor.scss
CHANGED
package/src/query/index.php
CHANGED
|
@@ -79,7 +79,7 @@ add_action( 'init', 'register_block_core_query' );
|
|
|
79
79
|
* @since 6.4.0
|
|
80
80
|
*
|
|
81
81
|
* @param array $parsed_block The block being rendered.
|
|
82
|
-
* @return
|
|
82
|
+
* @return array Returns the parsed block, unmodified.
|
|
83
83
|
*/
|
|
84
84
|
function block_core_query_disable_enhanced_pagination( $parsed_block ) {
|
|
85
85
|
static $enhanced_query_stack = array();
|
package/src/query/utils.js
CHANGED
|
@@ -272,32 +272,31 @@ export const getTransformedBlocksFromPattern = (
|
|
|
272
272
|
* @return {string} The block name to be used in the patterns suggestions.
|
|
273
273
|
*/
|
|
274
274
|
export function useBlockNameForPatterns( clientId, attributes ) {
|
|
275
|
-
|
|
276
|
-
( select ) =>
|
|
277
|
-
select( blocksStore ).getActiveBlockVariation(
|
|
278
|
-
'core/query',
|
|
279
|
-
attributes
|
|
280
|
-
)?.name,
|
|
281
|
-
[ attributes ]
|
|
282
|
-
);
|
|
283
|
-
const blockName = `core/query/${ activeVariationName }`;
|
|
284
|
-
const hasActiveVariationPatterns = useSelect(
|
|
275
|
+
return useSelect(
|
|
285
276
|
( select ) => {
|
|
277
|
+
const activeVariationName = select(
|
|
278
|
+
blocksStore
|
|
279
|
+
).getActiveBlockVariation( 'core/query', attributes )?.name;
|
|
280
|
+
|
|
286
281
|
if ( ! activeVariationName ) {
|
|
287
|
-
return
|
|
282
|
+
return 'core/query';
|
|
288
283
|
}
|
|
284
|
+
|
|
289
285
|
const { getBlockRootClientId, getPatternsByBlockTypes } =
|
|
290
286
|
select( blockEditorStore );
|
|
287
|
+
|
|
291
288
|
const rootClientId = getBlockRootClientId( clientId );
|
|
292
289
|
const activePatterns = getPatternsByBlockTypes(
|
|
293
|
-
|
|
290
|
+
`core/query/${ activeVariationName }`,
|
|
294
291
|
rootClientId
|
|
295
292
|
);
|
|
296
|
-
|
|
293
|
+
|
|
294
|
+
return activePatterns.length > 0
|
|
295
|
+
? `core/query/${ activeVariationName }`
|
|
296
|
+
: 'core/query';
|
|
297
297
|
},
|
|
298
|
-
[ clientId,
|
|
298
|
+
[ clientId, attributes ]
|
|
299
299
|
);
|
|
300
|
-
return hasActiveVariationPatterns ? blockName : 'core/query';
|
|
301
300
|
}
|
|
302
301
|
|
|
303
302
|
/**
|
package/src/rss/index.php
CHANGED
|
@@ -61,17 +61,20 @@ function render_block_core_rss( $attributes ) {
|
|
|
61
61
|
$author = $item->get_author();
|
|
62
62
|
if ( is_object( $author ) ) {
|
|
63
63
|
$author = $author->get_name();
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
if ( ! empty( $author ) ) {
|
|
65
|
+
$author = '<span class="wp-block-rss__item-author">' . sprintf(
|
|
66
|
+
/* translators: byline. %s: author. */
|
|
67
|
+
__( 'by %s' ),
|
|
68
|
+
esc_html( strip_tags( $author ) )
|
|
69
|
+
) . '</span>';
|
|
70
|
+
}
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
|
|
72
|
-
$excerpt
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
$excerpt = '';
|
|
75
|
+
$description = $item->get_description();
|
|
76
|
+
if ( $attributes['displayExcerpt'] && ! empty( $description ) ) {
|
|
77
|
+
$excerpt = html_entity_decode( $description, ENT_QUOTES, get_option( 'blog_charset' ) );
|
|
75
78
|
$excerpt = esc_attr( wp_trim_words( $excerpt, $attributes['excerptLength'], ' […]' ) );
|
|
76
79
|
|
|
77
80
|
// Change existing [...] to […].
|
package/src/search/style.scss
CHANGED
|
@@ -58,11 +58,9 @@ $button-spacing-y: math.div($grid-unit-15, 2); // 6px
|
|
|
58
58
|
// Prevent unintended text wrapping.
|
|
59
59
|
flex-shrink: 0;
|
|
60
60
|
max-width: 100%;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
.wp-block-search__button[aria-expanded="true"] {
|
|
65
|
-
max-width: calc(100% - 100px);
|
|
61
|
+
box-sizing: border-box;
|
|
62
|
+
display: flex;
|
|
63
|
+
justify-content: center;
|
|
66
64
|
}
|
|
67
65
|
|
|
68
66
|
.wp-block-search__inside-wrapper {
|
|
@@ -9,13 +9,15 @@
|
|
|
9
9
|
"textdomain": "default",
|
|
10
10
|
"attributes": {
|
|
11
11
|
"url": {
|
|
12
|
-
"type": "string"
|
|
12
|
+
"type": "string",
|
|
13
|
+
"role": "content"
|
|
13
14
|
},
|
|
14
15
|
"service": {
|
|
15
16
|
"type": "string"
|
|
16
17
|
},
|
|
17
18
|
"label": {
|
|
18
|
-
"type": "string"
|
|
19
|
+
"type": "string",
|
|
20
|
+
"role": "content"
|
|
19
21
|
},
|
|
20
22
|
"rel": {
|
|
21
23
|
"type": "string"
|