@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
@@ -163,6 +163,9 @@
163
163
  background-repeat: repeat-x;
164
164
  padding-bottom: 0.1em;
165
165
  }
166
+ .wp-block-navigation-link__placeholder .wp-block-navigation-link__placeholder-text.is-invalid span, .wp-block-navigation-link__placeholder .wp-block-navigation-link__placeholder-text.is-draft span {
167
+ --wp-underline-color: var(--wp--preset--color--vivid-red);
168
+ }
166
169
  .wp-block-navigation-link__placeholder.wp-block-navigation-item__content {
167
170
  cursor: pointer;
168
171
  }
@@ -113,4 +113,8 @@
113
113
  .block-editor-block-list__block[data-type="core/paragraph"].has-text-align-right[style*="writing-mode: vertical-rl"],
114
114
  .block-editor-block-list__block[data-type="core/paragraph"].has-text-align-left[style*="writing-mode: vertical-lr"] {
115
115
  rotate: 180deg;
116
+ }
117
+
118
+ .is-zoomed-out .block-editor-block-list__block[data-empty=true] [data-rich-text-placeholder] {
119
+ opacity: 0;
116
120
  }
@@ -113,4 +113,8 @@
113
113
  .block-editor-block-list__block[data-type="core/paragraph"].has-text-align-right[style*="writing-mode: vertical-rl"],
114
114
  .block-editor-block-list__block[data-type="core/paragraph"].has-text-align-left[style*="writing-mode: vertical-lr"] {
115
115
  rotate: 180deg;
116
+ }
117
+
118
+ .is-zoomed-out .block-editor-block-list__block[data-empty=true] [data-rich-text-placeholder] {
119
+ opacity: 0;
116
120
  }
@@ -192,7 +192,7 @@
192
192
  width: 100%;
193
193
  }
194
194
  .wp-block-post-featured-image > a {
195
- cursor: default;
195
+ pointer-events: none;
196
196
  }
197
197
  .wp-block-post-featured-image.is-selected .components-placeholder.has-illustration .components-button,
198
198
  .wp-block-post-featured-image.is-selected .components-placeholder.has-illustration .components-placeholder__instructions,
@@ -192,7 +192,7 @@
192
192
  width: 100%;
193
193
  }
194
194
  .wp-block-post-featured-image > a {
195
- cursor: default;
195
+ pointer-events: none;
196
196
  }
197
197
  .wp-block-post-featured-image.is-selected .components-placeholder.has-illustration .components-button,
198
198
  .wp-block-post-featured-image.is-selected .components-placeholder.has-illustration .components-placeholder__instructions,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "9.16.0",
