@wordpress/block-library 9.42.0 → 9.43.1-next.v.202604091042.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 (153) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/code/edit.cjs +2 -1
  3. package/build/code/edit.cjs.map +2 -2
  4. package/build/cover/edit/color-utils.cjs +1 -1
  5. package/build/cover/edit/color-utils.cjs.map +2 -2
  6. package/build/cover/edit/index.cjs +31 -25
  7. package/build/cover/edit/index.cjs.map +2 -2
  8. package/build/cover/embed-video-utils.cjs +9 -7
  9. package/build/cover/embed-video-utils.cjs.map +2 -2
  10. package/build/file/utils/index.cjs +1 -1
  11. package/build/file/utils/index.cjs.map +2 -2
  12. package/build/form/view.cjs +1 -1
  13. package/build/form/view.cjs.map +2 -2
  14. package/build/form-input/edit.cjs +36 -29
  15. package/build/form-input/edit.cjs.map +2 -2
  16. package/build/form-input/variations.cjs +10 -0
  17. package/build/form-input/variations.cjs.map +2 -2
  18. package/build/group/block.json +3 -1
  19. package/build/icon/edit.cjs +1 -3
  20. package/build/icon/edit.cjs.map +2 -2
  21. package/build/image/image.cjs +17 -7
  22. package/build/image/image.cjs.map +2 -2
  23. package/build/latest-comments/deprecated.cjs +33 -0
  24. package/build/latest-comments/deprecated.cjs.map +2 -2
  25. package/build/list-item/block.json +1 -0
  26. package/build/navigation/edit/index.cjs +123 -119
  27. package/build/navigation/edit/index.cjs.map +3 -3
  28. package/build/navigation/edit/navigation-menu-selector.cjs +2 -1
  29. package/build/navigation/edit/navigation-menu-selector.cjs.map +2 -2
  30. package/build/navigation-link/link-ui/page-creator.cjs +1 -1
  31. package/build/navigation-link/link-ui/page-creator.cjs.map +2 -2
  32. package/build/navigation-link/shared/update-attributes.cjs +1 -1
  33. package/build/navigation-link/shared/update-attributes.cjs.map +2 -2
  34. package/build/navigation-link/shared/use-link-preview.cjs +1 -1
  35. package/build/navigation-link/shared/use-link-preview.cjs.map +2 -2
  36. package/build/pattern/edit.cjs +1 -1
  37. package/build/pattern/edit.cjs.map +2 -2
  38. package/build/search/block.json +0 -4
  39. package/build/search/edit.cjs +6 -33
  40. package/build/search/edit.cjs.map +2 -2
  41. package/build/site-logo/edit.cjs +19 -13
  42. package/build/site-logo/edit.cjs.map +3 -3
  43. package/build/site-tagline/deprecated.cjs +2 -1
  44. package/build/site-tagline/deprecated.cjs.map +2 -2
  45. package/build/tab/save.cjs +2 -4
  46. package/build/tab/save.cjs.map +2 -2
  47. package/build/tabs/save.cjs +2 -4
  48. package/build/tabs/save.cjs.map +2 -2
  49. package/build/utils/media-control.cjs +1 -1
  50. package/build/utils/media-control.cjs.map +2 -2
  51. package/build-module/code/edit.mjs +2 -1
  52. package/build-module/code/edit.mjs.map +2 -2
  53. package/build-module/cover/edit/color-utils.mjs +1 -1
  54. package/build-module/cover/edit/color-utils.mjs.map +2 -2
  55. package/build-module/cover/edit/index.mjs +39 -28
  56. package/build-module/cover/edit/index.mjs.map +2 -2
  57. package/build-module/cover/embed-video-utils.mjs +8 -6
  58. package/build-module/cover/embed-video-utils.mjs.map +2 -2
  59. package/build-module/file/utils/index.mjs +1 -1
  60. package/build-module/file/utils/index.mjs.map +2 -2
  61. package/build-module/form/view.mjs +1 -1
  62. package/build-module/form/view.mjs.map +2 -2
  63. package/build-module/form-input/edit.mjs +36 -29
  64. package/build-module/form-input/edit.mjs.map +2 -2
  65. package/build-module/form-input/variations.mjs +10 -0
  66. package/build-module/form-input/variations.mjs.map +2 -2
  67. package/build-module/group/block.json +3 -1
  68. package/build-module/icon/edit.mjs +1 -3
  69. package/build-module/icon/edit.mjs.map +2 -2
  70. package/build-module/image/image.mjs +17 -7
  71. package/build-module/image/image.mjs.map +2 -2
  72. package/build-module/latest-comments/deprecated.mjs +33 -0
  73. package/build-module/latest-comments/deprecated.mjs.map +2 -2
  74. package/build-module/list-item/block.json +1 -0
  75. package/build-module/navigation/edit/index.mjs +123 -119
  76. package/build-module/navigation/edit/index.mjs.map +2 -2
  77. package/build-module/navigation/edit/navigation-menu-selector.mjs +2 -1
  78. package/build-module/navigation/edit/navigation-menu-selector.mjs.map +2 -2
  79. package/build-module/navigation-link/link-ui/page-creator.mjs +1 -1
  80. package/build-module/navigation-link/link-ui/page-creator.mjs.map +2 -2
  81. package/build-module/navigation-link/shared/update-attributes.mjs +1 -1
  82. package/build-module/navigation-link/shared/update-attributes.mjs.map +2 -2
  83. package/build-module/navigation-link/shared/use-link-preview.mjs +1 -1
  84. package/build-module/navigation-link/shared/use-link-preview.mjs.map +2 -2
  85. package/build-module/pattern/edit.mjs +1 -1
  86. package/build-module/pattern/edit.mjs.map +2 -2
  87. package/build-module/search/block.json +0 -4
  88. package/build-module/search/edit.mjs +6 -33
  89. package/build-module/search/edit.mjs.map +2 -2
  90. package/build-module/site-logo/edit.mjs +21 -14
  91. package/build-module/site-logo/edit.mjs.map +2 -2
  92. package/build-module/site-tagline/deprecated.mjs +2 -1
  93. package/build-module/site-tagline/deprecated.mjs.map +2 -2
  94. package/build-module/tab/save.mjs +2 -4
  95. package/build-module/tab/save.mjs.map +2 -2
  96. package/build-module/tabs/save.mjs +2 -4
  97. package/build-module/tabs/save.mjs.map +2 -2
  98. package/build-module/utils/media-control.mjs +1 -1
  99. package/build-module/utils/media-control.mjs.map +2 -2
  100. package/build-style/code/style-rtl.css +1 -1
  101. package/build-style/code/style.css +1 -1
  102. package/build-style/editor-rtl.css +15 -5
  103. package/build-style/editor.css +15 -5
  104. package/build-style/form-input/editor-rtl.css +6 -5
  105. package/build-style/form-input/editor.css +6 -5
  106. package/build-style/icon/editor-rtl.css +5 -0
  107. package/build-style/icon/editor.css +5 -0
  108. package/build-style/image/editor-rtl.css +4 -0
  109. package/build-style/image/editor.css +4 -0
  110. package/build-style/navigation/style-rtl.css +4 -1
  111. package/build-style/navigation/style.css +4 -1
  112. package/build-style/style-rtl.css +5 -2
  113. package/build-style/style.css +5 -2
  114. package/package.json +38 -38
  115. package/src/code/edit.js +1 -0
  116. package/src/code/style.scss +1 -1
  117. package/src/cover/edit/color-utils.js +1 -1
  118. package/src/cover/edit/index.js +63 -34
  119. package/src/cover/embed-video-utils.js +10 -8
  120. package/src/embed/test/index.native.js +3 -2
  121. package/src/file/utils/index.js +1 -1
  122. package/src/form/view.js +1 -1
  123. package/src/form-input/edit.js +19 -15
  124. package/src/form-input/editor.scss +6 -6
  125. package/src/form-input/variations.js +10 -0
  126. package/src/group/block.json +3 -1
  127. package/src/home-link/index.php +14 -33
  128. package/src/icon/edit.js +1 -3
  129. package/src/icon/editor.scss +5 -0
  130. package/src/image/editor.scss +5 -0
  131. package/src/image/image.js +24 -7
  132. package/src/image/index.php +4 -4
  133. package/src/latest-comments/deprecated.js +33 -0
  134. package/src/list-item/block.json +1 -0
  135. package/src/loginout/index.php +13 -0
  136. package/src/navigation/edit/index.js +134 -130
  137. package/src/navigation/edit/navigation-menu-selector.js +2 -1
  138. package/src/navigation/style.scss +5 -3
  139. package/src/navigation-link/index.php +10 -38
  140. package/src/navigation-link/link-ui/page-creator.js +1 -1
  141. package/src/navigation-link/shared/build-css-font-sizes.php +43 -0
  142. package/src/navigation-link/shared/update-attributes.js +1 -1
  143. package/src/navigation-link/shared/use-link-preview.js +1 -1
  144. package/src/navigation-submenu/index.php +10 -38
  145. package/src/page-list/index.php +14 -41
  146. package/src/pattern/edit.js +1 -1
  147. package/src/search/block.json +0 -4
  148. package/src/search/edit.js +2 -35
  149. package/src/site-logo/edit.js +24 -13
  150. package/src/site-tagline/deprecated.js +1 -0
  151. package/src/tab/save.js +2 -6
  152. package/src/tabs/save.js +2 -6
  153. package/src/utils/media-control.js +3 -1
