@wordpress/block-library 6.0.10 → 6.0.14

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/build/cover/edit.js +1 -0
  2. package/build/cover/edit.js.map +1 -1
  3. package/build/gallery/deprecated.js +314 -26
  4. package/build/gallery/deprecated.js.map +1 -1
  5. package/build/gallery/edit-wrapper.js +10 -27
  6. package/build/gallery/edit-wrapper.js.map +1 -1
  7. package/build/gallery/edit.js +10 -12
  8. package/build/gallery/edit.js.map +1 -1
  9. package/build/gallery/save.js +3 -3
  10. package/build/gallery/save.js.map +1 -1
  11. package/build/gallery/shared.js +24 -0
  12. package/build/gallery/shared.js.map +1 -1
  13. package/build/gallery/transforms.js +8 -22
  14. package/build/gallery/transforms.js.map +1 -1
  15. package/build/gallery/use-mobile-warning.js +1 -1
  16. package/build/gallery/use-mobile-warning.js.map +1 -1
  17. package/build/gallery/v1/edit.js +2 -21
  18. package/build/gallery/v1/edit.js.map +1 -1
  19. package/build/image/image.js +30 -6
  20. package/build/image/image.js.map +1 -1
  21. package/build/navigation/deprecated.js +9 -7
  22. package/build/navigation/deprecated.js.map +1 -1
  23. package/build/navigation/edit/index.js +12 -1
  24. package/build/navigation/edit/index.js.map +1 -1
  25. package/build/navigation/edit/inner-blocks.js +0 -4
  26. package/build/navigation/edit/inner-blocks.js.map +1 -1
  27. package/build/navigation/edit/navigation-menu-selector.js +7 -1
  28. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  29. package/build/navigation/menu-items-to-blocks.js +4 -1
  30. package/build/navigation/menu-items-to-blocks.js.map +1 -1
  31. package/build/navigation/view.js +2 -2
  32. package/build/navigation/view.js.map +1 -1
  33. package/build/navigation-submenu/edit.js +5 -1
  34. package/build/navigation-submenu/edit.js.map +1 -1
  35. package/build/post-comments/index.js +1 -1
  36. package/build/query-pagination/index.js +1 -1
  37. package/build/query-pagination-next/index.js +2 -2
  38. package/build/query-pagination-numbers/index.js +1 -1
  39. package/build/query-pagination-previous/index.js +2 -2
  40. package/build/separator/separator-settings.js +1 -0
  41. package/build/separator/separator-settings.js.map +1 -1
  42. package/build/social-links/edit.js +1 -0
  43. package/build/social-links/edit.js.map +1 -1
  44. package/build-module/cover/edit.js +1 -0
  45. package/build-module/cover/edit.js.map +1 -1
  46. package/build-module/gallery/deprecated.js +309 -27
  47. package/build-module/gallery/deprecated.js.map +1 -1
  48. package/build-module/gallery/edit-wrapper.js +7 -27
  49. package/build-module/gallery/edit-wrapper.js.map +1 -1
  50. package/build-module/gallery/edit.js +10 -12
  51. package/build-module/gallery/edit.js.map +1 -1
  52. package/build-module/gallery/save.js +2 -3
  53. package/build-module/gallery/save.js.map +1 -1
  54. package/build-module/gallery/shared.js +22 -0
  55. package/build-module/gallery/shared.js.map +1 -1
  56. package/build-module/gallery/transforms.js +9 -21
  57. package/build-module/gallery/transforms.js.map +1 -1
  58. package/build-module/gallery/use-mobile-warning.js +1 -1
  59. package/build-module/gallery/use-mobile-warning.js.map +1 -1
  60. package/build-module/gallery/v1/edit.js +4 -22
  61. package/build-module/gallery/v1/edit.js.map +1 -1
  62. package/build-module/image/image.js +31 -7
  63. package/build-module/image/image.js.map +1 -1
  64. package/build-module/navigation/deprecated.js +9 -7
  65. package/build-module/navigation/deprecated.js.map +1 -1
  66. package/build-module/navigation/edit/index.js +11 -1
  67. package/build-module/navigation/edit/index.js.map +1 -1
  68. package/build-module/navigation/edit/inner-blocks.js +0 -4
  69. package/build-module/navigation/edit/inner-blocks.js.map +1 -1
  70. package/build-module/navigation/edit/navigation-menu-selector.js +6 -1
  71. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  72. package/build-module/navigation/menu-items-to-blocks.js +3 -1
  73. package/build-module/navigation/menu-items-to-blocks.js.map +1 -1
  74. package/build-module/navigation/view.js +2 -2
  75. package/build-module/navigation/view.js.map +1 -1
  76. package/build-module/navigation-submenu/edit.js +5 -1
  77. package/build-module/navigation-submenu/edit.js.map +1 -1
  78. package/build-module/post-comments/index.js +1 -1
  79. package/build-module/query-pagination/index.js +1 -1
  80. package/build-module/query-pagination-next/index.js +2 -2
  81. package/build-module/query-pagination-numbers/index.js +1 -1
  82. package/build-module/query-pagination-previous/index.js +2 -2
  83. package/build-module/separator/separator-settings.js +1 -0
  84. package/build-module/separator/separator-settings.js.map +1 -1
  85. package/build-module/social-links/edit.js +1 -0
  86. package/build-module/social-links/edit.js.map +1 -1
  87. package/build-style/columns/editor-rtl.css +1 -1
  88. package/build-style/columns/editor.css +1 -1
  89. package/build-style/editor-rtl.css +26 -1
  90. package/build-style/editor.css +26 -1
  91. package/build-style/image/editor-rtl.css +16 -0
  92. package/build-style/image/editor.css +16 -0
  93. package/build-style/navigation/editor-rtl.css +9 -0
  94. package/build-style/navigation/editor.css +9 -0
  95. package/build-style/navigation/style-rtl.css +5 -1
  96. package/build-style/navigation/style.css +5 -1
  97. package/build-style/post-comments/style-rtl.css +3 -1
  98. package/build-style/post-comments/style.css +3 -1
  99. package/build-style/post-comments-form/style-rtl.css +2 -2
  100. package/build-style/post-comments-form/style.css +2 -2
  101. package/build-style/style-rtl.css +10 -4
  102. package/build-style/style.css +10 -4
  103. package/package.json +8 -8
  104. package/src/columns/editor.scss +3 -2
  105. package/src/cover/edit.js +1 -0
  106. package/src/gallery/deprecated.js +831 -559
  107. package/src/gallery/edit-wrapper.js +7 -27
  108. package/src/gallery/edit.js +10 -12
  109. package/src/gallery/index.php +7 -8
  110. package/src/gallery/save.js +2 -1
  111. package/src/gallery/shared.js +24 -0
  112. package/src/gallery/transforms.js +9 -27
  113. package/src/gallery/use-mobile-warning.js +1 -1
  114. package/src/gallery/v1/edit.js +1 -28
  115. package/src/image/editor.scss +18 -0
  116. package/src/image/image.js +32 -8
  117. package/src/image/index.php +1 -1
  118. package/src/navigation/deprecated.js +10 -9
  119. package/src/navigation/edit/index.js +15 -6
  120. package/src/navigation/edit/inner-blocks.js +0 -5
  121. package/src/navigation/edit/navigation-menu-selector.js +8 -0
  122. package/src/navigation/editor.scss +12 -0
  123. package/src/navigation/index.php +149 -26
  124. package/src/navigation/menu-items-to-blocks.js +7 -1
  125. package/src/navigation/style.scss +5 -1
  126. package/src/navigation/view.js +2 -2
  127. package/src/navigation-submenu/edit.js +7 -1
  128. package/src/navigation-submenu/index.php +30 -45
  129. package/src/page-list/index.php +5 -9
  130. package/src/post-comments/block.json +5 -1
  131. package/src/post-comments/index.php +15 -0
  132. package/src/post-comments/style.scss +7 -3
  133. package/src/post-comments-form/style.scss +7 -5
  134. package/src/query-pagination/block.json +1 -1
  135. package/src/query-pagination-next/block.json +2 -2
  136. package/src/query-pagination-numbers/block.json +1 -1
  137. package/src/query-pagination-previous/block.json +2 -2
  138. package/src/separator/separator-settings.js +1 -0
  139. package/src/social-links/edit.js +1 -0
  140. package/src/template-part/index.php +36 -0
  141. package/build/gallery/v1/update-gallery-modal.js +0 -114
  142. package/build/gallery/v1/update-gallery-modal.js.map +0 -1
  143. package/build-module/gallery/v1/update-gallery-modal.js +0 -97
  144. package/build-module/gallery/v1/update-gallery-modal.js.map +0 -1
  145. package/src/gallery/v1/update-gallery-modal.js +0 -97
