@wordpress/block-library 9.16.0 → 9.17.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 (215) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/archives/edit.js +2 -2
  3. package/build/archives/edit.js.map +1 -1
  4. package/build/categories/edit.js +115 -37
  5. package/build/categories/edit.js.map +1 -1
  6. package/build/comments/edit/comments-inspector-controls.js +6 -5
  7. package/build/comments/edit/comments-inspector-controls.js.map +1 -1
  8. package/build/comments-pagination/index.js +5 -0
  9. package/build/comments-pagination/index.js.map +1 -1
  10. package/build/cover/edit/inspector-controls.js +2 -9
  11. package/build/cover/edit/inspector-controls.js.map +1 -1
  12. package/build/details/edit.js +16 -2
  13. package/build/details/edit.js.map +1 -1
  14. package/build/details/index.js +9 -0
  15. package/build/details/index.js.map +1 -1
  16. package/build/details/save.js +2 -0
  17. package/build/details/save.js.map +1 -1
  18. package/build/embed/transforms.js +5 -2
  19. package/build/embed/transforms.js.map +1 -1
  20. package/build/form/variations.js +1 -1
  21. package/build/form/variations.js.map +1 -1
  22. package/build/group/edit.js +2 -9
  23. package/build/group/edit.js.map +1 -1
  24. package/build/home-link/edit.js +1 -2
  25. package/build/home-link/edit.js.map +1 -1
  26. package/build/latest-comments/edit.js +73 -26
  27. package/build/latest-comments/edit.js.map +1 -1
  28. package/build/latest-posts/constants.js +2 -1
  29. package/build/latest-posts/constants.js.map +1 -1
  30. package/build/latest-posts/edit.js +91 -38
  31. package/build/latest-posts/edit.js.map +1 -1
  32. package/build/list-item/index.js +1 -1
  33. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -4
  34. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  35. package/build/navigation/edit/use-generate-default-navigation-title.js +4 -4
  36. package/build/navigation/edit/use-generate-default-navigation-title.js.map +1 -1
  37. package/build/navigation-link/edit.js +14 -19
  38. package/build/navigation-link/edit.js.map +1 -1
  39. package/build/navigation-submenu/index.js +7 -0
  40. package/build/navigation-submenu/index.js.map +1 -1
  41. package/build/page-list/edit.js +1 -1
  42. package/build/page-list/edit.js.map +1 -1
  43. package/build/paragraph/edit.js +4 -14
  44. package/build/paragraph/edit.js.map +1 -1
  45. package/build/pattern/index.js +1 -1
  46. package/build/post-content/index.js +1 -0
  47. package/build/post-content/index.js.map +1 -1
  48. package/build/post-date/edit.js +1 -1
  49. package/build/post-date/edit.js.map +1 -1
  50. package/build/post-featured-image/edit.js +0 -6
  51. package/build/post-featured-image/edit.js.map +1 -1
  52. package/build/post-navigation-link/variations.js +2 -2
  53. package/build/post-navigation-link/variations.js.map +1 -1
  54. package/build/post-terms/edit.js +1 -0
  55. package/build/post-terms/edit.js.map +1 -1
  56. package/build/post-time-to-read/index.js +1 -1
  57. package/build/query/edit/query-content.js +2 -6
  58. package/build/query/edit/query-content.js.map +1 -1
  59. package/build/query-no-results/index.js +1 -1
  60. package/build/query-pagination-numbers/edit.js +1 -1
  61. package/build/query-pagination-numbers/edit.js.map +1 -1
  62. package/build/query-title/edit.js +1 -0
  63. package/build/query-title/edit.js.map +1 -1
  64. package/build/read-more/edit.js +25 -7
  65. package/build/read-more/edit.js.map +1 -1
  66. package/build/search/edit.js +67 -49
  67. package/build/search/edit.js.map +1 -1
  68. package/build/separator/edit.js +2 -4
  69. package/build/separator/edit.js.map +1 -1
  70. package/build/spacer/controls.js +13 -9
  71. package/build/spacer/controls.js.map +1 -1
  72. package/build/spacer/edit.js +23 -21
  73. package/build/spacer/edit.js.map +1 -1
  74. package/build/template-part/edit/advanced-controls.js +2 -9
  75. package/build/template-part/edit/advanced-controls.js.map +1 -1
  76. package/build/utils/messages.js +22 -0
  77. package/build/utils/messages.js.map +1 -0
  78. package/build/video/edit-common-settings.js +1 -1
  79. package/build/video/edit-common-settings.js.map +1 -1
  80. package/build-module/archives/edit.js +2 -2
  81. package/build-module/archives/edit.js.map +1 -1
  82. package/build-module/categories/edit.js +116 -38
  83. package/build-module/categories/edit.js.map +1 -1
  84. package/build-module/comments/edit/comments-inspector-controls.js +5 -4
  85. package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
  86. package/build-module/comments-pagination/index.js +5 -0
  87. package/build-module/comments-pagination/index.js.map +1 -1
  88. package/build-module/cover/edit/inspector-controls.js +1 -8
  89. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  90. package/build-module/details/edit.js +17 -3
  91. package/build-module/details/edit.js.map +1 -1
  92. package/build-module/details/index.js +9 -0
  93. package/build-module/details/index.js.map +1 -1
  94. package/build-module/details/save.js +2 -0
  95. package/build-module/details/save.js.map +1 -1
  96. package/build-module/embed/transforms.js +5 -2
  97. package/build-module/embed/transforms.js.map +1 -1
  98. package/build-module/form/variations.js +1 -1
  99. package/build-module/form/variations.js.map +1 -1
  100. package/build-module/group/edit.js +1 -8
  101. package/build-module/group/edit.js.map +1 -1
  102. package/build-module/home-link/edit.js +1 -2
  103. package/build-module/home-link/edit.js.map +1 -1
  104. package/build-module/latest-comments/edit.js +74 -27
  105. package/build-module/latest-comments/edit.js.map +1 -1
  106. package/build-module/latest-posts/constants.js +1 -0
  107. package/build-module/latest-posts/constants.js.map +1 -1
  108. package/build-module/latest-posts/edit.js +93 -40
  109. package/build-module/latest-posts/edit.js.map +1 -1
  110. package/build-module/list-item/index.js +1 -1
  111. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -4
  112. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  113. package/build-module/navigation/edit/use-generate-default-navigation-title.js +4 -4
  114. package/build-module/navigation/edit/use-generate-default-navigation-title.js.map +1 -1
  115. package/build-module/navigation-link/edit.js +15 -20
  116. package/build-module/navigation-link/edit.js.map +1 -1
  117. package/build-module/navigation-submenu/index.js +7 -0
  118. package/build-module/navigation-submenu/index.js.map +1 -1
  119. package/build-module/page-list/edit.js +1 -1
  120. package/build-module/page-list/edit.js.map +1 -1
  121. package/build-module/paragraph/edit.js +5 -15
  122. package/build-module/paragraph/edit.js.map +1 -1
  123. package/build-module/pattern/index.js +1 -1
  124. package/build-module/post-content/index.js +1 -0
  125. package/build-module/post-content/index.js.map +1 -1
  126. package/build-module/post-date/edit.js +1 -1
  127. package/build-module/post-date/edit.js.map +1 -1
  128. package/build-module/post-featured-image/edit.js +0 -6
  129. package/build-module/post-featured-image/edit.js.map +1 -1
  130. package/build-module/post-navigation-link/variations.js +2 -2
  131. package/build-module/post-navigation-link/variations.js.map +1 -1
  132. package/build-module/post-terms/edit.js +1 -0
  133. package/build-module/post-terms/edit.js.map +1 -1
  134. package/build-module/post-time-to-read/index.js +1 -1
  135. package/build-module/query/edit/query-content.js +1 -5
  136. package/build-module/query/edit/query-content.js.map +1 -1
  137. package/build-module/query-no-results/index.js +1 -1
  138. package/build-module/query-pagination-numbers/edit.js +1 -1
  139. package/build-module/query-pagination-numbers/edit.js.map +1 -1
  140. package/build-module/query-title/edit.js +1 -0
  141. package/build-module/query-title/edit.js.map +1 -1
  142. package/build-module/read-more/edit.js +26 -8
  143. package/build-module/read-more/edit.js.map +1 -1
  144. package/build-module/search/edit.js +68 -50
  145. package/build-module/search/edit.js.map +1 -1
  146. package/build-module/separator/edit.js +1 -3
  147. package/build-module/separator/edit.js.map +1 -1
  148. package/build-module/spacer/controls.js +13 -9
  149. package/build-module/spacer/controls.js.map +1 -1
  150. package/build-module/spacer/edit.js +24 -22
  151. package/build-module/spacer/edit.js.map +1 -1
  152. package/build-module/template-part/edit/advanced-controls.js +1 -8
  153. package/build-module/template-part/edit/advanced-controls.js.map +1 -1
  154. package/build-module/utils/messages.js +15 -0
  155. package/build-module/utils/messages.js.map +1 -0
  156. package/build-module/video/edit-common-settings.js +1 -1
  157. package/build-module/video/edit-common-settings.js.map +1 -1
  158. package/build-style/editor-rtl.css +8 -45
  159. package/build-style/editor.css +8 -45
  160. package/build-style/gallery/editor-rtl.css +0 -44
  161. package/build-style/gallery/editor.css +0 -44
  162. package/build-style/navigation-link/editor-rtl.css +3 -0
  163. package/build-style/navigation-link/editor.css +3 -0
  164. package/build-style/paragraph/editor-rtl.css +4 -0
  165. package/build-style/paragraph/editor.css +4 -0
  166. package/build-style/post-featured-image/editor-rtl.css +1 -1
  167. package/build-style/post-featured-image/editor.css +1 -1
  168. package/package.json +35 -35
  169. package/src/archives/edit.js +2 -2
  170. package/src/categories/edit.js +133 -45
  171. package/src/comments/edit/comments-inspector-controls.js +5 -8
  172. package/src/comments-pagination/block.json +5 -0
  173. package/src/cover/edit/inspector-controls.js +1 -21
  174. package/src/details/block.json +9 -0
  175. package/src/details/edit.js +18 -2
  176. package/src/details/save.js +6 -2
  177. package/src/embed/transforms.js +3 -1
  178. package/src/form/variations.js +1 -1
  179. package/src/gallery/editor.scss +0 -56
  180. package/src/group/edit.js +1 -20
  181. package/src/home-link/edit.js +0 -6
  182. package/src/latest-comments/edit.js +93 -33
  183. package/src/latest-posts/constants.js +1 -0
  184. package/src/latest-posts/edit.js +119 -44
  185. package/src/list/test/edit.native.js +9 -9
  186. package/src/list-item/block.json +1 -1
  187. package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -4
  188. package/src/navigation/edit/use-generate-default-navigation-title.js +4 -4
  189. package/src/navigation-link/edit.js +25 -29
  190. package/src/navigation-link/editor.scss +27 -18
  191. package/src/navigation-submenu/index.js +7 -0
  192. package/src/navigation-submenu/index.php +21 -4
  193. package/src/page-list/edit.js +52 -50
  194. package/src/paragraph/edit.js +3 -18
  195. package/src/paragraph/editor.scss +7 -0
  196. package/src/pattern/block.json +1 -1
  197. package/src/post-content/block.json +1 -0
  198. package/src/post-date/edit.js +1 -3
  199. package/src/post-featured-image/edit.js +2 -15
  200. package/src/post-featured-image/editor.scss +2 -2
  201. package/src/post-navigation-link/variations.js +2 -2
  202. package/src/post-terms/edit.js +1 -0
  203. package/src/post-time-to-read/block.json +1 -1
  204. package/src/query/edit/query-content.js +1 -11
  205. package/src/query-no-results/block.json +1 -1
  206. package/src/query-pagination-numbers/edit.js +1 -1
  207. package/src/query-title/edit.js +1 -0
  208. package/src/read-more/edit.js +35 -11
  209. package/src/search/edit.js +99 -74
  210. package/src/separator/edit.js +1 -6
  211. package/src/spacer/controls.js +10 -9
  212. package/src/spacer/edit.js +25 -23
  213. package/src/template-part/edit/advanced-controls.js +1 -21
  214. package/src/utils/messages.js +31 -0
  215. package/src/video/edit-common-settings.js +1 -1
