@wordpress/block-library 9.6.0 → 9.7.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 (313) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/audio/edit.js +2 -1
  3. package/build/audio/edit.js.map +1 -1
  4. package/build/block/edit.js +3 -5
  5. package/build/block/edit.js.map +1 -1
  6. package/build/button/edit.js +1 -1
  7. package/build/button/edit.js.map +1 -1
  8. package/build/categories/index.js +1 -0
  9. package/build/categories/index.js.map +1 -1
  10. package/build/comment-edit-link/index.js +13 -2
  11. package/build/comment-edit-link/index.js.map +1 -1
  12. package/build/comment-reply-link/index.js +13 -2
  13. package/build/comment-reply-link/index.js.map +1 -1
  14. package/build/comments/edit/comments-legacy.js +4 -1
  15. package/build/comments/edit/comments-legacy.js.map +1 -1
  16. package/build/cover/edit/block-controls.js +4 -2
  17. package/build/cover/edit/block-controls.js.map +1 -1
  18. package/build/cover/edit/index.js +2 -1
  19. package/build/cover/edit/index.js.map +1 -1
  20. package/build/cover/edit/inspector-controls.js +4 -12
  21. package/build/cover/edit/inspector-controls.js.map +1 -1
  22. package/build/details/index.js +3 -1
  23. package/build/details/index.js.map +1 -1
  24. package/build/details/transforms.js +24 -0
  25. package/build/details/transforms.js.map +1 -0
  26. package/build/embed/embed-placeholder.js +8 -2
  27. package/build/embed/embed-placeholder.js.map +1 -1
  28. package/build/file/edit.js +12 -1
  29. package/build/file/edit.js.map +1 -1
  30. package/build/freeform/edit.js +4 -4
  31. package/build/freeform/edit.js.map +1 -1
  32. package/build/freeform/modal.js +12 -3
  33. package/build/freeform/modal.js.map +1 -1
  34. package/build/home-link/edit.js +3 -9
  35. package/build/home-link/edit.js.map +1 -1
  36. package/build/image/edit.js +44 -34
  37. package/build/image/edit.js.map +1 -1
  38. package/build/image/image.js +22 -10
  39. package/build/image/image.js.map +1 -1
  40. package/build/media-text/deprecated.js +144 -3
  41. package/build/media-text/deprecated.js.map +1 -1
  42. package/build/media-text/edit.js +5 -5
  43. package/build/media-text/edit.js.map +1 -1
  44. package/build/media-text/image-fill.js +12 -0
  45. package/build/media-text/image-fill.js.map +1 -0
  46. package/build/media-text/media-container.js +21 -18
  47. package/build/media-text/media-container.js.map +1 -1
  48. package/build/media-text/media-container.native.js +0 -7
  49. package/build/media-text/media-container.native.js.map +1 -1
  50. package/build/media-text/save.js +5 -6
  51. package/build/media-text/save.js.map +1 -1
  52. package/build/missing/edit.js +6 -3
  53. package/build/missing/edit.js.map +1 -1
  54. package/build/navigation/edit/deleted-navigation-warning.js +4 -1
  55. package/build/navigation/edit/deleted-navigation-warning.js.map +1 -1
  56. package/build/navigation/edit/index.js +4 -1
  57. package/build/navigation/edit/index.js.map +1 -1
  58. package/build/navigation/edit/navigation-menu-delete-control.js +4 -1
  59. package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  60. package/build/navigation/edit/placeholder/index.js +4 -1
  61. package/build/navigation/edit/placeholder/index.js.map +1 -1
  62. package/build/navigation/edit/responsive-wrapper.js +8 -2
  63. package/build/navigation/edit/responsive-wrapper.js.map +1 -1
  64. package/build/navigation/edit/unsaved-inner-blocks.js +4 -4
  65. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  66. package/build/navigation-link/link-ui.js +5 -2
  67. package/build/navigation-link/link-ui.js.map +1 -1
  68. package/build/page-list/convert-to-links-modal.js +8 -2
  69. package/build/page-list/convert-to-links-modal.js.map +1 -1
  70. package/build/page-list/edit.js +7 -2
  71. package/build/page-list/edit.js.map +1 -1
  72. package/build/post-comments-form/form.js +4 -1
  73. package/build/post-comments-form/form.js.map +1 -1
  74. package/build/post-featured-image/dimension-controls.js +6 -8
  75. package/build/post-featured-image/dimension-controls.js.map +1 -1
  76. package/build/post-featured-image/edit.js +5 -5
  77. package/build/post-featured-image/edit.js.map +1 -1
  78. package/build/query/edit/enhanced-pagination-modal.js +4 -1
  79. package/build/query/edit/enhanced-pagination-modal.js.map +1 -1
  80. package/build/query/edit/query-placeholder.js +8 -2
  81. package/build/query/edit/query-placeholder.js.map +1 -1
  82. package/build/site-logo/edit.js +15 -15
  83. package/build/site-logo/edit.js.map +1 -1
  84. package/build/social-link/edit.js +4 -1
  85. package/build/social-link/edit.js.map +1 -1
  86. package/build/social-links/edit.js +10 -9
  87. package/build/social-links/edit.js.map +1 -1
  88. package/build/template-part/edit/advanced-controls.js.map +1 -1
  89. package/build/template-part/edit/index.js +1 -1
  90. package/build/template-part/edit/index.js.map +1 -1
  91. package/build/template-part/edit/placeholder.js +8 -2
  92. package/build/template-part/edit/placeholder.js.map +1 -1
  93. package/build/utils/hooks.js +10 -10
  94. package/build/utils/hooks.js.map +1 -1
  95. package/build/video/edit.js +22 -14
  96. package/build/video/edit.js.map +1 -1
  97. package/build/video/tracks-editor.js +12 -3
  98. package/build/video/tracks-editor.js.map +1 -1
  99. package/build-module/audio/edit.js +2 -1
  100. package/build-module/audio/edit.js.map +1 -1
  101. package/build-module/block/edit.js +4 -6
  102. package/build-module/block/edit.js.map +1 -1
  103. package/build-module/button/edit.js +1 -1
  104. package/build-module/button/edit.js.map +1 -1
  105. package/build-module/categories/index.js +1 -0
  106. package/build-module/categories/index.js.map +1 -1
  107. package/build-module/comment-edit-link/index.js +13 -2
  108. package/build-module/comment-edit-link/index.js.map +1 -1
  109. package/build-module/comment-reply-link/index.js +13 -2
  110. package/build-module/comment-reply-link/index.js.map +1 -1
  111. package/build-module/comments/edit/comments-legacy.js +4 -1
  112. package/build-module/comments/edit/comments-legacy.js.map +1 -1
  113. package/build-module/cover/edit/block-controls.js +4 -2
  114. package/build-module/cover/edit/block-controls.js.map +1 -1
  115. package/build-module/cover/edit/index.js +2 -1
  116. package/build-module/cover/edit/index.js.map +1 -1
  117. package/build-module/cover/edit/inspector-controls.js +5 -13
  118. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  119. package/build-module/details/index.js +3 -1
  120. package/build-module/details/index.js.map +1 -1
  121. package/build-module/details/transforms.js +18 -0
  122. package/build-module/details/transforms.js.map +1 -0
  123. package/build-module/embed/embed-placeholder.js +8 -2
  124. package/build-module/embed/embed-placeholder.js.map +1 -1
  125. package/build-module/file/edit.js +12 -1
  126. package/build-module/file/edit.js.map +1 -1
  127. package/build-module/freeform/edit.js +4 -4
  128. package/build-module/freeform/edit.js.map +1 -1
  129. package/build-module/freeform/modal.js +12 -3
  130. package/build-module/freeform/modal.js.map +1 -1
  131. package/build-module/home-link/edit.js +3 -9
  132. package/build-module/home-link/edit.js.map +1 -1
  133. package/build-module/image/edit.js +45 -34
  134. package/build-module/image/edit.js.map +1 -1
  135. package/build-module/image/image.js +23 -11
  136. package/build-module/image/image.js.map +1 -1
  137. package/build-module/media-text/deprecated.js +144 -3
  138. package/build-module/media-text/deprecated.js.map +1 -1
  139. package/build-module/media-text/edit.js +5 -5
  140. package/build-module/media-text/edit.js.map +1 -1
  141. package/build-module/media-text/image-fill.js +6 -0
  142. package/build-module/media-text/image-fill.js.map +1 -0
  143. package/build-module/media-text/media-container.js +21 -17
  144. package/build-module/media-text/media-container.js.map +1 -1
  145. package/build-module/media-text/media-container.native.js +0 -1
  146. package/build-module/media-text/media-container.native.js.map +1 -1
  147. package/build-module/media-text/save.js +5 -6
  148. package/build-module/media-text/save.js.map +1 -1
  149. package/build-module/missing/edit.js +6 -3
  150. package/build-module/missing/edit.js.map +1 -1
  151. package/build-module/navigation/edit/deleted-navigation-warning.js +4 -1
  152. package/build-module/navigation/edit/deleted-navigation-warning.js.map +1 -1
  153. package/build-module/navigation/edit/index.js +4 -1
  154. package/build-module/navigation/edit/index.js.map +1 -1
  155. package/build-module/navigation/edit/navigation-menu-delete-control.js +4 -1
  156. package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  157. package/build-module/navigation/edit/placeholder/index.js +4 -1
  158. package/build-module/navigation/edit/placeholder/index.js.map +1 -1
  159. package/build-module/navigation/edit/responsive-wrapper.js +8 -2
  160. package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
  161. package/build-module/navigation/edit/unsaved-inner-blocks.js +4 -4
  162. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  163. package/build-module/navigation-link/link-ui.js +7 -4
  164. package/build-module/navigation-link/link-ui.js.map +1 -1
  165. package/build-module/page-list/convert-to-links-modal.js +8 -2
  166. package/build-module/page-list/convert-to-links-modal.js.map +1 -1
  167. package/build-module/page-list/edit.js +7 -2
  168. package/build-module/page-list/edit.js.map +1 -1
  169. package/build-module/post-comments-form/form.js +4 -1
  170. package/build-module/post-comments-form/form.js.map +1 -1
  171. package/build-module/post-featured-image/dimension-controls.js +6 -8
  172. package/build-module/post-featured-image/dimension-controls.js.map +1 -1
  173. package/build-module/post-featured-image/edit.js +6 -6
  174. package/build-module/post-featured-image/edit.js.map +1 -1
  175. package/build-module/query/edit/enhanced-pagination-modal.js +4 -1
  176. package/build-module/query/edit/enhanced-pagination-modal.js.map +1 -1
  177. package/build-module/query/edit/query-placeholder.js +8 -2
  178. package/build-module/query/edit/query-placeholder.js.map +1 -1
  179. package/build-module/site-logo/edit.js +16 -16
  180. package/build-module/site-logo/edit.js.map +1 -1
  181. package/build-module/social-link/edit.js +4 -1
  182. package/build-module/social-link/edit.js.map +1 -1
  183. package/build-module/social-links/edit.js +11 -10
  184. package/build-module/social-links/edit.js.map +1 -1
  185. package/build-module/template-part/edit/advanced-controls.js.map +1 -1
  186. package/build-module/template-part/edit/index.js +1 -1
  187. package/build-module/template-part/edit/index.js.map +1 -1
  188. package/build-module/template-part/edit/placeholder.js +8 -2
  189. package/build-module/template-part/edit/placeholder.js.map +1 -1
  190. package/build-module/utils/hooks.js +10 -10
  191. package/build-module/utils/hooks.js.map +1 -1
  192. package/build-module/video/edit.js +22 -15
  193. package/build-module/video/edit.js.map +1 -1
  194. package/build-module/video/tracks-editor.js +12 -3
  195. package/build-module/video/tracks-editor.js.map +1 -1
  196. package/build-style/button/editor-rtl.css +0 -4
  197. package/build-style/button/editor.css +0 -4
  198. package/build-style/buttons/editor-rtl.css +0 -3
  199. package/build-style/buttons/editor.css +0 -3
  200. package/build-style/comment-edit-link/style-rtl.css +94 -0
  201. package/build-style/comment-edit-link/style.css +94 -0
  202. package/build-style/comment-reply-link/style-rtl.css +94 -0
  203. package/build-style/comment-reply-link/style.css +94 -0
  204. package/build-style/comments-pagination/editor-rtl.css +2 -2
  205. package/build-style/comments-pagination/editor.css +2 -2
  206. package/build-style/cover/editor-rtl.css +0 -6
  207. package/build-style/cover/editor.css +0 -6
  208. package/build-style/editor-rtl.css +24 -68
  209. package/build-style/editor.css +24 -70
  210. package/build-style/group/editor-rtl.css +0 -1
  211. package/build-style/group/editor.css +0 -1
  212. package/build-style/image/editor-rtl.css +0 -1
  213. package/build-style/image/editor.css +0 -1
  214. package/build-style/media-text/editor-rtl.css +3 -1
  215. package/build-style/media-text/editor.css +3 -1
  216. package/build-style/media-text/style-rtl.css +20 -0
  217. package/build-style/media-text/style.css +20 -0
  218. package/build-style/navigation/editor-rtl.css +0 -1
  219. package/build-style/navigation/editor.css +0 -1
  220. package/build-style/post-featured-image/style-rtl.css +1 -1
  221. package/build-style/post-featured-image/style.css +1 -1
  222. package/build-style/query-pagination/editor-rtl.css +2 -16
  223. package/build-style/query-pagination/editor.css +2 -18
  224. package/build-style/query-pagination/style-rtl.css +0 -11
  225. package/build-style/query-pagination/style.css +0 -13
  226. package/build-style/site-title/editor-rtl.css +0 -4
  227. package/build-style/site-title/editor.css +0 -4
  228. package/build-style/social-links/editor-rtl.css +17 -0
  229. package/build-style/social-links/editor.css +17 -0
  230. package/build-style/style-rtl.css +29 -12
  231. package/build-style/style.css +29 -14
  232. package/build-style/video/editor-rtl.css +0 -29
  233. package/build-style/video/editor.css +0 -29
  234. package/package.json +35 -35
  235. package/src/audio/edit.js +1 -0
  236. package/src/block/edit.js +6 -4
  237. package/src/button/edit.js +1 -1
  238. package/src/button/editor.scss +0 -5
  239. package/src/buttons/editor.scss +0 -6
  240. package/src/categories/block.json +1 -0
  241. package/src/categories/index.php +13 -2
  242. package/src/comment-date/index.php +1 -1
  243. package/src/comment-edit-link/block.json +13 -2
  244. package/src/comment-edit-link/style.scss +4 -0
  245. package/src/comment-reply-link/block.json +13 -2
  246. package/src/comment-reply-link/style.scss +4 -0
  247. package/src/comments/edit/comments-legacy.js +2 -0
  248. package/src/comments-pagination/editor.scss +1 -1
  249. package/src/cover/edit/block-controls.js +2 -0
  250. package/src/cover/edit/index.js +1 -0
  251. package/src/cover/edit/inspector-controls.js +3 -15
  252. package/src/cover/editor.scss +0 -5
  253. package/src/cover/test/edit.js +30 -26
  254. package/src/details/index.js +2 -0
  255. package/src/details/transforms.js +26 -0
  256. package/src/embed/embed-placeholder.js +12 -2
  257. package/src/file/edit.js +11 -0
  258. package/src/form/index.php +2 -2
  259. package/src/freeform/edit.js +4 -4
  260. package/src/freeform/editor.scss +1 -1
  261. package/src/freeform/modal.js +10 -1
  262. package/src/gallery/editor.scss +1 -1
  263. package/src/group/editor.scss +0 -1
  264. package/src/home-link/edit.js +4 -7
  265. package/src/image/edit.js +42 -30
  266. package/src/image/editor.scss +0 -3
  267. package/src/image/image.js +75 -53
  268. package/src/media-text/deprecated.js +159 -3
  269. package/src/media-text/edit.js +5 -5
  270. package/src/media-text/editor.scss +3 -1
  271. package/src/media-text/image-fill.js +11 -0
  272. package/src/media-text/index.php +53 -43
  273. package/src/media-text/media-container.js +25 -25
  274. package/src/media-text/media-container.native.js +0 -2
  275. package/src/media-text/save.js +9 -13
  276. package/src/media-text/style.scss +21 -0
  277. package/src/media-text/test/image-fill.js +19 -0
  278. package/src/missing/edit.js +9 -3
  279. package/src/navigation/edit/deleted-navigation-warning.js +8 -1
  280. package/src/navigation/edit/index.js +2 -0
  281. package/src/navigation/edit/navigation-menu-delete-control.js +2 -0
  282. package/src/navigation/edit/placeholder/index.js +2 -0
  283. package/src/navigation/edit/responsive-wrapper.js +4 -0
  284. package/src/navigation/edit/unsaved-inner-blocks.js +4 -4
  285. package/src/navigation/editor.scss +6 -3
  286. package/src/navigation-link/link-ui.js +5 -3
  287. package/src/page-list/convert-to-links-modal.js +8 -1
  288. package/src/page-list/edit.js +7 -1
  289. package/src/page-list/index.php +3 -1
  290. package/src/post-comments-form/form.js +2 -0
  291. package/src/post-date/index.php +3 -3
  292. package/src/post-featured-image/dimension-controls.js +4 -4
  293. package/src/post-featured-image/edit.js +4 -6
  294. package/src/post-featured-image/style.scss +1 -1
  295. package/src/query/edit/enhanced-pagination-modal.js +6 -1
  296. package/src/query/edit/query-placeholder.js +4 -0
  297. package/src/query-pagination/editor.scss +1 -21
  298. package/src/query-pagination/style.scss +0 -15
  299. package/src/site-logo/edit.js +13 -20
  300. package/src/site-title/editor.scss +0 -4
  301. package/src/social-link/edit.js +2 -0
  302. package/src/social-links/edit.js +17 -10
  303. package/src/social-links/editor.scss +24 -5
  304. package/src/style.scss +2 -0
  305. package/src/tag-cloud/index.php +7 -2
  306. package/src/template-part/edit/advanced-controls.js +0 -1
  307. package/src/template-part/edit/index.js +12 -10
  308. package/src/template-part/edit/placeholder.js +8 -1
  309. package/src/utils/hooks.js +11 -11
  310. package/src/video/edit.js +26 -21
  311. package/src/video/editor.scss +0 -45
  312. package/src/video/tracks-editor.js +6 -0
  313. package/src/media-text/test/media-container.js +0 -24