@@ -5,6 +5,120 @@
5
5
  * @package WordPress
6
6
  */
7
7
 
8
+ // These functions are used for the __unstableLocation feature and only active
9
+ // when the gutenberg plugin is active.
10
+ if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
11
+ /**
12
+ * Returns the menu items for a WordPress menu location.
13
+ *
14
+ * @param string $location The menu location.
15
+ * @return array Menu items for the location.
16
+ */
17
+ function block_core_navigation_get_menu_items_at_location( $location ) {
18
+ if ( empty( $location ) ) {
19
+ return;
20
+ }
21
+
22
+ // Build menu data. The following approximates the code in
23
+ // `wp_nav_menu()` and `gutenberg_output_block_nav_menu`.
24
+
25
+ // Find the location in the list of locations, returning early if the
26
+ // location can't be found.
27
+ $locations = get_nav_menu_locations();
28
+ if ( ! isset( $locations[ $location ] ) ) {
29
+ return;
30
+ }
31
+
32
+ // Get the menu from the location, returning early if there is no
33
+ // menu or there was an error.
34
+ $menu = wp_get_nav_menu_object( $locations[ $location ] );
35
+ if ( ! $menu || is_wp_error( $menu ) ) {
36
+ return;
37
+ }
38
+
39
+ $menu_items = wp_get_nav_menu_items( $menu->term_id, array( 'update_post_term_cache' => false ) );
40
+ _wp_menu_item_classes_by_context( $menu_items );
41
+
42
+ return $menu_items;
43
+ }
44
+
45
+
46
+ /**
47
+ * Sorts a standard array of menu items into a nested structure keyed by the
48
+ * id of the parent menu.
49
+ *
50
+ * @param array $menu_items Menu items to sort.
51
+ * @return array An array keyed by the id of the parent menu where each element
52
+ * is an array of menu items that belong to that parent.
53
+ */
54
+ function block_core_navigation_sort_menu_items_by_parent_id( $menu_items ) {
55
+ $sorted_menu_items = array();
56
+ foreach ( (array) $menu_items as $menu_item ) {
57
+ $sorted_menu_items[ $menu_item->menu_order ] = $menu_item;
58
+ }
59
+ unset( $menu_items, $menu_item );
60
+
61
+ $menu_items_by_parent_id = array();
62
+ foreach ( $sorted_menu_items as $menu_item ) {
63
+ $menu_items_by_parent_id[ $menu_item->menu_item_parent ][] = $menu_item;
64
+ }
65
+
66
+ return $menu_items_by_parent_id;
67
+ }
68
+
69
+ /**
70
+ * Turns menu item data into a nested array of parsed blocks
71
+ *
72
+ * @param array $menu_items An array of menu items that represent
73
+ * an individual level of a menu.
74
+ * @param array $menu_items_by_parent_id An array keyed by the id of the
75
+ * parent menu where each element is an
76
+ * array of menu items that belong to
77
+ * that parent.
78
+ * @return array An array of parsed block data.
79
+ */
80
+ function block_core_navigation_parse_blocks_from_menu_items( $menu_items, $menu_items_by_parent_id ) {
81
+ if ( empty( $menu_items ) ) {
82
+ return array();
83
+ }
84
+
85
+ $blocks = array();
86
+
87
+ foreach ( $menu_items as $menu_item ) {
88
+ $class_name = ! empty( $menu_item->classes ) ? implode( ' ', (array) $menu_item->classes ) : null;
89
+ $id = ( null !== $menu_item->object_id && 'custom' !== $menu_item->object ) ? $menu_item->object_id : null;
90
+ $opens_in_new_tab = null !== $menu_item->target && '_blank' === $menu_item->target;
91
+ $rel = ( null !== $menu_item->xfn && '' !== $menu_item->xfn ) ? $menu_item->xfn : null;
92
+ $kind = null !== $menu_item->type ? str_replace( '_', '-', $menu_item->type ) : 'custom';
93
+
94
+ $block = array(
95
+ 'blockName' => isset( $menu_items_by_parent_id[ $menu_item->ID ] ) ? 'core/navigation-submenu' : 'core/navigation-link',
96
+ 'attrs' => array(
97
+ 'className' => $class_name,
98
+ 'description' => $menu_item->description,
99
+ 'id' => $id,
100
+ 'kind' => $kind,
101
+ 'label' => $menu_item->title,
102
+ 'opensInNewTab' => $opens_in_new_tab,
103
+ 'rel' => $rel,
104
+ 'title' => $menu_item->attr_title,
105
+ 'type' => $menu_item->object,
106
+ 'url' => $menu_item->url,
107
+ ),
108
+ );
109
+
110
+ $block['innerBlocks'] = isset( $menu_items_by_parent_id[ $menu_item->ID ] )
111
+ ? block_core_navigation_parse_blocks_from_menu_items( $menu_items_by_parent_id[ $menu_item->ID ], $menu_items_by_parent_id )
112
+ : array();
113
+ $block['innerContent'] = array_map( 'serialize_block', $block['innerBlocks'] );
114
+
115
+ $blocks[] = $block;
116
+ }
117
+
118
+ return $blocks;
119
+ }
120
+ }
121
+
8
122
  /**
9
123
  * Build an array with CSS classes and inline styles defining the colors
10
124
  * which will be applied to the navigation markup in the front-end.
@@ -145,17 +259,23 @@ function block_core_navigation_get_first_non_empty_navigation() {
145
259
  // see:
146
260
  // - https://github.com/WordPress/wordpress-develop/blob/ba943e113d3b31b121f77a2d30aebe14b047c69d/src/wp-includes/nav-menu.php#L613-L619.
147
261
  // - https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters.
148
- $navigation_posts = get_posts(
149
- array(
150
- 'post_type' => 'wp_navigation',
151
- 'order' => 'ASC',
152
- 'orderby' => 'name',
153
- 'posts_per_page' => 1, // only the first post.
154
- 's' => '<!-- wp:', // look for block indicators to ensure we only include non-empty Navigations.
155
- )
262
+ $parsed_args = array(
263
+ 'post_type' => 'wp_navigation',
264
+ 'no_found_rows' => true,
265
+ 'order' => 'ASC',
266
+ 'orderby' => 'name',
267
+ 'post_status' => 'publish',
268
+ 'posts_per_page' => 20, // Try the first 20 posts.
156
269
  );
157
- return count( $navigation_posts ) ? $navigation_posts[0] : null;
158
270
 
271
+ $navigation_posts = new WP_Query( $parsed_args );
272
+ foreach ( $navigation_posts->posts as $navigation_post ) {
273
+ if ( has_blocks( $navigation_post ) ) {
274
+ return $navigation_post;
275
+ }
276
+ }
277
+
278
+ return null;
159
279
  }
160
280
 
161
281
  /**
@@ -272,30 +392,33 @@ function render_block_core_navigation( $attributes, $content, $block ) {
272
392
 
273
393
  $inner_blocks = $block->inner_blocks;
274
394
 
275
- // If `__unstableLocation` is defined, create inner blocks from the classic menu assigned to that location.
276
- if ( empty( $inner_blocks ) && array_key_exists( '__unstableLocation', $attributes ) ) {
277
- $menu_items = gutenberg_get_menu_items_at_location( $attributes['__unstableLocation'] );
395
+ // Ensure that blocks saved with the legacy ref attribute name (navigationMenuId) continue to render.
396
+ if ( array_key_exists( 'navigationMenuId', $attributes ) ) {
397
+ $attributes['ref'] = $attributes['navigationMenuId'];
398
+ }
399
+
400
+ // If:
401
+ // - the gutenberg plugin is active
402
+ // - `__unstableLocation` is defined
403
+ // - we have menu items at the defined location
404
+ // - we don't have a relationship to a `wp_navigation` Post (via `ref`).
405
+ // ...then create inner blocks from the classic menu assigned to that location.
406
+ if (
407
+ defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN &&
408
+ array_key_exists( '__unstableLocation', $attributes ) &&
409
+ ! array_key_exists( 'ref', $attributes ) &&
410
+ ! empty( block_core_navigation_get_menu_items_at_location( $attributes['__unstableLocation'] ) )
411
+ ) {
412
+ $menu_items = block_core_navigation_get_menu_items_at_location( $attributes['__unstableLocation'] );
278
413
  if ( empty( $menu_items ) ) {
279
414
  return '';
280
415
  }
281
416
 
282
- $menu_items_by_parent_id = gutenberg_sort_menu_items_by_parent_id( $menu_items );
283
- $parsed_blocks = gutenberg_parse_blocks_from_menu_items( $menu_items_by_parent_id[0], $menu_items_by_parent_id );
417
+ $menu_items_by_parent_id = block_core_navigation_sort_menu_items_by_parent_id( $menu_items );
418
+ $parsed_blocks = block_core_navigation_parse_blocks_from_menu_items( $menu_items_by_parent_id[0], $menu_items_by_parent_id );
284
419
  $inner_blocks = new WP_Block_List( $parsed_blocks, $attributes );
285
420
  }
286
421
 
287
- if ( ! empty( $block->context['navigationArea'] ) ) {
288
- $area = $block->context['navigationArea'];
289
- $mapping = get_option( 'wp_navigation_areas', array() );
290
- if ( ! empty( $mapping[ $area ] ) ) {
291
- $attributes['ref'] = $mapping[ $area ];
292
- }
293
- }
294
-
295
- // Ensure that blocks saved with the legacy ref attribute name (navigationMenuId) continue to render.
296
- if ( array_key_exists( 'navigationMenuId', $attributes ) ) {
297
- $attributes['ref'] = $attributes['navigationMenuId'];
298
- }
299
422
  // Load inner blocks from the navigation post.
300
423
  if ( array_key_exists( 'ref', $attributes ) ) {
301
424
  $navigation_post = get_post( $attributes['ref'] );
@@ -7,6 +7,7 @@ import { sortBy } from 'lodash';
7
7
  * WordPress dependencies
8
8
  */