@@ -5,6 +5,8 @@
5
5
  * @package WordPress
6
6
  */
7
7
 
8
+ require_once __DIR__ . '/navigation-link/shared/build-css-font-sizes.php';
9
+
8
10
  /**
9
11
  * Build an array with CSS classes and inline styles defining the colors
10
12
  * which will be applied to the home link markup in the front-end.
@@ -59,36 +61,6 @@ function block_core_home_link_build_css_colors( $context ) {
59
61
  return $colors;
60
62
  }
61
63
 
62
- /**
63
- * Build an array with CSS classes and inline styles defining the font sizes
64
- * which will be applied to the home link markup in the front-end.
65
- *
66
- * @since 6.0.0
67
- *
68
- * @param array $context Home link block context.
69
- * @return array Font size CSS classes and inline styles.
70
- */
71
- function block_core_home_link_build_css_font_sizes( $context ) {
72
- // CSS classes.
73
- $font_sizes = array(
74
- 'css_classes' => array(),
75
- 'inline_styles' => '',
76
- );
77
-
78
- $has_named_font_size = array_key_exists( 'fontSize', $context );
79
- $has_custom_font_size = isset( $context['style']['typography']['fontSize'] );
80
-
81
- if ( $has_named_font_size ) {
82
- // Add the font size class.
83
- $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] );
84
- } elseif ( $has_custom_font_size ) {
85
- // Add the custom font size inline style.
86
- $font_sizes['inline_styles'] = sprintf( 'font-size: %s;', $context['style']['typography']['fontSize'] );
87
- }
88
-
89
- return $font_sizes;
90
- }
91
-
92
64
  /**
93
65
  * Builds an array with classes and style for the li wrapper
94
66
  *
@@ -98,12 +70,21 @@ function block_core_home_link_build_css_font_sizes( $context ) {
98
70
  * @return string The li wrapper attributes.
99
71
  */
