@wordpress/block-library 9.15.0 → 9.16.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 (260) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/button/edit.js +2 -1
  3. package/build/button/edit.js.map +1 -1
  4. package/build/columns/edit.js +1 -1
  5. package/build/columns/edit.js.map +1 -1
  6. package/build/columns/edit.native.js +1 -1
  7. package/build/columns/edit.native.js.map +1 -1
  8. package/build/comment-template/edit.js +2 -2
  9. package/build/comment-template/edit.js.map +1 -1
  10. package/build/comments-pagination-next/index.js +7 -6
  11. package/build/comments-pagination-next/index.js.map +1 -1
  12. package/build/comments-pagination-previous/index.js +7 -6
  13. package/build/comments-pagination-previous/index.js.map +1 -1
  14. package/build/cover/deprecated.js +1 -1
  15. package/build/cover/deprecated.js.map +1 -1
  16. package/build/details/edit.js +12 -17
  17. package/build/details/edit.js.map +1 -1
  18. package/build/details/index.js +3 -0
  19. package/build/details/index.js.map +1 -1
  20. package/build/embed/util.js +1 -1
  21. package/build/embed/util.js.map +1 -1
  22. package/build/file/edit.js +7 -4
  23. package/build/file/edit.js.map +1 -1
  24. package/build/file/transforms.js +1 -1
  25. package/build/file/transforms.js.map +1 -1
  26. package/build/file/utils/index.js +1 -1
  27. package/build/file/utils/index.js.map +1 -1
  28. package/build/form-input/edit.js +1 -1
  29. package/build/form-input/edit.js.map +1 -1
  30. package/build/gallery/edit.js +1 -1
  31. package/build/gallery/edit.js.map +1 -1
  32. package/build/gallery/transforms.js +2 -2
  33. package/build/gallery/transforms.js.map +1 -1
  34. package/build/gallery/use-get-new-images.js +1 -1
  35. package/build/gallery/use-get-new-images.js.map +1 -1
  36. package/build/list-item/edit.native.js +2 -2
  37. package/build/list-item/edit.native.js.map +1 -1
  38. package/build/media-text/edit.native.js +2 -2
  39. package/build/media-text/edit.native.js.map +1 -1
  40. package/build/media-text/media-container.native.js +4 -4
  41. package/build/media-text/media-container.native.js.map +1 -1
  42. package/build/navigation/edit/index.js +8 -4
  43. package/build/navigation/edit/index.js.map +1 -1
  44. package/build/navigation/index.js +15 -0
  45. package/build/navigation/index.js.map +1 -1
  46. package/build/navigation-link/edit.js +1 -1
  47. package/build/navigation-link/edit.js.map +1 -1
  48. package/build/navigation-link/link-ui.js +9 -18
  49. package/build/navigation-link/link-ui.js.map +1 -1
  50. package/build/navigation-submenu/edit.js +1 -1
  51. package/build/navigation-submenu/edit.js.map +1 -1
  52. package/build/page-list/index.js +11 -0
  53. package/build/page-list/index.js.map +1 -1
  54. package/build/post-author-name/edit.js +41 -12
  55. package/build/post-author-name/edit.js.map +1 -1
  56. package/build/post-comments-link/index.js +7 -1
  57. package/build/post-comments-link/index.js.map +1 -1
  58. package/build/post-featured-image/overlay-controls.js +2 -1
  59. package/build/post-featured-image/overlay-controls.js.map +1 -1
  60. package/build/query/edit/inspector-controls/author-control.js +1 -1
  61. package/build/query/edit/inspector-controls/author-control.js.map +1 -1
  62. package/build/query/edit/inspector-controls/index.js +110 -61
  63. package/build/query/edit/inspector-controls/index.js.map +1 -1
  64. package/build/query/utils.js +1 -1
  65. package/build/query/utils.js.map +1 -1
  66. package/build/query-title/edit.js +39 -14
  67. package/build/query-title/edit.js.map +1 -1
  68. package/build/query-total/index.js +7 -1
  69. package/build/query-total/index.js.map +1 -1
  70. package/build/quote/transforms.js +1 -1
  71. package/build/quote/transforms.js.map +1 -1
  72. package/build/rss/edit.js +1 -0
  73. package/build/rss/edit.js.map +1 -1
  74. package/build/rss/index.js +6 -0
  75. package/build/rss/index.js.map +1 -1
  76. package/build/search/edit.js +2 -1
  77. package/build/search/edit.js.map +1 -1
  78. package/build/site-logo/edit.js +26 -35
  79. package/build/site-logo/edit.js.map +1 -1
  80. package/build/social-links/edit.js +2 -1
  81. package/build/social-links/edit.js.map +1 -1
  82. package/build/table-of-contents/edit.js +24 -8
  83. package/build/table-of-contents/edit.js.map +1 -1
  84. package/build/video/edit.native.js +3 -3
  85. package/build/video/edit.native.js.map +1 -1
  86. package/build-module/button/edit.js +3 -2
  87. package/build-module/button/edit.js.map +1 -1
  88. package/build-module/columns/edit.js +1 -1
  89. package/build-module/columns/edit.js.map +1 -1
  90. package/build-module/columns/edit.native.js +1 -1
  91. package/build-module/columns/edit.native.js.map +1 -1
  92. package/build-module/comment-template/edit.js +2 -2
  93. package/build-module/comment-template/edit.js.map +1 -1
  94. package/build-module/comments-pagination-next/index.js +7 -6
  95. package/build-module/comments-pagination-next/index.js.map +1 -1
  96. package/build-module/comments-pagination-previous/index.js +7 -6
  97. package/build-module/comments-pagination-previous/index.js.map +1 -1
  98. package/build-module/cover/deprecated.js +1 -1
  99. package/build-module/cover/deprecated.js.map +1 -1
  100. package/build-module/details/edit.js +13 -18
  101. package/build-module/details/edit.js.map +1 -1
  102. package/build-module/details/index.js +3 -0
  103. package/build-module/details/index.js.map +1 -1
  104. package/build-module/embed/util.js +1 -1
  105. package/build-module/embed/util.js.map +1 -1
  106. package/build-module/file/edit.js +7 -4
  107. package/build-module/file/edit.js.map +1 -1
  108. package/build-module/file/transforms.js +1 -1
  109. package/build-module/file/transforms.js.map +1 -1
  110. package/build-module/file/utils/index.js +1 -1
  111. package/build-module/file/utils/index.js.map +1 -1
  112. package/build-module/form-input/edit.js +1 -1
  113. package/build-module/form-input/edit.js.map +1 -1
  114. package/build-module/gallery/edit.js +1 -1
  115. package/build-module/gallery/edit.js.map +1 -1
  116. package/build-module/gallery/transforms.js +2 -2
  117. package/build-module/gallery/transforms.js.map +1 -1
  118. package/build-module/gallery/use-get-new-images.js +1 -1
  119. package/build-module/gallery/use-get-new-images.js.map +1 -1
  120. package/build-module/list-item/edit.native.js +2 -2
  121. package/build-module/list-item/edit.native.js.map +1 -1
  122. package/build-module/media-text/edit.native.js +2 -2
  123. package/build-module/media-text/edit.native.js.map +1 -1
  124. package/build-module/media-text/media-container.native.js +4 -4
  125. package/build-module/media-text/media-container.native.js.map +1 -1
  126. package/build-module/navigation/edit/index.js +8 -4
  127. package/build-module/navigation/edit/index.js.map +1 -1
  128. package/build-module/navigation/index.js +15 -0
  129. package/build-module/navigation/index.js.map +1 -1
  130. package/build-module/navigation-link/edit.js +1 -1
  131. package/build-module/navigation-link/edit.js.map +1 -1
  132. package/build-module/navigation-link/link-ui.js +9 -18
  133. package/build-module/navigation-link/link-ui.js.map +1 -1
  134. package/build-module/navigation-submenu/edit.js +1 -1
  135. package/build-module/navigation-submenu/edit.js.map +1 -1
  136. package/build-module/page-list/index.js +11 -0
  137. package/build-module/page-list/index.js.map +1 -1
  138. package/build-module/post-author-name/edit.js +42 -13
  139. package/build-module/post-author-name/edit.js.map +1 -1
  140. package/build-module/post-comments-link/index.js +7 -1
  141. package/build-module/post-comments-link/index.js.map +1 -1
  142. package/build-module/post-featured-image/overlay-controls.js +2 -1
  143. package/build-module/post-featured-image/overlay-controls.js.map +1 -1
  144. package/build-module/query/edit/inspector-controls/author-control.js +1 -1
  145. package/build-module/query/edit/inspector-controls/author-control.js.map +1 -1
  146. package/build-module/query/edit/inspector-controls/index.js +111 -62
  147. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  148. package/build-module/query/utils.js +1 -1
  149. package/build-module/query/utils.js.map +1 -1
  150. package/build-module/query-title/edit.js +40 -15
  151. package/build-module/query-title/edit.js.map +1 -1
  152. package/build-module/query-total/index.js +7 -1
  153. package/build-module/query-total/index.js.map +1 -1
  154. package/build-module/quote/transforms.js +1 -1
  155. package/build-module/quote/transforms.js.map +1 -1
  156. package/build-module/rss/edit.js +1 -0
  157. package/build-module/rss/edit.js.map +1 -1
  158. package/build-module/rss/index.js +6 -0
  159. package/build-module/rss/index.js.map +1 -1
  160. package/build-module/search/edit.js +3 -2
  161. package/build-module/search/edit.js.map +1 -1
  162. package/build-module/site-logo/edit.js +27 -36
  163. package/build-module/site-logo/edit.js.map +1 -1
  164. package/build-module/social-links/edit.js +2 -1
  165. package/build-module/social-links/edit.js.map +1 -1
  166. package/build-module/table-of-contents/edit.js +25 -9
  167. package/build-module/table-of-contents/edit.js.map +1 -1
  168. package/build-module/video/edit.native.js +3 -3
  169. package/build-module/video/edit.native.js.map +1 -1
  170. package/build-style/editor-rtl.css +6 -43
  171. package/build-style/editor.css +6 -43
  172. package/build-style/freeform/editor-rtl.css +2 -4
  173. package/build-style/freeform/editor.css +2 -4
  174. package/build-style/gallery/editor-rtl.css +2 -4
  175. package/build-style/gallery/editor.css +2 -4
  176. package/build-style/image/style-rtl.css +24 -10
  177. package/build-style/image/style.css +24 -10
  178. package/build-style/navigation/style-rtl.css +8 -6
  179. package/build-style/navigation/style.css +8 -6
  180. package/build-style/query/editor-rtl.css +0 -27
  181. package/build-style/query/editor.css +0 -27
  182. package/build-style/site-logo/editor-rtl.css +2 -8
  183. package/build-style/site-logo/editor.css +2 -8
  184. package/build-style/social-links/style-rtl.css +2 -5
  185. package/build-style/social-links/style.css +2 -5
  186. package/build-style/style-rtl.css +34 -21
  187. package/build-style/style.css +34 -21
  188. package/package.json +35 -35
  189. package/src/audio/test/transforms.native.js +4 -3
  190. package/src/button/edit.js +6 -2
  191. package/src/columns/edit.js +1 -1
  192. package/src/columns/edit.native.js +1 -1
  193. package/src/comment-template/edit.js +2 -2
  194. package/src/comments-pagination-next/block.json +0 -5
  195. package/src/comments-pagination-next/index.js +6 -0
  196. package/src/comments-pagination-previous/block.json +0 -5
  197. package/src/comments-pagination-previous/index.js +6 -0
  198. package/src/cover/deprecated.js +1 -1
  199. package/src/cover/test/__snapshots__/edit.native.js.snap +1 -1
  200. package/src/cover/test/edit.js +7 -7
  201. package/src/cover/test/edit.native.js +2 -2
  202. package/src/cover/test/transforms.native.js +9 -5
  203. package/src/details/block.json +3 -0
  204. package/src/details/edit.js +12 -23
  205. package/src/editor.scss +1 -1
  206. package/src/embed/test/index.js +1 -1
  207. package/src/embed/util.js +1 -1
  208. package/src/file/edit.js +4 -3
  209. package/src/file/test/transforms.native.js +4 -3
  210. package/src/file/transforms.js +1 -1
  211. package/src/file/utils/index.js +1 -1
  212. package/src/form-input/edit.js +1 -1
  213. package/src/freeform/editor.scss +4 -3
  214. package/src/gallery/edit.js +1 -1
  215. package/src/gallery/editor.scss +4 -2
  216. package/src/gallery/test/transforms.native.js +4 -3
  217. package/src/gallery/transforms.js +2 -2
  218. package/src/gallery/use-get-new-images.js +1 -1
  219. package/src/image/block.json +8 -1
  220. package/src/image/editor.scss +1 -1
  221. package/src/image/index.php +9 -13
  222. package/src/image/style.scss +17 -7
  223. package/src/image/test/edit.native.js +1 -1
  224. package/src/image/test/transforms.native.js +4 -3
  225. package/src/list/test/edit.native.js +1 -1
  226. package/src/list-item/edit.native.js +2 -2
  227. package/src/media-text/edit.native.js +2 -2
  228. package/src/media-text/media-container.native.js +4 -4
  229. package/src/media-text/test/transforms.native.js +9 -5
  230. package/src/navigation/edit/index.js +4 -0
  231. package/src/navigation/index.js +20 -0
  232. package/src/navigation/style.scss +7 -4
  233. package/src/navigation-link/edit.js +1 -1
  234. package/src/navigation-link/link-ui.js +7 -13
  235. package/src/navigation-submenu/edit.js +1 -1
  236. package/src/page-list/block.json +11 -0
  237. package/src/paragraph/style.scss +1 -1
  238. package/src/post-author-name/edit.js +53 -15
  239. package/src/post-comments-link/block.json +7 -1
  240. package/src/post-content/block.json +1 -1
  241. package/src/post-featured-image/overlay-controls.js +1 -0
  242. package/src/query/edit/inspector-controls/author-control.js +1 -1
  243. package/src/query/edit/inspector-controls/index.js +148 -88
  244. package/src/query/editor.scss +0 -31
  245. package/src/query/utils.js +1 -1
  246. package/src/query-title/edit.js +60 -19
  247. package/src/query-total/block.json +7 -1
  248. package/src/quote/transforms.js +1 -1
  249. package/src/rss/block.json +6 -0
  250. package/src/rss/edit.js +1 -0
  251. package/src/search/edit.js +6 -2
  252. package/src/separator/deprecated.scss +1 -1
  253. package/src/site-logo/edit.js +34 -47
  254. package/src/site-logo/editor.scss +3 -6
  255. package/src/social-link/index.php +2 -2
  256. package/src/social-links/edit.js +1 -0
  257. package/src/social-links/style.scss +3 -3
  258. package/src/table-of-contents/edit.js +38 -19
  259. package/src/video/edit.native.js +3 -3
  260. package/src/video/test/transforms.native.js +4 -3