9
9
  import { createBlock, parse } from '@wordpress/blocks';
10
+ import { applyFilters } from '@wordpress/hooks';
10
11
 
11
12
  /**
12
13
  * Convert a flat menu item structure to a nested blocks structure.
@@ -21,7 +22,12 @@ export default function menuItemsToBlocks( menuItems ) {
21
22
  }
22
23
 
23
24
  const menuTree = createDataTree( menuItems );
24
- return mapMenuItemsToBlocks( menuTree );
25
+ const blocks = mapMenuItemsToBlocks( menuTree );
26
+ return applyFilters(
27
+ 'blocks.navigation.__unstableMenuItemsToBlocks',
28
+ blocks,
29
+ menuItems
30
+ );
25
31
  }
26
32
 
27
33
  /**
@@ -82,6 +82,7 @@
82
82
  line-height: 0;
83
83
  display: inline-block;
84
84
  vertical-align: middle;
85
+ font-size: inherit;
85
86
 
86
87
  // Affect the button as well.
87
88
  padding: 0;
@@ -425,7 +426,10 @@ button.wp-block-navigation-item__content {
425
426
  align-items: var(--layout-justification-setting, inherit);
426
427
 
427
428
  // Always align the contents of the menu to the top.
428
- justify-content: flex-start;
429
+ &,
430
+ .wp-block-navigation__container {
431
+ justify-content: flex-start;
432
+ }
429
433
 
430
434
  // Allow menu to scroll.
431
435
  overflow: auto;
@@ -58,7 +58,7 @@ function toggleSubmenuOnClick( event ) {
58
58
 
59
59
  // Necessary for some themes such as TT1 Blocks, where
60
60
  // scripts could be loaded before the body.
61
- window.onload = () => {
61
+ window.addEventListener( 'load', () => {
62
62
  MicroModal.init( {
63
63
  onShow: navigationToggleModal,
64
64
  onClose: navigationToggleModal,
@@ -95,4 +95,4 @@ window.onload = () => {
95
95
  }
96
96
  } );
97
97
  } );
98
- };
98
+ } );
@@ -508,13 +508,19 @@ export default function NavigationSubmenuEdit( {
508
508
  allowedBlocks: ALLOWED_BLOCKS,
509
509
  __experimentalDefaultBlock: DEFAULT_BLOCK,
510
510
  __experimentalDirectInsert: true,
511
+
512
+ // Ensure block toolbar is not too far removed from item
513
+ // being edited.
514
+ // see: https://github.com/WordPress/gutenberg/pull/34615.
515
+ __experimentalCaptureToolbars: true,
516
+
511
517
  renderAppender:
512
518
  isSelected ||
513
519
  ( isImmediateParentOfSelectedBlock &&
514
520
  ! selectedBlockHasDescendants ) ||
515
521
  // Show the appender while dragging to allow inserting element between item and the appender.
516
522
  hasDescendants
517
- ? InnerBlocks.DefaultAppender
523
+ ? InnerBlocks.ButtonBlockAppender
518
524
  : false,
519
525
  }
520
526
  );
@@ -163,7 +163,32 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
163
163
  'style' => $style_attribute,
164
164
  )
165
165
  );
166
- $html = '<li ' . $wrapper_attributes . '>';
166
+
167
+ $label = '';
168
+
169
+ if ( isset( $attributes['label'] ) ) {
170
+ $label .= wp_kses(
171
+ $attributes['label'],
172
+ array(
173
+ 'code' => array(),
174
+ 'em' => array(),
175
+ 'img' => array(
176
+ 'scale' => array(),
177
+ 'class' => array(),
178
+ 'style' => array(),
179
+ 'src' => array(),
180
+ 'alt' => array(),
181
+ ),
182
+ 's' => array(),
183
+ 'span' => array(
184
+ 'style' => array(),
185
+ ),
186
+ 'strong' => array(),
187
+ )
188
+ );
189
+ }
190
+
191
+ $html = '<li ' . $wrapper_attributes . '>';
167
192
 
168
193
  // If Submenus open on hover, we render an anchor tag with attributes.
169
194
  // If submenu icons are set to show, we also render a submenu button, so the submenu can be opened on click.
@@ -193,27 +218,7 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
193
218
  $html .= '>';
194
219
  // End appending HTML attributes to anchor tag.
195
220
 
196
- if ( isset( $attributes['label'] ) ) {
197
- $html .= wp_kses(
198
- $attributes['label'],
199
- array(
200
- 'code' => array(),
201
- 'em' => array(),
202
- 'img' => array(
203
- 'scale' => array(),
204
- 'class' => array(),
205
- 'style' => array(),
206
- 'src' => array(),
207
- 'alt' => array(),
208
- ),
209
- 's' => array(),
210
- 'span' => array(
211
- 'style' => array(),
212
- ),
213
- 'strong' => array(),
214
- )
215
- );
216
- }
221
+ $html .= $label;
217
222
 
218
223
  $html .= '</a>';
219
224
  // End anchor tag content.
@@ -221,36 +226,16 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
221
226
  if ( $show_submenu_indicators ) {
222
227
  // The submenu icon is rendered in a button here
223
228
  // so that there's a clickable elment to open the submenu.
224
- $html .= '<button class="wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle" aria-expanded="false">' . block_core_navigation_submenu_render_submenu_icon() . '</button>';
229
+ $html .= '<button aria-label="' . $label . ' ' . __( 'submenu', 'gutenberg' ) . '" class="wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle" aria-expanded="false">' . block_core_navigation_submenu_render_submenu_icon() . '</button>';
225
230
  }
226
231
  } else {
227
232
  // If menus open on click, we render the parent as a button.
228
- $html .= '<button class="wp-block-navigation-item__content wp-block-navigation-submenu__toggle" aria-expanded="false">';
233
+ $html .= '<button aria-label="' . $label . ' ' . __( 'submenu', 'gutenberg' ) . '" class="wp-block-navigation-item__content wp-block-navigation-submenu__toggle" aria-expanded="false">';
229
234
 
230
235
  // Wrap title with span to isolate it from submenu icon.
231
236
  $html .= '<span class="wp-block-navigation-item__label">';
232
237
 
233
- if ( isset( $attributes['label'] ) ) {
234
- $html .= wp_kses(
235
- $attributes['label'],
236
- array(
237
- 'code' => array(),
238
- 'em' => array(),
239
- 'img' => array(
240
- 'scale' => array(),
241
- 'class' => array(),
242
- 'style' => array(),
243
- 'src' => array(),
244
- 'alt' => array(),
245
- ),
246
- 's' => array(),
247
- 'span' => array(
248
- 'style' => array(),
249
- ),
250
- 'strong' => array(),
251
- )
252
- );
253
- }
238
+ $html .= $label;
254
239
 
255
240
  $html .= '</span>';
256
241
 
@@ -173,24 +173,20 @@ function block_core_page_list_render_nested_page_list( $open_submenus_on_click,
173
173
  }
174
174
  }
175
175
 
176
+ $title = wp_kses( $page['title'], wp_kses_allowed_html( 'post' ) );
177
+
176
178
  $markup .= '<li class="wp-block-pages-list__item' . $css_class . '"' . $style_attribute . '>';
177
179
 
178
180
  if ( isset( $page['children'] ) && $is_navigation_child && $open_submenus_on_click ) {
179
- $markup .= '<button class="' . $navigation_child_content_class . ' wp-block-navigation-submenu__toggle" aria-expanded="false">' . wp_kses(
180
- $page['title'],
181
- wp_kses_allowed_html( 'post' )
182
- ) . '<span class="wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" role="img" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke-width="1.5"></path></svg></span>' .
181
+ $markup .= '<button aria-label="' . $title . ' ' . __( 'submenu', 'gutenberg' ) . '" class="' . $navigation_child_content_class . ' wp-block-navigation-submenu__toggle" aria-expanded="false">' . $title . '<span class="wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" role="img" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke-width="1.5"></path></svg></span>' .
183
182
  '</button>';
184
183
  } else {
185
- $markup .= '<a class="wp-block-pages-list__item__link' . $navigation_child_content_class . '" href="' . esc_url( $page['link'] ) . '"' . $aria_current . '>' . wp_kses(
186
- $page['title'],
187
- wp_kses_allowed_html( 'post' )
188
- ) . '</a>';
184
+ $markup .= '<a class="wp-block-pages-list__item__link' . $navigation_child_content_class . '" href="' . esc_url( $page['link'] ) . '"' . $aria_current . '>' . $title . '</a>';
189
185
  }
190
186
 
191
187
  if ( isset( $page['children'] ) ) {
192
188
  if ( $is_navigation_child && $show_submenu_icons && ! $open_submenus_on_click ) {
193
- $markup .= '<button class="wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle" aria-expanded="false">';
189
+ $markup .= '<button aria-label="' . $title . ' ' . __( 'submenu', 'gutenberg' ) . '" class="wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle" aria-expanded="false">';
194
190
  $markup .= '<span class="wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" role="img" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke-width="1.5"></path></svg></span>';
195
191
  $markup .= '</button>';
196
192
  }
@@ -30,5 +30,9 @@
30
30
  "link": true
31
31
  }
32
32
  },
33
- "style": "wp-block-post-comments"
33
+ "style": [
34
+ "wp-block-post-comments",
35
+ "wp-block-buttons",
36
+ "wp-block-button"
37
+ ]
34
38
  }
@@ -66,3 +66,18 @@ function register_block_core_post_comments() {
66
66
  );
67
67
  }
68
68
  add_action( 'init', 'register_block_core_post_comments' );
69
+
70
+ /**
71
+ * Use the button block classes for the form-submit button.
72
+ *
73
+ * @param array $fields The default comment form arguments.
74
+ *
75
+ * @return array Returns the modified fields.
76
+ */
77
+ function gutenberg_post_comments_block_form_defaults( $fields ) {
78
+ $fields['submit_button'] = '<input name="%1$s" type="submit" id="%2$s" class="%3$s wp-block-button__link" value="%4$s" />';
79
+ $fields['submit_field'] = '<p class="form-submit wp-block-button">%1$s %2$s</p>';
80
+
81
+ return $fields;
82
+ }
83
+ add_filter( 'comment_form_defaults', 'gutenberg_post_comments_block_form_defaults' );
@@ -64,9 +64,13 @@
64
64
  }