100
72
  function block_core_home_link_build_li_wrapper_attributes( $context ) {
101
- $colors = block_core_home_link_build_css_colors( $context );
102
- $font_sizes = block_core_home_link_build_css_font_sizes( $context );
103
- $classes = array_merge(
73
+ $colors = block_core_home_link_build_css_colors( $context );
74
+ // The build system prefixes this function with "gutenberg_" to avoid
75
+ // collisions with the core version. Until this function is backported to
76
+ // core, we need to guard it's use and only call the prefixed name in
77
+ // the plugin.
78
+ if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
79
+ $font_sizes = gutenberg_block_core_shared_navigation_build_css_font_sizes( $context );
80
+ } else {
81
+ $font_sizes = block_core_shared_navigation_build_css_font_sizes( $context );
82
+ }
83
+ $classes = array_merge(
104
84
  $colors['css_classes'],
105
85
  $font_sizes['css_classes']
106
86
  );
87
+
107
88
  $style_attribute = ( $colors['inline_styles'] . $font_sizes['inline_styles'] );
108
89
  $classes[] = 'wp-block-navigation-item';
109
90
 
package/src/icon/edit.js CHANGED
@@ -78,9 +78,7 @@ export function Edit( { attributes, setAttributes } ) {
78
78
  ? getEntityRecord( 'root', 'icon', icon )
79
79
  : null,
80
80
  allIcons: isInserterOpen
81
- ? getEntityRecords( 'root', 'icon', {
82
- per_page: -1,
83
- } )
81
+ ? getEntityRecords( 'root', 'icon' )
84
82
  : undefined,
85
83
  };
86
84
  },
@@ -1,6 +1,11 @@
1
1
  @use "@wordpress/base-styles/variables" as *;
2
2
  @use "@wordpress/base-styles/colors" as *;
3
3
 
4
+ .wp-block[data-align="center"] > .wp-block-icon {
5
+ display: flex;
6
+ justify-content: center;
7
+ }
8
+
4
9
  // Style for the icon library modal.
5
10
  .wp-block-icon__inserter {
6
11
  padding: 0 $grid-unit-30;
@@ -52,6 +52,11 @@ figure.wp-block-image:not(.wp-block) {
52
52
  }
53
53
  }