@@ -134,8 +134,7 @@ const DimensionControls = ( {
134
134
  panelId={ clientId }
135
135
  >
136
136
  <SelectControl
137
- // TODO: Switch to `true` (40px size) if possible
138
- __next40pxDefaultSize={ false }
137
+ __next40pxDefaultSize
139
138
  __nextHasNoMarginBottom
140
139
  label={ __( 'Aspect ratio' ) }
141
140
  value={ aspectRatio }
@@ -157,6 +156,7 @@ const DimensionControls = ( {
157
156
  panelId={ clientId }
158
157
  >
159
158
  <UnitControl
159
+ __next40pxDefaultSize
160
160
  label={ __( 'Height' ) }
161
161
  labelPosition="top"
162
162
  value={ height || '' }
@@ -179,6 +179,7 @@ const DimensionControls = ( {
179
179
  panelId={ clientId }
180
180
  >
181
181
  <UnitControl
182
+ __next40pxDefaultSize
182
183
  label={ __( 'Width' ) }
183
184
  labelPosition="top"
184
185
  value={ width || '' }
@@ -235,8 +236,7 @@ const DimensionControls = ( {
235
236
  panelId={ clientId }
236
237
  >
237
238
  <SelectControl
238
- // TODO: Switch to `true` (40px size) if possible
239
- __next40pxDefaultSize={ false }
239
+ __next40pxDefaultSize
240
240
  __nextHasNoMarginBottom
241
241
  label={ __( 'Resolution' ) }
242
242
  value={ sizeSlug || DEFAULT_SIZE }
@@ -10,7 +10,6 @@ import { isBlobURL } from '@wordpress/blob';
10
10
  import { useEntityProp, store as coreStore } from '@wordpress/core-data';
11
11
  import { useSelect, useDispatch } from '@wordpress/data';
12
12
  import {
13
- MenuItem,
14
13
  ToggleControl,
15
14
  PanelBody,
16
15
  Placeholder,
@@ -309,6 +308,8 @@ export default function PostFeaturedImageEdit( {
309
308
  mediaLibraryButton={ ( { open } ) => {
310
309
  return (
311
310
  <Button
311
+ // TODO: Switch to `true` (40px size) if possible
312
+ __next40pxDefaultSize={ false }
312
313
  icon={ upload }
313
314
  variant="primary"
314
315
  label={ label }
@@ -366,11 +367,8 @@ export default function PostFeaturedImageEdit( {
366
367
  accept="image/*"
367
368
  onSelect={ onSelectImage }
368
369
  onError={ onUploadError }
369
- >
370
- <MenuItem onClick={ () => setFeaturedImage( 0 ) }>
371
- { __( 'Reset' ) }
372
- </MenuItem>
373
- </MediaReplaceFlow>
370
+ onReset={ () => setFeaturedImage( 0 ) }
371
+ />
374
372
  </BlockControls>
375
373
  ) }
376
374
  <figure { ...blockProps }>
@@ -5,7 +5,7 @@
5
5
  display: block;
6
6
  height: 100%;
7
7
  }
8
- img {
8
+ :where(img) {
9
9
  max-width: 100%;
10
10
  width: 100%;
11
11
  height: auto;
@@ -75,7 +75,12 @@ export default function EnhancedPaginationModal( {
75
75
  >
76
76
  <VStack alignment="right" spacing={ 5 }>
77
77
  <span id={ modalDescriptionId }>{ notice }</span>
78
- <Button variant="primary" onClick={ closeModal }>
78
+ <Button
79
+ // TODO: Switch to `true` (40px size) if possible
80
+ __next40pxDefaultSize={ false }
81
+ variant="primary"
82
+ onClick={ closeModal }
83
+ >
79
84
  { __( 'OK' ) }
80
85
  </Button>
81
86
  </VStack>
@@ -79,6 +79,8 @@ export default function QueryPlaceholder( {
79
79
  >
80
80
  { !! hasPatterns && (
81
81
  <Button
82
+ // TODO: Switch to `true` (40px size) if possible
83
+ __next40pxDefaultSize={ false }
82
84
  variant="primary"
83
85
  onClick={ openPatternSelectionModal }
84
86
  >
@@ -87,6 +89,8 @@ export default function QueryPlaceholder( {
87
89
  ) }
88
90
 
89
91
  <Button
92
+ // TODO: Switch to `true` (40px size) if possible
93
+ __next40pxDefaultSize={ false }
90
94
  variant="secondary"
91
95
  onClick={ () => {
92
96
  setIsStartingBlank( true );
@@ -1,11 +1,9 @@
1
- $pagination-margin: 0.5em;
2
-
3
1
  // Center flex items. This has an equivalent in style.scss.
4
2
  .wp-block[data-align="center"] > .wp-block-query-pagination {
5
3
  justify-content: center;
6
4
  }
7
5
 
8
- .editor-styles-wrapper {
6
+ :where(.editor-styles-wrapper) {
9
7
  .wp-block-query-pagination {
10
8
  max-width: 100%;
11
9
  &.block-editor-block-list__layout {
@@ -14,21 +12,3 @@ $pagination-margin: 0.5em;
14
12
  }
15
13
  }
16
14
 
17
- .wp-block-query-pagination {
18
- > .wp-block-query-pagination-next,
19
- > .wp-block-query-pagination-previous,
20
- > .wp-block-query-pagination-numbers {
21
- // Override editor auto block margins.
22
- margin-left: 0;
23
- margin-top: $pagination-margin;
24
-
25
- /*rtl:ignore*/
26
- margin-right: $pagination-margin;
27
- margin-bottom: $pagination-margin;
28
-
29
- &:last-child {
30
- /*rtl:ignore*/
31
- margin-right: 0;
32
- }
33
- }
34
- }
@@ -1,19 +1,4 @@
1
- $pagination-margin: 0.5em;
2
1
  .wp-block-query-pagination {
3
- // Increased specificity to override blocks default margin.
4
- > .wp-block-query-pagination-next,
5
- > .wp-block-query-pagination-previous,
6
- > .wp-block-query-pagination-numbers {
7
- /*rtl:ignore*/
8
- margin-right: $pagination-margin;
9
- margin-bottom: $pagination-margin;
10
-
11
- &:last-child {
12
- /*rtl:ignore*/
13
- margin-right: 0;
14
- }
15
- }
16
-
17
2
  // This moves the next link to the right side of the container,
18
3
  // which is important when it's the only block displayed
19
4
  // and the block has a "space-between" justification.
@@ -14,7 +14,6 @@ import {
14
14
  } from '@wordpress/element';
15
15
  import { __, isRTL } from '@wordpress/i18n';
16
16
  import {
17
- MenuItem,
18
17
  PanelBody,
19
18
  RangeControl,
20
19
  ResizableBox,
@@ -356,22 +355,11 @@ function SiteLogoReplaceFlow( {
356
355
  return (
357
356
  <MediaReplaceFlow
358
357
  { ...mediaReplaceProps }
358
+ mediaURL={ mediaURL }
359
359
  allowedTypes={ ALLOWED_MEDIA_TYPES }
360
360
  accept={ ACCEPT_MEDIA_STRING }
361
- >
362
- { ( { onClose } ) =>
363
- mediaURL && (
364
- <MenuItem
365
- onClick={ () => {
366
- onRemoveLogo();
367
- onClose();
368
- } }
369
- >
370
- { __( 'Reset' ) }
371
- </MenuItem>
372
- )
373
- }
374
- </MediaReplaceFlow>
361
+ onReset={ onRemoveLogo }
362
+ />
375
363
  );
376
364
  }
377
365
 
@@ -435,7 +423,7 @@ export default function LogoEdit( {
435
423
  context: 'view',
436
424
  } );
437
425
  const _isRequestingMediaItem =
438
- _siteLogoId &&
426
+ !! _siteLogoId &&
439
427
  ! select( coreStore ).hasFinishedResolution( 'getMedia', [
440
428
  _siteLogoId,
441
429
  { context: 'view' },
@@ -639,6 +627,8 @@ export default function LogoEdit( {
639
627
  render={ ( { open } ) => (
640
628
  <div className="block-library-site-logo__inspector-upload-container">
641
629
  <Button
630
+ // TODO: Switch to `true` (40px size) if possible
631
+ __next40pxDefaultSize={ false }
642
632
  onClick={ open }
643
633
  variant="secondary"
644
634
  >
@@ -664,16 +654,17 @@ export default function LogoEdit( {
664
654
  { controls }
665
655
  { mediaInspectorPanel }
666
656
  { ( !! logoUrl || !! temporaryURL ) && logoImage }
667
- { ! temporaryURL && ! logoUrl && ! canUserEdit && (
668
- <Placeholder className="site-logo_placeholder">
669
- { !! isLoading && (
657
+ { ( isLoading ||
658
+ ( ! temporaryURL && ! logoUrl && ! canUserEdit ) ) && (
659
+ <Placeholder className="site-logo_placeholder" withIllustration>
660
+ { isLoading && (
670
661
  <span className="components-placeholder__preview">
671
662
  <Spinner />
672
663
  </span>
673
664
  ) }
674
665
  </Placeholder>
675
666
  ) }
676
- { ! temporaryURL && ! logoUrl && canUserEdit && (
667
+ { ! isLoading && ! temporaryURL && ! logoUrl && canUserEdit && (
677
668
  <MediaPlaceholder
678
669
  onSelect={ onInitialSelectLogo }
679
670
  accept={ ACCEPT_MEDIA_STRING }
@@ -683,6 +674,8 @@ export default function LogoEdit( {
683
674
  mediaLibraryButton={ ( { open } ) => {
684
675
  return (
685
676
  <Button
677
+ // TODO: Switch to `true` (40px size) if possible
678
+ __next40pxDefaultSize={ false }
686
679
  icon={ upload }
687
680
  variant="primary"
688
681
  label={ __( 'Choose logo' ) }
@@ -2,7 +2,3 @@
2
2
  padding: 1em 0;
3
3
  border: 1px dashed;
4
4
  }
5
-
6
- .editor-styles-wrapper :where(.wp-block-site-title a) {
7
- color: inherit;
8
- }
@@ -81,6 +81,8 @@ const SocialLinkURLPopover = ( {
81
81
  />
82
82
  </div>
83
83
  <Button
84
+ // TODO: Switch to `true` (40px size) if possible
85
+ __next40pxDefaultSize={ false }
84
86
  icon={ keyboardReturn }
85
87
  label={ __( 'Apply' ) }
86
88
  type="submit"
@@ -14,8 +14,10 @@ import {
14
14
  InspectorControls,
15
15
  ContrastChecker,
16
16
  withColors,
17
+ InnerBlocks,
17
18
  __experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,
18
19
  __experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,
20
+ store as blockEditorStore,
19
21
  } from '@wordpress/block-editor';
20
22
  import {
21
23
  MenuGroup,
@@ -26,6 +28,7 @@ import {
26
28
  } from '@wordpress/components';
27
29
  import { __ } from '@wordpress/i18n';
28
30
  import { check } from '@wordpress/icons';
31
+ import { useSelect } from '@wordpress/data';
29
32
 
30
33
  const sizeOptions = [
31
34
  { name: __( 'Small' ), value: 'has-small-icon-size' },
@@ -55,14 +58,22 @@ export function SocialLinksEdit( props ) {
55
58
  size,
56
59
  } = attributes;
57
60
 
61
+ const hasSelectedChild = useSelect(
62
+ ( select ) =>
63
+ select( blockEditorStore ).hasSelectedInnerBlock( clientId ),
64
+ [ clientId ]
65
+ );
66
+
67
+ const hasAnySelected = isSelected || hasSelectedChild;
68
+
58
69
  const logosOnly = attributes.className?.includes( 'is-style-logos-only' );
59
70
 
60
71
  // Remove icon background color when logos only style is selected or
61
72
  // restore it when any other style is selected.
62
- const backgroundBackup = useRef( {} );
73
+ const backgroundBackupRef = useRef( {} );
63
74
  useEffect( () => {
64
75
  if ( logosOnly ) {
65
- backgroundBackup.current = {
76
+ backgroundBackupRef.current = {
66
77
  iconBackgroundColor,
67
78
  iconBackgroundColorValue,
68
79
  customIconBackgroundColor,
@@ -73,8 +84,9 @@ export function SocialLinksEdit( props ) {
73
84
  iconBackgroundColorValue: undefined,
74
85
  } );
75
86
  } else {
76
- setAttributes( { ...backgroundBackup.current } );
87
+ setAttributes( { ...backgroundBackupRef.current } );
77
88
  }
89
+ // eslint-disable-next-line react-hooks/exhaustive-deps
78
90
  }, [ logosOnly ] );
79
91
 
80
92
  const SocialPlaceholder = (
@@ -87,12 +99,6 @@ export function SocialLinksEdit( props ) {
87
99
  </li>
88
100
  );
89
101
 
90
- const SelectedSocialPlaceholder = (
91
- <li className="wp-block-social-links__social-prompt">
92
- { __( 'Click plus to add' ) }
93
- </li>
94
- );
95
-
96
102
  // Fallback color values are used maintain selections in case switching
97
103
  // themes and named colors in palette do not match.
98
104
  const className = clsx( size, {
@@ -104,10 +110,11 @@ export function SocialLinksEdit( props ) {
104
110
 
105
111
  const blockProps = useBlockProps( { className } );
106
112
  const innerBlocksProps = useInnerBlocksProps( blockProps, {
107
- placeholder: isSelected ? SelectedSocialPlaceholder : SocialPlaceholder,
113
+ placeholder: ! isSelected && SocialPlaceholder,
108
114
  templateLock: false,
109
115
  orientation: attributes.layout?.orientation ?? 'horizontal',
110
116
  __experimentalAppenderTagName: 'li',
117
+ renderAppender: hasAnySelected && InnerBlocks.ButtonBlockAppender,
111
118
  } );
112
119
 
113
120
  const POPOVER_PROPS = {
@@ -1,11 +1,10 @@
1
1
  // Editor specific styles for Social Links.
2
- .wp-block-social-links {
3
- div.block-editor-url-input {
4
- display: inline-block;
5
- margin-left: $grid-unit-10;
6
- }
2
+ .wp-block-social-links div.block-editor-url-input {
3
+ display: inline-block;
4
+ margin-left: $grid-unit-10;
7
5
  }
8
6
 
7
+
9
8
  // Prevent toolbar from jumping when selecting / hovering a link.
10
9
  .wp-social-link:hover {
11
10
  transform: none;
@@ -98,3 +97,23 @@
98
97
  .wp-social-link.wp-social-link__is-incomplete:focus {
99
98
  opacity: 1;
100
99
  }
100
+
101
+ .wp-block-social-links .block-list-appender {
102
+ position: static; // display inline.
103
+
104
+ .block-editor-button-block-appender.components-button.components-button {
105
+ padding: $grid-unit-10 - 2px;
106
+ }
107
+ }
108
+
109
+ .wp-block-social-links {
110
+ &.has-small-icon-size .block-editor-button-block-appender.components-button.components-button {
111
+ padding: 0;
112
+ }
113
+ &.has-large-icon-size .block-editor-button-block-appender.components-button.components-button {
114
+ padding: $grid-unit-20 - 2px;
115
+ }
116
+ &.has-huge-icon-size .block-editor-button-block-appender.components-button.components-button {
117
+ padding: $grid-unit-30 - 1px;
118
+ }
119
+ }
package/src/style.scss CHANGED
@@ -13,6 +13,8 @@
13
13
  @import "./comment-date/style.scss";
14
14
  @import "./comment-content/style.scss";
15
15
  @import "./comment-author-name/style.scss";
16
+ @import "./comment-edit-link/style.scss";
17
+ @import "./comment-reply-link/style.scss";
16
18
  @import "./cover/style.scss";
17
19
  @import "./details/style.scss";
18
20
  @import "./embed/style.scss";
@@ -29,8 +29,13 @@ function render_block_core_tag_cloud( $attributes ) {
29
29
  );
30
30
  $tag_cloud = wp_tag_cloud( $args );
31
31
 
32
- if ( ! $tag_cloud ) {
33
- $tag_cloud = __( 'There&#8217;s no content to show here yet.' );
32
+ if ( empty( $tag_cloud ) ) {
33
+ // Display placeholder content when there are no tags only in editor.
34
+ if ( wp_is_serving_rest_request() ) {
35
+ $tag_cloud = __( 'There&#8217;s no content to show here yet.' );
36
+ } else {
37
+ return '';
38
+ }
34
39
  }
35
40
 
36
41
  $wrapper_attributes = get_block_wrapper_attributes();
@@ -82,7 +82,6 @@ export function TemplatePartAdvancedControls( {
82
82
  } }
83
83
  onFocus={ ( event ) => event.target.select() }
84
84
  />
85
-
86
85
  <SelectControl
87
86
  __next40pxDefaultSize
88
87
  __nextHasNoMarginBottom
@@ -254,16 +254,18 @@ export default function TemplatePartEdit( {
254
254
  </ToolbarButton>
255
255
  </BlockControls>
256
256
  ) }
257
- <InspectorControls group="advanced">
258
- <TemplatePartAdvancedControls
259
- tagName={ tagName }
260
- setAttributes={ setAttributes }
261
- isEntityAvailable={ isEntityAvailable }
262
- templatePartId={ templatePartId }
263
- defaultWrapper={ areaObject.tagName }
264
- hasInnerBlocks={ hasInnerBlocks }
265
- />
266
- </InspectorControls>
257
+ { canUserEdit && (
258
+ <InspectorControls group="advanced">
259
+ <TemplatePartAdvancedControls
260
+ tagName={ tagName }
261
+ setAttributes={ setAttributes }
262
+ isEntityAvailable={ isEntityAvailable }
263
+ templatePartId={ templatePartId }
264
+ defaultWrapper={ areaObject.tagName }
265
+ hasInnerBlocks={ hasInnerBlocks }
266
+ />
267
+ </InspectorControls>
268
+ ) }
267
269
  { isPlaceholder && (
268
270
  <TagName { ...blockProps }>
269
271
  <TemplatePartPlaceholder
@@ -74,13 +74,20 @@ export default function TemplatePartPlaceholder( {
74
74
 
75
75
  { ! isResolving &&
76
76
  !! ( templateParts.length || blockPatterns.length ) && (
77
- <Button variant="primary" onClick={ onOpenSelectionModal }>
77
+ <Button
78
+ // TODO: Switch to `true` (40px size) if possible
79
+ __next40pxDefaultSize={ false }
80
+ variant="primary"
81
+ onClick={ onOpenSelectionModal }
82
+ >
78
83
  { __( 'Choose' ) }
79
84
  </Button>
80
85
  ) }
81
86
 
82
87
  { ! isResolving && isBlockBasedTheme && canCreateTemplatePart && (
83
88
  <Button
89
+ // TODO: Switch to `true` (40px size) if possible
90
+ __next40pxDefaultSize={ false }
84
91
  variant="secondary"
85
92
  onClick={ () => {
86
93
  setShowTitleModal( true );
@@ -37,36 +37,36 @@ export function useCanEditEntity( kind, name, recordId ) {
37
37
  * @param {Function} args.onError Function called when an error happens.
38
38
  */
39
39
  export function useUploadMediaFromBlobURL( args = {} ) {
40
- const latestArgs = useRef( args );
41
- const hasUploadStarted = useRef( false );
40
+ const latestArgsRef = useRef( args );
41
+ const hasUploadStartedRef = useRef( false );
42
42
  const { getSettings } = useSelect( blockEditorStore );
43
43
 
44
44
  useLayoutEffect( () => {
45
- latestArgs.current = args;
45
+ latestArgsRef.current = args;
46
46
  } );
47
47
 
48
48
  useEffect( () => {
49
49
  // Uploading is a special effect that can't be canceled via the cleanup method.
50
50
  // The extra check avoids duplicate uploads in development mode (React.StrictMode).
51
- if ( hasUploadStarted.current ) {
51
+ if ( hasUploadStartedRef.current ) {
52
52
  return;
53
53
  }
54
54
  if (
55
- ! latestArgs.current.url ||
56
- ! isBlobURL( latestArgs.current.url )
55
+ ! latestArgsRef.current.url ||
56
+ ! isBlobURL( latestArgsRef.current.url )
57
57
  ) {
58
58
  return;
59
59
  }
60
60
 
61
- const file = getBlobByURL( latestArgs.current.url );
61
+ const file = getBlobByURL( latestArgsRef.current.url );
62
62
  if ( ! file ) {
63
63
  return;
64
64
  }
65
65
 
66
- const { url, allowedTypes, onChange, onError } = latestArgs.current;
66
+ const { url, allowedTypes, onChange, onError } = latestArgsRef.current;
67
67
  const { mediaUpload } = getSettings();
68
68
 
69
- hasUploadStarted.current = true;
69
+ hasUploadStartedRef.current = true;
70
70
 
71
71
  mediaUpload( {
72
72
  filesList: [ file ],
@@ -78,12 +78,12 @@ export function useUploadMediaFromBlobURL( args = {} ) {
78
78
 
79
79
  revokeBlobURL( url );
80
80
  onChange( media );
81
- hasUploadStarted.current = false;
81
+ hasUploadStartedRef.current = false;
82
82
  },
83
83
  onError: ( message ) => {
84
84
  revokeBlobURL( url );
85
85
  onError( message );
86
- hasUploadStarted.current = false;
86
+ hasUploadStartedRef.current = false;
87
87
  },
88
88
  } );
89
89
  }, [ getSettings ] );
package/src/video/edit.js CHANGED
@@ -42,23 +42,6 @@ import TracksEditor from './tracks-editor';
42
42
  import Tracks from './tracks';
43
43
  import { Caption } from '../utils/caption';
44
44
 
45
- // Much of this description is duplicated from MediaPlaceholder.
46
- const placeholder = ( content ) => {
47
- return (
48
- <Placeholder
49
- className="block-editor-media-placeholder"
50
- withIllustration
51
- icon={ icon }
52
- label={ __( 'Video' ) }
53
- instructions={ __(
54
- 'Upload a video file, pick one from your media library, or add one with a URL.'
55
- ) }
56
- >
57
- { content }
58
- </Placeholder>
59
- );
60
- };
61
-
62
45
  const ALLOWED_MEDIA_TYPES = [ 'video' ];
63
46
  const VIDEO_POSTER_ALLOWED_MEDIA_TYPES = [ 'image' ];
64
47
 
@@ -149,6 +132,23 @@ function VideoEdit( {
149
132
  createErrorNotice( message, { type: 'snackbar' } );
150
133
  }
151
134
 
135
+ // Much of this description is duplicated from MediaPlaceholder.
136
+ const placeholder = ( content ) => {
137
+ return (
138
+ <Placeholder
139
+ className="block-editor-media-placeholder"
140
+ withIllustration={ ! isSingleSelected }
141
+ icon={ icon }
142
+ label={ __( 'Video' ) }
143
+ instructions={ __(
144
+ 'Upload a video file, pick one from your media library, or add one with a URL.'
145
+ ) }
146
+ >
147
+ { content }
148
+ </Placeholder>
149
+ );
150
+ };
151
+
152
152
  const classes = clsx( className, {
153
153
  'is-transient': !! temporaryURL,
154
154
  } );
@@ -208,6 +208,7 @@ function VideoEdit( {
208
208
  onSelect={ onSelectVideo }
209
209
  onSelectURL={ onSelectURL }
210
210
  onError={ onUploadError }
211
+ onReset={ () => onSelectVideo( undefined ) }
211
212
  />
212
213
  </BlockControls>
213
214
  </>
@@ -231,6 +232,8 @@ function VideoEdit( {
231
232
  }
232
233
  render={ ( { open } ) => (
233
234
  <Button
235
+ // TODO: Switch to `true` (40px size) if possible
236
+ __next40pxDefaultSize={ false }
234
237
  variant="primary"
235
238
  onClick={ open }
236
239
  ref={ posterImageButton }
@@ -259,6 +262,8 @@ function VideoEdit( {
259
262
  </p>
260
263
  { !! poster && (
261
264
  <Button
265
+ // TODO: Switch to `true` (40px size) if possible
266
+ __next40pxDefaultSize={ false }
262
267
  onClick={ onRemovePoster }
263
268
  variant="tertiary"
264
269
  >
@@ -271,10 +276,10 @@ function VideoEdit( {
271
276
  </InspectorControls>
272
277
  <figure { ...blockProps }>
273
278
  { /*
274
- Disable the video tag if the block is not selected
275
- so the user clicking on it won't play the
276
- video when the controls are enabled.
277
- */ }
279
+ Disable the video tag if the block is not selected
280
+ so the user clicking on it won't play the
281
+ video when the controls are enabled.
282
+ */ }
278
283
  <Disabled isDisabled={ ! isSingleSelected }>
279
284
  <video
280
285
  controls={ controls }
@@ -1,40 +1,3 @@
1
- // Provide special styling for the placeholder.
2
- // @todo this particular minimal style of placeholder could be componentized further.
3
- .wp-block-video.wp-block-video {
4
- // Show Placeholder style on-select.
5
- &.is-selected .components-placeholder {
6
- // Block UI appearance.
7
- color: $gray-900;
8
- background-color: $white;
9
- box-shadow: inset 0 0 0 $border-width $gray-900;
10
- border: none;
11
-
12
- // @todo this should eventually be overridden by a custom border-radius set in the inspector.
13
- border-radius: $radius-block-ui;
14
-
15
- > svg {
16
- opacity: 0;
17
- }
18
-
19
- .components-placeholder__illustration {
20
- display: none;
21
- }
22
-
23
- &::before {
24
- opacity: 0;
25
- }
26
- }
27
-
28
- // Remove the transition while we still have a legacy placeholder style.
29
- // Otherwise the content jumps between the 1px placeholder border, and any inherited custom
30
- // parent border that may get applied when you deselect.
31
- .components-placeholder__label,
32
- .components-placeholder__instructions,
33
- .components-button {
34
- transition: none;
35
- }
36
- }
37
-
38
1
  .wp-block[data-align="center"] > .wp-block-video {
39
2
  text-align: center;
40
3
  }
@@ -85,7 +48,6 @@
85
48
 
86
49
  .block-library-video-tracks-editor > .components-popover__content {
87
50
  width: 360px;
88
- padding: 0;
89
51
  }
90
52
 
91
53
  .block-library-video-tracks-editor__track-list,
@@ -94,10 +56,3 @@
94
56
  padding: 0;
95
57
  }
96
58
  }
97
-
98
- .block-library-video-tracks-editor__single-track-editor,
99
- .block-library-video-tracks-editor__track-list,
100
- .block-library-video-tracks-editor__add-tracks-container {
101
- padding: $grid-unit-15;
102
- }
103
-