65
65
  }
66
66
 
67
- .comment-form-comment textarea {
68
- box-sizing: border-box;
69
- width: 100%;
67
+ .comment-form {
68
+ textarea,
69
+ input:not([type="submit"]):not([type="checkbox"]) {
70
+ display: block;
71
+ box-sizing: border-box;
72
+ width: 100%;
73
+ }
70
74
  }
71
75
 
72
76
  .comment-form-cookies-consent {
@@ -41,13 +41,15 @@
41
41
  padding: calc(0.667em + 2px); // The extra 2px is added to match outline buttons.
42
42
  }
43
43
 
44
- .comment-form-comment textarea {
45
- display: block;
46
- box-sizing: border-box;
47
- width: 100%;
44
+ .comment-form {
45
+ textarea,
46
+ input:not([type="submit"]):not([type="checkbox"]) {
47
+ display: block;
48
+ box-sizing: border-box;
49
+ width: 100%;
50
+ }
48
51
  }
49
52
 
50
- .comment-form-comment,
51
53
  .comment-form-author,
52
54
  .comment-form-email,
53
55
  .comment-form-url {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "apiVersion": 2,
3
3
  "name": "core/query-pagination",
4
- "title": "Query Pagination",
4
+ "title": "Pagination",
5
5
  "category": "design",
6
6
  "parent": [ "core/query" ],
7
7
  "description": "Displays a paginated navigation to next/previous set of posts, when applicable.",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "apiVersion": 2,
3
3
  "name": "core/query-pagination-next",
4
- "title": "Query Pagination Next",
4
+ "title": "Next Page",
5
5
  "category": "design",
6
6
  "parent": [ "core/query-pagination" ],
7
7
  "description": "Displays the next posts page link.",
@@ -17,7 +17,7 @@
17
17
  "html": false,
18
18
  "color": {
19
19
  "gradients": true,
20
- "link": true
20
+ "text": false
21
21
  },
22
22
  "typography": {
23
23
  "fontSize": true,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "apiVersion": 2,
3
3
  "name": "core/query-pagination-numbers",
4
- "title": "Query Pagination Numbers",
4
+ "title": "Page Numbers",
5
5
  "category": "design",
6
6
  "parent": [ "core/query-pagination" ],
7
7
  "description": "Displays a list of page numbers for pagination",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "apiVersion": 2,
3
3
  "name": "core/query-pagination-previous",
4
- "title": "Query Pagination Previous",
4
+ "title": "Previous Page",
5
5
  "category": "design",
6
6
  "parent": [ "core/query-pagination" ],
7
7
  "description": "Displays the previous posts page link.",
@@ -17,7 +17,7 @@
17
17
  "html": false,
18
18
  "color": {
19
19
  "gradients": true,
20
- "link": true
20
+ "text": false
21
21
  },
22
22
  "typography": {
23
23
  "fontSize": true,
@@ -8,6 +8,7 @@ const SeparatorSettings = ( { color, setColor } ) => (
8
8
  <InspectorControls>
9
9
  <PanelColorSettings
10
10
  __experimentalHasMultipleOrigins
11
+ __experimentalIsRenderedInSidebar
11
12
  title={ __( 'Color' ) }
12
13
  colorSettings={ [
13
14
  {
@@ -167,6 +167,7 @@ export function SocialLinksEdit( props ) {
167
167
  </PanelBody>
168
168
  <PanelColorSettings
169
169
  __experimentalHasMultipleOrigins
170
+ __experimentalIsRenderedInSidebar
170
171
  title={ __( 'Color' ) }
171
172
  colorSettings={ [
172
173
  {
@@ -50,6 +50,17 @@ function render_block_core_template_part( $attributes ) {
50
50
  if ( ! is_wp_error( $area_terms ) && false !== $area_terms ) {
51
51
  $area = $area_terms[0]->name;
52
52
  }
53
+ /**
54
+ * Fires when a block template part is loaded from a template post stored in the database.
55
+ *
56
+ * @since 5.9.0
57
+ *
58
+ * @param string $template_part_id The requested template part namespaced to the theme.
59
+ * @param array $attributes The block attributes.
60
+ * @param WP_Post $template_part_post The template part post object.
61
+ * @param string $content The template part content.
62
+ */
63
+ do_action( 'render_block_core_template_part_post', $template_part_id, $attributes, $template_part_post, $content );
53
64
  } else {
54
65
  // Else, if the template part was provided by the active theme,
55
66
  // render the corresponding file content.
@@ -61,6 +72,31 @@ function render_block_core_template_part( $attributes ) {
61
72
  ? _inject_theme_attribute_in_block_template_content( $content )
62
73
  : '';
63
74
  }
75
+
76
+ if ( '' !== $content && null !== $content ) {
77
+ /**
78
+ * Fires when a block template part is loaded from a template part in the theme.
79
+ *
80
+ * @since 5.9.0
81
+ *
82
+ * @param string $template_part_id The requested template part namespaced to the theme.
83
+ * @param array $attributes The block attributes.
84
+ * @param string $template_part_file_path Absolute path to the template path.
85
+ * @param string $content The template part content.
86
+ */
87
+ do_action( 'render_block_core_template_part_file', $template_part_id, $attributes, $template_part_file_path, $content );
88
+ } else {
89
+ /**
90
+ * Fires when a requested block template part does not exist in the database nor in the theme.
91
+ *
92
+ * @since 5.9.0
93
+ *
94
+ * @param string $template_part_id The requested template part namespaced to the theme.
95
+ * @param array $attributes The block attributes.
96
+ * @param string $template_part_file_path Absolute path to the not found template path.
97
+ */
98
+ do_action( 'render_block_core_template_part_none', $template_part_id, $attributes, $template_part_file_path );
99
+ }
64
100
  }
65
101
  }
66
102