@@ -56,7 +56,7 @@ export default function useGetNewImages( images, imageData ) {
56
56
  currentImage.clientId === image.clientId
57
57
  ) &&
58
58
  imageData?.find( ( img ) => img.id === image.id ) &&
59
- ! image.fromSavedConent
59
+ ! image.fromSavedContent
60
60
  );
61
61
 
62
62
  if ( imagesUpdated || newImages?.length > 0 ) {
@@ -4,7 +4,14 @@
4
4
  "name": "core/image",
5
5
  "title": "Image",
6
6
  "category": "media",
7
- "usesContext": [ "allowResize", "imageCrop", "fixedHeight", "postId", "postType", "queryId" ],
7
+ "usesContext": [
8
+ "allowResize",
9
+ "imageCrop",
10
+ "fixedHeight",
11
+ "postId",
12
+ "postType",
13
+ "queryId"
14
+ ],
8
15
  "description": "Insert an image to make a visual statement.",
9
16
  "keywords": [ "img", "photo", "picture" ],
10
17
  "textdomain": "default",
@@ -32,7 +32,7 @@ figure.wp-block-image:not(.wp-block) {
32
32
  }
33
33
  }
34
34
 
35
- // Shown while image is being uploded but cannot be previewed.
35
+ // Shown while image is being uploaded but cannot be previewed.
36
36
  .wp-block-image__placeholder {
37
37
  aspect-ratio: 4 / 3;
38
38
 
@@ -149,18 +149,14 @@ function block_core_image_render_lightbox( $block_content, $block ) {
149
149
  return $block_content;
150
150
  }
151
151
 
152
- $alt = $p->get_attribute( 'alt' );
153
- $img_uploaded_src = $p->get_attribute( 'src' );
154
- $img_class_names = $p->get_attribute( 'class' );
155
- $img_styles = $p->get_attribute( 'style' );
156
- $img_width = 'none';
157
- $img_height = 'none';
158
- $aria_label = __( 'Enlarge image' );
159
-
160
- if ( $alt ) {
161
- /* translators: %s: Image alt text. */
162
- $aria_label = sprintf( __( 'Enlarge image: %s' ), $alt );
163
- }
152
+ $alt = $p->get_attribute( 'alt' );
153
+ $img_uploaded_src = $p->get_attribute( 'src' );
154
+ $img_class_names = $p->get_attribute( 'class' );
155
+ $img_styles = $p->get_attribute( 'style' );
156
+ $img_width = 'none';
157
+ $img_height = 'none';
158
+ $aria_label = __( 'Enlarge' );
159
+ $dialog_aria_label = __( 'Enlarged image' );
164
160
 
165
161
  if ( isset( $block['attrs']['id'] ) ) {
166
162
  $img_uploaded_src = wp_get_attachment_url( $block['attrs']['id'] );
@@ -190,7 +186,7 @@ function block_core_image_render_lightbox( $block_content, $block ) {
190
186
  'targetWidth' => $img_width,
191
187
  'targetHeight' => $img_height,
192
188
  'scaleAttr' => $block['attrs']['scale'] ?? false,
193
- 'ariaLabel' => $aria_label,
189
+ 'ariaLabel' => $dialog_aria_label,
194
190
  'alt' => $alt,
195
191
  ),
196
192
  ),
@@ -11,7 +11,7 @@
11
11
  vertical-align: bottom;
12
12
  box-sizing: border-box;
13
13
 
14
- @media (prefers-reduced-motion: no-preference) {
14
+ @media not (prefers-reduced-motion) {
15
15
  &.hide {
16
16
  visibility: hidden;
17
17
  }
@@ -167,7 +167,9 @@
167
167
  text-align: center;
168
168
  padding: 0;
169
169
  border-radius: 4px;
170
- transition: opacity 0.2s ease;
170
+ @media not (prefers-reduced-motion) {
171
+ transition: opacity 0.2s ease;
172
+ }
171
173
 
172
174
  &:focus-visible {
173
175
  outline: 3px auto rgb(90 90 90 / 25%);
@@ -280,21 +282,29 @@
280
282
  // or faster than the scrim to give a sense of depth.
281
283
  &.active {
282
284
  visibility: visible;
283
- animation: both turn-on-visibility 0.25s;
285
+ @media not (prefers-reduced-motion) {
286
+ animation: both turn-on-visibility 0.25s;
287
+ }
284
288
  img {
285
- animation: both turn-on-visibility 0.35s;
289
+ @media not (prefers-reduced-motion) {
290
+ animation: both turn-on-visibility 0.35s;
291
+ }
286
292
  }
287
293
  }
288
294
  &.show-closing-animation {
289
295
  &:not(.active) {
290
- animation: both turn-off-visibility 0.35s;
296
+ @media not (prefers-reduced-motion) {
297
+ animation: both turn-off-visibility 0.35s;
298
+ }
291
299
  img {
292
- animation: both turn-off-visibility 0.25s;
300
+ @media not (prefers-reduced-motion) {
301
+ animation: both turn-off-visibility 0.25s;
302
+ }
293
303
  }
294
304
  }
295
305
  }
296
306
 
297
- @media (prefers-reduced-motion: no-preference) {
307
+ @media not (prefers-reduced-motion) {
298
308
  &.zoom {
299
309
  &.active {
300
310
  opacity: 1;
@@ -62,7 +62,7 @@ Clipboard.getString.mockImplementation( () => clipboardPromise );
62
62
  beforeAll( () => {
63
63
  registerCoreBlocks();
64
64
 
65
- // Mock Image.getSize to avoid failed attempt to size non-existant image
65
+ // Mock Image.getSize to avoid failed attempt to size non-existent image
66
66
  const getSizeSpy = jest.spyOn( Image, 'getSize' );
67
67
  getSizeSpy.mockImplementation( ( _url, callback ) => callback( 300, 200 ) );
68
68
  } );
@@ -15,12 +15,12 @@ const initialHtml = `
15
15
  <figure class="wp-block-image size-large is-style-default"><a href="https://cldup.com/cXyG__fTLN.jpg"><img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/></a><figcaption class="wp-element-caption">Mountain</figcaption></figure>
16
16
  <!-- /wp:image -->`;
17
17
 
18
- const tranformsWithInnerBlocks = [ 'Gallery', 'Columns', 'Group' ];
18
+ const transformsWithInnerBlocks = [ 'Gallery', 'Columns', 'Group' ];
19
19
  const nonMediaTransforms = [ 'File' ];
20
20
  const blockTransforms = [
21
21
  'Cover',
22
22
  'Media & Text',
23
- ...tranformsWithInnerBlocks,
23
+ ...transformsWithInnerBlocks,
24
24
  ...nonMediaTransforms,
25
25
  ];
26
26
 
@@ -31,7 +31,8 @@ describe( `${ block } block transformations`, () => {
31
31
  const screen = await initializeEditor( { initialHtml } );
32
32
  const newBlock = await transformBlock( screen, block, blockTransform, {
33
33
  isMediaBlock: ! nonMediaTransforms.includes( blockTransform ),
34
- hasInnerBlocks: tranformsWithInnerBlocks.includes( blockTransform ),
34
+ hasInnerBlocks:
35
+ transformsWithInnerBlocks.includes( blockTransform ),
35
36
  } );
36
37
  expect( newBlock ).toBeVisible();
37
38
  expect( getEditorHtml() ).toMatchSnapshot();
@@ -157,7 +157,7 @@ describe( 'List block', () => {
157
157
  fireEvent.press( listBlock );
158
158
  await triggerBlockListLayout( listBlock );
159
159
 
160
- // Select Secont List Item block
160
+ // Select Second List Item block
161
161
  const [ listItemBlock ] = screen.getAllByLabelText(
162
162
  /List item Block\. Row 2/
163
163
  );
@@ -54,7 +54,7 @@ export default function ListItemEdit( {
54
54
  getBlockParentsByBlockName,
55
55
  getBlockRootClientId,
56
56
  } = select( blockEditorStore );
57
- const currentIdentationLevel = getBlockParentsByBlockName(
57
+ const currentIndentationLevel = getBlockParentsByBlockName(
58
58
  clientId,
59
59
  'core/list-item',
60
60
  true
@@ -73,7 +73,7 @@ export default function ListItemEdit( {
73
73
  return {
74
74
  blockIndex: currentBlockIndex,
75
75
  hasInnerBlocks: blockWithInnerBlocks,
76
- indentationLevel: currentIdentationLevel,
76
+ indentationLevel: currentIndentationLevel,
77
77
  numberOfListItems: totalListItems,
78
78
  ordered: isOrdered,
79
79
  reversed: isReversed,
@@ -218,7 +218,7 @@ class MediaTextEdit extends Component {
218
218
  ? ( containerWidth * mediaWidth ) / 100 -
219
219
  styles.mediaAreaPadding.width
220
220
  : containerWidth;
221
- const aligmentStyles =
221
+ const alignmentStyles =
222
222
  styles[
223
223
  `is-vertically-aligned-${ verticalAlignment || 'center' }`
224
224
  ];
@@ -244,7 +244,7 @@ class MediaTextEdit extends Component {
244
244
  imageFill,
245
245
  focalPoint,
246
246
  isSelected,
247
- aligmentStyles,
247
+ alignmentStyles,
248
248
  shouldStack,
249
249
  } }
250
250
  />
@@ -171,7 +171,7 @@ class MediaContainer extends Component {
171
171
  renderImage( params, openMediaOptions ) {
172
172
  const { isUploadInProgress } = this.state;
173
173
  const {
174
- aligmentStyles,
174
+ alignmentStyles,
175
175
  focalPoint,
176
176
  imageFill,
177
177
  isMediaSelected,
@@ -205,7 +205,7 @@ class MediaContainer extends Component {
205
205
  style={ [
206
206
  imageFill && styles.imageCropped,
207
207
  styles.mediaImageContainer,
208
- ! isUploadInProgress && aligmentStyles,
208
+ ! isUploadInProgress && alignmentStyles,
209
209
  ] }
210
210
  >
211
211
  <Image
@@ -232,7 +232,7 @@ class MediaContainer extends Component {
232
232
 
233
233
  renderVideo( params ) {
234
234
  const {
235
- aligmentStyles,
235
+ alignmentStyles,
236
236
  mediaUrl,
237
237
  isSelected,
238
238
  getStylesFromColorScheme,
@@ -261,7 +261,7 @@ class MediaContainer extends Component {
261
261
  onPress={ this.onMediaPressed }
262
262
  disabled={ ! isSelected }
263
263
  >
264
- <View style={ [ styles.videoContainer, aligmentStyles ] }>
264
+ <View style={ [ styles.videoContainer, alignmentStyles ] }>
265
265
  <View
266
266
  style={ [
267
267
  styles.videoContent,
@@ -23,16 +23,16 @@ const initialHtmlWithVideo = `
23
23
  <!-- /wp:paragraph --></div></div>
24
24
  <!-- /wp:media-text -->`;
25
25
 
26
- const tranformsWithInnerBlocks = [ 'Columns', 'Group' ];
26
+ const transformsWithInnerBlocks = [ 'Columns', 'Group' ];
27
27
  const blockTransformsWithImage = [
28
28
  'Image',
29
29
  'Cover',
30
- ...tranformsWithInnerBlocks,
30
+ ...transformsWithInnerBlocks,
31
31
  ];
32
32
  const blockTransformsWithVideo = [
33
33
  'Video',
34
34
  'Cover',
35
- ...tranformsWithInnerBlocks,
35
+ ...transformsWithInnerBlocks,
36
36
  ];
37
37
 
38
38
  setupCoreBlocks();
@@ -52,7 +52,9 @@ describe( `${ block } block transformations`, () => {
52
52
  {
53
53
  isMediaBlock: true,
54
54
  hasInnerBlocks:
55
- tranformsWithInnerBlocks.includes( blockTransform ),
55
+ transformsWithInnerBlocks.includes(
56
+ blockTransform
57
+ ),
56
58
  }
57
59
  );
58
60
  expect( newBlock ).toBeVisible();
@@ -88,7 +90,9 @@ describe( `${ block } block transformations`, () => {
88
90
  {
89
91
  isMediaBlock: true,
90
92
  hasInnerBlocks:
91
- tranformsWithInnerBlocks.includes( blockTransform ),
93
+ transformsWithInnerBlocks.includes(
94
+ blockTransform
95
+ ),
92
96
  }
93
97
  );
94
98
  expect( newBlock ).toBeVisible();
@@ -142,24 +142,28 @@ function ColorTools( {
142
142
  label: __( 'Text' ),
143
143
  onColorChange: setTextColor,
144
144
  resetAllFilter: () => setTextColor(),
145
+ clearable: true,
145
146
  },
146
147
  {
147
148
  colorValue: backgroundColor.color,
148
149
  label: __( 'Background' ),
149
150
  onColorChange: setBackgroundColor,
150
151
  resetAllFilter: () => setBackgroundColor(),
152
+ clearable: true,
151
153
  },
152
154
  {
153
155
  colorValue: overlayTextColor.color,
154
156
  label: __( 'Submenu & overlay text' ),
155
157
  onColorChange: setOverlayTextColor,
156
158
  resetAllFilter: () => setOverlayTextColor(),
159
+ clearable: true,
157
160
  },
158
161
  {
159
162
  colorValue: overlayBackgroundColor.color,
160
163
  label: __( 'Submenu & overlay background' ),
161
164
  onColorChange: setOverlayBackgroundColor,
162
165
  resetAllFilter: () => setOverlayBackgroundColor(),
166
+ clearable: true,
163
167
  },
164
168
  ] }
165
169
  panelId={ clientId }
@@ -3,6 +3,9 @@
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
5
  import { navigation as icon } from '@wordpress/icons';
6
+ import { select } from '@wordpress/data';
7
+ import { store as coreStore } from '@wordpress/core-data';
8
+ import { decodeEntities } from '@wordpress/html-entities';
6
9
 
7
10
  /**
8
11
  * Internal dependencies
@@ -52,6 +55,23 @@ export const settings = {
52
55
  },
53
56
  edit,
54
57
  save,
58
+ __experimentalLabel: ( { ref } ) => {
59
+ if ( ! ref ) {
60
+ return;
61
+ }
62
+
63
+ const navigation = select( coreStore ).getEditedEntityRecord(
64
+ 'postType',
65
+ 'wp_navigation',
66
+ ref
67
+ );
68
+
69
+ if ( ! navigation?.title ) {
70
+ return;
71
+ }
72
+
73
+ return decodeEntities( navigation.title );
74
+ },
55
75
  deprecated,
56
76
  };
57
77
 
@@ -166,7 +166,9 @@ $navigation-icon-size: 24px;
166
166
 
167
167
  // Hide until hover or focus within.
168
168
  opacity: 0;
169
- transition: opacity 0.1s linear;
169
+ @media not (prefers-reduced-motion) {
170
+ transition: opacity 0.1s linear;
171
+ }
170
172
  visibility: hidden;
171
173
 
172
174
  // Don't take up space when the menu is collapsed.
@@ -502,9 +504,10 @@ button.wp-block-navigation-item__content {
502
504
  background-color: inherit;
503
505
 
504
506
  // Animation.
505
- animation: overlay-menu__fade-in-animation 0.1s ease-out;
506
- animation-fill-mode: forwards;
507
- @include reduce-motion("animation");
507
+ @media not (prefers-reduced-motion) {
508
+ animation: overlay-menu__fade-in-animation 0.1s ease-out;
509
+ animation-fill-mode: forwards;
510
+ }
508
511
 
509
512
  // Try to inherit any root paddings set, so the X can align to a top-right aligned menu.
510
513
  padding-top: clamp(1rem, var(--wp--style--root--padding-top), 20rem);
@@ -157,7 +157,7 @@ function getMissingText( type ) {
157
157
  /*
158
158
  * Warning, this duplicated in
159
159
  * packages/block-library/src/navigation-submenu/edit.js
160
- * Consider reuseing this components for both blocks.
160
+ * Consider reusing this components for both blocks.
161
161
  */
162
162
  function Controls( { attributes, setAttributes, setIsLabelFieldFocused } ) {
163
163
  const { label, url, description, title, rel } = attributes;
@@ -78,7 +78,7 @@ export function getSuggestionsQuery( type, kind ) {
78
78
  }
79
79
  }
80
80
 
81
- function LinkUIBlockInserter( { clientId, onBack, onSelectBlock } ) {
81
+ function LinkUIBlockInserter( { clientId, onBack } ) {
82
82
  const { rootBlockClientId } = useSelect(
83
83
  ( select ) => {
84
84
  const { getBlockRootClientId } = select( blockEditorStore );
@@ -96,7 +96,7 @@ function LinkUIBlockInserter( { clientId, onBack, onSelectBlock } ) {
96
96
  LinkControl,
97
97
  `link-ui-block-inserter__title`
98
98
  );
99
- const dialogDescritionId = useInstanceId(
99
+ const dialogDescriptionId = useInstanceId(
100
100
  LinkControl,
101
101
  `link-ui-block-inserter__description`
102
102
  );
@@ -110,13 +110,13 @@ function LinkUIBlockInserter( { clientId, onBack, onSelectBlock } ) {
110
110
  className="link-ui-block-inserter"
111
111
  role="dialog"
112
112
  aria-labelledby={ dialogTitleId }
113
- aria-describedby={ dialogDescritionId }
113
+ aria-describedby={ dialogDescriptionId }
114
114
  ref={ focusOnMountRef }
115
115
  >
116
116
  <VisuallyHidden>
117
117
  <h2 id={ dialogTitleId }>{ __( 'Add block' ) }</h2>
118
118
 
119
- <p id={ dialogDescritionId }>
119
+ <p id={ dialogDescriptionId }>
120
120
  { __( 'Choose a block to add to your Navigation.' ) }
121
121
  </p>
122
122
  </VisuallyHidden>
@@ -140,7 +140,6 @@ function LinkUIBlockInserter( { clientId, onBack, onSelectBlock } ) {
140
140
  prioritizePatterns={ false }
141
141
  selectBlockOnInsert
142
142
  hasSearch={ false }
143
- onSelect={ onSelectBlock }
144
143
  />
145
144
  </div>
146
145
  );
@@ -198,15 +197,11 @@ function UnforwardedLinkUI( props, ref ) {
198
197
  LinkUI,
199
198
  `link-ui-link-control__title`
200
199
  );
201
- const dialogDescritionId = useInstanceId(
200
+ const dialogDescriptionId = useInstanceId(
202
201
  LinkUI,
203
202
  `link-ui-link-control__description`
204
203
  );
205
204
 
206
- // Selecting a block should close the popover and also remove the (previously) automatically inserted
207
- // link block so that the newly selected block can be inserted in its place.
208
- const { onClose: onSelectBlock } = props;
209
-
210
205
  return (
211
206
  <Popover
212
207
  ref={ ref }
@@ -219,12 +214,12 @@ function UnforwardedLinkUI( props, ref ) {
219
214
  <div
220
215
  role="dialog"
221
216
  aria-labelledby={ dialogTitleId }
222
- aria-describedby={ dialogDescritionId }
217
+ aria-describedby={ dialogDescriptionId }
223
218
  >
224
219
  <VisuallyHidden>
225
220
  <h2 id={ dialogTitleId }>{ __( 'Add link' ) }</h2>
226
221
 
227
- <p id={ dialogDescritionId }>
222
+ <p id={ dialogDescriptionId }>
228
223
  { __(
229
224
  'Search for and add a link to your Navigation.'
230
225
  ) }
@@ -287,7 +282,6 @@ function UnforwardedLinkUI( props, ref ) {
287
282
  setAddingBlock( false );
288
283
  setFocusAddBlockButton( true );
289
284
  } }
290
- onSelectBlock={ onSelectBlock }
291
285
  />
292
286
  ) }
293
287
  </Popover>
@@ -276,7 +276,7 @@ export default function NavigationSubmenuEdit( {
276
276
  // as it shares the CMD+K shortcut.
277
277
  // See https://github.com/WordPress/gutenberg/pull/59845.
278
278
  event.preventDefault();
279
- // If we don't stop propogation, this event bubbles up to the parent submenu item
279
+ // If we don't stop propagation, this event bubbles up to the parent submenu item
280
280
  event.stopPropagation();
281
281
  setIsLinkOpen( true );
282
282
  setOpenedBy( ref.current );
@@ -52,6 +52,17 @@
52
52
  "interactivity": {
53
53
  "clientNavigation": true
54
54
  },
55
+ "color": {
56
+ "text": true,
57
+ "background": true,
58
+ "link": true,
59
+ "gradients": true,
60
+ "__experimentalDefaultControls": {
61
+ "background": true,
62
+ "text": true,
63
+ "link": true
64
+ }
65
+ },
55
66
  "__experimentalBorder": {
56
67
  "radius": true,
57
68
  "color": true,
@@ -44,7 +44,7 @@ p.has-drop-cap.has-background {
44
44
  }
45
45
 
46
46
  // Use :where to contain the specificity of this rule
47
- // so it's easily overrideable by any theme that targets
47
+ // so it's easily overridable by any theme that targets
48
48
  // links using the a element.
49
49
  // For example, this is what global styles does.
50
50
  :where(p.has-text-color:not(.has-link-color)) a {
@@ -15,7 +15,16 @@ import {
15
15
  import { useSelect } from '@wordpress/data';
16
16
  import { __, sprintf } from '@wordpress/i18n';
17
17
  import { store as coreStore } from '@wordpress/core-data';
18
- import { PanelBody, ToggleControl } from '@wordpress/components';
18
+ import {
19
+ ToggleControl,
20
+ __experimentalToolsPanel as ToolsPanel,
21
+ __experimentalToolsPanelItem as ToolsPanelItem,
22
+ } from '@wordpress/components';
23
+
24
+ /**
25
+ * Internal dependencies
26
+ */
27
+ import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
19
28
 
20
29
  function PostAuthorNameEdit( {
21
30
  context: { postType, postId },
@@ -61,6 +70,8 @@ function PostAuthorNameEdit( {
61
70
  displayName
62
71
  );
63
72
 
73
+ const dropdownMenuProps = useToolsPanelDropdownMenuProps();
74
+
64
75
  return (
65
76
  <>
66
77
  <BlockControls group="block">
@@ -72,26 +83,53 @@ function PostAuthorNameEdit( {
72
83
  />
73
84
  </BlockControls>
74
85
  <InspectorControls>
75
- <PanelBody title={ __( 'Settings' ) }>
76
- <ToggleControl
77
- __nextHasNoMarginBottom
86
+ <ToolsPanel
87
+ label={ __( 'Settings' ) }
88
+ resetAll={ () => {
89
+ setAttributes( {
90
+ isLink: false,
91
+ linkTarget: '_self',
92
+ } );
93
+ } }
94
+ dropdownMenuProps={ dropdownMenuProps }
95
+ >
96
+ <ToolsPanelItem
78
97
  label={ __( 'Link to author archive' ) }
79
- onChange={ () => setAttributes( { isLink: ! isLink } ) }
80
- checked={ isLink }
81
- />
82
- { isLink && (
98
+ isShownByDefault
99
+ hasValue={ () => isLink }
100
+ onDeselect={ () => setAttributes( { isLink: false } ) }
101
+ >
83
102
  <ToggleControl
84
103
  __nextHasNoMarginBottom
85
- label={ __( 'Open in new tab' ) }
86
- onChange={ ( value ) =>
87
- setAttributes( {
88
- linkTarget: value ? '_blank' : '_self',
89
- } )
104
+ label={ __( 'Link to author archive' ) }
105
+ onChange={ () =>
106
+ setAttributes( { isLink: ! isLink } )
90
107
  }
91
- checked={ linkTarget === '_blank' }
108
+ checked={ isLink }
92
109
  />
110
+ </ToolsPanelItem>
111
+ { isLink && (
112
+ <ToolsPanelItem
113
+ label={ __( 'Open in new tab' ) }
114
+ isShownByDefault
115
+ hasValue={ () => linkTarget !== '_self' }
116
+ onDeselect={ () =>
117
+ setAttributes( { linkTarget: '_self' } )
118
+ }
119
+ >
120
+ <ToggleControl
121
+ __nextHasNoMarginBottom
122
+ label={ __( 'Open in new tab' ) }
123
+ onChange={ ( value ) =>
124
+ setAttributes( {
125
+ linkTarget: value ? '_blank' : '_self',
126
+ } )
127
+ }
128
+ checked={ linkTarget === '_blank' }
129
+ />
130
+ </ToolsPanelItem>
93
131
  ) }
94
- </PanelBody>
132
+ </ToolsPanel>
95
133
  </InspectorControls>
96
134
  <div { ...blockProps }>
97
135
  { supportsAuthor
@@ -47,7 +47,13 @@
47
47
  "radius": true,
48
48
  "color": true,
49
49
  "width": true,
50
- "style": true
50
+ "style": true,
51
+ "__experimentalDefaultControls": {
52
+ "radius": true,
53
+ "color": true,
54
+ "width": true,
55
+ "style": true
56
+ }
51
57
  }
52
58
  },
53
59
  "style": "wp-block-post-comments-link"
@@ -69,4 +69,4 @@
69
69
  },
70
70
  "style": "wp-block-post-content",
71
71
  "editorStyle": "wp-block-post-content-editor"
72
- }
72
+ }
@@ -47,6 +47,7 @@ const Overlay = ( {
47
47
  gradient: undefined,
48
48
  customGradient: undefined,
49
49
  } ),
50
+ clearable: true,
50
51
  },
51
52
  ] }
52
53
  panelId={ clientId }
@@ -30,7 +30,7 @@ function AuthorControl( { value, onChange } ) {
30
30
  const authorsInfo = getEntitiesInfo( authorsList );
31
31
  /**
32
32
  * We need to normalize the value because the block operates on a
33
- * comma(`,`) separated string value and `FormTokenFiels` needs an
33
+ * comma(`,`) separated string value and `FormTokenField` needs an
34
34
  * array.
35
35
  */
36
36
  const normalizedValue = ! value ? [] : value.toString().split( ',' );