3
+ "version": "9.17.0",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -41,39 +41,39 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "@babel/runtime": "7.25.7",
44
- "@wordpress/a11y": "^4.16.0",
45
- "@wordpress/api-fetch": "^7.16.0",
46
- "@wordpress/autop": "^4.16.0",
47
- "@wordpress/blob": "^4.16.0",
48
- "@wordpress/block-editor": "^14.11.0",
49
- "@wordpress/blocks": "^14.5.0",
50
- "@wordpress/components": "^29.2.0",
51
- "@wordpress/compose": "^7.16.0",
52
- "@wordpress/core-data": "^7.16.0",
53
- "@wordpress/data": "^10.16.0",
54
- "@wordpress/date": "^5.16.0",
55
- "@wordpress/deprecated": "^4.16.0",
56
- "@wordpress/dom": "^4.16.0",
57
- "@wordpress/element": "^6.16.0",
58
- "@wordpress/escape-html": "^3.16.0",
59
- "@wordpress/hooks": "^4.16.0",
60
- "@wordpress/html-entities": "^4.16.0",
61
- "@wordpress/i18n": "^5.16.0",
62
- "@wordpress/icons": "^10.16.0",
63
- "@wordpress/interactivity": "^6.16.0",
64
- "@wordpress/interactivity-router": "^2.16.0",
65
- "@wordpress/keyboard-shortcuts": "^5.16.0",
66
- "@wordpress/keycodes": "^4.16.0",
67
- "@wordpress/notices": "^5.16.0",
68
- "@wordpress/patterns": "^2.16.0",
69
- "@wordpress/primitives": "^4.16.0",
70
- "@wordpress/private-apis": "^1.16.0",
71
- "@wordpress/reusable-blocks": "^5.16.0",
72
- "@wordpress/rich-text": "^7.16.0",
73
- "@wordpress/server-side-render": "^5.16.0",
74
- "@wordpress/url": "^4.16.0",
75
- "@wordpress/viewport": "^6.16.0",
76
- "@wordpress/wordcount": "^4.16.0",
44
+ "@wordpress/a11y": "^4.17.0",
45
+ "@wordpress/api-fetch": "^7.17.0",
46
+ "@wordpress/autop": "^4.17.0",
47
+ "@wordpress/blob": "^4.17.0",
48
+ "@wordpress/block-editor": "^14.12.0",
49
+ "@wordpress/blocks": "^14.6.0",
50
+ "@wordpress/components": "^29.3.0",
51
+ "@wordpress/compose": "^7.17.0",
52
+ "@wordpress/core-data": "^7.17.0",
53
+ "@wordpress/data": "^10.17.0",
54
+ "@wordpress/date": "^5.17.0",
55
+ "@wordpress/deprecated": "^4.17.0",
56
+ "@wordpress/dom": "^4.17.0",
57
+ "@wordpress/element": "^6.17.0",
58
+ "@wordpress/escape-html": "^3.17.0",
59
+ "@wordpress/hooks": "^4.17.0",
60
+ "@wordpress/html-entities": "^4.17.0",
61
+ "@wordpress/i18n": "^5.17.0",
62
+ "@wordpress/icons": "^10.17.0",
63
+ "@wordpress/interactivity": "^6.17.0",
64
+ "@wordpress/interactivity-router": "^2.17.0",
65
+ "@wordpress/keyboard-shortcuts": "^5.17.0",
66
+ "@wordpress/keycodes": "^4.17.0",
67
+ "@wordpress/notices": "^5.17.0",
68
+ "@wordpress/patterns": "^2.17.0",
69
+ "@wordpress/primitives": "^4.17.0",
70
+ "@wordpress/private-apis": "^1.17.0",
71
+ "@wordpress/reusable-blocks": "^5.17.0",
72
+ "@wordpress/rich-text": "^7.17.0",
73
+ "@wordpress/server-side-render": "^5.17.0",
74
+ "@wordpress/url": "^4.17.0",
75
+ "@wordpress/viewport": "^6.17.0",
76
+ "@wordpress/wordcount": "^4.17.0",
77
77
  "change-case": "^4.1.2",
78
78
  "clsx": "^2.1.1",
79
79
  "colord": "^2.7.0",
@@ -91,5 +91,5 @@
91
91
  "publishConfig": {
92
92
  "access": "public"
93
93
  },
94
- "gitHead": "f48b9f56629e400891abb5ae491504de475237ff"
94
+ "gitHead": "68a831c3178197fe87db284d4b94e5743bfb6b6c"
95
95
  }
