@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.
Files changed (145) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/block-keyboard-shortcuts/index.js +7 -7
  3. package/build/block-keyboard-shortcuts/index.js.map +1 -1
  4. package/build/cover/edit/index.js +1 -1
  5. package/build/cover/edit/index.js.map +1 -1
  6. package/build/cover/index.js +10 -10
  7. package/build/cover/index.js.map +1 -1
  8. package/build/cover/shared.js +6 -7
  9. package/build/cover/shared.js.map +1 -1
  10. package/build/details/index.js +19 -0
  11. package/build/details/index.js.map +1 -1
  12. package/build/file/edit.js +7 -3
  13. package/build/file/edit.js.map +1 -1
  14. package/build/freeform/modal.js +1 -1
  15. package/build/freeform/modal.js.map +1 -1
  16. package/build/heading/index.js +1 -7
  17. package/build/heading/index.js.map +1 -1
  18. package/build/home-link/edit.js +20 -36
  19. package/build/home-link/edit.js.map +1 -1
  20. package/build/navigation/use-template-part-area-label.js +6 -8
  21. package/build/navigation/use-template-part-area-label.js.map +1 -1
  22. package/build/page-list/index.js +14 -0
  23. package/build/page-list/index.js.map +1 -1
  24. package/build/paragraph/edit.js +26 -25
  25. package/build/paragraph/edit.js.map +1 -1
  26. package/build/query/edit/inspector-controls/enhanced-pagination-control.js +1 -3
  27. package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  28. package/build/query/edit/inspector-controls/index.js +1 -11
  29. package/build/query/edit/inspector-controls/index.js.map +1 -1
  30. package/build/query/utils.js +6 -8
  31. package/build/query/utils.js.map +1 -1
  32. package/build/social-link/edit.js +57 -10
  33. package/build/social-link/edit.js.map +1 -1
  34. package/build/social-link/index.js +4 -2
  35. package/build/social-link/index.js.map +1 -1
  36. package/build/template-part/edit/advanced-controls.js +2 -7
  37. package/build/template-part/edit/advanced-controls.js.map +1 -1
  38. package/build/template-part/edit/utils/get-template-part-icon.js +23 -0
  39. package/build/template-part/edit/utils/get-template-part-icon.js.map +1 -0
  40. package/build/template-part/edit/utils/hooks.js +1 -6
  41. package/build/template-part/edit/utils/hooks.js.map +1 -1
  42. package/build/template-part/variations.js +6 -12
  43. package/build/template-part/variations.js.map +1 -1
  44. package/build/video/tracks-editor.js +135 -121
  45. package/build/video/tracks-editor.js.map +1 -1
  46. package/build-module/block-keyboard-shortcuts/index.js +7 -7
  47. package/build-module/block-keyboard-shortcuts/index.js.map +1 -1
  48. package/build-module/cover/edit/index.js +1 -1
  49. package/build-module/cover/edit/index.js.map +1 -1
  50. package/build-module/cover/index.js +10 -10
  51. package/build-module/cover/index.js.map +1 -1
  52. package/build-module/cover/shared.js +6 -7
  53. package/build-module/cover/shared.js.map +1 -1
  54. package/build-module/details/index.js +20 -1
  55. package/build-module/details/index.js.map +1 -1
  56. package/build-module/file/edit.js +7 -3
  57. package/build-module/file/edit.js.map +1 -1
  58. package/build-module/freeform/modal.js +1 -1
  59. package/build-module/freeform/modal.js.map +1 -1
  60. package/build-module/heading/index.js +1 -7
  61. package/build-module/heading/index.js.map +1 -1
  62. package/build-module/home-link/edit.js +23 -39
  63. package/build-module/home-link/edit.js.map +1 -1
  64. package/build-module/navigation/use-template-part-area-label.js +6 -8
  65. package/build-module/navigation/use-template-part-area-label.js.map +1 -1
  66. package/build-module/page-list/index.js +14 -0
  67. package/build-module/page-list/index.js.map +1 -1
  68. package/build-module/paragraph/edit.js +26 -25
  69. package/build-module/paragraph/edit.js.map +1 -1
  70. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +1 -3
  71. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  72. package/build-module/query/edit/inspector-controls/index.js +1 -11
  73. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  74. package/build-module/query/utils.js +6 -8
  75. package/build-module/query/utils.js.map +1 -1
  76. package/build-module/social-link/edit.js +61 -14
  77. package/build-module/social-link/edit.js.map +1 -1
  78. package/build-module/social-link/index.js +4 -2
  79. package/build-module/social-link/index.js.map +1 -1
  80. package/build-module/template-part/edit/advanced-controls.js +3 -8
  81. package/build-module/template-part/edit/advanced-controls.js.map +1 -1
  82. package/build-module/template-part/edit/utils/get-template-part-icon.js +15 -0
  83. package/build-module/template-part/edit/utils/get-template-part-icon.js.map +1 -0
  84. package/build-module/template-part/edit/utils/hooks.js +1 -6
  85. package/build-module/template-part/edit/utils/hooks.js.map +1 -1
  86. package/build-module/template-part/variations.js +5 -11
  87. package/build-module/template-part/variations.js.map +1 -1
  88. package/build-module/video/tracks-editor.js +136 -122
  89. package/build-module/video/tracks-editor.js.map +1 -1
  90. package/build-style/editor-rtl.css +16 -8
  91. package/build-style/editor.css +16 -8
  92. package/build-style/navigation/style-rtl.css +1 -1
  93. package/build-style/navigation/style.css +1 -1
  94. package/build-style/page-list/style-rtl.css +4 -0
  95. package/build-style/page-list/style.css +4 -0
  96. package/build-style/query/editor-rtl.css +0 -4
  97. package/build-style/query/editor.css +0 -4
  98. package/build-style/search/style-rtl.css +3 -3
  99. package/build-style/search/style.css +3 -3
  100. package/build-style/social-link/editor-rtl.css +8 -4
  101. package/build-style/social-link/editor.css +8 -4
  102. package/build-style/style-rtl.css +8 -4
  103. package/build-style/style.css +8 -4
  104. package/build-style/video/editor-rtl.css +8 -0
  105. package/build-style/video/editor.css +8 -0
  106. package/package.json +2 -2
  107. package/src/block-keyboard-shortcuts/index.js +25 -11
  108. package/src/cover/edit/index.js +1 -1
  109. package/src/cover/index.js +8 -8
  110. package/src/cover/shared.js +10 -10
  111. package/src/cover/test/edit.js +2 -2
  112. package/src/details/index.js +23 -1
  113. package/src/file/edit.js +8 -2
  114. package/src/freeform/modal.js +1 -1
  115. package/src/heading/block.json +1 -7
  116. package/src/home-link/edit.js +27 -45
  117. package/src/home-link/index.php +0 -3
  118. package/src/navigation/index.php +4 -150
  119. package/src/navigation/style.scss +1 -1
  120. package/src/navigation/use-template-part-area-label.js +10 -10
  121. package/src/page-list/block.json +14 -0
  122. package/src/page-list/style.scss +4 -0
  123. package/src/paragraph/edit.js +20 -17
  124. package/src/pattern/index.php +0 -7
  125. package/src/query/edit/inspector-controls/enhanced-pagination-control.js +3 -5
  126. package/src/query/edit/inspector-controls/index.js +0 -10
  127. package/src/query/editor.scss +0 -4
  128. package/src/query/index.php +1 -1
  129. package/src/query/utils.js +14 -15
  130. package/src/rss/index.php +11 -8
  131. package/src/search/style.scss +3 -5
  132. package/src/social-link/block.json +4 -2
  133. package/src/social-link/edit.js +87 -19
  134. package/src/social-link/editor.scss +11 -7
  135. package/src/template-part/edit/advanced-controls.js +13 -13
  136. package/src/template-part/edit/utils/get-template-part-icon.js +20 -0
  137. package/src/template-part/edit/utils/hooks.js +2 -7
  138. package/src/template-part/variations.js +4 -16
  139. package/src/video/editor.scss +9 -0
  140. package/src/video/tracks-editor.js +157 -139
  141. package/build/query/edit/inspector-controls/create-new-post-link.js +0 -40
  142. package/build/query/edit/inspector-controls/create-new-post-link.js.map +0 -1
  143. package/build-module/query/edit/inspector-controls/create-new-post-link.js +0 -33
  144. package/build-module/query/edit/inspector-controls/create-new-post-link.js.map +0 -1
  145. package/src/query/edit/inspector-controls/create-new-post-link.js +0 -32