54
54
 
55
+ // Disable any duotone filter applied in the selected state.
56
+ .wp-block-image.is-selected .block-editor-media-placeholder {
57
+ filter: none !important;
58
+ }
59
+
55
60
  .block-editor-block-list__block[data-type="core/image"] .block-editor-block-toolbar .block-editor-url-input__button-modal {
56
61
  position: absolute;
57
62
  left: 0;
@@ -70,7 +70,9 @@ import {
70
70
  } from './constants';
71
71
  import { evalAspectRatio, mediaPosition } from './utils';
72
72
 
73
- const { DimensionsTool, ResolutionTool } = unlock( blockEditorPrivateApis );
73
+ const { DimensionsTool, ResolutionTool, mediaEditKey } = unlock(
74
+ blockEditorPrivateApis
75
+ );
74
76
 
75
77
  const scaleOptions = [
76
78
  {
@@ -342,7 +344,13 @@ export default function Image( {
342
344
  [ id, isSingleSelected ]
343
345
  );
344
346
 
345
- const { canInsertCover, imageEditing, imageSizes, maxWidth } = useSelect(
347
+ const {
348
+ canInsertCover,
349
+ imageEditing,
350
+ imageSizes,
351
+ maxWidth,
352
+ editMediaEntity,
353
+ } = useSelect(
346
354
  ( select ) => {
347
355
  const { getBlockRootClientId, canInsertBlockType, getSettings } =
348
356
  select( blockEditorStore );
@@ -354,6 +362,7 @@ export default function Image( {
354
362
  imageEditing: settings.imageEditing,
355
363
  imageSizes: settings.imageSizes,
356
364
  maxWidth: settings.maxWidth,
365
+ editMediaEntity: settings?.[ mediaEditKey ],
357
366
  canInsertCover: canInsertBlockType(
358
367
  'core/cover',
359
368
  rootClientId
@@ -387,6 +396,9 @@ export default function Image( {
387
396
  hasNonContentControls &&
388
397
  ! isWideAligned &&
389
398
  isLargeViewport;
399
+ // An image is uploading if it has a temporary blob URL, or if it is
400
+ // being processed client-side (e.g. transcoded or generating sub-sizes).
401
+ const isUploading = !! temporaryURL || isSideloading;
390
402
  const imageSizeOptions = imageSizes
391
403
  .filter(
392
404
  ( { slug } ) => image?.media_details?.sizes?.[ slug ]?.source_url
@@ -550,7 +562,12 @@ export default function Image( {
550
562
  }
551
563
  }, [ isSingleSelected ] );
552
564
 
553
- const canEditImage = id && naturalWidth && naturalHeight && imageEditing;
565
+ const canEditImage =
566
+ id &&
567
+ naturalWidth &&
568
+ naturalHeight &&
569
+ imageEditing &&
570
+ !! editMediaEntity;
554
571
  const allowCrop =
555
572
  isSingleSelected &&
556
573
  canEditImage &&
@@ -762,6 +779,7 @@ export default function Image( {
762
779
  id &&
763
780
  isSingleSelected &&
764
781
  canUserEdit &&
782
+ !! editMediaEntity &&
765
783
  ! isExternalImage( id, url ) &&
766
784
  ! isEditingImage &&
767
785
  onNavigateToEntityRecord && (
@@ -870,9 +888,7 @@ export default function Image( {
870
888
  onSelectURL={ onSelectURL }
871
889
  onError={ onUploadError }
872
890
  onReset={ () => onSelectImage( undefined ) }
873
- isUploading={
874
- !! temporaryURL || isSideloading
875
- }
891
+ isUploading={ isUploading }
876
892
  emptyLabel={ __( 'Add image' ) }
877
893
  />
878
894
  </ToolsPanelItem>
@@ -1063,7 +1079,7 @@ export default function Image( {
1063
1079
  ...shadowProps.style,
1064
1080
  } }
1065
1081
  />
1066
- { ( temporaryURL || isSideloading ) && <Spinner /> }
1082
+ { isUploading && <Spinner /> }
1067
1083
  </>
1068
1084
  );
1069
1085
 
@@ -1095,6 +1111,7 @@ export default function Image( {
1095
1111
  isResizable &&
1096
1112
  isSingleSelected &&
1097
1113
  ! isEditingImage &&
1114
+ ! isUploading &&
1098
1115
  ! SIZED_LAYOUTS.includes( parentLayoutType )
1099
1116
  ) {
1100
1117
  const numericRatio = aspectRatio && evalAspectRatio( aspectRatio );
@@ -205,8 +205,8 @@ function block_core_image_render_lightbox( $block_content, $block, $block_instan
205
205
  array(
206
206
  'defaultAriaLabel' => __( 'Enlarged image' ),
207
207
  'closeButtonText' => esc_html__( 'Close' ),
208
- 'prevButtonText' => esc_html__( 'Previous' ),
209
- 'nextButtonText' => esc_html__( 'Next' ),
208
+ 'prevButtonText' => esc_html_x( 'Previous', 'previous image in lightbox' ),
209
+ 'nextButtonText' => esc_html_x( 'Next', 'next image in lightbox' ),
210
210
  )
211
211
  );
212
212
 
@@ -323,8 +323,8 @@ function block_core_image_render_lightbox( $block_content, $block, $block_instan
323
323
  function block_core_image_print_lightbox_overlay() {
324
324
  $dialog_label = esc_attr__( 'Enlarged images' );
325
325
  $close_button_text = esc_attr__( 'Close' );
326
- $prev_button_text = esc_attr__( 'Previous' );
327
- $next_button_text = esc_attr__( 'Next' );
326
+ $prev_button_text = esc_attr_x( 'Previous', 'previous image in lightbox' );
327
+ $next_button_text = esc_attr_x( 'Next', 'next image in lightbox' );
328
328
  $close_button_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" aria-hidden="true" focusable="false"><path d="m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"></path></svg>';
329
329
  $prev_button_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="28" height="28" aria-hidden="true" focusable="false"><path d="M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"></path></svg>';
330
330
  $next_button_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="28" height="28" aria-hidden="true" focusable="false"><path d="M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"></path></svg>';
@@ -23,6 +23,39 @@ const v1 = {
23
23
  default: true,
24
24
  },
25
25
  },
26
+ supports: {
27
+ align: true,
28
+ color: {
29
+ gradients: true,
30
+ link: true,
31
+ __experimentalDefaultControls: {
32
+ background: true,
33
+ text: true,
34
+ link: true,
35
+ },
36
+ },
37
+ html: false,
38
+ spacing: {
39
+ margin: true,
40
+ padding: true,
41
+ },
42
+ typography: {
43
+ fontSize: true,
44
+ lineHeight: true,
45
+ __experimentalFontFamily: true,
46
+ __experimentalFontWeight: true,
47
+ __experimentalFontStyle: true,
48
+ __experimentalTextTransform: true,
49
+ __experimentalTextDecoration: true,
50
+ __experimentalLetterSpacing: true,
51
+ __experimentalDefaultControls: {
52
+ fontSize: true,
53
+ },
54
+ },
55
+ interactivity: {
56
+ clientNavigation: true,
57
+ },
58
+ },
26
59
  isEligible( attributes ) {
27
60
  return attributes?.displayExcerpt === false;
28
61
  },
@@ -21,6 +21,7 @@
21
21
  },
22
22
  "supports": {
23
23
  "anchor": true,
24
+ "html": false,
24
25
  "className": false,
25
26
  "splitting": true,
26
27
  "__experimentalBorder": {
@@ -38,6 +38,19 @@ function render_block_core_loginout( $attributes ) {
38
38
 
39
39
  // Get the form.
40
40
  $contents = wp_login_form( array( 'echo' => false ) );
41
+
42
+ if ( wp_is_block_theme() ) {
43
+ $processor = new WP_HTML_Tag_Processor( $contents );
44
+
45
+ while ( $processor->next_tag( 'input' ) ) {
46
+ if ( 'submit' === $processor->get_attribute( 'type' ) && 'wp-submit' === $processor->get_attribute( 'name' ) ) {
47
+ $processor->add_class( 'wp-block-button__link' );
48
+ $processor->add_class( wp_theme_get_element_class_name( 'button' ) );
49
+ $contents = $processor->get_updated_html();
50
+ break;
51
+ }
52
+ }
53
+ }
41
54
  }
42
55
 
43
56
  $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
@@ -966,16 +966,7 @@ function Navigation( {
966
966
 
967
967
  if ( hasUnsavedBlocks && ! isCreatingNavigationMenu ) {
968
968
  return (
969
- <TagName
970
- { ...blockProps }
971
- aria-describedby={
972
- ! isPlaceholder ? accessibleDescriptionId : undefined
973
- }
974
- >
975
- <AccessibleDescription id={ accessibleDescriptionId }>
976
- { __( 'Unsaved Navigation Menu.' ) }
977
- </AccessibleDescription>
978
-
969
+ <>
979
970
  <MenuInspectorControls
980
971
  clientId={ clientId }
981
972
  createNavigationMenuIsSuccess={
@@ -992,26 +983,36 @@ function Navigation( {
992
983
  blockEditingMode={ blockEditingMode }
993
984
  />
994
985
  { blockEditingMode === 'default' && stylingInspectorControls }
995
- <ResponsiveWrapper
996
- id={ clientId }
997
- onToggle={ setResponsiveMenuVisibility }
998
- isOpen={ isResponsiveMenuOpen }
999
- hasIcon={ hasIcon }
1000
- icon={ icon }
1001
- isResponsive={ isResponsive }
1002
- isHiddenByDefault={ isHiddenByDefault }
1003
- overlayBackgroundColor={ overlayBackgroundColor }
1004
- overlayTextColor={ overlayTextColor }
1005
- overlay={ overlay }
1006
- onNavigateToEntityRecord={ onNavigateToEntityRecord }
986
+ <TagName
987
+ { ...blockProps }
988
+ aria-describedby={
989
+ ! isPlaceholder ? accessibleDescriptionId : undefined
990
+ }
1007
991
  >
1008
- <UnsavedInnerBlocks
1009
- createNavigationMenu={ createNavigationMenu }
1010
- blocks={ uncontrolledInnerBlocks }
1011
- hasSelection={ isSelected || isInnerBlockSelected }
1012
- />
1013
- </ResponsiveWrapper>
1014
- </TagName>
992
+ <AccessibleDescription id={ accessibleDescriptionId }>
993
+ { __( 'Unsaved Navigation Menu.' ) }
994
+ </AccessibleDescription>
995
+ <ResponsiveWrapper
996
+ id={ clientId }
997
+ onToggle={ setResponsiveMenuVisibility }
998
+ isOpen={ isResponsiveMenuOpen }
999
+ hasIcon={ hasIcon }
1000
+ icon={ icon }
1001
+ isResponsive={ isResponsive }
1002
+ isHiddenByDefault={ isHiddenByDefault }
1003
+ overlayBackgroundColor={ overlayBackgroundColor }
1004
+ overlayTextColor={ overlayTextColor }
1005
+ overlay={ overlay }
1006
+ onNavigateToEntityRecord={ onNavigateToEntityRecord }
1007
+ >
1008
+ <UnsavedInnerBlocks
1009
+ createNavigationMenu={ createNavigationMenu }
1010
+ blocks={ uncontrolledInnerBlocks }
1011
+ hasSelection={ isSelected || isInnerBlockSelected }
1012
+ />
1013
+ </ResponsiveWrapper>
1014
+ </TagName>
1015
+ </>
1015
1016
  );
1016
1017
  }
1017
1018
 
@@ -1019,7 +1020,7 @@ function Navigation( {
1019
1020
  // TODO - the user should be able to select a new one?
1020
1021
  if ( ref && isNavigationMenuMissing ) {
1021
1022
  return (
1022
- <TagName { ...blockProps }>
1023
+ <>
1023
1024
  <MenuInspectorControls
1024
1025
  clientId={ clientId }
1025
1026
  createNavigationMenuIsSuccess={
@@ -1035,10 +1036,12 @@ function Navigation( {
1035
1036
  isLoading={ isLoading }
1036
1037
  blockEditingMode={ blockEditingMode }
1037
1038
  />
1038
- <DeletedNavigationWarning
1039
- onCreateNew={ createUntitledEmptyNavigationMenu }
1040
- />
1041
- </TagName>
1039
+ <TagName { ...blockProps }>
1040
+ <DeletedNavigationWarning
1041
+ onCreateNew={ createUntitledEmptyNavigationMenu }
1042
+ />
1043
+ </TagName>
1044
+ </>
1042
1045
  );
1043
1046
  }
1044
1047
 
@@ -1088,105 +1091,106 @@ function Navigation( {
1088
1091
  }
1089
1092
 
1090
1093
  return (
1091
- <EntityProvider kind="postType" type="wp_navigation" id={ ref }>
1092
- <RecursionProvider uniqueId={ recursionId }>
1093
- <MenuInspectorControls
1094
- clientId={ clientId }
1095
- createNavigationMenuIsSuccess={
1096
- createNavigationMenuIsSuccess
1097
- }
1098
- createNavigationMenuIsError={ createNavigationMenuIsError }
1099
- currentMenuId={ ref }
1100
- isNavigationMenuMissing={ isNavigationMenuMissing }
1101
- isManageMenusButtonDisabled={ isManageMenusButtonDisabled }
1102
- onCreateNew={ createUntitledEmptyNavigationMenu }
1103
- onSelectClassicMenu={ onSelectClassicMenu }
1104
- onSelectNavigationMenu={ onSelectNavigationMenu }
1105
- isLoading={ isLoading }
1106
- blockEditingMode={ blockEditingMode }
1107
- />
1108
- { blockEditingMode === 'default' && stylingInspectorControls }
1109
- { blockEditingMode === 'contentOnly' && isEntityAvailable && (
1110
- <NavigationAddPageButton clientId={ clientId } />
1111
- ) }
1112
- { blockEditingMode === 'default' && isEntityAvailable && (
1113
- <InspectorControls group="advanced">
1114
- { hasResolvedCanUserUpdateNavigationMenu &&
1115
- canUserUpdateNavigationMenu && (
1116
- <NavigationMenuNameControl />
1117
- ) }
1118
- { hasResolvedCanUserDeleteNavigationMenu &&
1119
- canUserDeleteNavigationMenu && (
1120
- <NavigationMenuDeleteControl
1121
- onDelete={ () => {
1122
- replaceInnerBlocks( clientId, [] );
1123
- showNavigationMenuStatusNotice(
1124
- __(
1125
- 'Navigation Menu successfully deleted.'
1126
- )
1127
- );
1128
- } }
1129
- />
1130
- ) }
1131
- <ManageMenusButton
1132
- disabled={ isManageMenusButtonDisabled }
1133
- className="wp-block-navigation-manage-menus-button"
1134
- />
1135
- </InspectorControls>
1136
- ) }
1137
-
1138
- <TagName
1139
- { ...blockProps }
1140
- aria-describedby={
1141
- ! isPlaceholder && ! isLoading
1142
- ? accessibleDescriptionId
1143
- : undefined
1144
- }
1145
- >
1146
- { isLoading && ! isHiddenByDefault && (
1147
- <div className="wp-block-navigation__loading-indicator-container">
1148
- <Spinner className="wp-block-navigation__loading-indicator" />
1149
- </div>
1150
- ) }
1151
-
1152
- { ( ! isLoading || isHiddenByDefault ) && (
1153
- <>
1154
- <AccessibleMenuDescription
1155
- id={ accessibleDescriptionId }
1156
- />
1157
- <ResponsiveWrapper
1158
- id={ clientId }
1159
- onToggle={ setResponsiveMenuVisibility }
1160
- hasIcon={ hasIcon }
1161
- icon={ icon }
1162
- isOpen={ isResponsiveMenuOpen }
1163
- isResponsive={ isResponsive }
1164
- isHiddenByDefault={ isHiddenByDefault }
1165
- overlayBackgroundColor={
1166
- overlayBackgroundColor
1167
- }
1168
- overlayTextColor={ overlayTextColor }
1169
- overlay={ overlay }
1170
- onNavigateToEntityRecord={
1171
- onNavigateToEntityRecord
1172
- }
1173
- >
1174
- { isEntityAvailable && (
1175
- <NavigationInnerBlocks
1176
- clientId={ clientId }
1177
- hasCustomPlaceholder={
1178
- !! CustomPlaceholder
1179
- }
1180
- templateLock={ templateLock }
1181
- orientation={ orientation }
1094
+ <>
1095
+ <MenuInspectorControls
1096
+ clientId={ clientId }
1097
+ createNavigationMenuIsSuccess={ createNavigationMenuIsSuccess }
1098
+ createNavigationMenuIsError={ createNavigationMenuIsError }
1099
+ currentMenuId={ ref }
1100
+ isNavigationMenuMissing={ isNavigationMenuMissing }
1101
+ isManageMenusButtonDisabled={ isManageMenusButtonDisabled }
1102
+ onCreateNew={ createUntitledEmptyNavigationMenu }
1103
+ onSelectClassicMenu={ onSelectClassicMenu }
1104
+ onSelectNavigationMenu={ onSelectNavigationMenu }
1105
+ isLoading={ isLoading }
1106
+ blockEditingMode={ blockEditingMode }
1107
+ />
1108
+ { blockEditingMode === 'default' && stylingInspectorControls }
1109
+ <EntityProvider kind="postType" type="wp_navigation" id={ ref }>
1110
+ <RecursionProvider uniqueId={ recursionId }>
1111
+ { blockEditingMode === 'contentOnly' &&
1112
+ isEntityAvailable && (
1113
+ <NavigationAddPageButton clientId={ clientId } />
1114
+ ) }
1115
+ { blockEditingMode === 'default' && isEntityAvailable && (
1116
+ <InspectorControls group="advanced">
1117
+ { hasResolvedCanUserUpdateNavigationMenu &&
1118
+ canUserUpdateNavigationMenu && (
1119
+ <NavigationMenuNameControl />
1120
+ ) }
1121
+ { hasResolvedCanUserDeleteNavigationMenu &&
1122
+ canUserDeleteNavigationMenu && (
1123
+ <NavigationMenuDeleteControl
1124
+ onDelete={ () => {
1125
+ replaceInnerBlocks( clientId, [] );
1126
+ showNavigationMenuStatusNotice(
1127
+ __(
1128
+ 'Navigation Menu successfully deleted.'
1129
+ )
1130
+ );
1131
+ } }
1182
1132
  />
1183
1133
  ) }
1184
- </ResponsiveWrapper>
1185
- </>
1134
+ <ManageMenusButton
1135
+ disabled={ isManageMenusButtonDisabled }
1136
+ className="wp-block-navigation-manage-menus-button"
1137
+ />
1138
+ </InspectorControls>
1186
1139
  ) }
1187
- </TagName>
1188
- </RecursionProvider>
1189
- </EntityProvider>
1140
+
1141
+ <TagName
1142
+ { ...blockProps }
1143
+ aria-describedby={
1144
+ ! isPlaceholder && ! isLoading
1145
+ ? accessibleDescriptionId
1146
+ : undefined
1147
+ }
1148
+ >
1149
+ { isLoading && ! isHiddenByDefault && (
1150
+ <div className="wp-block-navigation__loading-indicator-container">
1151
+ <Spinner className="wp-block-navigation__loading-indicator" />
1152
+ </div>
1153
+ ) }
1154
+
1155
+ { ( ! isLoading || isHiddenByDefault ) && (
1156
+ <>
1157
+ <AccessibleMenuDescription
1158
+ id={ accessibleDescriptionId }
1159
+ />
1160
+ <ResponsiveWrapper
1161
+ id={ clientId }
1162
+ onToggle={ setResponsiveMenuVisibility }
1163
+ hasIcon={ hasIcon }
1164
+ icon={ icon }
1165
+ isOpen={ isResponsiveMenuOpen }
1166
+ isResponsive={ isResponsive }
1167
+ isHiddenByDefault={ isHiddenByDefault }
1168
+ overlayBackgroundColor={
1169
+ overlayBackgroundColor
1170
+ }
1171
+ overlayTextColor={ overlayTextColor }
1172
+ overlay={ overlay }
1173
+ onNavigateToEntityRecord={
1174
+ onNavigateToEntityRecord
1175
+ }
1176
+ >
1177
+ { isEntityAvailable && (
1178
+ <NavigationInnerBlocks
1179
+ clientId={ clientId }
1180
+ hasCustomPlaceholder={
1181
+ !! CustomPlaceholder
1182
+ }
1183
+ templateLock={ templateLock }
1184
+ orientation={ orientation }
1185
+ />
1186
+ ) }
1187
+ </ResponsiveWrapper>
1188
+ </>
1189
+ ) }
1190
+ </TagName>
1191
+ </RecursionProvider>
1192
+ </EntityProvider>
1193
+ </>
1190
1194
  );
1191
1195
  }
1192
1196
 
@@ -69,7 +69,8 @@ function NavigationMenuSelector( {
69
69
  const [ currentTitle ] = useEntityProp(
70
70
  'postType',
71
71
  'wp_navigation',
72
- 'title'
72
+ 'title',
73
+ currentMenuId
73
74
  );
74
75
 
75
76
  const menuChoices = useMemo( () => {
@@ -27,9 +27,6 @@ $navigation-icon-size: 24px;
27
27
  ul,
28
28
  ul li {
29
29
  list-style: none;
30
-
31
- // Overrides generic ".entry-content li" styles on the front end.
32
- padding: 0;
33
30
  }
34
31
 
35
32
  // Menu item container.
@@ -156,6 +153,11 @@ $navigation-icon-size: 24px;
156
153
  }
157
154
  }
158
155
 
156
+ // Low specificity padding to not override global styles.
157
+ :where(.wp-block-navigation) ul li {
158
+ padding: 0;
159
+ }
160
+
159
161
  // Styles for submenu flyout.
160
162
  // These are separated out with reduced specificity to allow better inheritance from Global Styles.
161
163
  .wp-block-navigation .has-child {