@@ -61,7 +61,7 @@ export default function ArchivesEdit( { attributes, setAttributes } ) {
61
61
  <ToolsPanelItem
62
62
  label={ __( 'Show label' ) }
63
63
  isShownByDefault
64
- hasValue={ () => showLabel }
64
+ hasValue={ () => ! showLabel }
65
65
  onDeselect={ () =>
66
66
  setAttributes( { showLabel: false } )
67
67
  }
@@ -102,7 +102,7 @@ export default function ArchivesEdit( { attributes, setAttributes } ) {
102
102
  <ToolsPanelItem
103
103
  label={ __( 'Group by' ) }
104
104
  isShownByDefault
105
- hasValue={ () => !! type }
105
+ hasValue={ () => type !== 'monthly' }
106
106
  onDeselect={ () =>
107
107
  setAttributes( { type: 'monthly' } )
108
108
  }
@@ -7,12 +7,13 @@ import clsx from 'clsx';
7
7
  * WordPress dependencies
8
8
  */
9
9
  import {
10
- PanelBody,
11
10
  Placeholder,
12
11
  SelectControl,
13
12
  Spinner,
14
13
  ToggleControl,
15
14
  VisuallyHidden,
15
+ __experimentalToolsPanel as ToolsPanel,
16
+ __experimentalToolsPanelItem as ToolsPanelItem,
16
17
  } from '@wordpress/components';
17
18
  import { useInstanceId } from '@wordpress/compose';
18
19
  import {
@@ -25,6 +26,11 @@ import { __, sprintf } from '@wordpress/i18n';
25
26
  import { pin } from '@wordpress/icons';
26
27
  import { useEntityRecords } from '@wordpress/core-data';
27
28
 
29
+ /**
30
+ * Internal dependencies
31
+ */
32
+ import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
33
+
28
34
  export default function CategoriesEdit( {
29
35
  attributes: {
30
36
  displayAsDropdown,
@@ -180,72 +186,154 @@ export default function CategoriesEdit( {
180
186
  const blockProps = useBlockProps( {
181
187
  className: classes,
182
188
  } );
189
+ const dropdownMenuProps = useToolsPanelDropdownMenuProps();
183
190
 
184
191
  return (
185
192
  <TagName { ...blockProps }>
186
193
  <InspectorControls>
187
- <PanelBody title={ __( 'Settings' ) }>
194
+ <ToolsPanel
195
+ label={ __( 'Settings' ) }
196
+ resetAll={ () => {
197
+ setAttributes( {
198
+ taxonomy: 'category',
199
+ displayAsDropdown: false,
200
+ showHierarchy: false,
201
+ showPostCounts: false,
202
+ showOnlyTopLevel: false,
203
+ showEmpty: false,
204
+ showLabel: true,
205
+ } );
206
+ } }
207
+ dropdownMenuProps={ dropdownMenuProps }
208
+ >
188
209
  { Array.isArray( taxonomies ) && (
189
- <SelectControl
190
- __nextHasNoMarginBottom
191
- __next40pxDefaultSize
210
+ <ToolsPanelItem
211
+ hasValue={ () => {
212
+ return taxonomySlug !== 'category';
213
+ } }
192
214
  label={ __( 'Taxonomy' ) }
193
- options={ taxonomies.map( ( t ) => ( {
194
- label: t.name,
195
- value: t.slug,
196
- } ) ) }
197
- value={ taxonomySlug }
198
- onChange={ ( selectedTaxonomy ) =>
199
- setAttributes( {
200
- taxonomy: selectedTaxonomy,
201
- } )
202
- }
203
- />
215
+ onDeselect={ () => {
216
+ setAttributes( { taxonomy: 'category' } );
217
+ } }
218
+ isShownByDefault
219
+ >
220
+ <SelectControl
221
+ __nextHasNoMarginBottom
222
+ __next40pxDefaultSize
223
+ label={ __( 'Taxonomy' ) }
224
+ options={ taxonomies.map( ( t ) => ( {
225
+ label: t.name,
226
+ value: t.slug,
227
+ } ) ) }
228
+ value={ taxonomySlug }
229
+ onChange={ ( selectedTaxonomy ) =>
230
+ setAttributes( {
231
+ taxonomy: selectedTaxonomy,
232
+ } )
233
+ }
234
+ />
235
+ </ToolsPanelItem>
204
236
  ) }
205
- <ToggleControl
206
- __nextHasNoMarginBottom
237
+ <ToolsPanelItem
238
+ hasValue={ () => !! displayAsDropdown }
207
239
  label={ __( 'Display as dropdown' ) }
208
- checked={ displayAsDropdown }
209
- onChange={ toggleAttribute( 'displayAsDropdown' ) }
210
- />
211
- { displayAsDropdown && (
240
+ onDeselect={ () =>
241
+ setAttributes( { displayAsDropdown: false } )
242
+ }
243
+ isShownByDefault
244
+ >
212
245
  <ToggleControl
213
246
  __nextHasNoMarginBottom
214
- className="wp-block-categories__indentation"
215
- label={ __( 'Show label' ) }
216
- checked={ showLabel }
217
- onChange={ toggleAttribute( 'showLabel' ) }
247
+ label={ __( 'Display as dropdown' ) }
248
+ checked={ displayAsDropdown }
249
+ onChange={ toggleAttribute( 'displayAsDropdown' ) }
218
250
  />
251
+ </ToolsPanelItem>
252
+ { displayAsDropdown && (
253
+ <ToolsPanelItem
254
+ hasValue={ () => ! showLabel }
255
+ label={ __( 'Show label' ) }
256
+ onDeselect={ () =>
257
+ setAttributes( { showLabel: true } )
258
+ }
259
+ isShownByDefault
260
+ >
261
+ <ToggleControl
262
+ __nextHasNoMarginBottom
263
+ className="wp-block-categories__indentation"
264
+ label={ __( 'Show label' ) }
265
+ checked={ showLabel }
266
+ onChange={ toggleAttribute( 'showLabel' ) }
267
+ />
268
+ </ToolsPanelItem>
219
269
  ) }
220
- <ToggleControl
221
- __nextHasNoMarginBottom
270
+ <ToolsPanelItem
271
+ hasValue={ () => !! showPostCounts }
222
272
  label={ __( 'Show post counts' ) }
223
- checked={ showPostCounts }
224
- onChange={ toggleAttribute( 'showPostCounts' ) }
225
- />
226
- { isHierarchicalTaxonomy && (
273
+ onDeselect={ () =>
274
+ setAttributes( { showPostCounts: false } )
275
+ }
276
+ isShownByDefault
277
+ >
227
278
  <ToggleControl
228
279
  __nextHasNoMarginBottom
229
- label={ __( 'Show only top level terms' ) }
230
- checked={ showOnlyTopLevel }
231
- onChange={ toggleAttribute( 'showOnlyTopLevel' ) }
280
+ label={ __( 'Show post counts' ) }
281
+ checked={ showPostCounts }
282
+ onChange={ toggleAttribute( 'showPostCounts' ) }
232
283
  />
284
+ </ToolsPanelItem>
285
+ { isHierarchicalTaxonomy && (
286
+ <ToolsPanelItem
287
+ hasValue={ () => !! showOnlyTopLevel }
288
+ label={ __( 'Show only top level terms' ) }
289
+ onDeselect={ () =>
290
+ setAttributes( { showOnlyTopLevel: false } )
291
+ }
292
+ isShownByDefault
293
+ >
294
+ <ToggleControl
295
+ __nextHasNoMarginBottom
296
+ label={ __( 'Show only top level terms' ) }
297
+ checked={ showOnlyTopLevel }
298
+ onChange={ toggleAttribute(
299
+ 'showOnlyTopLevel'
300
+ ) }
301
+ />
302
+ </ToolsPanelItem>
233
303
  ) }
234
- <ToggleControl
235
- __nextHasNoMarginBottom
304
+ <ToolsPanelItem
305
+ hasValue={ () => !! showEmpty }
236
306
  label={ __( 'Show empty terms' ) }
237
- checked={ showEmpty }
238
- onChange={ toggleAttribute( 'showEmpty' ) }
239
- />
240
- { isHierarchicalTaxonomy && ! showOnlyTopLevel && (
307
+ onDeselect={ () =>
308
+ setAttributes( { showEmpty: false } )
309
+ }
310
+ isShownByDefault
311
+ >
241
312
  <ToggleControl
242
313
  __nextHasNoMarginBottom
243
- label={ __( 'Show hierarchy' ) }
244
- checked={ showHierarchy }
245
- onChange={ toggleAttribute( 'showHierarchy' ) }
314
+ label={ __( 'Show empty terms' ) }
315
+ checked={ showEmpty }
316
+ onChange={ toggleAttribute( 'showEmpty' ) }
246
317
  />
318
+ </ToolsPanelItem>
319
+ { isHierarchicalTaxonomy && ! showOnlyTopLevel && (
320
+ <ToolsPanelItem
321
+ hasValue={ () => !! showHierarchy }
322
+ label={ __( 'Show hierarchy' ) }
323
+ onDeselect={ () =>
324
+ setAttributes( { showHierarchy: false } )
325
+ }
326
+ isShownByDefault
327
+ >
328
+ <ToggleControl
329
+ __nextHasNoMarginBottom
330
+ label={ __( 'Show hierarchy' ) }
331
+ checked={ showHierarchy }
332
+ onChange={ toggleAttribute( 'showHierarchy' ) }
333
+ />
334
+ </ToolsPanelItem>
247
335
  ) }
248
- </PanelBody>
336
+ </ToolsPanel>
249
337
  </InspectorControls>
250
338
  { isResolving && (
251
339
  <Placeholder icon={ pin } label={ __( 'Terms' ) }>
@@ -5,18 +5,15 @@ import { SelectControl } from '@wordpress/components';
5
5
  import { __ } from '@wordpress/i18n';
6
6
  import { InspectorControls } from '@wordpress/block-editor';
7
7
 
8
+ /**
9
+ * Internal dependencies
10
+ */
11
+ import { htmlElementMessages } from '../../utils/messages';
12
+
8
13
  export default function CommentsInspectorControls( {
9
14
  attributes: { tagName },
10
15
  setAttributes,
11
16
  } ) {
12
- const htmlElementMessages = {
13
- section: __(
14
- "The <section> element should represent a standalone portion of the document that can't be better represented by another element."
15
- ),
16
- aside: __(
17
- "The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."
18
- ),
19
- };
20
17
  return (
21
18
  <InspectorControls>
22
19
  <InspectorControls group="advanced">
@@ -18,6 +18,11 @@
18
18
  "default": "none"
19
19
  }
20
20
  },
21
+ "example": {
22
+ "attributes": {
23
+ "paginationArrow": "none"
24
+ }
25
+ },
21
26
  "providesContext": {
22
27
  "comments/paginationArrow": "paginationArrow"
23
28
  },
@@ -36,6 +36,7 @@ import { COVER_MIN_HEIGHT, mediaPosition } from '../shared';
36
36
  import { unlock } from '../../lock-unlock';
37
37
  import { useToolsPanelDropdownMenuProps } from '../../utils/hooks';
38
38
  import { DEFAULT_MEDIA_SIZE_SLUG } from '../constants';
39
+ import { htmlElementMessages } from '../../utils/messages';
39
40
 
40
41
  const { cleanEmptyObject, ResolutionTool } = unlock( blockEditorPrivateApis );
41
42
 
@@ -183,27 +184,6 @@ export default function CoverInspectorControls( {
183
184
 
184
185
  const colorGradientSettings = useMultipleOriginColorsAndGradients();
185
186
 
186
- const htmlElementMessages = {
187
- header: __(
188
- 'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'
189
- ),
190
- main: __(
191
- 'The <main> element should be used for the primary content of your document only.'
192
- ),
193
- section: __(
194
- "The <section> element should represent a standalone portion of the document that can't be better represented by another element."
195
- ),
196
- article: __(
197
- 'The <article> element should represent a self-contained, syndicatable portion of the document.'
198
- ),
199
- aside: __(
200
- "The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."
201
- ),
202
- footer: __(
203
- 'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'
204
- ),
205
- };
206
-
207
187
  const dropdownMenuProps = useToolsPanelDropdownMenuProps();
208
188
 
209
189
  return (
@@ -17,8 +17,17 @@
17
17
  "source": "rich-text",
18
18
  "selector": "summary"
19
19
  },
20
+ "name": {
21
+ "type": "string",
22
+ "source": "attribute",
23
+ "attribute": "name",
24
+ "selector": ".wp-block-details"
25
+ },
20
26
  "allowedBlocks": {
21
27
  "type": "array"
28
+ },
29
+ "placeholder": {
30
+ "type": "string"
22
31
  }
23
32
  },
24
33
  "supports": {
@@ -8,6 +8,7 @@ import {
8
8
  InspectorControls,
9
9
  } from '@wordpress/block-editor';
10
10
  import {
11
+ TextControl,
11
12
  ToggleControl,
12
13
  __experimentalToolsPanel as ToolsPanel,
13
14
  __experimentalToolsPanelItem as ToolsPanelItem,
@@ -30,7 +31,8 @@ const TEMPLATE = [
30
31
  ];
31
32
 
32
33
  function DetailsEdit( { attributes, setAttributes } ) {
33
- const { showContent, summary, allowedBlocks } = attributes;
34
+ const { name, showContent, summary, allowedBlocks, placeholder } =
35
+ attributes;
34
36
  const blockProps = useBlockProps();
35
37
  const innerBlocksProps = useInnerBlocksProps( blockProps, {
36
38
  template: TEMPLATE,
@@ -75,6 +77,20 @@ function DetailsEdit( { attributes, setAttributes } ) {
75
77
  </ToolsPanelItem>
76
78
  </ToolsPanel>
77
79
  </InspectorControls>
80
+ <InspectorControls group="advanced">
81
+ <TextControl
82
+ __next40pxDefaultSize
83
+ __nextHasNoMarginBottom
84
+ label={ __( 'Name attribute' ) }
85
+ value={ name || '' }
86
+ onChange={ ( newName ) =>
87
+ setAttributes( { name: newName } )
88
+ }
89
+ help={ __(
90
+ 'Enables multiple Details blocks with the same name attribute to be connected, with only one open at a time.'
91
+ ) }
92
+ />
93
+ </InspectorControls>
78
94
  <details { ...innerBlocksProps } open={ isOpen }>
79
95
  <summary
80
96
  onClick={ ( event ) => {
@@ -85,7 +101,7 @@ function DetailsEdit( { attributes, setAttributes } ) {
85
101
  <RichText
86
102
  identifier="summary"
87
103
  aria-label={ __( 'Write summary' ) }
88
- placeholder={ __( 'Write summary…' ) }
104
+ placeholder={ placeholder || __( 'Write summary…' ) }
89
105
  allowedFormats={ [] }
90
106
  withoutInteractiveFormatting
91
107
  value={ summary }
@@ -4,12 +4,16 @@
4
4
  import { RichText, useBlockProps, InnerBlocks } from '@wordpress/block-editor';
5
5
 
6
6
  export default function save( { attributes } ) {
7
- const { showContent } = attributes;
7
+ const { name, showContent } = attributes;
8
8
  const summary = attributes.summary ? attributes.summary : 'Details';
9
9
  const blockProps = useBlockProps.save();
10
10
 
11
11
  return (
12
- <details { ...blockProps } open={ showContent }>
12
+ <details
13
+ { ...blockProps }
14
+ name={ name || undefined }
15
+ open={ showContent }
16
+ >
13
17
  <summary>
14
18
  <RichText.Content value={ summary } />
15
19
  </summary>
@@ -7,6 +7,7 @@ import { createBlock } from '@wordpress/blocks';
7
7
  * Internal dependencies
8
8
  */
9
9
  import metadata from './block.json';
10
+ import { removeAspectRatioClasses } from './util';
10
11
 
11
12
  const { name: EMBED_BLOCK } = metadata;
12
13
 
@@ -33,13 +34,14 @@ const transforms = {
33
34
  type: 'block',
34
35
  blocks: [ 'core/paragraph' ],
35
36
  isMatch: ( { url } ) => !! url,
36
- transform: ( { url, caption } ) => {
37
+ transform: ( { url, caption, className } ) => {
37
38
  let value = `<a href="${ url }">${ url }</a>`;
38
39
  if ( caption?.trim() ) {
39
40
  value += `<br />${ caption }`;
40
41
  }
41
42
  return createBlock( 'core/paragraph', {
42
43
  content: value,
44
+ className: removeAspectRatioClasses( className ),
43
45
  } );
44
46
  },
45
47
  },
@@ -61,7 +61,7 @@ const variations = [
61
61
  },
62
62
  {
63
63
  name: 'wp-privacy-form',
64
- title: __( 'Experimental privacy request form' ),
64
+ title: __( 'Experimental Privacy Request Form' ),
65
65
  keywords: [ 'GDPR' ],
66
66
  description: __( 'A form to request data exports and/or deletion.' ),
67
67
  attributes: {
@@ -117,10 +117,6 @@
117
117
  opacity: 0.3;
118
118
  }
119
119
 
120
- .is-selected .block-library-gallery-item__inline-menu {
121
- display: inline-flex;
122
- }
123
-
124
120
  .block-editor-media-placeholder {
125
121
  margin: 0;
126
122
  height: 100%;
@@ -131,58 +127,6 @@
131
127
  }
132
128
  }
133
129
 
134
- .block-library-gallery-item__inline-menu {
135
- display: none;
136
- position: absolute;
137
- top: -2px;
138
- margin: $grid-unit-10;
139
- z-index: z-index(".block-library-gallery-item__inline-menu");
140
- border-radius: $radius-small;
141
- background: $white;
142
- border: $border-width solid $gray-900;
143
-
144
- @media not (prefers-reduced-motion) {
145
- transition: box-shadow 0.2s ease-out;
146
- }
147
-
148
- &:hover {
149
- box-shadow: $elevation-x-small;
150
- }
151
-
152
- @include break-small() {
153
- // Use smaller buttons to fit when there are many columns.
154
- .columns-7 &,
155
- .columns-8 & {
156
- padding: $grid-unit-05 * 0.5;
157
- }
158
- }
159
-
160
- .components-button.has-icon {
161
- &:not(:focus) {
162
- border: none;
163
- box-shadow: none;
164
- }
165
-
166
- @include break-small() {
167
- // Use smaller buttons to fit when there are many columns.
168
- .columns-7 &,
169
- .columns-8 & {
170
- padding: 0;
171
- width: inherit;
172
- height: inherit;
173
- }
174
- }
175
- }
176
-
177
- &.is-left {
178
- left: -2px;
179
- }
180
-
181
- &.is-right {
182
- right: -2px;
183
- }
184
- }
185
-
186
130
  .wp-block-gallery ul.blocks-gallery-grid {
187
131
  padding: 0;
188
132
  // Some themes give all <ul> default margin instead of padding.