@@ -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 = '';
@@ -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), 20em);
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
- // FIXME: @wordpress/block-library should not depend on @wordpress/editor.
39
- // Blocks can be loaded into a *non-post* block editor.
40
- // This code is lifted from this file:
41
- // packages/block-library/src/template-part/edit/advanced-controls.js
42
- /* eslint-disable @wordpress/data-no-store-string-literals */
43
- const definedAreas =
44
- select(
45
- 'core/editor'
46
- ).__experimentalGetDefaultTemplatePartAreas();
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
 
@@ -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",
@@ -15,3 +15,7 @@
15
15
  background-color: inherit;
16
16
  }
17
17
  }
18
+ .wp-block-page-list {
19
+ // This block has customizable padding, border-box makes that more predictable.
20
+ box-sizing: border-box;
21
+ }
@@ -70,22 +70,24 @@ function DropCapControl( { clientId, attributes, setAttributes } ) {
70
70
  }
71
71
 
72
72
  return (
73
- <ToolsPanelItem
74
- hasValue={ () => !! dropCap }
75
- label={ __( 'Drop cap' ) }
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
- checked={ !! dropCap }
84
- onChange={ () => setAttributes( { dropCap: ! dropCap } ) }
85
- help={ helpText }
86
- disabled={ hasDropCapDisabled( align ) }
87
- />
88
- </ToolsPanelItem>
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
- <InspectorControls group="typography">
137
+ { isSingleSelected && (
135
138
  <DropCapControl
136
139
  clientId={ clientId }
137
140
  attributes={ attributes }
138
141
  setAttributes={ setAttributes }
139
142
  />
140
- </InspectorControls>
143
+ ) }
141
144
  <RichText
142
145
  identifier="content"
143
146
  tagName="p"
@@ -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 = __( 'Browsing between pages requires a full page reload.' );
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 && (
@@ -6,10 +6,6 @@
6
6
  }
7
7
  }