@@ -80,24 +80,33 @@
80
80
  background-image: none !important;
81
81
 
82
82
  // Draw a wavy underline.
83
- .wp-block-navigation-link__placeholder-text span {
84
- $blur: 10%;
85
- $width: 6%;
86
- $stop1: 30%;
87
- $stop2: 64%;
88
-
89
- --wp-underline-color: var(--wp-admin-theme-color);
90
-
91
- background-image:
92
- linear-gradient(45deg, transparent ($stop1 - $blur), var(--wp-underline-color) $stop1, var(--wp-underline-color) ($stop1 + $width), transparent ($stop1 + $width + $blur)),
93
- linear-gradient(135deg, transparent ($stop2 - $blur), var(--wp-underline-color) $stop2, var(--wp-underline-color) ($stop2 + $width), transparent ($stop2 + $width + $blur));
94
- background-position: 0 100%;
95
- background-size: 6px 3px;
96
- background-repeat: repeat-x;
97
-
98
- // Since applied to a span, it doesn't change the footprint of the item,
99
- // but it does vertically shift the underline to better align.
100
- padding-bottom: 0.1em;
83
+ .wp-block-navigation-link__placeholder-text {
84
+ span {
85
+ $blur: 10%;
86
+ $width: 6%;
87
+ $stop1: 30%;
88
+ $stop2: 64%;
89
+
90
+ --wp-underline-color: var(--wp-admin-theme-color);
91
+
92
+ background-image:
93
+ linear-gradient(45deg, transparent ($stop1 - $blur), var(--wp-underline-color) $stop1, var(--wp-underline-color) ($stop1 + $width), transparent ($stop1 + $width + $blur)),
94
+ linear-gradient(135deg, transparent ($stop2 - $blur), var(--wp-underline-color) $stop2, var(--wp-underline-color) ($stop2 + $width), transparent ($stop2 + $width + $blur));
95
+ background-position: 0 100%;
96
+ background-size: 6px 3px;
97
+ background-repeat: repeat-x;
98
+
99
+ // Since applied to a span, it doesn't change the footprint of the item,
100
+ // but it does vertically shift the underline to better align.
101
+ padding-bottom: 0.1em;
102
+ }
103
+
104
+ &.is-invalid,
105
+ &.is-draft {
106
+ span {
107
+ --wp-underline-color: var(--wp--preset--color--vivid-red);
108
+ }
109
+ }
101
110
  }
102
111
 
103
112
  // This needs extra specificity.
@@ -2,6 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { page, addSubmenu } from '@wordpress/icons';
5
+ import { _x } from '@wordpress/i18n';
5
6
 
6
7
  /**
7
8
  * Internal dependencies
@@ -37,6 +38,12 @@ export const settings = {
37
38
  return label;
38
39
  },
39
40
  edit,
41
+ example: {
42
+ attributes: {
43
+ label: _x( 'About', 'Example link text for Navigation Submenu' ),
44
+ type: 'page',
45
+ },
46
+ },
40
47
  save,
41
48
  transforms,
42
49
  };
@@ -82,7 +82,6 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
82
82
  $font_sizes = block_core_navigation_submenu_build_css_font_sizes( $block->context );
83
83
  $style_attribute = $font_sizes['inline_styles'];
84
84
 
85
- $css_classes = trim( implode( ' ', $font_sizes['css_classes'] ) );
86
85
  $has_submenu = count( $block->inner_blocks ) > 0;
87
86
  $kind = empty( $attributes['kind'] ) ? 'post_type' : str_replace( '-', '_', $attributes['kind'] );
88
87
  $is_active = ! empty( $attributes['id'] ) && get_queried_object_id() === (int) $attributes['id'] && ! empty( get_queried_object()->$kind );
@@ -99,11 +98,29 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
99
98
  $open_on_hover_and_click = isset( $block->context['openSubmenusOnClick'] ) && ! $block->context['openSubmenusOnClick'] &&
100
99
  $show_submenu_indicators;
101
100
 
101
+ $classes = array(
102
+ 'wp-block-navigation-item',
103
+ );
104
+ $classes = array_merge(
105
+ $classes,
106
+ $font_sizes['css_classes']
107
+ );
108
+ if ( $has_submenu ) {
109
+ $classes[] = 'has-child';
110
+ }
111
+ if ( $open_on_click ) {
112
+ $classes[] = 'open-on-click';
113
+ }
114
+ if ( $open_on_hover_and_click ) {
115
+ $classes[] = 'open-on-hover-click';
116
+ }
117
+ if ( $is_active ) {
118
+ $classes[] = 'current-menu-item';
119
+ }
120
+
102
121
  $wrapper_attributes = get_block_wrapper_attributes(
103
122
  array(
104
- 'class' => $css_classes . ' wp-block-navigation-item' . ( $has_submenu ? ' has-child' : '' ) .
105
- ( $open_on_click ? ' open-on-click' : '' ) . ( $open_on_hover_and_click ? ' open-on-hover-click' : '' ) .
106
- ( $is_active ? ' current-menu-item' : '' ),
123
+ 'class' => implode( ' ', $classes ),
107
124
  'style' => $style_attribute,
108
125
  )
109
126
  );
@@ -322,58 +322,60 @@ export default function PageListEdit( {
322
322
 
323
323
  return (
324
324
  <>
325
- <InspectorControls>
326
- <ToolsPanel
327
- label={ __( 'Settings' ) }
328
- resetAll={ () => {
329
- setAttributes( { parentPageID: 0 } );
330
- } }
331
- dropdownMenuProps={ dropdownMenuProps }
332
- >
333
- { pagesTree.length > 0 && (
334
- <ToolsPanelItem
335
- label={ __( 'Parent Page' ) }
336
- hasValue={ () => parentPageID !== 0 }
337
- onDeselect={ () =>
338
- setAttributes( { parentPageID: 0 } )
339
- }
340
- isShownByDefault
341
- >
342
- <ComboboxControl
343
- __nextHasNoMarginBottom
344
- __next40pxDefaultSize
345
- className="editor-page-attributes__parent"
346
- label={ __( 'Parent' ) }
347
- value={ parentPageID }
348
- options={ pagesTree }
349
- onChange={ ( value ) =>
350
- setAttributes( {
351
- parentPageID: value ?? 0,
352
- } )
325
+ { ( pagesTree.length > 0 || allowConvertToLinks ) && (
326
+ <InspectorControls>
327
+ <ToolsPanel
328
+ label={ __( 'Settings' ) }
329
+ resetAll={ () => {
330
+ setAttributes( { parentPageID: 0 } );
331
+ } }
332
+ dropdownMenuProps={ dropdownMenuProps }
333
+ >
334
+ { pagesTree.length > 0 && (
335
+ <ToolsPanelItem
336
+ label={ __( 'Parent Page' ) }
337
+ hasValue={ () => parentPageID !== 0 }
338
+ onDeselect={ () =>
339
+ setAttributes( { parentPageID: 0 } )
353
340
  }
354
- help={ __(
355
- 'Choose a page to show only its subpages.'
356
- ) }
357
- />
358
- </ToolsPanelItem>
359
- ) }
360
-
361
- { allowConvertToLinks && (
362
- <div style={ { gridColumn: '1 / -1' } }>
363
- <p>{ convertDescription }</p>
364
- <Button
365
- __next40pxDefaultSize
366
- variant="primary"
367
- accessibleWhenDisabled
368
- disabled={ ! hasResolvedPages }
369
- onClick={ convertToNavigationLinks }
341
+ isShownByDefault
370
342
  >
371
- { __( 'Edit' ) }
372
- </Button>
373
- </div>
374
- ) }
375
- </ToolsPanel>
376
- </InspectorControls>
343
+ <ComboboxControl
344
+ __nextHasNoMarginBottom
345
+ __next40pxDefaultSize
346
+ className="editor-page-attributes__parent"
347
+ label={ __( 'Parent' ) }
348
+ value={ parentPageID }
349
+ options={ pagesTree }
350
+ onChange={ ( value ) =>
351
+ setAttributes( {
352
+ parentPageID: value ?? 0,
353
+ } )
354
+ }
355
+ help={ __(
356
+ 'Choose a page to show only its subpages.'
357
+ ) }
358
+ />
359
+ </ToolsPanelItem>
360
+ ) }
361
+
362
+ { allowConvertToLinks && (
363
+ <div style={ { gridColumn: '1 / -1' } }>
364
+ <p>{ convertDescription }</p>
365
+ <Button
366
+ __next40pxDefaultSize
367
+ variant="primary"
368
+ accessibleWhenDisabled
369
+ disabled={ ! hasResolvedPages }
370
+ onClick={ convertToNavigationLinks }
371
+ >
372
+ { __( 'Edit' ) }
373
+ </Button>
374
+ </div>
375
+ ) }
376
+ </ToolsPanel>
377
+ </InspectorControls>
378
+ ) }
377
379
  { allowConvertToLinks && (
378
380
  <>
379
381
  <BlockControls group="other">
@@ -20,16 +20,13 @@ import {
20
20
  useBlockProps,
21
21
  useSettings,
22
22
  useBlockEditingMode,
23
- store as blockEditorStore,
24
23
  } from '@wordpress/block-editor';
25
- import { useSelect } from '@wordpress/data';
26
24
  import { getBlockSupport } from '@wordpress/blocks';
27
25
  import { formatLtr } from '@wordpress/icons';
28
26
  /**
29
27
  * Internal dependencies
30
28
  */
31
29
  import { useOnEnter } from './use-enter';
32
- import { unlock } from '../lock-unlock';
33
30
 
34
31
  function ParagraphRTLControl( { direction, setDirection } ) {
35
32
  return (
@@ -111,11 +108,7 @@ function ParagraphBlock( {
111
108
  isSelected: isSingleSelected,
112
109
  name,
113
110
  } ) {
114
- const isZoomOut = useSelect( ( select ) =>
115
- unlock( select( blockEditorStore ) ).isZoomOut()
116
- );
117
-
118
- const { align, content, direction, dropCap } = attributes;
111
+ const { align, content, direction, dropCap, placeholder } = attributes;
119
112
  const blockProps = useBlockProps( {
120
113
  ref: useOnEnter( { clientId, content } ),
121
114
  className: clsx( {
@@ -125,12 +118,6 @@ function ParagraphBlock( {
125
118
  style: { direction },
126
119
  } );
127
120
  const blockEditingMode = useBlockEditingMode();
128
- let { placeholder } = attributes;
129
- if ( isZoomOut ) {
130
- placeholder = '';
131
- } else if ( ! placeholder ) {
132
- placeholder = __( 'Type / to choose a block' );
133
- }
134
121
 
135
122
  return (
136
123
  <>
@@ -182,10 +169,8 @@ function ParagraphBlock( {
182
169
  : __( 'Block: Paragraph' )
183
170
  }
184
171
  data-empty={ RichText.isEmpty( content ) }
185
- placeholder={ placeholder }
186
- data-custom-placeholder={
187
- placeholder && ! isZoomOut ? true : undefined
188
- }
172
+ placeholder={ placeholder || __( 'Type / to choose a block' ) }
173
+ data-custom-placeholder={ placeholder ? true : undefined }
189
174
  __unstableEmbedURLOnPaste
190
175
  __unstableAllowPrefixTransformations
191
176
  />
@@ -22,3 +22,10 @@
22
22
  .block-editor-block-list__block[data-type="core/paragraph"].has-text-align-left[style*="writing-mode: vertical-lr"] {
23
23
  rotate: 180deg;
24
24
  }
25
+
26
+ // Hide the placeholder when the editor is in zoomed out mode.
27
+ .is-zoomed-out .block-editor-block-list__block[data-empty="true"] {
28
+ [data-rich-text-placeholder] {
29
+ opacity: 0;
30
+ }
31
+ }
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
3
  "apiVersion": 3,
4
4
  "name": "core/pattern",
5
- "title": "Pattern placeholder",
5
+ "title": "Pattern Placeholder",
6
6
  "category": "theme",
7
7
  "description": "Show a block pattern.",
8
8
  "supports": {
@@ -35,6 +35,7 @@
35
35
  },
36
36
  "color": {
37
37
  "gradients": true,
38
+ "heading": true,
38
39
  "link": true,
39
40
  "__experimentalDefaultControls": {
40
41
  "background": false,
@@ -179,9 +179,7 @@ export default function PostDateEdit( {
179
179
  dropdownMenuProps={ dropdownMenuProps }
180
180
  >
181
181
  <ToolsPanelItem
182
- hasValue={ () =>
183
- format !== undefined && format !== siteFormat
184
- }
182
+ hasValue={ () => !! format }
185
183
  label={ __( 'Date Format' ) }
186
184
  onDeselect={ () =>
187
185
  setAttributes( { format: undefined } )
@@ -49,11 +49,6 @@ function getMediaSourceUrlBySizeSlug( media, slug ) {
49
49
  );
50
50
  }
51
51
 
52
- const disabledClickProps = {
53
- onClick: ( event ) => event.preventDefault(),
54
- 'aria-disabled': true,
55
- };
56
-
57
52
  export default function PostFeaturedImageEdit( {
58
53
  clientId,
59
54
  attributes,
@@ -318,11 +313,7 @@ export default function PostFeaturedImageEdit( {
318
313
  { controls }
319
314
  <div { ...blockProps }>
320
315
  { !! isLink ? (
321
- <a
322
- href={ postPermalink }
323
- target={ linkTarget }
324
- { ...disabledClickProps }
325
- >
316
+ <a href={ postPermalink } target={ linkTarget }>
326
317
  { placeholder() }
327
318
  </a>
328
319
  ) : (
@@ -430,11 +421,7 @@ export default function PostFeaturedImageEdit( {
430
421
  <figure { ...blockProps }>
431
422
  { /* If the featured image is linked, wrap in an <a /> tag to trigger any inherited link element styles */ }
432
423
  { !! isLink ? (
433
- <a
434
- href={ postPermalink }
435
- target={ linkTarget }
436
- { ...disabledClickProps }
437
- >
424
+ <a href={ postPermalink } target={ linkTarget }>
438
425
  { image }
439
426
  </a>
440
427
  ) : (
@@ -100,9 +100,9 @@
100
100
 
101
101
  // When the Post Featured Image block is linked,
102
102
  // it's wrapped with a disabled <a /> tag.
103
- // Restore cursor style so it doesn't appear 'clickable'.
103
+ // Ensure that the link is not clickable.
104
104
  > a {
105
- cursor: default;
105
+ pointer-events: none;
106
106
  }
107
107
 
108
108
  // When the Post Featured Image block is linked,
@@ -8,7 +8,7 @@ const variations = [
8
8
  {
9
9
  isDefault: true,
10
10
  name: 'post-next',
11
- title: __( 'Next post' ),
11
+ title: __( 'Next Post' ),
12
12
  description: __(
13
13
  'Displays the post link that follows the current post.'
14
14
  ),
@@ -24,7 +24,7 @@ const variations = [
24
24
  },
25
25
  {
26
26
  name: 'post-previous',
27
- title: __( 'Previous post' ),
27
+ title: __( 'Previous Post' ),
28
28
  description: __(
29
29
  'Displays the post link that precedes the current post.'
30
30
  ),
@@ -122,6 +122,7 @@ export default function PostTermsEdit( {
122
122
  key={ postTerm.id }
123
123
  href={ postTerm.link }
124
124
  onClick={ ( event ) => event.preventDefault() }
125
+ rel="tag"
125
126
  >
126
127
  { decodeEntities( postTerm.name ) }
127
128
  </a>
@@ -3,7 +3,7 @@
3
3
  "apiVersion": 3,
4
4
  "__experimental": true,
5
5
  "name": "core/post-time-to-read",
6
- "title": "Time To Read",
6
+ "title": "Time to Read",
7
7
  "category": "theme",
8
8
  "description": "Show minutes required to finish reading the post.",
9
9
  "textdomain": "default",
@@ -23,6 +23,7 @@ import QueryInspectorControls from './inspector-controls';
23
23
  import EnhancedPaginationModal from './enhanced-pagination-modal';
24
24
  import { getQueryContextFromTemplate } from '../utils';
25
25
  import QueryToolbar from './query-toolbar';
26
+ import { htmlElementMessages } from '../../utils/messages';
26
27
 
27
28
  const DEFAULTS_POSTS_PER_PAGE = 3;
28
29
 
@@ -132,17 +133,6 @@ export default function QueryContent( {
132
133
  setAttributes( {
133
134
  displayLayout: { ...displayLayout, ...newDisplayLayout },
134
135
  } );
135
- const htmlElementMessages = {
136
- main: __(
137
- 'The <main> element should be used for the primary content of your document only.'
138
- ),
139
- section: __(
140
- "The <section> element should represent a standalone portion of the document that can't be better represented by another element."
141
- ),
142
- aside: __(
143
- "The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."
144
- ),
145
- };
146
136
 
147
137
  return (
148
138
  <>
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
3
  "apiVersion": 3,
4
4
  "name": "core/query-no-results",
5
- "title": "No results",
5
+ "title": "No Results",
6
6
  "category": "theme",
7
7
  "description": "Contains the block elements used to render content when no query results are found.",
8
8
  "ancestor": [ "core/query" ],
@@ -67,7 +67,7 @@ export default function QueryPaginationNumbersEdit( {
67
67
  >
68
68
  <ToolsPanelItem
69
69
  label={ __( 'Number of links' ) }
70
- hasValue={ () => midSize !== undefined }
70
+ hasValue={ () => midSize !== 2 }
71
71
  onDeselect={ () => setAttributes( { midSize: 2 } ) }
72
72
  isShownByDefault
73
73
  >
@@ -141,6 +141,7 @@ export default function QueryTitleEdit( {
141
141
  showSearchTerm: true,
142
142
  } )
143
143
  }
144
+ dropdownMenuProps={ dropdownMenuProps }
144
145
  >
145
146
  <ToolsPanelItem
146
147
  hasValue={ () => ! showSearchTerm }
@@ -6,31 +6,55 @@ import {
6
6
  RichText,
7
7
  useBlockProps,
8
8
  } from '@wordpress/block-editor';
9
- import { ToggleControl, PanelBody } from '@wordpress/components';
9
+ import {
10
+ ToggleControl,
11
+ __experimentalToolsPanel as ToolsPanel,
12
+ __experimentalToolsPanelItem as ToolsPanelItem,
13
+ } from '@wordpress/components';
10
14
  import { createBlock, getDefaultBlockName } from '@wordpress/blocks';
11
15
  import { __ } from '@wordpress/i18n';
12
16
 
17
+ /**
18
+ * Internal dependencies
19
+ */
20
+ import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
21
+
13
22
  export default function ReadMore( {
14
23
  attributes: { content, linkTarget },
15
24
  setAttributes,
16
25
  insertBlocksAfter,
17
26
  } ) {
18
27
  const blockProps = useBlockProps();
28
+ const dropdownMenuProps = useToolsPanelDropdownMenuProps();
29
+
19
30
  return (
20
31
  <>
21
32
  <InspectorControls>
22
- <PanelBody title={ __( 'Settings' ) }>
23
- <ToggleControl
24
- __nextHasNoMarginBottom
33
+ <ToolsPanel
34
+ label={ __( 'Settings' ) }
35
+ resetAll={ () => setAttributes( { linkTarget: '_self' } ) }
36
+ dropdownMenuProps={ dropdownMenuProps }
37
+ >
38
+ <ToolsPanelItem
25
39
  label={ __( 'Open in new tab' ) }
26
- onChange={ ( value ) =>
27
- setAttributes( {
28
- linkTarget: value ? '_blank' : '_self',
29
- } )
40
+ isShownByDefault
41
+ hasValue={ () => linkTarget !== '_self' }
42
+ onDeselect={ () =>
43
+ setAttributes( { linkTarget: '_self' } )
30
44
  }
31
- checked={ linkTarget === '_blank' }
32
- />
33
- </PanelBody>
45
+ >
46
+ <ToggleControl
47
+ __nextHasNoMarginBottom
48
+ label={ __( 'Open in new tab' ) }
49
+ onChange={ ( value ) =>
50
+ setAttributes( {
51
+ linkTarget: value ? '_blank' : '_self',
52
+ } )
53
+ }
54
+ checked={ linkTarget === '_blank' }
55
+ />
56
+ </ToolsPanelItem>
57
+ </ToolsPanel>
34
58
  </InspectorControls>
35
59
  <RichText
36
60
  identifier="content"