8
8
 
9
- .wp-block-query__create-new-link {
10
- padding: 0 $grid-unit-20 $grid-unit-20 52px;
11
- }
12
-
13
9
  .block-library-query__pattern-selection-content .block-editor-block-patterns-list {
14
10
  display: grid;
15
11
  grid-template-columns: 1fr 1fr 1fr;
@@ -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 string Returns the parsed block, unmodified.
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();
@@ -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
- const activeVariationName = useSelect(
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 false;
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
- blockName,
290
+ `core/query/${ activeVariationName }`,
294
291
  rootClientId
295
292
  );
296
- return activePatterns.length > 0;
293
+
294
+ return activePatterns.length > 0
295
+ ? `core/query/${ activeVariationName }`
296
+ : 'core/query';
297
297
  },
298
- [ clientId, activeVariationName, blockName ]
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
- $author = '<span class="wp-block-rss__item-author">' . sprintf(
65
- /* translators: byline. %s: author. */
66
- __( 'by %s' ),
67
- esc_html( strip_tags( $author ) )
68
- ) . '</span>';
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
- if ( $attributes['displayExcerpt'] ) {
74
- $excerpt = html_entity_decode( $item->get_description(), ENT_QUOTES, get_option( 'blog_charset' ) );
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'], ' [&hellip;]' ) );
76
79
 
77
80
  // Change existing [...] to [&hellip;].
@@ -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
- // Ensure minimum input field width in small viewports.
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"